@aurodesignsystem-dev/auro-formkit 0.0.0-pr757.2 → 0.0.0-pr773.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.min.js +77 -94
- package/components/combobox/demo/index.min.js +77 -94
- package/components/combobox/dist/index.js +41 -83
- package/components/combobox/dist/registered.js +41 -83
- package/components/counter/demo/api.min.js +34 -76
- package/components/counter/demo/index.min.js +34 -76
- package/components/counter/dist/index.js +34 -76
- package/components/counter/dist/registered.js +34 -76
- package/components/datepicker/demo/api.min.js +62 -89
- package/components/datepicker/demo/index.min.js +62 -89
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
- package/components/datepicker/dist/index.js +62 -89
- package/components/datepicker/dist/registered.js +62 -89
- package/components/dropdown/demo/api.md +60 -266
- package/components/dropdown/demo/api.min.js +25 -67
- package/components/dropdown/demo/index.md +45 -363
- package/components/dropdown/demo/index.min.js +25 -67
- package/components/dropdown/dist/auro-dropdown.d.ts +21 -71
- package/components/dropdown/dist/index.js +25 -67
- package/components/dropdown/dist/registered.js +25 -67
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/demo/api.min.js +9 -9
- package/components/input/demo/index.min.js +9 -9
- package/components/input/dist/index.js +9 -9
- package/components/input/dist/registered.js +9 -9
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +36 -11
- package/components/menu/demo/index.min.js +36 -11
- package/components/menu/dist/auro-menu.d.ts +13 -2
- package/components/menu/dist/index.js +36 -11
- package/components/menu/dist/registered.js +36 -11
- package/components/radio/demo/api.min.js +10 -10
- package/components/radio/demo/index.min.js +10 -10
- 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.md +2 -2
- package/components/select/demo/api.min.js +98 -168
- package/components/select/demo/index.min.js +98 -168
- package/components/select/dist/auro-select.d.ts +13 -3
- package/components/select/dist/index.js +62 -157
- package/components/select/dist/registered.js +62 -157
- package/package.json +1 -1
|
@@ -3140,7 +3140,7 @@ var dropdownVersion = '3.0.0';
|
|
|
3140
3140
|
|
|
3141
3141
|
var shapeSizeCss = css`.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}`;
|
|
3142
3142
|
|
|
3143
|
-
var colorCss$1 = css`: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)}`;
|
|
3143
|
+
var colorCss$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}: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)}`;
|
|
3144
3144
|
|
|
3145
3145
|
var classicColorCss = css``;
|
|
3146
3146
|
|
|
@@ -3152,7 +3152,7 @@ var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex:1;fle
|
|
|
3152
3152
|
|
|
3153
3153
|
var colorCss = css`: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)}`;
|
|
3154
3154
|
|
|
3155
|
-
var styleCss = css
|
|
3155
|
+
var styleCss = css`:host{position:relative;display:block}.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}`;
|
|
3156
3156
|
|
|
3157
3157
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3158
3158
|
|
|
@@ -3457,10 +3457,8 @@ class AuroElement extends LitElement {
|
|
|
3457
3457
|
// See LICENSE in the project root for license information.
|
|
3458
3458
|
|
|
3459
3459
|
|
|
3460
|
-
|
|
3461
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
3460
|
+
/*
|
|
3462
3461
|
* @slot - Default slot for the popover content.
|
|
3463
|
-
* @slot label - Defines the content of the label.
|
|
3464
3462
|
* @slot helpText - Defines the content of the helpText.
|
|
3465
3463
|
* @slot trigger - Defines the content of the trigger.
|
|
3466
3464
|
* @csspart trigger - The trigger content container.
|
|
@@ -3479,18 +3477,22 @@ class AuroDropdown extends AuroElement {
|
|
|
3479
3477
|
this.matchWidth = false;
|
|
3480
3478
|
this.noHideOnThisFocusLoss = false;
|
|
3481
3479
|
|
|
3482
|
-
this.errorMessage =
|
|
3480
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
3483
3481
|
|
|
3484
3482
|
// Layout Config
|
|
3485
|
-
this.layout =
|
|
3486
|
-
this.shape =
|
|
3487
|
-
this.size =
|
|
3483
|
+
this.layout = undefined;
|
|
3484
|
+
this.shape = undefined;
|
|
3485
|
+
this.size = undefined;
|
|
3488
3486
|
|
|
3489
3487
|
this.parentBorder = false;
|
|
3490
3488
|
|
|
3491
3489
|
this.privateDefaults();
|
|
3492
3490
|
}
|
|
3493
3491
|
|
|
3492
|
+
/**
|
|
3493
|
+
* @private
|
|
3494
|
+
* @returns {object} Class definition for the wrapper element.
|
|
3495
|
+
*/
|
|
3494
3496
|
get commonWrapperClasses() {
|
|
3495
3497
|
return {
|
|
3496
3498
|
'trigger': true,
|
|
@@ -3510,12 +3512,8 @@ class AuroDropdown extends AuroElement {
|
|
|
3510
3512
|
this.disabled = false;
|
|
3511
3513
|
this.disableFocusTrap = false;
|
|
3512
3514
|
this.error = false;
|
|
3513
|
-
this.inset = false;
|
|
3514
|
-
this.rounded = false;
|
|
3515
3515
|
this.tabIndex = 0;
|
|
3516
3516
|
this.noToggle = false;
|
|
3517
|
-
this.a11yAutocomplete = 'none';
|
|
3518
|
-
this.labeled = true;
|
|
3519
3517
|
this.a11yRole = 'button';
|
|
3520
3518
|
this.onDark = false;
|
|
3521
3519
|
this.showTriggerBorders = true;
|
|
@@ -3637,26 +3635,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3637
3635
|
},
|
|
3638
3636
|
|
|
3639
3637
|
/**
|
|
3640
|
-
* If declared,
|
|
3638
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
3639
|
+
* @default false
|
|
3641
3640
|
*/
|
|
3642
|
-
|
|
3641
|
+
disableEventShow: {
|
|
3643
3642
|
type: Boolean,
|
|
3644
3643
|
reflect: true
|
|
3645
3644
|
},
|
|
3646
3645
|
|
|
3647
3646
|
/**
|
|
3648
|
-
* If declared,
|
|
3649
|
-
* @attr {Boolean} chevron
|
|
3647
|
+
* If declared, applies a border around the trigger slot.
|
|
3650
3648
|
*/
|
|
3651
|
-
|
|
3649
|
+
simple: {
|
|
3652
3650
|
type: Boolean,
|
|
3653
3651
|
reflect: true
|
|
3654
3652
|
},
|
|
3655
3653
|
|
|
3656
3654
|
/**
|
|
3657
|
-
* If declared, the dropdown
|
|
3655
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
3656
|
+
* @attr {Boolean} chevron
|
|
3658
3657
|
*/
|
|
3659
|
-
|
|
3658
|
+
chevron: {
|
|
3660
3659
|
type: Boolean,
|
|
3661
3660
|
reflect: true
|
|
3662
3661
|
},
|
|
@@ -3670,7 +3669,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3670
3669
|
},
|
|
3671
3670
|
|
|
3672
3671
|
/**
|
|
3673
|
-
* If
|
|
3672
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
3674
3673
|
*/
|
|
3675
3674
|
disableFocusTrap: {
|
|
3676
3675
|
type: Boolean,
|
|
@@ -3717,22 +3716,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3717
3716
|
reflect: true
|
|
3718
3717
|
},
|
|
3719
3718
|
|
|
3720
|
-
/**
|
|
3721
|
-
* Makes the trigger to be full width of its parent container.
|
|
3722
|
-
*/
|
|
3723
|
-
fluid: {
|
|
3724
|
-
type: Boolean,
|
|
3725
|
-
reflect: true
|
|
3726
|
-
},
|
|
3727
|
-
|
|
3728
|
-
/**
|
|
3729
|
-
* If declared, will apply padding around trigger slot content.
|
|
3730
|
-
*/
|
|
3731
|
-
inset: {
|
|
3732
|
-
type: Boolean,
|
|
3733
|
-
reflect: true
|
|
3734
|
-
},
|
|
3735
|
-
|
|
3736
3719
|
/**
|
|
3737
3720
|
* If true, the dropdown bib is displayed.
|
|
3738
3721
|
*/
|
|
@@ -3776,15 +3759,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3776
3759
|
reflect: true
|
|
3777
3760
|
},
|
|
3778
3761
|
|
|
3779
|
-
/**
|
|
3780
|
-
* Defines if there is a label preset.
|
|
3781
|
-
* @private
|
|
3782
|
-
*/
|
|
3783
|
-
labeled: {
|
|
3784
|
-
type: Boolean,
|
|
3785
|
-
reflect: true
|
|
3786
|
-
},
|
|
3787
|
-
|
|
3788
3762
|
/**
|
|
3789
3763
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
3790
3764
|
* @private
|
|
@@ -3845,6 +3819,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3845
3819
|
reflect: true
|
|
3846
3820
|
},
|
|
3847
3821
|
|
|
3822
|
+
/**
|
|
3823
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
3824
|
+
*/
|
|
3848
3825
|
onSlotChange: {
|
|
3849
3826
|
type: Function,
|
|
3850
3827
|
reflect: false
|
|
@@ -3859,14 +3836,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3859
3836
|
reflect: true
|
|
3860
3837
|
},
|
|
3861
3838
|
|
|
3862
|
-
/**
|
|
3863
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
3864
|
-
*/
|
|
3865
|
-
rounded: {
|
|
3866
|
-
type: Boolean,
|
|
3867
|
-
reflect: true
|
|
3868
|
-
},
|
|
3869
|
-
|
|
3870
3839
|
/**
|
|
3871
3840
|
* @private
|
|
3872
3841
|
*/
|
|
@@ -3881,22 +3850,14 @@ class AuroDropdown extends AuroElement {
|
|
|
3881
3850
|
type: String || undefined,
|
|
3882
3851
|
attribute: false,
|
|
3883
3852
|
reflect: false
|
|
3884
|
-
},
|
|
3885
|
-
|
|
3886
|
-
/**
|
|
3887
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3888
|
-
*/
|
|
3889
|
-
a11yAutocomplete: {
|
|
3890
|
-
type: String,
|
|
3891
|
-
attribute: false,
|
|
3892
3853
|
}
|
|
3893
3854
|
};
|
|
3894
3855
|
}
|
|
3895
3856
|
|
|
3896
3857
|
static get styles() {
|
|
3897
3858
|
return [
|
|
3898
|
-
colorCss$1,
|
|
3899
3859
|
tokensCss$1,
|
|
3860
|
+
colorCss$1,
|
|
3900
3861
|
|
|
3901
3862
|
// default layout
|
|
3902
3863
|
classicColorCss,
|
|
@@ -4336,10 +4297,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4336
4297
|
id="bib"
|
|
4337
4298
|
shape="${this.shape}"
|
|
4338
4299
|
?data-show="${this.isPopoverVisible}"
|
|
4339
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4340
|
-
?common="${this.common}"
|
|
4341
|
-
?rounded="${this.common || this.rounded}"
|
|
4342
|
-
?inset="${this.common || this.inset}">
|
|
4300
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
4343
4301
|
<div class="slotContent">
|
|
4344
4302
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4345
4303
|
</div>
|
|
@@ -2,7 +2,7 @@ import { css, LitElement, html } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
var colorCss = css`: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)}`;
|
|
4
4
|
|
|
5
|
-
var styleCss = css
|
|
5
|
+
var styleCss = css`:host{position:relative;display:block}.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}`;
|
|
6
6
|
|
|
7
7
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import { css, LitElement, html } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
var colorCss = css`: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)}`;
|
|
4
4
|
|
|
5
|
-
var styleCss = css
|
|
5
|
+
var styleCss = css`:host{position:relative;display:block}.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}`;
|
|
6
6
|
|
|
7
7
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
8
8
|
|
|
@@ -4688,19 +4688,19 @@ class AuroFormValidation {
|
|
|
4688
4688
|
{
|
|
4689
4689
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
4690
4690
|
validity: 'tooShort',
|
|
4691
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
4691
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
4692
4692
|
},
|
|
4693
4693
|
{
|
|
4694
4694
|
check: (e) => e.value?.length > e.maxLength,
|
|
4695
4695
|
validity: 'tooLong',
|
|
4696
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
4696
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
4697
4697
|
}
|
|
4698
4698
|
],
|
|
4699
4699
|
pattern: [
|
|
4700
4700
|
{
|
|
4701
4701
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
4702
4702
|
validity: 'patternMismatch',
|
|
4703
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
4703
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
4704
4704
|
}
|
|
4705
4705
|
]
|
|
4706
4706
|
},
|
|
@@ -4895,10 +4895,10 @@ class AuroFormValidation {
|
|
|
4895
4895
|
if (!hasValue && elem.required && elem.touched) {
|
|
4896
4896
|
elem.validity = 'valueMissing';
|
|
4897
4897
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
4898
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4898
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4899
4899
|
this.validateType(elem);
|
|
4900
4900
|
this.validateElementAttributes(elem);
|
|
4901
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
4901
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
4902
4902
|
this.validateElementAttributes(elem);
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
@@ -5677,9 +5677,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
5677
5677
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
5678
5678
|
this.validation.validate(this);
|
|
5679
5679
|
}
|
|
5680
|
-
|
|
5681
|
-
this.notifyValueChanged();
|
|
5682
5680
|
}
|
|
5681
|
+
|
|
5682
|
+
this.notifyValueChanged();
|
|
5683
5683
|
}
|
|
5684
5684
|
|
|
5685
5685
|
if (changedProperties.has('error')) {
|
|
@@ -7640,7 +7640,7 @@ var buttonVersion = '11.0.0';
|
|
|
7640
7640
|
|
|
7641
7641
|
var colorCss = 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)}`;
|
|
7642
7642
|
|
|
7643
|
-
var styleCss = i$5
|
|
7643
|
+
var styleCss = i$5`:host{position:relative;display:block}.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}`;
|
|
7644
7644
|
|
|
7645
7645
|
var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7646
7646
|
|
|
@@ -7917,7 +7917,7 @@ class AuroInput extends BaseInput {
|
|
|
7917
7917
|
*/
|
|
7918
7918
|
get commonInputClasses() {
|
|
7919
7919
|
return {
|
|
7920
|
-
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7920
|
+
'util_displayHiddenVisually': (this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === '')),
|
|
7921
7921
|
};
|
|
7922
7922
|
}
|
|
7923
7923
|
|
|
@@ -4613,19 +4613,19 @@ class AuroFormValidation {
|
|
|
4613
4613
|
{
|
|
4614
4614
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
4615
4615
|
validity: 'tooShort',
|
|
4616
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
4616
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
4617
4617
|
},
|
|
4618
4618
|
{
|
|
4619
4619
|
check: (e) => e.value?.length > e.maxLength,
|
|
4620
4620
|
validity: 'tooLong',
|
|
4621
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
4621
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
4622
4622
|
}
|
|
4623
4623
|
],
|
|
4624
4624
|
pattern: [
|
|
4625
4625
|
{
|
|
4626
4626
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
4627
4627
|
validity: 'patternMismatch',
|
|
4628
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
4628
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
4629
4629
|
}
|
|
4630
4630
|
]
|
|
4631
4631
|
},
|
|
@@ -4820,10 +4820,10 @@ class AuroFormValidation {
|
|
|
4820
4820
|
if (!hasValue && elem.required && elem.touched) {
|
|
4821
4821
|
elem.validity = 'valueMissing';
|
|
4822
4822
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
4823
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4823
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4824
4824
|
this.validateType(elem);
|
|
4825
4825
|
this.validateElementAttributes(elem);
|
|
4826
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
4826
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
4827
4827
|
this.validateElementAttributes(elem);
|
|
4828
4828
|
}
|
|
4829
4829
|
}
|
|
@@ -5602,9 +5602,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
5602
5602
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
5603
5603
|
this.validation.validate(this);
|
|
5604
5604
|
}
|
|
5605
|
-
|
|
5606
|
-
this.notifyValueChanged();
|
|
5607
5605
|
}
|
|
5606
|
+
|
|
5607
|
+
this.notifyValueChanged();
|
|
5608
5608
|
}
|
|
5609
5609
|
|
|
5610
5610
|
if (changedProperties.has('error')) {
|
|
@@ -7565,7 +7565,7 @@ var buttonVersion = '11.0.0';
|
|
|
7565
7565
|
|
|
7566
7566
|
var colorCss = 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)}`;
|
|
7567
7567
|
|
|
7568
|
-
var styleCss = i$5
|
|
7568
|
+
var styleCss = i$5`:host{position:relative;display:block}.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}`;
|
|
7569
7569
|
|
|
7570
7570
|
var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7571
7571
|
|
|
@@ -7842,7 +7842,7 @@ class AuroInput extends BaseInput {
|
|
|
7842
7842
|
*/
|
|
7843
7843
|
get commonInputClasses() {
|
|
7844
7844
|
return {
|
|
7845
|
-
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7845
|
+
'util_displayHiddenVisually': (this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === '')),
|
|
7846
7846
|
};
|
|
7847
7847
|
}
|
|
7848
7848
|
|
|
@@ -4537,19 +4537,19 @@ class AuroFormValidation {
|
|
|
4537
4537
|
{
|
|
4538
4538
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
4539
4539
|
validity: 'tooShort',
|
|
4540
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
4540
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
4541
4541
|
},
|
|
4542
4542
|
{
|
|
4543
4543
|
check: (e) => e.value?.length > e.maxLength,
|
|
4544
4544
|
validity: 'tooLong',
|
|
4545
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
4545
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
4546
4546
|
}
|
|
4547
4547
|
],
|
|
4548
4548
|
pattern: [
|
|
4549
4549
|
{
|
|
4550
4550
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
4551
4551
|
validity: 'patternMismatch',
|
|
4552
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
4552
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
4553
4553
|
}
|
|
4554
4554
|
]
|
|
4555
4555
|
},
|
|
@@ -4744,10 +4744,10 @@ class AuroFormValidation {
|
|
|
4744
4744
|
if (!hasValue && elem.required && elem.touched) {
|
|
4745
4745
|
elem.validity = 'valueMissing';
|
|
4746
4746
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
4747
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4747
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4748
4748
|
this.validateType(elem);
|
|
4749
4749
|
this.validateElementAttributes(elem);
|
|
4750
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
4750
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
4751
4751
|
this.validateElementAttributes(elem);
|
|
4752
4752
|
}
|
|
4753
4753
|
}
|
|
@@ -5526,9 +5526,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
5526
5526
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
5527
5527
|
this.validation.validate(this);
|
|
5528
5528
|
}
|
|
5529
|
-
|
|
5530
|
-
this.notifyValueChanged();
|
|
5531
5529
|
}
|
|
5530
|
+
|
|
5531
|
+
this.notifyValueChanged();
|
|
5532
5532
|
}
|
|
5533
5533
|
|
|
5534
5534
|
if (changedProperties.has('error')) {
|
|
@@ -7489,7 +7489,7 @@ var buttonVersion = '11.0.0';
|
|
|
7489
7489
|
|
|
7490
7490
|
var colorCss = css`: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)}`;
|
|
7491
7491
|
|
|
7492
|
-
var styleCss = css
|
|
7492
|
+
var styleCss = css`:host{position:relative;display:block}.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}`;
|
|
7493
7493
|
|
|
7494
7494
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7495
7495
|
|
|
@@ -7766,7 +7766,7 @@ class AuroInput extends BaseInput {
|
|
|
7766
7766
|
*/
|
|
7767
7767
|
get commonInputClasses() {
|
|
7768
7768
|
return {
|
|
7769
|
-
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7769
|
+
'util_displayHiddenVisually': (this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === '')),
|
|
7770
7770
|
};
|
|
7771
7771
|
}
|
|
7772
7772
|
|
|
@@ -4537,19 +4537,19 @@ class AuroFormValidation {
|
|
|
4537
4537
|
{
|
|
4538
4538
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
4539
4539
|
validity: 'tooShort',
|
|
4540
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
4540
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
4541
4541
|
},
|
|
4542
4542
|
{
|
|
4543
4543
|
check: (e) => e.value?.length > e.maxLength,
|
|
4544
4544
|
validity: 'tooLong',
|
|
4545
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
4545
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
4546
4546
|
}
|
|
4547
4547
|
],
|
|
4548
4548
|
pattern: [
|
|
4549
4549
|
{
|
|
4550
4550
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
4551
4551
|
validity: 'patternMismatch',
|
|
4552
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
4552
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
4553
4553
|
}
|
|
4554
4554
|
]
|
|
4555
4555
|
},
|
|
@@ -4744,10 +4744,10 @@ class AuroFormValidation {
|
|
|
4744
4744
|
if (!hasValue && elem.required && elem.touched) {
|
|
4745
4745
|
elem.validity = 'valueMissing';
|
|
4746
4746
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
4747
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4747
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
4748
4748
|
this.validateType(elem);
|
|
4749
4749
|
this.validateElementAttributes(elem);
|
|
4750
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
4750
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
4751
4751
|
this.validateElementAttributes(elem);
|
|
4752
4752
|
}
|
|
4753
4753
|
}
|
|
@@ -5526,9 +5526,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
5526
5526
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
5527
5527
|
this.validation.validate(this);
|
|
5528
5528
|
}
|
|
5529
|
-
|
|
5530
|
-
this.notifyValueChanged();
|
|
5531
5529
|
}
|
|
5530
|
+
|
|
5531
|
+
this.notifyValueChanged();
|
|
5532
5532
|
}
|
|
5533
5533
|
|
|
5534
5534
|
if (changedProperties.has('error')) {
|
|
@@ -7489,7 +7489,7 @@ var buttonVersion = '11.0.0';
|
|
|
7489
7489
|
|
|
7490
7490
|
var colorCss = css`: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)}`;
|
|
7491
7491
|
|
|
7492
|
-
var styleCss = css
|
|
7492
|
+
var styleCss = css`:host{position:relative;display:block}.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}`;
|
|
7493
7493
|
|
|
7494
7494
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7495
7495
|
|
|
@@ -7766,7 +7766,7 @@ class AuroInput extends BaseInput {
|
|
|
7766
7766
|
*/
|
|
7767
7767
|
get commonInputClasses() {
|
|
7768
7768
|
return {
|
|
7769
|
-
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7769
|
+
'util_displayHiddenVisually': (this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === '')),
|
|
7770
7770
|
};
|
|
7771
7771
|
}
|
|
7772
7772
|
|
|
@@ -20,7 +20,7 @@ The auro-menu element provides users a way to select from a list of options.
|
|
|
20
20
|
| [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement\|Array<HTMLElement>` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
|
|
21
21
|
| [shape](#shape) | | `string` | "" | |
|
|
22
22
|
| [size](#size) | | `string` | "" | |
|
|
23
|
-
| [value](#value) | `value` | `
|
|
23
|
+
| [value](#value) | `value` | `string` | "undefined" | Value selected for the component. |
|
|
24
24
|
|
|
25
25
|
## Methods
|
|
26
26
|
|
|
@@ -286,7 +286,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
286
286
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
287
287
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
288
288
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
289
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
290
289
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
291
290
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
292
291
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -399,9 +398,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
399
398
|
reflect: true,
|
|
400
399
|
attribute: 'multiselect'
|
|
401
400
|
},
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Value selected for the component.
|
|
404
|
+
*/
|
|
402
405
|
value: {
|
|
403
|
-
|
|
404
|
-
|
|
406
|
+
type: String,
|
|
407
|
+
reflect: true,
|
|
408
|
+
attribute: 'value'
|
|
405
409
|
},
|
|
406
410
|
|
|
407
411
|
/**
|
|
@@ -436,6 +440,25 @@ class AuroMenu extends AuroElement$1 {
|
|
|
436
440
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
|
|
437
441
|
}
|
|
438
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Formatted value based on `multiSelect` state.
|
|
445
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
446
|
+
* @private
|
|
447
|
+
* @returns {String|Array<String>}
|
|
448
|
+
*/
|
|
449
|
+
get formattedValue() {
|
|
450
|
+
if (this.multiSelect) {
|
|
451
|
+
if (!this.value) {
|
|
452
|
+
return undefined;
|
|
453
|
+
}
|
|
454
|
+
if (this.value.startsWith("[")) {
|
|
455
|
+
return JSON.parse(this.value);
|
|
456
|
+
}
|
|
457
|
+
return [this.value];
|
|
458
|
+
}
|
|
459
|
+
return this.value;
|
|
460
|
+
}
|
|
461
|
+
|
|
439
462
|
// Lifecycle Methods
|
|
440
463
|
|
|
441
464
|
connectedCallback() {
|
|
@@ -478,7 +501,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
478
501
|
updated(changedProperties) {
|
|
479
502
|
super.updated(changedProperties);
|
|
480
503
|
|
|
481
|
-
if (changedProperties.has('multiSelect')) {
|
|
504
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
482
505
|
// Reset selection if multiSelect mode changes
|
|
483
506
|
this.clearSelection();
|
|
484
507
|
}
|
|
@@ -492,7 +515,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
492
515
|
} else {
|
|
493
516
|
if (this.multiSelect) {
|
|
494
517
|
// In multiselect mode, this.value should be an array of strings
|
|
495
|
-
const valueArray =
|
|
518
|
+
const valueArray = this.formattedValue;
|
|
496
519
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
497
520
|
|
|
498
521
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -659,14 +682,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
659
682
|
*/
|
|
660
683
|
handleSelectState(option) {
|
|
661
684
|
if (this.multiSelect) {
|
|
662
|
-
const currentValue = this.
|
|
685
|
+
const currentValue = this.formattedValue || [];
|
|
663
686
|
const currentSelected = this.optionSelected || [];
|
|
664
687
|
|
|
665
688
|
if (!currentValue.includes(option.value)) {
|
|
666
|
-
this.value = [
|
|
689
|
+
this.value = JSON.stringify([
|
|
667
690
|
...currentValue,
|
|
668
691
|
option.value
|
|
669
|
-
];
|
|
692
|
+
]);
|
|
670
693
|
}
|
|
671
694
|
if (!currentSelected.includes(option)) {
|
|
672
695
|
this.optionSelected = [
|
|
@@ -689,13 +712,15 @@ class AuroMenu extends AuroElement$1 {
|
|
|
689
712
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
690
713
|
*/
|
|
691
714
|
handleDeselectState(option) {
|
|
692
|
-
if (this.multiSelect
|
|
715
|
+
if (this.multiSelect) {
|
|
693
716
|
// Remove this option from array
|
|
694
|
-
|
|
717
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
695
718
|
|
|
696
719
|
// If array is empty after removal, set back to undefined
|
|
697
|
-
if (
|
|
720
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
698
721
|
this.value = undefined;
|
|
722
|
+
} else {
|
|
723
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
699
724
|
}
|
|
700
725
|
|
|
701
726
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|