@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
|
@@ -730,13 +730,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
730
730
|
this.getInputElements(elem);
|
|
731
731
|
this.getAuroInputs(elem);
|
|
732
732
|
|
|
733
|
-
//
|
|
733
|
+
// Check if validation should run
|
|
734
734
|
let validationShouldRun =
|
|
735
|
+
|
|
736
|
+
// If the validation was forced
|
|
735
737
|
force ||
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
|
|
739
|
+
// If the validation should run on input
|
|
740
|
+
elem.validateOnInput ||
|
|
741
|
+
|
|
742
|
+
// State-based checks
|
|
743
|
+
(
|
|
744
|
+
// Element is not currently focused
|
|
745
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
746
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
747
|
+
|
|
748
|
+
// And element has been touched or is untouched but has a value
|
|
749
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
750
|
+
);
|
|
740
751
|
|
|
741
752
|
if (elem.hasAttribute('error')) {
|
|
742
753
|
elem.validity = 'customError';
|
|
@@ -1296,9 +1307,9 @@ var shapeSizeCss$2 = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
|
|
|
1296
1307
|
|
|
1297
1308
|
var classicLayoutColor = i$2``;
|
|
1298
1309
|
|
|
1299
|
-
var snowflakeStyle = i$2`.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-
|
|
1310
|
+
var snowflakeStyle = i$2`.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}`;
|
|
1300
1311
|
|
|
1301
|
-
var snowflakeColors = i$2`: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-
|
|
1312
|
+
var snowflakeColors = i$2`: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}`;
|
|
1302
1313
|
|
|
1303
1314
|
var styleCss$d = i$2`: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:""}`;
|
|
1304
1315
|
|
|
@@ -15846,7 +15857,7 @@ class AuroFloatingUI {
|
|
|
15846
15857
|
*/
|
|
15847
15858
|
mirrorSize() {
|
|
15848
15859
|
// mirror the boxsize from bibSizer
|
|
15849
|
-
if (this.element.bibSizer
|
|
15860
|
+
if (this.element.bibSizer) {
|
|
15850
15861
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
15851
15862
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
15852
15863
|
if (sizerStyle.width !== '0px') {
|
|
@@ -16058,13 +16069,13 @@ class AuroFloatingUI {
|
|
|
16058
16069
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
16059
16070
|
return;
|
|
16060
16071
|
}
|
|
16061
|
-
|
|
16072
|
+
|
|
16062
16073
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
16063
16074
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
16064
16075
|
return;
|
|
16065
16076
|
}
|
|
16066
16077
|
|
|
16067
|
-
this.hideBib(
|
|
16078
|
+
this.hideBib();
|
|
16068
16079
|
}
|
|
16069
16080
|
|
|
16070
16081
|
setupHideHandlers() {
|
|
@@ -16089,7 +16100,7 @@ class AuroFloatingUI {
|
|
|
16089
16100
|
document.expandedAuroFormkitDropdown = null;
|
|
16090
16101
|
document.expandedAuroFloater = this;
|
|
16091
16102
|
} else {
|
|
16092
|
-
this.hideBib(
|
|
16103
|
+
this.hideBib();
|
|
16093
16104
|
}
|
|
16094
16105
|
}
|
|
16095
16106
|
};
|
|
@@ -16102,7 +16113,7 @@ class AuroFloatingUI {
|
|
|
16102
16113
|
// if something else is open, let it handle itself
|
|
16103
16114
|
return;
|
|
16104
16115
|
}
|
|
16105
|
-
this.hideBib(
|
|
16116
|
+
this.hideBib();
|
|
16106
16117
|
}
|
|
16107
16118
|
};
|
|
16108
16119
|
|
|
@@ -16185,11 +16196,7 @@ class AuroFloatingUI {
|
|
|
16185
16196
|
}
|
|
16186
16197
|
}
|
|
16187
16198
|
|
|
16188
|
-
|
|
16189
|
-
* Hides the floating UI element.
|
|
16190
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
16191
|
-
*/
|
|
16192
|
-
hideBib(eventType = "unknown") {
|
|
16199
|
+
hideBib() {
|
|
16193
16200
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
16194
16201
|
this.lockScroll(false);
|
|
16195
16202
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -16200,7 +16207,7 @@ class AuroFloatingUI {
|
|
|
16200
16207
|
if (this.showing) {
|
|
16201
16208
|
this.cleanupHideHandlers();
|
|
16202
16209
|
this.showing = false;
|
|
16203
|
-
this.dispatchEventDropdownToggle(
|
|
16210
|
+
this.dispatchEventDropdownToggle();
|
|
16204
16211
|
}
|
|
16205
16212
|
}
|
|
16206
16213
|
document.expandedAuroFloater = null;
|
|
@@ -16209,13 +16216,11 @@ class AuroFloatingUI {
|
|
|
16209
16216
|
/**
|
|
16210
16217
|
* @private
|
|
16211
16218
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
16212
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
16213
16219
|
*/
|
|
16214
|
-
dispatchEventDropdownToggle(
|
|
16220
|
+
dispatchEventDropdownToggle() {
|
|
16215
16221
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
16216
16222
|
detail: {
|
|
16217
16223
|
expanded: this.showing,
|
|
16218
|
-
eventType: eventType || "unknown",
|
|
16219
16224
|
},
|
|
16220
16225
|
composed: true
|
|
16221
16226
|
});
|
|
@@ -16225,7 +16230,7 @@ class AuroFloatingUI {
|
|
|
16225
16230
|
|
|
16226
16231
|
handleClick() {
|
|
16227
16232
|
if (this.element.isPopoverVisible) {
|
|
16228
|
-
this.hideBib(
|
|
16233
|
+
this.hideBib();
|
|
16229
16234
|
} else {
|
|
16230
16235
|
this.showBib();
|
|
16231
16236
|
}
|
|
@@ -16252,7 +16257,7 @@ class AuroFloatingUI {
|
|
|
16252
16257
|
|
|
16253
16258
|
event.preventDefault();
|
|
16254
16259
|
this.handleClick();
|
|
16255
|
-
}
|
|
16260
|
+
}
|
|
16256
16261
|
break;
|
|
16257
16262
|
case 'mouseenter':
|
|
16258
16263
|
if (this.element.hoverToggle) {
|
|
@@ -16261,7 +16266,7 @@ class AuroFloatingUI {
|
|
|
16261
16266
|
break;
|
|
16262
16267
|
case 'mouseleave':
|
|
16263
16268
|
if (this.element.hoverToggle) {
|
|
16264
|
-
this.hideBib(
|
|
16269
|
+
this.hideBib();
|
|
16265
16270
|
}
|
|
16266
16271
|
break;
|
|
16267
16272
|
case 'focus':
|
|
@@ -17649,9 +17654,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
17649
17654
|
|
|
17650
17655
|
this.parentBorder = false;
|
|
17651
17656
|
|
|
17652
|
-
/** @private */
|
|
17653
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
17654
|
-
|
|
17655
17657
|
this.privateDefaults();
|
|
17656
17658
|
}
|
|
17657
17659
|
|
|
@@ -18085,19 +18087,12 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18085
18087
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
18086
18088
|
this.handleTriggerContentSlotChange();
|
|
18087
18089
|
}
|
|
18088
|
-
}
|
|
18089
18090
|
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
handleDropdownToggle(event) {
|
|
18096
|
-
this.updateFocusTrap();
|
|
18097
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
18098
|
-
const eventType = event.detail.eventType || "unknown";
|
|
18099
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
18100
|
-
this.trigger.focus();
|
|
18091
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
18092
|
+
this.updateFocusTrap();
|
|
18093
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
18094
|
+
this.trigger.focus();
|
|
18095
|
+
}
|
|
18101
18096
|
}
|
|
18102
18097
|
}
|
|
18103
18098
|
|
|
@@ -18105,7 +18100,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18105
18100
|
|
|
18106
18101
|
// Configure the floater to, this will generate the ID for the bib
|
|
18107
18102
|
this.floater.configure(this, 'auroDropdown');
|
|
18108
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
18109
18103
|
|
|
18110
18104
|
/**
|
|
18111
18105
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -23265,13 +23259,24 @@ class AuroFormValidation {
|
|
|
23265
23259
|
this.getInputElements(elem);
|
|
23266
23260
|
this.getAuroInputs(elem);
|
|
23267
23261
|
|
|
23268
|
-
//
|
|
23262
|
+
// Check if validation should run
|
|
23269
23263
|
let validationShouldRun =
|
|
23264
|
+
|
|
23265
|
+
// If the validation was forced
|
|
23270
23266
|
force ||
|
|
23271
|
-
|
|
23272
|
-
|
|
23273
|
-
|
|
23274
|
-
|
|
23267
|
+
|
|
23268
|
+
// If the validation should run on input
|
|
23269
|
+
elem.validateOnInput ||
|
|
23270
|
+
|
|
23271
|
+
// State-based checks
|
|
23272
|
+
(
|
|
23273
|
+
// Element is not currently focused
|
|
23274
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
23275
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
23276
|
+
|
|
23277
|
+
// And element has been touched or is untouched but has a value
|
|
23278
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
23279
|
+
);
|
|
23275
23280
|
|
|
23276
23281
|
if (elem.hasAttribute('error')) {
|
|
23277
23282
|
elem.validity = 'customError';
|
|
@@ -24222,9 +24227,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24222
24227
|
this.inputElement.value = "";
|
|
24223
24228
|
this.value = "";
|
|
24224
24229
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
24230
|
+
this.notifyValueChanged();
|
|
24225
24231
|
this.focus();
|
|
24226
24232
|
this.validation.validate(this);
|
|
24227
|
-
this.notifyValueChanged();
|
|
24228
24233
|
}
|
|
24229
24234
|
|
|
24230
24235
|
/**
|
|
@@ -24319,13 +24324,20 @@ class BaseInput extends AuroElement$2 {
|
|
|
24319
24324
|
}
|
|
24320
24325
|
|
|
24321
24326
|
/**
|
|
24322
|
-
* Resets component to initial state.
|
|
24327
|
+
* Resets component to initial state, including resetting the touched state and validity.
|
|
24323
24328
|
* @returns {void}
|
|
24324
24329
|
*/
|
|
24325
24330
|
reset() {
|
|
24326
24331
|
this.validation.reset(this);
|
|
24327
24332
|
}
|
|
24328
24333
|
|
|
24334
|
+
/**
|
|
24335
|
+
* Clears the input value
|
|
24336
|
+
*/
|
|
24337
|
+
clear() {
|
|
24338
|
+
this.value = undefined;
|
|
24339
|
+
}
|
|
24340
|
+
|
|
24329
24341
|
/**
|
|
24330
24342
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
24331
24343
|
* @private
|
|
@@ -27731,15 +27743,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
27731
27743
|
this.layout = 'classic';
|
|
27732
27744
|
this.shape = 'classic';
|
|
27733
27745
|
this.size = 'lg';
|
|
27734
|
-
|
|
27735
|
-
/**
|
|
27736
|
-
* @private
|
|
27737
|
-
* @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
|
|
27738
|
-
*/
|
|
27739
|
-
this.constructor.shadowRootOptions = {
|
|
27740
|
-
...i.shadowRootOptions,
|
|
27741
|
-
delegatesFocus: true,
|
|
27742
|
-
};
|
|
27743
27746
|
}
|
|
27744
27747
|
|
|
27745
27748
|
// This function is to define props used within the scope of this component
|
|
@@ -28449,7 +28452,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28449
28452
|
*/
|
|
28450
28453
|
resetValues() {
|
|
28451
28454
|
this.inputList.forEach((input) => {
|
|
28452
|
-
input.
|
|
28455
|
+
input.clear();
|
|
28453
28456
|
});
|
|
28454
28457
|
}
|
|
28455
28458
|
|
|
@@ -28459,10 +28462,17 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28459
28462
|
*/
|
|
28460
28463
|
reset() {
|
|
28461
28464
|
this.resetValues();
|
|
28462
|
-
|
|
28463
28465
|
this.validation.reset(this);
|
|
28464
28466
|
}
|
|
28465
28467
|
|
|
28468
|
+
/**
|
|
28469
|
+
* Clears the current value(s) of the datepicker.
|
|
28470
|
+
* @returns {void}
|
|
28471
|
+
*/
|
|
28472
|
+
clear() {
|
|
28473
|
+
this.resetValues();
|
|
28474
|
+
}
|
|
28475
|
+
|
|
28466
28476
|
/**
|
|
28467
28477
|
* Validates value.
|
|
28468
28478
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
@@ -28477,7 +28487,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28477
28487
|
}
|
|
28478
28488
|
|
|
28479
28489
|
this.hasFocus = true;
|
|
28480
|
-
this.dropdown.show();
|
|
28481
28490
|
|
|
28482
28491
|
// shadowroot active element is null if we focus the datepicker itself
|
|
28483
28492
|
if (this.shadowRoot.activeElement === null) {
|
|
@@ -28801,9 +28810,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28801
28810
|
`;
|
|
28802
28811
|
}
|
|
28803
28812
|
|
|
28804
|
-
/**
|
|
28805
|
-
* @private
|
|
28806
|
-
*/
|
|
28807
28813
|
renderLayoutFromAttributes() {
|
|
28808
28814
|
switch (this.layout) {
|
|
28809
28815
|
case 'snowflake':
|
|
@@ -28816,44 +28822,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28816
28822
|
}
|
|
28817
28823
|
}
|
|
28818
28824
|
|
|
28819
|
-
// eslint-disable-next-line no-warning-comments
|
|
28820
|
-
// TODO: move this to date utility when time allows :(
|
|
28821
|
-
/**
|
|
28822
|
-
* Simple formatter that ONLY WORKS FOR US DATES.
|
|
28823
|
-
* Returns formatted date like Apr 21 or Dec 25.
|
|
28824
|
-
* @private
|
|
28825
|
-
* @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
|
|
28826
|
-
* @return {string}
|
|
28827
|
-
*/
|
|
28828
|
-
formatShortDate(date) {
|
|
28829
|
-
// should render like Apr 21
|
|
28830
|
-
const options = {
|
|
28831
|
-
month: 'short',
|
|
28832
|
-
day: '2-digit'
|
|
28833
|
-
};
|
|
28834
|
-
|
|
28835
|
-
return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
|
|
28836
|
-
}
|
|
28837
|
-
|
|
28838
|
-
/**
|
|
28839
|
-
* Format and render the provided date value.
|
|
28840
|
-
* @private
|
|
28841
|
-
* @param dateValue
|
|
28842
|
-
* @return {TemplateResult}
|
|
28843
|
-
*/
|
|
28844
|
-
renderDisplayTextDate(dateValue) {
|
|
28845
|
-
return u$3`
|
|
28846
|
-
<div>
|
|
28847
|
-
<div class="displayValueText">
|
|
28848
|
-
${dateValue && this.util.validDateStr(dateValue, this.format)
|
|
28849
|
-
? this.formatShortDate(dateValue)
|
|
28850
|
-
: undefined
|
|
28851
|
-
}
|
|
28852
|
-
</div>
|
|
28853
|
-
</div>
|
|
28854
|
-
`;
|
|
28855
|
-
}
|
|
28856
|
-
|
|
28857
28825
|
renderHtmlInputs() {
|
|
28858
28826
|
const inputClasses = {
|
|
28859
28827
|
"util_displayHiddenVisually": !this.hasValue && !this.hasFocus
|
|
@@ -28869,7 +28837,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28869
28837
|
.max="${this.maxDate}"
|
|
28870
28838
|
.min="${this.minDate}"
|
|
28871
28839
|
id="${this.generateRandomString(12)}"
|
|
28872
|
-
|
|
28840
|
+
placeholder="MM/DD"
|
|
28873
28841
|
simple
|
|
28874
28842
|
bordered
|
|
28875
28843
|
noValidate
|
|
@@ -28885,9 +28853,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28885
28853
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28886
28854
|
inputmode="${o(this.inputmode)}"
|
|
28887
28855
|
>
|
|
28888
|
-
<span slot="displayValue">
|
|
28889
|
-
${this.renderDisplayTextDate(this.value)}
|
|
28890
|
-
</span>
|
|
28891
28856
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
28892
28857
|
</${this.inputTag}>
|
|
28893
28858
|
</div>
|
|
@@ -28918,9 +28883,6 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28918
28883
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28919
28884
|
?disabled="${this.disabled}"
|
|
28920
28885
|
part="input">
|
|
28921
|
-
<span slot="displayValue">
|
|
28922
|
-
${this.renderDisplayTextDate(this.valueEnd)}
|
|
28923
|
-
</span>
|
|
28924
28886
|
<span slot="label"><slot name="toLabel"></slot></span>
|
|
28925
28887
|
</${this.inputTag}>
|
|
28926
28888
|
</div>
|
|
@@ -490,6 +490,11 @@ export class AuroDatePicker extends AuroElement {
|
|
|
490
490
|
* @returns {void}
|
|
491
491
|
*/
|
|
492
492
|
reset(): void;
|
|
493
|
+
/**
|
|
494
|
+
* Clears the current value(s) of the datepicker.
|
|
495
|
+
* @returns {void}
|
|
496
|
+
*/
|
|
497
|
+
clear(): void;
|
|
493
498
|
/**
|
|
494
499
|
* Validates value.
|
|
495
500
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
@@ -524,25 +529,7 @@ export class AuroDatePicker extends AuroElement {
|
|
|
524
529
|
* @returns {import("lit").TemplateResult}
|
|
525
530
|
*/
|
|
526
531
|
private renderSnowflakeLayout;
|
|
527
|
-
|
|
528
|
-
* @private
|
|
529
|
-
*/
|
|
530
|
-
private renderLayoutFromAttributes;
|
|
531
|
-
/**
|
|
532
|
-
* Simple formatter that ONLY WORKS FOR US DATES.
|
|
533
|
-
* Returns formatted date like Apr 21 or Dec 25.
|
|
534
|
-
* @private
|
|
535
|
-
* @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
|
|
536
|
-
* @return {string}
|
|
537
|
-
*/
|
|
538
|
-
private formatShortDate;
|
|
539
|
-
/**
|
|
540
|
-
* Format and render the provided date value.
|
|
541
|
-
* @private
|
|
542
|
-
* @param dateValue
|
|
543
|
-
* @return {TemplateResult}
|
|
544
|
-
*/
|
|
545
|
-
private renderDisplayTextDate;
|
|
532
|
+
renderLayoutFromAttributes(): import("lit-html").TemplateResult;
|
|
546
533
|
renderHtmlInputs(): import("lit-html").TemplateResult;
|
|
547
534
|
renderHtmlActionClear(): import("lit-html").TemplateResult;
|
|
548
535
|
renderHtmlIconError(): import("lit-html").TemplateResult;
|