@aurodesignsystem-dev/auro-formkit 0.0.0-pr784.0 → 0.0.0-pr785.1

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.
Files changed (41) hide show
  1. package/components/checkbox/demo/api.min.js +5 -16
  2. package/components/checkbox/demo/index.min.js +5 -16
  3. package/components/checkbox/dist/index.js +5 -16
  4. package/components/checkbox/dist/registered.js +5 -16
  5. package/components/combobox/demo/api.md +0 -1
  6. package/components/combobox/demo/api.min.js +29 -61
  7. package/components/combobox/demo/index.min.js +29 -61
  8. package/components/combobox/dist/auro-combobox.d.ts +0 -5
  9. package/components/combobox/dist/index.js +29 -61
  10. package/components/combobox/dist/registered.js +29 -61
  11. package/components/counter/demo/api.min.js +19 -24
  12. package/components/counter/demo/index.min.js +19 -24
  13. package/components/counter/dist/index.js +19 -24
  14. package/components/counter/dist/registered.js +19 -24
  15. package/components/datepicker/demo/api.md +1 -2
  16. package/components/datepicker/demo/api.min.js +87 -61
  17. package/components/datepicker/demo/index.min.js +87 -61
  18. package/components/datepicker/dist/auro-datepicker.d.ts +18 -6
  19. package/components/datepicker/dist/index.js +87 -61
  20. package/components/datepicker/dist/registered.js +87 -61
  21. package/components/dropdown/demo/api.md +7 -6
  22. package/components/dropdown/demo/api.min.js +14 -8
  23. package/components/dropdown/demo/index.min.js +14 -8
  24. package/components/dropdown/dist/auro-dropdown.d.ts +1 -0
  25. package/components/dropdown/dist/index.js +14 -8
  26. package/components/dropdown/dist/registered.js +14 -8
  27. package/components/input/demo/api.md +1 -2
  28. package/components/input/demo/api.min.js +7 -25
  29. package/components/input/demo/index.min.js +7 -25
  30. package/components/input/dist/base-input.d.ts +1 -5
  31. package/components/input/dist/index.js +7 -25
  32. package/components/input/dist/registered.js +7 -25
  33. package/components/radio/demo/api.min.js +5 -16
  34. package/components/radio/demo/index.min.js +5 -16
  35. package/components/radio/dist/index.js +5 -16
  36. package/components/radio/dist/registered.js +5 -16
  37. package/components/select/demo/api.min.js +19 -24
  38. package/components/select/demo/index.min.js +19 -24
  39. package/components/select/dist/index.js +19 -24
  40. package/components/select/dist/registered.js +19 -24
  41. package/package.json +2 -2
