@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>
|