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