@aurodesignsystem-dev/auro-formkit 0.0.0-pr750.0 → 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
|
@@ -781,19 +781,19 @@ class AuroFormValidation {
|
|
|
781
781
|
{
|
|
782
782
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
783
783
|
validity: 'tooShort',
|
|
784
|
-
message: e => e.
|
|
784
|
+
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
785
785
|
},
|
|
786
786
|
{
|
|
787
787
|
check: (e) => e.value?.length > e.maxLength,
|
|
788
788
|
validity: 'tooLong',
|
|
789
|
-
message: e => e.
|
|
789
|
+
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
790
790
|
}
|
|
791
791
|
],
|
|
792
792
|
pattern: [
|
|
793
793
|
{
|
|
794
794
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
795
795
|
validity: 'patternMismatch',
|
|
796
|
-
message: e => e.
|
|
796
|
+
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
797
797
|
}
|
|
798
798
|
]
|
|
799
799
|
},
|
|
@@ -988,10 +988,10 @@ class AuroFormValidation {
|
|
|
988
988
|
if (!hasValue && elem.required && elem.touched) {
|
|
989
989
|
elem.validity = 'valueMissing';
|
|
990
990
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
991
|
-
} else if (
|
|
991
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
992
992
|
this.validateType(elem);
|
|
993
993
|
this.validateElementAttributes(elem);
|
|
994
|
-
} else if (
|
|
994
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
995
995
|
this.validateElementAttributes(elem);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
@@ -4265,11 +4265,11 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
4265
4265
|
|
|
4266
4266
|
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}`;
|
|
4267
4267
|
|
|
4268
|
-
var colorCss$1$2 = i$5`:host(:not([
|
|
4268
|
+
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)}`;
|
|
4269
4269
|
|
|
4270
4270
|
var classicColorCss = i$5``;
|
|
4271
4271
|
|
|
4272
|
-
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%}`;
|
|
4272
|
+
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}`;
|
|
4273
4273
|
|
|
4274
4274
|
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)}`;
|
|
4275
4275
|
|
|
@@ -4277,7 +4277,7 @@ var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex:1;fle
|
|
|
4277
4277
|
|
|
4278
4278
|
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)}`;
|
|
4279
4279
|
|
|
4280
|
-
var styleCss$6 = i$5
|
|
4280
|
+
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}`;
|
|
4281
4281
|
|
|
4282
4282
|
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
4283
4283
|
|
|
@@ -4582,8 +4582,10 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
4582
4582
|
// See LICENSE in the project root for license information.
|
|
4583
4583
|
|
|
4584
4584
|
|
|
4585
|
-
|
|
4585
|
+
/**
|
|
4586
|
+
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4586
4587
|
* @slot - Default slot for the popover content.
|
|
4588
|
+
* @slot label - Defines the content of the label.
|
|
4587
4589
|
* @slot helpText - Defines the content of the helpText.
|
|
4588
4590
|
* @slot trigger - Defines the content of the trigger.
|
|
4589
4591
|
* @csspart trigger - The trigger content container.
|
|
@@ -4602,22 +4604,18 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4602
4604
|
this.matchWidth = false;
|
|
4603
4605
|
this.noHideOnThisFocusLoss = false;
|
|
4604
4606
|
|
|
4605
|
-
this.errorMessage =
|
|
4607
|
+
this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
|
|
4606
4608
|
|
|
4607
4609
|
// Layout Config
|
|
4608
|
-
this.layout =
|
|
4609
|
-
this.shape =
|
|
4610
|
-
this.size =
|
|
4610
|
+
this.layout = 'classic';
|
|
4611
|
+
this.shape = 'classic';
|
|
4612
|
+
this.size = 'xl';
|
|
4611
4613
|
|
|
4612
4614
|
this.parentBorder = false;
|
|
4613
4615
|
|
|
4614
4616
|
this.privateDefaults();
|
|
4615
4617
|
}
|
|
4616
4618
|
|
|
4617
|
-
/**
|
|
4618
|
-
* @private
|
|
4619
|
-
* @returns {object} Class definition for the wrapper element.
|
|
4620
|
-
*/
|
|
4621
4619
|
get commonWrapperClasses() {
|
|
4622
4620
|
return {
|
|
4623
4621
|
'trigger': true,
|
|
@@ -4637,8 +4635,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4637
4635
|
this.disabled = false;
|
|
4638
4636
|
this.disableFocusTrap = false;
|
|
4639
4637
|
this.error = false;
|
|
4638
|
+
this.inset = false;
|
|
4639
|
+
this.rounded = false;
|
|
4640
4640
|
this.tabIndex = 0;
|
|
4641
4641
|
this.noToggle = false;
|
|
4642
|
+
this.a11yAutocomplete = 'none';
|
|
4643
|
+
this.labeled = true;
|
|
4642
4644
|
this.a11yRole = 'button';
|
|
4643
4645
|
this.onDark = false;
|
|
4644
4646
|
this.showTriggerBorders = true;
|
|
@@ -4760,27 +4762,26 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4760
4762
|
},
|
|
4761
4763
|
|
|
4762
4764
|
/**
|
|
4763
|
-
* If declared,
|
|
4764
|
-
* @default false
|
|
4765
|
+
* If declared, applies a border around the trigger slot.
|
|
4765
4766
|
*/
|
|
4766
|
-
|
|
4767
|
+
simple: {
|
|
4767
4768
|
type: Boolean,
|
|
4768
4769
|
reflect: true
|
|
4769
4770
|
},
|
|
4770
4771
|
|
|
4771
4772
|
/**
|
|
4772
|
-
* If declared,
|
|
4773
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
4774
|
+
* @attr {Boolean} chevron
|
|
4773
4775
|
*/
|
|
4774
|
-
|
|
4776
|
+
chevron: {
|
|
4775
4777
|
type: Boolean,
|
|
4776
4778
|
reflect: true
|
|
4777
4779
|
},
|
|
4778
4780
|
|
|
4779
4781
|
/**
|
|
4780
|
-
* If declared, the dropdown
|
|
4781
|
-
* @attr {Boolean} chevron
|
|
4782
|
+
* If declared, the dropdown will be styled with the common theme.
|
|
4782
4783
|
*/
|
|
4783
|
-
|
|
4784
|
+
common: {
|
|
4784
4785
|
type: Boolean,
|
|
4785
4786
|
reflect: true
|
|
4786
4787
|
},
|
|
@@ -4794,7 +4795,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4794
4795
|
},
|
|
4795
4796
|
|
|
4796
4797
|
/**
|
|
4797
|
-
* If
|
|
4798
|
+
* If declare, the focus trap inside of bib will be turned off.
|
|
4798
4799
|
*/
|
|
4799
4800
|
disableFocusTrap: {
|
|
4800
4801
|
type: Boolean,
|
|
@@ -4841,6 +4842,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4841
4842
|
reflect: true
|
|
4842
4843
|
},
|
|
4843
4844
|
|
|
4845
|
+
/**
|
|
4846
|
+
* Makes the trigger to be full width of its parent container.
|
|
4847
|
+
*/
|
|
4848
|
+
fluid: {
|
|
4849
|
+
type: Boolean,
|
|
4850
|
+
reflect: true
|
|
4851
|
+
},
|
|
4852
|
+
|
|
4853
|
+
/**
|
|
4854
|
+
* If declared, will apply padding around trigger slot content.
|
|
4855
|
+
*/
|
|
4856
|
+
inset: {
|
|
4857
|
+
type: Boolean,
|
|
4858
|
+
reflect: true
|
|
4859
|
+
},
|
|
4860
|
+
|
|
4844
4861
|
/**
|
|
4845
4862
|
* If true, the dropdown bib is displayed.
|
|
4846
4863
|
*/
|
|
@@ -4884,6 +4901,15 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4884
4901
|
reflect: true
|
|
4885
4902
|
},
|
|
4886
4903
|
|
|
4904
|
+
/**
|
|
4905
|
+
* Defines if there is a label preset.
|
|
4906
|
+
* @private
|
|
4907
|
+
*/
|
|
4908
|
+
labeled: {
|
|
4909
|
+
type: Boolean,
|
|
4910
|
+
reflect: true
|
|
4911
|
+
},
|
|
4912
|
+
|
|
4887
4913
|
/**
|
|
4888
4914
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4889
4915
|
* @private
|
|
@@ -4944,9 +4970,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4944
4970
|
reflect: true
|
|
4945
4971
|
},
|
|
4946
4972
|
|
|
4947
|
-
/**
|
|
4948
|
-
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4949
|
-
*/
|
|
4950
4973
|
onSlotChange: {
|
|
4951
4974
|
type: Function,
|
|
4952
4975
|
reflect: false
|
|
@@ -4961,6 +4984,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4961
4984
|
reflect: true
|
|
4962
4985
|
},
|
|
4963
4986
|
|
|
4987
|
+
/**
|
|
4988
|
+
* If declared, will apply border-radius to trigger and default slots.
|
|
4989
|
+
*/
|
|
4990
|
+
rounded: {
|
|
4991
|
+
type: Boolean,
|
|
4992
|
+
reflect: true
|
|
4993
|
+
},
|
|
4994
|
+
|
|
4964
4995
|
/**
|
|
4965
4996
|
* @private
|
|
4966
4997
|
*/
|
|
@@ -4975,14 +5006,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4975
5006
|
type: String || undefined,
|
|
4976
5007
|
attribute: false,
|
|
4977
5008
|
reflect: false
|
|
5009
|
+
},
|
|
5010
|
+
|
|
5011
|
+
/**
|
|
5012
|
+
* The value for the aria-autocomplete attribute of the trigger element.
|
|
5013
|
+
*/
|
|
5014
|
+
a11yAutocomplete: {
|
|
5015
|
+
type: String,
|
|
5016
|
+
attribute: false,
|
|
4978
5017
|
}
|
|
4979
5018
|
};
|
|
4980
5019
|
}
|
|
4981
5020
|
|
|
4982
5021
|
static get styles() {
|
|
4983
5022
|
return [
|
|
4984
|
-
tokensCss$1$2,
|
|
4985
5023
|
colorCss$1$2,
|
|
5024
|
+
tokensCss$1$2,
|
|
4986
5025
|
|
|
4987
5026
|
// default layout
|
|
4988
5027
|
classicColorCss,
|
|
@@ -5422,7 +5461,10 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5422
5461
|
id="bib"
|
|
5423
5462
|
shape="${this.shape}"
|
|
5424
5463
|
?data-show="${this.isPopoverVisible}"
|
|
5425
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5464
|
+
?isfullscreen="${this.isBibFullscreen}"
|
|
5465
|
+
?common="${this.common}"
|
|
5466
|
+
?rounded="${this.common || this.rounded}"
|
|
5467
|
+
?inset="${this.common || this.inset}">
|
|
5426
5468
|
<div class="slotContent">
|
|
5427
5469
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5428
5470
|
</div>
|
|
@@ -7403,7 +7445,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
7403
7445
|
<div id="bibTemplate" part="bibtemplate">
|
|
7404
7446
|
${this.isFullscreen ? u`
|
|
7405
7447
|
<div id="headerContainer">
|
|
7406
|
-
<${this.buttonTag} id="closeButton"
|
|
7448
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7407
7449
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
7408
7450
|
</${this.buttonTag}>
|
|
7409
7451
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
@@ -7431,7 +7473,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
7431
7473
|
|
|
7432
7474
|
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)}`;
|
|
7433
7475
|
|
|
7434
|
-
var styleCss$4 = i$5
|
|
7476
|
+
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}`;
|
|
7435
7477
|
|
|
7436
7478
|
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7437
7479
|
|
|
@@ -7637,7 +7679,68 @@ class AuroHelpText extends i$2 {
|
|
|
7637
7679
|
|
|
7638
7680
|
var helpTextVersion = '1.0.0';
|
|
7639
7681
|
|
|
7640
|
-
|
|
7682
|
+
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)}`;
|
|
7683
|
+
|
|
7684
|
+
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)}`;
|
|
7685
|
+
|
|
7686
|
+
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)}`;
|
|
7687
|
+
|
|
7688
|
+
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7689
|
+
// See LICENSE in the project root for license information.
|
|
7690
|
+
|
|
7691
|
+
// ---------------------------------------------------------------------
|
|
7692
|
+
|
|
7693
|
+
/**
|
|
7694
|
+
* Converts value to an array.
|
|
7695
|
+
* If the value is a JSON string representing an array, it will be parsed.
|
|
7696
|
+
* If the value is already an array, it is returned.
|
|
7697
|
+
* If the value is undefined, it returns undefined.
|
|
7698
|
+
* @private
|
|
7699
|
+
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7700
|
+
* @returns {Array|undefined} - The converted array or undefined.
|
|
7701
|
+
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7702
|
+
* or if the value cannot be parsed into an array from a JSON string.
|
|
7703
|
+
*/
|
|
7704
|
+
function arrayConverter(value) {
|
|
7705
|
+
// Allow undefined
|
|
7706
|
+
if (value === undefined) {
|
|
7707
|
+
return undefined;
|
|
7708
|
+
}
|
|
7709
|
+
|
|
7710
|
+
// Return the value if it is already an array
|
|
7711
|
+
if (Array.isArray(value)) {
|
|
7712
|
+
return value;
|
|
7713
|
+
}
|
|
7714
|
+
|
|
7715
|
+
try {
|
|
7716
|
+
// If value is a JSON string, parse it
|
|
7717
|
+
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7718
|
+
|
|
7719
|
+
// Check if the parsed value is an array
|
|
7720
|
+
if (Array.isArray(parsed)) {
|
|
7721
|
+
return parsed;
|
|
7722
|
+
}
|
|
7723
|
+
} catch (error) {
|
|
7724
|
+
// If JSON parsing fails, continue to throw an error below
|
|
7725
|
+
/* eslint-disable no-console */
|
|
7726
|
+
console.error('JSON parsing failed:', error);
|
|
7727
|
+
}
|
|
7728
|
+
|
|
7729
|
+
// Throw error if the input is not an array or undefined
|
|
7730
|
+
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7731
|
+
}
|
|
7732
|
+
|
|
7733
|
+
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}`;
|
|
7734
|
+
|
|
7735
|
+
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)}`;
|
|
7736
|
+
|
|
7737
|
+
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}`;
|
|
7738
|
+
|
|
7739
|
+
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)}`;
|
|
7740
|
+
|
|
7741
|
+
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)}`;
|
|
7742
|
+
|
|
7743
|
+
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}`;
|
|
7641
7744
|
|
|
7642
7745
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7643
7746
|
// See LICENSE in the project root for license information.
|
|
@@ -7652,6 +7755,7 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7652
7755
|
* @slot label - Defines the content of the label.
|
|
7653
7756
|
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
7654
7757
|
* @slot helpText - Defines the content of the helpText.
|
|
7758
|
+
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7655
7759
|
* @slot valueText - Dropdown value text display.
|
|
7656
7760
|
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
7657
7761
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
@@ -7921,14 +8025,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7921
8025
|
reflect: true
|
|
7922
8026
|
},
|
|
7923
8027
|
|
|
7924
|
-
/**
|
|
7925
|
-
* Define custom placeholder text.
|
|
7926
|
-
*/
|
|
7927
|
-
placeholder: {
|
|
7928
|
-
type: String,
|
|
7929
|
-
reflect: true
|
|
7930
|
-
},
|
|
7931
|
-
|
|
7932
8028
|
/**
|
|
7933
8029
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
7934
8030
|
*/
|
|
@@ -7975,12 +8071,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7975
8071
|
},
|
|
7976
8072
|
|
|
7977
8073
|
/**
|
|
7978
|
-
* Value selected for the component.
|
|
8074
|
+
* Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
8075
|
+
* @type {String|Array<String>}
|
|
7979
8076
|
*/
|
|
7980
8077
|
value: {
|
|
7981
|
-
type:
|
|
7982
|
-
reflect: true,
|
|
7983
|
-
attribute: 'value'
|
|
8078
|
+
type: Object
|
|
7984
8079
|
},
|
|
7985
8080
|
|
|
7986
8081
|
/**
|
|
@@ -8032,25 +8127,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8032
8127
|
];
|
|
8033
8128
|
}
|
|
8034
8129
|
|
|
8035
|
-
/**
|
|
8036
|
-
* Formatted value based on `multiSelect` state.
|
|
8037
|
-
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
8038
|
-
* @private
|
|
8039
|
-
* @returns {String|Array<String>}
|
|
8040
|
-
*/
|
|
8041
|
-
get formattedValue() {
|
|
8042
|
-
if (this.multiSelect) {
|
|
8043
|
-
if (!this.value) {
|
|
8044
|
-
return undefined;
|
|
8045
|
-
}
|
|
8046
|
-
if (this.value.startsWith("[")) {
|
|
8047
|
-
return JSON.parse(this.value);
|
|
8048
|
-
}
|
|
8049
|
-
return [this.value];
|
|
8050
|
-
}
|
|
8051
|
-
return this.value;
|
|
8052
|
-
}
|
|
8053
|
-
|
|
8054
8130
|
/**
|
|
8055
8131
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8056
8132
|
* @private
|
|
@@ -8059,7 +8135,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8059
8135
|
get commonLabelClasses() {
|
|
8060
8136
|
return {
|
|
8061
8137
|
'is-disabled': this.disabled,
|
|
8062
|
-
'withValue': this.
|
|
8138
|
+
'withValue': this.value && this.value.length > 0,
|
|
8063
8139
|
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
8064
8140
|
};
|
|
8065
8141
|
}
|
|
@@ -8469,6 +8545,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8469
8545
|
this.configureDropdown();
|
|
8470
8546
|
this.configureMenu();
|
|
8471
8547
|
this.configureSelect();
|
|
8548
|
+
|
|
8549
|
+
// Set the initial value in auro-menu if defined
|
|
8550
|
+
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8551
|
+
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8552
|
+
if (this.menu) {
|
|
8553
|
+
this.menu.value = this.value;
|
|
8554
|
+
}
|
|
8555
|
+
}
|
|
8472
8556
|
}
|
|
8473
8557
|
|
|
8474
8558
|
/**
|
|
@@ -8480,18 +8564,19 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8480
8564
|
async updateMenuValue(value) {
|
|
8481
8565
|
if (!this.menu) return;
|
|
8482
8566
|
|
|
8483
|
-
this.menu.setAttribute('value', value);
|
|
8484
8567
|
this.menu.value = value;
|
|
8485
8568
|
await this.menu.updateComplete;
|
|
8486
8569
|
}
|
|
8487
8570
|
|
|
8488
8571
|
async updated(changedProperties) {
|
|
8489
|
-
if (changedProperties.has('multiSelect')
|
|
8572
|
+
if (changedProperties.has('multiSelect')) {
|
|
8490
8573
|
this.clearSelection();
|
|
8491
8574
|
}
|
|
8492
8575
|
|
|
8493
8576
|
if (changedProperties.has('value')) {
|
|
8494
8577
|
if (this.value) {
|
|
8578
|
+
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8579
|
+
|
|
8495
8580
|
await this.updateMenuValue(this.value);
|
|
8496
8581
|
|
|
8497
8582
|
if (this.menu) {
|
|
@@ -8517,7 +8602,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8517
8602
|
composed: true,
|
|
8518
8603
|
detail: {
|
|
8519
8604
|
optionSelected: this.optionSelected,
|
|
8520
|
-
value: this.
|
|
8605
|
+
value: this.value
|
|
8521
8606
|
}
|
|
8522
8607
|
}));
|
|
8523
8608
|
}
|
|
@@ -8576,13 +8661,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8576
8661
|
const selectedValue = selectedOption.value;
|
|
8577
8662
|
|
|
8578
8663
|
if (this.multiSelect) {
|
|
8579
|
-
const currentArray = this.
|
|
8664
|
+
const currentArray = Array.isArray(this.value) ? this.value : [];
|
|
8580
8665
|
|
|
8581
8666
|
if (!currentArray.includes(selectedValue)) {
|
|
8582
|
-
this.value =
|
|
8667
|
+
this.value = [
|
|
8583
8668
|
...currentArray,
|
|
8584
8669
|
selectedValue
|
|
8585
|
-
]
|
|
8670
|
+
];
|
|
8586
8671
|
}
|
|
8587
8672
|
} else {
|
|
8588
8673
|
const currentValue = this.value;
|
|
@@ -8605,17 +8690,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8605
8690
|
}
|
|
8606
8691
|
|
|
8607
8692
|
if (this.multiSelect) {
|
|
8608
|
-
nativeSelect.value = this.
|
|
8693
|
+
nativeSelect.value = this.value ? this.value[0] : '';
|
|
8609
8694
|
} else {
|
|
8610
8695
|
nativeSelect.value = this.value || '';
|
|
8611
8696
|
}
|
|
8612
8697
|
}
|
|
8613
8698
|
|
|
8614
|
-
/**
|
|
8615
|
-
* Returns HTML for the hidden a11y screen reader content.
|
|
8616
|
-
* @private
|
|
8617
|
-
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8618
|
-
*/
|
|
8619
8699
|
renderAriaHtml() {
|
|
8620
8700
|
return u`
|
|
8621
8701
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8636,11 +8716,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8636
8716
|
`;
|
|
8637
8717
|
}
|
|
8638
8718
|
|
|
8639
|
-
/**
|
|
8640
|
-
* Returns HTML for the hidden HTML5 select.
|
|
8641
|
-
* @private
|
|
8642
|
-
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8643
|
-
*/
|
|
8644
8719
|
renderNativeSelect() {
|
|
8645
8720
|
return u`
|
|
8646
8721
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8687,7 +8762,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8687
8762
|
: u`
|
|
8688
8763
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8689
8764
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8690
|
-
${this.errorMessage}
|
|
8765
|
+
ERROR MESSAGE ${this.errorMessage}
|
|
8691
8766
|
</p>
|
|
8692
8767
|
</${this.helpTextTag}>
|
|
8693
8768
|
`
|
|
@@ -8702,14 +8777,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8702
8777
|
*/
|
|
8703
8778
|
renderLayoutEmphasized() {
|
|
8704
8779
|
const placeholderClass = {
|
|
8705
|
-
|
|
8780
|
+
hidden: this.value,
|
|
8706
8781
|
};
|
|
8707
8782
|
|
|
8708
8783
|
const displayValueClasses = {
|
|
8709
8784
|
'displayValue': true,
|
|
8710
8785
|
'hasContent': this.hasDisplayValueContent,
|
|
8711
8786
|
'hasFocus': this.isPopoverVisible,
|
|
8712
|
-
'withValue': this.
|
|
8787
|
+
'withValue': this.value && this.value.length > 0,
|
|
8713
8788
|
'force': this.forceDisplayValue,
|
|
8714
8789
|
};
|
|
8715
8790
|
|
|
@@ -8736,6 +8811,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8736
8811
|
.offset="${this.offset}"
|
|
8737
8812
|
.placement="${this.placement}"
|
|
8738
8813
|
chevron
|
|
8814
|
+
fluid
|
|
8739
8815
|
for="selectMenu"
|
|
8740
8816
|
layout="${this.layout}"
|
|
8741
8817
|
part="dropdown"
|
|
@@ -8752,9 +8828,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8752
8828
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8753
8829
|
</label>
|
|
8754
8830
|
<div class="value" id="value"></div>
|
|
8755
|
-
|
|
8756
|
-
${
|
|
8757
|
-
|
|
8831
|
+
${this.value ? undefined : u`
|
|
8832
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8833
|
+
<slot name="placeholder"></slot>
|
|
8834
|
+
</div>
|
|
8835
|
+
`}
|
|
8758
8836
|
</div>
|
|
8759
8837
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8760
8838
|
<slot name="displayValue"></slot>
|
|
@@ -8781,14 +8859,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8781
8859
|
*/
|
|
8782
8860
|
renderLayoutSnowflake() {
|
|
8783
8861
|
const placeholderClass = {
|
|
8784
|
-
|
|
8862
|
+
hidden: this.value,
|
|
8785
8863
|
};
|
|
8786
8864
|
|
|
8787
8865
|
const displayValueClasses = {
|
|
8788
8866
|
'displayValue': true,
|
|
8789
8867
|
'hasContent': this.hasDisplayValueContent,
|
|
8790
8868
|
'hasFocus': this.isPopoverVisible,
|
|
8791
|
-
'withValue': this.
|
|
8869
|
+
'withValue': this.value && this.value.length > 0,
|
|
8792
8870
|
'force': this.forceDisplayValue,
|
|
8793
8871
|
};
|
|
8794
8872
|
|
|
@@ -8814,6 +8892,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8814
8892
|
.offset="${this.offset}"
|
|
8815
8893
|
.placement="${this.placement}"
|
|
8816
8894
|
chevron
|
|
8895
|
+
fluid
|
|
8817
8896
|
for="selectMenu"
|
|
8818
8897
|
layout="${this.layout}"
|
|
8819
8898
|
part="dropdown"
|
|
@@ -8830,9 +8909,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8830
8909
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8831
8910
|
</label>
|
|
8832
8911
|
<div class="value" id="value"></div>
|
|
8833
|
-
|
|
8834
|
-
${
|
|
8835
|
-
|
|
8912
|
+
${this.value ? undefined : u`
|
|
8913
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8914
|
+
<slot name="placeholder"></slot>
|
|
8915
|
+
</div>
|
|
8916
|
+
`}
|
|
8836
8917
|
</div>
|
|
8837
8918
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8838
8919
|
<slot name="displayValue"></slot>
|
|
@@ -8860,14 +8941,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8860
8941
|
*/
|
|
8861
8942
|
renderLayoutClassic() {
|
|
8862
8943
|
const placeholderClass = {
|
|
8863
|
-
|
|
8944
|
+
hidden: this.value,
|
|
8864
8945
|
};
|
|
8865
8946
|
|
|
8866
8947
|
const displayValueClasses = {
|
|
8867
8948
|
'displayValue': true,
|
|
8868
8949
|
'hasContent': this.hasDisplayValueContent,
|
|
8869
8950
|
'hasFocus': this.isPopoverVisible,
|
|
8870
|
-
'withValue': this.
|
|
8951
|
+
'withValue': this.value && this.value.length > 0,
|
|
8871
8952
|
'force': this.forceDisplayValue,
|
|
8872
8953
|
};
|
|
8873
8954
|
|
|
@@ -8893,6 +8974,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8893
8974
|
.offset="${this.offset}"
|
|
8894
8975
|
.placement="${this.placement}"
|
|
8895
8976
|
chevron
|
|
8977
|
+
fluid
|
|
8896
8978
|
for="selectMenu"
|
|
8897
8979
|
layout="${this.layout}"
|
|
8898
8980
|
part="dropdown"
|
|
@@ -8909,9 +8991,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8909
8991
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8910
8992
|
</label>
|
|
8911
8993
|
<div class="value" id="value"></div>
|
|
8912
|
-
|
|
8913
|
-
${
|
|
8914
|
-
|
|
8994
|
+
${this.value ? undefined : u`
|
|
8995
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8996
|
+
<slot name="placeholder"></slot>
|
|
8997
|
+
</div>
|
|
8998
|
+
`}
|
|
8915
8999
|
</div>
|
|
8916
9000
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8917
9001
|
<slot name="displayValue"></slot>
|
|
@@ -8961,6 +9045,106 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8961
9045
|
|
|
8962
9046
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8963
9047
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
9048
|
+
|
|
9049
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
9050
|
+
renderBACKUP() {
|
|
9051
|
+
const placeholderClass = {
|
|
9052
|
+
hidden: this.value,
|
|
9053
|
+
};
|
|
9054
|
+
|
|
9055
|
+
return u`
|
|
9056
|
+
<div class="outerWrapper">
|
|
9057
|
+
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
9058
|
+
${this.optionActive && this.options.length > 0
|
|
9059
|
+
? u`
|
|
9060
|
+
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
9061
|
+
`
|
|
9062
|
+
: undefined
|
|
9063
|
+
};
|
|
9064
|
+
|
|
9065
|
+
${this.optionSelected && this.options.length > 0
|
|
9066
|
+
? u`
|
|
9067
|
+
${`${this.optionSelected.innerText} selected`}
|
|
9068
|
+
`
|
|
9069
|
+
: undefined
|
|
9070
|
+
};
|
|
9071
|
+
</div>
|
|
9072
|
+
<div id="slotHolder" aria-hidden="true">
|
|
9073
|
+
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
9074
|
+
</div>
|
|
9075
|
+
<${this.dropdownTag}
|
|
9076
|
+
?autoPlacement="${this.autoPlacement}"
|
|
9077
|
+
?disabled="${this.disabled}"
|
|
9078
|
+
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
9079
|
+
?matchWidth="${this.matchWidth}"
|
|
9080
|
+
?noFlip="${this.noFlip}"
|
|
9081
|
+
?onDark="${this.onDark}"
|
|
9082
|
+
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
9083
|
+
.offset="${this.offset}"
|
|
9084
|
+
.placement="${this.placement}"
|
|
9085
|
+
chevron
|
|
9086
|
+
fluid
|
|
9087
|
+
for="selectMenu"
|
|
9088
|
+
layout="${this.layout}"
|
|
9089
|
+
part="dropdown"
|
|
9090
|
+
shape="${this.shape}"
|
|
9091
|
+
size="${this.size}">
|
|
9092
|
+
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
9093
|
+
<span id="placeholder"
|
|
9094
|
+
class="${e(placeholderClass)}"
|
|
9095
|
+
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
9096
|
+
>
|
|
9097
|
+
<slot name="placeholder"></slot>
|
|
9098
|
+
</span>
|
|
9099
|
+
<slot name="valueText" id="valueText"></slot>
|
|
9100
|
+
</span>
|
|
9101
|
+
|
|
9102
|
+
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
9103
|
+
<slot></slot>
|
|
9104
|
+
</${this.bibtemplateTag}>
|
|
9105
|
+
<slot name="label" slot="label"></slot>
|
|
9106
|
+
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
9107
|
+
<p slot="helpText">
|
|
9108
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
9109
|
+
? u`
|
|
9110
|
+
<span id="${this.uniqueId}" part="helpText">
|
|
9111
|
+
<slot name="helpText"></slot>
|
|
9112
|
+
</span>`
|
|
9113
|
+
: u`
|
|
9114
|
+
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
9115
|
+
${this.errorMessage}
|
|
9116
|
+
</span>`
|
|
9117
|
+
}
|
|
9118
|
+
</p>
|
|
9119
|
+
</${this.dropdownTag}>
|
|
9120
|
+
<div class="nativeSelectWrapper">
|
|
9121
|
+
<select
|
|
9122
|
+
tabindex="-1"
|
|
9123
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
9124
|
+
name="${this.name || ''}"
|
|
9125
|
+
?disabled="${this.disabled}"
|
|
9126
|
+
?required="${this.required}"
|
|
9127
|
+
aria-hidden="true"
|
|
9128
|
+
autocomplete="${o(this.autocomplete)}"
|
|
9129
|
+
@change="${this._handleNativeSelectChange}">
|
|
9130
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
9131
|
+
${this.options.map((option) => {
|
|
9132
|
+
const optionValue = option.value || option.textContent;
|
|
9133
|
+
return u`
|
|
9134
|
+
<option
|
|
9135
|
+
value="${optionValue}"
|
|
9136
|
+
?selected="${this.value === optionValue}">
|
|
9137
|
+
${option.textContent}
|
|
9138
|
+
</option>
|
|
9139
|
+
`;
|
|
9140
|
+
})}
|
|
9141
|
+
</select>
|
|
9142
|
+
</div>
|
|
9143
|
+
<!-- Help text and error message template -->
|
|
9144
|
+
${this.renderHtmlHelpText()}
|
|
9145
|
+
</div>
|
|
9146
|
+
`;
|
|
9147
|
+
}
|
|
8964
9148
|
}
|
|
8965
9149
|
|
|
8966
9150
|
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)}`;
|
|
@@ -9020,6 +9204,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
9020
9204
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
9021
9205
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
9022
9206
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
9207
|
+
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
9023
9208
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
9024
9209
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
9025
9210
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -9132,14 +9317,9 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9132
9317
|
reflect: true,
|
|
9133
9318
|
attribute: 'multiselect'
|
|
9134
9319
|
},
|
|
9135
|
-
|
|
9136
|
-
/**
|
|
9137
|
-
* Value selected for the component.
|
|
9138
|
-
*/
|
|
9139
9320
|
value: {
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
attribute: 'value'
|
|
9321
|
+
// Allow string, string[] arrays and undefined
|
|
9322
|
+
type: Object
|
|
9143
9323
|
},
|
|
9144
9324
|
|
|
9145
9325
|
/**
|
|
@@ -9174,25 +9354,6 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9174
9354
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9175
9355
|
}
|
|
9176
9356
|
|
|
9177
|
-
/**
|
|
9178
|
-
* Formatted value based on `multiSelect` state.
|
|
9179
|
-
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9180
|
-
* @private
|
|
9181
|
-
* @returns {String|Array<String>}
|
|
9182
|
-
*/
|
|
9183
|
-
get formattedValue() {
|
|
9184
|
-
if (this.multiSelect) {
|
|
9185
|
-
if (!this.value) {
|
|
9186
|
-
return undefined;
|
|
9187
|
-
}
|
|
9188
|
-
if (this.value.startsWith("[")) {
|
|
9189
|
-
return JSON.parse(this.value);
|
|
9190
|
-
}
|
|
9191
|
-
return [this.value];
|
|
9192
|
-
}
|
|
9193
|
-
return this.value;
|
|
9194
|
-
}
|
|
9195
|
-
|
|
9196
9357
|
// Lifecycle Methods
|
|
9197
9358
|
|
|
9198
9359
|
connectedCallback() {
|
|
@@ -9235,7 +9396,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9235
9396
|
updated(changedProperties) {
|
|
9236
9397
|
super.updated(changedProperties);
|
|
9237
9398
|
|
|
9238
|
-
if (changedProperties.has('multiSelect')
|
|
9399
|
+
if (changedProperties.has('multiSelect')) {
|
|
9239
9400
|
// Reset selection if multiSelect mode changes
|
|
9240
9401
|
this.clearSelection();
|
|
9241
9402
|
}
|
|
@@ -9249,7 +9410,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9249
9410
|
} else {
|
|
9250
9411
|
if (this.multiSelect) {
|
|
9251
9412
|
// In multiselect mode, this.value should be an array of strings
|
|
9252
|
-
const valueArray = this.
|
|
9413
|
+
const valueArray = Array.isArray(this.value) ? this.value : [this.value];
|
|
9253
9414
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
9254
9415
|
|
|
9255
9416
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9416,14 +9577,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9416
9577
|
*/
|
|
9417
9578
|
handleSelectState(option) {
|
|
9418
9579
|
if (this.multiSelect) {
|
|
9419
|
-
const currentValue = this.
|
|
9580
|
+
const currentValue = this.value || [];
|
|
9420
9581
|
const currentSelected = this.optionSelected || [];
|
|
9421
9582
|
|
|
9422
9583
|
if (!currentValue.includes(option.value)) {
|
|
9423
|
-
this.value =
|
|
9584
|
+
this.value = [
|
|
9424
9585
|
...currentValue,
|
|
9425
9586
|
option.value
|
|
9426
|
-
]
|
|
9587
|
+
];
|
|
9427
9588
|
}
|
|
9428
9589
|
if (!currentSelected.includes(option)) {
|
|
9429
9590
|
this.optionSelected = [
|
|
@@ -9446,15 +9607,13 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9446
9607
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9447
9608
|
*/
|
|
9448
9609
|
handleDeselectState(option) {
|
|
9449
|
-
if (this.multiSelect) {
|
|
9610
|
+
if (this.multiSelect && Array.isArray(this.value)) {
|
|
9450
9611
|
// Remove this option from array
|
|
9451
|
-
|
|
9612
|
+
this.value = this.value.filter((val) => val !== option.value);
|
|
9452
9613
|
|
|
9453
9614
|
// If array is empty after removal, set back to undefined
|
|
9454
|
-
if (
|
|
9615
|
+
if (this.value.length === 0) {
|
|
9455
9616
|
this.value = undefined;
|
|
9456
|
-
} else {
|
|
9457
|
-
this.value = JSON.stringify(newFormattedValue);
|
|
9458
9617
|
}
|
|
9459
9618
|
|
|
9460
9619
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -9805,7 +9964,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9805
9964
|
}
|
|
9806
9965
|
}
|
|
9807
9966
|
|
|
9808
|
-
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) +
|
|
9967
|
+
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}`;
|
|
9809
9968
|
|
|
9810
9969
|
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)}`;
|
|
9811
9970
|
|