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

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 (63) hide show
  1. package/components/checkbox/demo/api.html +16 -10
  2. package/components/checkbox/demo/api.min.js +2 -2
  3. package/components/checkbox/demo/index.html +16 -10
  4. package/components/checkbox/demo/index.min.js +2 -2
  5. package/components/checkbox/demo/readme.html +16 -9
  6. package/components/checkbox/dist/index.js +2 -2
  7. package/components/checkbox/dist/registered.js +2 -2
  8. package/components/combobox/demo/api.html +16 -10
  9. package/components/combobox/demo/api.min.js +27 -15
  10. package/components/combobox/demo/index.html +16 -10
  11. package/components/combobox/demo/index.min.js +27 -15
  12. package/components/combobox/demo/readme.html +16 -9
  13. package/components/combobox/dist/index.js +27 -15
  14. package/components/combobox/dist/registered.js +27 -15
  15. package/components/counter/demo/api.html +16 -10
  16. package/components/counter/demo/api.min.js +25 -13
  17. package/components/counter/demo/index.html +16 -10
  18. package/components/counter/demo/index.min.js +25 -13
  19. package/components/counter/demo/readme.html +16 -9
  20. package/components/counter/dist/index.js +25 -13
  21. package/components/counter/dist/registered.js +25 -13
  22. package/components/datepicker/demo/api.html +16 -10
  23. package/components/datepicker/demo/api.min.js +37 -15
  24. package/components/datepicker/demo/index.html +16 -10
  25. package/components/datepicker/demo/index.min.js +37 -15
  26. package/components/datepicker/demo/readme.html +16 -9
  27. package/components/datepicker/dist/index.js +37 -15
  28. package/components/datepicker/dist/registered.js +37 -15
  29. package/components/dropdown/demo/api.html +16 -10
  30. package/components/dropdown/demo/api.md +7 -6
  31. package/components/dropdown/demo/api.min.js +25 -13
  32. package/components/dropdown/demo/index.html +16 -10
  33. package/components/dropdown/demo/index.min.js +25 -13
  34. package/components/dropdown/demo/readme.html +16 -9
  35. package/components/dropdown/dist/auro-dropdown.d.ts +1 -0
  36. package/components/dropdown/dist/index.js +25 -13
  37. package/components/dropdown/dist/registered.js +25 -13
  38. package/components/form/demo/api.html +16 -9
  39. package/components/form/demo/autocomplete.html +19 -3
  40. package/components/form/demo/index.html +16 -9
  41. package/components/form/demo/readme.html +16 -9
  42. package/components/form/demo/working.html +19 -13
  43. package/components/input/demo/api.html +16 -10
  44. package/components/input/demo/api.min.js +2 -2
  45. package/components/input/demo/index.html +16 -10
  46. package/components/input/demo/index.min.js +2 -2
  47. package/components/input/demo/readme.html +16 -9
  48. package/components/input/dist/index.js +2 -2
  49. package/components/input/dist/registered.js +2 -2
  50. package/components/menu/demo/api.html +16 -32
  51. package/components/menu/demo/index.html +16 -10
  52. package/components/menu/demo/readme.html +16 -9
  53. package/components/radio/demo/api.html +16 -10
  54. package/components/radio/demo/index.html +16 -10
  55. package/components/radio/demo/readme.html +16 -9
  56. package/components/select/demo/api.html +16 -10
  57. package/components/select/demo/api.min.js +25 -13
  58. package/components/select/demo/index.html +16 -11
  59. package/components/select/demo/index.min.js +25 -13
  60. package/components/select/demo/readme.html +16 -9
  61. package/components/select/dist/index.js +25 -13
  62. package/components/select/dist/registered.js +25 -13
  63. package/package.json +4 -3
@@ -16064,7 +16064,7 @@ class AuroFloatingUI {
16064
16064
  return;
16065
16065
  }
16066
16066
 
16067
- this.hideBib();
16067
+ this.hideBib("keydown");
16068
16068
  }
16069
16069
 
