@aurodesignsystem/auro-formkit 5.8.1 → 5.9.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/CHANGELOG.md +7 -15
- package/components/checkbox/demo/api.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/api.md +7 -6
- package/components/combobox/demo/api.min.js +1651 -987
- package/components/combobox/demo/index.min.js +1651 -987
- package/components/combobox/dist/auro-combobox.d.ts +9 -8
- package/components/combobox/dist/index.js +86 -85
- package/components/combobox/dist/registered.js +86 -85
- package/components/counter/demo/api.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/api.min.js +4 -3
- package/components/datepicker/demo/index.min.js +4 -3
- package/components/datepicker/dist/index.js +4 -3
- package/components/datepicker/dist/registered.js +4 -3
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/input/demo/api.min.js +2 -1
- package/components/input/demo/index.min.js +2 -1
- package/components/input/dist/index.js +2 -1
- package/components/input/dist/registered.js +2 -1
- package/components/menu/demo/api.js +4 -0
- package/components/menu/demo/api.md +271 -26
- package/components/menu/demo/api.min.js +1591 -863
- package/components/menu/demo/index.html +1 -0
- package/components/menu/demo/index.js +2 -0
- package/components/menu/demo/index.md +95 -1
- package/components/menu/demo/index.min.js +1524 -810
- package/components/menu/dist/auro-menu.context.d.ts +222 -0
- package/components/menu/dist/auro-menu.d.ts +93 -53
- package/components/menu/dist/auro-menuoption.d.ts +115 -13
- package/components/menu/dist/index.js +1441 -798
- package/components/menu/dist/registered.js +1440 -809
- package/components/radio/demo/api.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/api.md +8 -7
- package/components/select/demo/api.min.js +1573 -1006
- package/components/select/demo/index.min.js +1573 -1006
- package/components/select/dist/auro-select.d.ts +11 -35
- package/components/select/dist/index.js +64 -160
- package/components/select/dist/registered.js +64 -160
- package/package.json +2 -1
|
@@ -152,23 +152,11 @@ export class AuroSelect extends AuroElement {
|
|
|
152
152
|
type: BooleanConstructor;
|
|
153
153
|
reflect: boolean;
|
|
154
154
|
};
|
|
155
|
-
/**
|
|
156
|
-
* @private
|
|
157
|
-
*/
|
|
158
|
-
optionActive: {
|
|
159
|
-
type: ObjectConstructor;
|
|
160
|
-
};
|
|
161
155
|
/**
|
|
162
156
|
* Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true.
|
|
163
157
|
* @type {HTMLElement|Array<HTMLElement>}
|
|
164
158
|
*/
|
|
165
159
|
optionSelected: HTMLElement | Array<HTMLElement>;
|
|
166
|
-
/**
|
|
167
|
-
* @private
|
|
168
|
-
*/
|
|
169
|
-
options: {
|
|
170
|
-
type: ArrayConstructor;
|
|
171
|
-
};
|
|
172
160
|
/**
|
|
173
161
|
* Position where the bib should appear relative to the trigger.
|
|
174
162
|
* Accepted values:
|
|
@@ -267,6 +255,13 @@ export class AuroSelect extends AuroElement {
|
|
|
267
255
|
reflect: boolean;
|
|
268
256
|
attribute: boolean;
|
|
269
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* @private
|
|
260
|
+
*/
|
|
261
|
+
options: {
|
|
262
|
+
type: ArrayConstructor;
|
|
263
|
+
state: boolean;
|
|
264
|
+
};
|
|
270
265
|
};
|
|
271
266
|
static get styles(): import("lit").CSSResult[];
|
|
272
267
|
/**
|
|
@@ -327,9 +322,6 @@ export class AuroSelect extends AuroElement {
|
|
|
327
322
|
*/
|
|
328
323
|
private privateDefaults;
|
|
329
324
|
appearance: string;
|
|
330
|
-
options: any[] | Element[];
|
|
331
|
-
optionActive: any;
|
|
332
|
-
optionSelected: any;
|
|
333
325
|
value: any;
|
|
334
326
|
fullscreenBreakpoint: string;
|
|
335
327
|
onDark: boolean;
|
|
@@ -389,6 +381,8 @@ export class AuroSelect extends AuroElement {
|
|
|
389
381
|
menu: Element;
|
|
390
382
|
defaultMenuSize: string;
|
|
391
383
|
defaultMenuShape: string;
|
|
384
|
+
options: any;
|
|
385
|
+
optionSelected: any;
|
|
392
386
|
/**
|
|
393
387
|
* Binds all behavior needed to the component after rendering.
|
|
394
388
|
* @private
|
|
@@ -444,26 +438,14 @@ export class AuroSelect extends AuroElement {
|
|
|
444
438
|
* @returns {void}
|
|
445
439
|
*/
|
|
446
440
|
private handleSlotChange;
|
|
447
|
-
/**
|
|
448
|
-
* Determines the element error state based on the `required` attribute and input value.
|
|
449
|
-
* @private
|
|
450
|
-
* @returns {void}
|
|
451
|
-
*/
|
|
452
|
-
private generateOptionsArray;
|
|
453
441
|
/**
|
|
454
442
|
* Resets all options to their default state.
|
|
455
443
|
* @private
|
|
456
444
|
*/
|
|
457
445
|
private clearSelection;
|
|
458
446
|
firstUpdated(): void;
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
* @param {string} value - The value to set in the menu.
|
|
462
|
-
* @returns {void}
|
|
463
|
-
* @private
|
|
464
|
-
*/
|
|
465
|
-
private updateMenuValue;
|
|
466
|
-
updated(changedProperties: any): Promise<void>;
|
|
447
|
+
setMenuValue(value: any): void;
|
|
448
|
+
updated(changedProperties: any): void;
|
|
467
449
|
/**
|
|
468
450
|
* Resets component to initial state.
|
|
469
451
|
* @returns {void}
|
|
@@ -487,12 +469,6 @@ export class AuroSelect extends AuroElement {
|
|
|
487
469
|
* @private
|
|
488
470
|
*/
|
|
489
471
|
private _updateNativeSelect;
|
|
490
|
-
/**
|
|
491
|
-
* Returns HTML for the hidden a11y screen reader content.
|
|
492
|
-
* @private
|
|
493
|
-
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
494
|
-
*/
|
|
495
|
-
private renderAriaHtml;
|
|
496
472
|
/**
|
|
497
473
|
* Returns HTML for the hidden HTML5 select.
|
|
498
474
|
* @private
|
|
@@ -4221,7 +4221,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
4221
4221
|
}
|
|
4222
4222
|
};
|
|
4223
4223
|
|
|
4224
|
-
var formkitVersion$1 = '
|
|
4224
|
+
var formkitVersion$1 = '202511191711';
|
|
4225
4225
|
|
|
4226
4226
|
class AuroElement extends LitElement {
|
|
4227
4227
|
static get properties() {
|
|
@@ -5859,7 +5859,7 @@ class AuroHelpText extends LitElement {
|
|
|
5859
5859
|
}
|
|
5860
5860
|
}
|
|
5861
5861
|
|
|
5862
|
-
var formkitVersion = '
|
|
5862
|
+
var formkitVersion = '202511191711';
|
|
5863
5863
|
|
|
5864
5864
|
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);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-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, 450);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, 450);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}`;
|
|
5865
5865
|
|
|
@@ -5972,9 +5972,6 @@ class AuroSelect extends AuroElement$1 {
|
|
|
5972
5972
|
*/
|
|
5973
5973
|
privateDefaults() {
|
|
5974
5974
|
this.appearance = 'default';
|
|
5975
|
-
this.options = [];
|
|
5976
|
-
this.optionActive = null;
|
|
5977
|
-
this.optionSelected = undefined;
|
|
5978
5975
|
this.value = undefined;
|
|
5979
5976
|
this.fullscreenBreakpoint = 'sm';
|
|
5980
5977
|
this.onDark = false;
|
|
@@ -6141,13 +6138,6 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6141
6138
|
reflect: true
|
|
6142
6139
|
},
|
|
6143
6140
|
|
|
6144
|
-
/**
|
|
6145
|
-
* @private
|
|
6146
|
-
*/
|
|
6147
|
-
optionActive: {
|
|
6148
|
-
type: Object
|
|
6149
|
-
},
|
|
6150
|
-
|
|
6151
6141
|
/**
|
|
6152
6142
|
* Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true.
|
|
6153
6143
|
* @type {HTMLElement|Array<HTMLElement>}
|
|
@@ -6156,13 +6146,6 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6156
6146
|
type: Object
|
|
6157
6147
|
},
|
|
6158
6148
|
|
|
6159
|
-
/**
|
|
6160
|
-
* @private
|
|
6161
|
-
*/
|
|
6162
|
-
options: {
|
|
6163
|
-
type: Array
|
|
6164
|
-
},
|
|
6165
|
-
|
|
6166
6149
|
/**
|
|
6167
6150
|
* Position where the bib should appear relative to the trigger.
|
|
6168
6151
|
* Accepted values:
|
|
@@ -6277,6 +6260,14 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6277
6260
|
reflect: false,
|
|
6278
6261
|
attribute: false
|
|
6279
6262
|
},
|
|
6263
|
+
|
|
6264
|
+
/**
|
|
6265
|
+
* @private
|
|
6266
|
+
*/
|
|
6267
|
+
options: {
|
|
6268
|
+
type: Array,
|
|
6269
|
+
state: true
|
|
6270
|
+
},
|
|
6280
6271
|
};
|
|
6281
6272
|
}
|
|
6282
6273
|
|
|
@@ -6296,16 +6287,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6296
6287
|
* @returns {String|Array<String>}
|
|
6297
6288
|
*/
|
|
6298
6289
|
get formattedValue() {
|
|
6299
|
-
|
|
6300
|
-
if (!this.value) {
|
|
6301
|
-
return undefined;
|
|
6302
|
-
}
|
|
6303
|
-
if (this.value.startsWith("[")) {
|
|
6304
|
-
return JSON.parse(this.value);
|
|
6305
|
-
}
|
|
6306
|
-
return [this.value];
|
|
6307
|
-
}
|
|
6308
|
-
return this.value;
|
|
6290
|
+
return this.menu.formattedValue;
|
|
6309
6291
|
}
|
|
6310
6292
|
|
|
6311
6293
|
/**
|
|
@@ -6439,14 +6421,25 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6439
6421
|
});
|
|
6440
6422
|
|
|
6441
6423
|
// Handle selected options
|
|
6442
|
-
if (this.optionSelected) {
|
|
6443
|
-
if (this.multiSelect && this.optionSelected.length > 0) {
|
|
6444
|
-
const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
|
|
6424
|
+
if (this.menu && this.menu.optionSelected) {
|
|
6445
6425
|
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6426
|
+
// If multiSelect and we got an array of selected options
|
|
6427
|
+
if (this.multiSelect && Array.isArray(this.menu.optionSelected)) {
|
|
6428
|
+
|
|
6429
|
+
// If we have selected options, join and display their text content
|
|
6430
|
+
if (this.menu.optionSelected.length > 0) {
|
|
6431
|
+
const displayText = this.menu.optionSelected.map((option) => option.textContent).join(', ');
|
|
6432
|
+
valueElem.textContent = displayText;
|
|
6433
|
+
|
|
6434
|
+
// If no selected options, clear out value display
|
|
6435
|
+
} else {
|
|
6436
|
+
valueElem.textContent = '';
|
|
6437
|
+
}
|
|
6438
|
+
|
|
6439
|
+
// If single select and we got an option that was selected, update value display
|
|
6440
|
+
} else if (!this.multiSelect && this.menu && this.menu.optionSelected instanceof HTMLElement) {
|
|
6441
|
+
valueElem.innerHTML = this.menu.optionSelected.innerHTML;
|
|
6442
|
+
const displayValueEl = this.menu.optionSelected.querySelector("[slot='displayValue']");
|
|
6450
6443
|
|
|
6451
6444
|
if (displayValueEl) {
|
|
6452
6445
|
this.appendChild(displayValueEl.cloneNode(true));
|
|
@@ -6510,57 +6503,28 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6510
6503
|
}
|
|
6511
6504
|
|
|
6512
6505
|
this.updateMenuShapeSize();
|
|
6513
|
-
this.
|
|
6506
|
+
this.setMenuValue(this.value);
|
|
6514
6507
|
|
|
6515
6508
|
if (this.multiSelect) {
|
|
6516
6509
|
this.menu.multiSelect = this.multiSelect;
|
|
6517
6510
|
}
|
|
6518
6511
|
|
|
6519
|
-
this.
|
|
6512
|
+
this.options = this.menu.options;
|
|
6520
6513
|
this.menu.setAttribute('aria-hidden', 'true');
|
|
6514
|
+
this.menu.addEventListener("auroMenu-loadingChange", (event) => this.handleMenuLoadingChange(event));
|
|
6515
|
+
this.menu.addEventListener('auroMenu-selectedOption', (event) => {
|
|
6521
6516
|
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
this.menu.addEventListener('auroMenu-activatedOption', (evt) => {
|
|
6525
|
-
this.optionActive = evt.detail;
|
|
6526
|
-
});
|
|
6517
|
+
// Update the displayed value
|
|
6518
|
+
this.updateDisplayedValue();
|
|
6527
6519
|
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
this.optionSelected = this.
|
|
6531
|
-
// For single select, we still use arrays but only take first value
|
|
6532
|
-
this.value = this.menu.value;
|
|
6520
|
+
// Update the internal value to match
|
|
6521
|
+
this.value = event.detail.stringValue;
|
|
6522
|
+
this.optionSelected = this.multiSelect ? event.detail.options : event.detail.options[0];
|
|
6533
6523
|
|
|
6534
6524
|
if (this.dropdown.isPopoverVisible) {
|
|
6535
6525
|
this.dropdown.hide();
|
|
6536
6526
|
}
|
|
6537
6527
|
});
|
|
6538
|
-
|
|
6539
|
-
/**
|
|
6540
|
-
* When this.value is preset auro-menu.selectByValue(this.value) is called.
|
|
6541
|
-
* However, if this.value does not match one of the menu options,
|
|
6542
|
-
* auro-menu will notify via event. In this case, clear out this.value
|
|
6543
|
-
* so that it is not storing an invalid value which can then later be returned
|
|
6544
|
-
* with `auro-select.value`.
|
|
6545
|
-
*/
|
|
6546
|
-
this.menu.addEventListener('auroMenu-selectValueFailure', () => {
|
|
6547
|
-
this.menu.clearSelection();
|
|
6548
|
-
});
|
|
6549
|
-
|
|
6550
|
-
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
6551
|
-
this.optionSelected = this.menu.optionSelected;
|
|
6552
|
-
this.validate(this);
|
|
6553
|
-
});
|
|
6554
|
-
|
|
6555
|
-
this.menu.addEventListener('auroMenu-activatedOption', (evt) => {
|
|
6556
|
-
if (evt.detail) {
|
|
6557
|
-
evt.detail.scrollIntoView({
|
|
6558
|
-
alignToTop: false,
|
|
6559
|
-
block: "nearest",
|
|
6560
|
-
behavior: "smooth"
|
|
6561
|
-
});
|
|
6562
|
-
}
|
|
6563
|
-
});
|
|
6564
6528
|
}
|
|
6565
6529
|
|
|
6566
6530
|
/**
|
|
@@ -6572,6 +6536,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6572
6536
|
this.nativeSelect = this.shadowRoot.querySelector('select');
|
|
6573
6537
|
|
|
6574
6538
|
this.addEventListener('keydown', (evt) => {
|
|
6539
|
+
|
|
6575
6540
|
// when the focus is on trigger not on close button
|
|
6576
6541
|
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
6577
6542
|
if (evt.key === 'ArrowUp') {
|
|
@@ -6612,7 +6577,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6612
6577
|
if (this.dropdown.isBibFullscreen) {
|
|
6613
6578
|
evt.preventDefault();
|
|
6614
6579
|
|
|
6615
|
-
|
|
6580
|
+
// when the focus is on trigger not on close button
|
|
6616
6581
|
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
6617
6582
|
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
6618
6583
|
// when bib it not open, it will focus onto trigger.
|
|
@@ -6657,7 +6622,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6657
6622
|
this.lastLetter = key;
|
|
6658
6623
|
|
|
6659
6624
|
// Get all the options that start with the last letter pressed
|
|
6660
|
-
const letterOptions = this.options.filter((option) => {
|
|
6625
|
+
const letterOptions = this.menu.options.filter((option) => {
|
|
6661
6626
|
const optionText = option.value || '';
|
|
6662
6627
|
return optionText.toLowerCase().startsWith(this.lastLetter);
|
|
6663
6628
|
});
|
|
@@ -6673,8 +6638,7 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6673
6638
|
|
|
6674
6639
|
// Select the new option in the menu
|
|
6675
6640
|
const newOption = letterOptions[index];
|
|
6676
|
-
|
|
6677
|
-
this.menu.updateActiveOption(newOptionIndex);
|
|
6641
|
+
this.menu.updateActiveOption(newOption);
|
|
6678
6642
|
}
|
|
6679
6643
|
}
|
|
6680
6644
|
|
|
@@ -6754,27 +6718,12 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6754
6718
|
});
|
|
6755
6719
|
}
|
|
6756
6720
|
|
|
6757
|
-
/**
|
|
6758
|
-
* Determines the element error state based on the `required` attribute and input value.
|
|
6759
|
-
* @private
|
|
6760
|
-
* @returns {void}
|
|
6761
|
-
*/
|
|
6762
|
-
generateOptionsArray() {
|
|
6763
|
-
if (this.menu) {
|
|
6764
|
-
this.options = [...this.menu.querySelectorAll('auro-menuoption, [auro-menuoption]')];
|
|
6765
|
-
} else {
|
|
6766
|
-
this.options = [];
|
|
6767
|
-
}
|
|
6768
|
-
}
|
|
6769
|
-
|
|
6770
6721
|
/**
|
|
6771
6722
|
* Resets all options to their default state.
|
|
6772
6723
|
* @private
|
|
6773
6724
|
*/
|
|
6774
6725
|
clearSelection() {
|
|
6775
6726
|
this.value = undefined;
|
|
6776
|
-
this.optionSelected = undefined;
|
|
6777
|
-
|
|
6778
6727
|
this.menu.multiSelect = this.multiSelect;
|
|
6779
6728
|
}
|
|
6780
6729
|
|
|
@@ -6813,42 +6762,23 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6813
6762
|
this.configureSelect();
|
|
6814
6763
|
}
|
|
6815
6764
|
|
|
6816
|
-
|
|
6817
|
-
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
6818
|
-
* @param {string} value - The value to set in the menu.
|
|
6819
|
-
* @returns {void}
|
|
6820
|
-
* @private
|
|
6821
|
-
*/
|
|
6822
|
-
async updateMenuValue(value) {
|
|
6765
|
+
setMenuValue(value) {
|
|
6823
6766
|
if (!this.menu) return;
|
|
6824
|
-
|
|
6825
|
-
this.menu.setAttribute('value', value);
|
|
6826
|
-
if (value) {
|
|
6827
|
-
this.menu.value = value;
|
|
6828
|
-
} else {
|
|
6829
|
-
this.menu.reset();
|
|
6830
|
-
}
|
|
6831
|
-
await this.menu.updateComplete;
|
|
6767
|
+
this.menu.value = value;
|
|
6832
6768
|
}
|
|
6833
6769
|
|
|
6834
|
-
|
|
6770
|
+
updated(changedProperties) {
|
|
6835
6771
|
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
6836
6772
|
this.clearSelection();
|
|
6837
6773
|
}
|
|
6838
6774
|
|
|
6839
6775
|
if (changedProperties.has('value')) {
|
|
6840
|
-
|
|
6841
|
-
await this.updateMenuValue(this.value);
|
|
6842
|
-
|
|
6843
|
-
if (this.menu) {
|
|
6844
|
-
this.optionSelected = this.menu.optionSelected;
|
|
6845
|
-
}
|
|
6846
|
-
} else {
|
|
6847
|
-
await this.updateMenuValue(undefined);
|
|
6848
|
-
}
|
|
6776
|
+
this.setMenuValue(this.value);
|
|
6849
6777
|
|
|
6850
6778
|
this._updateNativeSelect();
|
|
6851
6779
|
this.validate();
|
|
6780
|
+
this.hideBib();
|
|
6781
|
+
this.focus();
|
|
6852
6782
|
|
|
6853
6783
|
// LEGACY EVENT
|
|
6854
6784
|
this.dispatchEvent(new CustomEvent('auroSelect-valueSet', {
|
|
@@ -6862,16 +6792,12 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6862
6792
|
cancelable: true,
|
|
6863
6793
|
composed: true,
|
|
6864
6794
|
detail: {
|
|
6865
|
-
optionSelected: this.optionSelected,
|
|
6866
|
-
value: this.
|
|
6795
|
+
optionSelected: this.menu.optionSelected,
|
|
6796
|
+
value: this.menu.value
|
|
6867
6797
|
}
|
|
6868
6798
|
}));
|
|
6869
6799
|
}
|
|
6870
6800
|
|
|
6871
|
-
if (changedProperties.has('optionSelected')) {
|
|
6872
|
-
this.updateDisplayedValue();
|
|
6873
|
-
}
|
|
6874
|
-
|
|
6875
6801
|
if (changedProperties.has('error')) {
|
|
6876
6802
|
this.validate(true);
|
|
6877
6803
|
this.nativeSelect.setCustomValidity(this.error || '');
|
|
@@ -6920,10 +6846,11 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6920
6846
|
*/
|
|
6921
6847
|
_handleNativeSelectChange(event) {
|
|
6922
6848
|
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
6849
|
+
if (!selectedOption) return;
|
|
6923
6850
|
const selectedValue = selectedOption.value;
|
|
6924
6851
|
|
|
6925
6852
|
if (this.multiSelect) {
|
|
6926
|
-
const currentArray = this.
|
|
6853
|
+
const currentArray = this.menu.value || [];
|
|
6927
6854
|
|
|
6928
6855
|
if (!currentArray.includes(selectedValue)) {
|
|
6929
6856
|
this.value = JSON.stringify([
|
|
@@ -6946,40 +6873,17 @@ class AuroSelect extends AuroElement$1 {
|
|
|
6946
6873
|
* @private
|
|
6947
6874
|
*/
|
|
6948
6875
|
_updateNativeSelect() {
|
|
6949
|
-
if (!this.nativeSelect)
|
|
6950
|
-
return;
|
|
6951
|
-
}
|
|
6876
|
+
if (!this.nativeSelect) return;
|
|
6952
6877
|
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
} else {
|
|
6956
|
-
this.nativeSelect.value = this.value || '';
|
|
6957
|
-
}
|
|
6958
|
-
}
|
|
6878
|
+
let { formattedValue } = this;
|
|
6879
|
+
if (!formattedValue) formattedValue = this.multiSelect ? [] : '';
|
|
6959
6880
|
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
*/
|
|
6965
|
-
renderAriaHtml() {
|
|
6966
|
-
return html`
|
|
6967
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
6968
|
-
${this.optionActive && this.options.length > 0
|
|
6969
|
-
? html`
|
|
6970
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
6971
|
-
`
|
|
6972
|
-
: undefined
|
|
6973
|
-
};
|
|
6881
|
+
const currentValue = this.nativeSelect.value;
|
|
6882
|
+
const newValue = this.multiSelect
|
|
6883
|
+
? formattedValue[0] || ''
|
|
6884
|
+
: this.value || '';
|
|
6974
6885
|
|
|
6975
|
-
|
|
6976
|
-
? html`
|
|
6977
|
-
${`${this.optionSelected.innerText} selected`}
|
|
6978
|
-
`
|
|
6979
|
-
: undefined
|
|
6980
|
-
};
|
|
6981
|
-
</div>
|
|
6982
|
-
`;
|
|
6886
|
+
if (currentValue !== newValue) this.nativeSelect.value = newValue || '';
|
|
6983
6887
|
}
|
|
6984
6888
|
|
|
6985
6889
|
/**
|
|
@@ -7000,16 +6904,16 @@ class AuroSelect extends AuroElement$1 {
|
|
|
7000
6904
|
autocomplete="${ifDefined$1(this.autocomplete)}"
|
|
7001
6905
|
@change="${this._handleNativeSelectChange}">
|
|
7002
6906
|
<option value="" ?selected="${!this.value}"></option>
|
|
7003
|
-
${this.options.map((option) => {
|
|
7004
|
-
|
|
7005
|
-
|
|
6907
|
+
${this.menu && Array.isArray(this.menu.options) && this.menu.options.map((option) => {
|
|
6908
|
+
const optionValue = option.value || option.textContent;
|
|
6909
|
+
return html`
|
|
7006
6910
|
<option
|
|
7007
6911
|
value="${optionValue}"
|
|
7008
6912
|
?selected="${this.value === optionValue}">
|
|
7009
6913
|
${option.textContent}
|
|
7010
6914
|
</option>
|
|
7011
6915
|
`;
|
|
7012
|
-
|
|
6916
|
+
})}
|
|
7013
6917
|
</select>
|
|
7014
6918
|
</div>
|
|
7015
6919
|
`;
|