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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/components/checkbox/demo/api.min.js +16 -5
  2. package/components/checkbox/demo/index.min.js +16 -5
  3. package/components/checkbox/dist/index.js +16 -5
  4. package/components/checkbox/dist/registered.js +16 -5
  5. package/components/combobox/demo/api.md +1 -0
  6. package/components/combobox/demo/api.min.js +69 -48
  7. package/components/combobox/demo/index.min.js +69 -48
  8. package/components/combobox/dist/auro-combobox.d.ts +5 -0
  9. package/components/combobox/dist/index.js +69 -48
  10. package/components/combobox/dist/registered.js +69 -48
  11. package/components/counter/demo/api.min.js +32 -39
  12. package/components/counter/demo/index.min.js +32 -39
  13. package/components/counter/dist/index.js +32 -39
  14. package/components/counter/dist/registered.js +32 -39
  15. package/components/datepicker/demo/api.md +2 -0
  16. package/components/datepicker/demo/api.min.js +69 -107
  17. package/components/datepicker/demo/index.min.js +69 -107
  18. package/components/datepicker/dist/auro-datepicker.d.ts +6 -19
  19. package/components/datepicker/dist/index.js +69 -107
  20. package/components/datepicker/dist/registered.js +69 -107
  21. package/components/dropdown/demo/api.min.js +16 -33
  22. package/components/dropdown/demo/index.min.js +16 -33
  23. package/components/dropdown/dist/auro-dropdown.d.ts +0 -6
  24. package/components/dropdown/dist/index.js +16 -33
  25. package/components/dropdown/dist/registered.js +16 -33
  26. package/components/input/demo/api.md +2 -1
  27. package/components/input/demo/api.min.js +25 -7
  28. package/components/input/demo/index.min.js +25 -7
  29. package/components/input/dist/base-input.d.ts +5 -1
  30. package/components/input/dist/index.js +25 -7
  31. package/components/input/dist/registered.js +25 -7
  32. package/components/radio/demo/api.min.js +16 -5
  33. package/components/radio/demo/index.min.js +16 -5
  34. package/components/radio/dist/index.js +16 -5
  35. package/components/radio/dist/registered.js +16 -5
  36. package/components/select/demo/api.min.js +32 -38
  37. package/components/select/demo/index.min.js +32 -38
  38. package/components/select/dist/index.js +32 -38
  39. package/components/select/dist/registered.js +32 -38
  40. package/package.json +2 -2
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
2234
2234
  this.getInputElements(elem);
2235
2235
  this.getAuroInputs(elem);
2236
2236
 
2237
- // Validate only if noValidate is not true and the input does not have focus
2237
+ // Check if validation should run
2238
2238
  let validationShouldRun =
2239
+
2240
+ // If the validation was forced
2239
2241
  force ||
