@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, LitElement, html } from 'lit';
|
|
2
2
|
import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
|
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
4
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
|
|
6
6
|
var tokens = css`:host(:not([ondark])){--ds-auro-counter-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-counter-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-counter-outline-color: transparent;--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15))}:host([ondark]){--ds-auro-counter-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-counter-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-error-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-counter-outline-color: transparent;--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider-inverse, rgba(255, 255, 255, 0.4))}`;
|
|
7
7
|
|
|
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
|
|
|
2234
2234
|
this.getInputElements(elem);
|
|
2235
2235
|
this.getAuroInputs(elem);
|
|
2236
2236
|
|
|
2237
|
-
//
|
|
2237
|
+
// Check if validation should run
|
|
2238
2238
|
let validationShouldRun =
|
|
2239
|
+
|
|
2240
|
+
// If the validation was forced
|
|
2239
2241
|
force ||
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2242
|
+
|
|
2243
|
+
// If the validation should run on input
|
|
2244
|
+
elem.validateOnInput ||
|
|
2245
|
+
|
|
2246
|
+
// State-based checks
|
|
2247
|
+
(
|
|
2248
|
+
// Element is not currently focused
|
|
2249
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
2250
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
2251
|
+
|
|
2252
|
+
// And element has been touched or is untouched but has a value
|
|
2253
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
2254
|
+
);
|
|
2244
2255
|
|
|
2245
2256
|
if (elem.hasAttribute('error')) {
|
|
2246
2257
|
elem.validity = 'customError';
|
|
@@ -2971,13 +2982,13 @@ class AuroCounter extends LitElement {
|
|
|
2971
2982
|
part="counterControl"
|
|
2972
2983
|
aria-labelledby="counter-label"
|
|
2973
2984
|
aria-describedby="counter-description"
|
|
2974
|
-
|
|
2975
|
-
role="spinbutton"
|
|
2976
|
-
aria-disabled="${this.disabled ? 'true' : 'false'}"
|
|
2985
|
+
aria-disabled="${ifDefined(this.disabled ? 'true' : undefined)}"
|
|
2977
2986
|
aria-valuemin="${this.min}"
|
|
2978
2987
|
aria-valuemax="${this.max}"
|
|
2979
2988
|
aria-valuenow="${this.value}"
|
|
2980
2989
|
aria-valuetext="${this.value !== undefined ? this.value : this.min}"
|
|
2990
|
+
role="spinbutton"
|
|
2991
|
+
tabindex="${this.disabled ? '-1' : '0'}"
|
|
2981
2992
|
>
|
|
2982
2993
|
<auro-counter-button
|
|
2983
2994
|
aria-hidden="true"
|
|
@@ -3012,7 +3023,7 @@ class AuroCounter extends LitElement {
|
|
|
3012
3023
|
}
|
|
3013
3024
|
}
|
|
3014
3025
|
|
|
3015
|
-
var counterGroupStyles = css`:host(:not([layout=classic])) .triggerContent{padding:0 var(--ds-size-
|
|
3026
|
+
var counterGroupStyles = css`:host(:not([layout=classic])) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout=snowflake]) [auro-dropdown] .mainContent{align-items:center}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}.mainContent{display:flex;overflow:hidden;width:100%;flex-direction:column;align-items:flex-start;justify-content:center}label{font-size:var(--ds-text-body-size-default, 1rem);line-height:20px}label.filled{font-size:var(--ds-text-body-size-xs, 0.75rem)}.accents ::slotted([slot=typeIcon]){margin-right:8px}.accents ::slotted(*):not(.util_displayHidden){display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px}slot[name=valueText]{font-size:var(--ds-text-body-size-default, 1rem);overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.counters{display:flex;flex-direction:column;gap:var(--ds-size-300, 1.5rem)}.counters ::slotted(auro-counter:not(:first-of-type)){padding-top:var(--ds-size-300, 1.5rem);border-top-width:1px;border-top-style:solid}[auro-helptext] [part=helpText]{display:flex;flex-direction:column}[auro-helptext] [part=helpText]>p{margin-block:0}`;
|
|
3016
3027
|
|
|
3017
3028
|
var shapeSizeCss$1 = 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}`;
|
|
3018
3029
|
|
|
@@ -4702,7 +4713,7 @@ class AuroFloatingUI {
|
|
|
4702
4713
|
*/
|
|
4703
4714
|
mirrorSize() {
|
|
4704
4715
|
// mirror the boxsize from bibSizer
|
|
4705
|
-
if (this.element.bibSizer) {
|
|
4716
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
4706
4717
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
4707
4718
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
4708
4719
|
if (sizerStyle.width !== '0px') {
|
|
@@ -4914,13 +4925,13 @@ class AuroFloatingUI {
|
|
|
4914
4925
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
4915
4926
|
return;
|
|
4916
4927
|
}
|
|
4917
|
-
|
|
4928
|
+
|
|
4918
4929
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4919
4930
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
4920
4931
|
return;
|
|
4921
4932
|
}
|
|
4922
4933
|
|
|
4923
|
-
this.hideBib();
|
|
4934
|
+
this.hideBib("keydown");
|
|
4924
4935
|
}
|
|
4925
4936
|
|
|
4926
4937
|
setupHideHandlers() {
|
|
@@ -4945,7 +4956,7 @@ class AuroFloatingUI {
|
|
|
4945
4956
|
document.expandedAuroFormkitDropdown = null;
|
|
4946
4957
|
document.expandedAuroFloater = this;
|
|
4947
4958
|
} else {
|
|
4948
|
-
this.hideBib();
|
|
4959
|
+
this.hideBib("click");
|
|
4949
4960
|
}
|
|
4950
4961
|
}
|
|
4951
4962
|
};
|
|
@@ -4958,7 +4969,7 @@ class AuroFloatingUI {
|
|
|
4958
4969
|
// if something else is open, let it handle itself
|
|
4959
4970
|
return;
|
|
4960
4971
|
}
|
|
4961
|
-
this.hideBib();
|
|
4972
|
+
this.hideBib("keydown");
|
|
4962
4973
|
}
|
|
4963
4974
|
};
|
|
4964
4975
|
|
|
@@ -5041,7 +5052,11 @@ class AuroFloatingUI {
|
|
|
5041
5052
|
}
|
|
5042
5053
|
}
|
|
5043
5054
|
|
|
5044
|
-
|
|
5055
|
+
/**
|
|
5056
|
+
* Hides the floating UI element.
|
|
5057
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
5058
|
+
*/
|
|
5059
|
+
hideBib(eventType = "unknown") {
|
|
5045
5060
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
5046
5061
|
this.lockScroll(false);
|
|
5047
5062
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -5052,7 +5067,7 @@ class AuroFloatingUI {
|
|
|
5052
5067
|
if (this.showing) {
|
|
5053
5068
|
this.cleanupHideHandlers();
|
|
5054
5069
|
this.showing = false;
|
|
5055
|
-
this.dispatchEventDropdownToggle();
|
|
5070
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
5056
5071
|
}
|
|
5057
5072
|
}
|
|
5058
5073
|
document.expandedAuroFloater = null;
|
|
@@ -5061,11 +5076,13 @@ class AuroFloatingUI {
|
|
|
5061
5076
|
/**
|
|
5062
5077
|
* @private
|
|
5063
5078
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
5079
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
5064
5080
|
*/
|
|
5065
|
-
dispatchEventDropdownToggle() {
|
|
5081
|
+
dispatchEventDropdownToggle(eventType) {
|
|
5066
5082
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
5067
5083
|
detail: {
|
|
5068
5084
|
expanded: this.showing,
|
|
5085
|
+
eventType: eventType || "unknown",
|
|
5069
5086
|
},
|
|
5070
5087
|
composed: true
|
|
5071
5088
|
});
|
|
@@ -5075,7 +5092,7 @@ class AuroFloatingUI {
|
|
|
5075
5092
|
|
|
5076
5093
|
handleClick() {
|
|
5077
5094
|
if (this.element.isPopoverVisible) {
|
|
5078
|
-
this.hideBib();
|
|
5095
|
+
this.hideBib("click");
|
|
5079
5096
|
} else {
|
|
5080
5097
|
this.showBib();
|
|
5081
5098
|
}
|
|
@@ -5102,7 +5119,7 @@ class AuroFloatingUI {
|
|
|
5102
5119
|
|
|
5103
5120
|
event.preventDefault();
|
|
5104
5121
|
this.handleClick();
|
|
5105
|
-
}
|
|
5122
|
+
}
|
|
5106
5123
|
break;
|
|
5107
5124
|
case 'mouseenter':
|
|
5108
5125
|
if (this.element.hoverToggle) {
|
|
@@ -5111,7 +5128,7 @@ class AuroFloatingUI {
|
|
|
5111
5128
|
break;
|
|
5112
5129
|
case 'mouseleave':
|
|
5113
5130
|
if (this.element.hoverToggle) {
|
|
5114
|
-
this.hideBib();
|
|
5131
|
+
this.hideBib("mouseleave");
|
|
5115
5132
|
}
|
|
5116
5133
|
break;
|
|
5117
5134
|
case 'focus':
|
|
@@ -6499,6 +6516,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6499
6516
|
|
|
6500
6517
|
this.parentBorder = false;
|
|
6501
6518
|
|
|
6519
|
+
/** @private */
|
|
6520
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
6521
|
+
|
|
6502
6522
|
this.privateDefaults();
|
|
6503
6523
|
}
|
|
6504
6524
|
|
|
@@ -6932,12 +6952,19 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6932
6952
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
6933
6953
|
this.handleTriggerContentSlotChange();
|
|
6934
6954
|
}
|
|
6955
|
+
}
|
|
6935
6956
|
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6957
|
+
/**
|
|
6958
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
6959
|
+
* @private
|
|
6960
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
6961
|
+
*/
|
|
6962
|
+
handleDropdownToggle(event) {
|
|
6963
|
+
this.updateFocusTrap();
|
|
6964
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
6965
|
+
const eventType = event.detail.eventType || "unknown";
|
|
6966
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
6967
|
+
this.trigger.focus();
|
|
6941
6968
|
}
|
|
6942
6969
|
}
|
|
6943
6970
|
|
|
@@ -6945,6 +6972,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6945
6972
|
|
|
6946
6973
|
// Configure the floater to, this will generate the ID for the bib
|
|
6947
6974
|
this.floater.configure(this, 'auroDropdown');
|
|
6975
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
6948
6976
|
|
|
6949
6977
|
/**
|
|
6950
6978
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css, LitElement, html } from 'lit';
|
|
2
2
|
import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
|
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
4
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
|
|
6
6
|
var tokens = css`:host(:not([ondark])){--ds-auro-counter-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-counter-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-counter-outline-color: transparent;--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15))}:host([ondark]){--ds-auro-counter-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-counter-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-counter-error-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-counter-outline-color: transparent;--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider-inverse, rgba(255, 255, 255, 0.4))}`;
|
|
7
7
|
|
|
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
|
|
|
2234
2234
|
this.getInputElements(elem);
|
|
2235
2235
|
this.getAuroInputs(elem);
|
|
2236
2236
|
|
|
2237
|
-
//
|
|
2237
|
+
// Check if validation should run
|
|
2238
2238
|
let validationShouldRun =
|
|
2239
|
+
|
|
2240
|
+
// If the validation was forced
|
|
2239
2241
|
force ||
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2242
|
+
|
|
2243
|
+
// If the validation should run on input
|
|
2244
|
+
elem.validateOnInput ||
|
|
2245
|
+
|
|
2246
|
+
// State-based checks
|
|
2247
|
+
(
|
|
2248
|
+
// Element is not currently focused
|
|
2249
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
2250
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
2251
|
+
|
|
2252
|
+
// And element has been touched or is untouched but has a value
|
|
2253
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
2254
|
+
);
|
|
2244
2255
|
|
|
2245
2256
|
if (elem.hasAttribute('error')) {
|
|
2246
2257
|
elem.validity = 'customError';
|
|
@@ -2971,13 +2982,13 @@ class AuroCounter extends LitElement {
|
|
|
2971
2982
|
part="counterControl"
|
|
2972
2983
|
aria-labelledby="counter-label"
|
|
2973
2984
|
aria-describedby="counter-description"
|
|
2974
|
-
|
|
2975
|
-
role="spinbutton"
|
|
2976
|
-
aria-disabled="${this.disabled ? 'true' : 'false'}"
|
|
2985
|
+
aria-disabled="${ifDefined(this.disabled ? 'true' : undefined)}"
|
|
2977
2986
|
aria-valuemin="${this.min}"
|
|
2978
2987
|
aria-valuemax="${this.max}"
|
|
2979
2988
|
aria-valuenow="${this.value}"
|
|
2980
2989
|
aria-valuetext="${this.value !== undefined ? this.value : this.min}"
|
|
2990
|
+
role="spinbutton"
|
|
2991
|
+
tabindex="${this.disabled ? '-1' : '0'}"
|
|
2981
2992
|
>
|
|
2982
2993
|
<auro-counter-button
|
|
2983
2994
|
aria-hidden="true"
|
|
@@ -3012,7 +3023,7 @@ class AuroCounter extends LitElement {
|
|
|
3012
3023
|
}
|
|
3013
3024
|
}
|
|
3014
3025
|
|
|
3015
|
-
var counterGroupStyles = css`:host(:not([layout=classic])) .triggerContent{padding:0 var(--ds-size-
|
|
3026
|
+
var counterGroupStyles = css`:host(:not([layout=classic])) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout=snowflake]) [auro-dropdown] .mainContent{align-items:center}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}.mainContent{display:flex;overflow:hidden;width:100%;flex-direction:column;align-items:flex-start;justify-content:center}label{font-size:var(--ds-text-body-size-default, 1rem);line-height:20px}label.filled{font-size:var(--ds-text-body-size-xs, 0.75rem)}.accents ::slotted([slot=typeIcon]){margin-right:8px}.accents ::slotted(*):not(.util_displayHidden){display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px}slot[name=valueText]{font-size:var(--ds-text-body-size-default, 1rem);overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.counters{display:flex;flex-direction:column;gap:var(--ds-size-300, 1.5rem)}.counters ::slotted(auro-counter:not(:first-of-type)){padding-top:var(--ds-size-300, 1.5rem);border-top-width:1px;border-top-style:solid}[auro-helptext] [part=helpText]{display:flex;flex-direction:column}[auro-helptext] [part=helpText]>p{margin-block:0}`;
|
|
3016
3027
|
|
|
3017
3028
|
var shapeSizeCss$1 = 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}`;
|
|
3018
3029
|
|
|
@@ -4702,7 +4713,7 @@ class AuroFloatingUI {
|
|
|
4702
4713
|
*/
|
|
4703
4714
|
mirrorSize() {
|
|
4704
4715
|
// mirror the boxsize from bibSizer
|
|
4705
|
-
if (this.element.bibSizer) {
|
|
4716
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
4706
4717
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
4707
4718
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
4708
4719
|
if (sizerStyle.width !== '0px') {
|
|
@@ -4914,13 +4925,13 @@ class AuroFloatingUI {
|
|
|
4914
4925
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
4915
4926
|
return;
|
|
4916
4927
|
}
|
|
4917
|
-
|
|
4928
|
+
|
|
4918
4929
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4919
4930
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
4920
4931
|
return;
|
|
4921
4932
|
}
|
|
4922
4933
|
|
|
4923
|
-
this.hideBib();
|
|
4934
|
+
this.hideBib("keydown");
|
|
4924
4935
|
}
|
|
4925
4936
|
|
|
4926
4937
|
setupHideHandlers() {
|
|
@@ -4945,7 +4956,7 @@ class AuroFloatingUI {
|
|
|
4945
4956
|
document.expandedAuroFormkitDropdown = null;
|
|
4946
4957
|
document.expandedAuroFloater = this;
|
|
4947
4958
|
} else {
|
|
4948
|
-
this.hideBib();
|
|
4959
|
+
this.hideBib("click");
|
|
4949
4960
|
}
|
|
4950
4961
|
}
|
|
4951
4962
|
};
|
|
@@ -4958,7 +4969,7 @@ class AuroFloatingUI {
|
|
|
4958
4969
|
// if something else is open, let it handle itself
|
|
4959
4970
|
return;
|
|
4960
4971
|
}
|
|
4961
|
-
this.hideBib();
|
|
4972
|
+
this.hideBib("keydown");
|
|
4962
4973
|
}
|
|
4963
4974
|
};
|
|
4964
4975
|
|
|
@@ -5041,7 +5052,11 @@ class AuroFloatingUI {
|
|
|
5041
5052
|
}
|
|
5042
5053
|
}
|
|
5043
5054
|
|
|
5044
|
-
|
|
5055
|
+
/**
|
|
5056
|
+
* Hides the floating UI element.
|
|
5057
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
5058
|
+
*/
|
|
5059
|
+
hideBib(eventType = "unknown") {
|
|
5045
5060
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
5046
5061
|
this.lockScroll(false);
|
|
5047
5062
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -5052,7 +5067,7 @@ class AuroFloatingUI {
|
|
|
5052
5067
|
if (this.showing) {
|
|
5053
5068
|
this.cleanupHideHandlers();
|
|
5054
5069
|
this.showing = false;
|
|
5055
|
-
this.dispatchEventDropdownToggle();
|
|
5070
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
5056
5071
|
}
|
|
5057
5072
|
}
|
|
5058
5073
|
document.expandedAuroFloater = null;
|
|
@@ -5061,11 +5076,13 @@ class AuroFloatingUI {
|
|
|
5061
5076
|
/**
|
|
5062
5077
|
* @private
|
|
5063
5078
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
5079
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
5064
5080
|
*/
|
|
5065
|
-
dispatchEventDropdownToggle() {
|
|
5081
|
+
dispatchEventDropdownToggle(eventType) {
|
|
5066
5082
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
5067
5083
|
detail: {
|
|
5068
5084
|
expanded: this.showing,
|
|
5085
|
+
eventType: eventType || "unknown",
|
|
5069
5086
|
},
|
|
5070
5087
|
composed: true
|
|
5071
5088
|
});
|
|
@@ -5075,7 +5092,7 @@ class AuroFloatingUI {
|
|
|
5075
5092
|
|
|
5076
5093
|
handleClick() {
|
|
5077
5094
|
if (this.element.isPopoverVisible) {
|
|
5078
|
-
this.hideBib();
|
|
5095
|
+
this.hideBib("click");
|
|
5079
5096
|
} else {
|
|
5080
5097
|
this.showBib();
|
|
5081
5098
|
}
|
|
@@ -5102,7 +5119,7 @@ class AuroFloatingUI {
|
|
|
5102
5119
|
|
|
5103
5120
|
event.preventDefault();
|
|
5104
5121
|
this.handleClick();
|
|
5105
|
-
}
|
|
5122
|
+
}
|
|
5106
5123
|
break;
|
|
5107
5124
|
case 'mouseenter':
|
|
5108
5125
|
if (this.element.hoverToggle) {
|
|
@@ -5111,7 +5128,7 @@ class AuroFloatingUI {
|
|
|
5111
5128
|
break;
|
|
5112
5129
|
case 'mouseleave':
|
|
5113
5130
|
if (this.element.hoverToggle) {
|
|
5114
|
-
this.hideBib();
|
|
5131
|
+
this.hideBib("mouseleave");
|
|
5115
5132
|
}
|
|
5116
5133
|
break;
|
|
5117
5134
|
case 'focus':
|
|
@@ -6499,6 +6516,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6499
6516
|
|
|
6500
6517
|
this.parentBorder = false;
|
|
6501
6518
|
|
|
6519
|
+
/** @private */
|
|
6520
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
6521
|
+
|
|
6502
6522
|
this.privateDefaults();
|
|
6503
6523
|
}
|
|
6504
6524
|
|
|
@@ -6932,12 +6952,19 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6932
6952
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
6933
6953
|
this.handleTriggerContentSlotChange();
|
|
6934
6954
|
}
|
|
6955
|
+
}
|
|
6935
6956
|
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6957
|
+
/**
|
|
6958
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
6959
|
+
* @private
|
|
6960
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
6961
|
+
*/
|
|
6962
|
+
handleDropdownToggle(event) {
|
|
6963
|
+
this.updateFocusTrap();
|
|
6964
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
6965
|
+
const eventType = event.detail.eventType || "unknown";
|
|
6966
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
6967
|
+
this.trigger.focus();
|
|
6941
6968
|
}
|
|
6942
6969
|
}
|
|
6943
6970
|
|
|
@@ -6945,6 +6972,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
6945
6972
|
|
|
6946
6973
|
// Configure the floater to, this will generate the ID for the bib
|
|
6947
6974
|
this.floater.configure(this, 'auroDropdown');
|
|
6975
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
6948
6976
|
|
|
6949
6977
|
/**
|
|
6950
6978
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
|
|
51
51
|
| Method | Type | Description |
|
|
52
52
|
|-------------------------------|----------------------------------------|--------------------------------------------------|
|
|
53
|
+
| [clear](#clear) | `(): void` | Clears the current value(s) of the datepicker. |
|
|
53
54
|
| [focus](#focus) | `(focusInput: string): void` | Focuses the datepicker trigger input.<br /><br />**focusInput**: Pass in `endDate` to focus on the return input. No parameter is needed to focus on the depart input. |
|
|
54
55
|
| [renderHtmlActionClear](#renderHtmlActionClear) | `(): TemplateResult` | |
|
|
55
56
|
| [renderHtmlIconCalendar](#renderHtmlIconCalendar) | `(): TemplateResult` | |
|
|
56
57
|
| [renderHtmlIconError](#renderHtmlIconError) | `(): TemplateResult` | |
|
|
57
58
|
| [renderHtmlInputs](#renderHtmlInputs) | `(): TemplateResult` | |
|
|
58
|
-
| [renderLayoutFromAttributes](#renderLayoutFromAttributes) | `(): TemplateResult` | |
|
|
59
59
|
| [reset](#reset) | `(): void` | Resets component to initial state. |
|
|
60
60
|
| [resetLayoutClasses](#resetLayoutClasses) | `(): void` | |
|
|
61
61
|
| [resetShapeClasses](#resetShapeClasses) | `(): void` | |
|