@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
@@ -730,24 +730,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
730
730
  this.getInputElements(elem);
731
731
  this.getAuroInputs(elem);
732
732
 
733
- // Check if validation should run
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
- // If the validation should run on input
740
- elem.validateOnInput ||
741
-
742
- // State-based checks
743
- (
744
- // Element is not currently focused
745
- !elem.contains(document.activeElement) && // native input is not focused directly
746
- !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
747
-
748
- // And element has been touched or is untouched but has a value
749
- ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
750
- );
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) {
@@ -17654,6 +17643,9 @@ class AuroDropdown extends AuroElement$4 {
17654
17643
 
17655
17644
  this.parentBorder = false;
17656
17645
 
17646
+ /** @private */
17647
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17648
+
17657
17649
  this.privateDefaults();
17658
17650
  }
17659
17651
 
@@ -18087,12 +18079,14 @@ class AuroDropdown extends AuroElement$4 {
18087
18079
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18088
18080
  this.handleTriggerContentSlotChange();
18089
18081
  }
18082
+ }
18090
18083
 
18091
- if (changedProperties.has('isPopoverVisible')) {
18092
- this.updateFocusTrap();
18093
- if (!this.isPopoverVisible && this.hasFocus) {
18094
- this.trigger.focus();
18095
- }
18084
+ handleDropdownToggle(event) {
18085
+ this.updateFocusTrap();
18086
+ this.isPopoverVisible = event.detail.expanded;
18087
+ const eventType = event.detail.eventType || "unknown";
18088
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18089
+ this.trigger.focus();
18096
18090
  }
18097
18091
  }
18098
18092
 
@@ -18100,6 +18094,7 @@ class AuroDropdown extends AuroElement$4 {
18100
18094
 
18101
18095
  // Configure the floater to, this will generate the ID for the bib
18102
18096
  this.floater.configure(this, 'auroDropdown');
18097
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18103
18098
 
18104
18099
  /**
18105
18100
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -23259,24 +23254,13 @@ class AuroFormValidation {
23259
23254
  this.getInputElements(elem);
23260
23255
  this.getAuroInputs(elem);
23261
23256
 
23262
- // Check if validation should run
23257
+ // Validate only if noValidate is not true and the input does not have focus
23263
23258
  let validationShouldRun =
23264
-
23265
- // If the validation was forced
23266
23259
  force ||
23267
-
23268
- // If the validation should run on input
23269
- elem.validateOnInput ||
23270
-
23271
- // State-based checks
23272
- (
23273
- // Element is not currently focused
23274
- !elem.contains(document.activeElement) && // native input is not focused directly
23275
- !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
23276
-
23277
- // And element has been touched or is untouched but has a value
23278
- ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
23279
- );
23260
+ (!elem.contains(document.activeElement) &&
23261
+ (elem.touched ||
23262
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
23263
+ elem.validateOnInput;
23280
23264
 
23281
23265
  if (elem.hasAttribute('error')) {
23282
23266
  elem.validity = 'customError';
@@ -24227,9 +24211,9 @@ class BaseInput extends AuroElement$2 {
24227
24211
  this.inputElement.value = "";
24228
24212
  this.value = "";
24229
24213
  this.labelElement.classList.remove('inputElement-label--sticky');
24230
- this.notifyValueChanged();
24231
24214
  this.focus();
24232
24215
  this.validation.validate(this);
24216
+ this.notifyValueChanged();
24233
24217
  }
24234
24218
 
24235
24219
  /**
@@ -24324,20 +24308,13 @@ class BaseInput extends AuroElement$2 {
24324
24308
  }
24325
24309
 
24326
24310
  /**
24327
- * Resets component to initial state, including resetting the touched state and validity.
24311
+ * Resets component to initial state.
24328
24312
  * @returns {void}
24329
24313
  */
24330
24314
  reset() {
24331
24315
  this.validation.reset(this);
24332
24316
  }
24333
24317
 
24334
- /**
24335
- * Clears the input value
24336
- */
24337
- clear() {
24338
- this.value = undefined;
24339
- }
24340
-
24341
24318
  /**
24342
24319
  * Sets configuration data used elsewhere based on the `type` attribute.
24343
24320
  * @private
@@ -27743,6 +27720,15 @@ class AuroDatePicker extends AuroElement$1 {
27743
27720
  this.layout = 'classic';
27744
27721
  this.shape = 'classic';
27745
27722
  this.size = 'lg';
27723
+
27724
+ /**
27725
+ * @private
27726
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27727
+ */
27728
+ this.constructor.shadowRootOptions = {
27729
+ ...i.shadowRootOptions,
27730
+ delegatesFocus: true,
27731
+ };
27746
27732
  }
