@aurodesignsystem-dev/auro-formkit 0.0.0-pr1514.2 → 0.0.0-pr1514.4
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/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 +4 -3
- package/components/combobox/demo/getting-started.min.js +4 -3
- package/components/combobox/demo/index.min.js +4 -3
- package/components/combobox/dist/index.js +4 -3
- package/components/combobox/dist/registered.js +4 -3
- package/components/counter/demo/customize.min.js +10 -2
- package/components/counter/demo/index.min.js +10 -2
- package/components/counter/dist/index.js +10 -2
- package/components/counter/dist/registered.js +10 -2
- package/components/datepicker/demo/customize.min.js +17 -7
- package/components/datepicker/demo/index.min.js +17 -7
- package/components/datepicker/dist/auro-calendar.d.ts +4 -2
- package/components/datepicker/dist/index.js +17 -7
- package/components/datepicker/dist/registered.js +17 -7
- package/components/dropdown/demo/customize.min.js +2 -1
- package/components/dropdown/demo/getting-started.min.js +2 -1
- package/components/dropdown/demo/index.min.js +2 -1
- package/components/dropdown/dist/index.js +2 -1
- package/components/dropdown/dist/registered.js +2 -1
- package/components/form/demo/customize.min.js +220 -77
- package/components/form/demo/getting-started.min.js +220 -77
- package/components/form/demo/index.min.js +220 -77
- package/components/form/demo/registerDemoDeps.min.js +220 -77
- 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/customize.min.js +1 -1
- package/components/radio/demo/getting-started.min.js +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 +186 -62
- package/components/select/demo/getting-started.min.js +186 -62
- package/components/select/demo/index.min.js +186 -62
- package/components/select/demo/keyboard-behavior.md +18 -4
- package/components/select/dist/auro-select.d.ts +20 -8
- package/components/select/dist/index.js +186 -62
- package/components/select/dist/registered.js +186 -62
- package/custom-elements.json +14 -18
- package/package.json +1 -1
|
@@ -916,19 +916,28 @@ const selectKeyboardStrategy = {
|
|
|
916
916
|
},
|
|
917
917
|
|
|
918
918
|
End(component, evt, ctx) {
|
|
919
|
-
if (!ctx.isExpanded) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
919
|
evt.preventDefault();
|
|
923
920
|
evt.stopPropagation();
|
|
924
921
|
// `pop()` is safe here: getEnabledOptions returns a fresh filtered array.
|
|
925
922
|
const lastOption = getEnabledOptions(component.menu).pop();
|
|
926
|
-
if (lastOption) {
|
|
927
|
-
|
|
923
|
+
if (!lastOption) {
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
// Pre-stash before show() so the auroDropdown-toggled handler's
|
|
927
|
+
// `!optionActive` guard short-circuits the firstActive/selected fallback —
|
|
928
|
+
// otherwise show() synchronously fires the handler and writes
|
|
929
|
+
// aria-activedescendant once before we overwrite it.
|
|
930
|
+
component.menu.updateActiveOption(lastOption);
|
|
931
|
+
if (!ctx.isExpanded) {
|
|
932
|
+
component.dropdown.show();
|
|
928
933
|
}
|
|
929
934
|
},
|
|
930
935
|
|
|
931
936
|
Enter(component, evt, ctx) {
|
|
937
|
+
// Prevent the keypress from bubbling to parent containers (e.g., forms)
|
|
938
|
+
// which could interpret Enter as a submit. Matches APG select-only combobox
|
|
939
|
+
// and native <select> behavior: Enter opens the listbox when closed, selects
|
|
940
|
+
// the active option when open — it does not submit a parent form.
|
|
932
941
|
evt.preventDefault();
|
|
933
942
|
evt.stopPropagation();
|
|
934
943
|
if (!ctx.isExpanded) {
|
|
@@ -939,14 +948,16 @@ const selectKeyboardStrategy = {
|
|
|
939
948
|
},
|
|
940
949
|
|
|
941
950
|
Home(component, evt, ctx) {
|
|
942
|
-
if (!ctx.isExpanded) {
|
|
943
|
-
return;
|
|
944
|
-
}
|
|
945
951
|
evt.preventDefault();
|
|
946
952
|
evt.stopPropagation();
|
|
947
953
|
const [firstOption] = getEnabledOptions(component.menu);
|
|
948
|
-
if (firstOption) {
|
|
949
|
-
|
|
954
|
+
if (!firstOption) {
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
// See End() for why this must run before show().
|
|
958
|
+
component.menu.updateActiveOption(firstOption);
|
|
959
|
+
if (!ctx.isExpanded) {
|
|
960
|
+
component.dropdown.show();
|
|
950
961
|
}
|
|
951
962
|
},
|
|
952
963
|
|
|
@@ -4894,7 +4905,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
4894
4905
|
}
|
|
4895
4906
|
};
|
|
4896
4907
|
|
|
4897
|
-
var formkitVersion$1 = '
|
|
4908
|
+
var formkitVersion$1 = '202606291737';
|
|
4898
4909
|
|
|
4899
4910
|
class AuroElement extends LitElement {
|
|
4900
4911
|
static get properties() {
|
|
@@ -6166,6 +6177,7 @@ class AuroDropdown extends AuroElement {
|
|
|
6166
6177
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
6167
6178
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
6168
6179
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
6180
|
+
aria-haspopup="${ifDefined(this.a11yRole === 'combobox' && !this.triggerContentFocusable ? 'listbox' : undefined)}"
|
|
6169
6181
|
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
6170
6182
|
aria-disabled="${ifDefined(this.disabled ? 'true' : undefined)}"
|
|
6171
6183
|
@focusin="${this.handleFocusin}"
|
|
@@ -6915,7 +6927,7 @@ class AuroHelpText extends LitElement {
|
|
|
6915
6927
|
}
|
|
6916
6928
|
}
|
|
6917
6929
|
|
|
6918
|
-
var formkitVersion = '
|
|
6930
|
+
var formkitVersion = '202606291737';
|
|
6919
6931
|
|
|
6920
6932
|
var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, 0.875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, 0.75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-outline-color: var(--ds-auro-select-outline-color)}:host{display:inline-block;text-align:left;vertical-align:top}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}:host([layout*=emphasized]) .mainContent,:host([layout*=snowflake]) .mainContent{text-align:center}.mainContent{position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host([layout*=snowflake]) label{padding-block:var(--ds-size-25, 0.125rem)}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) .value{height:auto}label{color:var(--ds-auro-select-label-text-color)}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown],:host([appearance=inverse]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([fluid]){width:100%}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown],:host([disabled]:not([appearance=inverse])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown],:host(:not([layout*=classic])[disabled][appearance=inverse]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
6921
6933
|
|
|
@@ -7247,14 +7259,6 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7247
7259
|
reflect: true
|
|
7248
7260
|
},
|
|
7249
7261
|
|
|
7250
|
-
/**
|
|
7251
|
-
* @private
|
|
7252
|
-
*/
|
|
7253
|
-
options: {
|
|
7254
|
-
type: Array,
|
|
7255
|
-
state: true
|
|
7256
|
-
},
|
|
7257
|
-
|
|
7258
7262
|
/**
|
|
7259
7263
|
* Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true.
|
|
7260
7264
|
* @type {HTMLElement|Array<HTMLElement>}
|
|
@@ -7542,16 +7546,68 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7542
7546
|
this.dropdown.dropdownWidth = this.customBibWidth;
|
|
7543
7547
|
}
|
|
7544
7548
|
|
|
7545
|
-
|
|
7546
|
-
const labelElement = this.querySelector('span[slot="label"]');
|
|
7547
|
-
if (labelElement) {
|
|
7548
|
-
this.dropdown.bibDialogLabel = labelElement.textContent.trim() || undefined;
|
|
7549
|
-
}
|
|
7549
|
+
this._syncLabelText();
|
|
7550
7550
|
|
|
7551
7551
|
// Exposes the CSS parts from the dropdown for styling
|
|
7552
7552
|
this.dropdown.exposeCssParts();
|
|
7553
7553
|
}
|
|
7554
7554
|
|
|
7555
|
+
/**
|
|
7556
|
+
* Reads the current label slot text and pushes it to the dropdown bib
|
|
7557
|
+
* (for dialog naming) and the menu (for listbox aria-label). Safe to call
|
|
7558
|
+
* before either child has been wired up — each branch self-guards.
|
|
7559
|
+
* @private
|
|
7560
|
+
*/
|
|
7561
|
+
_syncLabelText() {
|
|
7562
|
+
const labelElement = this.querySelector('[slot="label"]');
|
|
7563
|
+
const text = labelElement ? labelElement.textContent.trim() : '';
|
|
7564
|
+
if (this.dropdown) {
|
|
7565
|
+
this.dropdown.bibDialogLabel = text || undefined;
|
|
7566
|
+
}
|
|
7567
|
+
if (this.menu) {
|
|
7568
|
+
if (text) {
|
|
7569
|
+
this.menu.setAttribute('aria-label', text);
|
|
7570
|
+
} else {
|
|
7571
|
+
this.menu.removeAttribute('aria-label');
|
|
7572
|
+
}
|
|
7573
|
+
}
|
|
7574
|
+
}
|
|
7575
|
+
|
|
7576
|
+
/**
|
|
7577
|
+
* Keeps the dialog/menu accessible names in sync when consumers mutate the
|
|
7578
|
+
* label slot at runtime (e.g., i18n locale swap). `slotchange` alone is
|
|
7579
|
+
* insufficient — it doesn't fire when textContent of an already-assigned
|
|
7580
|
+
* slotted node changes, which is the common case. We scope the observer to
|
|
7581
|
+
* the label node itself (not the whole host subtree) so option-content
|
|
7582
|
+
* mutations don't trigger label re-syncs, and re-target on `slotchange`
|
|
7583
|
+
* when consumers add or replace the label element.
|
|
7584
|
+
* @private
|
|
7585
|
+
*/
|
|
7586
|
+
_observeLabelChanges() {
|
|
7587
|
+
if (this._labelObserver) return;
|
|
7588
|
+
this._labelObserver = new MutationObserver(() => this._syncLabelText());
|
|
7589
|
+
|
|
7590
|
+
const retarget = () => {
|
|
7591
|
+
this._labelObserver.disconnect();
|
|
7592
|
+
const labelElement = this.querySelector('[slot="label"]');
|
|
7593
|
+
if (labelElement) {
|
|
7594
|
+
this._labelObserver.observe(labelElement, {
|
|
7595
|
+
childList: true,
|
|
7596
|
+
subtree: true,
|
|
7597
|
+
characterData: true
|
|
7598
|
+
});
|
|
7599
|
+
}
|
|
7600
|
+
this._syncLabelText();
|
|
7601
|
+
};
|
|
7602
|
+
|
|
7603
|
+
retarget();
|
|
7604
|
+
|
|
7605
|
+
this._retargetLabelObserver = retarget;
|
|
7606
|
+
this.shadowRoot.querySelectorAll('slot[name="label"]').forEach((slot) => {
|
|
7607
|
+
slot.addEventListener('slotchange', retarget);
|
|
7608
|
+
});
|
|
7609
|
+
}
|
|
7610
|
+
|
|
7555
7611
|
/**
|
|
7556
7612
|
* This will register this element with the browser.
|
|
7557
7613
|
* @param {string} [name="auro-select"] - The name of element that you want to register to.
|
|
@@ -7702,11 +7758,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7702
7758
|
this.updateMenuShapeSize();
|
|
7703
7759
|
this.setMenuValue(this.value);
|
|
7704
7760
|
|
|
7705
|
-
|
|
7706
|
-
const labelElement = this.querySelector('[slot="label"]');
|
|
7707
|
-
if (labelElement) {
|
|
7708
|
-
this.menu.setAttribute('aria-label', labelElement.textContent.trim());
|
|
7709
|
-
}
|
|
7761
|
+
this._syncLabelText();
|
|
7710
7762
|
|
|
7711
7763
|
if (this.multiSelect) {
|
|
7712
7764
|
this.menu.multiSelect = this.multiSelect;
|
|
@@ -7718,8 +7770,21 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7718
7770
|
if (typeof this.menu.initItems === 'function') {
|
|
7719
7771
|
this.menu.initItems();
|
|
7720
7772
|
}
|
|
7721
|
-
this.options = this.menu.options;
|
|
7722
7773
|
this.updateOptionPositions();
|
|
7774
|
+
// renderNativeSelect reads this.menu.options, which the parent doesn't
|
|
7775
|
+
// observe — request an update so the hidden native <option> list reflects
|
|
7776
|
+
// the menu's options after initItems populates them.
|
|
7777
|
+
this.requestUpdate();
|
|
7778
|
+
|
|
7779
|
+
// Keep aria-setsize/aria-posinset (and the native <option> list) in sync
|
|
7780
|
+
// when the menu re-initializes its items — e.g., slotchange, async/lazy
|
|
7781
|
+
// loads, value-triggered re-init. Without this, stale set-size is
|
|
7782
|
+
// announced and the native select goes stale after dynamic mutations.
|
|
7783
|
+
this.menu.addEventListener('auroMenu-optionsChange', () => {
|
|
7784
|
+
this.updateOptionPositions();
|
|
7785
|
+
this.requestUpdate();
|
|
7786
|
+
});
|
|
7787
|
+
|
|
7723
7788
|
this.menu.addEventListener("auroMenu-loadingChange", (event) => this.handleMenuLoadingChange(event));
|
|
7724
7789
|
|
|
7725
7790
|
this.menu.addEventListener("auroMenu-selectValueFailure", () => {
|
|
@@ -7738,11 +7803,26 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7738
7803
|
this.dropdown.setActiveDescendant(this.optionActive);
|
|
7739
7804
|
}
|
|
7740
7805
|
|
|
7741
|
-
//
|
|
7742
|
-
|
|
7806
|
+
// Live-region announce only for [not selected] options. For activations
|
|
7807
|
+
// on an already-selected option — auto-activation on bib open, arrow
|
|
7808
|
+
// navigation back to the selection, or click in multiSelect — rely on
|
|
7809
|
+
// aria-activedescendant + aria-selected="true" to convey state per the
|
|
7810
|
+
// WAI-ARIA listbox pattern. This is intentional, not limited to the
|
|
7811
|
+
// initial activation on open: it also prevents a duplicate "X, selected"
|
|
7812
|
+
// when Enter on the active+selected option re-fires
|
|
7813
|
+
// auroMenu-selectedOption (see 03b289e39).
|
|
7814
|
+
if (this.optionActive && !this.optionActive.hasAttribute('selected')) {
|
|
7743
7815
|
const optionText = this.optionActive.textContent.trim();
|
|
7744
|
-
const
|
|
7745
|
-
|
|
7816
|
+
const message = `${optionText}, not selected`;
|
|
7817
|
+
if (this.dropdown.isPopoverVisible) {
|
|
7818
|
+
announceToScreenReader(this._getAnnouncementRoot(), message);
|
|
7819
|
+
} else {
|
|
7820
|
+
// Typeahead-on-closed fires this event before `show()` flips
|
|
7821
|
+
// isPopoverVisible. Defer so the announcement targets the bib's
|
|
7822
|
+
// live region once the fullscreen <dialog> opens — otherwise it
|
|
7823
|
+
// lands in the host root, which is inert under the active modal.
|
|
7824
|
+
queueMicrotask(() => announceToScreenReader(this._getAnnouncementRoot(), message));
|
|
7825
|
+
}
|
|
7746
7826
|
}
|
|
7747
7827
|
|
|
7748
7828
|
if (this.dropdown.isPopoverVisible) {
|
|
@@ -7751,6 +7831,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7751
7831
|
});
|
|
7752
7832
|
|
|
7753
7833
|
this.menu.addEventListener('auroMenu-selectedOption', () => {
|
|
7834
|
+
const previousSelected = this.optionSelected;
|
|
7754
7835
|
|
|
7755
7836
|
// Update the displayed value
|
|
7756
7837
|
this.updateDisplayedValue();
|
|
@@ -7770,13 +7851,32 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7770
7851
|
this.dropdown.trigger.focus();
|
|
7771
7852
|
}
|
|
7772
7853
|
|
|
7773
|
-
//
|
|
7774
|
-
//
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7854
|
+
// Describe the actual change. In multiSelect, currentLabel is the
|
|
7855
|
+
// concatenated remaining list — announcing "{list}, selected" after a
|
|
7856
|
+
// deselect would falsely claim every remaining label was just added.
|
|
7857
|
+
// Diff previous vs next to recover the toggled option.
|
|
7858
|
+
let announcement = '';
|
|
7859
|
+
if (this.multiSelect) {
|
|
7860
|
+
const prev = Array.isArray(previousSelected) ? previousSelected : [];
|
|
7861
|
+
const removed = prev.find((opt) => !nextSelected.includes(opt));
|
|
7862
|
+
const added = nextSelected.find((opt) => !prev.includes(opt));
|
|
7863
|
+
if (removed) {
|
|
7864
|
+
announcement = `${removed.textContent.trim()}, not selected`;
|
|
7865
|
+
} else if (added) {
|
|
7866
|
+
announcement = `${added.textContent.trim()}, selected`;
|
|
7867
|
+
}
|
|
7868
|
+
} else {
|
|
7869
|
+
announcement = `${this.menu.currentLabel}, selected`;
|
|
7870
|
+
}
|
|
7871
|
+
|
|
7872
|
+
// Delay so the utterance isn't overridden by VoiceOver's "collapsed"
|
|
7873
|
+
// announcement from aria-expanded when the dropdown closes.
|
|
7874
|
+
if (announcement) {
|
|
7875
|
+
const announcementDelay = 300;
|
|
7876
|
+
setTimeout(() => {
|
|
7877
|
+
announceToScreenReader(this._getAnnouncementRoot(), announcement);
|
|
7878
|
+
}, announcementDelay);
|
|
7879
|
+
}
|
|
7780
7880
|
});
|
|
7781
7881
|
}
|
|
7782
7882
|
|
|
@@ -7874,24 +7974,32 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7874
7974
|
|
|
7875
7975
|
this.typeaheadBuffer += key;
|
|
7876
7976
|
|
|
7877
|
-
|
|
7977
|
+
// Prefer the literal buffer as a prefix per WAI-ARIA APG ("focus moves to the
|
|
7978
|
+
// next item with a name that starts with the string of characters typed").
|
|
7979
|
+
// Only fall back to single-char cycling when the repeated buffer has no
|
|
7980
|
+
// longer prefix match — e.g. "aa" cycles through ["Apple", "Apricot"] only
|
|
7981
|
+
// because no option starts with "aa".
|
|
7982
|
+
let match = options.find((option) => this._getOptionDisplayText(option).startsWith(this.typeaheadBuffer));
|
|
7878
7983
|
|
|
7879
|
-
|
|
7984
|
+
const isRepeatedChar = !match && this.typeaheadBuffer.length > 1 && new Set(this.typeaheadBuffer).size === 1;
|
|
7880
7985
|
if (isRepeatedChar) {
|
|
7881
7986
|
const matches = options.filter((option) => this._getOptionDisplayText(option).startsWith(key));
|
|
7882
7987
|
if (matches.length) {
|
|
7883
7988
|
const cycleIndex = (this.typeaheadBuffer.length - 1) % matches.length;
|
|
7884
7989
|
match = matches[cycleIndex];
|
|
7885
7990
|
}
|
|
7886
|
-
} else {
|
|
7887
|
-
match = options.find((option) => this._getOptionDisplayText(option).startsWith(this.typeaheadBuffer));
|
|
7888
7991
|
}
|
|
7889
7992
|
|
|
7993
|
+
// Intentional: no-match leaves the bib closed (deviates from APG / some native <select>).
|
|
7890
7994
|
if (match) {
|
|
7995
|
+
// Pre-stash the match so the auroDropdown-toggled handler's `!optionActive`
|
|
7996
|
+
// guard short-circuits and skips the firstActive/selected fallback —
|
|
7997
|
+
// otherwise show() synchronously fires the handler, which writes
|
|
7998
|
+
// aria-activedescendant once before we overwrite it.
|
|
7999
|
+
this.menu.updateActiveOption(match);
|
|
7891
8000
|
if (!this.dropdown.isPopoverVisible) {
|
|
7892
8001
|
this.dropdown.show();
|
|
7893
8002
|
}
|
|
7894
|
-
this.menu.updateActiveOption(match);
|
|
7895
8003
|
}
|
|
7896
8004
|
}
|
|
7897
8005
|
|
|
@@ -8008,6 +8116,28 @@ class AuroSelect extends AuroElement$1 {
|
|
|
8008
8116
|
disconnectedCallback() {
|
|
8009
8117
|
super.disconnectedCallback();
|
|
8010
8118
|
this._clearTypeaheadBuffer();
|
|
8119
|
+
if (this._labelObserver) {
|
|
8120
|
+
this._labelObserver.disconnect();
|
|
8121
|
+
this._labelObserver = null;
|
|
8122
|
+
}
|
|
8123
|
+
if (this._retargetLabelObserver && this.shadowRoot) {
|
|
8124
|
+
this.shadowRoot.querySelectorAll('slot[name="label"]').forEach((slot) => {
|
|
8125
|
+
slot.removeEventListener('slotchange', this._retargetLabelObserver);
|
|
8126
|
+
});
|
|
8127
|
+
this._retargetLabelObserver = null;
|
|
8128
|
+
}
|
|
8129
|
+
}
|
|
8130
|
+
|
|
8131
|
+
connectedCallback() {
|
|
8132
|
+
super.connectedCallback();
|
|
8133
|
+
// Regression guard: firstUpdated() fires once per instance, so the label
|
|
8134
|
+
// observer setup it triggers does NOT re-run on reconnect. After a
|
|
8135
|
+
// disconnect+reconnect (reparent, SPA route swap), runtime label mutations
|
|
8136
|
+
// would silently stop syncing menu aria-label / dropdown.bibDialogLabel
|
|
8137
|
+
// unless we re-wire the observer here.
|
|
8138
|
+
if (this.hasUpdated) {
|
|
8139
|
+
this._observeLabelChanges();
|
|
8140
|
+
}
|
|
8011
8141
|
}
|
|
8012
8142
|
|
|
8013
8143
|
// lifecycle runs only after the element's DOM has been updated the first time
|
|
@@ -8018,6 +8148,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
8018
8148
|
this.configureDropdown();
|
|
8019
8149
|
this.configureMenu();
|
|
8020
8150
|
this.configureSelect();
|
|
8151
|
+
this._observeLabelChanges();
|
|
8021
8152
|
}
|
|
8022
8153
|
|
|
8023
8154
|
setMenuValue(value) {
|
|
@@ -8150,25 +8281,18 @@ class AuroSelect extends AuroElement$1 {
|
|
|
8150
8281
|
* @private
|
|
8151
8282
|
*/
|
|
8152
8283
|
_handleNativeSelectChange(event) {
|
|
8284
|
+
// Hidden native <select> has no `multiple` attribute, so any change it fires
|
|
8285
|
+
// is a single raw value — applying it in multiSelect mode would collapse the
|
|
8286
|
+
// JSON-array `value` shape. Bfcache/autofill can reach this on a name-bearing
|
|
8287
|
+
// form control even with aria-hidden/tabindex=-1.
|
|
8288
|
+
if (this.multiSelect) return;
|
|
8289
|
+
|
|
8153
8290
|
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
8154
8291
|
if (!selectedOption) return;
|
|
8155
8292
|
const selectedValue = selectedOption.value;
|
|
8156
8293
|
|
|
8157
|
-
if (this.
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
if (!currentArray.includes(selectedValue)) {
|
|
8161
|
-
this.value = JSON.stringify([
|
|
8162
|
-
...currentArray,
|
|
8163
|
-
selectedValue
|
|
8164
|
-
]);
|
|
8165
|
-
}
|
|
8166
|
-
} else {
|
|
8167
|
-
const currentValue = this.value;
|
|
8168
|
-
|
|
8169
|
-
if (currentValue !== selectedValue) {
|
|
8170
|
-
this.value = selectedValue;
|
|
8171
|
-
}
|
|
8294
|
+
if (this.value !== selectedValue) {
|
|
8295
|
+
this.value = selectedValue;
|
|
8172
8296
|
}
|
|
8173
8297
|
}
|
|
8174
8298
|
|
package/custom-elements.json
CHANGED
|
@@ -5989,7 +5989,7 @@
|
|
|
5989
5989
|
"type": {
|
|
5990
5990
|
"text": "null"
|
|
5991
5991
|
},
|
|
5992
|
-
"description": "Cached reference to the active cell host
|
|
5992
|
+
"description": "Cached reference to the active cell host. Set by setActiveCell and\nrefreshed by scrollToActiveCell when its cache check misses (stale\nor missing). Lets scrollToActiveCell skip a full cell scan on each\narrow key.",
|
|
5993
5993
|
"privacy": "private",
|
|
5994
5994
|
"default": "null"
|
|
5995
5995
|
},
|
|
@@ -18937,6 +18937,18 @@
|
|
|
18937
18937
|
}
|
|
18938
18938
|
}
|
|
18939
18939
|
},
|
|
18940
|
+
{
|
|
18941
|
+
"kind": "method",
|
|
18942
|
+
"name": "_syncLabelText",
|
|
18943
|
+
"description": "Reads the current label slot text and pushes it to the dropdown bib\n(for dialog naming) and the menu (for listbox aria-label). Safe to call\nbefore either child has been wired up — each branch self-guards.",
|
|
18944
|
+
"privacy": "private"
|
|
18945
|
+
},
|
|
18946
|
+
{
|
|
18947
|
+
"kind": "method",
|
|
18948
|
+
"name": "_observeLabelChanges",
|
|
18949
|
+
"description": "Keeps the dialog/menu accessible names in sync when consumers mutate the\nlabel slot at runtime (e.g., i18n locale swap). `slotchange` alone is\ninsufficient — it doesn't fire when textContent of an already-assigned\nslotted node changes, which is the common case. We scope the observer to\nthe label node itself (not the whole host subtree) so option-content\nmutations don't trigger label re-syncs, and re-target on `slotchange`\nwhen consumers add or replace the label element.",
|
|
18950
|
+
"privacy": "private"
|
|
18951
|
+
},
|
|
18940
18952
|
{
|
|
18941
18953
|
"kind": "method",
|
|
18942
18954
|
"name": "register",
|
|
@@ -19655,15 +19667,6 @@
|
|
|
19655
19667
|
"module": "components/layoutElement/src/auroElement.js"
|
|
19656
19668
|
}
|
|
19657
19669
|
},
|
|
19658
|
-
{
|
|
19659
|
-
"kind": "field",
|
|
19660
|
-
"name": "options",
|
|
19661
|
-
"privacy": "private",
|
|
19662
|
-
"type": {
|
|
19663
|
-
"text": "array"
|
|
19664
|
-
},
|
|
19665
|
-
"attribute": "options"
|
|
19666
|
-
},
|
|
19667
19670
|
{
|
|
19668
19671
|
"kind": "field",
|
|
19669
19672
|
"name": "optionSelected",
|
|
@@ -20032,13 +20035,6 @@
|
|
|
20032
20035
|
"description": "DEPRECATED - use `appearance=\"inverse\"` instead.",
|
|
20033
20036
|
"fieldName": "onDark"
|
|
20034
20037
|
},
|
|
20035
|
-
{
|
|
20036
|
-
"name": "options",
|
|
20037
|
-
"type": {
|
|
20038
|
-
"text": "array"
|
|
20039
|
-
},
|
|
20040
|
-
"fieldName": "options"
|
|
20041
|
-
},
|
|
20042
20038
|
{
|
|
20043
20039
|
"name": "optionSelected",
|
|
20044
20040
|
"type": {
|
|
@@ -20216,7 +20212,7 @@
|
|
|
20216
20212
|
"type": {
|
|
20217
20213
|
"text": "object"
|
|
20218
20214
|
},
|
|
20219
|
-
"default": "{ ArrowDown(component, evt, ctx) { evt.preventDefault(); if (ctx.isExpanded) { if (evt.altKey || evt.ctrlKey || evt.metaKey) { // navigate to last enabled option selectKeyboardStrategy.End(component, evt, ctx); } else { navigateArrow(component, 'down', { ctx }); } } else { component.dropdown.show(); } }, ArrowUp(component, evt, ctx) { evt.preventDefault(); if (ctx.isExpanded) { if (evt.altKey || evt.ctrlKey || evt.metaKey) { // navigate to first enabled option selectKeyboardStrategy.Home(component, evt, ctx); } else { navigateArrow(component, 'up', { ctx }); } } else { component.dropdown.show(); } }, Escape(component, evt, ctx) { // Always clear the type-ahead buffer — Escape is a universal cancel. // Safe to call when the buffer is empty. // eslint-disable-next-line no-underscore-dangle if (typeof component._clearTypeaheadBuffer === 'function') { // eslint-disable-next-line no-underscore-dangle component._clearTypeaheadBuffer(); } if (!ctx.isExpanded) { return; } // Prevent the Escape key from bubbling up and closing any parent dialogs / drawers / popups evt.stopPropagation(); component.dropdown.hide(); }, End(component, evt, ctx) {
|
|
20215
|
+
"default": "{ ArrowDown(component, evt, ctx) { evt.preventDefault(); if (ctx.isExpanded) { if (evt.altKey || evt.ctrlKey || evt.metaKey) { // navigate to last enabled option selectKeyboardStrategy.End(component, evt, ctx); } else { navigateArrow(component, 'down', { ctx }); } } else { component.dropdown.show(); } }, ArrowUp(component, evt, ctx) { evt.preventDefault(); if (ctx.isExpanded) { if (evt.altKey || evt.ctrlKey || evt.metaKey) { // navigate to first enabled option selectKeyboardStrategy.Home(component, evt, ctx); } else { navigateArrow(component, 'up', { ctx }); } } else { component.dropdown.show(); } }, Escape(component, evt, ctx) { // Always clear the type-ahead buffer — Escape is a universal cancel. // Safe to call when the buffer is empty. // eslint-disable-next-line no-underscore-dangle if (typeof component._clearTypeaheadBuffer === 'function') { // eslint-disable-next-line no-underscore-dangle component._clearTypeaheadBuffer(); } if (!ctx.isExpanded) { return; } // Prevent the Escape key from bubbling up and closing any parent dialogs / drawers / popups evt.stopPropagation(); component.dropdown.hide(); }, End(component, evt, ctx) { evt.preventDefault(); evt.stopPropagation(); // `pop()` is safe here: getEnabledOptions returns a fresh filtered array. const lastOption = getEnabledOptions(component.menu).pop(); if (!lastOption) { return; } // Pre-stash before show() so the auroDropdown-toggled handler's // `!optionActive` guard short-circuits the firstActive/selected fallback — // otherwise show() synchronously fires the handler and writes // aria-activedescendant once before we overwrite it. component.menu.updateActiveOption(lastOption); if (!ctx.isExpanded) { component.dropdown.show(); } }, Enter(component, evt, ctx) { // Prevent the keypress from bubbling to parent containers (e.g., forms) // which could interpret Enter as a submit. Matches APG select-only combobox // and native <select> behavior: Enter opens the listbox when closed, selects // the active option when open — it does not submit a parent form. evt.preventDefault(); evt.stopPropagation(); if (!ctx.isExpanded) { component.dropdown.show(); return; } component.menu.makeSelection(); }, Home(component, evt, ctx) { evt.preventDefault(); evt.stopPropagation(); const [firstOption] = getEnabledOptions(component.menu); if (!firstOption) { return; } // See End() for why this must run before show(). component.menu.updateActiveOption(firstOption); if (!ctx.isExpanded) { component.dropdown.show(); } }, Tab(component, evt, ctx) { if (!ctx.isExpanded) { return; } // Tab selects the focused option and closes the popup per the // WAI-ARIA APG select-only combobox / listbox pattern. if (component.optionActive) { component.menu.makeSelection(); } component.dropdown.hide(); }, default(component, evt, ctx) { // Space resolves to either typeahead-buffer extension or bib toggle // depending on whether a type-ahead buffer is active. Mirrors native // <select> and the WAI-ARIA APG Listbox guidance: mid-typeahead space // is a search character (e.g. \"San Francisco\"); otherwise it toggles. if (evt.key === ' ') { evt.preventDefault(); evt.stopPropagation(); if (component.typeaheadBuffer && component.typeaheadBuffer.length > 0) { component.updateActiveOptionBasedOnKey(evt.key); return; } if (ctx.isExpanded) { component.dropdown.hide(); } else { component.dropdown.show(); } return; } component.updateActiveOptionBasedOnKey(evt.key); }, }"
|
|
20220
20216
|
}
|
|
20221
20217
|
],
|
|
20222
20218
|
"exports": [
|
package/package.json
CHANGED