@aurodesignsystem/auro-formkit 3.1.0 → 3.2.0
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 +7 -0
- 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.min.js +1 -0
- package/components/combobox/demo/index.min.js +1 -0
- package/components/combobox/demo/readme.md +1 -1
- package/components/counter/README.md +1 -1
- package/components/counter/demo/readme.md +1 -1
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/readme.md +1 -1
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/readme.md +1 -1
- 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 +5 -4
- package/components/select/demo/api.min.js +51 -0
- package/components/select/demo/index.min.js +51 -0
- package/components/select/demo/readme.md +1 -1
- package/components/select/dist/auro-select.d.ts +3 -0
- package/components/select/dist/index.js +50 -0
- package/components/select/dist/registered.js +50 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Semantic Release Automated Changelog
|
|
2
2
|
|
|
3
|
+
# [3.2.0](https://github.com/AlaskaAirlines/auro-formkit/compare/v3.1.0...v3.2.0) (2025-04-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added press-key-to-jump-to-selection functionality to auro-select component ([66fed78](https://github.com/AlaskaAirlines/auro-formkit/commit/66fed788ab07e431b42850da4167166eaa981473)), closes [#404](https://github.com/AlaskaAirlines/auro-formkit/issues/404)
|
|
9
|
+
|
|
3
10
|
# [3.1.0](https://github.com/AlaskaAirlines/auro-formkit/compare/v3.0.1...v3.1.0) (2025-04-30)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -106,7 +106,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
106
106
|
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.
|
|
107
107
|
|
|
108
108
|
```html
|
|
109
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
109
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-checkbox/+esm"></script>
|
|
110
110
|
```
|
|
111
111
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
112
|
|
|
@@ -106,7 +106,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
106
106
|
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.
|
|
107
107
|
|
|
108
108
|
```html
|
|
109
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
109
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-checkbox/+esm"></script>
|
|
110
110
|
```
|
|
111
111
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
112
|
|
|
@@ -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.0
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-combobox/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -14523,6 +14523,7 @@ class AuroMenu extends r$1 {
|
|
|
14523
14523
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
14524
14524
|
this.items[index].classList.add('active');
|
|
14525
14525
|
this.optionActive = this.items[index];
|
|
14526
|
+
this.index = index;
|
|
14526
14527
|
|
|
14527
14528
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
14528
14529
|
}
|
|
@@ -14381,6 +14381,7 @@ class AuroMenu extends r$1 {
|
|
|
14381
14381
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
14382
14382
|
this.items[index].classList.add('active');
|
|
14383
14383
|
this.optionActive = this.items[index];
|
|
14384
|
+
this.index = index;
|
|
14384
14385
|
|
|
14385
14386
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
14386
14387
|
}
|
|
@@ -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.0
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-combobox/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -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.0
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-counter/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -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.0
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-counter/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -104,7 +104,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
104
104
|
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.
|
|
105
105
|
|
|
106
106
|
```html
|
|
107
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
107
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-datepicker/+esm"></script>
|
|
108
108
|
```
|
|
109
109
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
110
|
|
|
@@ -104,7 +104,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
104
104
|
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.
|
|
105
105
|
|
|
106
106
|
```html
|
|
107
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
107
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-datepicker/+esm"></script>
|
|
108
108
|
```
|
|
109
109
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
110
|
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
110
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.0
|
|
110
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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.0
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.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.0
|
|
113
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.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.0
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.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.0
|
|
103
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.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.0
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-select/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -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
|
|
|
@@ -6031,6 +6031,8 @@ class AuroSelect extends r {
|
|
|
6031
6031
|
if (this.dropdown.isPopoverVisible) {
|
|
6032
6032
|
this.menu.navigateOptions('up');
|
|
6033
6033
|
}
|
|
6034
|
+
|
|
6035
|
+
return;
|
|
6034
6036
|
}
|
|
6035
6037
|
|
|
6036
6038
|
if (evt.key === 'ArrowDown') {
|
|
@@ -6041,6 +6043,8 @@ class AuroSelect extends r {
|
|
|
6041
6043
|
if (this.dropdown.isPopoverVisible) {
|
|
6042
6044
|
this.menu.navigateOptions('down');
|
|
6043
6045
|
}
|
|
6046
|
+
|
|
6047
|
+
return;
|
|
6044
6048
|
}
|
|
6045
6049
|
|
|
6046
6050
|
if (evt.key === 'Enter') {
|
|
@@ -6048,6 +6052,8 @@ class AuroSelect extends r {
|
|
|
6048
6052
|
evt.preventDefault();
|
|
6049
6053
|
this.menu.makeSelection();
|
|
6050
6054
|
}
|
|
6055
|
+
|
|
6056
|
+
return;
|
|
6051
6057
|
}
|
|
6052
6058
|
|
|
6053
6059
|
if (evt.key === 'Tab') {
|
|
@@ -6056,7 +6062,12 @@ class AuroSelect extends r {
|
|
|
6056
6062
|
} else {
|
|
6057
6063
|
this.dropdown.hide();
|
|
6058
6064
|
}
|
|
6065
|
+
|
|
6066
|
+
return;
|
|
6059
6067
|
}
|
|
6068
|
+
|
|
6069
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
6070
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
6060
6071
|
});
|
|
6061
6072
|
|
|
6062
6073
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -6066,6 +6077,45 @@ class AuroSelect extends r {
|
|
|
6066
6077
|
});
|
|
6067
6078
|
}
|
|
6068
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
|
+
|
|
6069
6119
|
/**
|
|
6070
6120
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
6071
6121
|
*
|
|
@@ -7103,6 +7153,7 @@ class AuroMenu extends r {
|
|
|
7103
7153
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
7104
7154
|
this.items[index].classList.add('active');
|
|
7105
7155
|
this.optionActive = this.items[index];
|
|
7156
|
+
this.index = index;
|
|
7106
7157
|
|
|
7107
7158
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
7108
7159
|
}
|
|
@@ -5939,6 +5939,8 @@ class AuroSelect extends r {
|
|
|
5939
5939
|
if (this.dropdown.isPopoverVisible) {
|
|
5940
5940
|
this.menu.navigateOptions('up');
|
|
5941
5941
|
}
|
|
5942
|
+
|
|
5943
|
+
return;
|
|
5942
5944
|
}
|
|
5943
5945
|
|
|
5944
5946
|
if (evt.key === 'ArrowDown') {
|
|
@@ -5949,6 +5951,8 @@ class AuroSelect extends r {
|
|
|
5949
5951
|
if (this.dropdown.isPopoverVisible) {
|
|
5950
5952
|
this.menu.navigateOptions('down');
|
|
5951
5953
|
}
|
|
5954
|
+
|
|
5955
|
+
return;
|
|
5952
5956
|
}
|
|
5953
5957
|
|
|
5954
5958
|
if (evt.key === 'Enter') {
|
|
@@ -5956,6 +5960,8 @@ class AuroSelect extends r {
|
|
|
5956
5960
|
evt.preventDefault();
|
|
5957
5961
|
this.menu.makeSelection();
|
|
5958
5962
|
}
|
|
5963
|
+
|
|
5964
|
+
return;
|
|
5959
5965
|
}
|
|
5960
5966
|
|
|
5961
5967
|
if (evt.key === 'Tab') {
|
|
@@ -5964,7 +5970,12 @@ class AuroSelect extends r {
|
|
|
5964
5970
|
} else {
|
|
5965
5971
|
this.dropdown.hide();
|
|
5966
5972
|
}
|
|
5973
|
+
|
|
5974
|
+
return;
|
|
5967
5975
|
}
|
|
5976
|
+
|
|
5977
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
5978
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
5968
5979
|
});
|
|
5969
5980
|
|
|
5970
5981
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -5974,6 +5985,45 @@ class AuroSelect extends r {
|
|
|
5974
5985
|
});
|
|
5975
5986
|
}
|
|
5976
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
|
+
|
|
5977
6027
|
/**
|
|
5978
6028
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
5979
6029
|
*
|
|
@@ -7011,6 +7061,7 @@ class AuroMenu extends r {
|
|
|
7011
7061
|
this.items.forEach((item) => item.classList.remove('active'));
|
|
7012
7062
|
this.items[index].classList.add('active');
|
|
7013
7063
|
this.optionActive = this.items[index];
|
|
7064
|
+
this.index = index;
|
|
7014
7065
|
|
|
7015
7066
|
dispatchMenuEvent(this, 'auroMenu-activatedOption', this.items[index]);
|
|
7016
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.0
|
|
114
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.1.0/auro-select/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -254,6 +254,9 @@ export class AuroSelect extends LitElement {
|
|
|
254
254
|
* @returns {void}
|
|
255
255
|
*/
|
|
256
256
|
private configureSelect;
|
|
257
|
+
updateActiveOptionBasedOnKey(_key: any): void;
|
|
258
|
+
sameLetterTimes: any;
|
|
259
|
+
lastLetter: any;
|
|
257
260
|
/**
|
|
258
261
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
259
262
|
*
|
|
@@ -5892,6 +5892,8 @@ class AuroSelect extends LitElement {
|
|
|
5892
5892
|
if (this.dropdown.isPopoverVisible) {
|
|
5893
5893
|
this.menu.navigateOptions('up');
|
|
5894
5894
|
}
|
|
5895
|
+
|
|
5896
|
+
return;
|
|
5895
5897
|
}
|
|
5896
5898
|
|
|
5897
5899
|
if (evt.key === 'ArrowDown') {
|
|
@@ -5902,6 +5904,8 @@ class AuroSelect extends LitElement {
|
|
|
5902
5904
|
if (this.dropdown.isPopoverVisible) {
|
|
5903
5905
|
this.menu.navigateOptions('down');
|
|
5904
5906
|
}
|
|
5907
|
+
|
|
5908
|
+
return;
|
|
5905
5909
|
}
|
|
5906
5910
|
|
|
5907
5911
|
if (evt.key === 'Enter') {
|
|
@@ -5909,6 +5913,8 @@ class AuroSelect extends LitElement {
|
|
|
5909
5913
|
evt.preventDefault();
|
|
5910
5914
|
this.menu.makeSelection();
|
|
5911
5915
|
}
|
|
5916
|
+
|
|
5917
|
+
return;
|
|
5912
5918
|
}
|
|
5913
5919
|
|
|
5914
5920
|
if (evt.key === 'Tab') {
|
|
@@ -5917,7 +5923,12 @@ class AuroSelect extends LitElement {
|
|
|
5917
5923
|
} else {
|
|
5918
5924
|
this.dropdown.hide();
|
|
5919
5925
|
}
|
|
5926
|
+
|
|
5927
|
+
return;
|
|
5920
5928
|
}
|
|
5929
|
+
|
|
5930
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
5931
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
5921
5932
|
});
|
|
5922
5933
|
|
|
5923
5934
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -5927,6 +5938,45 @@ class AuroSelect extends LitElement {
|
|
|
5927
5938
|
});
|
|
5928
5939
|
}
|
|
5929
5940
|
|
|
5941
|
+
updateActiveOptionBasedOnKey(_key) {
|
|
5942
|
+
|
|
5943
|
+
// Get a lowercase version of the key pressed
|
|
5944
|
+
const key = _key.toLowerCase();
|
|
5945
|
+
|
|
5946
|
+
// Calculate how many times the same letter has been pressed
|
|
5947
|
+
this.sameLetterTimes = key === this.lastLetter ? this.sameLetterTimes + 1 : 0;
|
|
5948
|
+
|
|
5949
|
+
// Set last letter for tracking
|
|
5950
|
+
this.lastLetter = key;
|
|
5951
|
+
|
|
5952
|
+
// Get all the options that start with the last letter pressed
|
|
5953
|
+
const letterOptions = this.options.filter((option) => {
|
|
5954
|
+
const optionText = option.value || '';
|
|
5955
|
+
return optionText.toLowerCase().startsWith(this.lastLetter);
|
|
5956
|
+
});
|
|
5957
|
+
|
|
5958
|
+
// If we have options that match the letter pressed
|
|
5959
|
+
if (letterOptions.length) {
|
|
5960
|
+
|
|
5961
|
+
// Show the dropdown if it is not already visible
|
|
5962
|
+
this.dropdown.show();
|
|
5963
|
+
|
|
5964
|
+
// Get the index we're after based on how many times the letter has been pressed and the length of the letterOptions array
|
|
5965
|
+
const index = this.sameLetterTimes < letterOptions.length ? this.sameLetterTimes : this.sameLetterTimes % letterOptions.length;
|
|
5966
|
+
|
|
5967
|
+
// Select the new option in the menu
|
|
5968
|
+
const newOption = letterOptions[index];
|
|
5969
|
+
const newOptionIndex = this.options.indexOf(newOption);
|
|
5970
|
+
this.menu.updateActiveOption(newOptionIndex);
|
|
5971
|
+
|
|
5972
|
+
newOption.scrollIntoView({
|
|
5973
|
+
alignToTop: false,
|
|
5974
|
+
block: "nearest",
|
|
5975
|
+
behavior: "smooth"
|
|
5976
|
+
});
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5979
|
+
|
|
5930
5980
|
/**
|
|
5931
5981
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
5932
5982
|
*
|
|
@@ -5892,6 +5892,8 @@ class AuroSelect extends LitElement {
|
|
|
5892
5892
|
if (this.dropdown.isPopoverVisible) {
|
|
5893
5893
|
this.menu.navigateOptions('up');
|
|
5894
5894
|
}
|
|
5895
|
+
|
|
5896
|
+
return;
|
|
5895
5897
|
}
|
|
5896
5898
|
|
|
5897
5899
|
if (evt.key === 'ArrowDown') {
|
|
@@ -5902,6 +5904,8 @@ class AuroSelect extends LitElement {
|
|
|
5902
5904
|
if (this.dropdown.isPopoverVisible) {
|
|
5903
5905
|
this.menu.navigateOptions('down');
|
|
5904
5906
|
}
|
|
5907
|
+
|
|
5908
|
+
return;
|
|
5905
5909
|
}
|
|
5906
5910
|
|
|
5907
5911
|
if (evt.key === 'Enter') {
|
|
@@ -5909,6 +5913,8 @@ class AuroSelect extends LitElement {
|
|
|
5909
5913
|
evt.preventDefault();
|
|
5910
5914
|
this.menu.makeSelection();
|
|
5911
5915
|
}
|
|
5916
|
+
|
|
5917
|
+
return;
|
|
5912
5918
|
}
|
|
5913
5919
|
|
|
5914
5920
|
if (evt.key === 'Tab') {
|
|
@@ -5917,7 +5923,12 @@ class AuroSelect extends LitElement {
|
|
|
5917
5923
|
} else {
|
|
5918
5924
|
this.dropdown.hide();
|
|
5919
5925
|
}
|
|
5926
|
+
|
|
5927
|
+
return;
|
|
5920
5928
|
}
|
|
5929
|
+
|
|
5930
|
+
// Handle all other key presses by updating the active option based on the key pressed
|
|
5931
|
+
this.updateActiveOptionBasedOnKey(evt.key);
|
|
5921
5932
|
});
|
|
5922
5933
|
|
|
5923
5934
|
this.addEventListener('focusin', this.handleFocusin);
|
|
@@ -5927,6 +5938,45 @@ class AuroSelect extends LitElement {
|
|
|
5927
5938
|
});
|
|
5928
5939
|
}
|
|
5929
5940
|
|
|
5941
|
+
updateActiveOptionBasedOnKey(_key) {
|
|
5942
|
+
|
|
5943
|
+
// Get a lowercase version of the key pressed
|
|
5944
|
+
const key = _key.toLowerCase();
|
|
5945
|
+
|
|
5946
|
+
// Calculate how many times the same letter has been pressed
|
|
5947
|
+
this.sameLetterTimes = key === this.lastLetter ? this.sameLetterTimes + 1 : 0;
|
|
5948
|
+
|
|
5949
|
+
// Set last letter for tracking
|
|
5950
|
+
this.lastLetter = key;
|
|
5951
|
+
|
|
5952
|
+
// Get all the options that start with the last letter pressed
|
|
5953
|
+
const letterOptions = this.options.filter((option) => {
|
|
5954
|
+
const optionText = option.value || '';
|
|
5955
|
+
return optionText.toLowerCase().startsWith(this.lastLetter);
|
|
5956
|
+
});
|
|
5957
|
+
|
|
5958
|
+
// If we have options that match the letter pressed
|
|
5959
|
+
if (letterOptions.length) {
|
|
5960
|
+
|
|
5961
|
+
// Show the dropdown if it is not already visible
|
|
5962
|
+
this.dropdown.show();
|
|
5963
|
+
|
|
5964
|
+
// Get the index we're after based on how many times the letter has been pressed and the length of the letterOptions array
|
|
5965
|
+
const index = this.sameLetterTimes < letterOptions.length ? this.sameLetterTimes : this.sameLetterTimes % letterOptions.length;
|
|
5966
|
+
|
|
5967
|
+
// Select the new option in the menu
|
|
5968
|
+
const newOption = letterOptions[index];
|
|
5969
|
+
const newOptionIndex = this.options.indexOf(newOption);
|
|
5970
|
+
this.menu.updateActiveOption(newOptionIndex);
|
|
5971
|
+
|
|
5972
|
+
newOption.scrollIntoView({
|
|
5973
|
+
alignToTop: false,
|
|
5974
|
+
block: "nearest",
|
|
5975
|
+
behavior: "smooth"
|
|
5976
|
+
});
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5979
|
+
|
|
5930
5980
|
/**
|
|
5931
5981
|
* Manages the visibility of the dropdown based on loading state changes.
|
|
5932
5982
|
*
|
package/package.json
CHANGED