@aurodesignsystem-dev/auro-formkit 0.0.0-pr750.1 → 0.0.0-pr753.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/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/demo/api.min.js +9 -9
- package/components/checkbox/demo/index.min.js +9 -9
- package/components/checkbox/dist/index.js +9 -9
- package/components/checkbox/dist/registered.js +9 -9
- package/components/combobox/demo/api.html +10 -16
- package/components/combobox/demo/api.md +6 -12
- package/components/combobox/demo/api.min.js +101 -84
- package/components/combobox/demo/index.html +10 -16
- package/components/combobox/demo/index.min.js +101 -84
- package/components/combobox/demo/readme.html +9 -16
- package/components/combobox/dist/index.js +89 -47
- package/components/combobox/dist/registered.js +89 -47
- package/components/counter/demo/api.html +10 -16
- package/components/counter/demo/api.md +7 -140
- package/components/counter/demo/api.min.js +387 -557
- package/components/counter/demo/index.html +10 -16
- package/components/counter/demo/index.md +0 -82
- package/components/counter/demo/index.min.js +387 -557
- package/components/counter/demo/readme.html +9 -16
- package/components/counter/dist/auro-counter-group.d.ts +14 -71
- package/components/counter/dist/auro-counter.d.ts +0 -10
- package/components/counter/dist/index.js +387 -557
- package/components/counter/dist/registered.js +387 -557
- package/components/datepicker/demo/api.html +10 -16
- package/components/datepicker/demo/api.min.js +95 -68
- package/components/datepicker/demo/index.html +10 -16
- package/components/datepicker/demo/index.min.js +95 -68
- package/components/datepicker/demo/readme.html +9 -16
- package/components/datepicker/dist/auro-datepicker.d.ts +0 -6
- package/components/datepicker/dist/index.js +95 -68
- package/components/datepicker/dist/registered.js +95 -68
- package/components/dropdown/demo/api.html +10 -16
- package/components/dropdown/demo/api.md +268 -76
- package/components/dropdown/demo/api.min.js +68 -26
- package/components/dropdown/demo/index.html +10 -16
- package/components/dropdown/demo/index.md +363 -45
- package/components/dropdown/demo/index.min.js +68 -26
- package/components/dropdown/demo/readme.html +9 -16
- package/components/dropdown/dist/auro-dropdown.d.ts +71 -21
- package/components/dropdown/dist/index.js +68 -26
- package/components/dropdown/dist/registered.js +68 -26
- package/components/form/demo/api.html +9 -16
- package/components/form/demo/autocomplete.html +3 -19
- package/components/form/demo/index.html +9 -16
- package/components/form/demo/readme.html +9 -16
- package/components/form/demo/working.html +13 -19
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/demo/api.html +10 -16
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +14 -14
- package/components/input/demo/index.html +10 -16
- package/components/input/demo/index.min.js +14 -14
- package/components/input/demo/readme.html +9 -16
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/index.js +14 -14
- package/components/input/dist/registered.js +14 -14
- package/components/menu/demo/api.html +32 -16
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +12 -37
- package/components/menu/demo/index.html +10 -16
- package/components/menu/demo/index.min.js +12 -37
- package/components/menu/demo/readme.html +9 -16
- package/components/menu/dist/auro-menu.d.ts +2 -13
- package/components/menu/dist/index.js +12 -37
- package/components/menu/dist/registered.js +12 -37
- package/components/radio/demo/api.html +10 -16
- package/components/radio/demo/api.min.js +10 -10
- package/components/radio/demo/index.html +10 -16
- package/components/radio/demo/index.min.js +10 -10
- package/components/radio/demo/readme.html +9 -16
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +10 -10
- package/components/radio/dist/registered.js +10 -10
- package/components/select/demo/api.html +10 -16
- package/components/select/demo/api.md +16 -19
- package/components/select/demo/api.min.js +295 -136
- package/components/select/demo/index.html +11 -16
- package/components/select/demo/index.md +1 -1
- package/components/select/demo/index.min.js +295 -136
- package/components/select/demo/readme.html +9 -16
- package/components/select/dist/auro-select.d.ts +7 -32
- package/components/select/dist/index.js +283 -99
- package/components/select/dist/registered.js +283 -99
- package/package.json +25 -26
|
@@ -689,19 +689,19 @@ class AuroFormValidation {
|
|
|
689
689
|
{
|
|
690
690
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
691
691
|
validity: 'tooShort',
|
|
692
|
-
message: e => e.
|
|
692
|
+
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
693
693
|
},
|
|
694
694
|
{
|
|
695
695
|
check: (e) => e.value?.length > e.maxLength,
|
|
696
696
|
validity: 'tooLong',
|
|
697
|
-
message: e => e.
|
|
697
|
+
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
698
698
|
}
|
|
699
699
|
],
|
|
700
700
|
pattern: [
|
|
701
701
|
{
|
|
702
702
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
703
703
|
validity: 'patternMismatch',
|
|
704
|
-
message: e => e.
|
|
704
|
+
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
705
705
|
}
|
|
706
706
|
]
|
|
707
707
|
},
|
|
@@ -896,10 +896,10 @@ class AuroFormValidation {
|
|
|
896
896
|
if (!hasValue && elem.required && elem.touched) {
|
|
897
897
|
elem.validity = 'valueMissing';
|
|
898
898
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
899
|
-
} else if (
|
|
899
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
900
900
|
this.validateType(elem);
|
|
901
901
|
this.validateElementAttributes(elem);
|
|
902
|
-
} else if (
|
|
902
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
903
903
|
this.validateElementAttributes(elem);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
@@ -4173,11 +4173,11 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
4173
4173
|
|
|
4174
4174
|
var shapeSizeCss = i$5`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
4175
4175
|
|
|
4176
|
-
var colorCss$1$2 = i$5`:host(:not([
|
|
4176
|
+
var colorCss$1$2 = i$5`:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
4177
4177
|
|
|
4178
4178
|
var classicColorCss = i$5``;
|
|
4179
4179
|
|
|
4180
|
-
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
4180
|
+
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([layout*=classic]:not([simple])) .triggerContentWrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}`;
|
|
4181
4181
|
|
|
4182
4182
|
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
4183
4183
|
|
|
@@ -4185,7 +4185,7 @@ var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex:1;fle
|
|
|
4185
4185
|
|
|
4186
4186
|
var colorCss$5 = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
4187
4187
|
|
|
4188
|
-
var styleCss$6 = i$5
|
|
4188
|
+
var styleCss$6 = i$5`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
4189
4189
|
|
|
4190
4190
|
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
4191
4191
|
|
|
@@ -4490,8 +4490,10 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
4490
4490
|
// See LICENSE in the project root for license information.
|
|
4491
4491
|
|
|
4492
4492
|
|
|
4493
|
-
|
|
4493
|
+
/**
|
|
4494
|
+
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4494
4495
|
* @slot - Default slot for the popover content.
|
|
4496
|
+
* @slot label - Defines the content of the label.
|
|
4495
4497
|
* @slot helpText - Defines the content of the helpText.
|
|
4496
4498
|
* @slot trigger - Defines the content of the trigger.
|
|
4497
4499
|
* @csspart trigger - The trigger content container.
|
|
@@ -4510,22 +4512,18 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4510
4512
|
this.matchWidth = false;
|
|
4511
4513
|
this.noHideOnThisFocusLoss = false;
|
|
4512
4514
|
|
|
4513
|
-
this.errorMessage =
|
|
4515
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
4514
4516
|
|
|
4515
4517
|
// Layout Config
|
|
4516
|
-
this.layout =
|
|
4517
|
-
this.shape =
|
|
4518
|
-
this.size =
|
|
4518
|
+
this.layout = 'classic';
|
|
4519
|
+
this.shape = 'classic';
|
|
4520
|
+
this.size = 'xl';
|
|
4519
4521
|
|
|
4520
4522
|
this.parentBorder = false;
|
|
4521
4523
|
|
|
4522
4524
|
this.privateDefaults();
|
|
4523
4525
|
}
|
|
4524
4526
|
|
|
4525
|
-
/**
|
|
4526
|
-
* @private
|
|
4527
|
-
* @returns {object} Class definition for the wrapper element.
|
|
4528
|
-
*/
|
|
4529
4527
|
get commonWrapperClasses() {
|
|
4530
4528
|
return {
|
|
4531
4529
|
'trigger': true,
|
|
@@ -4545,8 +4543,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4545
4543
|
this.disabled = false;
|
|
4546
4544
|
this.disableFocusTrap = false;
|
|
4547
4545
|
this.error = false;
|
|
4546
|
+
this.inset = false;
|
|
4547
|
+
this.rounded = false;
|
|
4548
4548
|
this.tabIndex = 0;
|
|
4549
4549
|
this.noToggle = false;
|
|
4550
|
+
this.a11yAutocomplete = 'none';
|
|
4551
|
+
this.labeled = true;
|
|
4550
4552
|
this.a11yRole = 'button';
|
|
4551
4553
|
this.onDark = false;
|
|
4552
4554
|
this.showTriggerBorders = true;
|
|
@@ -4668,27 +4670,26 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4668
4670
|
},
|
|
4669
4671
|
|
|
4670
4672
|
/**
|
|
4671
|
-
* If declared,
|
|
4672
|
-
* @default false
|
|
4673
|
+
* If declared, applies a border around the trigger slot.
|
|
4673
4674
|
*/
|
|
4674
|
-
|
|
4675
|
+
simple: {
|
|
4675
4676
|
type: Boolean,
|
|
4676
4677
|
reflect: true
|
|
4677
4678
|
},
|
|
4678
4679
|
|
|
4679
4680
|
/**
|
|
4680
|
-
* If declared,
|
|
4681
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
4682
|
+
* @attr {Boolean} chevron
|
|
4681
4683
|
*/
|
|
4682
|
-
|
|
4684
|
+
chevron: {
|
|
4683
4685
|
type: Boolean,
|
|
4684
4686
|
reflect: true
|
|
4685
4687
|
},
|
|
4686
4688
|
|
|
4687
4689
|
/**
|
|
4688
|
-
* If declared, the dropdown
|
|
4689
|
-
* @attr {Boolean} chevron
|
|
4690
|
+
* If declared, the dropdown will be styled with the common theme.
|
|
4690
4691
|
*/
|
|
4691
|
-
|
|
4692
|
+
common: {
|
|
4692
4693
|
type: Boolean,
|
|
4693
4694
|
reflect: true
|
|
4694
4695
|
},
|
|
@@ -4702,7 +4703,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4702
4703
|
},
|
|
4703
4704
|
|
|
4704
4705
|
/**
|
|
4705
|
-
* If
|
|
4706
|
+
* If declare, the focus trap inside of bib will be turned off.
|
|
4706
4707
|
*/
|
|
4707
4708
|
disableFocusTrap: {
|
|
4708
4709
|
type: Boolean,
|
|
@@ -4749,6 +4750,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4749
4750
|
reflect: true
|
|
4750
4751
|
},
|
|
4751
4752
|
|
|
4753
|
+
/**
|
|
4754
|
+
* Makes the trigger to be full width of its parent container.
|
|
4755
|
+
*/
|
|
4756
|
+
fluid: {
|
|
4757
|
+
type: Boolean,
|
|
4758
|
+
reflect: true
|
|
4759
|
+
},
|
|
4760
|
+
|
|
4761
|
+
/**
|
|
4762
|
+
* If declared, will apply padding around trigger slot content.
|
|
4763
|
+
*/
|
|
4764
|
+
inset: {
|
|
4765
|
+
type: Boolean,
|
|
4766
|
+
reflect: true
|
|
4767
|
+
},
|
|
4768
|
+
|
|
4752
4769
|
/**
|
|
4753
4770
|
* If true, the dropdown bib is displayed.
|
|
4754
4771
|
*/
|
|
@@ -4792,6 +4809,15 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4792
4809
|
reflect: true
|
|
4793
4810
|
},
|
|
4794
4811
|
|
|
4812
|
+
/**
|
|
4813
|
+
* Defines if there is a label preset.
|
|
4814
|
+
* @private
|
|
4815
|
+
*/
|
|
4816
|
+
labeled: {
|
|
4817
|
+
type: Boolean,
|
|
4818
|
+
reflect: true
|
|
4819
|
+
},
|
|
4820
|
+
|
|
4795
4821
|
/**
|
|
4796
4822
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4797
4823
|
* @private
|
|
@@ -4852,9 +4878,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4852
4878
|
reflect: true
|
|
4853
4879
|
},
|
|
4854
4880
|
|
|
4855
|
-
/**
|
|
4856
|
-
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4857
|
-
*/
|
|
4858
4881
|
onSlotChange: {
|
|
4859
4882
|
type: Function,
|
|
4860
4883
|
reflect: false
|
|
@@ -4869,6 +4892,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4869
4892
|
reflect: true
|
|
4870
4893
|
},
|
|
4871
4894
|
|
|
4895
|
+
/**
|
|
4896
|
+
* If declared, will apply border-radius to trigger and default slots.
|
|
4897
|
+
*/
|
|
4898
|
+
rounded: {
|
|
4899
|
+
type: Boolean,
|
|
4900
|
+
reflect: true
|
|
4901
|
+
},
|
|
4902
|
+
|
|
4872
4903
|
/**
|
|
4873
4904
|
* @private
|
|
4874
4905
|
*/
|
|
@@ -4883,14 +4914,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4883
4914
|
type: String || undefined,
|
|
4884
4915
|
attribute: false,
|
|
4885
4916
|
reflect: false
|
|
4917
|
+
},
|
|
4918
|
+
|
|
4919
|
+
/**
|
|
4920
|
+
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4921
|
+
*/
|
|
4922
|
+
a11yAutocomplete: {
|
|
4923
|
+
type: String,
|
|
4924
|
+
attribute: false,
|
|
4886
4925
|
}
|
|
4887
4926
|
};
|
|
4888
4927
|
}
|
|
4889
4928
|
|
|
4890
4929
|
static get styles() {
|
|
4891
4930
|
return [
|
|
4892
|
-
tokensCss$1$2,
|
|
4893
4931
|
colorCss$1$2,
|
|
4932
|
+
tokensCss$1$2,
|
|
4894
4933
|
|
|
4895
4934
|
// default layout
|
|
4896
4935
|
classicColorCss,
|
|
@@ -5330,7 +5369,10 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5330
5369
|
id="bib"
|
|
5331
5370
|
shape="${this.shape}"
|
|
5332
5371
|
?data-show="${this.isPopoverVisible}"
|
|
5333
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5372
|
+
?isfullscreen="${this.isBibFullscreen}"
|
|
5373
|
+
?common="${this.common}"
|
|
5374
|
+
?rounded="${this.common || this.rounded}"
|
|
5375
|
+
?inset="${this.common || this.inset}">
|
|
5334
5376
|
<div class="slotContent">
|
|
5335
5377
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5336
5378
|
</div>
|
|
@@ -7311,7 +7353,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
7311
7353
|
<div id="bibTemplate" part="bibtemplate">
|
|
7312
7354
|
${this.isFullscreen ? u`
|
|
7313
7355
|
<div id="headerContainer">
|
|
7314
|
-
<${this.buttonTag} id="closeButton"
|
|
7356
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7315
7357
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
7316
7358
|
</${this.buttonTag}>
|
|
7317
7359
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
@@ -7339,7 +7381,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
7339
7381
|
|
|
7340
7382
|
var colorCss$3 = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
7341
7383
|
|
|
7342
|
-
var styleCss$4 = i$5
|
|
7384
|
+
var styleCss$4 = i$5`.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
7343
7385
|
|
|
7344
7386
|
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7345
7387
|
|
|
@@ -7545,7 +7587,68 @@ class AuroHelpText extends i$2 {
|
|
|
7545
7587
|
|
|
7546
7588
|
var helpTextVersion = '1.0.0';
|
|
7547
7589
|
|
|
7548
|
-
|
|
7590
|
+
i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
7591
|
+
|
|
7592
|
+
i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
7593
|
+
|
|
7594
|
+
i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
7595
|
+
|
|
7596
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7597
|
+
// See LICENSE in the project root for license information.
|
|
7598
|
+
|
|
7599
|
+
// ---------------------------------------------------------------------
|
|
7600
|
+
|
|
7601
|
+
/**
|
|
7602
|
+
* Converts value to an array.
|
|
7603
|
+
* If the value is a JSON string representing an array, it will be parsed.
|
|
7604
|
+
* If the value is already an array, it is returned.
|
|
7605
|
+
* If the value is undefined, it returns undefined.
|
|
7606
|
+
* @private
|
|
7607
|
+
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7608
|
+
* @returns {Array|undefined} - The converted array or undefined.
|
|
7609
|
+
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7610
|
+
* or if the value cannot be parsed into an array from a JSON string.
|
|
7611
|
+
*/
|
|
7612
|
+
function arrayConverter(value) {
|
|
7613
|
+
// Allow undefined
|
|
7614
|
+
if (value === undefined) {
|
|
7615
|
+
return undefined;
|
|
7616
|
+
}
|
|
7617
|
+
|
|
7618
|
+
// Return the value if it is already an array
|
|
7619
|
+
if (Array.isArray(value)) {
|
|
7620
|
+
return value;
|
|
7621
|
+
}
|
|
7622
|
+
|
|
7623
|
+
try {
|
|
7624
|
+
// If value is a JSON string, parse it
|
|
7625
|
+
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7626
|
+
|
|
7627
|
+
// Check if the parsed value is an array
|
|
7628
|
+
if (Array.isArray(parsed)) {
|
|
7629
|
+
return parsed;
|
|
7630
|
+
}
|
|
7631
|
+
} catch (error) {
|
|
7632
|
+
// If JSON parsing fails, continue to throw an error below
|
|
7633
|
+
/* eslint-disable no-console */
|
|
7634
|
+
console.error('JSON parsing failed:', error);
|
|
7635
|
+
}
|
|
7636
|
+
|
|
7637
|
+
// Throw error if the input is not an array or undefined
|
|
7638
|
+
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7641
|
+
i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
7642
|
+
|
|
7643
|
+
i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
7644
|
+
|
|
7645
|
+
i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
|
|
7646
|
+
|
|
7647
|
+
i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
|
|
7648
|
+
|
|
7649
|
+
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
7650
|
+
|
|
7651
|
+
var styleCss$3 = i$5`.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}[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)}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}.mainContent{position:relative;display:flex;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:8px}.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,:host([layout*=snowflake]) .triggerContent{padding:0 8px 0 24px}:host([layout*=snowflake]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=emphasized]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=classic]) .triggerContent{padding:0 8px}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-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]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
7549
7652
|
|
|
7550
7653
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7551
7654
|
// See LICENSE in the project root for license information.
|
|
@@ -7560,6 +7663,7 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7560
7663
|
* @slot label - Defines the content of the label.
|
|
7561
7664
|
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
7562
7665
|
* @slot helpText - Defines the content of the helpText.
|
|
7666
|
+
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7563
7667
|
* @slot valueText - Dropdown value text display.
|
|
7564
7668
|
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
7565
7669
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
@@ -7829,14 +7933,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7829
7933
|
reflect: true
|
|
7830
7934
|
},
|
|
7831
7935
|
|
|
7832
|
-
/**
|
|
7833
|
-
* Define custom placeholder text.
|
|
7834
|
-
*/
|
|
7835
|
-
placeholder: {
|
|
7836
|
-
type: String,
|
|
7837
|
-
reflect: true
|
|
7838
|
-
},
|
|
7839
|
-
|
|
7840
7936
|
/**
|
|
7841
7937
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
7842
7938
|
*/
|
|
@@ -7883,12 +7979,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7883
7979
|
},
|
|
7884
7980
|
|
|
7885
7981
|
/**
|
|
7886
|
-
* Value selected for the component.
|
|
7982
|
+
* Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7983
|
+
* @type {String|Array<String>}
|
|
7887
7984
|
*/
|
|
7888
7985
|
value: {
|
|
7889
|
-
type:
|
|
7890
|
-
reflect: true,
|
|
7891
|
-
attribute: 'value'
|
|
7986
|
+
type: Object
|
|
7892
7987
|
},
|
|
7893
7988
|
|
|
7894
7989
|
/**
|
|
@@ -7940,25 +8035,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7940
8035
|
];
|
|
7941
8036
|
}
|
|
7942
8037
|
|
|
7943
|
-
/**
|
|
7944
|
-
* Formatted value based on `multiSelect` state.
|
|
7945
|
-
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7946
|
-
* @private
|
|
7947
|
-
* @returns {String|Array<String>}
|
|
7948
|
-
*/
|
|
7949
|
-
get formattedValue() {
|
|
7950
|
-
if (this.multiSelect) {
|
|
7951
|
-
if (!this.value) {
|
|
7952
|
-
return undefined;
|
|
7953
|
-
}
|
|
7954
|
-
if (this.value.startsWith("[")) {
|
|
7955
|
-
return JSON.parse(this.value);
|
|
7956
|
-
}
|
|
7957
|
-
return [this.value];
|
|
7958
|
-
}
|
|
7959
|
-
return this.value;
|
|
7960
|
-
}
|
|
7961
|
-
|
|
7962
8038
|
/**
|
|
7963
8039
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7964
8040
|
* @private
|
|
@@ -7967,7 +8043,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7967
8043
|
get commonLabelClasses() {
|
|
7968
8044
|
return {
|
|
7969
8045
|
'is-disabled': this.disabled,
|
|
7970
|
-
'withValue': this.
|
|
8046
|
+
'withValue': this.value && this.value.length > 0,
|
|
7971
8047
|
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7972
8048
|
};
|
|
7973
8049
|
}
|
|
@@ -8377,6 +8453,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8377
8453
|
this.configureDropdown();
|
|
8378
8454
|
this.configureMenu();
|
|
8379
8455
|
this.configureSelect();
|
|
8456
|
+
|
|
8457
|
+
// Set the initial value in auro-menu if defined
|
|
8458
|
+
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8459
|
+
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8460
|
+
if (this.menu) {
|
|
8461
|
+
this.menu.value = this.value;
|
|
8462
|
+
}
|
|
8463
|
+
}
|
|
8380
8464
|
}
|
|
8381
8465
|
|
|
8382
8466
|
/**
|
|
@@ -8388,18 +8472,19 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8388
8472
|
async updateMenuValue(value) {
|
|
8389
8473
|
if (!this.menu) return;
|
|
8390
8474
|
|
|
8391
|
-
this.menu.setAttribute('value', value);
|
|
8392
8475
|
this.menu.value = value;
|
|
8393
8476
|
await this.menu.updateComplete;
|
|
8394
8477
|
}
|
|
8395
8478
|
|
|
8396
8479
|
async updated(changedProperties) {
|
|
8397
|
-
if (changedProperties.has('multiSelect')
|
|
8480
|
+
if (changedProperties.has('multiSelect')) {
|
|
8398
8481
|
this.clearSelection();
|
|
8399
8482
|
}
|
|
8400
8483
|
|
|
8401
8484
|
if (changedProperties.has('value')) {
|
|
8402
8485
|
if (this.value) {
|
|
8486
|
+
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8487
|
+
|
|
8403
8488
|
await this.updateMenuValue(this.value);
|
|
8404
8489
|
|
|
8405
8490
|
if (this.menu) {
|
|
@@ -8425,7 +8510,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8425
8510
|
composed: true,
|
|
8426
8511
|
detail: {
|
|
8427
8512
|
optionSelected: this.optionSelected,
|
|
8428
|
-
value: this.
|
|
8513
|
+
value: this.value
|
|
8429
8514
|
}
|
|
8430
8515
|
}));
|
|
8431
8516
|
}
|
|
@@ -8484,13 +8569,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8484
8569
|
const selectedValue = selectedOption.value;
|
|
8485
8570
|
|
|
8486
8571
|
if (this.multiSelect) {
|
|
8487
|
-
const currentArray = this.
|
|
8572
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
8488
8573
|
|
|
8489
8574
|
if (!currentArray.includes(selectedValue)) {
|
|
8490
|
-
this.value =
|
|
8575
|
+
this.value = [
|
|
8491
8576
|
...currentArray,
|
|
8492
8577
|
selectedValue
|
|
8493
|
-
]
|
|
8578
|
+
];
|
|
8494
8579
|
}
|
|
8495
8580
|
} else {
|
|
8496
8581
|
const currentValue = this.value;
|
|
@@ -8513,17 +8598,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8513
8598
|
}
|
|
8514
8599
|
|
|
8515
8600
|
if (this.multiSelect) {
|
|
8516
|
-
nativeSelect.value = this.
|
|
8601
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
8517
8602
|
} else {
|
|
8518
8603
|
nativeSelect.value = this.value || '';
|
|
8519
8604
|
}
|
|
8520
8605
|
}
|
|
8521
8606
|
|
|
8522
|
-
/**
|
|
8523
|
-
* Returns HTML for the hidden a11y screen reader content.
|
|
8524
|
-
* @private
|
|
8525
|
-
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8526
|
-
*/
|
|
8527
8607
|
renderAriaHtml() {
|
|
8528
8608
|
return u`
|
|
8529
8609
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8544,11 +8624,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8544
8624
|
`;
|
|
8545
8625
|
}
|
|
8546
8626
|
|
|
8547
|
-
/**
|
|
8548
|
-
* Returns HTML for the hidden HTML5 select.
|
|
8549
|
-
* @private
|
|
8550
|
-
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8551
|
-
*/
|
|
8552
8627
|
renderNativeSelect() {
|
|
8553
8628
|
return u`
|
|
8554
8629
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8595,7 +8670,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8595
8670
|
: u`
|
|
8596
8671
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8597
8672
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8598
|
-
${this.errorMessage}
|
|
8673
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
8599
8674
|
</p>
|
|
8600
8675
|
</${this.helpTextTag}>
|
|
8601
8676
|
`
|
|
@@ -8610,14 +8685,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8610
8685
|
*/
|
|
8611
8686
|
renderLayoutEmphasized() {
|
|
8612
8687
|
const placeholderClass = {
|
|
8613
|
-
|
|
8688
|
+
hidden: this.value,
|
|
8614
8689
|
};
|
|
8615
8690
|
|
|
8616
8691
|
const displayValueClasses = {
|
|
8617
8692
|
'displayValue': true,
|
|
8618
8693
|
'hasContent': this.hasDisplayValueContent,
|
|
8619
8694
|
'hasFocus': this.isPopoverVisible,
|
|
8620
|
-
'withValue': this.
|
|
8695
|
+
'withValue': this.value && this.value.length > 0,
|
|
8621
8696
|
'force': this.forceDisplayValue,
|
|
8622
8697
|
};
|
|
8623
8698
|
|
|
@@ -8644,6 +8719,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8644
8719
|
.offset="${this.offset}"
|
|
8645
8720
|
.placement="${this.placement}"
|
|
8646
8721
|
chevron
|
|
8722
|
+
fluid
|
|
8647
8723
|
for="selectMenu"
|
|
8648
8724
|
layout="${this.layout}"
|
|
8649
8725
|
part="dropdown"
|
|
@@ -8660,9 +8736,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8660
8736
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8661
8737
|
</label>
|
|
8662
8738
|
<div class="value" id="value"></div>
|
|
8663
|
-
|
|
8664
|
-
${
|
|
8665
|
-
|
|
8739
|
+
${this.value ? undefined : u`
|
|
8740
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8741
|
+
<slot name="placeholder"></slot>
|
|
8742
|
+
</div>
|
|
8743
|
+
`}
|
|
8666
8744
|
</div>
|
|
8667
8745
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8668
8746
|
<slot name="displayValue"></slot>
|
|
@@ -8689,14 +8767,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8689
8767
|
*/
|
|
8690
8768
|
renderLayoutSnowflake() {
|
|
8691
8769
|
const placeholderClass = {
|
|
8692
|
-
|
|
8770
|
+
hidden: this.value,
|
|
8693
8771
|
};
|
|
8694
8772
|
|
|
8695
8773
|
const displayValueClasses = {
|
|
8696
8774
|
'displayValue': true,
|
|
8697
8775
|
'hasContent': this.hasDisplayValueContent,
|
|
8698
8776
|
'hasFocus': this.isPopoverVisible,
|
|
8699
|
-
'withValue': this.
|
|
8777
|
+
'withValue': this.value && this.value.length > 0,
|
|
8700
8778
|
'force': this.forceDisplayValue,
|
|
8701
8779
|
};
|
|
8702
8780
|
|
|
@@ -8722,6 +8800,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8722
8800
|
.offset="${this.offset}"
|
|
8723
8801
|
.placement="${this.placement}"
|
|
8724
8802
|
chevron
|
|
8803
|
+
fluid
|
|
8725
8804
|
for="selectMenu"
|
|
8726
8805
|
layout="${this.layout}"
|
|
8727
8806
|
part="dropdown"
|
|
@@ -8738,9 +8817,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8738
8817
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8739
8818
|
</label>
|
|
8740
8819
|
<div class="value" id="value"></div>
|
|
8741
|
-
|
|
8742
|
-
${
|
|
8743
|
-
|
|
8820
|
+
${this.value ? undefined : u`
|
|
8821
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8822
|
+
<slot name="placeholder"></slot>
|
|
8823
|
+
</div>
|
|
8824
|
+
`}
|
|
8744
8825
|
</div>
|
|
8745
8826
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8746
8827
|
<slot name="displayValue"></slot>
|
|
@@ -8768,14 +8849,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8768
8849
|
*/
|
|
8769
8850
|
renderLayoutClassic() {
|
|
8770
8851
|
const placeholderClass = {
|
|
8771
|
-
|
|
8852
|
+
hidden: this.value,
|
|
8772
8853
|
};
|
|
8773
8854
|
|
|
8774
8855
|
const displayValueClasses = {
|
|
8775
8856
|
'displayValue': true,
|
|
8776
8857
|
'hasContent': this.hasDisplayValueContent,
|
|
8777
8858
|
'hasFocus': this.isPopoverVisible,
|
|
8778
|
-
'withValue': this.
|
|
8859
|
+
'withValue': this.value && this.value.length > 0,
|
|
8779
8860
|
'force': this.forceDisplayValue,
|
|
8780
8861
|
};
|
|
8781
8862
|
|
|
@@ -8801,6 +8882,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8801
8882
|
.offset="${this.offset}"
|
|
8802
8883
|
.placement="${this.placement}"
|
|
8803
8884
|
chevron
|
|
8885
|
+
fluid
|
|
8804
8886
|
for="selectMenu"
|
|
8805
8887
|
layout="${this.layout}"
|
|
8806
8888
|
part="dropdown"
|
|
@@ -8817,9 +8899,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8817
8899
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8818
8900
|
</label>
|
|
8819
8901
|
<div class="value" id="value"></div>
|
|
8820
|
-
|
|
8821
|
-
${
|
|
8822
|
-
|
|
8902
|
+
${this.value ? undefined : u`
|
|
8903
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8904
|
+
<slot name="placeholder"></slot>
|
|
8905
|
+
</div>
|
|
8906
|
+
`}
|
|
8823
8907
|
</div>
|
|
8824
8908
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8825
8909
|
<slot name="displayValue"></slot>
|
|
@@ -8869,6 +8953,106 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8869
8953
|
|
|
8870
8954
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8871
8955
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
8956
|
+
|
|
8957
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
8958
|
+
renderBACKUP() {
|
|
8959
|
+
const placeholderClass = {
|
|
8960
|
+
hidden: this.value,
|
|
8961
|
+
};
|
|
8962
|
+
|
|
8963
|
+
return u`
|
|
8964
|
+
<div class="outerWrapper">
|
|
8965
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8966
|
+
${this.optionActive && this.options.length > 0
|
|
8967
|
+
? u`
|
|
8968
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8969
|
+
`
|
|
8970
|
+
: undefined
|
|
8971
|
+
};
|
|
8972
|
+
|
|
8973
|
+
${this.optionSelected && this.options.length > 0
|
|
8974
|
+
? u`
|
|
8975
|
+
${`${this.optionSelected.innerText} selected`}
|
|
8976
|
+
`
|
|
8977
|
+
: undefined
|
|
8978
|
+
};
|
|
8979
|
+
</div>
|
|
8980
|
+
<div id="slotHolder" aria-hidden="true">
|
|
8981
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8982
|
+
</div>
|
|
8983
|
+
<${this.dropdownTag}
|
|
8984
|
+
?autoPlacement="${this.autoPlacement}"
|
|
8985
|
+
?disabled="${this.disabled}"
|
|
8986
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8987
|
+
?matchWidth="${this.matchWidth}"
|
|
8988
|
+
?noFlip="${this.noFlip}"
|
|
8989
|
+
?onDark="${this.onDark}"
|
|
8990
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8991
|
+
.offset="${this.offset}"
|
|
8992
|
+
.placement="${this.placement}"
|
|
8993
|
+
chevron
|
|
8994
|
+
fluid
|
|
8995
|
+
for="selectMenu"
|
|
8996
|
+
layout="${this.layout}"
|
|
8997
|
+
part="dropdown"
|
|
8998
|
+
shape="${this.shape}"
|
|
8999
|
+
size="${this.size}">
|
|
9000
|
+
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
9001
|
+
<span id="placeholder"
|
|
9002
|
+
class="${e(placeholderClass)}"
|
|
9003
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
9004
|
+
>
|
|
9005
|
+
<slot name="placeholder"></slot>
|
|
9006
|
+
</span>
|
|
9007
|
+
<slot name="valueText" id="valueText"></slot>
|
|
9008
|
+
</span>
|
|
9009
|
+
|
|
9010
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
9011
|
+
<slot></slot>
|
|
9012
|
+
</${this.bibtemplateTag}>
|
|
9013
|
+
<slot name="label" slot="label"></slot>
|
|
9014
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
9015
|
+
<p slot="helpText">
|
|
9016
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
9017
|
+
? u`
|
|
9018
|
+
<span id="${this.uniqueId}" part="helpText">
|
|
9019
|
+
<slot name="helpText"></slot>
|
|
9020
|
+
</span>`
|
|
9021
|
+
: u`
|
|
9022
|
+
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
9023
|
+
${this.errorMessage}
|
|
9024
|
+
</span>`
|
|
9025
|
+
}
|
|
9026
|
+
</p>
|
|
9027
|
+
</${this.dropdownTag}>
|
|
9028
|
+
<div class="nativeSelectWrapper">
|
|
9029
|
+
<select
|
|
9030
|
+
tabindex="-1"
|
|
9031
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
9032
|
+
name="${this.name || ''}"
|
|
9033
|
+
?disabled="${this.disabled}"
|
|
9034
|
+
?required="${this.required}"
|
|
9035
|
+
aria-hidden="true"
|
|
9036
|
+
autocomplete="${o(this.autocomplete)}"
|
|
9037
|
+
@change="${this._handleNativeSelectChange}">
|
|
9038
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
9039
|
+
${this.options.map((option) => {
|
|
9040
|
+
const optionValue = option.value || option.textContent;
|
|
9041
|
+
return u`
|
|
9042
|
+
<option
|
|
9043
|
+
value="${optionValue}"
|
|
9044
|
+
?selected="${this.value === optionValue}">
|
|
9045
|
+
${option.textContent}
|
|
9046
|
+
</option>
|
|
9047
|
+
`;
|
|
9048
|
+
})}
|
|
9049
|
+
</select>
|
|
9050
|
+
</div>
|
|
9051
|
+
<!-- Help text and error message template -->
|
|
9052
|
+
${this.renderHtmlHelpText()}
|
|
9053
|
+
</div>
|
|
9054
|
+
`;
|
|
9055
|
+
}
|
|
8872
9056
|
}
|
|
8873
9057
|
|
|
8874
9058
|
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
@@ -8928,6 +9112,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
8928
9112
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
8929
9113
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
8930
9114
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
9115
|
+
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
8931
9116
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
8932
9117
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
8933
9118
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -9040,14 +9225,9 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9040
9225
|
reflect: true,
|
|
9041
9226
|
attribute: 'multiselect'
|
|
9042
9227
|
},
|
|
9043
|
-
|
|
9044
|
-
/**
|
|
9045
|
-
* Value selected for the component.
|
|
9046
|
-
*/
|
|
9047
9228
|
value: {
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
attribute: 'value'
|
|
9229
|
+
// Allow string, string[] arrays and undefined
|
|
9230
|
+
type: Object
|
|
9051
9231
|
},
|
|
9052
9232
|
|
|
9053
9233
|
/**
|
|
@@ -9082,25 +9262,6 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9082
9262
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9083
9263
|
}
|
|
9084
9264
|
|
|
9085
|
-
/**
|
|
9086
|
-
* Formatted value based on `multiSelect` state.
|
|
9087
|
-
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9088
|
-
* @private
|
|
9089
|
-
* @returns {String|Array<String>}
|
|
9090
|
-
*/
|
|
9091
|
-
get formattedValue() {
|
|
9092
|
-
if (this.multiSelect) {
|
|
9093
|
-
if (!this.value) {
|
|
9094
|
-
return undefined;
|
|
9095
|
-
}
|
|
9096
|
-
if (this.value.startsWith("[")) {
|
|
9097
|
-
return JSON.parse(this.value);
|
|
9098
|
-
}
|
|
9099
|
-
return [this.value];
|
|
9100
|
-
}
|
|
9101
|
-
return this.value;
|
|
9102
|
-
}
|
|
9103
|
-
|
|
9104
9265
|
// Lifecycle Methods
|
|
9105
9266
|
|
|
9106
9267
|
connectedCallback() {
|
|
@@ -9143,7 +9304,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9143
9304
|
updated(changedProperties) {
|
|
9144
9305
|
super.updated(changedProperties);
|
|
9145
9306
|
|
|
9146
|
-
if (changedProperties.has('multiSelect')
|
|
9307
|
+
if (changedProperties.has('multiSelect')) {
|
|
9147
9308
|
// Reset selection if multiSelect mode changes
|
|
9148
9309
|
this.clearSelection();
|
|
9149
9310
|
}
|
|
@@ -9157,7 +9318,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9157
9318
|
} else {
|
|
9158
9319
|
if (this.multiSelect) {
|
|
9159
9320
|
// In multiselect mode, this.value should be an array of strings
|
|
9160
|
-
const valueArray = this.
|
|
9321
|
+
const valueArray = Array.isArray(this.value) ? this.value : [this.value];
|
|
9161
9322
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
9162
9323
|
|
|
9163
9324
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9324,14 +9485,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9324
9485
|
*/
|
|
9325
9486
|
handleSelectState(option) {
|
|
9326
9487
|
if (this.multiSelect) {
|
|
9327
|
-
const currentValue = this.
|
|
9488
|
+
const currentValue = this.value || [];
|
|
9328
9489
|
const currentSelected = this.optionSelected || [];
|
|
9329
9490
|
|
|
9330
9491
|
if (!currentValue.includes(option.value)) {
|
|
9331
|
-
this.value =
|
|
9492
|
+
this.value = [
|
|
9332
9493
|
...currentValue,
|
|
9333
9494
|
option.value
|
|
9334
|
-
]
|
|
9495
|
+
];
|
|
9335
9496
|
}
|
|
9336
9497
|
if (!currentSelected.includes(option)) {
|
|
9337
9498
|
this.optionSelected = [
|
|
@@ -9354,15 +9515,13 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9354
9515
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9355
9516
|
*/
|
|
9356
9517
|
handleDeselectState(option) {
|
|
9357
|
-
if (this.multiSelect) {
|
|
9518
|
+
if (this.multiSelect && Array.isArray(this.value)) {
|
|
9358
9519
|
// Remove this option from array
|
|
9359
|
-
|
|
9520
|
+
this.value = this.value.filter((val) => val !== option.value);
|
|
9360
9521
|
|
|
9361
9522
|
// If array is empty after removal, set back to undefined
|
|
9362
|
-
if (
|
|
9523
|
+
if (this.value.length === 0) {
|
|
9363
9524
|
this.value = undefined;
|
|
9364
|
-
} else {
|
|
9365
|
-
this.value = JSON.stringify(newFormattedValue);
|
|
9366
9525
|
}
|
|
9367
9526
|
|
|
9368
9527
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -9713,7 +9872,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9713
9872
|
}
|
|
9714
9873
|
}
|
|
9715
9874
|
|
|
9716
|
-
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) +
|
|
9875
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
9717
9876
|
|
|
9718
9877
|
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9719
9878
|
|