16070
16070
  setupHideHandlers() {
@@ -16089,7 +16089,7 @@ class AuroFloatingUI {
16089
16089
  document.expandedAuroFormkitDropdown = null;
16090
16090
  document.expandedAuroFloater = this;
16091
16091
  } else {
16092
- this.hideBib();
16092
+ this.hideBib("click");
16093
16093
  }
16094
16094
  }
16095
16095
  };
@@ -16102,7 +16102,7 @@ class AuroFloatingUI {
16102
16102
  // if something else is open, let it handle itself
16103
16103
  return;
16104
16104
  }
16105
- this.hideBib();
16105
+ this.hideBib("keydown");
16106
16106
  }
16107
16107
  };
16108
16108
 
@@ -16185,7 +16185,11 @@ class AuroFloatingUI {
16185
16185
  }
16186
16186
  }
16187
16187
 
16188
- hideBib() {
16188
+ /**
16189
+ * Hides the floating UI element.
16190
+ * @param {String} eventType - The event type that triggered the hiding action.
16191
+ */
16192
+ hideBib(eventType = "unknown") {
16189
16193
  if (!this.element.disabled && !this.element.noToggle) {
16190
16194
  this.lockScroll(false);
16191
16195
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -16196,7 +16200,7 @@ class AuroFloatingUI {
16196
16200
  if (this.showing) {
16197
16201
  this.cleanupHideHandlers();
16198
16202
  this.showing = false;
16199
- this.dispatchEventDropdownToggle();
16203
+ this.dispatchEventDropdownToggle(eventType);
16200
16204
  }
16201
16205
  }
16202
16206
  document.expandedAuroFloater = null;
@@ -16205,11 +16209,13 @@ class AuroFloatingUI {
16205
16209
  /**
16206
16210
  * @private
16207
16211
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
16212
+ * @param {String} eventType - The event type that triggered the toggle action.
16208
16213
  */
16209
- dispatchEventDropdownToggle() {
16214
+ dispatchEventDropdownToggle(eventType) {
16210
16215
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
16211
16216
  detail: {
16212
16217
  expanded: this.showing,
16218
+ eventType: eventType || "unknown",
16213
16219
  },
16214
16220
  composed: true
16215
16221
  });
@@ -16219,7 +16225,7 @@ class AuroFloatingUI {
16219
16225
 
16220
16226
  handleClick() {
16221
16227
  if (this.element.isPopoverVisible) {
16222
- this.hideBib();
16228
+ this.hideBib("click");
16223
16229
  } else {
16224
16230
  this.showBib();
16225
16231
  }
@@ -16255,7 +16261,7 @@ class AuroFloatingUI {
16255
16261
  break;
16256
16262
  case 'mouseleave':
16257
16263
  if (this.element.hoverToggle) {
16258
- this.hideBib();
16264
+ this.hideBib("mouseleave");
16259
16265
  }
16260
16266
  break;
16261
16267
  case 'focus':
@@ -17643,6 +17649,9 @@ class AuroDropdown extends AuroElement$4 {
17643
17649
 
17644
17650
  this.parentBorder = false;
17645
17651
 
17652
+ /** @private */
17653
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17654
+
17646
17655
  this.privateDefaults();
17647
17656
  }
17648
17657
 
@@ -18076,12 +18085,14 @@ class AuroDropdown extends AuroElement$4 {
18076
18085
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18077
18086
  this.handleTriggerContentSlotChange();
18078
18087
  }
18088
+ }
18079
18089
 
18080
- if (changedProperties.has('isPopoverVisible')) {
18081
- this.updateFocusTrap();
18082
- if (!this.isPopoverVisible && this.hasFocus) {
18083
- this.trigger.focus();
18084
- }
18090
+ handleDropdownToggle(event) {
18091
+ this.updateFocusTrap();
18092
+ this.isPopoverVisible = event.detail.expanded;
18093
+ const eventType = event.detail.eventType || "unknown";
18094
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18095
+ this.trigger.focus();
18085
18096
  }
18086
18097
  }
18087
18098
 
@@ -18089,6 +18100,7 @@ class AuroDropdown extends AuroElement$4 {
18089
18100
 
18090
18101
  // Configure the floater to, this will generate the ID for the bib
18091
18102
  this.floater.configure(this, 'auroDropdown');
18103
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18092
18104
 
18093
18105
  /**
18094
18106
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -24078,9 +24090,9 @@ class BaseInput extends AuroElement$2 {
24078
24090
  if (!this.shadowRoot.contains(this.getActiveElement())) {
24079
24091
  this.validation.validate(this);
24080
24092
  }
24081
-
24082
- this.notifyValueChanged();
24083
24093
  }
24094
+
24095
+ this.notifyValueChanged();
24084
24096
  }
24085
24097
 
24086
24098
  if (changedProperties.has('error')) {
@@ -27714,6 +27726,15 @@ class AuroDatePicker extends AuroElement$1 {
27714
27726
  this.layout = 'classic';
27715
27727
  this.shape = 'classic';
27716
27728
  this.size = 'lg';
27729
+
27730
+ /**
27731
+ * @private
27732
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27733
+ */
27734
+ this.constructor.shadowRootOptions = {
27735
+ ...i.shadowRootOptions,
27736
+ delegatesFocus: true,
27737
+ };
27717
27738
  }
27718
27739
 
27719
27740
  // This function is to define props used within the scope of this component
@@ -28451,6 +28472,7 @@ class AuroDatePicker extends AuroElement$1 {
28451
28472
  }
28452
28473
 
28453
28474
  this.hasFocus = true;
28475
+ this.dropdown.show();
28454
28476
 
28455
28477
  // shadowroot active element is null if we focus the datepicker itself
28456
28478
  if (this.shadowRoot.activeElement === null) {
@@ -16,17 +16,24 @@
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 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">
19
+ <title>Auro Web Component Demo | auro-datepicker</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-datepicker's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
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 -->
27
34
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
28
35
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
29
- </head>
36
+ </head>
30
37
  <body class="auro-markdown">
31
38
  <main></main>
32
39
 
@@ -16013,7 +16013,7 @@ class AuroFloatingUI {
16013
16013
  return;
16014
16014
  }
16015
16015
 
16016
- this.hideBib();
16016
+ this.hideBib("keydown");
16017
16017
  }
16018
16018
 
16019
16019
  setupHideHandlers() {
@@ -16038,7 +16038,7 @@ class AuroFloatingUI {
16038
16038
  document.expandedAuroFormkitDropdown = null;
16039
16039
  document.expandedAuroFloater = this;
16040
16040
  } else {
16041
- this.hideBib();
16041
+ this.hideBib("click");
16042
16042
  }
16043
16043
  }
16044
16044
  };
@@ -16051,7 +16051,7 @@ class AuroFloatingUI {
16051
16051
  // if something else is open, let it handle itself
16052
16052
  return;
16053
16053
  }
16054
- this.hideBib();
16054
+ this.hideBib("keydown");
16055
16055
  }
16056
16056
  };
16057
16057
 
@@ -16134,7 +16134,11 @@ class AuroFloatingUI {
16134
16134
  }
16135
16135
  }
16136
16136
 
16137
- hideBib() {
16137
+ /**
16138
+ * Hides the floating UI element.
16139
+ * @param {String} eventType - The event type that triggered the hiding action.
16140
+ */
16141
+ hideBib(eventType = "unknown") {
16138
16142
  if (!this.element.disabled && !this.element.noToggle) {
16139
16143
  this.lockScroll(false);
16140
16144
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -16145,7 +16149,7 @@ class AuroFloatingUI {
16145
16149
  if (this.showing) {
16146
16150
  this.cleanupHideHandlers();
16147
16151
  this.showing = false;
16148
- this.dispatchEventDropdownToggle();
16152
+ this.dispatchEventDropdownToggle(eventType);
16149
16153
  }
16150
16154
  }
16151
16155
  document.expandedAuroFloater = null;
@@ -16154,11 +16158,13 @@ class AuroFloatingUI {
16154
16158
  /**
16155
16159
  * @private
16156
16160
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
16161
+ * @param {String} eventType - The event type that triggered the toggle action.
16157
16162
  */
16158
- dispatchEventDropdownToggle() {
16163
+ dispatchEventDropdownToggle(eventType) {
16159
16164
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
16160
16165
  detail: {
16161
16166
  expanded: this.showing,
16167
+ eventType: eventType || "unknown",
16162
16168
  },
16163
16169
  composed: true
16164
16170
  });
@@ -16168,7 +16174,7 @@ class AuroFloatingUI {
16168
16174
 
16169
16175
  handleClick() {
16170
16176
  if (this.element.isPopoverVisible) {
16171
- this.hideBib();
16177
+ this.hideBib("click");
16172
16178
  } else {
16173
16179
  this.showBib();
16174
16180
  }
@@ -16204,7 +16210,7 @@ class AuroFloatingUI {
16204
16210
  break;
16205
16211
  case 'mouseleave':
16206
16212
  if (this.element.hoverToggle) {
16207
- this.hideBib();
16213
+ this.hideBib("mouseleave");
16208
16214
  }
16209
16215
  break;
16210
16216
  case 'focus':
@@ -17592,6 +17598,9 @@ class AuroDropdown extends AuroElement$4 {
17592
17598
 
17593
17599
  this.parentBorder = false;
17594
17600
 
17601
+ /** @private */
17602
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17603
+
17595
17604
  this.privateDefaults();
17596
17605
  }
17597
17606
 
@@ -18025,12 +18034,14 @@ class AuroDropdown extends AuroElement$4 {
18025
18034
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18026
18035
  this.handleTriggerContentSlotChange();
18027
18036
  }
18037
+ }
18028
18038
 
18029
- if (changedProperties.has('isPopoverVisible')) {
18030
- this.updateFocusTrap();
18031
- if (!this.isPopoverVisible && this.hasFocus) {
18032
- this.trigger.focus();
18033
- }
18039
+ handleDropdownToggle(event) {
18040
+ this.updateFocusTrap();
18041
+ this.isPopoverVisible = event.detail.expanded;
18042
+ const eventType = event.detail.eventType || "unknown";
18043
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18044
+ this.trigger.focus();
18034
18045
  }
18035
18046
  }
18036
18047
 
@@ -18038,6 +18049,7 @@ class AuroDropdown extends AuroElement$4 {
18038
18049
 
18039
18050
  // Configure the floater to, this will generate the ID for the bib
18040
18051
  this.floater.configure(this, 'auroDropdown');
18052
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18041
18053
 
18042
18054
  /**
18043
18055
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -24014,9 +24026,9 @@ class BaseInput extends AuroElement$2 {
24014
24026
  if (!this.shadowRoot.contains(this.getActiveElement())) {
24015
24027
  this.validation.validate(this);
24016
24028
  }
24017
-
24018
- this.notifyValueChanged();
24019
24029
  }
24030
+
24031
+ this.notifyValueChanged();
24020
24032
  }
24021
24033
 
24022
24034
  if (changedProperties.has('error')) {
@@ -27650,6 +27662,15 @@ class AuroDatePicker extends AuroElement$1 {
27650
27662
  this.layout = 'classic';
27651
27663
  this.shape = 'classic';
27652
27664
  this.size = 'lg';
27665
+
27666
+ /**
27667
+ * @private
27668
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27669
+ */
27670
+ this.constructor.shadowRootOptions = {
27671
+ ...LitElement.shadowRootOptions,
27672
+ delegatesFocus: true,
27673
+ };
27653
27674
  }
27654
27675
 
27655
27676
  // This function is to define props used within the scope of this component
@@ -28387,6 +28408,7 @@ class AuroDatePicker extends AuroElement$1 {
28387
28408
  }
28388
28409
 
28389
28410
  this.hasFocus = true;
28411
+ this.dropdown.show();
28390
28412
 
28391
28413
  // shadowroot active element is null if we focus the datepicker itself
28392
28414
  if (this.shadowRoot.activeElement === null) {
@@ -16013,7 +16013,7 @@ class AuroFloatingUI {
16013
16013
  return;
16014
16014
  }
16015
16015
 
16016
- this.hideBib();
16016
+ this.hideBib("keydown");
16017
16017
  }
16018
16018
 
16019
16019
  setupHideHandlers() {
@@ -16038,7 +16038,7 @@ class AuroFloatingUI {
16038
16038
  document.expandedAuroFormkitDropdown = null;
16039
16039
  document.expandedAuroFloater = this;
16040
16040
  } else {
16041
- this.hideBib();
16041
+ this.hideBib("click");
16042
16042
  }
16043
16043
  }
16044
16044
  };
@@ -16051,7 +16051,7 @@ class AuroFloatingUI {
16051
16051
  // if something else is open, let it handle itself
16052
16052
  return;
16053
16053
  }
16054
- this.hideBib();
16054
+ this.hideBib("keydown");
16055
16055
  }
16056
16056
  };
16057
16057
 
@@ -16134,7 +16134,11 @@ class AuroFloatingUI {
16134
16134
  }
16135
16135
  }
16136
16136
 
16137
- hideBib() {
16137
+ /**
16138
+ * Hides the floating UI element.
16139
+ * @param {String} eventType - The event type that triggered the hiding action.
16140
+ */
16141
+ hideBib(eventType = "unknown") {
16138
16142
  if (!this.element.disabled && !this.element.noToggle) {
16139
16143
  this.lockScroll(false);
16140
16144
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -16145,7 +16149,7 @@ class AuroFloatingUI {
16145
16149
  if (this.showing) {
16146
16150
  this.cleanupHideHandlers();
16147
16151
  this.showing = false;
16148
- this.dispatchEventDropdownToggle();
16152
+ this.dispatchEventDropdownToggle(eventType);
16149
16153
  }
16150
16154
  }
16151
16155
  document.expandedAuroFloater = null;
@@ -16154,11 +16158,13 @@ class AuroFloatingUI {
16154
16158
  /**
16155
16159
  * @private
16156
16160
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
16161
+ * @param {String} eventType - The event type that triggered the toggle action.
16157
16162
  */
16158
- dispatchEventDropdownToggle() {
16163
+ dispatchEventDropdownToggle(eventType) {
16159
16164
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
16160
16165
  detail: {
16161
16166
  expanded: this.showing,
16167
+ eventType: eventType || "unknown",
16162
16168
  },
16163
16169
  composed: true
16164
16170
  });
@@ -16168,7 +16174,7 @@ class AuroFloatingUI {
16168
16174
 
16169
16175
  handleClick() {
16170
16176
  if (this.element.isPopoverVisible) {
16171
- this.hideBib();
16177
+ this.hideBib("click");
16172
16178
  } else {
16173
16179
  this.showBib();
16174
16180
  }
@@ -16204,7 +16210,7 @@ class AuroFloatingUI {
16204
16210
  break;
16205
16211
  case 'mouseleave':
16206
16212
  if (this.element.hoverToggle) {
16207
- this.hideBib();
16213
+ this.hideBib("mouseleave");
16208
16214
  }
16209
16215
  break;
16210
16216
  case 'focus':
@@ -17592,6 +17598,9 @@ class AuroDropdown extends AuroElement$4 {
17592
17598
 
17593
17599
  this.parentBorder = false;
17594
17600
 
17601
+ /** @private */
17602
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17603
+
17595
17604
  this.privateDefaults();
17596
17605
  }
17597
17606
 
@@ -18025,12 +18034,14 @@ class AuroDropdown extends AuroElement$4 {
18025
18034
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18026
18035
  this.handleTriggerContentSlotChange();
18027
18036
  }
18037
+ }
18028
18038
 
18029
- if (changedProperties.has('isPopoverVisible')) {
18030
- this.updateFocusTrap();
18031
- if (!this.isPopoverVisible && this.hasFocus) {
18032
- this.trigger.focus();
18033
- }
18039
+ handleDropdownToggle(event) {
18040
+ this.updateFocusTrap();
18041
+ this.isPopoverVisible = event.detail.expanded;
18042
+ const eventType = event.detail.eventType || "unknown";
18043
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18044
+ this.trigger.focus();
18034
18045
  }
18035
18046
  }
18036
18047
 
@@ -18038,6 +18049,7 @@ class AuroDropdown extends AuroElement$4 {
18038
18049
 
18039
18050
  // Configure the floater to, this will generate the ID for the bib
18040
18051
  this.floater.configure(this, 'auroDropdown');
18052
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18041
18053
 
18042
18054
  /**
18043
18055
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -24014,9 +24026,9 @@ class BaseInput extends AuroElement$2 {
24014
24026
  if (!this.shadowRoot.contains(this.getActiveElement())) {
24015
24027
  this.validation.validate(this);
24016
24028
  }
24017
-
24018
- this.notifyValueChanged();
24019
24029
  }
24030
+
24031
+ this.notifyValueChanged();
24020
24032
  }
24021
24033
 
24022
24034
  if (changedProperties.has('error')) {
@@ -27650,6 +27662,15 @@ class AuroDatePicker extends AuroElement$1 {
27650
27662
  this.layout = 'classic';
27651
27663
  this.shape = 'classic';
27652
27664
  this.size = 'lg';
27665
+
27666
+ /**
27667
+ * @private
27668
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27669
+ */
27670
+ this.constructor.shadowRootOptions = {
27671
+ ...LitElement.shadowRootOptions,
27672
+ delegatesFocus: true,
27673
+ };
27653
27674
  }
27654
27675
 
27655
27676
  // This function is to define props used within the scope of this component
@@ -28387,6 +28408,7 @@ class AuroDatePicker extends AuroElement$1 {
28387
28408
  }
28388
28409
 
28389
28410
  this.hasFocus = true;
28411
+ this.dropdown.show();
28390
28412
 
28391
28413
  // shadowroot active element is null if we focus the datepicker itself
28392
28414
  if (this.shadowRoot.activeElement === null) {
@@ -16,18 +16,24 @@
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 Generator | auro-dropdown 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">
19
+ <title>Auro Web Component Demo | auro-dropdown</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-dropdown's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
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 -->
27
34
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
28
35
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
29
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/essentials-as.css" />
30
- </head>
36
+ </head>
31
37
  <body class="auro-markdown">
32
38
  <main></main>
33
39
 
@@ -35,12 +35,13 @@
35
35
 
36
36
  ## Methods
37
37
 
38
- | Method | Type | Description |
39
- |------------------|------------|--------------------------------------------------|
40
- | [exposeCssParts](#exposeCssParts) | `(): void` | Exposes CSS parts for styling from parent components. |
41
- | [focus](#focus) | `(): void` | When bib is open, focus on the first element inside of bib.<br />If not, trigger element will get focus. |
42
- | [hide](#hide) | `(): void` | Public method to hide the dropdown. |
43
- | [show](#show) | `(): void` | Public method to show the dropdown. |
38
+ | Method | Type | Description |
39
+ |------------------------|----------------------|--------------------------------------------------|
40
+ | [exposeCssParts](#exposeCssParts) | `(): void` | Exposes CSS parts for styling from parent components. |
41
+ | [focus](#focus) | `(): void` | When bib is open, focus on the first element inside of bib.<br />If not, trigger element will get focus. |
42
+ | [handleDropdownToggle](#handleDropdownToggle) | `(event: any): void` | |
43
+ | [hide](#hide) | `(): void` | Public method to hide the dropdown. |
44
+ | [show](#show) | `(): void` | Public method to show the dropdown. |
44
45
 
45
46
  ## Events
46
47
 
@@ -1973,7 +1973,7 @@ class AuroFloatingUI {
1973
1973
  return;
1974
1974
  }
1975
1975
 
1976
- this.hideBib();
1976
+ this.hideBib("keydown");
1977
1977
  }
1978
1978
 
1979
1979
  setupHideHandlers() {
@@ -1998,7 +1998,7 @@ class AuroFloatingUI {
1998
1998
  document.expandedAuroFormkitDropdown = null;
1999
1999
  document.expandedAuroFloater = this;
2000
2000
  } else {
2001
- this.hideBib();
2001
+ this.hideBib("click");
2002
2002
  }
2003
2003
  }
2004
2004
  };
@@ -2011,7 +2011,7 @@ class AuroFloatingUI {
2011
2011
  // if something else is open, let it handle itself
2012
2012
  return;
2013
2013
  }
2014
- this.hideBib();
2014
+ this.hideBib("keydown");
2015
2015
  }
2016
2016
  };
2017
2017
 
@@ -2094,7 +2094,11 @@ class AuroFloatingUI {
2094
2094
  }
2095
2095
  }
2096
2096
 
2097
- hideBib() {
2097
+ /**
2098
+ * Hides the floating UI element.
2099
+ * @param {String} eventType - The event type that triggered the hiding action.
2100
+ */
2101
+ hideBib(eventType = "unknown") {
2098
2102
  if (!this.element.disabled && !this.element.noToggle) {
2099
2103
  this.lockScroll(false);
2100
2104
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2105,7 +2109,7 @@ class AuroFloatingUI {
2105
2109
  if (this.showing) {
2106
2110
  this.cleanupHideHandlers();
2107
2111
  this.showing = false;
2108
- this.dispatchEventDropdownToggle();
2112
+ this.dispatchEventDropdownToggle(eventType);
2109
2113
  }
2110
2114
  }
2111
2115
  document.expandedAuroFloater = null;
@@ -2114,11 +2118,13 @@ class AuroFloatingUI {
2114
2118
  /**
2115
2119
  * @private
2116
2120
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2121
+ * @param {String} eventType - The event type that triggered the toggle action.
2117
2122
  */
2118
- dispatchEventDropdownToggle() {
2123
+ dispatchEventDropdownToggle(eventType) {
2119
2124
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2120
2125
  detail: {
2121
2126
  expanded: this.showing,
2127
+ eventType: eventType || "unknown",
2122
2128
  },
2123
2129
  composed: true
2124
2130
  });
@@ -2128,7 +2134,7 @@ class AuroFloatingUI {
2128
2134
 
2129
2135
  handleClick() {
2130
2136
  if (this.element.isPopoverVisible) {
2131
- this.hideBib();
2137
+ this.hideBib("click");
2132
2138
  } else {
2133
2139
  this.showBib();
2134
2140
  }
@@ -2164,7 +2170,7 @@ class AuroFloatingUI {
2164
2170
  break;
2165
2171
  case 'mouseleave':
2166
2172
  if (this.element.hoverToggle) {
2167
- this.hideBib();
2173
+ this.hideBib("mouseleave");
2168
2174
  }
2169
2175
  break;
2170
2176
  case 'focus':
@@ -3558,6 +3564,9 @@ class AuroDropdown extends AuroElement {
3558
3564
 
3559
3565
  this.parentBorder = false;
3560
3566
 
3567
+ /** @private */
3568
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
3569
+
3561
3570
  this.privateDefaults();
3562
3571
  }
3563
3572
 
@@ -3991,12 +4000,14 @@ class AuroDropdown extends AuroElement {
3991
4000
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
3992
4001
  this.handleTriggerContentSlotChange();
3993
4002
  }
4003
+ }
3994
4004
 
3995
- if (changedProperties.has('isPopoverVisible')) {
3996
- this.updateFocusTrap();
3997
- if (!this.isPopoverVisible && this.hasFocus) {
3998
- this.trigger.focus();
3999
- }
4005
+ handleDropdownToggle(event) {
4006
+ this.updateFocusTrap();
4007
+ this.isPopoverVisible = event.detail.expanded;
4008
+ const eventType = event.detail.eventType || "unknown";
4009
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4010
+ this.trigger.focus();
4000
4011
  }
4001
4012
  }
4002
4013
 
@@ -4004,6 +4015,7 @@ class AuroDropdown extends AuroElement {
4004
4015
 
4005
4016
  // Configure the floater to, this will generate the ID for the bib
4006
4017
  this.floater.configure(this, 'auroDropdown');
4018
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
4007
4019
 
4008
4020
  /**
4009
4021
  * @description Let subscribers know that the dropdown ID ha been generated and added.