@aurodesignsystem-dev/auro-formkit 0.0.0-pr1492.4 → 0.0.0-pr1493.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
- package/components/bibtemplate/dist/index.js +9 -1
- package/components/bibtemplate/dist/registered.js +9 -1
- package/components/checkbox/demo/css-only.html +57 -0
- package/components/checkbox/demo/css-only.md +146 -0
- package/components/checkbox/demo/customize.min.js +2 -2
- package/components/checkbox/demo/getting-started.min.js +2 -2
- package/components/checkbox/demo/index.min.js +2 -2
- package/components/checkbox/demo/pages.json +1 -1
- package/components/checkbox/demo/styles.min.css +1 -1
- package/components/checkbox/demo/why-checkbox.html +57 -0
- package/components/checkbox/demo/why-checkbox.md +86 -0
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/css-only.html +57 -0
- package/components/combobox/demo/css-only.md +209 -0
- package/components/combobox/demo/customize.md +7 -3
- package/components/combobox/demo/customize.min.js +1846 -1804
- package/components/combobox/demo/getting-started.min.js +1846 -1804
- package/components/combobox/demo/index.min.js +1846 -1804
- package/components/combobox/demo/pages.json +1 -1
- package/components/combobox/demo/styles.min.css +1 -1
- package/components/combobox/demo/why-combobox.html +57 -0
- package/components/combobox/demo/why-combobox.md +113 -0
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +796 -179
- package/components/combobox/dist/registered.js +796 -179
- package/components/counter/demo/css-only.html +57 -0
- package/components/counter/demo/css-only.md +184 -0
- package/components/counter/demo/customize.min.js +276 -16
- package/components/counter/demo/index.min.js +276 -16
- package/components/counter/demo/keyboard-behavior.md +1 -0
- package/components/counter/demo/pages.json +1 -1
- package/components/counter/demo/styles.min.css +1 -1
- package/components/counter/demo/why-counter.html +57 -0
- package/components/counter/demo/why-counter.md +108 -0
- package/components/counter/dist/index.js +5457 -193
- package/components/counter/dist/registered.js +5457 -193
- package/components/datepicker/demo/accessibility.md +54 -3
- package/components/datepicker/demo/api.md +65 -55
- package/components/datepicker/demo/css-only.html +57 -0
- package/components/datepicker/demo/css-only.md +151 -0
- package/components/datepicker/demo/customize.html +2 -0
- package/components/datepicker/demo/customize.js +19 -0
- package/components/datepicker/demo/customize.md +474 -298
- package/components/datepicker/demo/customize.min.js +36243 -0
- package/components/datepicker/demo/design.md +5 -3
- package/components/datepicker/demo/getting-started.md +6 -6
- package/components/datepicker/demo/index.js +5 -1
- package/components/datepicker/demo/index.md +113 -16
- package/components/datepicker/demo/index.min.js +2736 -398
- package/components/datepicker/demo/keyboard-behavior.md +201 -2
- package/components/datepicker/demo/pages.json +1 -1
- package/components/datepicker/demo/styles.min.css +1 -1
- package/components/datepicker/demo/voiceover.md +21 -12
- package/components/datepicker/demo/why-datepicker.html +57 -0
- package/components/datepicker/demo/why-datepicker.md +133 -0
- package/components/datepicker/dist/index.js +2650 -399
- package/components/datepicker/dist/registered.js +2650 -399
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +116 -14
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +54 -1
- package/components/datepicker/dist/src/auro-calendar.d.ts +264 -0
- package/components/datepicker/dist/src/auro-datepicker.d.ts +189 -53
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
- package/components/datepicker/dist/src/utilities.d.ts +0 -14
- package/components/dropdown/demo/accessibility.md +11 -0
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/css-only.html +57 -0
- package/components/dropdown/demo/css-only.md +219 -0
- package/components/dropdown/demo/customize.md +3 -0
- package/components/dropdown/demo/customize.min.js +265 -13
- package/components/dropdown/demo/getting-started.min.js +265 -13
- package/components/dropdown/demo/index.min.js +265 -13
- package/components/dropdown/demo/keyboard-behavior.md +1 -0
- package/components/dropdown/demo/pages.json +1 -1
- package/components/dropdown/demo/styles.min.css +1 -1
- package/components/dropdown/demo/why-dropdown.html +57 -0
- package/components/dropdown/demo/why-dropdown.md +97 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +36 -1
- package/components/dropdown/dist/index.js +265 -13
- package/components/dropdown/dist/registered.js +265 -13
- package/components/form/demo/css-only.html +57 -0
- package/components/form/demo/css-only.md +156 -0
- package/components/form/demo/customize.min.js +11085 -8074
- package/components/form/demo/getting-started.min.js +11085 -8074
- package/components/form/demo/index.min.js +11085 -8074
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +11084 -8073
- package/components/form/demo/styles.min.css +1 -1
- package/components/form/demo/why-form.html +57 -0
- package/components/form/demo/why-form.md +101 -0
- package/components/input/demo/css-only.html +57 -0
- package/components/input/demo/css-only.md +199 -0
- package/components/input/demo/customize.md +625 -636
- package/components/input/demo/customize.min.js +150 -75
- package/components/input/demo/getting-started.md +16 -6
- package/components/input/demo/getting-started.min.js +150 -75
- package/components/input/demo/index.min.js +150 -75
- package/components/input/demo/pages.json +1 -1
- package/components/input/demo/styles.min.css +1 -1
- package/components/input/demo/why-input.html +57 -0
- package/components/input/demo/why-input.md +121 -0
- package/components/input/dist/auro-input-util.d.ts +1 -1
- package/components/input/dist/base-input.d.ts +16 -0
- package/components/input/dist/index.js +150 -75
- package/components/input/dist/registered.js +150 -75
- package/components/input/dist/utilities.d.ts +1 -2
- package/components/menu/demo/api.md +41 -45
- package/components/menu/demo/css-only.html +57 -0
- package/components/menu/demo/css-only.md +166 -0
- package/components/menu/demo/customize.md +0 -28
- package/components/menu/demo/index.min.js +779 -1354
- package/components/menu/demo/pages.json +1 -1
- package/components/menu/demo/styles.min.css +1 -1
- package/components/menu/demo/why-menu.html +57 -0
- package/components/menu/demo/why-menu.md +104 -0
- package/components/menu/dist/auro-menu.d.ts +95 -110
- package/components/menu/dist/auro-menuoption.d.ts +32 -138
- package/components/menu/dist/index.js +753 -1308
- package/components/menu/dist/registered.js +765 -1308
- package/components/radio/demo/css-only.html +57 -0
- package/components/radio/demo/css-only.md +151 -0
- package/components/radio/demo/customize.min.js +1764 -0
- package/components/radio/demo/demo-support.min.js +55807 -0
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/getting-started.min.js +1783 -0
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/demo/pages.json +1 -1
- package/components/radio/demo/styles.min.css +1 -1
- package/components/radio/demo/why-radio.html +57 -0
- package/components/radio/demo/why-radio.md +92 -0
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/api.md +1 -0
- package/components/select/demo/css-only.html +57 -0
- package/components/select/demo/css-only.md +203 -0
- package/components/select/demo/customize.md +78 -3
- package/components/select/demo/customize.min.js +1341 -1533
- package/components/select/demo/getting-started.min.js +1341 -1533
- package/components/select/demo/index.min.js +1341 -1533
- package/components/select/demo/keyboard-behavior.md +19 -0
- package/components/select/demo/pages.json +1 -1
- package/components/select/demo/styles.min.css +1 -1
- package/components/select/demo/why-select.html +57 -0
- package/components/select/demo/why-select.md +128 -0
- package/components/select/dist/auro-select.d.ts +38 -2
- package/components/select/dist/index.js +435 -52
- package/components/select/dist/registered.js +435 -52
- package/components/select/dist/selectUtils.d.ts +12 -0
- package/custom-elements.json +3051 -2553
- package/package.json +8 -8
- package/components/menu/dist/auro-menu.context.d.ts +0 -238
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<auro-header level="1">CSS only with native disclosure</auro-header>
|
|
2
|
+
<p>For situations where the <code><auro-dropdown></code> web component cannot be used, a native HTML <code><details></code>/<code><summary></code> element can be styled with the Auro Design System tokens to approximate the visual appearance of <code>auro-dropdown</code>. Unlike <auro-hyperlink href="https://auro.alaskaair.com/components/auro/hyperlink/css-only" target="_blank">auro-hyperlink</auro-hyperlink>, <auro-hyperlink href="https://alaskaairlines.github.io/WebCoreStyleSheets/" target="_blank">Web Core Style Sheets</auro-hyperlink> does not provide a prebuilt <code>.dropdown</code> class, so the styling must be authored manually using Auro design tokens.</p>
|
|
3
|
+
<auro-header level="2">Styling a native disclosure</auro-header>
|
|
4
|
+
<p>The native <code><details></code>/<code><summary></code> pair can be reset and restyled with the Auro design tokens published by <auro-hyperlink href="https://alaskaairlines.github.io/WebCoreStyleSheets/" target="_blank">@aurodesignsystem/design-tokens</auro-hyperlink>. The pattern below replicates the trigger border, spacing, and panel colors used by <code>auro-dropdown</code>.</p>
|
|
5
|
+
<pre><code>@import "./node_modules/@aurodesignsystem/design-tokens/dist/tokens/CSSCustomProperties.css";
|
|
6
|
+
|
|
7
|
+
.dropdown {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: inline-block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dropdown > summary {
|
|
13
|
+
list-style: none;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--ds-size-100, 0.5rem);
|
|
18
|
+
padding: var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem);
|
|
19
|
+
border: 1px solid var(--ds-color-border-ui-default, #6e767f);
|
|
20
|
+
border-radius: var(--ds-border-radius, 4px);
|
|
21
|
+
background-color: var(--ds-color-container-primary-default, #ffffff);
|
|
22
|
+
color: var(--ds-color-text-primary-default, #1d1d1d);
|
|
23
|
+
font-family: var(--ds-font-family-default, sans-serif);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dropdown > summary::-webkit-details-marker {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dropdown > summary::after {
|
|
31
|
+
content: "";
|
|
32
|
+
width: var(--ds-size-150, 0.75rem);
|
|
33
|
+
height: var(--ds-size-150, 0.75rem);
|
|
34
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
background-position: center;
|
|
37
|
+
transition: transform 150ms ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dropdown[open] > summary::after {
|
|
41
|
+
transform: rotate(180deg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dropdown > summary:focus-visible {
|
|
45
|
+
outline: 2px solid var(--ds-color-border-active-default, #01426a);
|
|
46
|
+
outline-offset: 2px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dropdown-bib {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: calc(100% + var(--ds-size-50, 0.25rem));
|
|
52
|
+
left: 0;
|
|
53
|
+
z-index: 1;
|
|
54
|
+
min-width: 100%;
|
|
55
|
+
padding: var(--ds-size-100, 0.5rem);
|
|
56
|
+
border: 1px solid var(--ds-color-border-ui-default, #6e767f);
|
|
57
|
+
border-radius: var(--ds-border-radius, 4px);
|
|
58
|
+
background-color: var(--ds-color-container-primary-default, #ffffff);
|
|
59
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
60
|
+
}</code></pre>
|
|
61
|
+
<auro-header level="3">Basic disclosure</auro-header>
|
|
62
|
+
<p>Apply the <code>.dropdown</code> class to a <code><details></code> element with a <code><summary></code> trigger and a panel container:</p>
|
|
63
|
+
<pre><code><details class="dropdown">
|
|
64
|
+
<summary>More options</summary>
|
|
65
|
+
<div class="dropdown-bib">
|
|
66
|
+
<p>Panel content goes here.</p>
|
|
67
|
+
</div>
|
|
68
|
+
</details></code></pre>
|
|
69
|
+
<auro-header level="3">Disclosure with a list of actions</auro-header>
|
|
70
|
+
<p>The panel can hold any markup. For a menu-like list, author the items as a plain unordered list:</p>
|
|
71
|
+
<pre><code><details class="dropdown">
|
|
72
|
+
<summary>Account</summary>
|
|
73
|
+
<div class="dropdown-bib">
|
|
74
|
+
<ul>
|
|
75
|
+
<li><a href="/profile">Profile</a></li>
|
|
76
|
+
<li><a href="/settings">Settings</a></li>
|
|
77
|
+
<li><a href="/logout">Log out</a></li>
|
|
78
|
+
</ul>
|
|
79
|
+
</div>
|
|
80
|
+
</details></code></pre>
|
|
81
|
+
<auro-header level="2">What you lose without auro-dropdown</auro-header>
|
|
82
|
+
<p>While the CSS above replicates the <strong>visual styling</strong> of <code>auro-dropdown</code>, the following functionality built into the <code>auro-dropdown</code> web component is <strong>not available</strong> when using plain HTML:</p>
|
|
83
|
+
<auro-header level="3">Floating-UI positioning</auro-header>
|
|
84
|
+
<p><code>auro-dropdown</code> uses Floating UI to position the bib relative to the trigger and supports a <code>placement</code> attribute with twelve values (<code>top</code>, <code>right</code>, <code>bottom</code>, <code>left</code>, and their <code>-start</code>/<code>-end</code> variants). A native <code><details></code> panel is absolutely positioned by the author and does not adapt to alternate placements without additional CSS for each case.</p>
|
|
85
|
+
<auro-header level="3">Auto-placement and flip</auro-header>
|
|
86
|
+
<p><code>auro-dropdown</code> exposes <code>autoPlacement</code> and the inverse <code>noFlip</code> option so the bib can automatically pick the side of the trigger with the most available space and flip when it would otherwise be clipped by the viewport. A CSS-only panel stays where it is authored and will overflow the viewport when there is not enough room.</p>
|
|
87
|
+
<auro-header level="3">Shift to stay on-screen</auro-header>
|
|
88
|
+
<p><code>auro-dropdown</code> supports a <code>shift</code> attribute that nudges the bib along its axis so it remains fully visible inside the viewport. Native disclosures have no equivalent — a panel positioned with CSS that runs past the viewport edge is simply clipped or causes horizontal scroll.</p>
|
|
89
|
+
<auro-header level="3">Match-width and offset control</auro-header>
|
|
90
|
+
<p><code>auro-dropdown</code> exposes <code>matchWidth</code> to size the bib to the trigger and a numeric <code>offset</code> for the gap between trigger and bib. With native HTML, both must be implemented manually with CSS and, in the case of dynamic trigger widths, JavaScript measurement.</p>
|
|
91
|
+
<auro-header level="3">Mobile fullscreen behavior</auro-header>
|
|
92
|
+
<p><code>auro-dropdown</code> supports a <code>fullscreenBreakpoint</code> (defaulting to <code>sm</code>) that switches the bib into a fullscreen presentation on small viewports, and a <code>desktopModal</code> option for modal behavior on larger viewports. Native <code><details></code> has no responsive presentation — the panel renders the same way on every screen size.</p>
|
|
93
|
+
<auro-header level="3">Hover trigger</auro-header>
|
|
94
|
+
<p><code>auro-dropdown</code> supports a <code>hoverToggle</code> attribute that opens the bib on mouseover and closes it on mouseout. Native <code><details></code> only responds to click on the <code><summary></code>; hover-to-open requires custom JavaScript.</p>
|
|
95
|
+
<auro-header level="3">Focus management</auro-header>
|
|
96
|
+
<p><code>auro-dropdown</code> provides a <code>focus()</code> method that moves focus to the first focusable element inside the bib when it is open, or to the trigger when it is closed. It also supports <code>focusShow</code> to open the bib on trigger focus. Native <code><details></code> leaves focus on the <code><summary></code> after toggle and offers no built-in focus-into-panel behavior.</p>
|
|
97
|
+
<auro-header level="3">Click-outside and focus-loss dismissal</auro-header>
|
|
98
|
+
<p><code>auro-dropdown</code> closes the bib when the user clicks outside the component or moves focus out of it, and exposes <code>noHideOnThisFocusLoss</code> to opt out. Native <code><details></code> stays open until the <code><summary></code> is clicked again — click-outside and focus-out dismissal must be wired up manually.</p>
|
|
99
|
+
<auro-header level="3">Keyboard handling</auro-header>
|
|
100
|
+
<p><code>auro-dropdown</code> includes a keyboard strategy for arrow-key navigation, <code>Escape</code> to close, and <code>Tab</code> behavior coordinated with the bib contents, and lets consumers opt out via <code>disableKeyboardHandling</code>. Native <code><details></code> only toggles on <code>Enter</code>/<code>Space</code> on the <code><summary></code> and offers no panel-internal keyboard model.</p>
|
|
101
|
+
<auro-header level="3">ARIA wiring</auro-header>
|
|
102
|
+
<p><code>auro-dropdown</code> sets an <code>a11yRole</code> on the trigger, manages <code>aria-expanded</code>, and emits an <code>auroDropdown-idAdded</code> event so consumers can wire <code>aria-controls</code> to the generated bib ID. Native <code><details></code> exposes a disclosure role with <code>open</code> state but does not expose a generated panel ID, and any custom role (for example, <code>combobox</code> or <code>menu</code>) must be added and kept in sync by hand.</p>
|
|
103
|
+
<auro-header level="3">Chevron indicator</auro-header>
|
|
104
|
+
<p><code>auro-dropdown</code> supports a <code>chevron</code> attribute that renders a collapsed/expanded indicator with the correct rotation and design-token color. With native HTML you must author the indicator yourself — the example above uses a background-image SVG and a <code>[open]</code> selector to rotate it.</p>
|
|
105
|
+
<auro-header level="3">Error and help-text presentation</auro-header>
|
|
106
|
+
<p><code>auro-dropdown</code> exposes <code>error</code>, <code>errorMessage</code>, and a <code>helpText</code> slot that renders supporting text below the trigger with the correct error styling. Native <code><details></code> has no concept of error state or help text — both must be authored and toggled manually.</p>
|
|
107
|
+
<auro-header level="3">Imperative show/hide and toggle events</auro-header>
|
|
108
|
+
<p><code>auro-dropdown</code> exposes <code>show()</code> and <code>hide()</code> methods, a <code>disableEventShow</code> option to lock it to programmatic control, and emits <code>auroDropdown-toggled</code> and <code>auroDropdown-triggerClick</code> events. Native <code><details></code> emits a single <code>toggle</code> event and is toggled by user interaction with the <code><summary></code>; coordinated open/close logic across components must be written by hand.</p>
|
|
109
|
+
<auro-header level="3">Multi-brand theming</auro-header>
|
|
110
|
+
<p><code>auro-dropdown</code> consumes Auro design tokens through its component logic, so it automatically picks up brand-specific theming when token packages are swapped. A CSS-only disclosure is tied to whichever tokens were imported at author time and will not respond to runtime theme switching the way the web component does.</p>
|
|
111
|
+
<auro-header level="2">Summary</auro-header>
|
|
112
|
+
<table>
|
|
113
|
+
<thead>
|
|
114
|
+
<tr>
|
|
115
|
+
<th>Feature</th>
|
|
116
|
+
<th>Native <code><details></code>/<code><summary></code> with Auro tokens</th>
|
|
117
|
+
<th><code>auro-dropdown</code></th>
|
|
118
|
+
</tr>
|
|
119
|
+
</thead>
|
|
120
|
+
<tbody>
|
|
121
|
+
<tr>
|
|
122
|
+
<td>Design-system-aligned styling</td>
|
|
123
|
+
<td>Manual (author-written CSS)</td>
|
|
124
|
+
<td>Built-in</td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr>
|
|
127
|
+
<td>Dark background support</td>
|
|
128
|
+
<td>Manual</td>
|
|
129
|
+
<td>Yes (<code>appearance="inverse"</code>)</td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td>Bib placement</td>
|
|
133
|
+
<td>Fixed by author CSS</td>
|
|
134
|
+
<td>12 <code>placement</code> values</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td>Auto-placement and flip</td>
|
|
138
|
+
<td>Not supported</td>
|
|
139
|
+
<td><code>autoPlacement</code> / <code>noFlip</code></td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td>Shift to stay on-screen</td>
|
|
143
|
+
<td>Not supported</td>
|
|
144
|
+
<td><code>shift</code></td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr>
|
|
147
|
+
<td>Match trigger width</td>
|
|
148
|
+
<td>Manual CSS/JS</td>
|
|
149
|
+
<td><code>matchWidth</code></td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td>Offset / gap control</td>
|
|
153
|
+
<td>Manual CSS</td>
|
|
154
|
+
<td><code>offset</code></td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td>Mobile fullscreen</td>
|
|
158
|
+
<td>Not supported</td>
|
|
159
|
+
<td><code>fullscreenBreakpoint</code></td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td>Desktop modal</td>
|
|
163
|
+
<td>Not supported</td>
|
|
164
|
+
<td><code>desktopModal</code></td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td>Hover to open</td>
|
|
168
|
+
<td>Manual JS</td>
|
|
169
|
+
<td><code>hoverToggle</code></td>
|
|
170
|
+
</tr>
|
|
171
|
+
<tr>
|
|
172
|
+
<td>Focus into bib on open</td>
|
|
173
|
+
<td>Manual JS</td>
|
|
174
|
+
<td><code>focus()</code> / <code>focusShow</code></td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr>
|
|
177
|
+
<td>Click-outside / focus-loss dismiss</td>
|
|
178
|
+
<td>Manual JS</td>
|
|
179
|
+
<td>Built-in (with opt-out)</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<td>Keyboard model</td>
|
|
183
|
+
<td><code>Enter</code>/<code>Space</code> on summary only</td>
|
|
184
|
+
<td>Arrow / <code>Escape</code> / <code>Tab</code> strategy</td>
|
|
185
|
+
</tr>
|
|
186
|
+
<tr>
|
|
187
|
+
<td>ARIA wiring</td>
|
|
188
|
+
<td>Native disclosure role only</td>
|
|
189
|
+
<td><code>a11yRole</code>, <code>aria-expanded</code>, generated bib ID</td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr>
|
|
192
|
+
<td>Chevron indicator</td>
|
|
193
|
+
<td>Manual</td>
|
|
194
|
+
<td><code>chevron</code></td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td>Error / help text</td>
|
|
198
|
+
<td>Manual</td>
|
|
199
|
+
<td><code>error</code>, <code>errorMessage</code>, <code>helpText</code> slot</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr>
|
|
202
|
+
<td>Imperative show / hide</td>
|
|
203
|
+
<td>Not supported</td>
|
|
204
|
+
<td><code>show()</code> / <code>hide()</code></td>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr>
|
|
207
|
+
<td>Toggle events</td>
|
|
208
|
+
<td><code>toggle</code></td>
|
|
209
|
+
<td><code>auroDropdown-toggled</code>, <code>auroDropdown-triggerClick</code></td>
|
|
210
|
+
</tr>
|
|
211
|
+
<tr>
|
|
212
|
+
<td>Multi-brand theming</td>
|
|
213
|
+
<td>Static (import-time tokens)</td>
|
|
214
|
+
<td>Full (design tokens + component logic)</td>
|
|
215
|
+
</tr>
|
|
216
|
+
</tbody>
|
|
217
|
+
</table>
|
|
218
|
+
<auro-header level="2">Recommendation</auro-header>
|
|
219
|
+
<p>Use <code>auro-dropdown</code> whenever possible. Fall back to a CSS-styled native <code><details></code>/<code><summary></code> only in environments where custom elements are not supported or when integrating with third-party systems that require plain HTML — and be prepared to reimplement positioning, focus management, click-outside dismissal, keyboard behavior, and responsive presentation yourself.</p>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<auro-anchorlink fluid href="#matchWidth" class="level2 body-xs">Match Width</auro-anchorlink>
|
|
14
14
|
<auro-anchorlink fluid href="#customBehavior">Behavior</auro-anchorlink>
|
|
15
15
|
<auro-anchorlink fluid href="#chevron" class="level2 body-xs">Chevron</auro-anchorlink>
|
|
16
|
+
<auro-anchorlink fluid href="#desktopModal" class="level2 body-xs">Desktop Modal</auro-anchorlink>
|
|
16
17
|
<auro-anchorlink fluid href="#disabled" class="level2 body-xs">Disabled</auro-anchorlink>
|
|
17
18
|
<auro-anchorlink fluid href="#error" class="level2 body-xs">Error</auro-anchorlink>
|
|
18
19
|
<auro-anchorlink fluid href="#noToggle" class="level2 body-xs">No Toggle</auro-anchorlink>
|
|
@@ -569,6 +570,8 @@
|
|
|
569
570
|
</auro-dropdown></code></pre>
|
|
570
571
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
571
572
|
</auro-accordion>
|
|
573
|
+
<auro-header level="3" id="desktopModal">Desktop Modal</auro-header>
|
|
574
|
+
<p>Use the <code>desktopModal</code> attribute to make the dropdown behave as a modal dialog on desktop viewports. When set, all sibling elements on the page are marked <code>inert</code> and focus is trapped within the bib content. In fullscreen mode, the native <code><dialog></code> <code>showModal()</code> API provides equivalent behavior automatically.</p>
|
|
572
575
|
<auro-header level="3" id="disabled">Disabled</auro-header>
|
|
573
576
|
<p>Use the <code>disabled</code> attribute to disable interaction with the dropdown.</p>
|
|
574
577
|
<div class="exampleWrapper">
|
|
@@ -3311,7 +3311,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
|
3311
3311
|
});
|
|
3312
3312
|
}
|
|
3313
3313
|
|
|
3314
|
-
var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
3314
|
+
var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host([desktopmodal]:popover-open)::backdrop{background:transparent}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
3315
3315
|
|
|
3316
3316
|
var colorCss$2 = i$2`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3317
3317
|
|
|
@@ -3942,7 +3942,7 @@ class AuroHelpText extends i {
|
|
|
3942
3942
|
}
|
|
3943
3943
|
}
|
|
3944
3944
|
|
|
3945
|
-
var formkitVersion = '
|
|
3945
|
+
var formkitVersion = '202606181613';
|
|
3946
3946
|
|
|
3947
3947
|
class AuroElement extends i {
|
|
3948
3948
|
static get properties() {
|
|
@@ -4122,6 +4122,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4122
4122
|
_intializeDefaults() {
|
|
4123
4123
|
this.appearance = 'default';
|
|
4124
4124
|
this.chevron = false;
|
|
4125
|
+
this.desktopModal = false;
|
|
4125
4126
|
this.disabled = false;
|
|
4126
4127
|
this.disableKeyboardHandling = false;
|
|
4127
4128
|
this.error = false;
|
|
@@ -4302,6 +4303,14 @@ class AuroDropdown extends AuroElement {
|
|
|
4302
4303
|
reflect: true
|
|
4303
4304
|
},
|
|
4304
4305
|
|
|
4306
|
+
/**
|
|
4307
|
+
* If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
|
|
4308
|
+
*/
|
|
4309
|
+
desktopModal: {
|
|
4310
|
+
type: Boolean,
|
|
4311
|
+
reflect: true
|
|
4312
|
+
},
|
|
4313
|
+
|
|
4305
4314
|
/**
|
|
4306
4315
|
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4307
4316
|
*/
|
|
@@ -4589,6 +4598,15 @@ class AuroDropdown extends AuroElement {
|
|
|
4589
4598
|
|
|
4590
4599
|
disconnectedCallback() {
|
|
4591
4600
|
super.disconnectedCallback();
|
|
4601
|
+
this._clearPageInert();
|
|
4602
|
+
if (this._bibTabHandler) {
|
|
4603
|
+
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4604
|
+
this._bibTabHandler = undefined;
|
|
4605
|
+
}
|
|
4606
|
+
if (this.focusTrap) {
|
|
4607
|
+
this.focusTrap.disconnect();
|
|
4608
|
+
this.focusTrap = undefined;
|
|
4609
|
+
}
|
|
4592
4610
|
if (this.floater) {
|
|
4593
4611
|
this.floater.hideBib('disconnect');
|
|
4594
4612
|
this.floater.disconnect();
|
|
@@ -4616,19 +4634,45 @@ class AuroDropdown extends AuroElement {
|
|
|
4616
4634
|
if (this.isPopoverVisible) {
|
|
4617
4635
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
4618
4636
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
4619
|
-
|
|
4620
|
-
this.
|
|
4637
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
4638
|
+
this.updateFocusTrap();
|
|
4639
|
+
|
|
4640
|
+
// Desktop modal: make siblings inert so content outside is not interactive
|
|
4641
|
+
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4642
|
+
this._setPageInert();
|
|
4643
|
+
}
|
|
4621
4644
|
} else {
|
|
4622
4645
|
this.bibElement.value.close();
|
|
4646
|
+
this._clearPageInert();
|
|
4623
4647
|
}
|
|
4624
4648
|
}
|
|
4625
4649
|
|
|
4626
4650
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
4627
4651
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
4628
4652
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
4629
|
-
const useModal = this.isBibFullscreen;
|
|
4630
4653
|
this.bibElement.value.close();
|
|
4631
|
-
this.bibElement.value.open(
|
|
4654
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
4655
|
+
|
|
4656
|
+
// Re-initialize focus management for the new strategy
|
|
4657
|
+
this.updateFocusTrap();
|
|
4658
|
+
|
|
4659
|
+
// Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
|
|
4660
|
+
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4661
|
+
this._setPageInert();
|
|
4662
|
+
} else {
|
|
4663
|
+
this._clearPageInert();
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4666
|
+
|
|
4667
|
+
// Handle desktopModal toggled while the dropdown is already open.
|
|
4668
|
+
// Re-initialize focus trapping and page inert state to match the new mode.
|
|
4669
|
+
if (changedProperties.has('desktopModal') && this.isPopoverVisible && !this.isBibFullscreen) {
|
|
4670
|
+
this.updateFocusTrap();
|
|
4671
|
+
if (this.desktopModal) {
|
|
4672
|
+
this._setPageInert();
|
|
4673
|
+
} else {
|
|
4674
|
+
this._clearPageInert();
|
|
4675
|
+
}
|
|
4632
4676
|
}
|
|
4633
4677
|
}
|
|
4634
4678
|
|
|
@@ -4638,8 +4682,14 @@ class AuroDropdown extends AuroElement {
|
|
|
4638
4682
|
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4639
4683
|
*/
|
|
4640
4684
|
handleDropdownToggle(event) {
|
|
4641
|
-
this.updateFocusTrap();
|
|
4642
4685
|
this.isPopoverVisible = event.detail.expanded;
|
|
4686
|
+
|
|
4687
|
+
// Tear down FocusTrap when closing. Creation happens in updated()
|
|
4688
|
+
// after the dialog is open so getFocusableElements can find content.
|
|
4689
|
+
if (!this.isPopoverVisible) {
|
|
4690
|
+
this.updateFocusTrap();
|
|
4691
|
+
}
|
|
4692
|
+
|
|
4643
4693
|
const eventType = event.detail.eventType || "unknown";
|
|
4644
4694
|
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4645
4695
|
this.trigger.focus();
|
|
@@ -4738,19 +4788,220 @@ class AuroDropdown extends AuroElement {
|
|
|
4738
4788
|
* @private
|
|
4739
4789
|
*/
|
|
4740
4790
|
updateFocusTrap() {
|
|
4791
|
+
// Always clean up existing handlers/traps before setting up new ones
|
|
4792
|
+
// to prevent duplicate listeners on repeated calls.
|
|
4793
|
+
if (this._bibTabHandler) {
|
|
4794
|
+
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4795
|
+
this._bibTabHandler = undefined;
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4798
|
+
if (this.focusTrap) {
|
|
4799
|
+
this.focusTrap.disconnect();
|
|
4800
|
+
this.focusTrap = undefined;
|
|
4801
|
+
}
|
|
4802
|
+
|
|
4803
|
+
// Restore the user-set noHideOnThisFocusLoss value, if we overrode it.
|
|
4804
|
+
if (this._noHideOverridden) {
|
|
4805
|
+
this.noHideOnThisFocusLoss = this._priorNoHide;
|
|
4806
|
+
this._noHideOverridden = false;
|
|
4807
|
+
this._priorNoHide = undefined;
|
|
4808
|
+
}
|
|
4809
|
+
|
|
4741
4810
|
if (this.isPopoverVisible) {
|
|
4742
4811
|
if (!this.isBibFullscreen) {
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4812
|
+
if (this.desktopModal) {
|
|
4813
|
+
// The floater's focus-loss check uses :focus-within, which does not
|
|
4814
|
+
// match the host when focus is on a slotted element projected through
|
|
4815
|
+
// multiple shadow roots. Without this override, focusing a button
|
|
4816
|
+
// inside the bib would be misread as focus leaving the dropdown and
|
|
4817
|
+
// close the bib immediately. desktopModal traps focus inside the
|
|
4818
|
+
// bib and inerts siblings, so suppressing focus-loss dismissal here
|
|
4819
|
+
// is safe — Escape and outside-click still close the bib.
|
|
4820
|
+
this._priorNoHide = this.noHideOnThisFocusLoss;
|
|
4821
|
+
this._noHideOverridden = true;
|
|
4822
|
+
this.noHideOnThisFocusLoss = true;
|
|
4823
|
+
|
|
4824
|
+
// Desktop modal: trap focus only within the bib content.
|
|
4825
|
+
// Can't use FocusTrap on the bib element because keydown events
|
|
4826
|
+
// from slotted content bubble through the dropdown host (light DOM),
|
|
4827
|
+
// not through the bib (shadow projection target). Using FocusTrap
|
|
4828
|
+
// on the dropdown would include the trigger in the tab cycle.
|
|
4829
|
+
// Instead, listen for Tab on the dropdown and manually wrap focus
|
|
4830
|
+
// within the bib's focusable elements.
|
|
4831
|
+
this._bibTabHandler = (event) => {
|
|
4832
|
+
if (event.key !== 'Tab') {
|
|
4833
|
+
return;
|
|
4834
|
+
}
|
|
4835
|
+
|
|
4836
|
+
// Collect focusable elements from the bib content.
|
|
4837
|
+
const focusables = getFocusableElements(this.bibContent);
|
|
4838
|
+
|
|
4839
|
+
// Fallback: try from slotted content directly
|
|
4840
|
+
if (!focusables.length) {
|
|
4841
|
+
const slot = this.shadowRoot.querySelector('.slotContent slot');
|
|
4842
|
+
const assignedNodes = slot.assignedNodes({ flatten: true });
|
|
4843
|
+
|
|
4844
|
+
for (const node of assignedNodes) {
|
|
4845
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
4846
|
+
focusables.push(...getFocusableElements(node));
|
|
4847
|
+
}
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
if (!focusables.length) {
|
|
4852
|
+
return;
|
|
4853
|
+
}
|
|
4854
|
+
|
|
4855
|
+
event.preventDefault();
|
|
4856
|
+
|
|
4857
|
+
const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
|
|
4858
|
+
|
|
4859
|
+
// Walk the active element chain through shadow roots
|
|
4860
|
+
const actives = this._getActiveElements();
|
|
4861
|
+
|
|
4862
|
+
let idx = focusables.findIndex((el) => actives.includes(el));
|
|
4863
|
+
|
|
4864
|
+
if (idx === -1) { // eslint-disable-line no-magic-numbers
|
|
4865
|
+
// Focus is not on a known element — move to first/last
|
|
4866
|
+
idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
|
|
4867
|
+
}
|
|
4868
|
+
|
|
4869
|
+
// Try each element in order, skipping any that can't receive focus
|
|
4870
|
+
// (e.g. hidden elements, elements in collapsed sections)
|
|
4871
|
+
for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
|
|
4872
|
+
let nextIdx = idx + direction;
|
|
4873
|
+
|
|
4874
|
+
// Wrap around
|
|
4875
|
+
if (nextIdx < 0) {
|
|
4876
|
+
nextIdx = focusables.length - 1;
|
|
4877
|
+
} else if (nextIdx >= focusables.length) {
|
|
4878
|
+
nextIdx = 0;
|
|
4879
|
+
}
|
|
4880
|
+
|
|
4881
|
+
focusables[nextIdx].focus();
|
|
4882
|
+
|
|
4883
|
+
// Verify focus actually moved to the target
|
|
4884
|
+
const newActives = this._getActiveElements();
|
|
4885
|
+
|
|
4886
|
+
if (newActives.includes(focusables[nextIdx])) {
|
|
4887
|
+
return;
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
// Focus didn't stick — skip this element and try the next
|
|
4891
|
+
idx = nextIdx;
|
|
4892
|
+
}
|
|
4893
|
+
};
|
|
4894
|
+
this.addEventListener('keydown', this._bibTabHandler);
|
|
4895
|
+
|
|
4896
|
+
// Move initial focus into the bib content, matching FocusTrap behavior
|
|
4897
|
+
requestAnimationFrame(() => {
|
|
4898
|
+
const focusables = getFocusableElements(this.bibContent);
|
|
4899
|
+
if (focusables.length) {
|
|
4900
|
+
focusables[0].focus();
|
|
4901
|
+
}
|
|
4902
|
+
});
|
|
4903
|
+
} else {
|
|
4904
|
+
// Normal desktop: use FocusTrap on the bib element.
|
|
4905
|
+
// Defer focusFirstElement to the next frame because the popover
|
|
4906
|
+
// is positioned asynchronously by Floating UI — calling focus()
|
|
4907
|
+
// synchronously here would target elements with zero dimensions
|
|
4908
|
+
// and the focus call would be silently ignored.
|
|
4909
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4910
|
+
requestAnimationFrame(() => {
|
|
4911
|
+
if (this.focusTrap) {
|
|
4912
|
+
this.focusTrap.focusFirstElement();
|
|
4913
|
+
}
|
|
4914
|
+
});
|
|
4915
|
+
}
|
|
4746
4916
|
}
|
|
4747
4917
|
// Fullscreen: showModal() provides native focus trapping
|
|
4918
|
+
}
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
/**
|
|
4922
|
+
* Returns the chain of active (focused) elements through shadow roots.
|
|
4923
|
+
* @private
|
|
4924
|
+
* @returns {Array<HTMLElement>}
|
|
4925
|
+
*/
|
|
4926
|
+
_getActiveElements() {
|
|
4927
|
+
let { activeElement } = document;
|
|
4928
|
+
const actives = [activeElement];
|
|
4929
|
+
|
|
4930
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
4931
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
4932
|
+
actives.push(activeElement);
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
return actives;
|
|
4936
|
+
}
|
|
4937
|
+
|
|
4938
|
+
/**
|
|
4939
|
+
* Sets `inert` on sibling elements of the dropdown's top-level host
|
|
4940
|
+
* so that content outside the dropdown is not interactive while the modal is open.
|
|
4941
|
+
* Walks up through shadow DOM boundaries to find the outermost host element
|
|
4942
|
+
* in the light DOM, then sets `inert` on siblings at each ancestor level
|
|
4943
|
+
* to ensure all page content outside the host subtree is inert.
|
|
4944
|
+
* @private
|
|
4945
|
+
*/
|
|
4946
|
+
_setPageInert() {
|
|
4947
|
+
if (this._inertSiblings) {
|
|
4748
4948
|
return;
|
|
4749
4949
|
}
|
|
4750
4950
|
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4951
|
+
this._inertSiblings = [];
|
|
4952
|
+
|
|
4953
|
+
// Walk up through shadow DOM boundaries to find the topmost host
|
|
4954
|
+
// element in the light DOM. For example, if this dropdown is inside
|
|
4955
|
+
// auro-datepicker's shadow DOM, we walk up to the datepicker element
|
|
4956
|
+
// so we set inert on its siblings — not on the datepicker itself.
|
|
4957
|
+
let host = this;
|
|
4958
|
+
while (host.getRootNode() instanceof ShadowRoot) {
|
|
4959
|
+
host = host.getRootNode().host;
|
|
4960
|
+
}
|
|
4961
|
+
|
|
4962
|
+
// Walk up the ancestor chain, inerting siblings at each level
|
|
4963
|
+
// to ensure the entire page outside the host subtree is inert.
|
|
4964
|
+
// Uses a reference counter (data-auro-inert-count) so multiple
|
|
4965
|
+
// simultaneous modal dropdowns share inert state safely.
|
|
4966
|
+
let current = host;
|
|
4967
|
+
while (current.parentElement) {
|
|
4968
|
+
const parent = current.parentElement;
|
|
4969
|
+
for (const sibling of parent.children) {
|
|
4970
|
+
if (sibling !== current) {
|
|
4971
|
+
const count = parseInt(sibling.dataset.auroInertCount || '0', 10);
|
|
4972
|
+
if (count === 0) {
|
|
4973
|
+
sibling.dataset.auroInertWas = sibling.inert ? 'true' : 'false';
|
|
4974
|
+
}
|
|
4975
|
+
sibling.dataset.auroInertCount = String(count + 1);
|
|
4976
|
+
sibling.inert = true;
|
|
4977
|
+
this._inertSiblings.push(sibling);
|
|
4978
|
+
}
|
|
4979
|
+
}
|
|
4980
|
+
current = parent;
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4984
|
+
/**
|
|
4985
|
+
* Restores `inert` state on siblings that were tracked by `_setPageInert`.
|
|
4986
|
+
* Uses reference counting so inert is only cleared when the last modal
|
|
4987
|
+
* dropdown releases a given element. Preserves the original inert state
|
|
4988
|
+
* so externally-inerted elements are not inadvertently re-enabled.
|
|
4989
|
+
* @private
|
|
4990
|
+
*/
|
|
4991
|
+
_clearPageInert() {
|
|
4992
|
+
if (this._inertSiblings) {
|
|
4993
|
+
for (const sibling of this._inertSiblings) {
|
|
4994
|
+
const count = parseInt(sibling.dataset.auroInertCount || '1', 10) - 1;
|
|
4995
|
+
if (count <= 0) {
|
|
4996
|
+
const wasInert = sibling.dataset.auroInertWas === 'true';
|
|
4997
|
+
delete sibling.dataset.auroInertCount;
|
|
4998
|
+
delete sibling.dataset.auroInertWas;
|
|
4999
|
+
sibling.inert = wasInert;
|
|
5000
|
+
} else {
|
|
5001
|
+
sibling.dataset.auroInertCount = String(count);
|
|
5002
|
+
}
|
|
5003
|
+
}
|
|
5004
|
+
this._inertSiblings = undefined;
|
|
4754
5005
|
}
|
|
4755
5006
|
}
|
|
4756
5007
|
|
|
@@ -4989,6 +5240,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4989
5240
|
shape="${this.shape}"
|
|
4990
5241
|
?data-show="${this.isPopoverVisible}"
|
|
4991
5242
|
?isfullscreen="${this.isBibFullscreen}"
|
|
5243
|
+
?desktopmodal="${this.desktopModal}"
|
|
4992
5244
|
.dialogLabel="${this.bibDialogLabel}"
|
|
4993
5245
|
${n$2(this.bibElement)}
|
|
4994
5246
|
>
|