@aurodesignsystem-dev/auro-formkit 0.0.0-pr753.0 → 0.0.0-pr754.1
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
|
@@ -4177,7 +4177,7 @@ var colorCss$1$2 = i$5`:host(:not([ondark])) .wrapper{border-color:var(--ds-auro
|
|
|
4177
4177
|
|
|
4178
4178
|
var classicColorCss = i$5``;
|
|
4179
4179
|
|
|
4180
|
-
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([
|
|
4180
|
+
var classicLayoutCss = i$5`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
4181
4181
|
|
|
4182
4182
|
var styleEmphasizedCss = i$5`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
4183
4183
|
|
|
@@ -7587,67 +7587,6 @@ class AuroHelpText extends i$2 {
|
|
|
7587
7587
|
|
|
7588
7588
|
var helpTextVersion = '1.0.0';
|
|
7589
7589
|
|
|
7590
|
-
i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
7591
|
-
|
|
7592
|
-
i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
7593
|
-
|
|
7594
|
-
i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
7595
|
-
|
|
7596
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7597
|
-
// See LICENSE in the project root for license information.
|
|
7598
|
-
|
|
7599
|
-
// ---------------------------------------------------------------------
|
|
7600
|
-
|
|
7601
|
-
/**
|
|
7602
|
-
* Converts value to an array.
|
|
7603
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
7604
|
-
* If the value is already an array, it is returned.
|
|
7605
|
-
* If the value is undefined, it returns undefined.
|
|
7606
|
-
* @private
|
|
7607
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7608
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
7609
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7610
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
7611
|
-
*/
|
|
7612
|
-
function arrayConverter(value) {
|
|
7613
|
-
// Allow undefined
|
|
7614
|
-
if (value === undefined) {
|
|
7615
|
-
return undefined;
|
|
7616
|
-
}
|
|
7617
|
-
|
|
7618
|
-
// Return the value if it is already an array
|
|
7619
|
-
if (Array.isArray(value)) {
|
|
7620
|
-
return value;
|
|
7621
|
-
}
|
|
7622
|
-
|
|
7623
|
-
try {
|
|
7624
|
-
// If value is a JSON string, parse it
|
|
7625
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7626
|
-
|
|
7627
|
-
// Check if the parsed value is an array
|
|
7628
|
-
if (Array.isArray(parsed)) {
|
|
7629
|
-
return parsed;
|
|
7630
|
-
}
|
|
7631
|
-
} catch (error) {
|
|
7632
|
-
// If JSON parsing fails, continue to throw an error below
|
|
7633
|
-
/* eslint-disable no-console */
|
|
7634
|
-
console.error('JSON parsing failed:', error);
|
|
7635
|
-
}
|
|
7636
|
-
|
|
7637
|
-
// Throw error if the input is not an array or undefined
|
|
7638
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7639
|
-
}
|
|
7640
|
-
|
|
7641
|
-
i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
7642
|
-
|
|
7643
|
-
i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
7644
|
-
|
|
7645
|
-
i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
|
|
7646
|
-
|
|
7647
|
-
i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
|
|
7648
|
-
|
|
7649
|
-
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
7650
|
-
|
|
7651
7590
|
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}`;
|
|
7652
7591
|
|
|
7653
7592
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
@@ -7979,11 +7918,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7979
7918
|
},
|
|
7980
7919
|
|
|
7981
7920
|
/**
|
|
7982
|
-
* Value selected for the component.
|
|
7983
|
-
* @type {String|Array<String>}
|
|
7921
|
+
* Value selected for the component.
|
|
7984
7922
|
*/
|
|
7985
7923
|
value: {
|
|
7986
|
-
type:
|
|
7924
|
+
type: String,
|
|
7925
|
+
reflect: true,
|
|
7926
|
+
attribute: 'value'
|
|
7987
7927
|
},
|
|
7988
7928
|
|
|
7989
7929
|
/**
|
|
@@ -8035,6 +7975,24 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8035
7975
|
];
|
|
8036
7976
|
}
|
|
8037
7977
|
|
|
7978
|
+
/**
|
|
7979
|
+
* Formatted value based on `multiSelect` state.
|
|
7980
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7981
|
+
* @returns {String|Array<String>}
|
|
7982
|
+
*/
|
|
7983
|
+
get formattedValue() {
|
|
7984
|
+
if (this.multiSelect) {
|
|
7985
|
+
if (!this.value) {
|
|
7986
|
+
return undefined;
|
|
7987
|
+
}
|
|
7988
|
+
if (this.value.startsWith("[")) {
|
|
7989
|
+
return JSON.parse(this.value);
|
|
7990
|
+
}
|
|
7991
|
+
return [this.value];
|
|
7992
|
+
}
|
|
7993
|
+
return this.value;
|
|
7994
|
+
}
|
|
7995
|
+
|
|
8038
7996
|
/**
|
|
8039
7997
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
8040
7998
|
* @private
|
|
@@ -8453,14 +8411,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8453
8411
|
this.configureDropdown();
|
|
8454
8412
|
this.configureMenu();
|
|
8455
8413
|
this.configureSelect();
|
|
8456
|
-
|
|
8457
|
-
// Set the initial value in auro-menu if defined
|
|
8458
|
-
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8459
|
-
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8460
|
-
if (this.menu) {
|
|
8461
|
-
this.menu.value = this.value;
|
|
8462
|
-
}
|
|
8463
|
-
}
|
|
8464
8414
|
}
|
|
8465
8415
|
|
|
8466
8416
|
/**
|
|
@@ -8472,19 +8422,18 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8472
8422
|
async updateMenuValue(value) {
|
|
8473
8423
|
if (!this.menu) return;
|
|
8474
8424
|
|
|
8425
|
+
this.menu.setAttribute('value', value);
|
|
8475
8426
|
this.menu.value = value;
|
|
8476
8427
|
await this.menu.updateComplete;
|
|
8477
8428
|
}
|
|
8478
8429
|
|
|
8479
8430
|
async updated(changedProperties) {
|
|
8480
|
-
if (changedProperties.has('multiSelect')) {
|
|
8431
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
8481
8432
|
this.clearSelection();
|
|
8482
8433
|
}
|
|
8483
8434
|
|
|
8484
8435
|
if (changedProperties.has('value')) {
|
|
8485
8436
|
if (this.value) {
|
|
8486
|
-
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8487
|
-
|
|
8488
8437
|
await this.updateMenuValue(this.value);
|
|
8489
8438
|
|
|
8490
8439
|
if (this.menu) {
|
|
@@ -8510,7 +8459,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8510
8459
|
composed: true,
|
|
8511
8460
|
detail: {
|
|
8512
8461
|
optionSelected: this.optionSelected,
|
|
8513
|
-
value: this.
|
|
8462
|
+
value: this.formattedValue
|
|
8514
8463
|
}
|
|
8515
8464
|
}));
|
|
8516
8465
|
}
|
|
@@ -8569,13 +8518,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8569
8518
|
const selectedValue = selectedOption.value;
|
|
8570
8519
|
|
|
8571
8520
|
if (this.multiSelect) {
|
|
8572
|
-
const currentArray =
|
|
8521
|
+
const currentArray = this.formattedValue;
|
|
8573
8522
|
|
|
8574
8523
|
if (!currentArray.includes(selectedValue)) {
|
|
8575
|
-
this.value = [
|
|
8524
|
+
this.value = JSON.stringify([
|
|
8576
8525
|
...currentArray,
|
|
8577
8526
|
selectedValue
|
|
8578
|
-
];
|
|
8527
|
+
]);
|
|
8579
8528
|
}
|
|
8580
8529
|
} else {
|
|
8581
8530
|
const currentValue = this.value;
|
|
@@ -8598,12 +8547,17 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8598
8547
|
}
|
|
8599
8548
|
|
|
8600
8549
|
if (this.multiSelect) {
|
|
8601
|
-
nativeSelect.value = this.
|
|
8550
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
8602
8551
|
} else {
|
|
8603
8552
|
nativeSelect.value = this.value || '';
|
|
8604
8553
|
}
|
|
8605
8554
|
}
|
|
8606
8555
|
|
|
8556
|
+
/**
|
|
8557
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8558
|
+
* @private
|
|
8559
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8560
|
+
*/
|
|
8607
8561
|
renderAriaHtml() {
|
|
8608
8562
|
return u`
|
|
8609
8563
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8624,6 +8578,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8624
8578
|
`;
|
|
8625
8579
|
}
|
|
8626
8580
|
|
|
8581
|
+
/**
|
|
8582
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8583
|
+
* @private
|
|
8584
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8585
|
+
*/
|
|
8627
8586
|
renderNativeSelect() {
|
|
8628
8587
|
return u`
|
|
8629
8588
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8953,106 +8912,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8953
8912
|
|
|
8954
8913
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8955
8914
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
8956
|
-
|
|
8957
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
8958
|
-
renderBACKUP() {
|
|
8959
|
-
const placeholderClass = {
|
|
8960
|
-
hidden: this.value,
|
|
8961
|
-
};
|
|
8962
|
-
|
|
8963
|
-
return u`
|
|
8964
|
-
<div class="outerWrapper">
|
|
8965
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8966
|
-
${this.optionActive && this.options.length > 0
|
|
8967
|
-
? u`
|
|
8968
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8969
|
-
`
|
|
8970
|
-
: undefined
|
|
8971
|
-
};
|
|
8972
|
-
|
|
8973
|
-
${this.optionSelected && this.options.length > 0
|
|
8974
|
-
? u`
|
|
8975
|
-
${`${this.optionSelected.innerText} selected`}
|
|
8976
|
-
`
|
|
8977
|
-
: undefined
|
|
8978
|
-
};
|
|
8979
|
-
</div>
|
|
8980
|
-
<div id="slotHolder" aria-hidden="true">
|
|
8981
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8982
|
-
</div>
|
|
8983
|
-
<${this.dropdownTag}
|
|
8984
|
-
?autoPlacement="${this.autoPlacement}"
|
|
8985
|
-
?disabled="${this.disabled}"
|
|
8986
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8987
|
-
?matchWidth="${this.matchWidth}"
|
|
8988
|
-
?noFlip="${this.noFlip}"
|
|
8989
|
-
?onDark="${this.onDark}"
|
|
8990
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8991
|
-
.offset="${this.offset}"
|
|
8992
|
-
.placement="${this.placement}"
|
|
8993
|
-
chevron
|
|
8994
|
-
fluid
|
|
8995
|
-
for="selectMenu"
|
|
8996
|
-
layout="${this.layout}"
|
|
8997
|
-
part="dropdown"
|
|
8998
|
-
shape="${this.shape}"
|
|
8999
|
-
size="${this.size}">
|
|
9000
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
9001
|
-
<span id="placeholder"
|
|
9002
|
-
class="${e(placeholderClass)}"
|
|
9003
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
9004
|
-
>
|
|
9005
|
-
<slot name="placeholder"></slot>
|
|
9006
|
-
</span>
|
|
9007
|
-
<slot name="valueText" id="valueText"></slot>
|
|
9008
|
-
</span>
|
|
9009
|
-
|
|
9010
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
9011
|
-
<slot></slot>
|
|
9012
|
-
</${this.bibtemplateTag}>
|
|
9013
|
-
<slot name="label" slot="label"></slot>
|
|
9014
|
-
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
9015
|
-
<p slot="helpText">
|
|
9016
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
9017
|
-
? u`
|
|
9018
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
9019
|
-
<slot name="helpText"></slot>
|
|
9020
|
-
</span>`
|
|
9021
|
-
: u`
|
|
9022
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
9023
|
-
${this.errorMessage}
|
|
9024
|
-
</span>`
|
|
9025
|
-
}
|
|
9026
|
-
</p>
|
|
9027
|
-
</${this.dropdownTag}>
|
|
9028
|
-
<div class="nativeSelectWrapper">
|
|
9029
|
-
<select
|
|
9030
|
-
tabindex="-1"
|
|
9031
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
9032
|
-
name="${this.name || ''}"
|
|
9033
|
-
?disabled="${this.disabled}"
|
|
9034
|
-
?required="${this.required}"
|
|
9035
|
-
aria-hidden="true"
|
|
9036
|
-
autocomplete="${o(this.autocomplete)}"
|
|
9037
|
-
@change="${this._handleNativeSelectChange}">
|
|
9038
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
9039
|
-
${this.options.map((option) => {
|
|
9040
|
-
const optionValue = option.value || option.textContent;
|
|
9041
|
-
return u`
|
|
9042
|
-
<option
|
|
9043
|
-
value="${optionValue}"
|
|
9044
|
-
?selected="${this.value === optionValue}">
|
|
9045
|
-
${option.textContent}
|
|
9046
|
-
</option>
|
|
9047
|
-
`;
|
|
9048
|
-
})}
|
|
9049
|
-
</select>
|
|
9050
|
-
</div>
|
|
9051
|
-
<!-- Help text and error message template -->
|
|
9052
|
-
${this.renderHtmlHelpText()}
|
|
9053
|
-
</div>
|
|
9054
|
-
`;
|
|
9055
|
-
}
|
|
9056
8915
|
}
|
|
9057
8916
|
|
|
9058
8917
|
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)}`;
|
|
@@ -9112,7 +8971,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
9112
8971
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
9113
8972
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
9114
8973
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
9115
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
9116
8974
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
9117
8975
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
9118
8976
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -9225,9 +9083,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9225
9083
|
reflect: true,
|
|
9226
9084
|
attribute: 'multiselect'
|
|
9227
9085
|
},
|
|
9086
|
+
|
|
9087
|
+
/**
|
|
9088
|
+
* Value selected for the component.
|
|
9089
|
+
*/
|
|
9228
9090
|
value: {
|
|
9229
|
-
|
|
9230
|
-
|
|
9091
|
+
type: String,
|
|
9092
|
+
reflect: true,
|
|
9093
|
+
attribute: 'value'
|
|
9231
9094
|
},
|
|
9232
9095
|
|
|
9233
9096
|
/**
|
|
@@ -9262,6 +9125,24 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9262
9125
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9263
9126
|
}
|
|
9264
9127
|
|
|
9128
|
+
/**
|
|
9129
|
+
* Formatted value based on `multiSelect` state.
|
|
9130
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9131
|
+
* @returns {String|Array<String>}
|
|
9132
|
+
*/
|
|
9133
|
+
get formattedValue() {
|
|
9134
|
+
if (this.multiSelect) {
|
|
9135
|
+
if (!this.value) {
|
|
9136
|
+
return undefined;
|
|
9137
|
+
}
|
|
9138
|
+
if (this.value.startsWith("[")) {
|
|
9139
|
+
return JSON.parse(this.value);
|
|
9140
|
+
}
|
|
9141
|
+
return [this.value];
|
|
9142
|
+
}
|
|
9143
|
+
return this.value;
|
|
9144
|
+
}
|
|
9145
|
+
|
|
9265
9146
|
// Lifecycle Methods
|
|
9266
9147
|
|
|
9267
9148
|
connectedCallback() {
|
|
@@ -9304,7 +9185,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9304
9185
|
updated(changedProperties) {
|
|
9305
9186
|
super.updated(changedProperties);
|
|
9306
9187
|
|
|
9307
|
-
if (changedProperties.has('multiSelect')) {
|
|
9188
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
9308
9189
|
// Reset selection if multiSelect mode changes
|
|
9309
9190
|
this.clearSelection();
|
|
9310
9191
|
}
|
|
@@ -9318,7 +9199,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9318
9199
|
} else {
|
|
9319
9200
|
if (this.multiSelect) {
|
|
9320
9201
|
// In multiselect mode, this.value should be an array of strings
|
|
9321
|
-
const valueArray =
|
|
9202
|
+
const valueArray = this.formattedValue;
|
|
9322
9203
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
9323
9204
|
|
|
9324
9205
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9485,14 +9366,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9485
9366
|
*/
|
|
9486
9367
|
handleSelectState(option) {
|
|
9487
9368
|
if (this.multiSelect) {
|
|
9488
|
-
const currentValue = this.
|
|
9369
|
+
const currentValue = this.formattedValue || [];
|
|
9489
9370
|
const currentSelected = this.optionSelected || [];
|
|
9490
9371
|
|
|
9491
9372
|
if (!currentValue.includes(option.value)) {
|
|
9492
|
-
this.value = [
|
|
9373
|
+
this.value = JSON.stringify([
|
|
9493
9374
|
...currentValue,
|
|
9494
9375
|
option.value
|
|
9495
|
-
];
|
|
9376
|
+
]);
|
|
9496
9377
|
}
|
|
9497
9378
|
if (!currentSelected.includes(option)) {
|
|
9498
9379
|
this.optionSelected = [
|
|
@@ -9515,13 +9396,15 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9515
9396
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9516
9397
|
*/
|
|
9517
9398
|
handleDeselectState(option) {
|
|
9518
|
-
if (this.multiSelect
|
|
9399
|
+
if (this.multiSelect) {
|
|
9519
9400
|
// Remove this option from array
|
|
9520
|
-
|
|
9401
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
9521
9402
|
|
|
9522
9403
|
// If array is empty after removal, set back to undefined
|
|
9523
|
-
if (
|
|
9404
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
9524
9405
|
this.value = undefined;
|
|
9406
|
+
} else {
|
|
9407
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
9525
9408
|
}
|
|
9526
9409
|
|
|
9527
9410
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -194,10 +194,13 @@ export class AuroSelect extends AuroElement {
|
|
|
194
194
|
reflect: boolean;
|
|
195
195
|
};
|
|
196
196
|
/**
|
|
197
|
-
* Value selected for the component.
|
|
198
|
-
* @type {String|Array<String>}
|
|
197
|
+
* Value selected for the component.
|
|
199
198
|
*/
|
|
200
|
-
value:
|
|
199
|
+
value: {
|
|
200
|
+
type: StringConstructor;
|
|
201
|
+
reflect: boolean;
|
|
202
|
+
attribute: string;
|
|
203
|
+
};
|
|
201
204
|
/**
|
|
202
205
|
* Sets multi-select mode, allowing multiple options to be selected at once.
|
|
203
206
|
*/
|
|
@@ -296,6 +299,12 @@ export class AuroSelect extends AuroElement {
|
|
|
296
299
|
fullscreenBreakpoint: string;
|
|
297
300
|
onDark: boolean;
|
|
298
301
|
isPopoverVisible: any;
|
|
302
|
+
/**
|
|
303
|
+
* Formatted value based on `multiSelect` state.
|
|
304
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
305
|
+
* @returns {String|Array<String>}
|
|
306
|
+
*/
|
|
307
|
+
get formattedValue(): string | Array<string>;
|
|
299
308
|
/**
|
|
300
309
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
301
310
|
* @private
|
|
@@ -421,8 +430,18 @@ export class AuroSelect extends AuroElement {
|
|
|
421
430
|
* @private
|
|
422
431
|
*/
|
|
423
432
|
private _updateNativeSelect;
|
|
424
|
-
|
|
425
|
-
|
|
433
|
+
/**
|
|
434
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
435
|
+
* @private
|
|
436
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
437
|
+
*/
|
|
438
|
+
private renderAriaHtml;
|
|
439
|
+
/**
|
|
440
|
+
* Returns HTML for the hidden HTML5 select.
|
|
441
|
+
* @private
|
|
442
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
443
|
+
*/
|
|
444
|
+
private renderNativeSelect;
|
|
426
445
|
/**
|
|
427
446
|
* Returns HTML for the help text and error message.
|
|
428
447
|
* @private
|
|
@@ -454,6 +473,5 @@ export class AuroSelect extends AuroElement {
|
|
|
454
473
|
* @returns {void}
|
|
455
474
|
*/
|
|
456
475
|
private renderLayout;
|
|
457
|
-
renderBACKUP(): import("lit-html").TemplateResult;
|
|
458
476
|
}
|
|
459
477
|
import { AuroElement } from '../../layoutElement/src/auroElement.js';
|