Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Butil/Bit.Butil.Demo/Client/Docs/DocsNav.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public static class DocsNav
]),
new("DOM & Interaction", "dom",
[
new("Element", "element", "Attributes, scrolling, fullscreen, pointer capture and events on any ElementReference.", typeof(ElementPage), ApiSupport.Broad, ApiNeeds.None,
["ElementReferenceExtensions", "ElementReferenceEventExtensions", "ElementReferenceMediaExtensions"]),
new("Element", "element", "Attributes, ARIA, classes, content, scrolling, fullscreen, pointer capture and events on any ElementReference.", typeof(ElementPage), ApiSupport.Broad, ApiNeeds.None,
["ElementReferenceExtensions", "ElementReferenceDomExtensions", "ElementReferenceStateExtensions", "ElementReferenceAriaExtensions", "ElementReferenceEventExtensions", "ElementReferenceMediaExtensions"]),
new("Animation", "animation", "Run and control Web Animations on any element, straight from C#.", typeof(AnimationPage), ApiSupport.Broad, ApiNeeds.None,
["ElementReferenceAnimationExtensions", "AnimationHandle"]),
new("PictureInPicture", "picture-in-picture", "Float a video in an always-on-top window outside the page.", typeof(PictureInPicturePage), ApiSupport.Broad, ApiNeeds.UserGesture),
Expand Down
629 changes: 629 additions & 0 deletions src/Butil/Bit.Butil.Demo/Client/Pages/ElementPage.razor

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/Butil/Bit.Butil/Internals/Element/AriaNotifyJsOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Bit.Butil;

internal class AriaNotifyJsOptions
{
public string Priority { get; set; } = default!;
}
14 changes: 14 additions & 0 deletions src/Butil/Bit.Butil/Internals/Element/CheckVisibilityJsOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Bit.Butil;

internal class CheckVisibilityJsOptions
{
public bool? ContentVisibilityAuto { get; set; }

public bool? OpacityProperty { get; set; }

public bool? VisibilityProperty { get; set; }

public bool? CheckOpacity { get; set; }

public bool? CheckVisibilityCSS { get; set; }
}
8 changes: 8 additions & 0 deletions src/Butil/Bit.Butil/Internals/Element/FocusJsOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Bit.Butil;

internal class FocusJsOptions
{
public bool? PreventScroll { get; set; }

public bool? FocusVisible { get; set; }
}
6 changes: 6 additions & 0 deletions src/Butil/Bit.Butil/Internals/Element/GetHtmlJsOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Bit.Butil;

internal class GetHtmlJsOptions
{
public bool? SerializableShadowRoots { get; set; }
}
20 changes: 20 additions & 0 deletions src/Butil/Bit.Butil/Publics/Element/AriaNotifyOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Bit.Butil;

/// <summary>
/// How an <see cref="ElementReferenceAriaExtensions.AriaNotify(Microsoft.AspNetCore.Components.ElementReference, string, AriaNotifyOptions?)"/>
/// announcement should be queued.
/// </summary>
public class AriaNotifyOptions
{
/// <summary>Where the announcement goes in the queue. Defaults to <see cref="AriaNotifyPriority.Normal"/>.</summary>
public AriaNotifyPriority? Priority { get; set; }

internal AriaNotifyJsOptions ToJsObject() => new()
{
Priority = Priority switch
{
AriaNotifyPriority.High => "high",
_ => "normal"
}
};
}
11 changes: 11 additions & 0 deletions src/Butil/Bit.Butil/Publics/Element/AriaNotifyPriority.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Bit.Butil;

/// <summary>Where an <c>ariaNotify</c> announcement goes in the screen reader's queue.</summary>
public enum AriaNotifyPriority
{
/// <summary>Announced after whatever the screen reader is already saying. The default.</summary>
Normal,

/// <summary>Interrupts the current announcement. For things the user must hear now.</summary>
High
}
26 changes: 26 additions & 0 deletions src/Butil/Bit.Butil/Publics/Element/Autocapitalize.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace Bit.Butil;

/// <summary>How a virtual keyboard should capitalize what the user types into the element.</summary>
public enum Autocapitalize
{
/// <summary>The attribute is absent, so the element inherits the behaviour of its form or document.</summary>
NotSet,

/// <summary>No automatic capitalization.</summary>
None,

/// <summary>The historical spelling of <see cref="None"/>, still accepted.</summary>
Off,

/// <summary>The historical spelling of <see cref="Sentences"/>, still accepted.</summary>
On,

/// <summary>Capitalize the first letter of each sentence. The default for most inputs.</summary>
Sentences,

/// <summary>Capitalize the first letter of every word.</summary>
Words,

/// <summary>Capitalize every letter.</summary>
Characters
}
34 changes: 34 additions & 0 deletions src/Butil/Bit.Butil/Publics/Element/CheckVisibilityOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace Bit.Butil;

/// <summary>
/// Which of the several reasons an element can be invisible
/// <see cref="ElementReferenceExtensions.CheckVisibility(Microsoft.AspNetCore.Components.ElementReference, CheckVisibilityOptions?)"/>
/// should take into account. Everything left null uses the browser's default, which is to consider
/// only whether the element is rendered at all.
/// </summary>
public class CheckVisibilityOptions
{
/// <summary>True to report an element inside a <c>content-visibility: auto</c> subtree that is currently skipped as invisible.</summary>
public bool? ContentVisibilityAuto { get; set; }

/// <summary>True to report an element with <c>opacity: 0</c> - on itself or on an ancestor - as invisible.</summary>
public bool? OpacityProperty { get; set; }

/// <summary>True to report an element hidden by <c>visibility: hidden</c> or <c>collapse</c> as invisible.</summary>
public bool? VisibilityProperty { get; set; }

/// <summary>The earlier spelling of <see cref="OpacityProperty"/>, still accepted by shipped engines.</summary>
public bool? CheckOpacity { get; set; }

/// <summary>The earlier spelling of <see cref="VisibilityProperty"/>, still accepted by shipped engines.</summary>
public bool? CheckVisibilityCSS { get; set; }

internal CheckVisibilityJsOptions ToJsObject() => new()
{
ContentVisibilityAuto = ContentVisibilityAuto,
OpacityProperty = OpacityProperty,
VisibilityProperty = VisibilityProperty,
CheckOpacity = CheckOpacity,
CheckVisibilityCSS = CheckVisibilityCSS
};
}
17 changes: 17 additions & 0 deletions src/Butil/Bit.Butil/Publics/Element/ElementPopover.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Bit.Butil;

/// <summary>The popover behaviour of an element - the values of its <c>popover</c> attribute.</summary>
public enum ElementPopover
{
/// <summary>Not a popover.</summary>
NotSet,

/// <summary>Light-dismissed: opening it closes other auto popovers, and clicking away or pressing Escape closes it.</summary>
Auto,

/// <summary>Closed only by the code that opened it. Several can be open at once.</summary>
Manual,

/// <summary>Light-dismissed like <see cref="Auto"/>, but does not close other popovers - for tooltips over an open menu.</summary>
Hint
}
Loading
Loading