@aurodesignsystem-dev/auro-formkit 0.0.0-pr753.0 → 0.0.0-pr754.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/checkbox/demo/api.html +10 -16
- package/components/checkbox/demo/api.min.js +2 -2
- package/components/checkbox/demo/index.html +10 -16
- package/components/checkbox/demo/index.min.js +2 -2
- package/components/checkbox/demo/readme.html +9 -16
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/api.min.js +36 -12
- package/components/combobox/demo/index.min.js +36 -12
- package/components/combobox/dist/index.js +1 -1
- package/components/combobox/dist/registered.js +1 -1
- package/components/counter/demo/api.min.js +1 -1
- package/components/counter/demo/index.min.js +1 -1
- package/components/counter/dist/index.js +1 -1
- package/components/counter/dist/registered.js +1 -1
- package/components/datepicker/demo/api.min.js +1 -1
- package/components/datepicker/demo/index.min.js +1 -1
- package/components/datepicker/dist/index.js +1 -1
- package/components/datepicker/dist/registered.js +1 -1
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/menu/demo/api.md +15 -14
- package/components/menu/demo/api.min.js +35 -11
- package/components/menu/demo/index.min.js +35 -11
- package/components/menu/dist/auro-menu.d.ts +12 -2
- package/components/menu/dist/index.js +35 -11
- package/components/menu/dist/registered.js +35 -11
- package/components/select/demo/api.md +34 -36
- package/components/select/demo/api.min.js +75 -192
- package/components/select/demo/index.min.js +75 -192
- package/components/select/dist/auro-select.d.ts +24 -6
- package/components/select/dist/index.js +40 -181
- package/components/select/dist/registered.js +40 -181
- package/package.json +24 -24
|
@@ -4269,7 +4269,7 @@ var colorCss$1$2 = i$5`:host(:not([ondark])) .wrapper{border-color:var(--ds-auro
|
|
|
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([
|
|
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%}`;
|
|
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
|
|
|
@@ -7679,67 +7679,6 @@ class AuroHelpText extends i$2 {
|
|
|
7679
7679
|
|
|
7680
7680
|
var helpTextVersion = '1.0.0';
|
|
7681
7681
|
|
|
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
7682
|
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}`;
|
|
7744
7683
|
|
|
7745
7684
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
@@ -8071,11 +8010,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8071
8010
|
},
|
|
8072
8011
|
|
|
8073
8012
|
/**
|
|
8074
|
-
* Value selected for the component.
|
|
8075
|
-
* @type {String|Array<String>}
|
|
8013
|
+
* Value selected for the component.
|
|
8076
8014
|
*/
|
|
8077
8015
|
value: {
|
|
8078
|
-
type:
|
|
8016
|
+
type: String,
|
|
8017
|
+
reflect: true,
|
|
8018
|
+
attribute: 'value'
|
|
8079
8019
|
},
|
|
8080
8020
|
|
|
8081
8021
|
/**
|
|
@@ -8127,6 +8067,24 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8127
8067
|
];
|
|
8128
8068
|
}
|
|
8129
8069
|
|
|
8070
|
+
/**
|
|
8071
|
+
* Formatted value based on `multiSelect` state.
|
|
8072
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
8073
|
+
* @returns {String|Array<String>}
|
|
8074
|
+
*/
|
|
8075
|
+
get formattedValue() {
|
|
8076
|
+
if (this.multiSelect) {
|
|
8077
|
+
if (!this.value) {
|
|
8078
|
+
return undefined;
|
|
8079
|
+
}
|
|
8080
|
+
if (this.value.startsWith("[")) {
|
|
8081
|
+
return JSON.parse(this.value);
|
|
8082
|
+
}
|
|
8083
|
+
return [this.value];
|
|
8084
|
+
}
|
|
8085
|
+
return this.value;
|
|
8086
|
+
}
|
|
8087
|
+
|
|
8130
8088
|
/**
|
|
8131
8089
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8132
8090
|
* @private
|
|
@@ -8545,14 +8503,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8545
8503
|
this.configureDropdown();
|
|
8546
8504
|
this.configureMenu();
|
|
8547
8505
|
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
|
-
}
|
|
8556
8506
|
}
|
|
8557
8507
|
|
|
8558
8508
|
/**
|
|
@@ -8564,19 +8514,18 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8564
8514
|
async updateMenuValue(value) {
|
|
8565
8515
|
if (!this.menu) return;
|
|
8566
8516
|
|
|
8517
|
+
this.menu.setAttribute('value', value);
|
|
8567
8518
|
this.menu.value = value;
|
|
8568
8519
|
await this.menu.updateComplete;
|
|
8569
8520
|
}
|
|
8570
8521
|
|
|
8571
8522
|
async updated(changedProperties) {
|
|
8572
|
-
if (changedProperties.has('multiSelect')) {
|
|
8523
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
8573
8524
|
this.clearSelection();
|
|
8574
8525
|
}
|
|
8575
8526
|
|
|
8576
8527
|
if (changedProperties.has('value')) {
|
|
8577
8528
|
if (this.value) {
|
|
8578
|
-
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8579
|
-
|
|
8580
8529
|
await this.updateMenuValue(this.value);
|
|
8581
8530
|
|
|
8582
8531
|
if (this.menu) {
|
|
@@ -8602,7 +8551,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8602
8551
|
composed: true,
|
|
8603
8552
|
detail: {
|
|
8604
8553
|
optionSelected: this.optionSelected,
|
|
8605
|
-
value: this.
|
|
8554
|
+
value: this.formattedValue
|
|
8606
8555
|
}
|
|
8607
8556
|
}));
|
|
8608
8557
|
}
|
|
@@ -8661,13 +8610,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8661
8610
|
const selectedValue = selectedOption.value;
|
|
8662
8611
|
|
|
8663
8612
|
if (this.multiSelect) {
|
|
8664
|
-
const currentArray =
|
|
8613
|
+
const currentArray = this.formattedValue;
|
|
8665
8614
|
|
|
8666
8615
|
if (!currentArray.includes(selectedValue)) {
|
|
8667
|
-
this.value = [
|
|
8616
|
+
this.value = JSON.stringify([
|
|
8668
8617
|
...currentArray,
|
|
8669
8618
|
selectedValue
|
|
8670
|
-
];
|
|
8619
|
+
]);
|
|
8671
8620
|
}
|
|
8672
8621
|
} else {
|
|
8673
8622
|
const currentValue = this.value;
|
|
@@ -8690,12 +8639,17 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8690
8639
|
}
|
|
8691
8640
|
|
|
8692
8641
|
if (this.multiSelect) {
|
|
8693
|
-
nativeSelect.value = this.
|
|
8642
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
8694
8643
|
} else {
|
|
8695
8644
|
nativeSelect.value = this.value || '';
|
|
8696
8645
|
}
|
|
8697
8646
|
}
|
|
8698
8647
|
|
|
8648
|
+
/**
|
|
8649
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8650
|
+
* @private
|
|
8651
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8652
|
+
*/
|
|
8699
8653
|
renderAriaHtml() {
|
|
8700
8654
|
return u`
|
|
8701
8655
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8716,6 +8670,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8716
8670
|
`;
|
|
8717
8671
|
}
|
|
8718
8672
|
|
|
8673
|
+
/**
|
|
8674
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8675
|
+
* @private
|
|
8676
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8677
|
+
*/
|
|
8719
8678
|
renderNativeSelect() {
|
|
8720
8679
|
return u`
|
|
8721
8680
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -9045,106 +9004,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
9045
9004
|
|
|
9046
9005
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
9047
9006
|
// 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
|
-
}
|
|
9148
9007
|
}
|
|
9149
9008
|
|
|
9150
9009
|
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)}`;
|
|
@@ -9204,7 +9063,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
9204
9063
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
9205
9064
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
9206
9065
|
* @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.
|
|
9208
9066
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
9209
9067
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
9210
9068
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -9317,9 +9175,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9317
9175
|
reflect: true,
|
|
9318
9176
|
attribute: 'multiselect'
|
|
9319
9177
|
},
|
|
9178
|
+
|
|
9179
|
+
/**
|
|
9180
|
+
* Value selected for the component.
|
|
9181
|
+
*/
|
|
9320
9182
|
value: {
|
|
9321
|
-
|
|
9322
|
-
|
|
9183
|
+
type: String,
|
|
9184
|
+
reflect: true,
|
|
9185
|
+
attribute: 'value'
|
|
9323
9186
|
},
|
|
9324
9187
|
|
|
9325
9188
|
/**
|
|
@@ -9354,6 +9217,24 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9354
9217
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9355
9218
|
}
|
|
9356
9219
|
|
|
9220
|
+
/**
|
|
9221
|
+
* Formatted value based on `multiSelect` state.
|
|
9222
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9223
|
+
* @returns {String|Array<String>}
|
|
9224
|
+
*/
|
|
9225
|
+
get formattedValue() {
|
|
9226
|
+
if (this.multiSelect) {
|
|
9227
|
+
if (!this.value) {
|
|
9228
|
+
return undefined;
|
|
9229
|
+
}
|
|
9230
|
+
if (this.value.startsWith("[")) {
|
|
9231
|
+
return JSON.parse(this.value);
|
|
9232
|
+
}
|
|
9233
|
+
return [this.value];
|
|
9234
|
+
}
|
|
9235
|
+
return this.value;
|
|
9236
|
+
}
|
|
9237
|
+
|
|
9357
9238
|
// Lifecycle Methods
|
|
9358
9239
|
|
|
9359
9240
|
connectedCallback() {
|
|
@@ -9396,7 +9277,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9396
9277
|
updated(changedProperties) {
|
|
9397
9278
|
super.updated(changedProperties);
|
|
9398
9279
|
|
|
9399
|
-
if (changedProperties.has('multiSelect')) {
|
|
9280
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
9400
9281
|
// Reset selection if multiSelect mode changes
|
|
9401
9282
|
this.clearSelection();
|
|
9402
9283
|
}
|
|
@@ -9410,7 +9291,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9410
9291
|
} else {
|
|
9411
9292
|
if (this.multiSelect) {
|
|
9412
9293
|
// In multiselect mode, this.value should be an array of strings
|
|
9413
|
-
const valueArray =
|
|
9294
|
+
const valueArray = this.formattedValue;
|
|
9414
9295
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
9415
9296
|
|
|
9416
9297
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9577,14 +9458,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9577
9458
|
*/
|
|
9578
9459
|
handleSelectState(option) {
|
|
9579
9460
|
if (this.multiSelect) {
|
|
9580
|
-
const currentValue = this.
|
|
9461
|
+
const currentValue = this.formattedValue || [];
|
|
9581
9462
|
const currentSelected = this.optionSelected || [];
|
|
9582
9463
|
|
|
9583
9464
|
if (!currentValue.includes(option.value)) {
|
|
9584
|
-
this.value = [
|
|
9465
|
+
this.value = JSON.stringify([
|
|
9585
9466
|
...currentValue,
|
|
9586
9467
|
option.value
|
|
9587
|
-
];
|
|
9468
|
+
]);
|
|
9588
9469
|
}
|
|
9589
9470
|
if (!currentSelected.includes(option)) {
|
|
9590
9471
|
this.optionSelected = [
|
|
@@ -9607,13 +9488,15 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9607
9488
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9608
9489
|
*/
|
|
9609
9490
|
handleDeselectState(option) {
|
|
9610
|
-
if (this.multiSelect
|
|
9491
|
+
if (this.multiSelect) {
|
|
9611
9492
|
// Remove this option from array
|
|
9612
|
-
|
|
9493
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
9613
9494
|
|
|
9614
9495
|
// If array is empty after removal, set back to undefined
|
|
9615
|
-
if (
|
|
9496
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
9616
9497
|
this.value = undefined;
|
|
9498
|
+
} else {
|
|
9499
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
9617
9500
|
}
|
|
9618
9501
|
|
|
9619
9502
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|