@aurodesignsystem/auro-formkit 3.2.0-beta.1 → 3.2.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 +5 -3
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/readme.md +1 -1
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.md +1 -1
- package/components/combobox/demo/api.min.js +10 -26
- package/components/combobox/demo/index.min.js +10 -26
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +2 -5
- package/components/combobox/dist/index.js +9 -26
- package/components/combobox/dist/registered.js +9 -26
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +5 -26
- package/components/counter/demo/index.min.js +5 -26
- package/components/counter/demo/readme.md +1 -1
- package/components/counter/dist/auro-counter-group.d.ts +2 -5
- package/components/counter/dist/index.js +5 -26
- package/components/counter/dist/registered.js +5 -26
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.md +0 -1
- package/components/datepicker/demo/api.min.js +4 -36
- package/components/datepicker/demo/index.min.js +4 -36
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/auro-datepicker.d.ts +0 -13
- package/components/datepicker/dist/index.js +4 -36
- package/components/datepicker/dist/registered.js +4 -36
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/api.md +1 -1
- package/components/dropdown/demo/api.min.js +3 -21
- package/components/dropdown/demo/index.md +0 -83
- package/components/dropdown/demo/index.min.js +3 -21
- package/components/dropdown/demo/readme.md +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +1 -12
- package/components/dropdown/dist/index.js +3 -21
- package/components/dropdown/dist/registered.js +3 -21
- 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/readme.md +1 -1
- package/components/menu/README.md +1 -1
- package/components/menu/demo/api.min.js +1 -0
- package/components/menu/demo/index.min.js +1 -0
- package/components/menu/demo/readme.md +1 -1
- package/components/menu/dist/index.js +1 -0
- package/components/menu/dist/registered.js +1 -0
- package/components/radio/README.md +1 -1
- package/components/radio/demo/readme.md +1 -1
- package/components/select/README.md +1 -1
- package/components/select/demo/api.md +6 -5
- package/components/select/demo/api.min.js +56 -26
- package/components/select/demo/index.md +1 -46
- package/components/select/demo/index.min.js +56 -26
- package/components/select/demo/readme.md +1 -1
- package/components/select/dist/auro-select.d.ts +5 -5
- package/components/select/dist/index.js +55 -26
- package/components/select/dist/registered.js +55 -26
- package/package.json +1 -1
- package/components/form/demo/autocomplete.html +0 -15
|
@@ -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.
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.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.
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -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.
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
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.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -918,6 +918,7 @@ class AuroMenu extends r {
|
|
|
918
918
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
919
919
|
this.items[index].classList.add('active');
|
|
920
920
|
this.optionActive = this.items[index];
|
|
921
|
+
this.index = index;
|
|
921
922
|
|
|
922
923
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
923
924
|
}
|
|
@@ -878,6 +878,7 @@ class AuroMenu extends r {
|
|
|
878
878
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
879
879
|
this.items[index].classList.add('active');
|
|
880
880
|
this.optionActive = this.items[index];
|
|
881
|
+
this.index = index;
|
|
881
882
|
|
|
882
883
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
883
884
|
}
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
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.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -857,6 +857,7 @@ class AuroMenu extends LitElement {
|
|
|
857
857
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
858
858
|
this.items[index].classList.add('active');
|
|
859
859
|
this.optionActive = this.items[index];
|
|
860
|
+
this.index = index;
|
|
860
861
|
|
|
861
862
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
862
863
|
}
|
|
@@ -857,6 +857,7 @@ class AuroMenu extends LitElement {
|
|
|
857
857
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
858
858
|
this.items[index].classList.add('active');
|
|
859
859
|
this.optionActive = this.items[index];
|
|
860
|
+
this.index = index;
|
|
860
861
|
|
|
861
862
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
862
863
|
}
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
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.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
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.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -111,7 +111,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
111
111
|
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.
|
|
112
112
|
|
|
113
113
|
```html
|
|
114
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-select/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -20,7 +20,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
20
20
|
| [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
|
|
21
21
|
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
22
22
|
| [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
|
|
23
|
-
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`
|
|
23
|
+
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile.<br />When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint. |
|
|
24
24
|
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
|
|
25
25
|
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
|
|
26
26
|
| [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
|
|
@@ -39,10 +39,11 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
39
39
|
|
|
40
40
|
## Methods
|
|
41
41
|
|
|
42
|
-
| Method
|
|
43
|
-
|
|
44
|
-
| [reset](#reset)
|
|
45
|
-
| [
|
|
42
|
+
| Method | Type | Description |
|
|
43
|
+
|--------------------------------|----------------------------------------|--------------------------------------------------|
|
|
44
|
+
| [reset](#reset) | `(): void` | Resets component to initial state. |
|
|
45
|
+
| [updateActiveOptionBasedOnKey](#updateActiveOptionBasedOnKey) | `(_key: any): void` | |
|
|
46
|
+
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
46
47
|
|
|
47
48
|
## Events
|
|
48
49
|
|
|
@@ -3584,7 +3584,6 @@ var tokensCss$1$1 = i$5`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
|
|
|
3584
3584
|
|
|
3585
3585
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3586
3586
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3587
|
-
'xl',
|
|
3588
3587
|
'lg',
|
|
3589
3588
|
'md',
|
|
3590
3589
|
'sm',
|
|
@@ -3656,7 +3655,6 @@ class AuroDropdownBib extends r {
|
|
|
3656
3655
|
|
|
3657
3656
|
set mobileFullscreenBreakpoint(value) {
|
|
3658
3657
|
// verify the defined breakpoint is valid and exit out if not
|
|
3659
|
-
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
3660
3658
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
3661
3659
|
if (!validatedValue) {
|
|
3662
3660
|
this._mobileBreakpointValue = undefined;
|
|
@@ -4182,12 +4180,7 @@ class AuroDropdown extends r {
|
|
|
4182
4180
|
},
|
|
4183
4181
|
|
|
4184
4182
|
/**
|
|
4185
|
-
* Defines the screen size breakpoint (`
|
|
4186
|
-
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
4187
|
-
*
|
|
4188
|
-
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
4189
|
-
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
4190
|
-
* @default sm
|
|
4183
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
4191
4184
|
*/
|
|
4192
4185
|
fullscreenBreakpoint: {
|
|
4193
4186
|
type: String,
|
|
@@ -4327,15 +4320,6 @@ class AuroDropdown extends r {
|
|
|
4327
4320
|
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroDropdown);
|
|
4328
4321
|
}
|
|
4329
4322
|
|
|
4330
|
-
/**
|
|
4331
|
-
* Accessor for reusing the focusable entity query string.
|
|
4332
|
-
* @private
|
|
4333
|
-
* @returns {string}
|
|
4334
|
-
*/
|
|
4335
|
-
get focusableEntityQuery () {
|
|
4336
|
-
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
4337
|
-
}
|
|
4338
|
-
|
|
4339
4323
|
connectedCallback() {
|
|
4340
4324
|
super.connectedCallback();
|
|
4341
4325
|
}
|
|
@@ -4349,8 +4333,6 @@ class AuroDropdown extends r {
|
|
|
4349
4333
|
updated(changedProperties) {
|
|
4350
4334
|
this.floater.handleUpdate(changedProperties);
|
|
4351
4335
|
|
|
4352
|
-
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
4353
|
-
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
4354
4336
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
4355
4337
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
4356
4338
|
}
|
|
@@ -4501,7 +4483,7 @@ class AuroDropdown extends r {
|
|
|
4501
4483
|
|
|
4502
4484
|
this.triggerContentSlot.forEach((node) => {
|
|
4503
4485
|
if (node.querySelectorAll) {
|
|
4504
|
-
const auroElements = node.querySelectorAll(
|
|
4486
|
+
const auroElements = node.querySelectorAll('auro-input, [auro-input], auro-button, [auro-button], button, input');
|
|
4505
4487
|
auroElements.forEach((auroEl) => {
|
|
4506
4488
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
4507
4489
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -4522,7 +4504,7 @@ class AuroDropdown extends r {
|
|
|
4522
4504
|
|
|
4523
4505
|
this.triggerContentSlot.forEach((node) => {
|
|
4524
4506
|
if (node.querySelectorAll) {
|
|
4525
|
-
const auroElements = node.querySelectorAll(
|
|
4507
|
+
const auroElements = node.querySelectorAll('auro-input, [auro-input], auro-button, [auro-button], button, input');
|
|
4526
4508
|
auroElements.forEach((auroEl) => {
|
|
4527
4509
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
4528
4510
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -5746,11 +5728,8 @@ class AuroSelect extends r {
|
|
|
5746
5728
|
},
|
|
5747
5729
|
|
|
5748
5730
|
/**
|
|
5749
|
-
* Defines the screen size breakpoint (`
|
|
5750
|
-
*
|
|
5751
|
-
*
|
|
5752
|
-
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
5753
|
-
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
5731
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile.
|
|
5732
|
+
* When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
5754
5733
|
* @default sm
|
|
5755
5734
|
*/
|
|
5756
5735
|
fullscreenBreakpoint: {
|
|
@@ -6052,6 +6031,8 @@ class AuroSelect extends r {
|
|
|
6052
6031
|
if (this.dropdown.isPopoverVisible) {
|
|
6053
6032
|
this.menu.navigateOptions('up');
|
|
6054
6033
|
}
|
|
6034
|
+
|
|
6035
|
+
return;
|
|
6055
6036
|
}
|
|
6056
6037
|
|
|
6057
6038
|
if (evt.key === 'ArrowDown') {
|
|
@@ -6062,6 +6043,8 @@ class AuroSelect extends r {
|
|
|
6062
6043
|
if (this.dropdown.isPopoverVisible) {
|
|
6063
6044
|
this.menu.navigateOptions('down');
|
|
6064
6045
|
}
|
|
6046
|
+
|
|
6047
|
+
return;
|
|
6065
6048
|
}
|
|
6066
6049
|
|
|
6067
6050
|
if (evt.key === 'Enter') {
|
|
@@ -6069,6 +6052,8 @@ class AuroSelect extends r {
|
|
|
6069
6052
|
evt.preventDefault();
|
|
6070
6053
|
this.menu.makeSelection();
|
|
6071
6054
|
}
|
|
6055
|
+
|
|
6056
|
+
return;
|
|
6072
6057
|
}
|
|
6073
6058
|
|
|
6074
6059
|
if (evt.key === 'Tab') {
|
|
@@ -6077,7 +6062,12 @@ class AuroSelect extends r {
|
|
|
6077
6062
|
} else {
|
|
6078
6063
|
this.dropdown.hide();
|
|
6079
6064
|
}
|
|
6065
|
+
|
|
6066
|
+
return;
|
|
6080
6067
|
}
|
|
6068
|
+
|
|
6069
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
6070
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
6081
6071
|
});
|
|
6082
6072
|
|
|
6083
6073
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -6087,6 +6077,45 @@ class AuroSelect extends r {
|
|
|
6087
6077
|
});
|
|
6088
6078
|
}
|
|
6089
6079
|
|
|
6080
|
+
updateActiveOptionBasedOnKey(_key) {
|
|
6081
|
+
|
|
6082
|
+
// Get a lowercase version of the key pressed
|
|
6083
|
+
const key = _key.toLowerCase();
|
|
6084
|
+
|
|
6085
|
+
// Calculate how many times the same letter has been pressed
|
|
6086
|
+
this.sameLetterTimes = key === this.lastLetter ? this.sameLetterTimes + 1 : 0;
|
|
6087
|
+
|
|
6088
|
+
// Set last letter for tracking
|
|
6089
|
+
this.lastLetter = key;
|
|
6090
|
+
|
|
6091
|
+
// Get all the options that start with the last letter pressed
|
|
6092
|
+
const letterOptions = this.options.filter((option) => {
|
|
6093
|
+
const optionText = option.value || '';
|
|
6094
|
+
return optionText.toLowerCase().startsWith(this.lastLetter);
|
|
6095
|
+
});
|
|
6096
|
+
|
|
6097
|
+
// If we have options that match the letter pressed
|
|
6098
|
+
if (letterOptions.length) {
|
|
6099
|
+
|
|
6100
|
+
// Show the dropdown if it is not already visible
|
|
6101
|
+
this.dropdown.show();
|
|
6102
|
+
|
|
6103
|
+
// Get the index we're after based on how many times the letter has been pressed and the length of the letterOptions array
|
|
6104
|
+
const index = this.sameLetterTimes < letterOptions.length ? this.sameLetterTimes : this.sameLetterTimes % letterOptions.length;
|
|
6105
|
+
|
|
6106
|
+
// Select the new option in the menu
|
|
6107
|
+
const newOption = letterOptions[index];
|
|
6108
|
+
const newOptionIndex = this.options.indexOf(newOption);
|
|
6109
|
+
this.menu.updateActiveOption(newOptionIndex);
|
|
6110
|
+
|
|
6111
|
+
newOption.scrollIntoView({
|
|
6112
|
+
alignToTop: false,
|
|
6113
|
+
block: "nearest",
|
|
6114
|
+
behavior: "smooth"
|
|
6115
|
+
});
|
|
6116
|
+
}
|
|
6117
|
+
}
|
|
6118
|
+
|
|
6090
6119
|
/**
|
|
6091
6120
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
6092
6121
|
*
|
|
@@ -7124,6 +7153,7 @@ class AuroMenu extends r {
|
|
|
7124
7153
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
7125
7154
|
this.items[index].classList.add('active');
|
|
7126
7155
|
this.optionActive = this.items[index];
|
|
7156
|
+
this.index = index;
|
|
7127
7157
|
|
|
7128
7158
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
7129
7159
|
}
|
|
@@ -379,7 +379,7 @@ Applying the `noCheckmark` attribute will prevent the checkmark icon from being
|
|
|
379
379
|
|
|
380
380
|
## Example with custom bib height
|
|
381
381
|
|
|
382
|
-
This example shows how to set a custom height for the bib from `<auro-dropdown>`.
|
|
382
|
+
This example shows how to set a custom height for the bib from `<auro-dropdown>`.
|
|
383
383
|
|
|
384
384
|
Custom height dimensions are set by using the `dropdownSize` CSS Part and then applying a `max-height` rule and value.
|
|
385
385
|
|
|
@@ -434,51 +434,6 @@ Custom height dimensions are set by using the `dropdownSize` CSS Part and then a
|
|
|
434
434
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
435
435
|
</auro-accordion>
|
|
436
436
|
|
|
437
|
-
## Example with fullscreen dropdown breakpoint override
|
|
438
|
-
|
|
439
|
-
This example overrides the default dropdown behavior to force a non-fullscreen view on any screen size. `disabled`
|
|
440
|
-
ensures that the dropdown will never be fullscreen.
|
|
441
|
-
Please use `xl` if you want the opposite behavior, where a dropdown is always fullscreen.
|
|
442
|
-
|
|
443
|
-
<div class="exampleWrapper">
|
|
444
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/forcedFullscreenDisabled.html) -->
|
|
445
|
-
<!-- The below content is automatically added from ./../apiExamples/forcedFullscreenDisabled.html -->
|
|
446
|
-
<auro-select fullscreenBreakpoint="disabled">
|
|
447
|
-
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
448
|
-
<span slot="label">Select Example</span>
|
|
449
|
-
<auro-menu>
|
|
450
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
451
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
452
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
453
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
454
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
455
|
-
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
456
|
-
</auro-menu>
|
|
457
|
-
</auro-select>
|
|
458
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
459
|
-
</div>
|
|
460
|
-
<auro-accordion alignRight>
|
|
461
|
-
<span slot="trigger">See code</span>
|
|
462
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/forcedFullscreenDisabled.html) -->
|
|
463
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/forcedFullscreenDisabled.html -->
|
|
464
|
-
|
|
465
|
-
```html
|
|
466
|
-
<auro-select fullscreenBreakpoint="disabled">
|
|
467
|
-
<span slot="bib.fullscreen.headline">Bib Headline</span>
|
|
468
|
-
<span slot="label">Select Example</span>
|
|
469
|
-
<auro-menu>
|
|
470
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
471
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
472
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
473
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
474
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
475
|
-
<auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
|
|
476
|
-
</auro-menu>
|
|
477
|
-
</auro-select>
|
|
478
|
-
```
|
|
479
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
480
|
-
</auro-accordion>
|
|
481
|
-
|
|
482
437
|
## Error State
|
|
483
438
|
|
|
484
439
|
Use the `error` boolean attribute to toggle the error UI.
|
|
@@ -3492,7 +3492,6 @@ var tokensCss$1$1 = i$5`:host{--ds-auro-dropdown-label-text-color: var(--ds-basi
|
|
|
3492
3492
|
|
|
3493
3493
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
3494
3494
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
3495
|
-
'xl',
|
|
3496
3495
|
'lg',
|
|
3497
3496
|
'md',
|
|
3498
3497
|
'sm',
|
|
@@ -3564,7 +3563,6 @@ class AuroDropdownBib extends r {
|
|
|
3564
3563
|
|
|
3565
3564
|
set mobileFullscreenBreakpoint(value) {
|
|
3566
3565
|
// verify the defined breakpoint is valid and exit out if not
|
|
3567
|
-
// 'disabled' is a design token breakpoint so it acts as our "undefined" value
|
|
3568
3566
|
const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
|
|
3569
3567
|
if (!validatedValue) {
|
|
3570
3568
|
this._mobileBreakpointValue = undefined;
|
|
@@ -4090,12 +4088,7 @@ class AuroDropdown extends r {
|
|
|
4090
4088
|
},
|
|
4091
4089
|
|
|
4092
4090
|
/**
|
|
4093
|
-
* Defines the screen size breakpoint (`
|
|
4094
|
-
* at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
|
|
4095
|
-
*
|
|
4096
|
-
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
4097
|
-
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
4098
|
-
* @default sm
|
|
4091
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
4099
4092
|
*/
|
|
4100
4093
|
fullscreenBreakpoint: {
|
|
4101
4094
|
type: String,
|
|
@@ -4235,15 +4228,6 @@ class AuroDropdown extends r {
|
|
|
4235
4228
|
AuroLibraryRuntimeUtils$1$1.prototype.registerComponent(name, AuroDropdown);
|
|
4236
4229
|
}
|
|
4237
4230
|
|
|
4238
|
-
/**
|
|
4239
|
-
* Accessor for reusing the focusable entity query string.
|
|
4240
|
-
* @private
|
|
4241
|
-
* @returns {string}
|
|
4242
|
-
*/
|
|
4243
|
-
get focusableEntityQuery () {
|
|
4244
|
-
return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
|
|
4245
|
-
}
|
|
4246
|
-
|
|
4247
4231
|
connectedCallback() {
|
|
4248
4232
|
super.connectedCallback();
|
|
4249
4233
|
}
|
|
@@ -4257,8 +4241,6 @@ class AuroDropdown extends r {
|
|
|
4257
4241
|
updated(changedProperties) {
|
|
4258
4242
|
this.floater.handleUpdate(changedProperties);
|
|
4259
4243
|
|
|
4260
|
-
// Note: `disabled` is not a breakpoint (it is not a screen size),
|
|
4261
|
-
// so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
|
|
4262
4244
|
if (changedProperties.has('fullscreenBreakpoint')) {
|
|
4263
4245
|
this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
|
|
4264
4246
|
}
|
|
@@ -4409,7 +4391,7 @@ class AuroDropdown extends r {
|
|
|
4409
4391
|
|
|
4410
4392
|
this.triggerContentSlot.forEach((node) => {
|
|
4411
4393
|
if (node.querySelectorAll) {
|
|
4412
|
-
const auroElements = node.querySelectorAll(
|
|
4394
|
+
const auroElements = node.querySelectorAll('auro-input, [auro-input], auro-button, [auro-button], button, input');
|
|
4413
4395
|
auroElements.forEach((auroEl) => {
|
|
4414
4396
|
auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
|
|
4415
4397
|
auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -4430,7 +4412,7 @@ class AuroDropdown extends r {
|
|
|
4430
4412
|
|
|
4431
4413
|
this.triggerContentSlot.forEach((node) => {
|
|
4432
4414
|
if (node.querySelectorAll) {
|
|
4433
|
-
const auroElements = node.querySelectorAll(
|
|
4415
|
+
const auroElements = node.querySelectorAll('auro-input, [auro-input], auro-button, [auro-button], button, input');
|
|
4434
4416
|
auroElements.forEach((auroEl) => {
|
|
4435
4417
|
auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
|
|
4436
4418
|
auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
|
|
@@ -5654,11 +5636,8 @@ class AuroSelect extends r {
|
|
|
5654
5636
|
},
|
|
5655
5637
|
|
|
5656
5638
|
/**
|
|
5657
|
-
* Defines the screen size breakpoint (`
|
|
5658
|
-
*
|
|
5659
|
-
*
|
|
5660
|
-
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
5661
|
-
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
5639
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile.
|
|
5640
|
+
* When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
5662
5641
|
* @default sm
|
|
5663
5642
|
*/
|
|
5664
5643
|
fullscreenBreakpoint: {
|
|
@@ -5960,6 +5939,8 @@ class AuroSelect extends r {
|
|
|
5960
5939
|
if (this.dropdown.isPopoverVisible) {
|
|
5961
5940
|
this.menu.navigateOptions('up');
|
|
5962
5941
|
}
|
|
5942
|
+
|
|
5943
|
+
return;
|
|
5963
5944
|
}
|
|
5964
5945
|
|
|
5965
5946
|
if (evt.key === 'ArrowDown') {
|
|
@@ -5970,6 +5951,8 @@ class AuroSelect extends r {
|
|
|
5970
5951
|
if (this.dropdown.isPopoverVisible) {
|
|
5971
5952
|
this.menu.navigateOptions('down');
|
|
5972
5953
|
}
|
|
5954
|
+
|
|
5955
|
+
return;
|
|
5973
5956
|
}
|
|
5974
5957
|
|
|
5975
5958
|
if (evt.key === 'Enter') {
|
|
@@ -5977,6 +5960,8 @@ class AuroSelect extends r {
|
|
|
5977
5960
|
evt.preventDefault();
|
|
5978
5961
|
this.menu.makeSelection();
|
|
5979
5962
|
}
|
|
5963
|
+
|
|
5964
|
+
return;
|
|
5980
5965
|
}
|
|
5981
5966
|
|
|
5982
5967
|
if (evt.key === 'Tab') {
|
|
@@ -5985,7 +5970,12 @@ class AuroSelect extends r {
|
|
|
5985
5970
|
} else {
|
|
5986
5971
|
this.dropdown.hide();
|
|
5987
5972
|
}
|
|
5973
|
+
|
|
5974
|
+
return;
|
|
5988
5975
|
}
|
|
5976
|
+
|
|
5977
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
5978
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
5989
5979
|
});
|
|
5990
5980
|
|
|
5991
5981
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -5995,6 +5985,45 @@ class AuroSelect extends r {
|
|
|
5995
5985
|
});
|
|
5996
5986
|
}
|
|
5997
5987
|
|
|
5988
|
+
updateActiveOptionBasedOnKey(_key) {
|
|
5989
|
+
|
|
5990
|
+
// Get a lowercase version of the key pressed
|
|
5991
|
+
const key = _key.toLowerCase();
|
|
5992
|
+
|
|
5993
|
+
// Calculate how many times the same letter has been pressed
|
|
5994
|
+
this.sameLetterTimes = key === this.lastLetter ? this.sameLetterTimes + 1 : 0;
|
|
5995
|
+
|
|
5996
|
+
// Set last letter for tracking
|
|
5997
|
+
this.lastLetter = key;
|
|
5998
|
+
|
|
5999
|
+
// Get all the options that start with the last letter pressed
|
|
6000
|
+
const letterOptions = this.options.filter((option) => {
|
|
6001
|
+
const optionText = option.value || '';
|
|
6002
|
+
return optionText.toLowerCase().startsWith(this.lastLetter);
|
|
6003
|
+
});
|
|
6004
|
+
|
|
6005
|
+
// If we have options that match the letter pressed
|
|
6006
|
+
if (letterOptions.length) {
|
|
6007
|
+
|
|
6008
|
+
// Show the dropdown if it is not already visible
|
|
6009
|
+
this.dropdown.show();
|
|
6010
|
+
|
|
6011
|
+
// Get the index we're after based on how many times the letter has been pressed and the length of the letterOptions array
|
|
6012
|
+
const index = this.sameLetterTimes < letterOptions.length ? this.sameLetterTimes : this.sameLetterTimes % letterOptions.length;
|
|
6013
|
+
|
|
6014
|
+
// Select the new option in the menu
|
|
6015
|
+
const newOption = letterOptions[index];
|
|
6016
|
+
const newOptionIndex = this.options.indexOf(newOption);
|
|
6017
|
+
this.menu.updateActiveOption(newOptionIndex);
|
|
6018
|
+
|
|
6019
|
+
newOption.scrollIntoView({
|
|
6020
|
+
alignToTop: false,
|
|
6021
|
+
block: "nearest",
|
|
6022
|
+
behavior: "smooth"
|
|
6023
|
+
});
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
|
|
5998
6027
|
/**
|
|
5999
6028
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
6000
6029
|
*
|
|
@@ -7032,6 +7061,7 @@ class AuroMenu extends r {
|
|
|
7032
7061
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
7033
7062
|
this.items[index].classList.add('active');
|
|
7034
7063
|
this.optionActive = this.items[index];
|
|
7064
|
+
this.index = index;
|
|
7035
7065
|
|
|
7036
7066
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
7037
7067
|
}
|
|
@@ -111,7 +111,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
111
111
|
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.
|
|
112
112
|
|
|
113
113
|
```html
|
|
114
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.0/auro-select/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -36,11 +36,8 @@ export class AuroSelect extends LitElement {
|
|
|
36
36
|
reflect: boolean;
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
|
-
* Defines the screen size breakpoint (`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* When expanded, the dropdown will automatically display in fullscreen mode
|
|
43
|
-
* if the screen size is equal to or smaller than the selected breakpoint.
|
|
39
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile.
|
|
40
|
+
* When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
44
41
|
* @default sm
|
|
45
42
|
*/
|
|
46
43
|
fullscreenBreakpoint: {
|
|
@@ -257,6 +254,9 @@ export class AuroSelect extends LitElement {
|
|
|
257
254
|
* @returns {void}
|
|
258
255
|
*/
|
|
259
256
|
private configureSelect;
|
|
257
|
+
updateActiveOptionBasedOnKey(_key: any): void;
|
|
258
|
+
sameLetterTimes: any;
|
|
259
|
+
lastLetter: any;
|
|
260
260
|
/**
|
|
261
261
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
262
262
|
*
|