@aurodesignsystem-dev/auro-formkit 0.0.0-pr784.0 → 0.0.0-pr785.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.html +10 -16
- package/components/checkbox/demo/api.min.js +7 -18
- package/components/checkbox/demo/index.html +10 -16
- package/components/checkbox/demo/index.min.js +7 -18
- package/components/checkbox/demo/readme.html +9 -16
- package/components/checkbox/dist/index.js +7 -18
- package/components/checkbox/dist/registered.js +7 -18
- package/components/combobox/demo/api.html +10 -16
- package/components/combobox/demo/api.md +0 -1
- package/components/combobox/demo/api.min.js +20 -58
- package/components/combobox/demo/index.html +10 -16
- package/components/combobox/demo/index.min.js +20 -58
- package/components/combobox/demo/readme.html +9 -16
- package/components/combobox/dist/auro-combobox.d.ts +0 -5
- package/components/combobox/dist/index.js +20 -58
- package/components/combobox/dist/registered.js +20 -58
- package/components/counter/demo/api.html +10 -16
- package/components/counter/demo/api.min.js +8 -19
- package/components/counter/demo/index.html +10 -16
- package/components/counter/demo/index.min.js +8 -19
- package/components/counter/demo/readme.html +9 -16
- package/components/counter/dist/index.js +8 -19
- package/components/counter/dist/registered.js +8 -19
- package/components/datepicker/demo/api.html +10 -16
- package/components/datepicker/demo/api.md +1 -2
- package/components/datepicker/demo/api.min.js +68 -58
- package/components/datepicker/demo/index.html +10 -16
- package/components/datepicker/demo/index.min.js +68 -58
- package/components/datepicker/demo/readme.html +9 -16
- package/components/datepicker/dist/auro-datepicker.d.ts +18 -6
- package/components/datepicker/dist/index.js +68 -58
- package/components/datepicker/dist/registered.js +68 -58
- package/components/dropdown/demo/api.html +10 -16
- package/components/dropdown/demo/api.min.js +3 -3
- package/components/dropdown/demo/index.html +10 -16
- package/components/dropdown/demo/index.min.js +3 -3
- package/components/dropdown/demo/readme.html +9 -16
- package/components/dropdown/dist/index.js +3 -3
- package/components/dropdown/dist/registered.js +3 -3
- package/components/form/demo/api.html +9 -16
- package/components/form/demo/autocomplete.html +3 -19
- package/components/form/demo/index.html +9 -16
- package/components/form/demo/readme.html +9 -16
- package/components/form/demo/working.html +13 -19
- package/components/input/demo/api.html +10 -16
- package/components/input/demo/api.md +1 -2
- package/components/input/demo/api.min.js +9 -27
- package/components/input/demo/index.html +10 -16
- package/components/input/demo/index.min.js +9 -27
- package/components/input/demo/readme.html +9 -16
- package/components/input/dist/base-input.d.ts +1 -5
- package/components/input/dist/index.js +9 -27
- package/components/input/dist/registered.js +9 -27
- package/components/menu/demo/api.html +32 -16
- package/components/menu/demo/index.html +10 -16
- package/components/menu/demo/readme.html +9 -16
- package/components/radio/demo/api.html +10 -16
- package/components/radio/demo/api.min.js +5 -16
- package/components/radio/demo/index.html +10 -16
- package/components/radio/demo/index.min.js +5 -16
- package/components/radio/demo/readme.html +9 -16
- package/components/radio/dist/index.js +5 -16
- package/components/radio/dist/registered.js +5 -16
- package/components/select/demo/api.html +10 -16
- package/components/select/demo/api.min.js +8 -19
- package/components/select/demo/index.html +11 -16
- package/components/select/demo/index.min.js +8 -19
- package/components/select/demo/readme.html +9 -16
- package/components/select/dist/index.js +8 -19
- package/components/select/dist/registered.js +8 -19
- package/package.json +3 -4
|
@@ -989,24 +989,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
989
989
|
this.getInputElements(elem);
|
|
990
990
|
this.getAuroInputs(elem);
|
|
991
991
|
|
|
992
|
-
//
|
|
992
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
993
993
|
let validationShouldRun =
|
|
994
|
-
|
|
995
|
-
// If the validation was forced
|
|
996
994
|
force ||
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
// State-based checks
|
|
1002
|
-
(
|
|
1003
|
-
// Element is not currently focused
|
|
1004
|
-
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1005
|
-
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1006
|
-
|
|
1007
|
-
// And element has been touched or is untouched but has a value
|
|
1008
|
-
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1009
|
-
);
|
|
995
|
+
(!elem.contains(document.activeElement) &&
|
|
996
|
+
(elem.touched ||
|
|
997
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
998
|
+
elem.validateOnInput;
|
|
1010
999
|
|
|
1011
1000
|
if (elem.hasAttribute('error')) {
|
|
1012
1001
|
elem.validity = 'customError';
|
|
@@ -1566,9 +1555,9 @@ var shapeSizeCss$2 = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
|
|
|
1566
1555
|
|
|
1567
1556
|
var classicLayoutColor = i$2``;
|
|
1568
1557
|
|
|
1569
|
-
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}`;
|
|
1558
|
+
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-input]::part(displayValue){justify-content:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem)}: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}`;
|
|
1570
1559
|
|
|
1571
|
-
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}`;
|
|
1560
|
+
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-input]::part(displayValue){background-color:inherit}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
|
|
1572
1561
|
|
|
1573
1562
|
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:""}`;
|
|
1574
1563
|
|
|
@@ -16116,7 +16105,7 @@ class AuroFloatingUI {
|
|
|
16116
16105
|
*/
|
|
16117
16106
|
mirrorSize() {
|
|
16118
16107
|
// mirror the boxsize from bibSizer
|
|
16119
|
-
if (this.element.bibSizer) {
|
|
16108
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
16120
16109
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
16121
16110
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
16122
16111
|
if (sizerStyle.width !== '0px') {
|
|
@@ -16328,7 +16317,7 @@ class AuroFloatingUI {
|
|
|
16328
16317
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
16329
16318
|
return;
|
|
16330
16319
|
}
|
|
16331
|
-
|
|
16320
|
+
|
|
16332
16321
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
16333
16322
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
16334
16323
|
return;
|
|
@@ -16516,7 +16505,7 @@ class AuroFloatingUI {
|
|
|
16516
16505
|
|
|
16517
16506
|
event.preventDefault();
|
|
16518
16507
|
this.handleClick();
|
|
16519
|
-
}
|
|
16508
|
+
}
|
|
16520
16509
|
break;
|
|
16521
16510
|
case 'mouseenter':
|
|
16522
16511
|
if (this.element.hoverToggle) {
|
|
@@ -23518,24 +23507,13 @@ class AuroFormValidation {
|
|
|
23518
23507
|
this.getInputElements(elem);
|
|
23519
23508
|
this.getAuroInputs(elem);
|
|
23520
23509
|
|
|
23521
|
-
//
|
|
23510
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
23522
23511
|
let validationShouldRun =
|
|
23523
|
-
|
|
23524
|
-
// If the validation was forced
|
|
23525
23512
|
force ||
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
// State-based checks
|
|
23531
|
-
(
|
|
23532
|
-
// Element is not currently focused
|
|
23533
|
-
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
23534
|
-
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
23535
|
-
|
|
23536
|
-
// And element has been touched or is untouched but has a value
|
|
23537
|
-
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
23538
|
-
);
|
|
23513
|
+
(!elem.contains(document.activeElement) &&
|
|
23514
|
+
(elem.touched ||
|
|
23515
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
23516
|
+
elem.validateOnInput;
|
|
23539
23517
|
|
|
23540
23518
|
if (elem.hasAttribute('error')) {
|
|
23541
23519
|
elem.validity = 'customError';
|
|
@@ -24359,9 +24337,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24359
24337
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
24360
24338
|
this.validation.validate(this);
|
|
24361
24339
|
}
|
|
24362
|
-
}
|
|
24363
24340
|
|
|
24364
|
-
|
|
24341
|
+
this.notifyValueChanged();
|
|
24342
|
+
}
|
|
24365
24343
|
}
|
|
24366
24344
|
|
|
24367
24345
|
if (changedProperties.has('error')) {
|
|
@@ -24486,9 +24464,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24486
24464
|
this.inputElement.value = "";
|
|
24487
24465
|
this.value = "";
|
|
24488
24466
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
24489
|
-
this.notifyValueChanged();
|
|
24490
24467
|
this.focus();
|
|
24491
24468
|
this.validation.validate(this);
|
|
24469
|
+
this.notifyValueChanged();
|
|
24492
24470
|
}
|
|
24493
24471
|
|
|
24494
24472
|
/**
|
|
@@ -24583,20 +24561,13 @@ class BaseInput extends AuroElement$2 {
|
|
|
24583
24561
|
}
|
|
24584
24562
|
|
|
24585
24563
|
/**
|
|
24586
|
-
* Resets component to initial state
|
|
24564
|
+
* Resets component to initial state.
|
|
24587
24565
|
* @returns {void}
|
|
24588
24566
|
*/
|
|
24589
24567
|
reset() {
|
|
24590
24568
|
this.validation.reset(this);
|
|
24591
24569
|
}
|
|
24592
24570
|
|
|
24593
|
-
/**
|
|
24594
|
-
* Clears the input value
|
|
24595
|
-
*/
|
|
24596
|
-
clear() {
|
|
24597
|
-
this.value = undefined;
|
|
24598
|
-
}
|
|
24599
|
-
|
|
24600
24571
|
/**
|
|
24601
24572
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
24602
24573
|
* @private
|
|
@@ -28711,7 +28682,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28711
28682
|
*/
|
|
28712
28683
|
resetValues() {
|
|
28713
28684
|
this.inputList.forEach((input) => {
|
|
28714
|
-
input.
|
|
28685
|
+
input.reset();
|
|
28715
28686
|
});
|
|
28716
28687
|
}
|
|
28717
28688
|
|
|
@@ -28721,15 +28692,8 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28721
28692
|
*/
|
|
28722
28693
|
reset() {
|
|
28723
28694
|
this.resetValues();
|
|
28724
|
-
this.validation.reset(this);
|
|
28725
|
-
}
|
|
28726
28695
|
|
|
28727
|
-
|
|
28728
|
-
* Clears the current value(s) of the datepicker.
|
|
28729
|
-
* @returns {void}
|
|
28730
|
-
*/
|
|
28731
|
-
clear() {
|
|
28732
|
-
this.resetValues();
|
|
28696
|
+
this.validation.reset(this);
|
|
28733
28697
|
}
|
|
28734
28698
|
|
|
28735
28699
|
/**
|
|
@@ -29069,6 +29033,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
29069
29033
|
`;
|
|
29070
29034
|
}
|
|
29071
29035
|
|
|
29036
|
+
/**
|
|
29037
|
+
* @private
|
|
29038
|
+
*/
|
|
29072
29039
|
renderLayoutFromAttributes() {
|
|
29073
29040
|
switch (this.layout) {
|
|
29074
29041
|
case 'snowflake':
|
|
@@ -29081,6 +29048,43 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
29081
29048
|
}
|
|
29082
29049
|
}
|
|
29083
29050
|
|
|
29051
|
+
// eslint-disable-next-line no-warning-comments
|
|
29052
|
+
// TODO: move this to date utility when time allows :(
|
|
29053
|
+
/**
|
|
29054
|
+
* Simple formatter that ONLY WORKS FOR US DATES.
|
|
29055
|
+
* Returns formatted date like Apr 21 or Dec 25.
|
|
29056
|
+
* @param date
|
|
29057
|
+
* @return {string}
|
|
29058
|
+
*/
|
|
29059
|
+
formatShortDate(date) {
|
|
29060
|
+
// should render like Apr 21
|
|
29061
|
+
const options = {
|
|
29062
|
+
month: 'short',
|
|
29063
|
+
day: '2-digit'
|
|
29064
|
+
};
|
|
29065
|
+
|
|
29066
|
+
return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
|
|
29067
|
+
}
|
|
29068
|
+
|
|
29069
|
+
/**
|
|
29070
|
+
* Format and render the provided date value.
|
|
29071
|
+
* @private
|
|
29072
|
+
* @param dateValue
|
|
29073
|
+
* @return {TemplateResult}
|
|
29074
|
+
*/
|
|
29075
|
+
renderDisplayTextDate(dateValue) {
|
|
29076
|
+
return u$3`
|
|
29077
|
+
<div>
|
|
29078
|
+
<div class="displayValueText">
|
|
29079
|
+
${dateValue && this.util.validDateStr(dateValue, this.format)
|
|
29080
|
+
? this.formatShortDate(dateValue)
|
|
29081
|
+
: undefined
|
|
29082
|
+
}
|
|
29083
|
+
</div>
|
|
29084
|
+
</div>
|
|
29085
|
+
`;
|
|
29086
|
+
}
|
|
29087
|
+
|
|
29084
29088
|
renderHtmlInputs() {
|
|
29085
29089
|
const inputClasses = {
|
|
29086
29090
|
"util_displayHiddenVisually": !this.hasValue && !this.hasFocus
|
|
@@ -29096,7 +29100,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
29096
29100
|
.max="${this.maxDate}"
|
|
29097
29101
|
.min="${this.minDate}"
|
|
29098
29102
|
id="${this.generateRandomString(12)}"
|
|
29099
|
-
placeholder="
|
|
29103
|
+
.placeholder="${this.placeholder}"
|
|
29100
29104
|
simple
|
|
29101
29105
|
bordered
|
|
29102
29106
|
noValidate
|
|
@@ -29112,6 +29116,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
29112
29116
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
29113
29117
|
inputmode="${o(this.inputmode)}"
|
|
29114
29118
|
>
|
|
29119
|
+
<span slot="displayValue">
|
|
29120
|
+
${this.renderDisplayTextDate(this.value)}
|
|
29121
|
+
</span>
|
|
29115
29122
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
29116
29123
|
</${this.inputTag}>
|
|
29117
29124
|
</div>
|
|
@@ -29142,6 +29149,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
29142
29149
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
29143
29150
|
?disabled="${this.disabled}"
|
|
29144
29151
|
part="input">
|
|
29152
|
+
<span slot="displayValue">
|
|
29153
|
+
${this.renderDisplayTextDate(this.valueEnd)}
|
|
29154
|
+
</span>
|
|
29145
29155
|
<span slot="label"><slot name="toLabel"></slot></span>
|
|
29146
29156
|
</${this.inputTag}>
|
|
29147
29157
|
</div>
|
|
@@ -16,24 +16,18 @@
|
|
|
16
16
|
<head>
|
|
17
17
|
<meta charset="UTF-8" />
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<link rel="stylesheet"
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
19
|
+
<title>Auro Web Component Generator | auro-datepicker custom element</title>
|
|
20
|
+
<link
|
|
21
|
+
rel="stylesheet"
|
|
22
|
+
type="text/css"
|
|
23
|
+
href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"
|
|
24
|
+
/>
|
|
25
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
|
|
34
27
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
35
28
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
|
|
36
|
-
|
|
29
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/essentials-as.css" />
|
|
30
|
+
</head>
|
|
37
31
|
<body class="auro-markdown">
|
|
38
32
|
<main></main>
|
|
39
33
|
|
|
@@ -730,24 +730,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
730
730
|
this.getInputElements(elem);
|
|
731
731
|
this.getAuroInputs(elem);
|
|
732
732
|
|
|
733
|
-
//
|
|
733
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
734
734
|
let validationShouldRun =
|
|
735
|
-
|
|
736
|
-
// If the validation was forced
|
|
737
735
|
force ||
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
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
|
-
);
|
|
736
|
+
(!elem.contains(document.activeElement) &&
|
|
737
|
+
(elem.touched ||
|
|
738
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
739
|
+
elem.validateOnInput;
|
|
751
740
|
|
|
752
741
|
if (elem.hasAttribute('error')) {
|
|
753
742
|
elem.validity = 'customError';
|
|
@@ -1307,9 +1296,9 @@ var shapeSizeCss$2 = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
|
|
|
1307
1296
|
|
|
1308
1297
|
var classicLayoutColor = i$2``;
|
|
1309
1298
|
|
|
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}`;
|
|
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-input]::part(displayValue){justify-content:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem)}: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}`;
|
|
1311
1300
|
|
|
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}`;
|
|
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-input]::part(displayValue){background-color:inherit}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
|
|
1313
1302
|
|
|
1314
1303
|
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:""}`;
|
|
1315
1304
|
|
|
@@ -15857,7 +15846,7 @@ class AuroFloatingUI {
|
|
|
15857
15846
|
*/
|
|
15858
15847
|
mirrorSize() {
|
|
15859
15848
|
// mirror the boxsize from bibSizer
|
|
15860
|
-
if (this.element.bibSizer) {
|
|
15849
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
15861
15850
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
15862
15851
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
15863
15852
|
if (sizerStyle.width !== '0px') {
|
|
@@ -16069,7 +16058,7 @@ class AuroFloatingUI {
|
|
|
16069
16058
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
16070
16059
|
return;
|
|
16071
16060
|
}
|
|
16072
|
-
|
|
16061
|
+
|
|
16073
16062
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
16074
16063
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
16075
16064
|
return;
|
|
@@ -16257,7 +16246,7 @@ class AuroFloatingUI {
|
|
|
16257
16246
|
|
|
16258
16247
|
event.preventDefault();
|
|
16259
16248
|
this.handleClick();
|
|
16260
|
-
}
|
|
16249
|
+
}
|
|
16261
16250
|
break;
|
|
16262
16251
|
case 'mouseenter':
|
|
16263
16252
|
if (this.element.hoverToggle) {
|
|
@@ -23259,24 +23248,13 @@ class AuroFormValidation {
|
|
|
23259
23248
|
this.getInputElements(elem);
|
|
23260
23249
|
this.getAuroInputs(elem);
|
|
23261
23250
|
|
|
23262
|
-
//
|
|
23251
|
+
// Validate only if noValidate is not true and the input does not have focus
|
|
23263
23252
|
let validationShouldRun =
|
|
23264
|
-
|
|
23265
|
-
// If the validation was forced
|
|
23266
23253
|
force ||
|
|
23267
|
-
|
|
23268
|
-
|
|
23269
|
-
|
|
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
|
-
);
|
|
23254
|
+
(!elem.contains(document.activeElement) &&
|
|
23255
|
+
(elem.touched ||
|
|
23256
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
23257
|
+
elem.validateOnInput;
|
|
23280
23258
|
|
|
23281
23259
|
if (elem.hasAttribute('error')) {
|
|
23282
23260
|
elem.validity = 'customError';
|
|
@@ -24100,9 +24078,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24100
24078
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
24101
24079
|
this.validation.validate(this);
|
|
24102
24080
|
}
|
|
24103
|
-
}
|
|
24104
24081
|
|
|
24105
|
-
|
|
24082
|
+
this.notifyValueChanged();
|
|
24083
|
+
}
|
|
24106
24084
|
}
|
|
24107
24085
|
|
|
24108
24086
|
if (changedProperties.has('error')) {
|
|
@@ -24227,9 +24205,9 @@ class BaseInput extends AuroElement$2 {
|
|
|
24227
24205
|
this.inputElement.value = "";
|
|
24228
24206
|
this.value = "";
|
|
24229
24207
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
24230
|
-
this.notifyValueChanged();
|
|
24231
24208
|
this.focus();
|
|
24232
24209
|
this.validation.validate(this);
|
|
24210
|
+
this.notifyValueChanged();
|
|
24233
24211
|
}
|
|
24234
24212
|
|
|
24235
24213
|
/**
|
|
@@ -24324,20 +24302,13 @@ class BaseInput extends AuroElement$2 {
|
|
|
24324
24302
|
}
|
|
24325
24303
|
|
|
24326
24304
|
/**
|
|
24327
|
-
* Resets component to initial state
|
|
24305
|
+
* Resets component to initial state.
|
|
24328
24306
|
* @returns {void}
|
|
24329
24307
|
*/
|
|
24330
24308
|
reset() {
|
|
24331
24309
|
this.validation.reset(this);
|
|
24332
24310
|
}
|
|
24333
24311
|
|
|
24334
|
-
/**
|
|
24335
|
-
* Clears the input value
|
|
24336
|
-
*/
|
|
24337
|
-
clear() {
|
|
24338
|
-
this.value = undefined;
|
|
24339
|
-
}
|
|
24340
|
-
|
|
24341
24312
|
/**
|
|
24342
24313
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
24343
24314
|
* @private
|
|
@@ -28452,7 +28423,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28452
28423
|
*/
|
|
28453
28424
|
resetValues() {
|
|
28454
28425
|
this.inputList.forEach((input) => {
|
|
28455
|
-
input.
|
|
28426
|
+
input.reset();
|
|
28456
28427
|
});
|
|
28457
28428
|
}
|
|
28458
28429
|
|
|
@@ -28462,15 +28433,8 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28462
28433
|
*/
|
|
28463
28434
|
reset() {
|
|
28464
28435
|
this.resetValues();
|
|
28465
|
-
this.validation.reset(this);
|
|
28466
|
-
}
|
|
28467
28436
|
|
|
28468
|
-
|
|
28469
|
-
* Clears the current value(s) of the datepicker.
|
|
28470
|
-
* @returns {void}
|
|
28471
|
-
*/
|
|
28472
|
-
clear() {
|
|
28473
|
-
this.resetValues();
|
|
28437
|
+
this.validation.reset(this);
|
|
28474
28438
|
}
|
|
28475
28439
|
|
|
28476
28440
|
/**
|
|
@@ -28810,6 +28774,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28810
28774
|
`;
|
|
28811
28775
|
}
|
|
28812
28776
|
|
|
28777
|
+
/**
|
|
28778
|
+
* @private
|
|
28779
|
+
*/
|
|
28813
28780
|
renderLayoutFromAttributes() {
|
|
28814
28781
|
switch (this.layout) {
|
|
28815
28782
|
case 'snowflake':
|
|
@@ -28822,6 +28789,43 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28822
28789
|
}
|
|
28823
28790
|
}
|
|
28824
28791
|
|
|
28792
|
+
// eslint-disable-next-line no-warning-comments
|
|
28793
|
+
// TODO: move this to date utility when time allows :(
|
|
28794
|
+
/**
|
|
28795
|
+
* Simple formatter that ONLY WORKS FOR US DATES.
|
|
28796
|
+
* Returns formatted date like Apr 21 or Dec 25.
|
|
28797
|
+
* @param date
|
|
28798
|
+
* @return {string}
|
|
28799
|
+
*/
|
|
28800
|
+
formatShortDate(date) {
|
|
28801
|
+
// should render like Apr 21
|
|
28802
|
+
const options = {
|
|
28803
|
+
month: 'short',
|
|
28804
|
+
day: '2-digit'
|
|
28805
|
+
};
|
|
28806
|
+
|
|
28807
|
+
return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
|
|
28808
|
+
}
|
|
28809
|
+
|
|
28810
|
+
/**
|
|
28811
|
+
* Format and render the provided date value.
|
|
28812
|
+
* @private
|
|
28813
|
+
* @param dateValue
|
|
28814
|
+
* @return {TemplateResult}
|
|
28815
|
+
*/
|
|
28816
|
+
renderDisplayTextDate(dateValue) {
|
|
28817
|
+
return u$3`
|
|
28818
|
+
<div>
|
|
28819
|
+
<div class="displayValueText">
|
|
28820
|
+
${dateValue && this.util.validDateStr(dateValue, this.format)
|
|
28821
|
+
? this.formatShortDate(dateValue)
|
|
28822
|
+
: undefined
|
|
28823
|
+
}
|
|
28824
|
+
</div>
|
|
28825
|
+
</div>
|
|
28826
|
+
`;
|
|
28827
|
+
}
|
|
28828
|
+
|
|
28825
28829
|
renderHtmlInputs() {
|
|
28826
28830
|
const inputClasses = {
|
|
28827
28831
|
"util_displayHiddenVisually": !this.hasValue && !this.hasFocus
|
|
@@ -28837,7 +28841,7 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28837
28841
|
.max="${this.maxDate}"
|
|
28838
28842
|
.min="${this.minDate}"
|
|
28839
28843
|
id="${this.generateRandomString(12)}"
|
|
28840
|
-
placeholder="
|
|
28844
|
+
.placeholder="${this.placeholder}"
|
|
28841
28845
|
simple
|
|
28842
28846
|
bordered
|
|
28843
28847
|
noValidate
|
|
@@ -28853,6 +28857,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28853
28857
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28854
28858
|
inputmode="${o(this.inputmode)}"
|
|
28855
28859
|
>
|
|
28860
|
+
<span slot="displayValue">
|
|
28861
|
+
${this.renderDisplayTextDate(this.value)}
|
|
28862
|
+
</span>
|
|
28856
28863
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
28857
28864
|
</${this.inputTag}>
|
|
28858
28865
|
</div>
|
|
@@ -28883,6 +28890,9 @@ class AuroDatePicker extends AuroElement$1 {
|
|
|
28883
28890
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
28884
28891
|
?disabled="${this.disabled}"
|
|
28885
28892
|
part="input">
|
|
28893
|
+
<span slot="displayValue">
|
|
28894
|
+
${this.renderDisplayTextDate(this.valueEnd)}
|
|
28895
|
+
</span>
|
|
28886
28896
|
<span slot="label"><slot name="toLabel"></slot></span>
|
|
28887
28897
|
</${this.inputTag}>
|
|
28888
28898
|
</div>
|
|
@@ -16,24 +16,17 @@
|
|
|
16
16
|
<head>
|
|
17
17
|
<meta charset="UTF-8" />
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<link rel="stylesheet"
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
19
|
+
<title>Auro Web Component Generator | auro-datepicker custom element</title>
|
|
20
|
+
<link
|
|
21
|
+
rel="stylesheet"
|
|
22
|
+
type="text/css"
|
|
23
|
+
href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"
|
|
24
|
+
/>
|
|
25
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
|
|
34
27
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
35
28
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
|
|
36
|
-
</head>
|
|
29
|
+
</head>
|
|
37
30
|
<body class="auro-markdown">
|
|
38
31
|
<main></main>
|
|
39
32
|
|
|
@@ -490,11 +490,6 @@ 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;
|
|
498
493
|
/**
|
|
499
494
|
* Validates value.
|
|
500
495
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
@@ -529,7 +524,24 @@ export class AuroDatePicker extends AuroElement {
|
|
|
529
524
|
* @returns {import("lit").TemplateResult}
|
|
530
525
|
*/
|
|
531
526
|
private renderSnowflakeLayout;
|
|
532
|
-
|
|
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
|
+
* @param date
|
|
535
|
+
* @return {string}
|
|
536
|
+
*/
|
|
537
|
+
formatShortDate(date: any): string;
|
|
538
|
+
/**
|
|
539
|
+
* Format and render the provided date value.
|
|
540
|
+
* @private
|
|
541
|
+
* @param dateValue
|
|
542
|
+
* @return {TemplateResult}
|
|
543
|
+
*/
|
|
544
|
+
private renderDisplayTextDate;
|
|
533
545
|
renderHtmlInputs(): import("lit-html").TemplateResult;
|
|
534
546
|
renderHtmlActionClear(): import("lit-html").TemplateResult;
|
|
535
547
|
renderHtmlIconError(): import("lit-html").TemplateResult;
|