@aurodesignsystem-dev/auro-formkit 0.0.0-pr1059.1 → 0.0.0-pr1059.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.md +98 -9
- package/components/combobox/demo/api.min.js +72 -36
- package/components/combobox/demo/index.md +1 -1
- package/components/combobox/demo/index.min.js +22 -32
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/index.js +18 -20
- package/components/combobox/dist/registered.js +18 -20
- package/components/counter/demo/api.min.js +7 -2
- package/components/counter/demo/index.min.js +7 -2
- package/components/counter/dist/index.js +7 -2
- package/components/counter/dist/registered.js +7 -2
- package/components/datepicker/demo/api.min.js +8 -3
- package/components/datepicker/demo/index.min.js +8 -3
- package/components/datepicker/dist/index.js +8 -3
- package/components/datepicker/dist/registered.js +8 -3
- package/components/dropdown/demo/api.min.js +7 -2
- package/components/dropdown/demo/index.min.js +7 -2
- package/components/dropdown/dist/index.js +7 -2
- package/components/dropdown/dist/registered.js +7 -2
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.md +1 -2
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.min.js +4 -12
- package/components/menu/demo/index.min.js +4 -12
- package/components/menu/dist/index.js +4 -12
- package/components/menu/dist/registered.js +4 -12
- package/components/select/demo/api.min.js +12 -15
- package/components/select/demo/index.min.js +12 -15
- package/components/select/dist/index.js +8 -3
- package/components/select/dist/registered.js +8 -3
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ The following sections are editable by making changes to the following files:
|
|
|
22
22
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
23
23
|
`<auro-combobox>` is the combination of [dropdown](http://auro.alaskaair.com/components/auro/dropdown), [input](http://auro.alaskaair.com/components/auro/input), and [menu](http://auro.alaskaair.com/components/auro/menu) and allows users to filter search results from a predefined list as they type. When the user starts typing in the text input, a dropdown of a menu shows up to display options that match the user’s search.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
By default, `auro-combobox` behaves as a suggestion list. This means any value may be typed into the combobox and the menu list presented effectively provides sample or suggestion options. With the use of the `persistInput` attribute the `auro-combobox` behaves as a filter of menu options. In this mode. typing into the input field will execute the filter but will not set the `value` of the combobox. The combobox value is set by selecting a menu option. Clicking the `X` clear button in the input will remove the current value of the HTML5 input causing the menu filter to reset as well as remove the current value of the combobox.
|
|
26
26
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
27
27
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
28
28
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
@@ -170,7 +170,7 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
170
170
|
<!-- ----------------- -->
|
|
171
171
|
<auro-combobox
|
|
172
172
|
id="dynamicMenuExample"
|
|
173
|
-
value="
|
|
173
|
+
value="TAN"
|
|
174
174
|
layout="snowflake"
|
|
175
175
|
shape="snowflake"
|
|
176
176
|
size="lg"
|
|
@@ -180,13 +180,35 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
180
180
|
dvInputOnly
|
|
181
181
|
required>
|
|
182
182
|
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
183
|
-
<span slot="label">
|
|
183
|
+
<span slot="label">First</span>
|
|
184
184
|
<!--
|
|
185
185
|
The auro-combobox element requires an empty auro-menu element
|
|
186
186
|
due to the requirements of auro-dropdown and auro-input
|
|
187
187
|
-->
|
|
188
188
|
<auro-menu id="initMenu"></auro-menu>
|
|
189
|
-
</auro-combobox>
|
|
189
|
+
</auro-combobox>
|
|
190
|
+
<auro-combobox
|
|
191
|
+
id="dynamicMenuExampleTwo"
|
|
192
|
+
value="GER"
|
|
193
|
+
layout="snowflake"
|
|
194
|
+
shape="snowflake"
|
|
195
|
+
size="lg"
|
|
196
|
+
ondark
|
|
197
|
+
noFilter
|
|
198
|
+
persistInput
|
|
199
|
+
dvInputOnly
|
|
200
|
+
required>
|
|
201
|
+
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
202
|
+
<span slot="label">Second</span>
|
|
203
|
+
<!--
|
|
204
|
+
The auro-combobox element requires an empty auro-menu element
|
|
205
|
+
due to the requirements of auro-dropdown and auro-input
|
|
206
|
+
-->
|
|
207
|
+
<auro-menu id="initMenuTwo"></auro-menu>
|
|
208
|
+
</auro-combobox>
|
|
209
|
+
<auro-button id="dynamicMenuSwapButton">
|
|
210
|
+
Swap Values
|
|
211
|
+
</auro-button>
|
|
190
212
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
191
213
|
</div>
|
|
192
214
|
<auro-accordion alignRight>
|
|
@@ -199,7 +221,7 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
199
221
|
<!-- ----------------- -->
|
|
200
222
|
<auro-combobox
|
|
201
223
|
id="dynamicMenuExample"
|
|
202
|
-
value="
|
|
224
|
+
value="TAN"
|
|
203
225
|
layout="snowflake"
|
|
204
226
|
shape="snowflake"
|
|
205
227
|
size="lg"
|
|
@@ -209,13 +231,35 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
209
231
|
dvInputOnly
|
|
210
232
|
required>
|
|
211
233
|
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
212
|
-
<span slot="label">
|
|
234
|
+
<span slot="label">First</span>
|
|
213
235
|
<!--
|
|
214
236
|
The auro-combobox element requires an empty auro-menu element
|
|
215
237
|
due to the requirements of auro-dropdown and auro-input
|
|
216
238
|
-->
|
|
217
239
|
<auro-menu id="initMenu"></auro-menu>
|
|
218
240
|
</auro-combobox>
|
|
241
|
+
<auro-combobox
|
|
242
|
+
id="dynamicMenuExampleTwo"
|
|
243
|
+
value="GER"
|
|
244
|
+
layout="snowflake"
|
|
245
|
+
shape="snowflake"
|
|
246
|
+
size="lg"
|
|
247
|
+
ondark
|
|
248
|
+
noFilter
|
|
249
|
+
persistInput
|
|
250
|
+
dvInputOnly
|
|
251
|
+
required>
|
|
252
|
+
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
253
|
+
<span slot="label">Second</span>
|
|
254
|
+
<!--
|
|
255
|
+
The auro-combobox element requires an empty auro-menu element
|
|
256
|
+
due to the requirements of auro-dropdown and auro-input
|
|
257
|
+
-->
|
|
258
|
+
<auro-menu id="initMenuTwo"></auro-menu>
|
|
259
|
+
</auro-combobox>
|
|
260
|
+
<auro-button id="dynamicMenuSwapButton">
|
|
261
|
+
Swap Values
|
|
262
|
+
</auro-button>
|
|
219
263
|
```
|
|
220
264
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
221
265
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamicMenu.js) -->
|
|
@@ -234,9 +278,35 @@ export async function dynamicMenuExample() {
|
|
|
234
278
|
}
|
|
235
279
|
}
|
|
236
280
|
|
|
281
|
+
function swapValues() {
|
|
282
|
+
const elOne = document.querySelector('#dynamicMenuExample');
|
|
283
|
+
const elTwo = document.querySelector('#dynamicMenuExampleTwo');
|
|
284
|
+
|
|
285
|
+
const elOneValue = elOne.value;
|
|
286
|
+
const elTwoValue = elTwo.value;
|
|
287
|
+
|
|
288
|
+
const elOneInputValue = elOne.input.value;
|
|
289
|
+
const elTwoInputValue = elTwo.input.value;
|
|
290
|
+
|
|
291
|
+
elOne.reset();
|
|
292
|
+
elTwo.reset();
|
|
293
|
+
|
|
294
|
+
elOne.value = elTwoValue;
|
|
295
|
+
elTwo.value = elOneValue;
|
|
296
|
+
|
|
297
|
+
setTimeout(() => {
|
|
298
|
+
elOne.typedValue = elTwoInputValue;
|
|
299
|
+
elTwo.typedValue = elOneInputValue;
|
|
300
|
+
}, 0);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
document.querySelector('#dynamicMenuSwapButton').addEventListener('click', () => {
|
|
304
|
+
swapValues();
|
|
305
|
+
});
|
|
306
|
+
|
|
237
307
|
// Generates HTML for menu and submenus using country & city data from an external API
|
|
238
|
-
function generateHtml(data) {
|
|
239
|
-
const initialMenu = document.querySelector(
|
|
308
|
+
function generateHtml(data, selector) {
|
|
309
|
+
const initialMenu = document.querySelector(selector);
|
|
240
310
|
|
|
241
311
|
resetMenu(initialMenu);
|
|
242
312
|
|
|
@@ -279,13 +349,32 @@ export async function dynamicMenuExample() {
|
|
|
279
349
|
let data = dynamicData.getData();
|
|
280
350
|
data = dynamicData.filterData(data, inputEl.value);
|
|
281
351
|
|
|
282
|
-
generateHtml(data);
|
|
352
|
+
generateHtml(data, '#initMenu');
|
|
283
353
|
});
|
|
284
354
|
|
|
285
355
|
if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
|
|
286
356
|
let data = dynamicData.getData();
|
|
287
357
|
data = dynamicData.filterData(data, inputEl.value);
|
|
288
|
-
generateHtml(data);
|
|
358
|
+
generateHtml(data, '#initMenu');
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// TODO: Need to refactor this to to not console a console error
|
|
362
|
+
const dynamicDataTwo = new DynamicData();
|
|
363
|
+
const dynamicMenuExampleElTwo = document.querySelector('#dynamicMenuExample');
|
|
364
|
+
const dropdownElTwo = dynamicMenuExampleElTwo.shadowRoot.querySelector(dynamicMenuExampleElTwo.dropdownTag._$litStatic$);
|
|
365
|
+
const inputElTwo = dropdownElTwo.querySelector(dynamicMenuExampleElTwo.inputTag._$litStatic$);
|
|
366
|
+
|
|
367
|
+
inputElTwo.addEventListener('input', () => {
|
|
368
|
+
let data = dynamicDataTwo.getData();
|
|
369
|
+
data = dynamicDataTwo.filterData(data, inputEl.value);
|
|
370
|
+
|
|
371
|
+
generateHtml(data, '#initMenuTwo');
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
if (dynamicMenuExampleElTwo.value && dynamicMenuExampleElTwo.value.length > 0 && dynamicMenuExampleElTwo.input.value && (!dynamicMenuExampleElTwo.menu.availableOptions || dynamicMenuExampleElTwo.menu.availableOptions.length === 0)) {
|
|
375
|
+
let data = dynamicDataTwo.getData();
|
|
376
|
+
data = dynamicDataTwo.filterData(data, inputElTwo.value);
|
|
377
|
+
generateHtml(data, '#initMenuTwo');
|
|
289
378
|
}
|
|
290
379
|
}
|
|
291
380
|
```
|
|
@@ -40,9 +40,36 @@ async function dynamicMenuExample() {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function swapValues() {
|
|
44
|
+
const elOne = document.querySelector('#dynamicMenuExample');
|
|
45
|
+
const elTwo = document.querySelector('#dynamicMenuExampleTwo');
|
|
46
|
+
|
|
47
|
+
const elOneValue = elOne.value;
|
|
48
|
+
const elTwoValue = elTwo.value;
|
|
49
|
+
|
|
50
|
+
const elOneInputValue = elOne.input.value;
|
|
51
|
+
const elTwoInputValue = elTwo.input.value;
|
|
52
|
+
|
|
53
|
+
elOne.reset();
|
|
54
|
+
elTwo.reset();
|
|
55
|
+
|
|
56
|
+
elOne.value = elTwoValue;
|
|
57
|
+
elTwo.value = elOneValue;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
elOne.typedValue = elTwoInputValue;
|
|
62
|
+
elTwo.typedValue = elOneInputValue;
|
|
63
|
+
}, 0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
document.querySelector('#dynamicMenuSwapButton').addEventListener('click', () => {
|
|
67
|
+
swapValues();
|
|
68
|
+
});
|
|
69
|
+
|
|
43
70
|
// Generates HTML for menu and submenus using country & city data from an external API
|
|
44
|
-
function generateHtml(data) {
|
|
45
|
-
const initialMenu = document.querySelector(
|
|
71
|
+
function generateHtml(data, selector) {
|
|
72
|
+
const initialMenu = document.querySelector(selector);
|
|
46
73
|
|
|
47
74
|
resetMenu(initialMenu);
|
|
48
75
|
|
|
@@ -84,14 +111,33 @@ async function dynamicMenuExample() {
|
|
|
84
111
|
let data = dynamicData.getData();
|
|
85
112
|
data = dynamicData.filterData(data, inputEl.value);
|
|
86
113
|
|
|
87
|
-
generateHtml(data);
|
|
114
|
+
generateHtml(data, '#initMenu');
|
|
88
115
|
});
|
|
89
116
|
|
|
90
117
|
|
|
91
118
|
if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
|
|
92
119
|
let data = dynamicData.getData();
|
|
93
120
|
data = dynamicData.filterData(data, inputEl.value);
|
|
94
|
-
generateHtml(data);
|
|
121
|
+
generateHtml(data, '#initMenu');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// TODO: Need to refactor this to to not console a console error
|
|
125
|
+
const dynamicDataTwo = new DynamicData();
|
|
126
|
+
const dynamicMenuExampleElTwo = document.querySelector('#dynamicMenuExample');
|
|
127
|
+
const dropdownElTwo = dynamicMenuExampleElTwo.shadowRoot.querySelector(dynamicMenuExampleElTwo.dropdownTag._$litStatic$);
|
|
128
|
+
const inputElTwo = dropdownElTwo.querySelector(dynamicMenuExampleElTwo.inputTag._$litStatic$);
|
|
129
|
+
|
|
130
|
+
inputElTwo.addEventListener('input', () => {
|
|
131
|
+
let data = dynamicDataTwo.getData();
|
|
132
|
+
data = dynamicDataTwo.filterData(data, inputEl.value);
|
|
133
|
+
|
|
134
|
+
generateHtml(data, '#initMenuTwo');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
if (dynamicMenuExampleElTwo.value && dynamicMenuExampleElTwo.value.length > 0 && dynamicMenuExampleElTwo.input.value && (!dynamicMenuExampleElTwo.menu.availableOptions || dynamicMenuExampleElTwo.menu.availableOptions.length === 0)) {
|
|
138
|
+
let data = dynamicDataTwo.getData();
|
|
139
|
+
data = dynamicDataTwo.filterData(data, inputElTwo.value);
|
|
140
|
+
generateHtml(data, '#initMenuTwo');
|
|
95
141
|
}
|
|
96
142
|
}
|
|
97
143
|
|
|
@@ -5306,8 +5352,13 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5306
5352
|
}
|
|
5307
5353
|
|
|
5308
5354
|
if (event) {
|
|
5309
|
-
|
|
5310
|
-
|
|
5355
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
5356
|
+
try {
|
|
5357
|
+
this.triggerNode = event.target;
|
|
5358
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
5359
|
+
} catch (error) {
|
|
5360
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
5361
|
+
}
|
|
5311
5362
|
}
|
|
5312
5363
|
|
|
5313
5364
|
if (this.triggerContentSlot) {
|
|
@@ -10578,7 +10629,7 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10578
10629
|
...super.properties,
|
|
10579
10630
|
|
|
10580
10631
|
/**
|
|
10581
|
-
* If defined, the display value slot content will only mask the HTML5 input element. The
|
|
10632
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
10582
10633
|
*/
|
|
10583
10634
|
dvInputOnly: {
|
|
10584
10635
|
type: Boolean,
|
|
@@ -15855,7 +15906,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
15855
15906
|
|
|
15856
15907
|
var styleCss$4 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
15857
15908
|
|
|
15858
|
-
var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]
|
|
15909
|
+
var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}`;
|
|
15859
15910
|
|
|
15860
15911
|
var styleSnowflakeCss = i$5`:host([layout*=snowflake][shape*=snowflake]) [auro-input]{width:100%}:host([layout*=snowflake][shape*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake][shape*=snowflake])::part(helpText){text-align:center}`;
|
|
15861
15912
|
|
|
@@ -16671,11 +16722,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16671
16722
|
this.menu.value = this.value;
|
|
16672
16723
|
this.menu.matchWord = this.input.value;
|
|
16673
16724
|
|
|
16674
|
-
console.warn('syncValuesAndStates()');
|
|
16675
|
-
console.info('this.value', this.value);
|
|
16676
|
-
console.info('this.input.value', this.input.value);
|
|
16677
|
-
console.info('this.menu.value', this.menu.value);
|
|
16678
|
-
|
|
16679
16725
|
// Wait a lifecycle for child components to update
|
|
16680
16726
|
await Promise.all([this.menu.updateComplete]);
|
|
16681
16727
|
|
|
@@ -16709,6 +16755,8 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16709
16755
|
this.input.appendChild(displayValueEl.cloneNode(true));
|
|
16710
16756
|
}
|
|
16711
16757
|
}
|
|
16758
|
+
|
|
16759
|
+
this.requestUpdate();
|
|
16712
16760
|
}
|
|
16713
16761
|
|
|
16714
16762
|
/**
|
|
@@ -16730,7 +16778,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16730
16778
|
* @returns {void}
|
|
16731
16779
|
*/
|
|
16732
16780
|
handleMenuOptions() {
|
|
16733
|
-
console.warn('handleMenuOptions()');
|
|
16734
16781
|
this.resetMenuMatchword();
|
|
16735
16782
|
|
|
16736
16783
|
this.generateOptionsArray();
|
|
@@ -16917,7 +16964,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16917
16964
|
|
|
16918
16965
|
// handle the menu event for an option selection
|
|
16919
16966
|
this.menu.addEventListener('auroMenu-selectedOption', (evt) => {
|
|
16920
|
-
console.warn('event auroMenu-selectedOption', evt);
|
|
16921
16967
|
if (this.menu.optionSelected) {
|
|
16922
16968
|
const selected = this.menu.optionSelected;
|
|
16923
16969
|
|
|
@@ -17018,7 +17064,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17018
17064
|
* @returns {void}
|
|
17019
17065
|
*/
|
|
17020
17066
|
handleInputValueChange(event) {
|
|
17021
|
-
console.warn('handleInputValueChange', event);
|
|
17022
17067
|
if (event.target === this.inputInBib) {
|
|
17023
17068
|
this.input.value = this.inputInBib.value;
|
|
17024
17069
|
return;
|
|
@@ -17039,15 +17084,14 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17039
17084
|
this.validate();
|
|
17040
17085
|
}
|
|
17041
17086
|
|
|
17042
|
-
// Hide menu if value is empty, otherwise show if there are available suggestions
|
|
17043
17087
|
if (this.input.value && this.input.value.length === 0) {
|
|
17088
|
+
// Hide menu if value is empty, otherwise show if there are available suggestions
|
|
17044
17089
|
this.hideBib();
|
|
17045
|
-
}
|
|
17046
|
-
|
|
17047
|
-
// Force dropdown bib to hide if input value has no matching suggestions
|
|
17048
|
-
if (this.menu.loading) {
|
|
17090
|
+
} else if (this.menu.loading) {
|
|
17091
|
+
// if input has value but menu is loading, show bib immediately
|
|
17049
17092
|
this.showBib();
|
|
17050
17093
|
} else if ((!this.availableOptions || this.availableOptions.length === 0) && !this.dropdown.isBibFullscreen) {
|
|
17094
|
+
// Force dropdown bib to hide if input value has no matching suggestions
|
|
17051
17095
|
this.hideBib();
|
|
17052
17096
|
}
|
|
17053
17097
|
|
|
@@ -17180,10 +17224,11 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17180
17224
|
* @returns {void}
|
|
17181
17225
|
*/
|
|
17182
17226
|
reset() {
|
|
17183
|
-
this.input.reset();
|
|
17184
|
-
this.menu.reset();
|
|
17185
17227
|
this.optionSelected = undefined;
|
|
17186
17228
|
this.value = undefined;
|
|
17229
|
+
this.typedValue = undefined;
|
|
17230
|
+
this.input.value = undefined;
|
|
17231
|
+
this.menu.value = undefined;
|
|
17187
17232
|
this.validation.reset(this);
|
|
17188
17233
|
this.touched = false;
|
|
17189
17234
|
}
|
|
@@ -17307,7 +17352,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17307
17352
|
* @returns {void}
|
|
17308
17353
|
*/
|
|
17309
17354
|
handleSlotChange(event) {
|
|
17310
|
-
console.warn('handleSlotChange', event);
|
|
17311
17355
|
switch (event.target.name) {
|
|
17312
17356
|
case '':
|
|
17313
17357
|
if (!this.menu || this.menu !== this.querySelector('auro-menu, [auro-menu]')) {
|
|
@@ -17743,6 +17787,10 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17743
17787
|
updated(changedProperties) {
|
|
17744
17788
|
super.updated(changedProperties);
|
|
17745
17789
|
|
|
17790
|
+
if (changedProperties.has('optionSelected')) {
|
|
17791
|
+
this.notifySelectionChange();
|
|
17792
|
+
}
|
|
17793
|
+
|
|
17746
17794
|
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
17747
17795
|
// Reset selection if multiSelect mode changes
|
|
17748
17796
|
this.clearSelection();
|
|
@@ -17750,8 +17798,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17750
17798
|
|
|
17751
17799
|
|
|
17752
17800
|
if (changedProperties.has("value")) {
|
|
17753
|
-
console.warn('menu value updated', this.value);
|
|
17754
|
-
console.info('available options', this.availableOptions);
|
|
17755
17801
|
// Handle null/undefined case
|
|
17756
17802
|
if (this.value === undefined || this.value === null) {
|
|
17757
17803
|
this.clearSelection();
|
|
@@ -17763,12 +17809,9 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17763
17809
|
|
|
17764
17810
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
17765
17811
|
} else {
|
|
17766
|
-
console.info('single-select mode, looking for value', this.value);
|
|
17767
17812
|
// In single-select mode, this.value should be a string
|
|
17768
17813
|
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
17769
17814
|
|
|
17770
|
-
console.info('matchingOptions', matchingOptions);
|
|
17771
|
-
|
|
17772
17815
|
if (matchingOptions) {
|
|
17773
17816
|
this.optionSelected = matchingOptions;
|
|
17774
17817
|
this.index = this.items.indexOf(matchingOptions);
|
|
@@ -17777,8 +17820,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17777
17820
|
this.optionSelected = undefined;
|
|
17778
17821
|
this.index = -1;
|
|
17779
17822
|
}
|
|
17780
|
-
|
|
17781
|
-
console.warn('optionSelected', this.optionSelected);
|
|
17782
17823
|
}
|
|
17783
17824
|
|
|
17784
17825
|
// If no matching options were found in either mode
|
|
@@ -17805,11 +17846,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17805
17846
|
|
|
17806
17847
|
// Process all other UI updates
|
|
17807
17848
|
this.updateItemsState(changedProperties);
|
|
17808
|
-
|
|
17809
|
-
if (changedProperties.has('optionSelected')) {
|
|
17810
|
-
console.warn('updated: optionSelected', this.optionSelected);
|
|
17811
|
-
this.notifySelectionChange();
|
|
17812
|
-
}
|
|
17813
17849
|
}
|
|
17814
17850
|
|
|
17815
17851
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<!-- The below content is automatically added from ./../docs/partials/description.md -->
|
|
5
5
|
`<auro-combobox>` is the combination of [dropdown](http://auro.alaskaair.com/components/auro/dropdown), [input](http://auro.alaskaair.com/components/auro/input), and [menu](http://auro.alaskaair.com/components/auro/menu) and allows users to filter search results from a predefined list as they type. When the user starts typing in the text input, a dropdown of a menu shows up to display options that match the user’s search.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
By default, `auro-combobox` behaves as a suggestion list. This means any value may be typed into the combobox and the menu list presented effectively provides sample or suggestion options. With the use of the `persistInput` attribute the `auro-combobox` behaves as a filter of menu options. In this mode. typing into the input field will execute the filter but will not set the `value` of the combobox. The combobox value is set by selecting a menu option. Clicking the `X` clear button in the input will remove the current value of the HTML5 input causing the menu filter to reset as well as remove the current value of the combobox.
|
|
8
8
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
9
9
|
|
|
10
10
|
## auro-combobox use cases
|
|
@@ -5154,8 +5154,13 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5154
5154
|
}
|
|
5155
5155
|
|
|
5156
5156
|
if (event) {
|
|
5157
|
-
|
|
5158
|
-
|
|
5157
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
5158
|
+
try {
|
|
5159
|
+
this.triggerNode = event.target;
|
|
5160
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
5161
|
+
} catch (error) {
|
|
5162
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
5163
|
+
}
|
|
5159
5164
|
}
|
|
5160
5165
|
|
|
5161
5166
|
if (this.triggerContentSlot) {
|
|
@@ -10426,7 +10431,7 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10426
10431
|
...super.properties,
|
|
10427
10432
|
|
|
10428
10433
|
/**
|
|
10429
|
-
* If defined, the display value slot content will only mask the HTML5 input element. The
|
|
10434
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
10430
10435
|
*/
|
|
10431
10436
|
dvInputOnly: {
|
|
10432
10437
|
type: Boolean,
|
|
@@ -15703,7 +15708,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
15703
15708
|
|
|
15704
15709
|
var styleCss$4 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
15705
15710
|
|
|
15706
|
-
var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]
|
|
15711
|
+
var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}`;
|
|
15707
15712
|
|
|
15708
15713
|
var styleSnowflakeCss = i$5`:host([layout*=snowflake][shape*=snowflake]) [auro-input]{width:100%}:host([layout*=snowflake][shape*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake][shape*=snowflake])::part(helpText){text-align:center}`;
|
|
15709
15714
|
|
|
@@ -16519,11 +16524,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16519
16524
|
this.menu.value = this.value;
|
|
16520
16525
|
this.menu.matchWord = this.input.value;
|
|
16521
16526
|
|
|
16522
|
-
console.warn('syncValuesAndStates()');
|
|
16523
|
-
console.info('this.value', this.value);
|
|
16524
|
-
console.info('this.input.value', this.input.value);
|
|
16525
|
-
console.info('this.menu.value', this.menu.value);
|
|
16526
|
-
|
|
16527
16527
|
// Wait a lifecycle for child components to update
|
|
16528
16528
|
await Promise.all([this.menu.updateComplete]);
|
|
16529
16529
|
|
|
@@ -16557,6 +16557,8 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16557
16557
|
this.input.appendChild(displayValueEl.cloneNode(true));
|
|
16558
16558
|
}
|
|
16559
16559
|
}
|
|
16560
|
+
|
|
16561
|
+
this.requestUpdate();
|
|
16560
16562
|
}
|
|
16561
16563
|
|
|
16562
16564
|
/**
|
|
@@ -16578,7 +16580,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16578
16580
|
* @returns {void}
|
|
16579
16581
|
*/
|
|
16580
16582
|
handleMenuOptions() {
|
|
16581
|
-
console.warn('handleMenuOptions()');
|
|
16582
16583
|
this.resetMenuMatchword();
|
|
16583
16584
|
|
|
16584
16585
|
this.generateOptionsArray();
|
|
@@ -16765,7 +16766,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16765
16766
|
|
|
16766
16767
|
// handle the menu event for an option selection
|
|
16767
16768
|
this.menu.addEventListener('auroMenu-selectedOption', (evt) => {
|
|
16768
|
-
console.warn('event auroMenu-selectedOption', evt);
|
|
16769
16769
|
if (this.menu.optionSelected) {
|
|
16770
16770
|
const selected = this.menu.optionSelected;
|
|
16771
16771
|
|
|
@@ -16866,7 +16866,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16866
16866
|
* @returns {void}
|
|
16867
16867
|
*/
|
|
16868
16868
|
handleInputValueChange(event) {
|
|
16869
|
-
console.warn('handleInputValueChange', event);
|
|
16870
16869
|
if (event.target === this.inputInBib) {
|
|
16871
16870
|
this.input.value = this.inputInBib.value;
|
|
16872
16871
|
return;
|
|
@@ -16887,15 +16886,14 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16887
16886
|
this.validate();
|
|
16888
16887
|
}
|
|
16889
16888
|
|
|
16890
|
-
// Hide menu if value is empty, otherwise show if there are available suggestions
|
|
16891
16889
|
if (this.input.value && this.input.value.length === 0) {
|
|
16890
|
+
// Hide menu if value is empty, otherwise show if there are available suggestions
|
|
16892
16891
|
this.hideBib();
|
|
16893
|
-
}
|
|
16894
|
-
|
|
16895
|
-
// Force dropdown bib to hide if input value has no matching suggestions
|
|
16896
|
-
if (this.menu.loading) {
|
|
16892
|
+
} else if (this.menu.loading) {
|
|
16893
|
+
// if input has value but menu is loading, show bib immediately
|
|
16897
16894
|
this.showBib();
|
|
16898
16895
|
} else if ((!this.availableOptions || this.availableOptions.length === 0) && !this.dropdown.isBibFullscreen) {
|
|
16896
|
+
// Force dropdown bib to hide if input value has no matching suggestions
|
|
16899
16897
|
this.hideBib();
|
|
16900
16898
|
}
|
|
16901
16899
|
|
|
@@ -17028,10 +17026,11 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17028
17026
|
* @returns {void}
|
|
17029
17027
|
*/
|
|
17030
17028
|
reset() {
|
|
17031
|
-
this.input.reset();
|
|
17032
|
-
this.menu.reset();
|
|
17033
17029
|
this.optionSelected = undefined;
|
|
17034
17030
|
this.value = undefined;
|
|
17031
|
+
this.typedValue = undefined;
|
|
17032
|
+
this.input.value = undefined;
|
|
17033
|
+
this.menu.value = undefined;
|
|
17035
17034
|
this.validation.reset(this);
|
|
17036
17035
|
this.touched = false;
|
|
17037
17036
|
}
|
|
@@ -17155,7 +17154,6 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17155
17154
|
* @returns {void}
|
|
17156
17155
|
*/
|
|
17157
17156
|
handleSlotChange(event) {
|
|
17158
|
-
console.warn('handleSlotChange', event);
|
|
17159
17157
|
switch (event.target.name) {
|
|
17160
17158
|
case '':
|
|
17161
17159
|
if (!this.menu || this.menu !== this.querySelector('auro-menu, [auro-menu]')) {
|
|
@@ -17591,6 +17589,10 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17591
17589
|
updated(changedProperties) {
|
|
17592
17590
|
super.updated(changedProperties);
|
|
17593
17591
|
|
|
17592
|
+
if (changedProperties.has('optionSelected')) {
|
|
17593
|
+
this.notifySelectionChange();
|
|
17594
|
+
}
|
|
17595
|
+
|
|
17594
17596
|
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
17595
17597
|
// Reset selection if multiSelect mode changes
|
|
17596
17598
|
this.clearSelection();
|
|
@@ -17598,8 +17600,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17598
17600
|
|
|
17599
17601
|
|
|
17600
17602
|
if (changedProperties.has("value")) {
|
|
17601
|
-
console.warn('menu value updated', this.value);
|
|
17602
|
-
console.info('available options', this.availableOptions);
|
|
17603
17603
|
// Handle null/undefined case
|
|
17604
17604
|
if (this.value === undefined || this.value === null) {
|
|
17605
17605
|
this.clearSelection();
|
|
@@ -17611,12 +17611,9 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17611
17611
|
|
|
17612
17612
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
17613
17613
|
} else {
|
|
17614
|
-
console.info('single-select mode, looking for value', this.value);
|
|
17615
17614
|
// In single-select mode, this.value should be a string
|
|
17616
17615
|
const matchingOptions = this.items.find((item) => item.value === this.value);
|
|
17617
17616
|
|
|
17618
|
-
console.info('matchingOptions', matchingOptions);
|
|
17619
|
-
|
|
17620
17617
|
if (matchingOptions) {
|
|
17621
17618
|
this.optionSelected = matchingOptions;
|
|
17622
17619
|
this.index = this.items.indexOf(matchingOptions);
|
|
@@ -17625,8 +17622,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17625
17622
|
this.optionSelected = undefined;
|
|
17626
17623
|
this.index = -1;
|
|
17627
17624
|
}
|
|
17628
|
-
|
|
17629
|
-
console.warn('optionSelected', this.optionSelected);
|
|
17630
17625
|
}
|
|
17631
17626
|
|
|
17632
17627
|
// If no matching options were found in either mode
|
|
@@ -17653,11 +17648,6 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17653
17648
|
|
|
17654
17649
|
// Process all other UI updates
|
|
17655
17650
|
this.updateItemsState(changedProperties);
|
|
17656
|
-
|
|
17657
|
-
if (changedProperties.has('optionSelected')) {
|
|
17658
|
-
console.warn('updated: optionSelected', this.optionSelected);
|
|
17659
|
-
this.notifySelectionChange();
|
|
17660
|
-
}
|
|
17661
17651
|
}
|
|
17662
17652
|
|
|
17663
17653
|
/**
|
|
@@ -22,7 +22,7 @@ The following sections are editable by making changes to the following files:
|
|
|
22
22
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
23
23
|
`<auro-combobox>` is the combination of [dropdown](http://auro.alaskaair.com/components/auro/dropdown), [input](http://auro.alaskaair.com/components/auro/input), and [menu](http://auro.alaskaair.com/components/auro/menu) and allows users to filter search results from a predefined list as they type. When the user starts typing in the text input, a dropdown of a menu shows up to display options that match the user’s search.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
By default, `auro-combobox` behaves as a suggestion list. This means any value may be typed into the combobox and the menu list presented effectively provides sample or suggestion options. With the use of the `persistInput` attribute the `auro-combobox` behaves as a filter of menu options. In this mode. typing into the input field will execute the filter but will not set the `value` of the combobox. The combobox value is set by selecting a menu option. Clicking the `X` clear button in the input will remove the current value of the HTML5 input causing the menu filter to reset as well as remove the current value of the combobox.
|
|
26
26
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
27
27
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
28
28
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|