@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.77 → 0.0.0-pr624.78
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 +3 -60
- package/components/combobox/demo/index.min.js +3 -60
- package/components/combobox/dist/index.js +3 -60
- package/components/combobox/dist/registered.js +3 -60
- package/components/counter/demo/api.min.js +3 -60
- package/components/counter/demo/index.min.js +3 -60
- package/components/counter/dist/index.js +3 -60
- package/components/counter/dist/registered.js +3 -60
- package/components/datepicker/demo/api.min.js +71 -94
- package/components/datepicker/demo/index.min.js +71 -94
- package/components/datepicker/dist/auro-datepicker.d.ts +14 -1
- package/components/datepicker/dist/index.js +71 -94
- package/components/datepicker/dist/registered.js +71 -94
- package/components/dropdown/demo/api.min.js +3 -60
- package/components/dropdown/demo/index.min.js +3 -60
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -7
- package/components/dropdown/dist/index.js +3 -60
- package/components/dropdown/dist/registered.js +3 -60
- package/components/select/demo/api.min.js +3 -60
- package/components/select/demo/index.min.js +3 -60
- package/components/select/dist/index.js +3 -60
- package/components/select/dist/registered.js +3 -60
- package/package.json +1 -1
|
@@ -4573,6 +4573,7 @@ let AuroElement$4 = class AuroElement extends i$2 {
|
|
|
4573
4573
|
// See LICENSE in the project root for license information.
|
|
4574
4574
|
|
|
4575
4575
|
|
|
4576
|
+
|
|
4576
4577
|
/*
|
|
4577
4578
|
* @slot - Default slot for the popover content.
|
|
4578
4579
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -5155,64 +5156,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5155
5156
|
this.hasFocus = false;
|
|
5156
5157
|
}
|
|
5157
5158
|
|
|
5158
|
-
/**
|
|
5159
|
-
* Determines if the element or any children are focusable.
|
|
5160
|
-
* @private
|
|
5161
|
-
* @param {HTMLElement} element - Element to check.
|
|
5162
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
5163
|
-
*/
|
|
5164
|
-
containsFocusableElement(element) {
|
|
5165
|
-
this.showTriggerBorders = true;
|
|
5166
|
-
|
|
5167
|
-
const nodes = [
|
|
5168
|
-
element,
|
|
5169
|
-
...element.children
|
|
5170
|
-
];
|
|
5171
|
-
|
|
5172
|
-
const focusableElements = [
|
|
5173
|
-
'a',
|
|
5174
|
-
'auro-hyperlink',
|
|
5175
|
-
'button',
|
|
5176
|
-
'auro-button',
|
|
5177
|
-
'input',
|
|
5178
|
-
'auro-input',
|
|
5179
|
-
];
|
|
5180
|
-
|
|
5181
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
5182
|
-
|
|
5183
|
-
const result = nodes.some((node) => {
|
|
5184
|
-
const tagName = node.tagName.toLowerCase();
|
|
5185
|
-
|
|
5186
|
-
if (node.tabIndex > -1) {
|
|
5187
|
-
return true;
|
|
5188
|
-
}
|
|
5189
|
-
|
|
5190
|
-
if (focusableElements.includes(tagName)) {
|
|
5191
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
5192
|
-
return true;
|
|
5193
|
-
}
|
|
5194
|
-
if (!node.hasAttribute('disabled')) {
|
|
5195
|
-
return true;
|
|
5196
|
-
}
|
|
5197
|
-
}
|
|
5198
|
-
|
|
5199
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
5200
|
-
return true;
|
|
5201
|
-
}
|
|
5202
|
-
|
|
5203
|
-
return false;
|
|
5204
|
-
});
|
|
5205
|
-
|
|
5206
|
-
if (result) {
|
|
5207
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
5208
|
-
const tagName = node.tagName.toLowerCase();
|
|
5209
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
5210
|
-
});
|
|
5211
|
-
}
|
|
5212
|
-
|
|
5213
|
-
return result;
|
|
5214
|
-
}
|
|
5215
|
-
|
|
5216
5159
|
/**
|
|
5217
5160
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
5218
5161
|
* @private
|
|
@@ -5324,7 +5267,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5324
5267
|
if (triggerContentNodes) {
|
|
5325
5268
|
|
|
5326
5269
|
// See if any of them are focusable elements
|
|
5327
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
5270
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
5328
5271
|
|
|
5329
5272
|
// If any of them are focusable elements
|
|
5330
5273
|
if (this.triggerContentFocusable) {
|
|
@@ -5396,7 +5339,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5396
5339
|
<div
|
|
5397
5340
|
id="trigger"
|
|
5398
5341
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
5399
|
-
tabindex="${this.tabIndex}"
|
|
5342
|
+
tabindex="${o(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
5400
5343
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5401
5344
|
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5402
5345
|
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -4431,6 +4431,7 @@ let AuroElement$4 = class AuroElement extends i$2 {
|
|
|
4431
4431
|
// See LICENSE in the project root for license information.
|
|
4432
4432
|
|
|
4433
4433
|
|
|
4434
|
+
|
|
4434
4435
|
/*
|
|
4435
4436
|
* @slot - Default slot for the popover content.
|
|
4436
4437
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -5013,64 +5014,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5013
5014
|
this.hasFocus = false;
|
|
5014
5015
|
}
|
|
5015
5016
|
|
|
5016
|
-
/**
|
|
5017
|
-
* Determines if the element or any children are focusable.
|
|
5018
|
-
* @private
|
|
5019
|
-
* @param {HTMLElement} element - Element to check.
|
|
5020
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
5021
|
-
*/
|
|
5022
|
-
containsFocusableElement(element) {
|
|
5023
|
-
this.showTriggerBorders = true;
|
|
5024
|
-
|
|
5025
|
-
const nodes = [
|
|
5026
|
-
element,
|
|
5027
|
-
...element.children
|
|
5028
|
-
];
|
|
5029
|
-
|
|
5030
|
-
const focusableElements = [
|
|
5031
|
-
'a',
|
|
5032
|
-
'auro-hyperlink',
|
|
5033
|
-
'button',
|
|
5034
|
-
'auro-button',
|
|
5035
|
-
'input',
|
|
5036
|
-
'auro-input',
|
|
5037
|
-
];
|
|
5038
|
-
|
|
5039
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
5040
|
-
|
|
5041
|
-
const result = nodes.some((node) => {
|
|
5042
|
-
const tagName = node.tagName.toLowerCase();
|
|
5043
|
-
|
|
5044
|
-
if (node.tabIndex > -1) {
|
|
5045
|
-
return true;
|
|
5046
|
-
}
|
|
5047
|
-
|
|
5048
|
-
if (focusableElements.includes(tagName)) {
|
|
5049
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
5050
|
-
return true;
|
|
5051
|
-
}
|
|
5052
|
-
if (!node.hasAttribute('disabled')) {
|
|
5053
|
-
return true;
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
|
-
|
|
5057
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
5058
|
-
return true;
|
|
5059
|
-
}
|
|
5060
|
-
|
|
5061
|
-
return false;
|
|
5062
|
-
});
|
|
5063
|
-
|
|
5064
|
-
if (result) {
|
|
5065
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
5066
|
-
const tagName = node.tagName.toLowerCase();
|
|
5067
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
5068
|
-
});
|
|
5069
|
-
}
|
|
5070
|
-
|
|
5071
|
-
return result;
|
|
5072
|
-
}
|
|
5073
|
-
|
|
5074
5017
|
/**
|
|
5075
5018
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
5076
5019
|
* @private
|
|
@@ -5182,7 +5125,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5182
5125
|
if (triggerContentNodes) {
|
|
5183
5126
|
|
|
5184
5127
|
// See if any of them are focusable elements
|
|
5185
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
5128
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
5186
5129
|
|
|
5187
5130
|
// If any of them are focusable elements
|
|
5188
5131
|
if (this.triggerContentFocusable) {
|
|
@@ -5254,7 +5197,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5254
5197
|
<div
|
|
5255
5198
|
id="trigger"
|
|
5256
5199
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
5257
|
-
tabindex="${this.tabIndex}"
|
|
5200
|
+
tabindex="${o(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
5258
5201
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5259
5202
|
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5260
5203
|
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -4362,6 +4362,7 @@ let AuroElement$4 = class AuroElement extends LitElement {
|
|
|
4362
4362
|
// See LICENSE in the project root for license information.
|
|
4363
4363
|
|
|
4364
4364
|
|
|
4365
|
+
|
|
4365
4366
|
/*
|
|
4366
4367
|
* @slot - Default slot for the popover content.
|
|
4367
4368
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -4944,64 +4945,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4944
4945
|
this.hasFocus = false;
|
|
4945
4946
|
}
|
|
4946
4947
|
|
|
4947
|
-
/**
|
|
4948
|
-
* Determines if the element or any children are focusable.
|
|
4949
|
-
* @private
|
|
4950
|
-
* @param {HTMLElement} element - Element to check.
|
|
4951
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
4952
|
-
*/
|
|
4953
|
-
containsFocusableElement(element) {
|
|
4954
|
-
this.showTriggerBorders = true;
|
|
4955
|
-
|
|
4956
|
-
const nodes = [
|
|
4957
|
-
element,
|
|
4958
|
-
...element.children
|
|
4959
|
-
];
|
|
4960
|
-
|
|
4961
|
-
const focusableElements = [
|
|
4962
|
-
'a',
|
|
4963
|
-
'auro-hyperlink',
|
|
4964
|
-
'button',
|
|
4965
|
-
'auro-button',
|
|
4966
|
-
'input',
|
|
4967
|
-
'auro-input',
|
|
4968
|
-
];
|
|
4969
|
-
|
|
4970
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
4971
|
-
|
|
4972
|
-
const result = nodes.some((node) => {
|
|
4973
|
-
const tagName = node.tagName.toLowerCase();
|
|
4974
|
-
|
|
4975
|
-
if (node.tabIndex > -1) {
|
|
4976
|
-
return true;
|
|
4977
|
-
}
|
|
4978
|
-
|
|
4979
|
-
if (focusableElements.includes(tagName)) {
|
|
4980
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
4981
|
-
return true;
|
|
4982
|
-
}
|
|
4983
|
-
if (!node.hasAttribute('disabled')) {
|
|
4984
|
-
return true;
|
|
4985
|
-
}
|
|
4986
|
-
}
|
|
4987
|
-
|
|
4988
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
4989
|
-
return true;
|
|
4990
|
-
}
|
|
4991
|
-
|
|
4992
|
-
return false;
|
|
4993
|
-
});
|
|
4994
|
-
|
|
4995
|
-
if (result) {
|
|
4996
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
4997
|
-
const tagName = node.tagName.toLowerCase();
|
|
4998
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
4999
|
-
});
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
|
-
return result;
|
|
5003
|
-
}
|
|
5004
|
-
|
|
5005
4948
|
/**
|
|
5006
4949
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
5007
4950
|
* @private
|
|
@@ -5113,7 +5056,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5113
5056
|
if (triggerContentNodes) {
|
|
5114
5057
|
|
|
5115
5058
|
// See if any of them are focusable elements
|
|
5116
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
5059
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
5117
5060
|
|
|
5118
5061
|
// If any of them are focusable elements
|
|
5119
5062
|
if (this.triggerContentFocusable) {
|
|
@@ -5185,7 +5128,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5185
5128
|
<div
|
|
5186
5129
|
id="trigger"
|
|
5187
5130
|
class="${classMap(this.commonWrapperClasses)}" part="wrapper"
|
|
5188
|
-
tabindex="${this.tabIndex}"
|
|
5131
|
+
tabindex="${ifDefined(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
5189
5132
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5190
5133
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5191
5134
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -4362,6 +4362,7 @@ let AuroElement$4 = class AuroElement extends LitElement {
|
|
|
4362
4362
|
// See LICENSE in the project root for license information.
|
|
4363
4363
|
|
|
4364
4364
|
|
|
4365
|
+
|
|
4365
4366
|
/*
|
|
4366
4367
|
* @slot - Default slot for the popover content.
|
|
4367
4368
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -4944,64 +4945,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4944
4945
|
this.hasFocus = false;
|
|
4945
4946
|
}
|
|
4946
4947
|
|
|
4947
|
-
/**
|
|
4948
|
-
* Determines if the element or any children are focusable.
|
|
4949
|
-
* @private
|
|
4950
|
-
* @param {HTMLElement} element - Element to check.
|
|
4951
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
4952
|
-
*/
|
|
4953
|
-
containsFocusableElement(element) {
|
|
4954
|
-
this.showTriggerBorders = true;
|
|
4955
|
-
|
|
4956
|
-
const nodes = [
|
|
4957
|
-
element,
|
|
4958
|
-
...element.children
|
|
4959
|
-
];
|
|
4960
|
-
|
|
4961
|
-
const focusableElements = [
|
|
4962
|
-
'a',
|
|
4963
|
-
'auro-hyperlink',
|
|
4964
|
-
'button',
|
|
4965
|
-
'auro-button',
|
|
4966
|
-
'input',
|
|
4967
|
-
'auro-input',
|
|
4968
|
-
];
|
|
4969
|
-
|
|
4970
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
4971
|
-
|
|
4972
|
-
const result = nodes.some((node) => {
|
|
4973
|
-
const tagName = node.tagName.toLowerCase();
|
|
4974
|
-
|
|
4975
|
-
if (node.tabIndex > -1) {
|
|
4976
|
-
return true;
|
|
4977
|
-
}
|
|
4978
|
-
|
|
4979
|
-
if (focusableElements.includes(tagName)) {
|
|
4980
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
4981
|
-
return true;
|
|
4982
|
-
}
|
|
4983
|
-
if (!node.hasAttribute('disabled')) {
|
|
4984
|
-
return true;
|
|
4985
|
-
}
|
|
4986
|
-
}
|
|
4987
|
-
|
|
4988
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
4989
|
-
return true;
|
|
4990
|
-
}
|
|
4991
|
-
|
|
4992
|
-
return false;
|
|
4993
|
-
});
|
|
4994
|
-
|
|
4995
|
-
if (result) {
|
|
4996
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
4997
|
-
const tagName = node.tagName.toLowerCase();
|
|
4998
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
4999
|
-
});
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
|
-
return result;
|
|
5003
|
-
}
|
|
5004
|
-
|
|
5005
4948
|
/**
|
|
5006
4949
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
5007
4950
|
* @private
|
|
@@ -5113,7 +5056,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5113
5056
|
if (triggerContentNodes) {
|
|
5114
5057
|
|
|
5115
5058
|
// See if any of them are focusable elements
|
|
5116
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
5059
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
5117
5060
|
|
|
5118
5061
|
// If any of them are focusable elements
|
|
5119
5062
|
if (this.triggerContentFocusable) {
|
|
@@ -5185,7 +5128,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5185
5128
|
<div
|
|
5186
5129
|
id="trigger"
|
|
5187
5130
|
class="${classMap(this.commonWrapperClasses)}" part="wrapper"
|
|
5188
|
-
tabindex="${this.tabIndex}"
|
|
5131
|
+
tabindex="${ifDefined(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
5189
5132
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
5190
5133
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5191
5134
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -6584,6 +6584,7 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
6584
6584
|
// See LICENSE in the project root for license information.
|
|
6585
6585
|
|
|
6586
6586
|
|
|
6587
|
+
|
|
6587
6588
|
/*
|
|
6588
6589
|
* @slot - Default slot for the popover content.
|
|
6589
6590
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -7166,64 +7167,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7166
7167
|
this.hasFocus = false;
|
|
7167
7168
|
}
|
|
7168
7169
|
|
|
7169
|
-
/**
|
|
7170
|
-
* Determines if the element or any children are focusable.
|
|
7171
|
-
* @private
|
|
7172
|
-
* @param {HTMLElement} element - Element to check.
|
|
7173
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
7174
|
-
*/
|
|
7175
|
-
containsFocusableElement(element) {
|
|
7176
|
-
this.showTriggerBorders = true;
|
|
7177
|
-
|
|
7178
|
-
const nodes = [
|
|
7179
|
-
element,
|
|
7180
|
-
...element.children
|
|
7181
|
-
];
|
|
7182
|
-
|
|
7183
|
-
const focusableElements = [
|
|
7184
|
-
'a',
|
|
7185
|
-
'auro-hyperlink',
|
|
7186
|
-
'button',
|
|
7187
|
-
'auro-button',
|
|
7188
|
-
'input',
|
|
7189
|
-
'auro-input',
|
|
7190
|
-
];
|
|
7191
|
-
|
|
7192
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
7193
|
-
|
|
7194
|
-
const result = nodes.some((node) => {
|
|
7195
|
-
const tagName = node.tagName.toLowerCase();
|
|
7196
|
-
|
|
7197
|
-
if (node.tabIndex > -1) {
|
|
7198
|
-
return true;
|
|
7199
|
-
}
|
|
7200
|
-
|
|
7201
|
-
if (focusableElements.includes(tagName)) {
|
|
7202
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
7203
|
-
return true;
|
|
7204
|
-
}
|
|
7205
|
-
if (!node.hasAttribute('disabled')) {
|
|
7206
|
-
return true;
|
|
7207
|
-
}
|
|
7208
|
-
}
|
|
7209
|
-
|
|
7210
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
7211
|
-
return true;
|
|
7212
|
-
}
|
|
7213
|
-
|
|
7214
|
-
return false;
|
|
7215
|
-
});
|
|
7216
|
-
|
|
7217
|
-
if (result) {
|
|
7218
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
7219
|
-
const tagName = node.tagName.toLowerCase();
|
|
7220
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
7221
|
-
});
|
|
7222
|
-
}
|
|
7223
|
-
|
|
7224
|
-
return result;
|
|
7225
|
-
}
|
|
7226
|
-
|
|
7227
7170
|
/**
|
|
7228
7171
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
7229
7172
|
* @private
|
|
@@ -7335,7 +7278,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7335
7278
|
if (triggerContentNodes) {
|
|
7336
7279
|
|
|
7337
7280
|
// See if any of them are focusable elements
|
|
7338
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
7281
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
7339
7282
|
|
|
7340
7283
|
// If any of them are focusable elements
|
|
7341
7284
|
if (this.triggerContentFocusable) {
|
|
@@ -7407,7 +7350,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7407
7350
|
<div
|
|
7408
7351
|
id="trigger"
|
|
7409
7352
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
7410
|
-
tabindex="${this.tabIndex}"
|
|
7353
|
+
tabindex="${o(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
7411
7354
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
7412
7355
|
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
7413
7356
|
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -6584,6 +6584,7 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
6584
6584
|
// See LICENSE in the project root for license information.
|
|
6585
6585
|
|
|
6586
6586
|
|
|
6587
|
+
|
|
6587
6588
|
/*
|
|
6588
6589
|
* @slot - Default slot for the popover content.
|
|
6589
6590
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -7166,64 +7167,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7166
7167
|
this.hasFocus = false;
|
|
7167
7168
|
}
|
|
7168
7169
|
|
|
7169
|
-
/**
|
|
7170
|
-
* Determines if the element or any children are focusable.
|
|
7171
|
-
* @private
|
|
7172
|
-
* @param {HTMLElement} element - Element to check.
|
|
7173
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
7174
|
-
*/
|
|
7175
|
-
containsFocusableElement(element) {
|
|
7176
|
-
this.showTriggerBorders = true;
|
|
7177
|
-
|
|
7178
|
-
const nodes = [
|
|
7179
|
-
element,
|
|
7180
|
-
...element.children
|
|
7181
|
-
];
|
|
7182
|
-
|
|
7183
|
-
const focusableElements = [
|
|
7184
|
-
'a',
|
|
7185
|
-
'auro-hyperlink',
|
|
7186
|
-
'button',
|
|
7187
|
-
'auro-button',
|
|
7188
|
-
'input',
|
|
7189
|
-
'auro-input',
|
|
7190
|
-
];
|
|
7191
|
-
|
|
7192
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
7193
|
-
|
|
7194
|
-
const result = nodes.some((node) => {
|
|
7195
|
-
const tagName = node.tagName.toLowerCase();
|
|
7196
|
-
|
|
7197
|
-
if (node.tabIndex > -1) {
|
|
7198
|
-
return true;
|
|
7199
|
-
}
|
|
7200
|
-
|
|
7201
|
-
if (focusableElements.includes(tagName)) {
|
|
7202
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
7203
|
-
return true;
|
|
7204
|
-
}
|
|
7205
|
-
if (!node.hasAttribute('disabled')) {
|
|
7206
|
-
return true;
|
|
7207
|
-
}
|
|
7208
|
-
}
|
|
7209
|
-
|
|
7210
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
7211
|
-
return true;
|
|
7212
|
-
}
|
|
7213
|
-
|
|
7214
|
-
return false;
|
|
7215
|
-
});
|
|
7216
|
-
|
|
7217
|
-
if (result) {
|
|
7218
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
7219
|
-
const tagName = node.tagName.toLowerCase();
|
|
7220
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
7221
|
-
});
|
|
7222
|
-
}
|
|
7223
|
-
|
|
7224
|
-
return result;
|
|
7225
|
-
}
|
|
7226
|
-
|
|
7227
7170
|
/**
|
|
7228
7171
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
7229
7172
|
* @private
|
|
@@ -7335,7 +7278,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7335
7278
|
if (triggerContentNodes) {
|
|
7336
7279
|
|
|
7337
7280
|
// See if any of them are focusable elements
|
|
7338
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
7281
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
7339
7282
|
|
|
7340
7283
|
// If any of them are focusable elements
|
|
7341
7284
|
if (this.triggerContentFocusable) {
|
|
@@ -7407,7 +7350,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7407
7350
|
<div
|
|
7408
7351
|
id="trigger"
|
|
7409
7352
|
class="${e(this.commonWrapperClasses)}" part="wrapper"
|
|
7410
|
-
tabindex="${this.tabIndex}"
|
|
7353
|
+
tabindex="${o(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
7411
7354
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
7412
7355
|
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
7413
7356
|
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
@@ -6537,6 +6537,7 @@ let AuroElement$3 = class AuroElement extends LitElement {
|
|
|
6537
6537
|
// See LICENSE in the project root for license information.
|
|
6538
6538
|
|
|
6539
6539
|
|
|
6540
|
+
|
|
6540
6541
|
/*
|
|
6541
6542
|
* @slot - Default slot for the popover content.
|
|
6542
6543
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -7119,64 +7120,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7119
7120
|
this.hasFocus = false;
|
|
7120
7121
|
}
|
|
7121
7122
|
|
|
7122
|
-
/**
|
|
7123
|
-
* Determines if the element or any children are focusable.
|
|
7124
|
-
* @private
|
|
7125
|
-
* @param {HTMLElement} element - Element to check.
|
|
7126
|
-
* @returns {Boolean} - True if the element or any children are focusable.
|
|
7127
|
-
*/
|
|
7128
|
-
containsFocusableElement(element) {
|
|
7129
|
-
this.showTriggerBorders = true;
|
|
7130
|
-
|
|
7131
|
-
const nodes = [
|
|
7132
|
-
element,
|
|
7133
|
-
...element.children
|
|
7134
|
-
];
|
|
7135
|
-
|
|
7136
|
-
const focusableElements = [
|
|
7137
|
-
'a',
|
|
7138
|
-
'auro-hyperlink',
|
|
7139
|
-
'button',
|
|
7140
|
-
'auro-button',
|
|
7141
|
-
'input',
|
|
7142
|
-
'auro-input',
|
|
7143
|
-
];
|
|
7144
|
-
|
|
7145
|
-
const focusableElementsThatNeedBorders = ['auro-input'];
|
|
7146
|
-
|
|
7147
|
-
const result = nodes.some((node) => {
|
|
7148
|
-
const tagName = node.tagName.toLowerCase();
|
|
7149
|
-
|
|
7150
|
-
if (node.tabIndex > -1) {
|
|
7151
|
-
return true;
|
|
7152
|
-
}
|
|
7153
|
-
|
|
7154
|
-
if (focusableElements.includes(tagName)) {
|
|
7155
|
-
if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
|
|
7156
|
-
return true;
|
|
7157
|
-
}
|
|
7158
|
-
if (!node.hasAttribute('disabled')) {
|
|
7159
|
-
return true;
|
|
7160
|
-
}
|
|
7161
|
-
}
|
|
7162
|
-
|
|
7163
|
-
if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
|
|
7164
|
-
return true;
|
|
7165
|
-
}
|
|
7166
|
-
|
|
7167
|
-
return false;
|
|
7168
|
-
});
|
|
7169
|
-
|
|
7170
|
-
if (result) {
|
|
7171
|
-
this.showTriggerBorders = !nodes.some((node) => {
|
|
7172
|
-
const tagName = node.tagName.toLowerCase();
|
|
7173
|
-
return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
|
|
7174
|
-
});
|
|
7175
|
-
}
|
|
7176
|
-
|
|
7177
|
-
return result;
|
|
7178
|
-
}
|
|
7179
|
-
|
|
7180
7123
|
/**
|
|
7181
7124
|
* Creates and dispatches a duplicate focus event on the trigger element.
|
|
7182
7125
|
* @private
|
|
@@ -7288,7 +7231,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7288
7231
|
if (triggerContentNodes) {
|
|
7289
7232
|
|
|
7290
7233
|
// See if any of them are focusable elements
|
|
7291
|
-
this.triggerContentFocusable = triggerContentNodes.some((node) =>
|
|
7234
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
|
|
7292
7235
|
|
|
7293
7236
|
// If any of them are focusable elements
|
|
7294
7237
|
if (this.triggerContentFocusable) {
|
|
@@ -7360,7 +7303,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7360
7303
|
<div
|
|
7361
7304
|
id="trigger"
|
|
7362
7305
|
class="${classMap(this.commonWrapperClasses)}" part="wrapper"
|
|
7363
|
-
tabindex="${this.tabIndex}"
|
|
7306
|
+
tabindex="${ifDefined(this.triggerContentFocusable ? undefined : this.tabIndex)}"
|
|
7364
7307
|
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
7365
7308
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
7366
7309
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|