@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.0 → 0.0.0-pr783.2
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.min.js +16 -5
- package/components/checkbox/demo/index.min.js +16 -5
- package/components/checkbox/dist/index.js +16 -5
- package/components/checkbox/dist/registered.js +16 -5
- package/components/combobox/demo/api.md +1 -0
- package/components/combobox/demo/api.min.js +95 -53
- package/components/combobox/demo/index.min.js +95 -53
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +94 -52
- package/components/combobox/dist/registered.js +94 -52
- package/components/counter/demo/api.min.js +59 -31
- package/components/counter/demo/index.min.js +59 -31
- package/components/counter/dist/index.js +54 -26
- package/components/counter/dist/registered.js +54 -26
- package/components/datepicker/demo/api.md +1 -1
- package/components/datepicker/demo/api.min.js +152 -53
- package/components/datepicker/demo/index.min.js +152 -53
- package/components/datepicker/dist/auro-datepicker.d.ts +24 -1
- package/components/datepicker/dist/index.js +152 -53
- package/components/datepicker/dist/registered.js +152 -53
- package/components/dropdown/demo/api.min.js +33 -16
- package/components/dropdown/demo/index.min.js +33 -16
- package/components/dropdown/dist/auro-dropdown.d.ts +6 -0
- package/components/dropdown/dist/index.js +33 -16
- package/components/dropdown/dist/registered.js +33 -16
- package/components/input/demo/api.md +2 -1
- package/components/input/demo/api.min.js +34 -27
- package/components/input/demo/index.min.js +34 -27
- package/components/input/dist/auro-input.d.ts +0 -6
- package/components/input/dist/base-input.d.ts +5 -1
- package/components/input/dist/index.js +34 -27
- package/components/input/dist/registered.js +34 -27
- package/components/menu/demo/api.min.js +1 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/dist/registered.js +1 -1
- package/components/radio/demo/api.min.js +16 -5
- package/components/radio/demo/index.min.js +16 -5
- package/components/radio/dist/index.js +16 -5
- package/components/radio/dist/registered.js +16 -5
- package/components/select/demo/api.min.js +51 -23
- package/components/select/demo/index.html +1 -0
- package/components/select/demo/index.min.js +51 -23
- package/components/select/dist/index.js +50 -22
- package/components/select/dist/registered.js +50 -22
- package/package.json +2 -2
|
@@ -1082,13 +1082,24 @@ class AuroFormValidation {
|
|
|
1082
1082
|
this.getInputElements(elem);
|
|
1083
1083
|
this.getAuroInputs(elem);
|
|
1084
1084
|
|
|
1085
|
-
//
|
|
1085
|
+
// Check if validation should run
|
|
1086
1086
|
let validationShouldRun =
|
|
1087
|
+
|
|
1088
|
+
// If the validation was forced
|
|
1087
1089
|
force ||
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1090
|
+
|
|
1091
|
+
// If the validation should run on input
|
|
1092
|
+
elem.validateOnInput ||
|
|
1093
|
+
|
|
1094
|
+
// State-based checks
|
|
1095
|
+
(
|
|
1096
|
+
// Element is not currently focused
|
|
1097
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1098
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1099
|
+
|
|
1100
|
+
// And element has been touched or is untouched but has a value
|
|
1101
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1102
|
+
);
|
|
1092
1103
|
|
|
1093
1104
|
if (elem.hasAttribute('error')) {
|
|
1094
1105
|
elem.validity = 'customError';
|
|
@@ -1057,13 +1057,24 @@ class AuroFormValidation {
|
|
|
1057
1057
|
this.getInputElements(elem);
|
|
1058
1058
|
this.getAuroInputs(elem);
|
|
1059
1059
|
|
|
1060
|
-
//
|
|
1060
|
+
// Check if validation should run
|
|
1061
1061
|
let validationShouldRun =
|
|
1062
|
+
|
|
1063
|
+
// If the validation was forced
|
|
1062
1064
|
force ||
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1065
|
+
|
|
1066
|
+
// If the validation should run on input
|
|
1067
|
+
elem.validateOnInput ||
|
|
1068
|
+
|
|
1069
|
+
// State-based checks
|
|
1070
|
+
(
|
|
1071
|
+
// Element is not currently focused
|
|
1072
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1073
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1074
|
+
|
|
1075
|
+
// And element has been touched or is untouched but has a value
|
|
1076
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1077
|
+
);
|
|
1067
1078
|
|
|
1068
1079
|
if (elem.hasAttribute('error')) {
|
|
1069
1080
|
elem.validity = 'customError';
|
|
@@ -1010,13 +1010,24 @@ class AuroFormValidation {
|
|
|
1010
1010
|
this.getInputElements(elem);
|
|
1011
1011
|
this.getAuroInputs(elem);
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// Check if validation should run
|
|
1014
1014
|
let validationShouldRun =
|
|
1015
|
+
|
|
1016
|
+
// If the validation was forced
|
|
1015
1017
|
force ||
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
|
|
1019
|
+
// If the validation should run on input
|
|
1020
|
+
elem.validateOnInput ||
|
|
1021
|
+
|
|
1022
|
+
// State-based checks
|
|
1023
|
+
(
|
|
1024
|
+
// Element is not currently focused
|
|
1025
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1026
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1027
|
+
|
|
1028
|
+
// And element has been touched or is untouched but has a value
|
|
1029
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1030
|
+
);
|
|
1020
1031
|
|
|
1021
1032
|
if (elem.hasAttribute('error')) {
|
|
1022
1033
|
elem.validity = 'customError';
|
|
@@ -1010,13 +1010,24 @@ class AuroFormValidation {
|
|
|
1010
1010
|
this.getInputElements(elem);
|
|
1011
1011
|
this.getAuroInputs(elem);
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// Check if validation should run
|
|
1014
1014
|
let validationShouldRun =
|
|
1015
|
+
|
|
1016
|
+
// If the validation was forced
|
|
1015
1017
|
force ||
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
|
|
1019
|
+
// If the validation should run on input
|
|
1020
|
+
elem.validateOnInput ||
|
|
1021
|
+
|
|
1022
|
+
// State-based checks
|
|
1023
|
+
(
|
|
1024
|
+
// Element is not currently focused
|
|
1025
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1026
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1027
|
+
|
|
1028
|
+
// And element has been touched or is untouched but has a value
|
|
1029
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1030
|
+
);
|
|
1020
1031
|
|
|
1021
1032
|
if (elem.hasAttribute('error')) {
|
|
1022
1033
|
elem.validity = 'customError';
|
|
@@ -940,13 +940,24 @@ class AuroFormValidation {
|
|
|
940
940
|
this.getInputElements(elem);
|
|
941
941
|
this.getAuroInputs(elem);
|
|
942
942
|
|
|
943
|
-
//
|
|
943
|
+
// Check if validation should run
|
|
944
944
|
let validationShouldRun =
|
|
945
|
+
|
|
946
|
+
// If the validation was forced
|
|
945
947
|
force ||
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
|
|
949
|
+
// If the validation should run on input
|
|
950
|
+
elem.validateOnInput ||
|
|
951
|
+
|
|
952
|
+
// State-based checks
|
|
953
|
+
(
|
|
954
|
+
// Element is not currently focused
|
|
955
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
956
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
957
|
+
|
|
958
|
+
// And element has been touched or is untouched but has a value
|
|
959
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
960
|
+
);
|
|
950
961
|
|
|
951
962
|
if (elem.hasAttribute('error')) {
|
|
952
963
|
elem.validity = 'customError';
|
|
@@ -2814,7 +2825,7 @@ class AuroFloatingUI {
|
|
|
2814
2825
|
*/
|
|
2815
2826
|
mirrorSize() {
|
|
2816
2827
|
// mirror the boxsize from bibSizer
|
|
2817
|
-
if (this.element.bibSizer) {
|
|
2828
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2818
2829
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2819
2830
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2820
2831
|
if (sizerStyle.width !== '0px') {
|
|
@@ -3026,13 +3037,13 @@ class AuroFloatingUI {
|
|
|
3026
3037
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
3027
3038
|
return;
|
|
3028
3039
|
}
|
|
3029
|
-
|
|
3040
|
+
|
|
3030
3041
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3031
3042
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
3032
3043
|
return;
|
|
3033
3044
|
}
|
|
3034
3045
|
|
|
3035
|
-
this.hideBib();
|
|
3046
|
+
this.hideBib("keydown");
|
|
3036
3047
|
}
|
|
3037
3048
|
|
|
3038
3049
|
setupHideHandlers() {
|
|
@@ -3057,7 +3068,7 @@ class AuroFloatingUI {
|
|
|
3057
3068
|
document.expandedAuroFormkitDropdown = null;
|
|
3058
3069
|
document.expandedAuroFloater = this;
|
|
3059
3070
|
} else {
|
|
3060
|
-
this.hideBib();
|
|
3071
|
+
this.hideBib("click");
|
|
3061
3072
|
}
|
|
3062
3073
|
}
|
|
3063
3074
|
};
|
|
@@ -3070,7 +3081,7 @@ class AuroFloatingUI {
|
|
|
3070
3081
|
// if something else is open, let it handle itself
|
|
3071
3082
|
return;
|
|
3072
3083
|
}
|
|
3073
|
-
this.hideBib();
|
|
3084
|
+
this.hideBib("keydown");
|
|
3074
3085
|
}
|
|
3075
3086
|
};
|
|
3076
3087
|
|
|
@@ -3153,7 +3164,11 @@ class AuroFloatingUI {
|
|
|
3153
3164
|
}
|
|
3154
3165
|
}
|
|
3155
3166
|
|
|
3156
|
-
|
|
3167
|
+
/**
|
|
3168
|
+
* Hides the floating UI element.
|
|
3169
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3170
|
+
*/
|
|
3171
|
+
hideBib(eventType = "unknown") {
|
|
3157
3172
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3158
3173
|
this.lockScroll(false);
|
|
3159
3174
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3164,7 +3179,7 @@ class AuroFloatingUI {
|
|
|
3164
3179
|
if (this.showing) {
|
|
3165
3180
|
this.cleanupHideHandlers();
|
|
3166
3181
|
this.showing = false;
|
|
3167
|
-
this.dispatchEventDropdownToggle();
|
|
3182
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3168
3183
|
}
|
|
3169
3184
|
}
|
|
3170
3185
|
document.expandedAuroFloater = null;
|
|
@@ -3173,11 +3188,13 @@ class AuroFloatingUI {
|
|
|
3173
3188
|
/**
|
|
3174
3189
|
* @private
|
|
3175
3190
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3191
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3176
3192
|
*/
|
|
3177
|
-
dispatchEventDropdownToggle() {
|
|
3193
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3178
3194
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3179
3195
|
detail: {
|
|
3180
3196
|
expanded: this.showing,
|
|
3197
|
+
eventType: eventType || "unknown",
|
|
3181
3198
|
},
|
|
3182
3199
|
composed: true
|
|
3183
3200
|
});
|
|
@@ -3187,7 +3204,7 @@ class AuroFloatingUI {
|
|
|
3187
3204
|
|
|
3188
3205
|
handleClick() {
|
|
3189
3206
|
if (this.element.isPopoverVisible) {
|
|
3190
|
-
this.hideBib();
|
|
3207
|
+
this.hideBib("click");
|
|
3191
3208
|
} else {
|
|
3192
3209
|
this.showBib();
|
|
3193
3210
|
}
|
|
@@ -3214,7 +3231,7 @@ class AuroFloatingUI {
|
|
|
3214
3231
|
|
|
3215
3232
|
event.preventDefault();
|
|
3216
3233
|
this.handleClick();
|
|
3217
|
-
}
|
|
3234
|
+
}
|
|
3218
3235
|
break;
|
|
3219
3236
|
case 'mouseenter':
|
|
3220
3237
|
if (this.element.hoverToggle) {
|
|
@@ -3223,7 +3240,7 @@ class AuroFloatingUI {
|
|
|
3223
3240
|
break;
|
|
3224
3241
|
case 'mouseleave':
|
|
3225
3242
|
if (this.element.hoverToggle) {
|
|
3226
|
-
this.hideBib();
|
|
3243
|
+
this.hideBib("mouseleave");
|
|
3227
3244
|
}
|
|
3228
3245
|
break;
|
|
3229
3246
|
case 'focus':
|
|
@@ -4611,6 +4628,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4611
4628
|
|
|
4612
4629
|
this.parentBorder = false;
|
|
4613
4630
|
|
|
4631
|
+
/** @private */
|
|
4632
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4633
|
+
|
|
4614
4634
|
this.privateDefaults();
|
|
4615
4635
|
}
|
|
4616
4636
|
|
|
@@ -5044,12 +5064,19 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5044
5064
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
5045
5065
|
this.handleTriggerContentSlotChange();
|
|
5046
5066
|
}
|
|
5067
|
+
}
|
|
5047
5068
|
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5069
|
+
/**
|
|
5070
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
5071
|
+
* @private
|
|
5072
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
5073
|
+
*/
|
|
5074
|
+
handleDropdownToggle(event) {
|
|
5075
|
+
this.updateFocusTrap();
|
|
5076
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
5077
|
+
const eventType = event.detail.eventType || "unknown";
|
|
5078
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
5079
|
+
this.trigger.focus();
|
|
5053
5080
|
}
|
|
5054
5081
|
}
|
|
5055
5082
|
|
|
@@ -5057,6 +5084,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5057
5084
|
|
|
5058
5085
|
// Configure the floater to, this will generate the ID for the bib
|
|
5059
5086
|
this.floater.configure(this, 'auroDropdown');
|
|
5087
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
5060
5088
|
|
|
5061
5089
|
/**
|
|
5062
5090
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -7637,7 +7665,7 @@ class AuroHelpText extends i$2 {
|
|
|
7637
7665
|
|
|
7638
7666
|
var helpTextVersion = '1.0.0';
|
|
7639
7667
|
|
|
7640
|
-
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:var(--ds-size-
|
|
7668
|
+
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;overflow:hidden;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:var(--ds-size-100, 0.5rem)}.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 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}: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 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px;text-overflow:ellipsis;white-space:nowrap}: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]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
7641
7669
|
|
|
7642
7670
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7643
7671
|
// See LICENSE in the project root for license information.
|
|
@@ -9805,7 +9833,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9805
9833
|
}
|
|
9806
9834
|
}
|
|
9807
9835
|
|
|
9808
|
-
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-
|
|
9836
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + 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) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
9809
9837
|
|
|
9810
9838
|
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9811
9839
|
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
54
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
|
|
55
55
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/dist/auro-button__bundled.js" type="module"></script>
|
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/dist/auro-icon__bundled.js" type="module"></script>
|
|
56
57
|
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.4/auro-input/+esm"></script>
|
|
57
58
|
|
|
58
59
|
<style>
|
|
@@ -848,13 +848,24 @@ class AuroFormValidation {
|
|
|
848
848
|
this.getInputElements(elem);
|
|
849
849
|
this.getAuroInputs(elem);
|
|
850
850
|
|
|
851
|
-
//
|
|
851
|
+
// Check if validation should run
|
|
852
852
|
let validationShouldRun =
|
|
853
|
+
|
|
854
|
+
// If the validation was forced
|
|
853
855
|
force ||
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
856
|
+
|
|
857
|
+
// If the validation should run on input
|
|
858
|
+
elem.validateOnInput ||
|
|
859
|
+
|
|
860
|
+
// State-based checks
|
|
861
|
+
(
|
|
862
|
+
// Element is not currently focused
|
|
863
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
864
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
865
|
+
|
|
866
|
+
// And element has been touched or is untouched but has a value
|
|
867
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
868
|
+
);
|
|
858
869
|
|
|
859
870
|
if (elem.hasAttribute('error')) {
|
|
860
871
|
elem.validity = 'customError';
|
|
@@ -2722,7 +2733,7 @@ class AuroFloatingUI {
|
|
|
2722
2733
|
*/
|
|
2723
2734
|
mirrorSize() {
|
|
2724
2735
|
// mirror the boxsize from bibSizer
|
|
2725
|
-
if (this.element.bibSizer) {
|
|
2736
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2726
2737
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2727
2738
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2728
2739
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2934,13 +2945,13 @@ class AuroFloatingUI {
|
|
|
2934
2945
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2935
2946
|
return;
|
|
2936
2947
|
}
|
|
2937
|
-
|
|
2948
|
+
|
|
2938
2949
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2939
2950
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2940
2951
|
return;
|
|
2941
2952
|
}
|
|
2942
2953
|
|
|
2943
|
-
this.hideBib();
|
|
2954
|
+
this.hideBib("keydown");
|
|
2944
2955
|
}
|
|
2945
2956
|
|
|
2946
2957
|
setupHideHandlers() {
|
|
@@ -2965,7 +2976,7 @@ class AuroFloatingUI {
|
|
|
2965
2976
|
document.expandedAuroFormkitDropdown = null;
|
|
2966
2977
|
document.expandedAuroFloater = this;
|
|
2967
2978
|
} else {
|
|
2968
|
-
this.hideBib();
|
|
2979
|
+
this.hideBib("click");
|
|
2969
2980
|
}
|
|
2970
2981
|
}
|
|
2971
2982
|
};
|
|
@@ -2978,7 +2989,7 @@ class AuroFloatingUI {
|
|
|
2978
2989
|
// if something else is open, let it handle itself
|
|
2979
2990
|
return;
|
|
2980
2991
|
}
|
|
2981
|
-
this.hideBib();
|
|
2992
|
+
this.hideBib("keydown");
|
|
2982
2993
|
}
|
|
2983
2994
|
};
|
|
2984
2995
|
|
|
@@ -3061,7 +3072,11 @@ class AuroFloatingUI {
|
|
|
3061
3072
|
}
|
|
3062
3073
|
}
|
|
3063
3074
|
|
|
3064
|
-
|
|
3075
|
+
/**
|
|
3076
|
+
* Hides the floating UI element.
|
|
3077
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3078
|
+
*/
|
|
3079
|
+
hideBib(eventType = "unknown") {
|
|
3065
3080
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3066
3081
|
this.lockScroll(false);
|
|
3067
3082
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3072,7 +3087,7 @@ class AuroFloatingUI {
|
|
|
3072
3087
|
if (this.showing) {
|
|
3073
3088
|
this.cleanupHideHandlers();
|
|
3074
3089
|
this.showing = false;
|
|
3075
|
-
this.dispatchEventDropdownToggle();
|
|
3090
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3076
3091
|
}
|
|
3077
3092
|
}
|
|
3078
3093
|
document.expandedAuroFloater = null;
|
|
@@ -3081,11 +3096,13 @@ class AuroFloatingUI {
|
|
|
3081
3096
|
/**
|
|
3082
3097
|
* @private
|
|
3083
3098
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3099
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3084
3100
|
*/
|
|
3085
|
-
dispatchEventDropdownToggle() {
|
|
3101
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3086
3102
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3087
3103
|
detail: {
|
|
3088
3104
|
expanded: this.showing,
|
|
3105
|
+
eventType: eventType || "unknown",
|
|
3089
3106
|
},
|
|
3090
3107
|
composed: true
|
|
3091
3108
|
});
|
|
@@ -3095,7 +3112,7 @@ class AuroFloatingUI {
|
|
|
3095
3112
|
|
|
3096
3113
|
handleClick() {
|
|
3097
3114
|
if (this.element.isPopoverVisible) {
|
|
3098
|
-
this.hideBib();
|
|
3115
|
+
this.hideBib("click");
|
|
3099
3116
|
} else {
|
|
3100
3117
|
this.showBib();
|
|
3101
3118
|
}
|
|
@@ -3122,7 +3139,7 @@ class AuroFloatingUI {
|
|
|
3122
3139
|
|
|
3123
3140
|
event.preventDefault();
|
|
3124
3141
|
this.handleClick();
|
|
3125
|
-
}
|
|
3142
|
+
}
|
|
3126
3143
|
break;
|
|
3127
3144
|
case 'mouseenter':
|
|
3128
3145
|
if (this.element.hoverToggle) {
|
|
@@ -3131,7 +3148,7 @@ class AuroFloatingUI {
|
|
|
3131
3148
|
break;
|
|
3132
3149
|
case 'mouseleave':
|
|
3133
3150
|
if (this.element.hoverToggle) {
|
|
3134
|
-
this.hideBib();
|
|
3151
|
+
this.hideBib("mouseleave");
|
|
3135
3152
|
}
|
|
3136
3153
|
break;
|
|
3137
3154
|
case 'focus':
|
|
@@ -4519,6 +4536,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4519
4536
|
|
|
4520
4537
|
this.parentBorder = false;
|
|
4521
4538
|
|
|
4539
|
+
/** @private */
|
|
4540
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4541
|
+
|
|
4522
4542
|
this.privateDefaults();
|
|
4523
4543
|
}
|
|
4524
4544
|
|
|
@@ -4952,12 +4972,19 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4952
4972
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4953
4973
|
this.handleTriggerContentSlotChange();
|
|
4954
4974
|
}
|
|
4975
|
+
}
|
|
4955
4976
|
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4977
|
+
/**
|
|
4978
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4979
|
+
* @private
|
|
4980
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4981
|
+
*/
|
|
4982
|
+
handleDropdownToggle(event) {
|
|
4983
|
+
this.updateFocusTrap();
|
|
4984
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
4985
|
+
const eventType = event.detail.eventType || "unknown";
|
|
4986
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4987
|
+
this.trigger.focus();
|
|
4961
4988
|
}
|
|
4962
4989
|
}
|
|
4963
4990
|
|
|
@@ -4965,6 +4992,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4965
4992
|
|
|
4966
4993
|
// Configure the floater to, this will generate the ID for the bib
|
|
4967
4994
|
this.floater.configure(this, 'auroDropdown');
|
|
4995
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4968
4996
|
|
|
4969
4997
|
/**
|
|
4970
4998
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -7545,7 +7573,7 @@ class AuroHelpText extends i$2 {
|
|
|
7545
7573
|
|
|
7546
7574
|
var helpTextVersion = '1.0.0';
|
|
7547
7575
|
|
|
7548
|
-
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:var(--ds-size-
|
|
7576
|
+
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;overflow:hidden;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:var(--ds-size-100, 0.5rem)}.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 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}: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 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px;text-overflow:ellipsis;white-space:nowrap}: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]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
7549
7577
|
|
|
7550
7578
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7551
7579
|
// See LICENSE in the project root for license information.
|
|
@@ -9713,7 +9741,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9713
9741
|
}
|
|
9714
9742
|
}
|
|
9715
9743
|
|
|
9716
|
-
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-
|
|
9744
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + 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) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
9717
9745
|
|
|
9718
9746
|
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9719
9747
|
|