2240
- (!elem.contains(document.activeElement) &&
2241
- (elem.touched ||
2242
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2243
- elem.validateOnInput;
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
+ );
2244
2255
 
2245
2256
  if (elem.hasAttribute('error')) {
2246
2257
  elem.validity = 'customError';
@@ -2973,7 +2984,6 @@ class AuroCounter extends LitElement {
2973
2984
  aria-describedby="counter-description"
2974
2985
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2986
  role="spinbutton"
2976
- aria-disabled="${this.disabled ? 'true' : 'false'}"
2977
2987
  aria-valuemin="${this.min}"
2978
2988
  aria-valuemax="${this.max}"
2979
2989
  aria-valuenow="${this.value}"
@@ -4702,7 +4712,7 @@ class AuroFloatingUI {
4702
4712
  */
4703
4713
  mirrorSize() {
4704
4714
  // mirror the boxsize from bibSizer
4705
- if (this.element.bibSizer && this.element.matchWidth) {
4715
+ if (this.element.bibSizer) {
4706
4716
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4707
4717
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4708
4718
  if (sizerStyle.width !== '0px') {
@@ -4914,13 +4924,13 @@ class AuroFloatingUI {
4914
4924
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4915
4925
  return;
4916
4926
  }
4917
-
4927
+
4918
4928
  // if fullscreen bib is in fullscreen mode, do not close
4919
4929
  if (this.element.bib.hasAttribute('isfullscreen')) {
4920
4930
  return;
4921
4931
  }
4922
4932
 
4923
- this.hideBib("keydown");
4933
+ this.hideBib();
4924
4934
  }
4925
4935
 
4926
4936
  setupHideHandlers() {
@@ -4945,7 +4955,7 @@ class AuroFloatingUI {
4945
4955
  document.expandedAuroFormkitDropdown = null;
4946
4956
  document.expandedAuroFloater = this;
4947
4957
  } else {
4948
- this.hideBib("click");
4958
+ this.hideBib();
4949
4959
  }
4950
4960
  }
4951
4961
  };
@@ -4958,7 +4968,7 @@ class AuroFloatingUI {
4958
4968
  // if something else is open, let it handle itself
4959
4969
  return;
4960
4970
  }
4961
- this.hideBib("keydown");
4971
+ this.hideBib();
4962
4972
  }
4963
4973
  };
4964
4974
 
@@ -5041,11 +5051,7 @@ class AuroFloatingUI {
5041
5051
  }
5042
5052
  }
5043
5053
 
5044
- /**
5045
- * Hides the floating UI element.
5046
- * @param {String} eventType - The event type that triggered the hiding action.
5047
- */
5048
- hideBib(eventType = "unknown") {
5054
+ hideBib() {
5049
5055
  if (!this.element.disabled && !this.element.noToggle) {
5050
5056
  this.lockScroll(false);
5051
5057
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5056,7 +5062,7 @@ class AuroFloatingUI {
5056
5062
  if (this.showing) {
5057
5063
  this.cleanupHideHandlers();
5058
5064
  this.showing = false;
5059
- this.dispatchEventDropdownToggle(eventType);
5065
+ this.dispatchEventDropdownToggle();
5060
5066
  }
5061
5067
  }
5062
5068
  document.expandedAuroFloater = null;
@@ -5065,13 +5071,11 @@ class AuroFloatingUI {
5065
5071
  /**
5066
5072
  * @private
5067
5073
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5068
- * @param {String} eventType - The event type that triggered the toggle action.
5069
5074
  */
5070
- dispatchEventDropdownToggle(eventType) {
5075
+ dispatchEventDropdownToggle() {
5071
5076
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5072
5077
  detail: {
5073
5078
  expanded: this.showing,
5074
- eventType: eventType || "unknown",
5075
5079
  },
5076
5080
  composed: true
5077
5081
  });
@@ -5081,7 +5085,7 @@ class AuroFloatingUI {
5081
5085
 
5082
5086
  handleClick() {
5083
5087
  if (this.element.isPopoverVisible) {
5084
- this.hideBib("click");
5088
+ this.hideBib();
5085
5089
  } else {
5086
5090
  this.showBib();
5087
5091
  }
@@ -5108,7 +5112,7 @@ class AuroFloatingUI {
5108
5112
 
5109
5113
  event.preventDefault();
5110
5114
  this.handleClick();
5111
- }
5115
+ }
5112
5116
  break;
5113
5117
  case 'mouseenter':
5114
5118
  if (this.element.hoverToggle) {
@@ -5117,7 +5121,7 @@ class AuroFloatingUI {
5117
5121
  break;
5118
5122
  case 'mouseleave':
5119
5123
  if (this.element.hoverToggle) {
5120
- this.hideBib("mouseleave");
5124
+ this.hideBib();
5121
5125
  }
5122
5126
  break;
5123
5127
  case 'focus':
@@ -6505,9 +6509,6 @@ class AuroDropdown extends AuroElement$3 {
6505
6509
 
6506
6510
  this.parentBorder = false;
6507
6511
 
6508
- /** @private */
6509
- this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6510
-
6511
6512
  this.privateDefaults();
6512
6513
  }
6513
6514
 
@@ -6941,19 +6942,12 @@ class AuroDropdown extends AuroElement$3 {
6941
6942
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6942
6943
  this.handleTriggerContentSlotChange();
6943
6944
  }
6944
- }
6945
6945
 
6946
- /**
6947
- * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
6948
- * @private
6949
- * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
6950
- */
6951
- handleDropdownToggle(event) {
6952
- this.updateFocusTrap();
6953
- this.isPopoverVisible = event.detail.expanded;
6954
- const eventType = event.detail.eventType || "unknown";
6955
- if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
6956
- this.trigger.focus();
6946
+ if (changedProperties.has('isPopoverVisible')) {
6947
+ this.updateFocusTrap();
6948
+ if (!this.isPopoverVisible && this.hasFocus) {
6949
+ this.trigger.focus();
6950
+ }
6957
6951
  }
6958
6952
  }
6959
6953
 
@@ -6961,7 +6955,6 @@ class AuroDropdown extends AuroElement$3 {
6961
6955
 
6962
6956
  // Configure the floater to, this will generate the ID for the bib
6963
6957
  this.floater.configure(this, 'auroDropdown');
6964
- this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6965
6958
 
6966
6959
  /**
6967
6960
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2234,13 +2234,24 @@ class AuroFormValidation {
2234
2234
  this.getInputElements(elem);
2235
2235
  this.getAuroInputs(elem);
2236
2236
 
2237
- // Validate only if noValidate is not true and the input does not have focus
2237
+ // Check if validation should run
2238
2238
  let validationShouldRun =
2239
+
2240
+ // If the validation was forced
2239
2241
  force ||
2240
- (!elem.contains(document.activeElement) &&
2241
- (elem.touched ||
2242
- (!elem.touched && typeof elem.value !== "undefined"))) ||
2243
- elem.validateOnInput;
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
+ );
2244
2255
 
2245
2256
  if (elem.hasAttribute('error')) {
2246
2257
  elem.validity = 'customError';
@@ -2973,7 +2984,6 @@ class AuroCounter extends LitElement {
2973
2984
  aria-describedby="counter-description"
2974
2985
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2986
  role="spinbutton"
2976
- aria-disabled="${this.disabled ? 'true' : 'false'}"
2977
2987
  aria-valuemin="${this.min}"
2978
2988
  aria-valuemax="${this.max}"
2979
2989
  aria-valuenow="${this.value}"
@@ -4702,7 +4712,7 @@ class AuroFloatingUI {
4702
4712
  */
4703
4713
  mirrorSize() {
4704
4714
  // mirror the boxsize from bibSizer
4705
- if (this.element.bibSizer && this.element.matchWidth) {
4715
+ if (this.element.bibSizer) {
4706
4716
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4707
4717
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4708
4718
  if (sizerStyle.width !== '0px') {
@@ -4914,13 +4924,13 @@ class AuroFloatingUI {
4914
4924
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4915
4925
  return;
4916
4926
  }
4917
-
4927
+
4918
4928
  // if fullscreen bib is in fullscreen mode, do not close
4919
4929
  if (this.element.bib.hasAttribute('isfullscreen')) {
4920
4930
  return;
4921
4931
  }
4922
4932
 
4923
- this.hideBib("keydown");
4933
+ this.hideBib();
4924
4934
  }
4925
4935
 
4926
4936
  setupHideHandlers() {
@@ -4945,7 +4955,7 @@ class AuroFloatingUI {
4945
4955
  document.expandedAuroFormkitDropdown = null;
4946
4956
  document.expandedAuroFloater = this;
4947
4957
  } else {
4948
- this.hideBib("click");
4958
+ this.hideBib();
4949
4959
  }
4950
4960
  }
4951
4961
  };
@@ -4958,7 +4968,7 @@ class AuroFloatingUI {
4958
4968
  // if something else is open, let it handle itself
4959
4969
  return;
4960
4970
  }
4961
- this.hideBib("keydown");
4971
+ this.hideBib();
4962
4972
  }
4963
4973
  };
4964
4974
 
@@ -5041,11 +5051,7 @@ class AuroFloatingUI {
5041
5051
  }
5042
5052
  }
5043
5053
 
5044
- /**
5045
- * Hides the floating UI element.
5046
- * @param {String} eventType - The event type that triggered the hiding action.
5047
- */
5048
- hideBib(eventType = "unknown") {
5054
+ hideBib() {
5049
5055
  if (!this.element.disabled && !this.element.noToggle) {
5050
5056
  this.lockScroll(false);
5051
5057
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5056,7 +5062,7 @@ class AuroFloatingUI {
5056
5062
  if (this.showing) {
5057
5063
  this.cleanupHideHandlers();
5058
5064
  this.showing = false;
5059
- this.dispatchEventDropdownToggle(eventType);
5065
+ this.dispatchEventDropdownToggle();
5060
5066
  }
5061
5067
  }
5062
5068
  document.expandedAuroFloater = null;
@@ -5065,13 +5071,11 @@ class AuroFloatingUI {
5065
5071
  /**
5066
5072
  * @private
5067
5073
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5068
- * @param {String} eventType - The event type that triggered the toggle action.
5069
5074
  */
5070
- dispatchEventDropdownToggle(eventType) {
5075
+ dispatchEventDropdownToggle() {
5071
5076
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5072
5077
  detail: {
5073
5078
  expanded: this.showing,
5074
- eventType: eventType || "unknown",
5075
5079
  },
5076
5080
  composed: true
5077
5081
  });
@@ -5081,7 +5085,7 @@ class AuroFloatingUI {
5081
5085
 
5082
5086
  handleClick() {
5083
5087
  if (this.element.isPopoverVisible) {
5084
- this.hideBib("click");
5088
+ this.hideBib();
5085
5089
  } else {
5086
5090
  this.showBib();
5087
5091
  }
@@ -5108,7 +5112,7 @@ class AuroFloatingUI {
5108
5112
 
5109
5113
  event.preventDefault();
5110
5114
  this.handleClick();
5111
- }
5115
+ }
5112
5116
  break;
5113
5117
  case 'mouseenter':
5114
5118
  if (this.element.hoverToggle) {
@@ -5117,7 +5121,7 @@ class AuroFloatingUI {
5117
5121
  break;
5118
5122
  case 'mouseleave':
5119
5123
  if (this.element.hoverToggle) {
5120
- this.hideBib("mouseleave");
5124
+ this.hideBib();
5121
5125
  }
5122
5126
  break;
5123
5127
  case 'focus':
@@ -6505,9 +6509,6 @@ class AuroDropdown extends AuroElement$3 {
6505
6509
 
6506
6510
  this.parentBorder = false;
6507
6511
 
6508
- /** @private */
6509
- this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6510
-
6511
6512
  this.privateDefaults();
6512
6513
  }
6513
6514
 
@@ -6941,19 +6942,12 @@ class AuroDropdown extends AuroElement$3 {
6941
6942
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6942
6943
  this.handleTriggerContentSlotChange();
6943
6944
  }
6944
- }
6945
6945
 
6946
- /**
6947
- * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
6948
- * @private
6949
- * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
6950
- */
6951
- handleDropdownToggle(event) {
6952
- this.updateFocusTrap();
6953
- this.isPopoverVisible = event.detail.expanded;
6954
- const eventType = event.detail.eventType || "unknown";
6955
- if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
6956
- this.trigger.focus();
6946
+ if (changedProperties.has('isPopoverVisible')) {
6947
+ this.updateFocusTrap();
6948
+ if (!this.isPopoverVisible && this.hasFocus) {
6949
+ this.trigger.focus();
6950
+ }
6957
6951
  }
6958
6952
  }
6959
6953
 
@@ -6961,7 +6955,6 @@ class AuroDropdown extends AuroElement$3 {
6961
6955
 
6962
6956
  // Configure the floater to, this will generate the ID for the bib
6963
6957
  this.floater.configure(this, 'auroDropdown');
6964
- this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6965
6958
 
6966
6959
  /**
6967
6960
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -50,11 +50,13 @@
50
50
 
51
51
  | Method | Type | Description |
52
52
  |-------------------------------|----------------------------------------|--------------------------------------------------|
53
+ | [clear](#clear) | `(): void` | Clears the current value(s) of the datepicker. |
53
54
  | [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
55
  | [renderHtmlActionClear](#renderHtmlActionClear) | `(): TemplateResult` | |
55
56
  | [renderHtmlIconCalendar](#renderHtmlIconCalendar) | `(): TemplateResult` | |
56
57
  | [renderHtmlIconError](#renderHtmlIconError) | `(): TemplateResult` | |
57
58
  | [renderHtmlInputs](#renderHtmlInputs) | `(): TemplateResult` | |
59
+ | [renderLayoutFromAttributes](#renderLayoutFromAttributes) | `(): TemplateResult` | |
58
60
  | [reset](#reset) | `(): void` | Resets component to initial state. |
59
61
  | [resetLayoutClasses](#resetLayoutClasses) | `(): void` | |
60
62
  | [resetShapeClasses](#resetShapeClasses) | `(): void` | |