@aurodesignsystem/auro-formkit 3.1.0-beta.1 → 3.2.0-beta.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/CHANGELOG.md +19 -1
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.min.js +468 -25
- package/components/checkbox/demo/index.min.js +468 -25
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/index.js +468 -25
- package/components/checkbox/dist/registered.js +468 -25
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.min.js +1125 -74
- package/components/combobox/demo/index.min.js +1125 -74
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +30 -0
- package/components/combobox/dist/index.js +1125 -74
- package/components/combobox/dist/registered.js +1125 -74
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.min.js +570 -45
- package/components/counter/demo/index.min.js +570 -45
- package/components/counter/demo/readme.md +1 -1
- package/components/counter/dist/index.js +570 -45
- package/components/counter/dist/registered.js +570 -45
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.min.js +1073 -70
- package/components/datepicker/demo/index.min.js +1073 -70
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/index.js +1073 -70
- package/components/datepicker/dist/registered.js +1073 -70
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/api.md +8 -5
- package/components/dropdown/demo/api.min.js +104 -22
- package/components/dropdown/demo/index.min.js +104 -22
- package/components/dropdown/demo/readme.md +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +29 -0
- package/components/dropdown/dist/index.js +104 -22
- package/components/dropdown/dist/registered.js +104 -22
- package/components/form/README.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/input/README.md +1 -1
- package/components/input/demo/api.md +4 -1
- package/components/input/demo/api.min.js +503 -25
- package/components/input/demo/index.min.js +503 -25
- package/components/input/demo/readme.md +1 -1
- package/components/input/dist/base-input.d.ts +24 -0
- package/components/input/dist/index.js +503 -25
- package/components/input/dist/registered.js +503 -25
- package/components/menu/README.md +1 -1
- package/components/menu/demo/readme.md +1 -1
- package/components/radio/README.md +1 -1
- package/components/radio/demo/api.min.js +468 -25
- package/components/radio/demo/index.min.js +468 -25
- package/components/radio/demo/readme.md +1 -1
- package/components/radio/dist/index.js +468 -25
- package/components/radio/dist/registered.js +468 -25
- package/components/select/README.md +1 -1
- package/components/select/demo/api.min.js +570 -45
- package/components/select/demo/index.min.js +570 -45
- package/components/select/demo/readme.md +1 -1
- package/components/select/dist/index.js +570 -45
- package/components/select/dist/registered.js +570 -45
- package/package.json +2 -2
|
@@ -1846,7 +1846,7 @@ class AuroFloatingUI {
|
|
|
1846
1846
|
/**
|
|
1847
1847
|
* @private
|
|
1848
1848
|
* getting called on 'blur' in trigger or `focusin` in document
|
|
1849
|
-
*
|
|
1849
|
+
*
|
|
1850
1850
|
* Hides the bib if focus moves outside of the trigger or bib, unless a 'noHideOnThisFocusLoss' flag is set.
|
|
1851
1851
|
* This method checks if the currently active element is still within the trigger or bib.
|
|
1852
1852
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
@@ -1962,7 +1962,7 @@ class AuroFloatingUI {
|
|
|
1962
1962
|
// Close any other dropdown that is already open
|
|
1963
1963
|
const existedVisibleFloatingUI = document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
1964
1964
|
if (existedVisibleFloatingUI && existedVisibleFloatingUI !== this &&
|
|
1965
|
-
existedVisibleFloatingUI.isPopoverVisible &&
|
|
1965
|
+
existedVisibleFloatingUI.element.isPopoverVisible &&
|
|
1966
1966
|
document.expandedAuroFloater.eventPrefix === this.eventPrefix) {
|
|
1967
1967
|
document.expandedAuroFloater.hideBib();
|
|
1968
1968
|
}
|
|
@@ -2138,7 +2138,7 @@ class AuroFloatingUI {
|
|
|
2138
2138
|
this.id = window.crypto.randomUUID();
|
|
2139
2139
|
this.element.setAttribute('id', this.id);
|
|
2140
2140
|
}
|
|
2141
|
-
|
|
2141
|
+
|
|
2142
2142
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
2143
2143
|
}
|
|
2144
2144
|
|
|
@@ -2191,7 +2191,7 @@ class AuroFloatingUI {
|
|
|
2191
2191
|
if (this.element.bib) {
|
|
2192
2192
|
this.element.shadowRoot.append(this.element.bib);
|
|
2193
2193
|
}
|
|
2194
|
-
|
|
2194
|
+
|
|
2195
2195
|
// Remove event & keyboard listeners
|
|
2196
2196
|
if (this.element?.trigger) {
|
|
2197
2197
|
this.element.trigger.removeEventListener('keydown', this.handleEvent);
|
|
@@ -2922,6 +2922,7 @@ var helpTextVersion = '1.0.0';
|
|
|
2922
2922
|
* @csspart helpText - The helpText content container.
|
|
2923
2923
|
* @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
|
|
2924
2924
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
2925
|
+
* @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
|
|
2925
2926
|
*/
|
|
2926
2927
|
class AuroDropdown extends LitElement {
|
|
2927
2928
|
constructor() {
|
|
@@ -2967,7 +2968,9 @@ class AuroDropdown extends LitElement {
|
|
|
2967
2968
|
this.rounded = false;
|
|
2968
2969
|
this.tabIndex = 0;
|
|
2969
2970
|
this.noToggle = false;
|
|
2971
|
+
this.a11yAutocomplete = 'none';
|
|
2970
2972
|
this.labeled = true;
|
|
2973
|
+
this.a11yRole = 'combobox';
|
|
2971
2974
|
this.onDark = false;
|
|
2972
2975
|
|
|
2973
2976
|
// floaterConfig
|
|
@@ -3103,6 +3106,16 @@ class AuroDropdown extends LitElement {
|
|
|
3103
3106
|
type: Number
|
|
3104
3107
|
},
|
|
3105
3108
|
|
|
3109
|
+
/**
|
|
3110
|
+
* The unique ID for the dropdown bib element.
|
|
3111
|
+
* @private
|
|
3112
|
+
*/
|
|
3113
|
+
dropdownId: {
|
|
3114
|
+
type: String,
|
|
3115
|
+
reflect: false,
|
|
3116
|
+
attribute: false
|
|
3117
|
+
},
|
|
3118
|
+
|
|
3106
3119
|
/**
|
|
3107
3120
|
* If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
3108
3121
|
*/
|
|
@@ -3270,6 +3283,23 @@ class AuroDropdown extends LitElement {
|
|
|
3270
3283
|
*/
|
|
3271
3284
|
tabIndex: {
|
|
3272
3285
|
type: Number
|
|
3286
|
+
},
|
|
3287
|
+
|
|
3288
|
+
/**
|
|
3289
|
+
* The value for the role attribute of the trigger element.
|
|
3290
|
+
*/
|
|
3291
|
+
a11yRole: {
|
|
3292
|
+
type: String || undefined,
|
|
3293
|
+
attribute: false,
|
|
3294
|
+
reflect: false
|
|
3295
|
+
},
|
|
3296
|
+
|
|
3297
|
+
/**
|
|
3298
|
+
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3299
|
+
*/
|
|
3300
|
+
a11yAutocomplete: {
|
|
3301
|
+
type: String,
|
|
3302
|
+
attribute: false,
|
|
3273
3303
|
}
|
|
3274
3304
|
};
|
|
3275
3305
|
}
|
|
@@ -3331,7 +3361,22 @@ class AuroDropdown extends LitElement {
|
|
|
3331
3361
|
}
|
|
3332
3362
|
|
|
3333
3363
|
firstUpdated() {
|
|
3364
|
+
|
|
3365
|
+
// Configure the floater to, this will generate the ID for the bib
|
|
3334
3366
|
this.floater.configure(this, 'auroDropdown');
|
|
3367
|
+
|
|
3368
|
+
/**
|
|
3369
|
+
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
3370
|
+
* @event auroDropdown-idAdded
|
|
3371
|
+
* @type {Object<key: 'id', value: string>} - The ID of the dropdown bib element.
|
|
3372
|
+
*/
|
|
3373
|
+
this.dispatchEvent(new CustomEvent('auroDropdown-idAdded', {detail: {id: this.floater.element.id}}));
|
|
3374
|
+
|
|
3375
|
+
// Set the bib ID locally if the user hasn't provided a focusable trigger
|
|
3376
|
+
if (!this.triggerContentFocusable) {
|
|
3377
|
+
this.dropdownId = this.floater.element.id;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3335
3380
|
this.bibContent = this.floater.element.bib;
|
|
3336
3381
|
|
|
3337
3382
|
// Add the tag name as an attribute if it is different than the component name
|
|
@@ -3483,6 +3528,30 @@ class AuroDropdown extends LitElement {
|
|
|
3483
3528
|
});
|
|
3484
3529
|
}
|
|
3485
3530
|
|
|
3531
|
+
/*
|
|
3532
|
+
* Sets aria attributes for the trigger element if a custom one is passed in.
|
|
3533
|
+
* @private
|
|
3534
|
+
* @method setTriggerAriaAttributes
|
|
3535
|
+
* @param { HTMLElement } triggerElement - The custom trigger element.
|
|
3536
|
+
*/
|
|
3537
|
+
clearTriggerA11yAttributes(triggerElement) {
|
|
3538
|
+
|
|
3539
|
+
if (!triggerElement || !triggerElement.removeAttribute) {
|
|
3540
|
+
return;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
// Reset appropriate attributes for a11y
|
|
3544
|
+
triggerElement.removeAttribute('aria-labelledby');
|
|
3545
|
+
if (triggerElement.getAttribute('id') === `${this.id}-trigger-element`) {
|
|
3546
|
+
triggerElement.removeAttribute('id');
|
|
3547
|
+
}
|
|
3548
|
+
triggerElement.removeAttribute('role');
|
|
3549
|
+
triggerElement.removeAttribute('aria-expanded');
|
|
3550
|
+
|
|
3551
|
+
triggerElement.removeAttribute('aria-controls');
|
|
3552
|
+
triggerElement.removeAttribute('aria-autocomplete');
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3486
3555
|
/**
|
|
3487
3556
|
* Handles changes to the trigger content slot and updates related properties.
|
|
3488
3557
|
*
|
|
@@ -3496,32 +3565,41 @@ class AuroDropdown extends LitElement {
|
|
|
3496
3565
|
* @returns {void}
|
|
3497
3566
|
*/
|
|
3498
3567
|
handleTriggerContentSlotChange(event) {
|
|
3568
|
+
|
|
3499
3569
|
this.floater.handleTriggerTabIndex();
|
|
3500
3570
|
|
|
3571
|
+
// Get the trigger
|
|
3572
|
+
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3573
|
+
|
|
3574
|
+
// Get the trigger slot
|
|
3501
3575
|
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3502
3576
|
|
|
3577
|
+
// If there's a trigger slot
|
|
3503
3578
|
if (triggerSlot) {
|
|
3504
3579
|
|
|
3580
|
+
// Get the content nodes to see if there are any children
|
|
3505
3581
|
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3506
3582
|
|
|
3583
|
+
// If there are children
|
|
3507
3584
|
if (triggerContentNodes) {
|
|
3508
3585
|
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3512
|
-
}
|
|
3513
|
-
});
|
|
3514
|
-
}
|
|
3515
|
-
}
|
|
3586
|
+
// See if any of them are focusable elemeents
|
|
3587
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => this.containsFocusableElement(node));
|
|
3516
3588
|
|
|
3517
|
-
|
|
3589
|
+
// If any of them are focusable elements
|
|
3590
|
+
if (this.triggerContentFocusable) {
|
|
3518
3591
|
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3592
|
+
// Assume the consumer will be providing their own a11y in whatever they passed in
|
|
3593
|
+
this.clearTriggerA11yAttributes(trigger);
|
|
3594
|
+
|
|
3595
|
+
// Remove the tabindex from the trigger so it doesn't interrupt focus flow
|
|
3596
|
+
trigger.removeAttribute('tabindex');
|
|
3597
|
+
} else {
|
|
3598
|
+
|
|
3599
|
+
// Add the tabindex to the trigger so that it's in the focus flow
|
|
3600
|
+
trigger.setAttribute('tabindex', '0');
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3525
3603
|
}
|
|
3526
3604
|
|
|
3527
3605
|
if (event) {
|
|
@@ -3531,6 +3609,7 @@ class AuroDropdown extends LitElement {
|
|
|
3531
3609
|
|
|
3532
3610
|
if (this.triggerContentSlot) {
|
|
3533
3611
|
this.setupTriggerFocusEventBinding();
|
|
3612
|
+
|
|
3534
3613
|
this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
|
|
3535
3614
|
if (slot.textContent.trim()) {
|
|
3536
3615
|
return true;
|
|
@@ -3598,10 +3677,13 @@ class AuroDropdown extends LitElement {
|
|
|
3598
3677
|
id="trigger"
|
|
3599
3678
|
class="trigger"
|
|
3600
3679
|
part="trigger"
|
|
3601
|
-
aria-labelledby="triggerLabel"
|
|
3602
3680
|
tabindex="${this.tabIndex}"
|
|
3603
3681
|
?showBorder="${this.showTriggerBorders}"
|
|
3604
|
-
|
|
3682
|
+
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
3683
|
+
aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
3684
|
+
aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
3685
|
+
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
3686
|
+
>
|
|
3605
3687
|
<div class="triggerContentWrapper">
|
|
3606
3688
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3607
3689
|
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
@@ -3635,12 +3717,12 @@ class AuroDropdown extends LitElement {
|
|
|
3635
3717
|
<div id="bibSizer" part="size"></div>
|
|
3636
3718
|
<${this.dropdownBibTag}
|
|
3637
3719
|
id="bib"
|
|
3638
|
-
role="tooltip"
|
|
3639
3720
|
?data-show="${this.isPopoverVisible}"
|
|
3640
3721
|
?isfullscreen="${this.isBibFullscreen}"
|
|
3641
3722
|
?common="${this.common}"
|
|
3642
3723
|
?rounded="${this.common || this.rounded}"
|
|
3643
|
-
?inset="${this.common || this.inset}"
|
|
3724
|
+
?inset="${this.common || this.inset}"
|
|
3725
|
+
>
|
|
3644
3726
|
</${this.dropdownBibTag}>
|
|
3645
3727
|
</div>
|
|
3646
3728
|
`;
|
|
@@ -1846,7 +1846,7 @@ class AuroFloatingUI {
|
|
|
1846
1846
|
/**
|
|
1847
1847
|
* @private
|
|
1848
1848
|
* getting called on 'blur' in trigger or `focusin` in document
|
|
1849
|
-
*
|
|
1849
|
+
*
|
|
1850
1850
|
* Hides the bib if focus moves outside of the trigger or bib, unless a 'noHideOnThisFocusLoss' flag is set.
|
|
1851
1851
|
* This method checks if the currently active element is still within the trigger or bib.
|
|
1852
1852
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
@@ -1962,7 +1962,7 @@ class AuroFloatingUI {
|
|
|
1962
1962
|
// Close any other dropdown that is already open
|
|
1963
1963
|
const existedVisibleFloatingUI = document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
1964
1964
|
if (existedVisibleFloatingUI && existedVisibleFloatingUI !== this &&
|
|
1965
|
-
existedVisibleFloatingUI.isPopoverVisible &&
|
|
1965
|
+
existedVisibleFloatingUI.element.isPopoverVisible &&
|
|
1966
1966
|
document.expandedAuroFloater.eventPrefix === this.eventPrefix) {
|
|
1967
1967
|
document.expandedAuroFloater.hideBib();
|
|
1968
1968
|
}
|
|
@@ -2138,7 +2138,7 @@ class AuroFloatingUI {
|
|
|
2138
2138
|
this.id = window.crypto.randomUUID();
|
|
2139
2139
|
this.element.setAttribute('id', this.id);
|
|
2140
2140
|
}
|
|
2141
|
-
|
|
2141
|
+
|
|
2142
2142
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
2143
2143
|
}
|
|
2144
2144
|
|
|
@@ -2191,7 +2191,7 @@ class AuroFloatingUI {
|
|
|
2191
2191
|
if (this.element.bib) {
|
|
2192
2192
|
this.element.shadowRoot.append(this.element.bib);
|
|
2193
2193
|
}
|
|
2194
|
-
|
|
2194
|
+
|
|
2195
2195
|
// Remove event & keyboard listeners
|
|
2196
2196
|
if (this.element?.trigger) {
|
|
2197
2197
|
this.element.trigger.removeEventListener('keydown', this.handleEvent);
|
|
@@ -2922,6 +2922,7 @@ var helpTextVersion = '1.0.0';
|
|
|
2922
2922
|
* @csspart helpText - The helpText content container.
|
|
2923
2923
|
* @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
|
|
2924
2924
|
* @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
|
|
2925
|
+
* @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
|
|
2925
2926
|
*/
|
|
2926
2927
|
class AuroDropdown extends LitElement {
|
|
2927
2928
|
constructor() {
|
|
@@ -2967,7 +2968,9 @@ class AuroDropdown extends LitElement {
|
|
|
2967
2968
|
this.rounded = false;
|
|
2968
2969
|
this.tabIndex = 0;
|
|
2969
2970
|
this.noToggle = false;
|
|
2971
|
+
this.a11yAutocomplete = 'none';
|
|
2970
2972
|
this.labeled = true;
|
|
2973
|
+
this.a11yRole = 'combobox';
|
|
2971
2974
|
this.onDark = false;
|
|
2972
2975
|
|
|
2973
2976
|
// floaterConfig
|
|
@@ -3103,6 +3106,16 @@ class AuroDropdown extends LitElement {
|
|
|
3103
3106
|
type: Number
|
|
3104
3107
|
},
|
|
3105
3108
|
|
|
3109
|
+
/**
|
|
3110
|
+
* The unique ID for the dropdown bib element.
|
|
3111
|
+
* @private
|
|
3112
|
+
*/
|
|
3113
|
+
dropdownId: {
|
|
3114
|
+
type: String,
|
|
3115
|
+
reflect: false,
|
|
3116
|
+
attribute: false
|
|
3117
|
+
},
|
|
3118
|
+
|
|
3106
3119
|
/**
|
|
3107
3120
|
* If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
3108
3121
|
*/
|
|
@@ -3270,6 +3283,23 @@ class AuroDropdown extends LitElement {
|
|
|
3270
3283
|
*/
|
|
3271
3284
|
tabIndex: {
|
|
3272
3285
|
type: Number
|
|
3286
|
+
},
|
|
3287
|
+
|
|
3288
|
+
/**
|
|
3289
|
+
* The value for the role attribute of the trigger element.
|
|
3290
|
+
*/
|
|
3291
|
+
a11yRole: {
|
|
3292
|
+
type: String || undefined,
|
|
3293
|
+
attribute: false,
|
|
3294
|
+
reflect: false
|
|
3295
|
+
},
|
|
3296
|
+
|
|
3297
|
+
/**
|
|
3298
|
+
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3299
|
+
*/
|
|
3300
|
+
a11yAutocomplete: {
|
|
3301
|
+
type: String,
|
|
3302
|
+
attribute: false,
|
|
3273
3303
|
}
|
|
3274
3304
|
};
|
|
3275
3305
|
}
|
|
@@ -3331,7 +3361,22 @@ class AuroDropdown extends LitElement {
|
|
|
3331
3361
|
}
|
|
3332
3362
|
|
|
3333
3363
|
firstUpdated() {
|
|
3364
|
+
|
|
3365
|
+
// Configure the floater to, this will generate the ID for the bib
|
|
3334
3366
|
this.floater.configure(this, 'auroDropdown');
|
|
3367
|
+
|
|
3368
|
+
/**
|
|
3369
|
+
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
3370
|
+
* @event auroDropdown-idAdded
|
|
3371
|
+
* @type {Object<key: 'id', value: string>} - The ID of the dropdown bib element.
|
|
3372
|
+
*/
|
|
3373
|
+
this.dispatchEvent(new CustomEvent('auroDropdown-idAdded', {detail: {id: this.floater.element.id}}));
|
|
3374
|
+
|
|
3375
|
+
// Set the bib ID locally if the user hasn't provided a focusable trigger
|
|
3376
|
+
if (!this.triggerContentFocusable) {
|
|
3377
|
+
this.dropdownId = this.floater.element.id;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3335
3380
|
this.bibContent = this.floater.element.bib;
|
|
3336
3381
|
|
|
3337
3382
|
// Add the tag name as an attribute if it is different than the component name
|
|
@@ -3483,6 +3528,30 @@ class AuroDropdown extends LitElement {
|
|
|
3483
3528
|
});
|
|
3484
3529
|
}
|
|
3485
3530
|
|
|
3531
|
+
/*
|
|
3532
|
+
* Sets aria attributes for the trigger element if a custom one is passed in.
|
|
3533
|
+
* @private
|
|
3534
|
+
* @method setTriggerAriaAttributes
|
|
3535
|
+
* @param { HTMLElement } triggerElement - The custom trigger element.
|
|
3536
|
+
*/
|
|
3537
|
+
clearTriggerA11yAttributes(triggerElement) {
|
|
3538
|
+
|
|
3539
|
+
if (!triggerElement || !triggerElement.removeAttribute) {
|
|
3540
|
+
return;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
// Reset appropriate attributes for a11y
|
|
3544
|
+
triggerElement.removeAttribute('aria-labelledby');
|
|
3545
|
+
if (triggerElement.getAttribute('id') === `${this.id}-trigger-element`) {
|
|
3546
|
+
triggerElement.removeAttribute('id');
|
|
3547
|
+
}
|
|
3548
|
+
triggerElement.removeAttribute('role');
|
|
3549
|
+
triggerElement.removeAttribute('aria-expanded');
|
|
3550
|
+
|
|
3551
|
+
triggerElement.removeAttribute('aria-controls');
|
|
3552
|
+
triggerElement.removeAttribute('aria-autocomplete');
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3486
3555
|
/**
|
|
3487
3556
|
* Handles changes to the trigger content slot and updates related properties.
|
|
3488
3557
|
*
|
|
@@ -3496,32 +3565,41 @@ class AuroDropdown extends LitElement {
|
|
|
3496
3565
|
* @returns {void}
|
|
3497
3566
|
*/
|
|
3498
3567
|
handleTriggerContentSlotChange(event) {
|
|
3568
|
+
|
|
3499
3569
|
this.floater.handleTriggerTabIndex();
|
|
3500
3570
|
|
|
3571
|
+
// Get the trigger
|
|
3572
|
+
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3573
|
+
|
|
3574
|
+
// Get the trigger slot
|
|
3501
3575
|
const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
|
|
3502
3576
|
|
|
3577
|
+
// If there's a trigger slot
|
|
3503
3578
|
if (triggerSlot) {
|
|
3504
3579
|
|
|
3580
|
+
// Get the content nodes to see if there are any children
|
|
3505
3581
|
const triggerContentNodes = triggerSlot.assignedNodes();
|
|
3506
3582
|
|
|
3583
|
+
// If there are children
|
|
3507
3584
|
if (triggerContentNodes) {
|
|
3508
3585
|
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
this.triggerContentFocusable = this.containsFocusableElement(node);
|
|
3512
|
-
}
|
|
3513
|
-
});
|
|
3514
|
-
}
|
|
3515
|
-
}
|
|
3586
|
+
// See if any of them are focusable elemeents
|
|
3587
|
+
this.triggerContentFocusable = triggerContentNodes.some((node) => this.containsFocusableElement(node));
|
|
3516
3588
|
|
|
3517
|
-
|
|
3589
|
+
// If any of them are focusable elements
|
|
3590
|
+
if (this.triggerContentFocusable) {
|
|
3518
3591
|
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3592
|
+
// Assume the consumer will be providing their own a11y in whatever they passed in
|
|
3593
|
+
this.clearTriggerA11yAttributes(trigger);
|
|
3594
|
+
|
|
3595
|
+
// Remove the tabindex from the trigger so it doesn't interrupt focus flow
|
|
3596
|
+
trigger.removeAttribute('tabindex');
|
|
3597
|
+
} else {
|
|
3598
|
+
|
|
3599
|
+
// Add the tabindex to the trigger so that it's in the focus flow
|
|
3600
|
+
trigger.setAttribute('tabindex', '0');
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3525
3603
|
}
|
|
3526
3604
|
|
|
3527
3605
|
if (event) {
|
|
@@ -3531,6 +3609,7 @@ class AuroDropdown extends LitElement {
|
|
|
3531
3609
|
|
|
3532
3610
|
if (this.triggerContentSlot) {
|
|
3533
3611
|
this.setupTriggerFocusEventBinding();
|
|
3612
|
+
|
|
3534
3613
|
this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
|
|
3535
3614
|
if (slot.textContent.trim()) {
|
|
3536
3615
|
return true;
|
|
@@ -3598,10 +3677,13 @@ class AuroDropdown extends LitElement {
|
|
|
3598
3677
|
id="trigger"
|
|
3599
3678
|
class="trigger"
|
|
3600
3679
|
part="trigger"
|
|
3601
|
-
aria-labelledby="triggerLabel"
|
|
3602
3680
|
tabindex="${this.tabIndex}"
|
|
3603
3681
|
?showBorder="${this.showTriggerBorders}"
|
|
3604
|
-
|
|
3682
|
+
role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
3683
|
+
aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
3684
|
+
aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
3685
|
+
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
3686
|
+
>
|
|
3605
3687
|
<div class="triggerContentWrapper">
|
|
3606
3688
|
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3607
3689
|
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
@@ -3635,12 +3717,12 @@ class AuroDropdown extends LitElement {
|
|
|
3635
3717
|
<div id="bibSizer" part="size"></div>
|
|
3636
3718
|
<${this.dropdownBibTag}
|
|
3637
3719
|
id="bib"
|
|
3638
|
-
role="tooltip"
|
|
3639
3720
|
?data-show="${this.isPopoverVisible}"
|
|
3640
3721
|
?isfullscreen="${this.isBibFullscreen}"
|
|
3641
3722
|
?common="${this.common}"
|
|
3642
3723
|
?rounded="${this.common || this.rounded}"
|
|
3643
|
-
?inset="${this.common || this.inset}"
|
|
3724
|
+
?inset="${this.common || this.inset}"
|
|
3725
|
+
>
|
|
3644
3726
|
</${this.dropdownBibTag}>
|
|
3645
3727
|
</div>
|
|
3646
3728
|
`;
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -15,7 +15,10 @@ Generate unique names for dependency components.
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
17
17
|
| Property | Attribute | Type | Default | Description |
|
|
18
|
-
|-----------------------------------|-----------------------------------|-----------|-------------|--------------------------------------------------|
|
|
18
|
+
|-----------------------------------|-----------------------------------|-----------|-------------|--------------------------------------------------|
|
|
19
|
+
| `a11yControls` | `a11yControls` | `string` | | The value for the aria-controls attribute. |
|
|
20
|
+
| `a11yExpanded` | `a11yExpanded` | `boolean` | | The value for the aria-expanded attribute. |
|
|
21
|
+
| `a11yRole` | `a11yRole` | `string` | | The value for the role attribute. |
|
|
19
22
|
| [activeLabel](#activeLabel) | `activeLabel` | `boolean` | false | If set, the label will remain fixed in the active position. |
|
|
20
23
|
| [autocapitalize](#autocapitalize) | `autocapitalize` | `string` | | An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]. |
|
|
21
24
|
| [autocomplete](#autocomplete) | `autocomplete` | `string` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
|