@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.1 → 0.0.0-pr784.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/api.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 +69 -48
- package/components/combobox/demo/index.min.js +69 -48
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +69 -48
- package/components/combobox/dist/registered.js +69 -48
- package/components/counter/demo/api.min.js +32 -39
- package/components/counter/demo/index.min.js +32 -39
- package/components/counter/dist/index.js +32 -39
- package/components/counter/dist/registered.js +32 -39
- package/components/datepicker/demo/api.md +2 -0
- package/components/datepicker/demo/api.min.js +69 -107
- package/components/datepicker/demo/index.min.js +69 -107
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -19
- package/components/datepicker/dist/index.js +69 -107
- package/components/datepicker/dist/registered.js +69 -107
- package/components/dropdown/demo/api.min.js +16 -33
- package/components/dropdown/demo/index.min.js +16 -33
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -6
- package/components/dropdown/dist/index.js +16 -33
- package/components/dropdown/dist/registered.js +16 -33
- package/components/input/demo/api.md +2 -1
- package/components/input/demo/api.min.js +25 -7
- package/components/input/demo/index.min.js +25 -7
- package/components/input/dist/base-input.d.ts +5 -1
- package/components/input/dist/index.js +25 -7
- package/components/input/dist/registered.js +25 -7
- 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 +32 -38
- package/components/select/demo/index.min.js +32 -38
- package/components/select/dist/index.js +32 -38
- package/components/select/dist/registered.js +32 -38
- package/package.json +2 -2
|
@@ -710,13 +710,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
710
710
|
this.getInputElements(elem);
|
|
711
711
|
this.getAuroInputs(elem);
|
|
712
712
|
|
|
713
|
-
//
|
|
713
|
+
// Check if validation should run
|
|
714
714
|
let validationShouldRun =
|
|
715
|
+
|
|
716
|
+
// If the validation was forced
|
|
715
717
|
force ||
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
|
|
719
|
+
// If the validation should run on input
|
|
720
|
+
elem.validateOnInput ||
|
|
721
|
+
|
|
722
|
+
// State-based checks
|
|
723
|
+
(
|
|
724
|
+
// Element is not currently focused
|
|
725
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
726
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
727
|
+
|
|
728
|
+
// And element has been touched or is untouched but has a value
|
|
729
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
730
|
+
);
|
|
720
731
|
|
|
721
732
|
if (elem.hasAttribute('error')) {
|
|
722
733
|
elem.validity = 'customError';
|
|
@@ -1257,9 +1268,9 @@ var shapeSizeCss$2 = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
|
|
|
1257
1268
|
|
|
1258
1269
|
var classicLayoutColor = css``;
|
|
1259
1270
|
|
|
1260
|
-
var snowflakeStyle = css`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-
|
|
1271
|
+
var snowflakeStyle = css`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-dropdown]::part(trigger){width:100%}:host([layout*=snowflake]) .dpTriggerContent{width:100%}:host([layout*=snowflake]) .wrapper{height:60px;width:calc(100% - 48px);display:flex;flex-direction:row;justify-content:space-between;padding-left:24px;padding-right:24px}:host([layout*=snowflake]) label{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);font-weight:450;letter-spacing:0}:host([layout*=snowflake]) label.hasFocus,:host([layout*=snowflake]) label.hasValue{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-height-xs, 1rem)}:host([layout*=snowflake]) .inputDivider{height:18px;margin:4px 12px;width:2px}`;
|
|
1261
1272
|
|
|
1262
|
-
var snowflakeColors = css`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-
|
|
1273
|
+
var snowflakeColors = css`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
|
|
1263
1274
|
|
|
1264
1275
|
var styleCss$d = css`:host{--calendar-width: 336px;--mobile-footer-height: 150px;--mobile-header-height: 68px;height:100vh;height:100dvh}.calendars{display:flex;flex-direction:row}.calendarNavButtons{position:absolute;top:var(--ds-size-200, 1rem);right:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem)}.calendarNavBtn{display:flex;width:var(--ds-size-500, 2.5rem);height:var(--ds-size-500, 2.5rem);align-items:center;justify-content:center;border-width:1px;border-style:solid;border-radius:50%;cursor:pointer}.prevMonth,.nextMonth{position:absolute;top:0}.prevMonth{left:0}.nextMonth{right:0}.headerActions{padding:0 var(--ds-size-200, 1rem)}.mobileHeader{width:100%;height:var(--mobile-header-height);z-index:1;align-items:center;flex-direction:row}.headerDateFrom{display:flex;height:var(--mobile-header-height);flex:1;flex-direction:column;justify-content:center;padding:0 var(--ds-size-150, 0.75rem) 0 var(--ds-size-200, 1rem)}.mobileDateLabel{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}.headerDateTo{height:calc(var(--mobile-header-height) - var(--ds-size-300, 1.5rem));padding:var(--ds-size-300, 1.5rem) var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host(:not([noRange])) .headerDateTo{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center}:host(:not([noRange])) .headerDateTo:after{position:absolute;top:calc(50% + 10px);left:0;display:block;width:1px;height:var(--ds-size-300, 1.5rem);content:"";transform:translateY(-50%)}.mobileFooter{display:none;width:100%;align-items:flex-end;flex-direction:column;justify-content:flex-end}.mobileFooterActions{position:relative;bottom:0;left:50%;display:none;width:calc(100% - var(--ds-size-200, 1rem)*2);align-items:flex-end;flex-direction:column;justify-content:flex-end;padding:var(--ds-size-150) calc(var(--ds-size-200, 1rem));transform:translateX(-50%)}.mobileFooterActions auro-button{width:100%}:host([isfullscreen]){width:100%;max-height:100dvh;overflow:hidden}:host([isfullscreen]) .prevMonth,:host([isfullscreen]) .nextMonth{display:none}:host([isfullscreen]) .mobileHeader,:host([isfullscreen]) .mobileFooter,:host([isfullscreen]) .mobileFooterActions{display:flex}:host([isfullscreen]) .calendarWrapper{display:flex;flex-direction:column}:host([isfullscreen]) .calendars{display:flex;flex-direction:column;flex:1;align-items:center;width:100%;overscroll-behavior:contain}:host([isfullscreen]) .calendars:after{display:block;width:100%;height:var(--mobile-footer-height);content:""}`;
|
|
1265
1276
|
|
|
@@ -15795,7 +15806,7 @@ class AuroFloatingUI {
|
|
|
15795
15806
|
*/
|
|
15796
15807
|
mirrorSize() {
|
|
15797
15808
|
// mirror the boxsize from bibSizer
|
|
15798
|
-
if (this.element.bibSizer
|
|
15809
|
+
if (this.element.bibSizer) {
|
|
15799
15810
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
15800
15811
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
15801
15812
|
if (sizerStyle.width !== '0px') {
|
|
@@ -16007,13 +16018,13 @@ class AuroFloatingUI {
|
|
|
16007
16018
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
16008
16019
|
return;
|
|
16009
16020
|
}
|
|
16010
|
-
|
|
16021
|
+
|
|
16011
16022
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
16012
16023
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
16013
16024
|
return;
|
|
16014
16025
|
}
|
|
16015
16026
|
|
|
16016
|
-
this.hideBib(
|
|
16027
|
+
this.hideBib();
|
|
16017
16028
|
}
|
|
16018
16029
|
|
|
16019
16030
|
setupHideHandlers() {
|
|
@@ -16038,7 +16049,7 @@ class AuroFloatingUI {
|
|
|
16038
16049
|
document.expandedAuroFormkitDropdown = null;
|
|
16039
16050
|
document.expandedAuroFloater = this;
|
|
16040
16051
|
} else {
|
|
16041
|
-
this.hideBib(
|
|
16052
|
+
this.hideBib();
|
|
16042
16053
|
}
|
|
16043
16054
|
}
|
|
16044
16055
|
};
|
|
@@ -16051,7 +16062,7 @@ class AuroFloatingUI {
|
|
|
16051
16062
|
// if something else is open, let it handle itself
|
|
16052
16063
|
return;
|
|
16053
16064
|
}
|
|
16054
|
-
this.hideBib(
|
|
16065
|
+
this.hideBib();
|
|
16055
16066
|
}
|
|
16056
16067
|
};
|
|
16057
16068
|
|
|
@@ -16134,11 +16145,7 @@ class AuroFloatingUI {
|
|
|
16134
16145
|
}
|
|
16135
16146
|
}
|
|
16136
16147
|
|
|
16137
|
-
|
|
16138
|
-
* Hides the floating UI element.
|
|
16139
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
16140
|
-
*/
|
|
16141
|
-
hideBib(eventType = "unknown") {
|
|
16148
|
+
hideBib() {
|
|
16142
16149
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
16143
16150
|
this.lockScroll(false);
|
|
16144
16151
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -16149,7 +16156,7 @@ class AuroFloatingUI {
|
|
|
16149
16156
|
if (this.showing) {
|
|
16150
16157
|
this.cleanupHideHandlers();
|
|
16151
16158
|
this.showing = false;
|
|
16152
|
-
this.dispatchEventDropdownToggle(
|
|
16159
|
+
this.dispatchEventDropdownToggle();
|
|
16153
16160
|
}
|
|
16154
16161
|
}
|
|
16155
16162
|
document.expandedAuroFloater = null;
|
|
@@ -16158,13 +16165,11 @@ class AuroFloatingUI {
|
|
|
16158
16165
|
/**
|
|
16159
16166
|
* @private
|
|
16160
16167
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
16161
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
16162
16168
|
*/
|
|
16163
|
-
dispatchEventDropdownToggle(
|
|
16169
|
+
dispatchEventDropdownToggle() {
|
|
16164
16170
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
16165
16171
|
detail: {
|
|
16166
16172
|
expanded: this.showing,
|
|
16167
|
-
eventType: eventType || "unknown",
|
|
16168
16173
|
},
|
|
16169
16174
|
composed: true
|
|
16170
16175
|
});
|
|
@@ -16174,7 +16179,7 @@ class AuroFloatingUI {
|
|
|
16174
16179
|
|
|
16175
16180
|
handleClick() {
|
|
16176
16181
|
if (this.element.isPopoverVisible) {
|
|
16177
|
-
this.hideBib(
|
|
16182
|
+
this.hideBib();
|
|
16178
16183
|
} else {
|
|
16179
16184
|
this.showBib();
|
|
16180
16185
|
}
|
|
@@ -16201,7 +16206,7 @@ class AuroFloatingUI {
|
|
|
16201
16206
|
|
|
16202
16207
|
event.preventDefault();
|
|
16203
16208
|
this.handleClick();
|
|
16204
|
-
}
|
|
16209
|
+
}
|
|
16205
16210
|
break;
|
|
16206
16211
|
case 'mouseenter':
|
|
16207
16212
|
if (this.element.hoverToggle) {
|
|
@@ -16210,7 +16215,7 @@ class AuroFloatingUI {
|
|
|
16210
16215
|
break;
|
|
16211
16216
|
case 'mouseleave':
|
|
16212
16217
|
if (this.element.hoverToggle) {
|
|
16213
|
-
this.hideBib(
|
|
16218
|
+
this.hideBib();
|
|
16214
16219
|
}
|
|
16215
16220
|
break;
|
|
16216
16221
|
case 'focus':
|
|
@@ -17598,9 +17603,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
17598
17603
|
|
|
17599
17604
|
this.parentBorder = false;
|
|
17600
17605
|
|
|
17601
|
-
/** @private */
|
|
17602
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
17603
|
-
|
|
17604
17606
|
this.privateDefaults();
|
|
17605
17607
|
}
|
|
17606
17608
|
|
|
@@ -18034,19 +18036,12 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18034
18036
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
18035
18037
|
this.handleTriggerContentSlotChange();
|
|
18036
18038
|
}
|
|
18037
|
-
}
|
|
18038
18039
|
|
|
18039
|
-
|
|
18040
|
-
|
|
18041
|
-
|
|
18042
|
-
|
|
18043
|
-
|
|
18044
|
-
handleDropdownToggle(event) {
|
|
18045
|
-
this.updateFocusTrap();
|
|
18046
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
18047
|
-
const eventType = event.detail.eventType || "unknown";
|
|
18048
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
18049
|
-
this.trigger.focus();
|
|
18040
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
18041
|
+
this.updateFocusTrap();
|
|
18042
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
18043
|
+
this.trigger.focus();
|
|
18044
|
+
}
|
|
18050
18045
|
}
|
|
18051
18046
|
}
|
|
18052
18047
|
|
|
@@ -18054,7 +18049,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18054
18049
|
|
|
18055
18050
|
// Configure the floater to, this will generate the ID for the bib
|
|
18056
18051
|
this.floater.configure(this, 'auroDropdown');
|
|
18057
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
18058
18052
|
|
|
18059
18053
|
/**
|
|
18060
18054
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -23201,13 +23195,24 @@ class AuroFormValidation {
|
|
|
23201
23195
|
this.getInputElements(elem);
|
|
23202
23196
|
this.getAuroInputs(elem);
|
|
23203
23197
|
|
|
23204
|
-
//
|
|
23198
|
+
// Check if validation should run
|
|
23205
23199
|
let validationShouldRun =
|
|
23200
|
+
|
|
23201
|
+
// If the validation was forced
|
|
23206
23202
|
force ||
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
|
|
23203
|
+
|
|
23204
|
+
// If the validation should run on input
|
|
23205
|
+
elem.validateOnInput ||
|
|
23206
|
+
|
|
23207
|
+
// State-based checks
|
|
23208
|
+
(
|
|
23209
|
+
// Element is not currently focused
|
|
23210
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
23211
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
23212
|
+
|
|
23213
|
+
// And element has been touched or is untouched but has a value
|
|
23214
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
23215
|
+
);
|
|
23211
23216
|
|
|
23212
23217
|
if (elem.hasAttribute('error')) {
|
|
23213
23218
|
elem.validity = 'customError';
|
|
@@ -24158,9 +24163,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24158
24163
|
this.inputElement.value = "";
|
|
24159
24164
|
this.value = "";
|
|
24160
24165
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
24166
|
+
this.notifyValueChanged();
|
|
24161
24167
|
this.focus();
|
|
24162
24168
|
this.validation.validate(this);
|
|
24163
|
-
this.notifyValueChanged();
|
|
24164
24169
|
}
|
|
24165
24170
|
|
|
24166
24171
|
/**
|
|
@@ -24255,13 +24260,20 @@ class BaseInput extends AuroElement$2 {
|
|
|
24255
24260
|
}
|
|
24256
24261
|
|
|
24257
24262
|
/**
|
|
24258
|
-
* Resets component to initial state.
|
|
24263
|
+
* Resets component to initial state, including resetting the touched state and validity.
|
|
24259
24264
|
* @returns {void}
|
|
24260
24265
|
*/
|
|
24261
24266
|
reset() {
|
|
24262
24267
|
this.validation.reset(this);
|
|
24263
24268
|
}
|
|
24264
24269
|
|
|
24270
|
+
/**
|
|
24271
|
+
* Clears the input value
|
|
24272
|
+
*/
|
|
24273
|
+
clear() {
|
|
24274
|
+
this.value = undefined;
|
|
24275
|
+
}
|
|
24276
|
+
|
|
24265
24277
|
/**
|
|
24266
24278
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
24267
24279
|
* @private
|
|
@@ -27667,15 +27679,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
27667
27679
|
this.layout = 'classic';
|
|
27668
27680
|
this.shape = 'classic';
|
|
27669
27681
|
this.size = 'lg';
|
|
27670
|
-
|
|
27671
|
-
/**
|
|
27672
|
-
* @private
|
|
27673
|
-
* @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
|
|
27674
|
-
*/
|
|
27675
|
-
this.constructor.shadowRootOptions = {
|
|
27676
|
-
...LitElement.shadowRootOptions,
|
|
27677
|
-
delegatesFocus: true,
|
|
27678
|
-
};
|
|
27679
27682
|
}
|
|
27680
27683
|
|
|
27681
27684
|
// This function is to define props used within the scope of this component
|
|
@@ -28385,7 +28388,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28385
28388
|
*/
|
|
28386
28389
|
resetValues() {
|
|
28387
28390
|
this.inputList.forEach((input) => {
|
|
28388
|
-
input.
|
|
28391
|
+
input.clear();
|
|
28389
28392
|
});
|
|
28390
28393
|
}
|
|
28391
28394
|
|
|
@@ -28395,10 +28398,17 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28395
28398
|
*/
|
|
28396
28399
|
reset() {
|
|
28397
28400
|
this.resetValues();
|
|
28398
|
-
|
|
28399
28401
|
this.validation.reset(this);
|
|
28400
28402
|
}
|
|
28401
28403
|
|
|
28404
|
+
/**
|
|
28405
|
+
* Clears the current value(s) of the datepicker.
|
|
28406
|
+
* @returns {void}
|
|
28407
|
+
*/
|
|
28408
|
+
clear() {
|
|
28409
|
+
this.resetValues();
|
|
28410
|
+
}
|
|
28411
|
+
|
|
28402
28412
|
/**
|
|
28403
28413
|
* Validates value.
|
|
28404
28414
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
@@ -28413,7 +28423,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28413
28423
|
}
|
|
28414
28424
|
|
|
28415
28425
|
this.hasFocus = true;
|
|
28416
|
-
this.dropdown.show();
|
|
28417
28426
|
|
|
28418
28427
|
// shadowroot active element is null if we focus the datepicker itself
|
|
28419
28428
|
if (this.shadowRoot.activeElement === null) {
|
|
@@ -28737,9 +28746,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28737
28746
|
`;
|
|
28738
28747
|
}
|
|
28739
28748
|
|
|
28740
|
-
/**
|
|
28741
|
-
* @private
|
|
28742
|
-
*/
|
|
28743
28749
|
renderLayoutFromAttributes() {
|
|
28744
28750
|
switch (this.layout) {
|
|
28745
28751
|
case 'snowflake':
|
|
@@ -28752,44 +28758,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28752
28758
|
}
|
|
28753
28759
|
}
|
|
28754
28760
|
|
|
28755
|
-
// eslint-disable-next-line no-warning-comments
|
|
28756
|
-
// TODO: move this to date utility when time allows :(
|
|
28757
|
-
/**
|
|
28758
|
-
* Simple formatter that ONLY WORKS FOR US DATES.
|
|
28759
|
-
* Returns formatted date like Apr 21 or Dec 25.
|
|
28760
|
-
* @private
|
|
28761
|
-
* @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
|
|
28762
|
-
* @return {string}
|
|
28763
|
-
*/
|
|
28764
|
-
formatShortDate(date) {
|
|
28765
|
-
// should render like Apr 21
|
|
28766
|
-
const options = {
|
|
28767
|
-
month: 'short',
|
|
28768
|
-
day: '2-digit'
|
|
28769
|
-
};
|
|
28770
|
-
|
|
28771
|
-
return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
|
|
28772
|
-
}
|
|
28773
|
-
|
|
28774
|
-
/**
|
|
28775
|
-
* Format and render the provided date value.
|
|
28776
|
-
* @private
|
|
28777
|
-
* @param dateValue
|
|
28778
|
-
* @return {TemplateResult}
|
|
28779
|
-
*/
|
|
28780
|
-
renderDisplayTextDate(dateValue) {
|
|
28781
|
-
return html$1`
|
|
28782
|
-
<div>
|
|
28783
|
-
<div class="displayValueText">
|
|
28784
|
-
${dateValue && this.util.validDateStr(dateValue, this.format)
|
|
28785
|
-
? this.formatShortDate(dateValue)
|
|
28786
|
-
: undefined
|
|
28787
|
-
}
|
|
28788
|
-
</div>
|
|
28789
|
-
</div>
|
|
28790
|
-
`;
|
|
28791
|
-
}
|
|
28792
|
-
|
|
28793
28761
|
renderHtmlInputs() {
|
|
28794
28762
|
const inputClasses = {
|
|
28795
28763
|
"util_displayHiddenVisually": !this.hasValue && !this.hasFocus
|
|
@@ -28805,7 +28773,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28805
28773
|
.max="${this.maxDate}"
|
|
28806
28774
|
.min="${this.minDate}"
|
|
28807
28775
|
id="${this.generateRandomString(12)}"
|
|
28808
|
-
|
|
28776
|
+
placeholder="MM/DD"
|
|
28809
28777
|
simple
|
|
28810
28778
|
bordered
|
|
28811
28779
|
noValidate
|
|
@@ -28821,9 +28789,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28821
28789
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28822
28790
|
inputmode="${ifDefined(this.inputmode)}"
|
|
28823
28791
|
>
|
|
28824
|
-
<span slot="displayValue">
|
|
28825
|
-
${this.renderDisplayTextDate(this.value)}
|
|
28826
|
-
</span>
|
|
28827
28792
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
28828
28793
|
</${this.inputTag}>
|
|
28829
28794
|
</div>
|
|
@@ -28854,9 +28819,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28854
28819
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28855
28820
|
?disabled="${this.disabled}"
|
|
28856
28821
|
part="input">
|
|
28857
|
-
<span slot="displayValue">
|
|
28858
|
-
${this.renderDisplayTextDate(this.valueEnd)}
|
|
28859
|
-
</span>
|
|
28860
28822
|
<span slot="label"><slot name="toLabel"></slot></span>
|
|
28861
28823
|
</${this.inputTag}>
|
|
28862
28824
|
</div>
|
|
@@ -1755,7 +1755,7 @@ class AuroFloatingUI {
|
|
|
1755
1755
|
*/
|
|
1756
1756
|
mirrorSize() {
|
|
1757
1757
|
// mirror the boxsize from bibSizer
|
|
1758
|
-
if (this.element.bibSizer
|
|
1758
|
+
if (this.element.bibSizer) {
|
|
1759
1759
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
1760
1760
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1761
1761
|
if (sizerStyle.width !== '0px') {
|
|
@@ -1967,13 +1967,13 @@ class AuroFloatingUI {
|
|
|
1967
1967
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
|
-
|
|
1970
|
+
|
|
1971
1971
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
1972
1972
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1973
1973
|
return;
|
|
1974
1974
|
}
|
|
1975
1975
|
|
|
1976
|
-
this.hideBib(
|
|
1976
|
+
this.hideBib();
|
|
1977
1977
|
}
|
|
1978
1978
|
|
|
1979
1979
|
setupHideHandlers() {
|
|
@@ -1998,7 +1998,7 @@ class AuroFloatingUI {
|
|
|
1998
1998
|
document.expandedAuroFormkitDropdown = null;
|
|
1999
1999
|
document.expandedAuroFloater = this;
|
|
2000
2000
|
} else {
|
|
2001
|
-
this.hideBib(
|
|
2001
|
+
this.hideBib();
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
2004
|
};
|
|
@@ -2011,7 +2011,7 @@ class AuroFloatingUI {
|
|
|
2011
2011
|
// if something else is open, let it handle itself
|
|
2012
2012
|
return;
|
|
2013
2013
|
}
|
|
2014
|
-
this.hideBib(
|
|
2014
|
+
this.hideBib();
|
|
2015
2015
|
}
|
|
2016
2016
|
};
|
|
2017
2017
|
|
|
@@ -2094,11 +2094,7 @@ class AuroFloatingUI {
|
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
|
-
|
|
2098
|
-
* Hides the floating UI element.
|
|
2099
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2100
|
-
*/
|
|
2101
|
-
hideBib(eventType = "unknown") {
|
|
2097
|
+
hideBib() {
|
|
2102
2098
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2103
2099
|
this.lockScroll(false);
|
|
2104
2100
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2109,7 +2105,7 @@ class AuroFloatingUI {
|
|
|
2109
2105
|
if (this.showing) {
|
|
2110
2106
|
this.cleanupHideHandlers();
|
|
2111
2107
|
this.showing = false;
|
|
2112
|
-
this.dispatchEventDropdownToggle(
|
|
2108
|
+
this.dispatchEventDropdownToggle();
|
|
2113
2109
|
}
|
|
2114
2110
|
}
|
|
2115
2111
|
document.expandedAuroFloater = null;
|
|
@@ -2118,13 +2114,11 @@ class AuroFloatingUI {
|
|
|
2118
2114
|
/**
|
|
2119
2115
|
* @private
|
|
2120
2116
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
2121
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
2122
2117
|
*/
|
|
2123
|
-
dispatchEventDropdownToggle(
|
|
2118
|
+
dispatchEventDropdownToggle() {
|
|
2124
2119
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2125
2120
|
detail: {
|
|
2126
2121
|
expanded: this.showing,
|
|
2127
|
-
eventType: eventType || "unknown",
|
|
2128
2122
|
},
|
|
2129
2123
|
composed: true
|
|
2130
2124
|
});
|
|
@@ -2134,7 +2128,7 @@ class AuroFloatingUI {
|
|
|
2134
2128
|
|
|
2135
2129
|
handleClick() {
|
|
2136
2130
|
if (this.element.isPopoverVisible) {
|
|
2137
|
-
this.hideBib(
|
|
2131
|
+
this.hideBib();
|
|
2138
2132
|
} else {
|
|
2139
2133
|
this.showBib();
|
|
2140
2134
|
}
|
|
@@ -2161,7 +2155,7 @@ class AuroFloatingUI {
|
|
|
2161
2155
|
|
|
2162
2156
|
event.preventDefault();
|
|
2163
2157
|
this.handleClick();
|
|
2164
|
-
}
|
|
2158
|
+
}
|
|
2165
2159
|
break;
|
|
2166
2160
|
case 'mouseenter':
|
|
2167
2161
|
if (this.element.hoverToggle) {
|
|
@@ -2170,7 +2164,7 @@ class AuroFloatingUI {
|
|
|
2170
2164
|
break;
|
|
2171
2165
|
case 'mouseleave':
|
|
2172
2166
|
if (this.element.hoverToggle) {
|
|
2173
|
-
this.hideBib(
|
|
2167
|
+
this.hideBib();
|
|
2174
2168
|
}
|
|
2175
2169
|
break;
|
|
2176
2170
|
case 'focus':
|
|
@@ -3564,9 +3558,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3564
3558
|
|
|
3565
3559
|
this.parentBorder = false;
|
|
3566
3560
|
|
|
3567
|
-
/** @private */
|
|
3568
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
3569
|
-
|
|
3570
3561
|
this.privateDefaults();
|
|
3571
3562
|
}
|
|
3572
3563
|
|
|
@@ -4000,19 +3991,12 @@ class AuroDropdown extends AuroElement {
|
|
|
4000
3991
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4001
3992
|
this.handleTriggerContentSlotChange();
|
|
4002
3993
|
}
|
|
4003
|
-
}
|
|
4004
3994
|
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
handleDropdownToggle(event) {
|
|
4011
|
-
this.updateFocusTrap();
|
|
4012
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4013
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4014
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4015
|
-
this.trigger.focus();
|
|
3995
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
3996
|
+
this.updateFocusTrap();
|
|
3997
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
3998
|
+
this.trigger.focus();
|
|
3999
|
+
}
|
|
4016
4000
|
}
|
|
4017
4001
|
}
|
|
4018
4002
|
|
|
@@ -4020,7 +4004,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4020
4004
|
|
|
4021
4005
|
// Configure the floater to, this will generate the ID for the bib
|
|
4022
4006
|
this.floater.configure(this, 'auroDropdown');
|
|
4023
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4024
4007
|
|
|
4025
4008
|
/**
|
|
4026
4009
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -1730,7 +1730,7 @@ class AuroFloatingUI {
|
|
|
1730
1730
|
*/
|
|
1731
1731
|
mirrorSize() {
|
|
1732
1732
|
// mirror the boxsize from bibSizer
|
|
1733
|
-
if (this.element.bibSizer
|
|
1733
|
+
if (this.element.bibSizer) {
|
|
1734
1734
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
1735
1735
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1736
1736
|
if (sizerStyle.width !== '0px') {
|
|
@@ -1942,13 +1942,13 @@ class AuroFloatingUI {
|
|
|
1942
1942
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1943
1943
|
return;
|
|
1944
1944
|
}
|
|
1945
|
-
|
|
1945
|
+
|
|
1946
1946
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
1947
1947
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1948
1948
|
return;
|
|
1949
1949
|
}
|
|
1950
1950
|
|
|
1951
|
-
this.hideBib(
|
|
1951
|
+
this.hideBib();
|
|
1952
1952
|
}
|
|
1953
1953
|
|
|
1954
1954
|
setupHideHandlers() {
|
|
@@ -1973,7 +1973,7 @@ class AuroFloatingUI {
|
|
|
1973
1973
|
document.expandedAuroFormkitDropdown = null;
|
|
1974
1974
|
document.expandedAuroFloater = this;
|
|
1975
1975
|
} else {
|
|
1976
|
-
this.hideBib(
|
|
1976
|
+
this.hideBib();
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
1979
|
};
|
|
@@ -1986,7 +1986,7 @@ class AuroFloatingUI {
|
|
|
1986
1986
|
// if something else is open, let it handle itself
|
|
1987
1987
|
return;
|
|
1988
1988
|
}
|
|
1989
|
-
this.hideBib(
|
|
1989
|
+
this.hideBib();
|
|
1990
1990
|
}
|
|
1991
1991
|
};
|
|
1992
1992
|
|
|
@@ -2069,11 +2069,7 @@ class AuroFloatingUI {
|
|
|
2069
2069
|
}
|
|
2070
2070
|
}
|
|
2071
2071
|
|
|
2072
|
-
|
|
2073
|
-
* Hides the floating UI element.
|
|
2074
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2075
|
-
*/
|
|
2076
|
-
hideBib(eventType = "unknown") {
|
|
2072
|
+
hideBib() {
|
|
2077
2073
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2078
2074
|
this.lockScroll(false);
|
|
2079
2075
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2084,7 +2080,7 @@ class AuroFloatingUI {
|
|
|
2084
2080
|
if (this.showing) {
|
|
2085
2081
|
this.cleanupHideHandlers();
|
|
2086
2082
|
this.showing = false;
|
|
2087
|
-
this.dispatchEventDropdownToggle(
|
|
2083
|
+
this.dispatchEventDropdownToggle();
|
|
2088
2084
|
}
|
|
2089
2085
|
}
|
|
2090
2086
|
document.expandedAuroFloater = null;
|
|
@@ -2093,13 +2089,11 @@ class AuroFloatingUI {
|
|
|
2093
2089
|
/**
|
|
2094
2090
|
* @private
|
|
2095
2091
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
2096
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
2097
2092
|
*/
|
|
2098
|
-
dispatchEventDropdownToggle(
|
|
2093
|
+
dispatchEventDropdownToggle() {
|
|
2099
2094
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2100
2095
|
detail: {
|
|
2101
2096
|
expanded: this.showing,
|
|
2102
|
-
eventType: eventType || "unknown",
|
|
2103
2097
|
},
|
|
2104
2098
|
composed: true
|
|
2105
2099
|
});
|
|
@@ -2109,7 +2103,7 @@ class AuroFloatingUI {
|
|
|
2109
2103
|
|
|
2110
2104
|
handleClick() {
|
|
2111
2105
|
if (this.element.isPopoverVisible) {
|
|
2112
|
-
this.hideBib(
|
|
2106
|
+
this.hideBib();
|
|
2113
2107
|
} else {
|
|
2114
2108
|
this.showBib();
|
|
2115
2109
|
}
|
|
@@ -2136,7 +2130,7 @@ class AuroFloatingUI {
|
|
|
2136
2130
|
|
|
2137
2131
|
event.preventDefault();
|
|
2138
2132
|
this.handleClick();
|
|
2139
|
-
}
|
|
2133
|
+
}
|
|
2140
2134
|
break;
|
|
2141
2135
|
case 'mouseenter':
|
|
2142
2136
|
if (this.element.hoverToggle) {
|
|
@@ -2145,7 +2139,7 @@ class AuroFloatingUI {
|
|
|
2145
2139
|
break;
|
|
2146
2140
|
case 'mouseleave':
|
|
2147
2141
|
if (this.element.hoverToggle) {
|
|
2148
|
-
this.hideBib(
|
|
2142
|
+
this.hideBib();
|
|
2149
2143
|
}
|
|
2150
2144
|
break;
|
|
2151
2145
|
case 'focus':
|
|
@@ -3539,9 +3533,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3539
3533
|
|
|
3540
3534
|
this.parentBorder = false;
|
|
3541
3535
|
|
|
3542
|
-
/** @private */
|
|
3543
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
3544
|
-
|
|
3545
3536
|
this.privateDefaults();
|
|
3546
3537
|
}
|
|
3547
3538
|
|
|
@@ -3975,19 +3966,12 @@ class AuroDropdown extends AuroElement {
|
|
|
3975
3966
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3976
3967
|
this.handleTriggerContentSlotChange();
|
|
3977
3968
|
}
|
|
3978
|
-
}
|
|
3979
3969
|
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
handleDropdownToggle(event) {
|
|
3986
|
-
this.updateFocusTrap();
|
|
3987
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
3988
|
-
const eventType = event.detail.eventType || "unknown";
|
|
3989
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
3990
|
-
this.trigger.focus();
|
|
3970
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
3971
|
+
this.updateFocusTrap();
|
|
3972
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
3973
|
+
this.trigger.focus();
|
|
3974
|
+
}
|
|
3991
3975
|
}
|
|
3992
3976
|
}
|
|
3993
3977
|
|
|
@@ -3995,7 +3979,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3995
3979
|
|
|
3996
3980
|
// Configure the floater to, this will generate the ID for the bib
|
|
3997
3981
|
this.floater.configure(this, 'auroDropdown');
|
|
3998
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
3999
3982
|
|
|
4000
3983
|
/**
|
|
4001
3984
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|