@aurodesignsystem-dev/auro-formkit 0.0.0-pr776.1 → 0.0.0-pr783.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.
@@ -3020,6 +3020,7 @@ class AuroCounter extends i$2 {
3020
3020
  aria-describedby="counter-description"
3021
3021
  tabindex="${this.disabled ? '-1' : '0'}"
3022
3022
  role="spinbutton"
3023
+ aria-disabled="${this.disabled ? 'true' : 'false'}"
3023
3024
  aria-valuemin="${this.min}"
3024
3025
  aria-valuemax="${this.max}"
3025
3026
  aria-valuenow="${this.value}"
@@ -4748,7 +4749,7 @@ class AuroFloatingUI {
4748
4749
  */
4749
4750
  mirrorSize() {
4750
4751
  // mirror the boxsize from bibSizer
4751
- if (this.element.bibSizer) {
4752
+ if (this.element.bibSizer && this.element.matchWidth) {
4752
4753
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4753
4754
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4754
4755
  if (sizerStyle.width !== '0px') {
@@ -4960,13 +4961,13 @@ class AuroFloatingUI {
4960
4961
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4961
4962
  return;
4962
4963
  }
4963
-
4964
+
4964
4965
  // if fullscreen bib is in fullscreen mode, do not close
4965
4966
  if (this.element.bib.hasAttribute('isfullscreen')) {
4966
4967
  return;
4967
4968
  }
4968
4969
 
4969
- this.hideBib();
4970
+ this.hideBib("keydown");
4970
4971
  }
4971
4972
 
4972
4973
  setupHideHandlers() {
@@ -4991,7 +4992,7 @@ class AuroFloatingUI {
4991
4992
  document.expandedAuroFormkitDropdown = null;
4992
4993
  document.expandedAuroFloater = this;
4993
4994
  } else {
4994
- this.hideBib();
4995
+ this.hideBib("click");
4995
4996
  }
4996
4997
  }
4997
4998
  };
@@ -5004,7 +5005,7 @@ class AuroFloatingUI {
5004
5005
  // if something else is open, let it handle itself
5005
5006
  return;
5006
5007
  }
5007
- this.hideBib();
5008
+ this.hideBib("keydown");
5008
5009
  }
5009
5010
  };
5010
5011
 
@@ -5087,7 +5088,11 @@ class AuroFloatingUI {
5087
5088
  }
5088
5089
  }
5089
5090
 
5090
- hideBib() {
5091
+ /**
5092
+ * Hides the floating UI element.
5093
+ * @param {String} eventType - The event type that triggered the hiding action.
5094
+ */
5095
+ hideBib(eventType = "unknown") {
5091
5096
  if (!this.element.disabled && !this.element.noToggle) {
5092
5097
  this.lockScroll(false);
5093
5098
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5098,7 +5103,7 @@ class AuroFloatingUI {
5098
5103
  if (this.showing) {
5099
5104
  this.cleanupHideHandlers();
5100
5105
  this.showing = false;
5101
- this.dispatchEventDropdownToggle();
5106
+ this.dispatchEventDropdownToggle(eventType);
5102
5107
  }
5103
5108
  }
5104
5109
  document.expandedAuroFloater = null;
@@ -5107,11 +5112,13 @@ class AuroFloatingUI {
5107
5112
  /**
5108
5113
  * @private
5109
5114
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5115
+ * @param {String} eventType - The event type that triggered the toggle action.
5110
5116
  */
5111
- dispatchEventDropdownToggle() {
5117
+ dispatchEventDropdownToggle(eventType) {
5112
5118
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5113
5119
  detail: {
5114
5120
  expanded: this.showing,
5121
+ eventType: eventType || "unknown",
5115
5122
  },
5116
5123
  composed: true
5117
5124
  });
@@ -5121,7 +5128,7 @@ class AuroFloatingUI {
5121
5128
 
5122
5129
  handleClick() {
5123
5130
  if (this.element.isPopoverVisible) {
5124
- this.hideBib();
5131
+ this.hideBib("click");
5125
5132
  } else {
5126
5133
  this.showBib();
5127
5134
  }
@@ -5148,7 +5155,7 @@ class AuroFloatingUI {
5148
5155
 
5149
5156
  event.preventDefault();
5150
5157
  this.handleClick();
5151
- }
5158
+ }
5152
5159
  break;
5153
5160
  case 'mouseenter':
5154
5161
  if (this.element.hoverToggle) {
@@ -5157,7 +5164,7 @@ class AuroFloatingUI {
5157
5164
  break;
5158
5165
  case 'mouseleave':
5159
5166
  if (this.element.hoverToggle) {
5160
- this.hideBib();
5167
+ this.hideBib("mouseleave");
5161
5168
  }
5162
5169
  break;
5163
5170
  case 'focus':
@@ -6545,6 +6552,9 @@ class AuroDropdown extends AuroElement$3 {
6545
6552
 
6546
6553
  this.parentBorder = false;
6547
6554
 
6555
+ /** @private */
6556
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6557
+
6548
6558
  this.privateDefaults();
6549
6559
  }
6550
6560
 
@@ -6978,12 +6988,19 @@ class AuroDropdown extends AuroElement$3 {
6978
6988
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6979
6989
  this.handleTriggerContentSlotChange();
6980
6990
  }
6991
+ }
6981
6992
 
6982
- if (changedProperties.has('isPopoverVisible')) {
6983
- this.updateFocusTrap();
6984
- if (!this.isPopoverVisible && this.hasFocus) {
6985
- this.trigger.focus();
6986
- }
6993
+ /**
6994
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
6995
+ * @private
6996
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
6997
+ */
6998
+ handleDropdownToggle(event) {
6999
+ this.updateFocusTrap();
7000
+ this.isPopoverVisible = event.detail.expanded;
7001
+ const eventType = event.detail.eventType || "unknown";
7002
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
7003
+ this.trigger.focus();
6987
7004
  }
6988
7005
  }
6989
7006
 
@@ -6991,6 +7008,7 @@ class AuroDropdown extends AuroElement$3 {
6991
7008
 
6992
7009
  // Configure the floater to, this will generate the ID for the bib
6993
7010
  this.floater.configure(this, 'auroDropdown');
7011
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6994
7012
 
6995
7013
  /**
6996
7014
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -3020,6 +3020,7 @@ class AuroCounter extends i$2 {
3020
3020
  aria-describedby="counter-description"
3021
3021
  tabindex="${this.disabled ? '-1' : '0'}"
3022
3022
  role="spinbutton"
3023
+ aria-disabled="${this.disabled ? 'true' : 'false'}"
3023
3024
  aria-valuemin="${this.min}"
3024
3025
  aria-valuemax="${this.max}"
3025
3026
  aria-valuenow="${this.value}"
@@ -4748,7 +4749,7 @@ class AuroFloatingUI {
4748
4749
  */
4749
4750
  mirrorSize() {
4750
4751
  // mirror the boxsize from bibSizer
4751
- if (this.element.bibSizer) {
4752
+ if (this.element.bibSizer && this.element.matchWidth) {
4752
4753
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4753
4754
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4754
4755
  if (sizerStyle.width !== '0px') {
@@ -4960,13 +4961,13 @@ class AuroFloatingUI {
4960
4961
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4961
4962
  return;
4962
4963
  }
4963
-
4964
+
4964
4965
  // if fullscreen bib is in fullscreen mode, do not close
4965
4966
  if (this.element.bib.hasAttribute('isfullscreen')) {
4966
4967
  return;
4967
4968
  }
4968
4969
 
4969
- this.hideBib();
4970
+ this.hideBib("keydown");
4970
4971
  }
4971
4972
 
4972
4973
  setupHideHandlers() {
@@ -4991,7 +4992,7 @@ class AuroFloatingUI {
4991
4992
  document.expandedAuroFormkitDropdown = null;
4992
4993
  document.expandedAuroFloater = this;
4993
4994
  } else {
4994
- this.hideBib();
4995
+ this.hideBib("click");
4995
4996
  }
4996
4997
  }
4997
4998
  };
@@ -5004,7 +5005,7 @@ class AuroFloatingUI {
5004
5005
  // if something else is open, let it handle itself
5005
5006
  return;
5006
5007
  }
5007
- this.hideBib();
5008
+ this.hideBib("keydown");
5008
5009
  }
5009
5010
  };
5010
5011
 
@@ -5087,7 +5088,11 @@ class AuroFloatingUI {
5087
5088
  }
5088
5089
  }
5089
5090
 
5090
- hideBib() {
5091
+ /**
5092
+ * Hides the floating UI element.
5093
+ * @param {String} eventType - The event type that triggered the hiding action.
5094
+ */
5095
+ hideBib(eventType = "unknown") {
5091
5096
  if (!this.element.disabled && !this.element.noToggle) {
5092
5097
  this.lockScroll(false);
5093
5098
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5098,7 +5103,7 @@ class AuroFloatingUI {
5098
5103
  if (this.showing) {
5099
5104
  this.cleanupHideHandlers();
5100
5105
  this.showing = false;
5101
- this.dispatchEventDropdownToggle();
5106
+ this.dispatchEventDropdownToggle(eventType);
5102
5107
  }
5103
5108
  }
5104
5109
  document.expandedAuroFloater = null;
@@ -5107,11 +5112,13 @@ class AuroFloatingUI {
5107
5112
  /**
5108
5113
  * @private
5109
5114
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5115
+ * @param {String} eventType - The event type that triggered the toggle action.
5110
5116
  */
5111
- dispatchEventDropdownToggle() {
5117
+ dispatchEventDropdownToggle(eventType) {
5112
5118
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5113
5119
  detail: {
5114
5120
  expanded: this.showing,
5121
+ eventType: eventType || "unknown",
5115
5122
  },
5116
5123
  composed: true
5117
5124
  });
@@ -5121,7 +5128,7 @@ class AuroFloatingUI {
5121
5128
 
5122
5129
  handleClick() {
5123
5130
  if (this.element.isPopoverVisible) {
5124
- this.hideBib();
5131
+ this.hideBib("click");
5125
5132
  } else {
5126
5133
  this.showBib();
5127
5134
  }
@@ -5148,7 +5155,7 @@ class AuroFloatingUI {
5148
5155
 
5149
5156
  event.preventDefault();
5150
5157
  this.handleClick();
5151
- }
5158
+ }
5152
5159
  break;
5153
5160
  case 'mouseenter':
5154
5161
  if (this.element.hoverToggle) {
@@ -5157,7 +5164,7 @@ class AuroFloatingUI {
5157
5164
  break;
5158
5165
  case 'mouseleave':
5159
5166
  if (this.element.hoverToggle) {
5160
- this.hideBib();
5167
+ this.hideBib("mouseleave");
5161
5168
  }
5162
5169
  break;
5163
5170
  case 'focus':
@@ -6545,6 +6552,9 @@ class AuroDropdown extends AuroElement$3 {
6545
6552
 
6546
6553
  this.parentBorder = false;
6547
6554
 
6555
+ /** @private */
6556
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6557
+
6548
6558
  this.privateDefaults();
6549
6559
  }
6550
6560
 
@@ -6978,12 +6988,19 @@ class AuroDropdown extends AuroElement$3 {
6978
6988
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6979
6989
  this.handleTriggerContentSlotChange();
6980
6990
  }
6991
+ }
6981
6992
 
6982
- if (changedProperties.has('isPopoverVisible')) {
6983
- this.updateFocusTrap();
6984
- if (!this.isPopoverVisible && this.hasFocus) {
6985
- this.trigger.focus();
6986
- }
6993
+ /**
6994
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
6995
+ * @private
6996
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
6997
+ */
6998
+ handleDropdownToggle(event) {
6999
+ this.updateFocusTrap();
7000
+ this.isPopoverVisible = event.detail.expanded;
7001
+ const eventType = event.detail.eventType || "unknown";
7002
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
7003
+ this.trigger.focus();
6987
7004
  }
6988
7005
  }
6989
7006
 
@@ -6991,6 +7008,7 @@ class AuroDropdown extends AuroElement$3 {
6991
7008
 
6992
7009
  // Configure the floater to, this will generate the ID for the bib
6993
7010
  this.floater.configure(this, 'auroDropdown');
7011
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6994
7012
 
6995
7013
  /**
6996
7014
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2973,6 +2973,7 @@ class AuroCounter extends LitElement {
2973
2973
  aria-describedby="counter-description"
2974
2974
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2975
  role="spinbutton"
2976
+ aria-disabled="${this.disabled ? 'true' : 'false'}"
2976
2977
  aria-valuemin="${this.min}"
2977
2978
  aria-valuemax="${this.max}"
2978
2979
  aria-valuenow="${this.value}"
@@ -4701,7 +4702,7 @@ class AuroFloatingUI {
4701
4702
  */
4702
4703
  mirrorSize() {
4703
4704
  // mirror the boxsize from bibSizer
4704
- if (this.element.bibSizer) {
4705
+ if (this.element.bibSizer && this.element.matchWidth) {
4705
4706
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4706
4707
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4707
4708
  if (sizerStyle.width !== '0px') {
@@ -4913,13 +4914,13 @@ class AuroFloatingUI {
4913
4914
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4914
4915
  return;
4915
4916
  }
4916
-
4917
+
4917
4918
  // if fullscreen bib is in fullscreen mode, do not close
4918
4919
  if (this.element.bib.hasAttribute('isfullscreen')) {
4919
4920
  return;
4920
4921
  }
4921
4922
 
4922
- this.hideBib();
4923
+ this.hideBib("keydown");
4923
4924
  }
4924
4925
 
4925
4926
  setupHideHandlers() {
@@ -4944,7 +4945,7 @@ class AuroFloatingUI {
4944
4945
  document.expandedAuroFormkitDropdown = null;
4945
4946
  document.expandedAuroFloater = this;
4946
4947
  } else {
4947
- this.hideBib();
4948
+ this.hideBib("click");
4948
4949
  }
4949
4950
  }
4950
4951
  };
@@ -4957,7 +4958,7 @@ class AuroFloatingUI {
4957
4958
  // if something else is open, let it handle itself
4958
4959
  return;
4959
4960
  }
4960
- this.hideBib();
4961
+ this.hideBib("keydown");
4961
4962
  }
4962
4963
  };
4963
4964
 
@@ -5040,7 +5041,11 @@ class AuroFloatingUI {
5040
5041
  }
5041
5042
  }
5042
5043
 
5043
- hideBib() {
5044
+ /**
5045
+ * Hides the floating UI element.
5046
+ * @param {String} eventType - The event type that triggered the hiding action.
5047
+ */
5048
+ hideBib(eventType = "unknown") {
5044
5049
  if (!this.element.disabled && !this.element.noToggle) {
5045
5050
  this.lockScroll(false);
5046
5051
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5051,7 +5056,7 @@ class AuroFloatingUI {
5051
5056
  if (this.showing) {
5052
5057
  this.cleanupHideHandlers();
5053
5058
  this.showing = false;
5054
- this.dispatchEventDropdownToggle();
5059
+ this.dispatchEventDropdownToggle(eventType);
5055
5060
  }
5056
5061
  }
5057
5062
  document.expandedAuroFloater = null;
@@ -5060,11 +5065,13 @@ class AuroFloatingUI {
5060
5065
  /**
5061
5066
  * @private
5062
5067
  * @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.
5063
5069
  */
5064
- dispatchEventDropdownToggle() {
5070
+ dispatchEventDropdownToggle(eventType) {
5065
5071
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5066
5072
  detail: {
5067
5073
  expanded: this.showing,
5074
+ eventType: eventType || "unknown",
5068
5075
  },
5069
5076
  composed: true
5070
5077
  });
@@ -5074,7 +5081,7 @@ class AuroFloatingUI {
5074
5081
 
5075
5082
  handleClick() {
5076
5083
  if (this.element.isPopoverVisible) {
5077
- this.hideBib();
5084
+ this.hideBib("click");
5078
5085
  } else {
5079
5086
  this.showBib();
5080
5087
  }
@@ -5101,7 +5108,7 @@ class AuroFloatingUI {
5101
5108
 
5102
5109
  event.preventDefault();
5103
5110
  this.handleClick();
5104
- }
5111
+ }
5105
5112
  break;
5106
5113
  case 'mouseenter':
5107
5114
  if (this.element.hoverToggle) {
@@ -5110,7 +5117,7 @@ class AuroFloatingUI {
5110
5117
  break;
5111
5118
  case 'mouseleave':
5112
5119
  if (this.element.hoverToggle) {
5113
- this.hideBib();
5120
+ this.hideBib("mouseleave");
5114
5121
  }
5115
5122
  break;
5116
5123
  case 'focus':
@@ -6498,6 +6505,9 @@ class AuroDropdown extends AuroElement$3 {
6498
6505
 
6499
6506
  this.parentBorder = false;
6500
6507
 
6508
+ /** @private */
6509
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6510
+
6501
6511
  this.privateDefaults();
6502
6512
  }
6503
6513
 
@@ -6931,12 +6941,19 @@ class AuroDropdown extends AuroElement$3 {
6931
6941
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6932
6942
  this.handleTriggerContentSlotChange();
6933
6943
  }
6944
+ }
6934
6945
 
6935
- if (changedProperties.has('isPopoverVisible')) {
6936
- this.updateFocusTrap();
6937
- if (!this.isPopoverVisible && this.hasFocus) {
6938
- this.trigger.focus();
6939
- }
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();
6940
6957
  }
6941
6958
  }
6942
6959
 
@@ -6944,6 +6961,7 @@ class AuroDropdown extends AuroElement$3 {
6944
6961
 
6945
6962
  // Configure the floater to, this will generate the ID for the bib
6946
6963
  this.floater.configure(this, 'auroDropdown');
6964
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6947
6965
 
6948
6966
  /**
6949
6967
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2973,6 +2973,7 @@ class AuroCounter extends LitElement {
2973
2973
  aria-describedby="counter-description"
2974
2974
  tabindex="${this.disabled ? '-1' : '0'}"
2975
2975
  role="spinbutton"
2976
+ aria-disabled="${this.disabled ? 'true' : 'false'}"
2976
2977
  aria-valuemin="${this.min}"
2977
2978
  aria-valuemax="${this.max}"
2978
2979
  aria-valuenow="${this.value}"
@@ -4701,7 +4702,7 @@ class AuroFloatingUI {
4701
4702
  */
4702
4703
  mirrorSize() {
4703
4704
  // mirror the boxsize from bibSizer
4704
- if (this.element.bibSizer) {
4705
+ if (this.element.bibSizer && this.element.matchWidth) {
4705
4706
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
4706
4707
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
4707
4708
  if (sizerStyle.width !== '0px') {
@@ -4913,13 +4914,13 @@ class AuroFloatingUI {
4913
4914
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
4914
4915
  return;
4915
4916
  }
4916
-
4917
+
4917
4918
  // if fullscreen bib is in fullscreen mode, do not close
4918
4919
  if (this.element.bib.hasAttribute('isfullscreen')) {
4919
4920
  return;
4920
4921
  }
4921
4922
 
4922
- this.hideBib();
4923
+ this.hideBib("keydown");
4923
4924
  }
4924
4925
 
4925
4926
  setupHideHandlers() {
@@ -4944,7 +4945,7 @@ class AuroFloatingUI {
4944
4945
  document.expandedAuroFormkitDropdown = null;
4945
4946
  document.expandedAuroFloater = this;
4946
4947
  } else {
4947
- this.hideBib();
4948
+ this.hideBib("click");
4948
4949
  }
4949
4950
  }
4950
4951
  };
@@ -4957,7 +4958,7 @@ class AuroFloatingUI {
4957
4958
  // if something else is open, let it handle itself
4958
4959
  return;
4959
4960
  }
4960
- this.hideBib();
4961
+ this.hideBib("keydown");
4961
4962
  }
4962
4963
  };
4963
4964
 
@@ -5040,7 +5041,11 @@ class AuroFloatingUI {
5040
5041
  }
5041
5042
  }
5042
5043
 
5043
- hideBib() {
5044
+ /**
5045
+ * Hides the floating UI element.
5046
+ * @param {String} eventType - The event type that triggered the hiding action.
5047
+ */
5048
+ hideBib(eventType = "unknown") {
5044
5049
  if (!this.element.disabled && !this.element.noToggle) {
5045
5050
  this.lockScroll(false);
5046
5051
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5051,7 +5056,7 @@ class AuroFloatingUI {
5051
5056
  if (this.showing) {
5052
5057
  this.cleanupHideHandlers();
5053
5058
  this.showing = false;
5054
- this.dispatchEventDropdownToggle();
5059
+ this.dispatchEventDropdownToggle(eventType);
5055
5060
  }
5056
5061
  }
5057
5062
  document.expandedAuroFloater = null;
@@ -5060,11 +5065,13 @@ class AuroFloatingUI {
5060
5065
  /**
5061
5066
  * @private
5062
5067
  * @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.
5063
5069
  */
5064
- dispatchEventDropdownToggle() {
5070
+ dispatchEventDropdownToggle(eventType) {
5065
5071
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5066
5072
  detail: {
5067
5073
  expanded: this.showing,
5074
+ eventType: eventType || "unknown",
5068
5075
  },
5069
5076
  composed: true
5070
5077
  });
@@ -5074,7 +5081,7 @@ class AuroFloatingUI {
5074
5081
 
5075
5082
  handleClick() {
5076
5083
  if (this.element.isPopoverVisible) {
5077
- this.hideBib();
5084
+ this.hideBib("click");
5078
5085
  } else {
5079
5086
  this.showBib();
5080
5087
  }
@@ -5101,7 +5108,7 @@ class AuroFloatingUI {
5101
5108
 
5102
5109
  event.preventDefault();
5103
5110
  this.handleClick();
5104
- }
5111
+ }
5105
5112
  break;
5106
5113
  case 'mouseenter':
5107
5114
  if (this.element.hoverToggle) {
@@ -5110,7 +5117,7 @@ class AuroFloatingUI {
5110
5117
  break;
5111
5118
  case 'mouseleave':
5112
5119
  if (this.element.hoverToggle) {
5113
- this.hideBib();
5120
+ this.hideBib("mouseleave");
5114
5121
  }
5115
5122
  break;
5116
5123
  case 'focus':
@@ -6498,6 +6505,9 @@ class AuroDropdown extends AuroElement$3 {
6498
6505
 
6499
6506
  this.parentBorder = false;
6500
6507
 
6508
+ /** @private */
6509
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
6510
+
6501
6511
  this.privateDefaults();
6502
6512
  }
6503
6513
 
@@ -6931,12 +6941,19 @@ class AuroDropdown extends AuroElement$3 {
6931
6941
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
6932
6942
  this.handleTriggerContentSlotChange();
6933
6943
  }
6944
+ }
6934
6945
 
6935
- if (changedProperties.has('isPopoverVisible')) {
6936
- this.updateFocusTrap();
6937
- if (!this.isPopoverVisible && this.hasFocus) {
6938
- this.trigger.focus();
6939
- }
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();
6940
6957
  }
6941
6958
  }
6942
6959
 
@@ -6944,6 +6961,7 @@ class AuroDropdown extends AuroElement$3 {
6944
6961
 
6945
6962
  // Configure the floater to, this will generate the ID for the bib
6946
6963
  this.floater.configure(this, 'auroDropdown');
6964
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
6947
6965
 
6948
6966
  /**
6949
6967
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -55,7 +55,6 @@
55
55
  | [renderHtmlIconCalendar](#renderHtmlIconCalendar) | `(): TemplateResult` | |
56
56
  | [renderHtmlIconError](#renderHtmlIconError) | `(): TemplateResult` | |
57
57
  | [renderHtmlInputs](#renderHtmlInputs) | `(): TemplateResult` | |
58
- | [renderLayoutFromAttributes](#renderLayoutFromAttributes) | `(): TemplateResult` | |
59
58
  | [reset](#reset) | `(): void` | Resets component to initial state. |
60
59
  | [resetLayoutClasses](#resetLayoutClasses) | `(): void` | |
61
60
  | [resetShapeClasses](#resetShapeClasses) | `(): void` | |