27747
27733
 
27748
27734
  // This function is to define props used within the scope of this component
@@ -28452,7 +28438,7 @@ class AuroDatePicker extends AuroElement$1 {
28452
28438
  */
28453
28439
  resetValues() {
28454
28440
  this.inputList.forEach((input) => {
28455
- input.clear();
28441
+ input.reset();
28456
28442
  });
28457
28443
  }
28458
28444
 
@@ -28462,15 +28448,8 @@ class AuroDatePicker extends AuroElement$1 {
28462
28448
  */
28463
28449
  reset() {
28464
28450
  this.resetValues();
28465
- this.validation.reset(this);
28466
- }
28467
28451
 
28468
- /**
28469
- * Clears the current value(s) of the datepicker.
28470
- * @returns {void}
28471
- */
28472
- clear() {
28473
- this.resetValues();
28452
+ this.validation.reset(this);
28474
28453
  }
28475
28454
 
28476
28455
  /**
@@ -28487,6 +28466,7 @@ class AuroDatePicker extends AuroElement$1 {
28487
28466
  }
28488
28467
 
28489
28468
  this.hasFocus = true;
28469
+ this.dropdown.show();
28490
28470
 
28491
28471
  // shadowroot active element is null if we focus the datepicker itself
28492
28472
  if (this.shadowRoot.activeElement === null) {
@@ -28810,6 +28790,9 @@ class AuroDatePicker extends AuroElement$1 {
28810
28790
  `;
28811
28791
  }
28812
28792
 
28793
+ /**
28794
+ * @private
28795
+ */
28813
28796
  renderLayoutFromAttributes() {
28814
28797
  switch (this.layout) {
28815
28798
  case 'snowflake':
@@ -28822,6 +28805,43 @@ class AuroDatePicker extends AuroElement$1 {
28822
28805
  }
28823
28806
  }
28824
28807
 
28808
+ // eslint-disable-next-line no-warning-comments
28809
+ // TODO: move this to date utility when time allows :(
28810
+ /**
28811
+ * Simple formatter that ONLY WORKS FOR US DATES.
28812
+ * Returns formatted date like Apr 21 or Dec 25.
28813
+ * @param date
28814
+ * @return {string}
28815
+ */
28816
+ formatShortDate(date) {
28817
+ // should render like Apr 21
28818
+ const options = {
28819
+ month: 'short',
28820
+ day: '2-digit'
28821
+ };
28822
+
28823
+ return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
28824
+ }
28825
+
28826
+ /**
28827
+ * Format and render the provided date value.
28828
+ * @private
28829
+ * @param dateValue
28830
+ * @return {TemplateResult}
28831
+ */
28832
+ renderDisplayTextDate(dateValue) {
28833
+ return u$3`
28834
+ <div>
28835
+ <div class="displayValueText">
28836
+ ${dateValue && this.util.validDateStr(dateValue, this.format)
28837
+ ? this.formatShortDate(dateValue)
28838
+ : undefined
28839
+ }
28840
+ </div>
28841
+ </div>
28842
+ `;
28843
+ }
28844
+
28825
28845
  renderHtmlInputs() {
28826
28846
  const inputClasses = {
28827
28847
  "util_displayHiddenVisually": !this.hasValue && !this.hasFocus
@@ -28837,7 +28857,7 @@ class AuroDatePicker extends AuroElement$1 {
28837
28857
  .max="${this.maxDate}"
28838
28858
  .min="${this.minDate}"
28839
28859
  id="${this.generateRandomString(12)}"
28840
- placeholder="MM/DD"
28860
+ .placeholder="${this.placeholder}"
28841
28861
  simple
28842
28862
  bordered
28843
28863
  noValidate
@@ -28853,6 +28873,9 @@ class AuroDatePicker extends AuroElement$1 {
28853
28873
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28854
28874
  inputmode="${o(this.inputmode)}"
28855
28875
  >
28876
+ <span slot="displayValue">
28877
+ ${this.renderDisplayTextDate(this.value)}
28878
+ </span>
28856
28879
  <span slot="label"><slot name="fromLabel"></slot></span>
28857
28880
  </${this.inputTag}>
28858
28881
  </div>
@@ -28883,6 +28906,9 @@ class AuroDatePicker extends AuroElement$1 {
28883
28906
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28884
28907
  ?disabled="${this.disabled}"
28885
28908
  part="input">
28909
+ <span slot="displayValue">
28910
+ ${this.renderDisplayTextDate(this.valueEnd)}
28911
+ </span>
28886
28912
  <span slot="label"><slot name="toLabel"></slot></span>
28887
28913
  </${this.inputTag}>
28888
28914
  </div>
@@ -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
- renderLayoutFromAttributes(): import("lit-html").TemplateResult;
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;
@@ -710,24 +710,13 @@ let AuroFormValidation$1 = class AuroFormValidation {
710
710
  this.getInputElements(elem);
711
711
  this.getAuroInputs(elem);
712
712
 
713
- // Check if validation should run
713
+ // Validate only if noValidate is not true and the input does not have focus
714
714
  let validationShouldRun =
715
-
716
- // If the validation was forced
717
715
  force ||
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
- );
716
+ (!elem.contains(document.activeElement) &&
717
+ (elem.touched ||
718
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
719
+ elem.validateOnInput;
731
720
 
732
721
  if (elem.hasAttribute('error')) {
733
722
  elem.validity = 'customError';
@@ -1268,9 +1257,9 @@ var shapeSizeCss$2 = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
1268
1257
 
1269
1258
  var classicLayoutColor = css``;
1270
1259
 
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}`;
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-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}`;
1272
1261
 
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}`;
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-input]::part(displayValue){background-color:inherit}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
1274
1263
 
1275
1264
  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:""}`;
1276
1265
 
@@ -15806,7 +15795,7 @@ class AuroFloatingUI {
15806
15795
  */
15807
15796
  mirrorSize() {
15808
15797
  // mirror the boxsize from bibSizer
15809
- if (this.element.bibSizer) {
15798
+ if (this.element.bibSizer && this.element.matchWidth) {
15810
15799
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
15811
15800
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
15812
15801
  if (sizerStyle.width !== '0px') {
@@ -16018,7 +16007,7 @@ class AuroFloatingUI {
16018
16007
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
16019
16008
  return;
16020
16009
  }
16021
-
16010
+
16022
16011
  // if fullscreen bib is in fullscreen mode, do not close
16023
16012
  if (this.element.bib.hasAttribute('isfullscreen')) {
16024
16013
  return;
@@ -16206,7 +16195,7 @@ class AuroFloatingUI {
16206
16195
 
16207
16196
  event.preventDefault();
16208
16197
  this.handleClick();
16209
- }
16198
+ }
16210
16199
  break;
16211
16200
  case 'mouseenter':
16212
16201
  if (this.element.hoverToggle) {
@@ -17603,6 +17592,9 @@ class AuroDropdown extends AuroElement$4 {
17603
17592
 
17604
17593
  this.parentBorder = false;
17605
17594
 
17595
+ /** @private */
17596
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17597
+
17606
17598
  this.privateDefaults();
17607
17599
  }
17608
17600
 
@@ -18036,12 +18028,14 @@ class AuroDropdown extends AuroElement$4 {
18036
18028
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18037
18029
  this.handleTriggerContentSlotChange();
18038
18030
  }
18031
+ }
18039
18032
 
18040
- if (changedProperties.has('isPopoverVisible')) {
18041
- this.updateFocusTrap();
18042
- if (!this.isPopoverVisible && this.hasFocus) {
18043
- this.trigger.focus();
18044
- }
18033
+ handleDropdownToggle(event) {
18034
+ this.updateFocusTrap();
18035
+ this.isPopoverVisible = event.detail.expanded;
18036
+ const eventType = event.detail.eventType || "unknown";
18037
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18038
+ this.trigger.focus();
18045
18039
  }
18046
18040
  }
18047
18041
 
@@ -18049,6 +18043,7 @@ class AuroDropdown extends AuroElement$4 {
18049
18043
 
18050
18044
  // Configure the floater to, this will generate the ID for the bib
18051
18045
  this.floater.configure(this, 'auroDropdown');
18046
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18052
18047
 
18053
18048
  /**
18054
18049
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -23195,24 +23190,13 @@ class AuroFormValidation {
23195
23190
  this.getInputElements(elem);
23196
23191
  this.getAuroInputs(elem);
23197
23192
 
23198
- // Check if validation should run
23193
+ // Validate only if noValidate is not true and the input does not have focus
23199
23194
  let validationShouldRun =
23200
-
23201
- // If the validation was forced
23202
23195
  force ||
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
- );
23196
+ (!elem.contains(document.activeElement) &&
23197
+ (elem.touched ||
23198
+ (!elem.touched && typeof elem.value !== "undefined"))) ||
23199
+ elem.validateOnInput;
23216
23200
 
23217
23201
  if (elem.hasAttribute('error')) {
23218
23202
  elem.validity = 'customError';
@@ -24163,9 +24147,9 @@ class BaseInput extends AuroElement$2 {
24163
24147
  this.inputElement.value = "";
24164
24148
  this.value = "";
24165
24149
  this.labelElement.classList.remove('inputElement-label--sticky');
24166
- this.notifyValueChanged();
24167
24150
  this.focus();
24168
24151
  this.validation.validate(this);
24152
+ this.notifyValueChanged();
24169
24153
  }
24170
24154
 
24171
24155
  /**
@@ -24260,20 +24244,13 @@ class BaseInput extends AuroElement$2 {
24260
24244
  }
24261
24245
 
24262
24246
  /**
24263
- * Resets component to initial state, including resetting the touched state and validity.
24247
+ * Resets component to initial state.
24264
24248
  * @returns {void}
24265
24249
  */
24266
24250
  reset() {
24267
24251
  this.validation.reset(this);
24268
24252
  }
24269
24253
 
24270
- /**
24271
- * Clears the input value
24272
- */
24273
- clear() {
24274
- this.value = undefined;
24275
- }
24276
-
24277
24254
  /**
24278
24255
  * Sets configuration data used elsewhere based on the `type` attribute.
24279
24256
  * @private
@@ -27679,6 +27656,15 @@ class AuroDatePicker extends AuroElement$1 {
27679
27656
  this.layout = 'classic';
27680
27657
  this.shape = 'classic';
27681
27658
  this.size = 'lg';
27659
+
27660
+ /**
27661
+ * @private
27662
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27663
+ */
27664
+ this.constructor.shadowRootOptions = {
27665
+ ...LitElement.shadowRootOptions,
27666
+ delegatesFocus: true,
27667
+ };
27682
27668
  }
27683
27669
 
27684
27670
  // This function is to define props used within the scope of this component
@@ -28388,7 +28374,7 @@ class AuroDatePicker extends AuroElement$1 {
28388
28374
  */
28389
28375
  resetValues() {
28390
28376
  this.inputList.forEach((input) => {
28391
- input.clear();
28377
+ input.reset();
28392
28378
  });
28393
28379
  }
28394
28380
 
@@ -28398,15 +28384,8 @@ class AuroDatePicker extends AuroElement$1 {
28398
28384
  */
28399
28385
  reset() {
28400
28386
  this.resetValues();
28401
- this.validation.reset(this);
28402
- }
28403
28387
 
28404
- /**
28405
- * Clears the current value(s) of the datepicker.
28406
- * @returns {void}
28407
- */
28408
- clear() {
28409
- this.resetValues();
28388
+ this.validation.reset(this);
28410
28389
  }
28411
28390
 
28412
28391
  /**
@@ -28423,6 +28402,7 @@ class AuroDatePicker extends AuroElement$1 {
28423
28402
  }
28424
28403
 
28425
28404
  this.hasFocus = true;
28405
+ this.dropdown.show();
28426
28406
 
28427
28407
  // shadowroot active element is null if we focus the datepicker itself
28428
28408
  if (this.shadowRoot.activeElement === null) {
@@ -28746,6 +28726,9 @@ class AuroDatePicker extends AuroElement$1 {
28746
28726
  `;
28747
28727
  }
28748
28728
 
28729
+ /**
28730
+ * @private
28731
+ */
28749
28732
  renderLayoutFromAttributes() {
28750
28733
  switch (this.layout) {
28751
28734
  case 'snowflake':
@@ -28758,6 +28741,43 @@ class AuroDatePicker extends AuroElement$1 {
28758
28741
  }
28759
28742
  }
28760
28743
 
28744
+ // eslint-disable-next-line no-warning-comments
28745
+ // TODO: move this to date utility when time allows :(
28746
+ /**
28747
+ * Simple formatter that ONLY WORKS FOR US DATES.
28748
+ * Returns formatted date like Apr 21 or Dec 25.
28749
+ * @param date
28750
+ * @return {string}
28751
+ */
28752
+ formatShortDate(date) {
28753
+ // should render like Apr 21
28754
+ const options = {
28755
+ month: 'short',
28756
+ day: '2-digit'
28757
+ };
28758
+
28759
+ return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
28760
+ }
28761
+
28762
+ /**
28763
+ * Format and render the provided date value.
28764
+ * @private
28765
+ * @param dateValue
28766
+ * @return {TemplateResult}
28767
+ */
28768
+ renderDisplayTextDate(dateValue) {
28769
+ return html$1`
28770
+ <div>
28771
+ <div class="displayValueText">
28772
+ ${dateValue && this.util.validDateStr(dateValue, this.format)
28773
+ ? this.formatShortDate(dateValue)
28774
+ : undefined
28775
+ }
28776
+ </div>
28777
+ </div>
28778
+ `;
28779
+ }
28780
+
28761
28781
  renderHtmlInputs() {
28762
28782
  const inputClasses = {
28763
28783
  "util_displayHiddenVisually": !this.hasValue && !this.hasFocus
@@ -28773,7 +28793,7 @@ class AuroDatePicker extends AuroElement$1 {
28773
28793
  .max="${this.maxDate}"
28774
28794
  .min="${this.minDate}"
28775
28795
  id="${this.generateRandomString(12)}"
28776
- placeholder="MM/DD"
28796
+ .placeholder="${this.placeholder}"
28777
28797
  simple
28778
28798
  bordered
28779
28799
  noValidate
@@ -28789,6 +28809,9 @@ class AuroDatePicker extends AuroElement$1 {
28789
28809
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28790
28810
  inputmode="${ifDefined(this.inputmode)}"
28791
28811
  >
28812
+ <span slot="displayValue">
28813
+ ${this.renderDisplayTextDate(this.value)}
28814
+ </span>
28792
28815
  <span slot="label"><slot name="fromLabel"></slot></span>
28793
28816
  </${this.inputTag}>
28794
28817
  </div>
@@ -28819,6 +28842,9 @@ class AuroDatePicker extends AuroElement$1 {
28819
28842
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28820
28843
  ?disabled="${this.disabled}"
28821
28844
  part="input">
28845
+ <span slot="displayValue">
28846
+ ${this.renderDisplayTextDate(this.valueEnd)}
28847
+ </span>
28822
28848
  <span slot="label"><slot name="toLabel"></slot></span>
28823
28849
  </${this.inputTag}>
28824
28850
  </div>