@aurodesignsystem-dev/auro-formkit 0.0.0-pr1475.4 → 0.0.0-pr1477.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 +0 -7
- package/components/bibtemplate/dist/index.js +1 -9
- package/components/bibtemplate/dist/registered.js +1 -9
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.min.js +18 -234
- package/components/combobox/demo/getting-started.min.js +18 -234
- package/components/combobox/demo/index.min.js +18 -234
- package/components/combobox/demo/keyboard-behavior.md +68 -8
- package/components/combobox/dist/index.js +18 -234
- package/components/combobox/dist/registered.js +18 -234
- package/components/counter/demo/customize.min.js +15 -231
- package/components/counter/demo/index.min.js +15 -231
- package/components/counter/demo/keyboard-behavior.md +0 -1
- package/components/counter/dist/index.js +433 -45
- package/components/counter/dist/registered.js +2 -10
- package/components/datepicker/demo/accessibility.md +3 -51
- package/components/datepicker/demo/api.md +0 -9
- package/components/datepicker/demo/customize.html +0 -2
- package/components/datepicker/demo/customize.md +8 -72
- package/components/datepicker/demo/design.md +1 -3
- package/components/datepicker/demo/index.js +1 -5
- package/components/datepicker/demo/index.md +1 -81
- package/components/datepicker/demo/index.min.js +101 -1350
- package/components/datepicker/demo/keyboard-behavior.md +2 -201
- package/components/datepicker/demo/voiceover.md +12 -19
- package/components/datepicker/dist/index.js +111 -1284
- package/components/datepicker/dist/registered.js +111 -1284
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +1 -64
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +0 -28
- package/components/datepicker/dist/src/auro-calendar.d.ts +0 -84
- package/components/datepicker/dist/src/auro-datepicker.d.ts +0 -80
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +3 -5
- package/components/dropdown/demo/accessibility.md +0 -11
- package/components/dropdown/demo/api.md +0 -1
- package/components/dropdown/demo/customize.md +0 -3
- package/components/dropdown/demo/customize.min.js +13 -221
- package/components/dropdown/demo/getting-started.min.js +13 -221
- package/components/dropdown/demo/index.min.js +13 -221
- package/components/dropdown/demo/keyboard-behavior.md +0 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +1 -31
- package/components/dropdown/dist/index.js +13 -221
- package/components/dropdown/dist/registered.js +13 -221
- package/components/form/demo/customize.min.js +987 -2806
- package/components/form/demo/getting-started.min.js +987 -2806
- package/components/form/demo/index.min.js +987 -2806
- package/components/form/demo/registerDemoDeps.min.js +982 -2801
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.min.js +33 -247
- package/components/select/demo/getting-started.min.js +33 -247
- package/components/select/demo/index.min.js +33 -247
- package/components/select/demo/keyboard-behavior.md +54 -9
- package/components/select/dist/index.js +33 -247
- package/components/select/dist/registered.js +33 -247
- package/custom-elements.json +1491 -2163
- package/package.json +2 -2
- package/components/datepicker/demo/customize.js +0 -19
- package/components/datepicker/demo/customize.min.js +0 -25810
- package/components/radio/demo/customize.min.js +0 -2186
- package/components/radio/demo/demo-support.min.js +0 -55807
- package/components/radio/demo/getting-started.min.js +0 -2205
|
@@ -3243,7 +3243,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
|
3243
3243
|
});
|
|
3244
3244
|
}
|
|
3245
3245
|
|
|
3246
|
-
var styleCss$2 = css`: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(
|
|
3246
|
+
var styleCss$2 = css`: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}`;
|
|
3247
3247
|
|
|
3248
3248
|
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3249
3249
|
|
|
@@ -3874,7 +3874,7 @@ class AuroHelpText extends LitElement {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
3877
|
-
var formkitVersion = '
|
|
3877
|
+
var formkitVersion = '202605192014';
|
|
3878
3878
|
|
|
3879
3879
|
class AuroElement extends LitElement {
|
|
3880
3880
|
static get properties() {
|
|
@@ -4054,7 +4054,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4054
4054
|
_intializeDefaults() {
|
|
4055
4055
|
this.appearance = 'default';
|
|
4056
4056
|
this.chevron = false;
|
|
4057
|
-
this.desktopModal = false;
|
|
4058
4057
|
this.disabled = false;
|
|
4059
4058
|
this.disableKeyboardHandling = false;
|
|
4060
4059
|
this.error = false;
|
|
@@ -4235,14 +4234,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4235
4234
|
reflect: true
|
|
4236
4235
|
},
|
|
4237
4236
|
|
|
4238
|
-
/**
|
|
4239
|
-
* If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
|
|
4240
|
-
*/
|
|
4241
|
-
desktopModal: {
|
|
4242
|
-
type: Boolean,
|
|
4243
|
-
reflect: true
|
|
4244
|
-
},
|
|
4245
|
-
|
|
4246
4237
|
/**
|
|
4247
4238
|
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4248
4239
|
*/
|
|
@@ -4530,15 +4521,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4530
4521
|
|
|
4531
4522
|
disconnectedCallback() {
|
|
4532
4523
|
super.disconnectedCallback();
|
|
4533
|
-
this._clearPageInert();
|
|
4534
|
-
if (this._bibTabHandler) {
|
|
4535
|
-
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4536
|
-
this._bibTabHandler = undefined;
|
|
4537
|
-
}
|
|
4538
|
-
if (this.focusTrap) {
|
|
4539
|
-
this.focusTrap.disconnect();
|
|
4540
|
-
this.focusTrap = undefined;
|
|
4541
|
-
}
|
|
4542
4524
|
if (this.floater) {
|
|
4543
4525
|
this.floater.hideBib('disconnect');
|
|
4544
4526
|
this.floater.disconnect();
|
|
@@ -4566,45 +4548,19 @@ class AuroDropdown extends AuroElement {
|
|
|
4566
4548
|
if (this.isPopoverVisible) {
|
|
4567
4549
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
4568
4550
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
4569
|
-
this.
|
|
4570
|
-
this.
|
|
4571
|
-
|
|
4572
|
-
// Desktop modal: make siblings inert so content outside is not interactive
|
|
4573
|
-
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4574
|
-
this._setPageInert();
|
|
4575
|
-
}
|
|
4551
|
+
const useModal = this.isBibFullscreen;
|
|
4552
|
+
this.bibElement.value.open(useModal);
|
|
4576
4553
|
} else {
|
|
4577
4554
|
this.bibElement.value.close();
|
|
4578
|
-
this._clearPageInert();
|
|
4579
4555
|
}
|
|
4580
4556
|
}
|
|
4581
4557
|
|
|
4582
4558
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
4583
4559
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
4584
4560
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
4561
|
+
const useModal = this.isBibFullscreen;
|
|
4585
4562
|
this.bibElement.value.close();
|
|
4586
|
-
this.bibElement.value.open(
|
|
4587
|
-
|
|
4588
|
-
// Re-initialize focus management for the new strategy
|
|
4589
|
-
this.updateFocusTrap();
|
|
4590
|
-
|
|
4591
|
-
// Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
|
|
4592
|
-
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4593
|
-
this._setPageInert();
|
|
4594
|
-
} else {
|
|
4595
|
-
this._clearPageInert();
|
|
4596
|
-
}
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
// Handle desktopModal toggled while the dropdown is already open.
|
|
4600
|
-
// Re-initialize focus trapping and page inert state to match the new mode.
|
|
4601
|
-
if (changedProperties.has('desktopModal') && this.isPopoverVisible && !this.isBibFullscreen) {
|
|
4602
|
-
this.updateFocusTrap();
|
|
4603
|
-
if (this.desktopModal) {
|
|
4604
|
-
this._setPageInert();
|
|
4605
|
-
} else {
|
|
4606
|
-
this._clearPageInert();
|
|
4607
|
-
}
|
|
4563
|
+
this.bibElement.value.open(useModal);
|
|
4608
4564
|
}
|
|
4609
4565
|
}
|
|
4610
4566
|
|
|
@@ -4614,14 +4570,8 @@ class AuroDropdown extends AuroElement {
|
|
|
4614
4570
|
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4615
4571
|
*/
|
|
4616
4572
|
handleDropdownToggle(event) {
|
|
4573
|
+
this.updateFocusTrap();
|
|
4617
4574
|
this.isPopoverVisible = event.detail.expanded;
|
|
4618
|
-
|
|
4619
|
-
// Tear down FocusTrap when closing. Creation happens in updated()
|
|
4620
|
-
// after the dialog is open so getFocusableElements can find content.
|
|
4621
|
-
if (!this.isPopoverVisible) {
|
|
4622
|
-
this.updateFocusTrap();
|
|
4623
|
-
}
|
|
4624
|
-
|
|
4625
4575
|
const eventType = event.detail.eventType || "unknown";
|
|
4626
4576
|
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4627
4577
|
this.trigger.focus();
|
|
@@ -4720,176 +4670,19 @@ class AuroDropdown extends AuroElement {
|
|
|
4720
4670
|
* @private
|
|
4721
4671
|
*/
|
|
4722
4672
|
updateFocusTrap() {
|
|
4723
|
-
// Always clean up existing handlers/traps before setting up new ones
|
|
4724
|
-
// to prevent duplicate listeners on repeated calls.
|
|
4725
|
-
if (this._bibTabHandler) {
|
|
4726
|
-
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4727
|
-
this._bibTabHandler = undefined;
|
|
4728
|
-
}
|
|
4729
|
-
|
|
4730
|
-
if (this.focusTrap) {
|
|
4731
|
-
this.focusTrap.disconnect();
|
|
4732
|
-
this.focusTrap = undefined;
|
|
4733
|
-
}
|
|
4734
|
-
|
|
4735
4673
|
if (this.isPopoverVisible) {
|
|
4736
4674
|
if (!this.isBibFullscreen) {
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
// from slotted content bubble through the dropdown host (light DOM),
|
|
4741
|
-
// not through the bib (shadow projection target). Using FocusTrap
|
|
4742
|
-
// on the dropdown would include the trigger in the tab cycle.
|
|
4743
|
-
// Instead, listen for Tab on the dropdown and manually wrap focus
|
|
4744
|
-
// within the bib's focusable elements.
|
|
4745
|
-
this._bibTabHandler = (event) => {
|
|
4746
|
-
if (event.key !== 'Tab') {
|
|
4747
|
-
return;
|
|
4748
|
-
}
|
|
4749
|
-
|
|
4750
|
-
// Collect focusable elements from the bib content.
|
|
4751
|
-
const focusables = getFocusableElements(this.bibContent);
|
|
4752
|
-
|
|
4753
|
-
// Fallback: try from slotted content directly
|
|
4754
|
-
if (!focusables.length) {
|
|
4755
|
-
const slot = this.shadowRoot.querySelector('.slotContent slot');
|
|
4756
|
-
const assignedNodes = slot ? slot.assignedNodes({ flatten: true }) : [];
|
|
4757
|
-
|
|
4758
|
-
for (const node of assignedNodes) {
|
|
4759
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
4760
|
-
focusables.push(...getFocusableElements(node));
|
|
4761
|
-
}
|
|
4762
|
-
}
|
|
4763
|
-
}
|
|
4764
|
-
|
|
4765
|
-
if (!focusables.length) {
|
|
4766
|
-
return;
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
|
-
event.preventDefault();
|
|
4770
|
-
|
|
4771
|
-
const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
|
|
4772
|
-
|
|
4773
|
-
// Walk the active element chain through shadow roots
|
|
4774
|
-
const actives = this._getActiveElements();
|
|
4775
|
-
|
|
4776
|
-
let idx = focusables.findIndex((el) => actives.includes(el));
|
|
4777
|
-
|
|
4778
|
-
if (idx === -1) { // eslint-disable-line no-magic-numbers
|
|
4779
|
-
// Focus is not on a known element — move to first/last
|
|
4780
|
-
idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4783
|
-
// Try each element in order, skipping any that can't receive focus
|
|
4784
|
-
// (e.g. hidden elements, elements in collapsed sections)
|
|
4785
|
-
for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
|
|
4786
|
-
let nextIdx = idx + direction;
|
|
4787
|
-
|
|
4788
|
-
// Wrap around
|
|
4789
|
-
if (nextIdx < 0) {
|
|
4790
|
-
nextIdx = focusables.length - 1;
|
|
4791
|
-
} else if (nextIdx >= focusables.length) {
|
|
4792
|
-
nextIdx = 0;
|
|
4793
|
-
}
|
|
4794
|
-
|
|
4795
|
-
focusables[nextIdx].focus();
|
|
4796
|
-
|
|
4797
|
-
// Verify focus actually moved to the target
|
|
4798
|
-
const newActives = this._getActiveElements();
|
|
4799
|
-
|
|
4800
|
-
if (newActives.includes(focusables[nextIdx])) {
|
|
4801
|
-
return;
|
|
4802
|
-
}
|
|
4803
|
-
|
|
4804
|
-
// Focus didn't stick — skip this element and try the next
|
|
4805
|
-
idx = nextIdx;
|
|
4806
|
-
}
|
|
4807
|
-
};
|
|
4808
|
-
this.addEventListener('keydown', this._bibTabHandler);
|
|
4809
|
-
|
|
4810
|
-
// Move initial focus into the bib content, matching FocusTrap behavior
|
|
4811
|
-
requestAnimationFrame(() => {
|
|
4812
|
-
const focusables = getFocusableElements(this.bibContent);
|
|
4813
|
-
if (focusables.length) {
|
|
4814
|
-
focusables[0].focus();
|
|
4815
|
-
}
|
|
4816
|
-
});
|
|
4817
|
-
} else {
|
|
4818
|
-
// Normal desktop: use FocusTrap on the bib element
|
|
4819
|
-
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4820
|
-
this.focusTrap.focusFirstElement();
|
|
4821
|
-
}
|
|
4675
|
+
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
4676
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4677
|
+
this.focusTrap.focusFirstElement();
|
|
4822
4678
|
}
|
|
4823
4679
|
// Fullscreen: showModal() provides native focus trapping
|
|
4824
|
-
}
|
|
4825
|
-
}
|
|
4826
|
-
|
|
4827
|
-
/**
|
|
4828
|
-
* Returns the chain of active (focused) elements through shadow roots.
|
|
4829
|
-
* @private
|
|
4830
|
-
* @returns {Array<HTMLElement>}
|
|
4831
|
-
*/
|
|
4832
|
-
_getActiveElements() {
|
|
4833
|
-
let { activeElement } = document;
|
|
4834
|
-
const actives = [activeElement];
|
|
4835
|
-
|
|
4836
|
-
while (activeElement?.shadowRoot?.activeElement) {
|
|
4837
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
|
4838
|
-
actives.push(activeElement);
|
|
4839
|
-
}
|
|
4840
|
-
|
|
4841
|
-
return actives;
|
|
4842
|
-
}
|
|
4843
|
-
|
|
4844
|
-
/**
|
|
4845
|
-
* Sets `inert` on sibling elements of the dropdown's top-level host
|
|
4846
|
-
* so that content outside the dropdown is not interactive while the modal is open.
|
|
4847
|
-
* Walks up through shadow DOM boundaries to find the outermost host element
|
|
4848
|
-
* in the light DOM, then sets `inert` on siblings at each ancestor level
|
|
4849
|
-
* to ensure all page content outside the host subtree is inert.
|
|
4850
|
-
* @private
|
|
4851
|
-
*/
|
|
4852
|
-
_setPageInert() {
|
|
4853
|
-
if (this._inertSiblings) {
|
|
4854
4680
|
return;
|
|
4855
4681
|
}
|
|
4856
4682
|
|
|
4857
|
-
this.
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
// element in the light DOM. For example, if this dropdown is inside
|
|
4861
|
-
// auro-datepicker's shadow DOM, we walk up to the datepicker element
|
|
4862
|
-
// so we set inert on its siblings — not on the datepicker itself.
|
|
4863
|
-
let host = this;
|
|
4864
|
-
while (host.getRootNode() instanceof ShadowRoot) {
|
|
4865
|
-
host = host.getRootNode().host;
|
|
4866
|
-
}
|
|
4867
|
-
|
|
4868
|
-
// Walk up the ancestor chain, inerting siblings at each level
|
|
4869
|
-
// to ensure the entire page outside the host subtree is inert.
|
|
4870
|
-
let current = host;
|
|
4871
|
-
while (current.parentElement) {
|
|
4872
|
-
const parent = current.parentElement;
|
|
4873
|
-
for (const sibling of parent.children) {
|
|
4874
|
-
if (sibling !== current && !sibling.inert) {
|
|
4875
|
-
sibling.inert = true;
|
|
4876
|
-
this._inertSiblings.push(sibling);
|
|
4877
|
-
}
|
|
4878
|
-
}
|
|
4879
|
-
current = parent;
|
|
4880
|
-
}
|
|
4881
|
-
}
|
|
4882
|
-
|
|
4883
|
-
/**
|
|
4884
|
-
* Restores `inert` state on siblings that were made inert by `_setPageInert`.
|
|
4885
|
-
* @private
|
|
4886
|
-
*/
|
|
4887
|
-
_clearPageInert() {
|
|
4888
|
-
if (this._inertSiblings) {
|
|
4889
|
-
for (const sibling of this._inertSiblings) {
|
|
4890
|
-
sibling.inert = false;
|
|
4891
|
-
}
|
|
4892
|
-
this._inertSiblings = undefined;
|
|
4683
|
+
if (this.focusTrap) {
|
|
4684
|
+
this.focusTrap.disconnect();
|
|
4685
|
+
this.focusTrap = undefined;
|
|
4893
4686
|
}
|
|
4894
4687
|
}
|
|
4895
4688
|
|
|
@@ -5128,7 +4921,6 @@ class AuroDropdown extends AuroElement {
|
|
|
5128
4921
|
shape="${this.shape}"
|
|
5129
4922
|
?data-show="${this.isPopoverVisible}"
|
|
5130
4923
|
?isfullscreen="${this.isBibFullscreen}"
|
|
5131
|
-
?desktopmodal="${this.desktopModal}"
|
|
5132
4924
|
.dialogLabel="${this.bibDialogLabel}"
|
|
5133
4925
|
${ref(this.bibElement)}
|
|
5134
4926
|
>
|
|
@@ -3243,7 +3243,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
|
3243
3243
|
});
|
|
3244
3244
|
}
|
|
3245
3245
|
|
|
3246
|
-
var styleCss$2 = css`: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(
|
|
3246
|
+
var styleCss$2 = css`: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}`;
|
|
3247
3247
|
|
|
3248
3248
|
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3249
3249
|
|
|
@@ -3874,7 +3874,7 @@ class AuroHelpText extends LitElement {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
3877
|
-
var formkitVersion = '
|
|
3877
|
+
var formkitVersion = '202605192014';
|
|
3878
3878
|
|
|
3879
3879
|
class AuroElement extends LitElement {
|
|
3880
3880
|
static get properties() {
|
|
@@ -4054,7 +4054,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4054
4054
|
_intializeDefaults() {
|
|
4055
4055
|
this.appearance = 'default';
|
|
4056
4056
|
this.chevron = false;
|
|
4057
|
-
this.desktopModal = false;
|
|
4058
4057
|
this.disabled = false;
|
|
4059
4058
|
this.disableKeyboardHandling = false;
|
|
4060
4059
|
this.error = false;
|
|
@@ -4235,14 +4234,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4235
4234
|
reflect: true
|
|
4236
4235
|
},
|
|
4237
4236
|
|
|
4238
|
-
/**
|
|
4239
|
-
* If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
|
|
4240
|
-
*/
|
|
4241
|
-
desktopModal: {
|
|
4242
|
-
type: Boolean,
|
|
4243
|
-
reflect: true
|
|
4244
|
-
},
|
|
4245
|
-
|
|
4246
4237
|
/**
|
|
4247
4238
|
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4248
4239
|
*/
|
|
@@ -4530,15 +4521,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4530
4521
|
|
|
4531
4522
|
disconnectedCallback() {
|
|
4532
4523
|
super.disconnectedCallback();
|
|
4533
|
-
this._clearPageInert();
|
|
4534
|
-
if (this._bibTabHandler) {
|
|
4535
|
-
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4536
|
-
this._bibTabHandler = undefined;
|
|
4537
|
-
}
|
|
4538
|
-
if (this.focusTrap) {
|
|
4539
|
-
this.focusTrap.disconnect();
|
|
4540
|
-
this.focusTrap = undefined;
|
|
4541
|
-
}
|
|
4542
4524
|
if (this.floater) {
|
|
4543
4525
|
this.floater.hideBib('disconnect');
|
|
4544
4526
|
this.floater.disconnect();
|
|
@@ -4566,45 +4548,19 @@ class AuroDropdown extends AuroElement {
|
|
|
4566
4548
|
if (this.isPopoverVisible) {
|
|
4567
4549
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
4568
4550
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
4569
|
-
this.
|
|
4570
|
-
this.
|
|
4571
|
-
|
|
4572
|
-
// Desktop modal: make siblings inert so content outside is not interactive
|
|
4573
|
-
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4574
|
-
this._setPageInert();
|
|
4575
|
-
}
|
|
4551
|
+
const useModal = this.isBibFullscreen;
|
|
4552
|
+
this.bibElement.value.open(useModal);
|
|
4576
4553
|
} else {
|
|
4577
4554
|
this.bibElement.value.close();
|
|
4578
|
-
this._clearPageInert();
|
|
4579
4555
|
}
|
|
4580
4556
|
}
|
|
4581
4557
|
|
|
4582
4558
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
4583
4559
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
4584
4560
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
4561
|
+
const useModal = this.isBibFullscreen;
|
|
4585
4562
|
this.bibElement.value.close();
|
|
4586
|
-
this.bibElement.value.open(
|
|
4587
|
-
|
|
4588
|
-
// Re-initialize focus management for the new strategy
|
|
4589
|
-
this.updateFocusTrap();
|
|
4590
|
-
|
|
4591
|
-
// Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
|
|
4592
|
-
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4593
|
-
this._setPageInert();
|
|
4594
|
-
} else {
|
|
4595
|
-
this._clearPageInert();
|
|
4596
|
-
}
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
// Handle desktopModal toggled while the dropdown is already open.
|
|
4600
|
-
// Re-initialize focus trapping and page inert state to match the new mode.
|
|
4601
|
-
if (changedProperties.has('desktopModal') && this.isPopoverVisible && !this.isBibFullscreen) {
|
|
4602
|
-
this.updateFocusTrap();
|
|
4603
|
-
if (this.desktopModal) {
|
|
4604
|
-
this._setPageInert();
|
|
4605
|
-
} else {
|
|
4606
|
-
this._clearPageInert();
|
|
4607
|
-
}
|
|
4563
|
+
this.bibElement.value.open(useModal);
|
|
4608
4564
|
}
|
|
4609
4565
|
}
|
|
4610
4566
|
|
|
@@ -4614,14 +4570,8 @@ class AuroDropdown extends AuroElement {
|
|
|
4614
4570
|
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4615
4571
|
*/
|
|
4616
4572
|
handleDropdownToggle(event) {
|
|
4573
|
+
this.updateFocusTrap();
|
|
4617
4574
|
this.isPopoverVisible = event.detail.expanded;
|
|
4618
|
-
|
|
4619
|
-
// Tear down FocusTrap when closing. Creation happens in updated()
|
|
4620
|
-
// after the dialog is open so getFocusableElements can find content.
|
|
4621
|
-
if (!this.isPopoverVisible) {
|
|
4622
|
-
this.updateFocusTrap();
|
|
4623
|
-
}
|
|
4624
|
-
|
|
4625
4575
|
const eventType = event.detail.eventType || "unknown";
|
|
4626
4576
|
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4627
4577
|
this.trigger.focus();
|
|
@@ -4720,176 +4670,19 @@ class AuroDropdown extends AuroElement {
|
|
|
4720
4670
|
* @private
|
|
4721
4671
|
*/
|
|
4722
4672
|
updateFocusTrap() {
|
|
4723
|
-
// Always clean up existing handlers/traps before setting up new ones
|
|
4724
|
-
// to prevent duplicate listeners on repeated calls.
|
|
4725
|
-
if (this._bibTabHandler) {
|
|
4726
|
-
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4727
|
-
this._bibTabHandler = undefined;
|
|
4728
|
-
}
|
|
4729
|
-
|
|
4730
|
-
if (this.focusTrap) {
|
|
4731
|
-
this.focusTrap.disconnect();
|
|
4732
|
-
this.focusTrap = undefined;
|
|
4733
|
-
}
|
|
4734
|
-
|
|
4735
4673
|
if (this.isPopoverVisible) {
|
|
4736
4674
|
if (!this.isBibFullscreen) {
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
// from slotted content bubble through the dropdown host (light DOM),
|
|
4741
|
-
// not through the bib (shadow projection target). Using FocusTrap
|
|
4742
|
-
// on the dropdown would include the trigger in the tab cycle.
|
|
4743
|
-
// Instead, listen for Tab on the dropdown and manually wrap focus
|
|
4744
|
-
// within the bib's focusable elements.
|
|
4745
|
-
this._bibTabHandler = (event) => {
|
|
4746
|
-
if (event.key !== 'Tab') {
|
|
4747
|
-
return;
|
|
4748
|
-
}
|
|
4749
|
-
|
|
4750
|
-
// Collect focusable elements from the bib content.
|
|
4751
|
-
const focusables = getFocusableElements(this.bibContent);
|
|
4752
|
-
|
|
4753
|
-
// Fallback: try from slotted content directly
|
|
4754
|
-
if (!focusables.length) {
|
|
4755
|
-
const slot = this.shadowRoot.querySelector('.slotContent slot');
|
|
4756
|
-
const assignedNodes = slot ? slot.assignedNodes({ flatten: true }) : [];
|
|
4757
|
-
|
|
4758
|
-
for (const node of assignedNodes) {
|
|
4759
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
4760
|
-
focusables.push(...getFocusableElements(node));
|
|
4761
|
-
}
|
|
4762
|
-
}
|
|
4763
|
-
}
|
|
4764
|
-
|
|
4765
|
-
if (!focusables.length) {
|
|
4766
|
-
return;
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
|
-
event.preventDefault();
|
|
4770
|
-
|
|
4771
|
-
const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
|
|
4772
|
-
|
|
4773
|
-
// Walk the active element chain through shadow roots
|
|
4774
|
-
const actives = this._getActiveElements();
|
|
4775
|
-
|
|
4776
|
-
let idx = focusables.findIndex((el) => actives.includes(el));
|
|
4777
|
-
|
|
4778
|
-
if (idx === -1) { // eslint-disable-line no-magic-numbers
|
|
4779
|
-
// Focus is not on a known element — move to first/last
|
|
4780
|
-
idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4783
|
-
// Try each element in order, skipping any that can't receive focus
|
|
4784
|
-
// (e.g. hidden elements, elements in collapsed sections)
|
|
4785
|
-
for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
|
|
4786
|
-
let nextIdx = idx + direction;
|
|
4787
|
-
|
|
4788
|
-
// Wrap around
|
|
4789
|
-
if (nextIdx < 0) {
|
|
4790
|
-
nextIdx = focusables.length - 1;
|
|
4791
|
-
} else if (nextIdx >= focusables.length) {
|
|
4792
|
-
nextIdx = 0;
|
|
4793
|
-
}
|
|
4794
|
-
|
|
4795
|
-
focusables[nextIdx].focus();
|
|
4796
|
-
|
|
4797
|
-
// Verify focus actually moved to the target
|
|
4798
|
-
const newActives = this._getActiveElements();
|
|
4799
|
-
|
|
4800
|
-
if (newActives.includes(focusables[nextIdx])) {
|
|
4801
|
-
return;
|
|
4802
|
-
}
|
|
4803
|
-
|
|
4804
|
-
// Focus didn't stick — skip this element and try the next
|
|
4805
|
-
idx = nextIdx;
|
|
4806
|
-
}
|
|
4807
|
-
};
|
|
4808
|
-
this.addEventListener('keydown', this._bibTabHandler);
|
|
4809
|
-
|
|
4810
|
-
// Move initial focus into the bib content, matching FocusTrap behavior
|
|
4811
|
-
requestAnimationFrame(() => {
|
|
4812
|
-
const focusables = getFocusableElements(this.bibContent);
|
|
4813
|
-
if (focusables.length) {
|
|
4814
|
-
focusables[0].focus();
|
|
4815
|
-
}
|
|
4816
|
-
});
|
|
4817
|
-
} else {
|
|
4818
|
-
// Normal desktop: use FocusTrap on the bib element
|
|
4819
|
-
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4820
|
-
this.focusTrap.focusFirstElement();
|
|
4821
|
-
}
|
|
4675
|
+
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
4676
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4677
|
+
this.focusTrap.focusFirstElement();
|
|
4822
4678
|
}
|
|
4823
4679
|
// Fullscreen: showModal() provides native focus trapping
|
|
4824
|
-
}
|
|
4825
|
-
}
|
|
4826
|
-
|
|
4827
|
-
/**
|
|
4828
|
-
* Returns the chain of active (focused) elements through shadow roots.
|
|
4829
|
-
* @private
|
|
4830
|
-
* @returns {Array<HTMLElement>}
|
|
4831
|
-
*/
|
|
4832
|
-
_getActiveElements() {
|
|
4833
|
-
let { activeElement } = document;
|
|
4834
|
-
const actives = [activeElement];
|
|
4835
|
-
|
|
4836
|
-
while (activeElement?.shadowRoot?.activeElement) {
|
|
4837
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
|
4838
|
-
actives.push(activeElement);
|
|
4839
|
-
}
|
|
4840
|
-
|
|
4841
|
-
return actives;
|
|
4842
|
-
}
|
|
4843
|
-
|
|
4844
|
-
/**
|
|
4845
|
-
* Sets `inert` on sibling elements of the dropdown's top-level host
|
|
4846
|
-
* so that content outside the dropdown is not interactive while the modal is open.
|
|
4847
|
-
* Walks up through shadow DOM boundaries to find the outermost host element
|
|
4848
|
-
* in the light DOM, then sets `inert` on siblings at each ancestor level
|
|
4849
|
-
* to ensure all page content outside the host subtree is inert.
|
|
4850
|
-
* @private
|
|
4851
|
-
*/
|
|
4852
|
-
_setPageInert() {
|
|
4853
|
-
if (this._inertSiblings) {
|
|
4854
4680
|
return;
|
|
4855
4681
|
}
|
|
4856
4682
|
|
|
4857
|
-
this.
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
// element in the light DOM. For example, if this dropdown is inside
|
|
4861
|
-
// auro-datepicker's shadow DOM, we walk up to the datepicker element
|
|
4862
|
-
// so we set inert on its siblings — not on the datepicker itself.
|
|
4863
|
-
let host = this;
|
|
4864
|
-
while (host.getRootNode() instanceof ShadowRoot) {
|
|
4865
|
-
host = host.getRootNode().host;
|
|
4866
|
-
}
|
|
4867
|
-
|
|
4868
|
-
// Walk up the ancestor chain, inerting siblings at each level
|
|
4869
|
-
// to ensure the entire page outside the host subtree is inert.
|
|
4870
|
-
let current = host;
|
|
4871
|
-
while (current.parentElement) {
|
|
4872
|
-
const parent = current.parentElement;
|
|
4873
|
-
for (const sibling of parent.children) {
|
|
4874
|
-
if (sibling !== current && !sibling.inert) {
|
|
4875
|
-
sibling.inert = true;
|
|
4876
|
-
this._inertSiblings.push(sibling);
|
|
4877
|
-
}
|
|
4878
|
-
}
|
|
4879
|
-
current = parent;
|
|
4880
|
-
}
|
|
4881
|
-
}
|
|
4882
|
-
|
|
4883
|
-
/**
|
|
4884
|
-
* Restores `inert` state on siblings that were made inert by `_setPageInert`.
|
|
4885
|
-
* @private
|
|
4886
|
-
*/
|
|
4887
|
-
_clearPageInert() {
|
|
4888
|
-
if (this._inertSiblings) {
|
|
4889
|
-
for (const sibling of this._inertSiblings) {
|
|
4890
|
-
sibling.inert = false;
|
|
4891
|
-
}
|
|
4892
|
-
this._inertSiblings = undefined;
|
|
4683
|
+
if (this.focusTrap) {
|
|
4684
|
+
this.focusTrap.disconnect();
|
|
4685
|
+
this.focusTrap = undefined;
|
|
4893
4686
|
}
|
|
4894
4687
|
}
|
|
4895
4688
|
|
|
@@ -5128,7 +4921,6 @@ class AuroDropdown extends AuroElement {
|
|
|
5128
4921
|
shape="${this.shape}"
|
|
5129
4922
|
?data-show="${this.isPopoverVisible}"
|
|
5130
4923
|
?isfullscreen="${this.isBibFullscreen}"
|
|
5131
|
-
?desktopmodal="${this.desktopModal}"
|
|
5132
4924
|
.dialogLabel="${this.bibDialogLabel}"
|
|
5133
4925
|
${ref(this.bibElement)}
|
|
5134
4926
|
>
|