@@ -2234,24 +2234,13 @@ class AuroFormValidation {
2234
2234
  this.getInputElements(elem);
2235
2235
  this.getAuroInputs(elem);
2236
2236
 
2237
- // Check if validation should run
2237
+ // Validate only if noValidate is not true and the input does not have focus
2238
2238
  let validationShouldRun =
2239
-
2240
- // If the validation was forced
2241
2239
  force ||
2242
-
2243
- // If the validation should run on input
2244
- elem.validateOnInput ||
2245
-
2246
- // State-based checks
2247
- (
2248
- // Element is not currently focused
2249
- !elem.contains(document.activeElement) && // native input is not focused directly
2250
- !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
2251
-
2252
- // And element has been touched or is untouched but has a value
2253
- ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
2254
- );
2240
+ (!elem.contains(document.activeElement) &&
2241
+ (elem.touched ||
2242
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
2243
+ elem.validateOnInput;
2255
2244
 
2256
2245
  if (elem.hasAttribute('error')) {
2257
2246
  elem.validity = 'customError';
@@ -4712,7 +4701,7 @@ class AuroFloatingUI {
4712
4701
  */
4713
4702
  mirrorSize() {
4714
4703
  // mirror the boxsize from bibSizer
4715
- if (this.element.bibSizer) {
4704
+ if (this.element.bibSizer && this.element.matchWidth) {
4716
4705
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4717
4706
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4718
4707
  if (sizerStyle.width !== '0px') {
@@ -4924,7 +4913,7 @@ class AuroFloatingUI {
4924
4913
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4925
4914
  return;
4926
4915
  }
4927
-
4916
+
4928
4917
  // if fullscreen bib is in fullscreen mode, do not close
4929
4918
  if (this.element.bib.hasAttribute('isfullscreen')) {
4930
4919
  return;
@@ -5112,7 +5101,7 @@ class AuroFloatingUI {
5112
5101
 
5113
5102
  event.preventDefault();
5114
5103
  this.handleClick();
5115
- }
5104
+ }
5116
5105
  break;
5117
5106
  case 'mouseenter':
5118
5107
  if (this.element.hoverToggle) {
@@ -6509,6 +6498,9 @@ class AuroDropdown extends AuroElement$3 {
6509
6498
 
6510
6499
  this.parentBorder = false;
6511
6500
 
6501
+ /** @private */
6502
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6503
+
6512
6504
  this.privateDefaults();
6513
6505
  }
6514
6506
 
@@ -6942,12 +6934,14 @@ class AuroDropdown extends AuroElement$3 {
6942
6934
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6943
6935
  this.handleTriggerContentSlotChange();
6944
6936
  }
6937
+ }
6945
6938
 
6946
- if (changedProperties.has('isPopoverVisible')) {
6947
- this.updateFocusTrap();
6948
- if (!this.isPopoverVisible && this.hasFocus) {
6949
- this.trigger.focus();
6950
- }
6939
+ handleDropdownToggle(event) {
6940
+ this.updateFocusTrap();
6941
+ this.isPopoverVisible = event.detail.expanded;
6942
+ const eventType = event.detail.eventType || "unknown";
6943
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
6944
+ this.trigger.focus();
6951
6945
  }
6952
6946
  }
6953
6947
 
@@ -6955,6 +6949,7 @@ class AuroDropdown extends AuroElement$3 {
6955
6949
 
6956
6950
  // Configure the floater to, this will generate the ID for the bib
6957
6951
  this.floater.configure(this, 'auroDropdown');
6952
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6958
6953
 
6959
6954
  /**
6960
6955
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -50,13 +50,12 @@
50
50
 
51
51
  | Method | Type | Description |
52
52
  |-------------------------------|----------------------------------------|--------------------------------------------------|
53
- | [clear](#clear) | `(): void` | Clears the current value(s) of the datepicker. |
54
53
  | [focus](#focus) | `(focusInput: string): void` | Focuses the datepicker trigger input.<br /><br />**focusInput**: Pass in `endDate` to focus on the return input. No parameter is needed to focus on the depart input. |
54
+ | [formatShortDate](#formatShortDate) | `(date: any): string` | Simple formatter that ONLY WORKS FOR US DATES.<br />Returns formatted date like Apr 21 or Dec 25.<br /><br />**date**: undefined |
55
55
  | [renderHtmlActionClear](#renderHtmlActionClear) | `(): TemplateResult` | |
56
56
  | [renderHtmlIconCalendar](#renderHtmlIconCalendar) | `(): TemplateResult` | |
57
57
  | [renderHtmlIconError](#renderHtmlIconError) | `(): TemplateResult` | |
58
58
  | [renderHtmlInputs](#renderHtmlInputs) | `(): TemplateResult` | |
59
- | [renderLayoutFromAttributes](#renderLayoutFromAttributes) | `(): TemplateResult` | |
60
59
  | [reset](#reset) | `(): void` | Resets component to initial state. |
61
60
  | [resetLayoutClasses](#resetLayoutClasses) | `(): void` | |
62
61
  | [resetShapeClasses](#resetShapeClasses) | `(): void` | |
@@ -989,24 +989,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
989
989
  this.getInputElements(elem);
990
990
  this.getAuroInputs(elem);
991
991
 
992
- // Check if validation should run
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
- // If the validation should run on input
999
- elem.validateOnInput ||
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) {
@@ -17913,6 +17902,9 @@ class AuroDropdown extends AuroElement$4 {
17913
17902
 
17914
17903
  this.parentBorder = false;
17915
17904
 
17905
+ /** @private */
17906
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17907
+
17916
17908
  this.privateDefaults();
17917
17909
  }
17918
17910
 
@@ -18346,12 +18338,14 @@ class AuroDropdown extends AuroElement$4 {
18346
18338
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18347
18339
  this.handleTriggerContentSlotChange();
18348
18340
  }
18341
+ }
18349
18342
 
18350
- if (changedProperties.has('isPopoverVisible')) {
18351
- this.updateFocusTrap();
18352
- if (!this.isPopoverVisible && this.hasFocus) {
18353
- this.trigger.focus();
18354
- }
18343
+ handleDropdownToggle(event) {
18344
+ this.updateFocusTrap();
18345
+ this.isPopoverVisible = event.detail.expanded;
18346
+ const eventType = event.detail.eventType || "unknown";
18347
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18348
+ this.trigger.focus();
18355
18349
  }
18356
18350
  }
18357
18351
 
@@ -18359,6 +18353,7 @@ class AuroDropdown extends AuroElement$4 {
18359
18353
 
18360
18354
  // Configure the floater to, this will generate the ID for the bib
18361
18355
  this.floater.configure(this, 'auroDropdown');
18356
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18362
18357
 
18363
18358
  /**
18364
18359
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -23518,24 +23513,13 @@ class AuroFormValidation {
23518
23513
  this.getInputElements(elem);
23519
23514
  this.getAuroInputs(elem);
23520
23515
 
23521
- // Check if validation should run
23516
+ // Validate only if noValidate is not true and the input does not have focus
23522
23517
  let validationShouldRun =
23523
-
23524
- // If the validation was forced
23525
23518
  force ||
23526
-
23527
- // If the validation should run on input
23528
- elem.validateOnInput ||
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
- );
23519
+ (!elem.contains(document.activeElement) &&
23520
+ (elem.touched ||
23521
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
23522
+ elem.validateOnInput;
23539
23523
 
23540
23524
  if (elem.hasAttribute('error')) {
23541
23525
  elem.validity = 'customError';
@@ -24486,9 +24470,9 @@ class BaseInput extends AuroElement$2 {
24486
24470
  this.inputElement.value = "";
24487
24471
  this.value = "";
24488
24472
  this.labelElement.classList.remove('inputElement-label--sticky');
24489
- this.notifyValueChanged();
24490
24473
  this.focus();
24491
24474
  this.validation.validate(this);
24475
+ this.notifyValueChanged();
24492
24476
  }
24493
24477
 
24494
24478
  /**
@@ -24583,20 +24567,13 @@ class BaseInput extends AuroElement$2 {
24583
24567
  }
24584
24568
 
24585
24569
  /**
24586
- * Resets component to initial state, including resetting the touched state and validity.
24570
+ * Resets component to initial state.
24587
24571
  * @returns {void}
24588
24572
  */
24589
24573
  reset() {
24590
24574
  this.validation.reset(this);
24591
24575
  }
24592
24576
 
24593
- /**
24594
- * Clears the input value
24595
- */
24596
- clear() {
24597
- this.value = undefined;
24598
- }
24599
-
24600
24577
  /**
24601
24578
  * Sets configuration data used elsewhere based on the `type` attribute.
24602
24579
  * @private
@@ -28002,6 +27979,15 @@ class AuroDatePicker extends AuroElement$1 {
28002
27979
  this.layout = 'classic';
28003
27980
  this.shape = 'classic';
28004
27981
  this.size = 'lg';
27982
+
27983
+ /**
27984
+ * @private
27985
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27986
+ */
27987
+ this.constructor.shadowRootOptions = {
27988
+ ...i.shadowRootOptions,
27989
+ delegatesFocus: true,
27990
+ };
28005
27991
  }
28006
27992
 
28007
27993
  // This function is to define props used within the scope of this component
@@ -28711,7 +28697,7 @@ class AuroDatePicker extends AuroElement$1 {
28711
28697
  */
28712
28698
  resetValues() {
28713
28699
  this.inputList.forEach((input) => {
28714
- input.clear();
28700
+ input.reset();
28715
28701
  });
28716
28702
  }
28717
28703
 
@@ -28721,15 +28707,8 @@ class AuroDatePicker extends AuroElement$1 {
28721
28707
  */
28722
28708
  reset() {
28723
28709
  this.resetValues();
28724
- this.validation.reset(this);
28725
- }
28726
28710
 
28727
- /**
28728
- * Clears the current value(s) of the datepicker.
28729
- * @returns {void}
28730
- */
28731
- clear() {
28732
- this.resetValues();
28711
+ this.validation.reset(this);
28733
28712
  }
28734
28713
 
28735
28714
  /**
@@ -28746,6 +28725,7 @@ class AuroDatePicker extends AuroElement$1 {
28746
28725
  }
28747
28726
 
28748
28727
  this.hasFocus = true;
28728
+ this.dropdown.show();
28749
28729
 
28750
28730
  // shadowroot active element is null if we focus the datepicker itself
28751
28731
  if (this.shadowRoot.activeElement === null) {
@@ -29069,6 +29049,9 @@ class AuroDatePicker extends AuroElement$1 {
29069
29049
  `;
29070
29050
  }
29071
29051
 
29052
+ /**
29053
+ * @private
29054
+ */
29072
29055
  renderLayoutFromAttributes() {
29073
29056
  switch (this.layout) {
29074
29057
  case 'snowflake':
@@ -29081,6 +29064,43 @@ class AuroDatePicker extends AuroElement$1 {
29081
29064
  }
29082
29065
  }
29083
29066
 
29067
+ // eslint-disable-next-line no-warning-comments
29068
+ // TODO: move this to date utility when time allows :(
29069
+ /**
29070
+ * Simple formatter that ONLY WORKS FOR US DATES.
29071
+ * Returns formatted date like Apr 21 or Dec 25.
29072
+ * @param date
29073
+ * @return {string}
29074
+ */
29075
+ formatShortDate(date) {
29076
+ // should render like Apr 21
29077
+ const options = {
29078
+ month: 'short',
29079
+ day: '2-digit'
29080
+ };
29081
+
29082
+ return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
29083
+ }
29084
+
29085
+ /**
29086
+ * Format and render the provided date value.
29087
+ * @private
29088
+ * @param dateValue
29089
+ * @return {TemplateResult}
29090
+ */
29091
+ renderDisplayTextDate(dateValue) {
29092
+ return u$3`
29093
+ <div>
29094
+ <div class="displayValueText">
29095
+ ${dateValue && this.util.validDateStr(dateValue, this.format)
29096
+ ? this.formatShortDate(dateValue)
29097
+ : undefined
29098
+ }
29099
+ </div>
29100
+ </div>
29101
+ `;
29102
+ }
29103
+
29084
29104
  renderHtmlInputs() {
29085
29105
  const inputClasses = {
29086
29106
  "util_displayHiddenVisually": !this.hasValue && !this.hasFocus
@@ -29096,7 +29116,7 @@ class AuroDatePicker extends AuroElement$1 {
29096
29116
  .max="${this.maxDate}"
29097
29117
  .min="${this.minDate}"
29098
29118
  id="${this.generateRandomString(12)}"
29099
- placeholder="MM/DD"
29119
+ .placeholder="${this.placeholder}"
29100
29120
  simple
29101
29121
  bordered
29102
29122
  noValidate
@@ -29112,6 +29132,9 @@ class AuroDatePicker extends AuroElement$1 {
29112
29132
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
29113
29133
  inputmode="${o(this.inputmode)}"
29114
29134
  >
29135
+ <span slot="displayValue">
29136
+ ${this.renderDisplayTextDate(this.value)}
29137
+ </span>
29115
29138
  <span slot="label"><slot name="fromLabel"></slot></span>
29116
29139
  </${this.inputTag}>
29117
29140
  </div>
@@ -29142,6 +29165,9 @@ class AuroDatePicker extends AuroElement$1 {
29142
29165
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
29143
29166
  ?disabled="${this.disabled}"
29144
29167
  part="input">
29168
+ <span slot="displayValue">
29169
+ ${this.renderDisplayTextDate(this.valueEnd)}
29170
+ </span>
29145
29171
  <span slot="label"><slot name="toLabel"></slot></span>
29146
29172
  </${this.inputTag}>
29147
29173
  </div>