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