@aurodesignsystem-dev/auro-formkit 0.0.0-pr1052.2 → 0.0.0-pr1052.20
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 +134 -41
- package/components/combobox/demo/api.min.js +116 -62
- package/components/combobox/demo/index.md +1 -1
- package/components/combobox/demo/index.min.js +66 -58
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +35 -33
- package/components/combobox/dist/index.js +62 -58
- package/components/combobox/dist/registered.js +62 -58
- package/components/datepicker/demo/api.min.js +1 -1
- package/components/datepicker/demo/index.min.js +1 -1
- package/components/datepicker/dist/index.js +1 -1
- package/components/datepicker/dist/registered.js +1 -1
- 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 -0
- package/components/menu/demo/index.min.js +4 -0
- package/components/menu/dist/index.js +4 -0
- package/components/menu/dist/registered.js +4 -0
- package/components/select/demo/api.min.js +5 -1
- package/components/select/demo/index.min.js +5 -1
- package/components/select/dist/index.js +1 -1
- package/components/select/dist/registered.js +1 -1
- 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 -->
|
|
@@ -5,38 +5,42 @@
|
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
-
| Property | Attribute | Modifiers | Type | Default
|
|
9
|
-
|
|
10
|
-
| [autoPlacement](#autoPlacement) | `autoPlacement` | | `boolean` |
|
|
11
|
-
| [autocomplete](#autocomplete) | `autocomplete` | | `string` | "false"
|
|
12
|
-
| [checkmark](#checkmark) | `checkmark` | | `boolean` |
|
|
13
|
-
| [disabled](#disabled) | `disabled` | | `boolean` |
|
|
14
|
-
| [dvInputOnly](#dvInputOnly) | `dvInputOnly` | | `boolean` |
|
|
15
|
-
| [error](#error) | `error` | | `string` |
|
|
16
|
-
| [format](#format) | `format` | | `string` |
|
|
17
|
-
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | | `string` | "sm"
|
|
18
|
-
| [inputValue](#inputValue) | | readonly | `string \| undefined` |
|
|
19
|
-
| [inputmode](#inputmode) | `inputmode` | | `string` |
|
|
20
|
-
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | | `boolean` |
|
|
21
|
-
| [layout](#layout) | | | `string` |
|
|
22
|
-
| [matchWidth](#matchWidth) | `matchWidth` | | `boolean` | true
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
8
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
9
|
+
|---------------------------------|---------------------------------|-----------|-----------------------|----------------------------|--------------------------------------------------|
|
|
10
|
+
| [autoPlacement](#autoPlacement) | `autoPlacement` | | `boolean` | false | If declared, bib's position will be automatically calculated where to appear. |
|
|
11
|
+
| [autocomplete](#autocomplete) | `autocomplete` | | `string` | "false" | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
|
|
12
|
+
| [checkmark](#checkmark) | `checkmark` | | `boolean` | false | When attribute is present auro-menu will apply check marks to selected options. |
|
|
13
|
+
| [disabled](#disabled) | `disabled` | | `boolean` | false | If set, disables the combobox. |
|
|
14
|
+
| [dvInputOnly](#dvInputOnly) | `dvInputOnly` | | `boolean` | false | If defined, the display value slot content will only mask the HTML5 input element. The inputs label will not be masked. |
|
|
15
|
+
| [error](#error) | `error` | | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
|
|
16
|
+
| [format](#format) | `format` | | `string` | | Specifies the input mask format. |
|
|
17
|
+
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
|
|
18
|
+
| [inputValue](#inputValue) | | readonly | `string \| undefined` | | Returns the current value of the input element within the combobox. |
|
|
19
|
+
| [inputmode](#inputmode) | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
|
|
20
|
+
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
|
|
21
|
+
| [layout](#layout) | | | `string` | "classic" | |
|
|
22
|
+
| [matchWidth](#matchWidth) | `matchWidth` | | `boolean` | true | If declared, the popover and trigger will be set to the same width. |
|
|
23
|
+
| [msgSelectionMissing](#msgSelectionMissing) | | | `string` | "Please select an option." | |
|
|
24
|
+
| [noFilter](#noFilter) | `noFilter` | | `boolean` | false | If set, combobox will not filter menuoptions based in input. |
|
|
25
|
+
| [noFlip](#noFlip) | `noFlip` | | `boolean` | "false" | If declared, the bib will NOT flip to an alternate position<br />when there isn't enough space in the specified `placement`. |
|
|
26
|
+
| [noValidate](#noValidate) | `noValidate` | | `boolean` | false | If set, disables auto-validation on blur. |
|
|
27
|
+
| [offset](#offset) | `offset` | | `number` | "0" | Gap between the trigger element and bib. |
|
|
28
|
+
| [onDark](#onDark) | `onDark` | | `boolean` | | If declared, onDark styles will be applied to the trigger. |
|
|
29
|
+
| [optionSelected](#optionSelected) | `optionSelected` | | `HTMLElement` | | Specifies the current selected option. |
|
|
30
|
+
| [persistInput](#persistInput) | `persistInput` | | `Boolean` | false | If declared, selecting a menu option will not change the input value. By doing so,<br />the current menu filter will be preserved and the user can continue from their last<br />filter state. It is recommended to use this in combination with the `displayValue` slot. |
|
|
31
|
+
| [placeholder](#placeholder) | `placeholder` | | `string` | | Define custom placeholder text, only supported by date input formats. |
|
|
32
|
+
| [placement](#placement) | `placement` | | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
|
|
33
|
+
| [required](#required) | `required` | | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
|
|
34
|
+
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
35
|
+
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
|
|
36
|
+
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
37
|
+
| [shape](#shape) | | | `string` | "classic" | |
|
|
38
|
+
| [size](#size) | | | `string` | "xl" | |
|
|
39
|
+
| [triggerIcon](#triggerIcon) | `triggerIcon` | | `boolean` | false | If set, the `icon` attribute will be applied to the trigger `auro-input` element. |
|
|
40
|
+
| [type](#type) | `type` | | `string` | | Applies the defined value as the type attribute on auro-input. |
|
|
41
|
+
| [typedValue](#typedValue) | `typedValue` | | `string` | "undefined" | Specifies the value of the input element within the combobox. |
|
|
42
|
+
| [validity](#validity) | `validity` | | `string` | | Specifies the `validityState` this element is in. |
|
|
43
|
+
| [value](#value) | `value` | | `string` | "undefined" | Value selected for the dropdown menu. |
|
|
40
44
|
|
|
41
45
|
## Methods
|
|
42
46
|
|
|
@@ -166,7 +170,7 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
166
170
|
<!-- ----------------- -->
|
|
167
171
|
<auro-combobox
|
|
168
172
|
id="dynamicMenuExample"
|
|
169
|
-
value="
|
|
173
|
+
value="TAN"
|
|
170
174
|
layout="snowflake"
|
|
171
175
|
shape="snowflake"
|
|
172
176
|
size="lg"
|
|
@@ -176,13 +180,35 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
176
180
|
dvInputOnly
|
|
177
181
|
required>
|
|
178
182
|
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
179
|
-
<span slot="label">
|
|
183
|
+
<span slot="label">First</span>
|
|
180
184
|
<!--
|
|
181
185
|
The auro-combobox element requires an empty auro-menu element
|
|
182
186
|
due to the requirements of auro-dropdown and auro-input
|
|
183
187
|
-->
|
|
184
188
|
<auro-menu id="initMenu"></auro-menu>
|
|
185
|
-
</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>
|
|
186
212
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
187
213
|
</div>
|
|
188
214
|
<auro-accordion alignRight>
|
|
@@ -195,7 +221,7 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
195
221
|
<!-- ----------------- -->
|
|
196
222
|
<auro-combobox
|
|
197
223
|
id="dynamicMenuExample"
|
|
198
|
-
value="
|
|
224
|
+
value="TAN"
|
|
199
225
|
layout="snowflake"
|
|
200
226
|
shape="snowflake"
|
|
201
227
|
size="lg"
|
|
@@ -205,13 +231,35 @@ The menu in this example was populated from data from a country/city API. To kee
|
|
|
205
231
|
dvInputOnly
|
|
206
232
|
required>
|
|
207
233
|
<span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
|
|
208
|
-
<span slot="label">
|
|
234
|
+
<span slot="label">First</span>
|
|
209
235
|
<!--
|
|
210
236
|
The auro-combobox element requires an empty auro-menu element
|
|
211
237
|
due to the requirements of auro-dropdown and auro-input
|
|
212
238
|
-->
|
|
213
239
|
<auro-menu id="initMenu"></auro-menu>
|
|
214
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>
|
|
215
263
|
```
|
|
216
264
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
217
265
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamicMenu.js) -->
|
|
@@ -230,9 +278,36 @@ export async function dynamicMenuExample() {
|
|
|
230
278
|
}
|
|
231
279
|
}
|
|
232
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
|
+
console.warn('timeout executed ============================');
|
|
299
|
+
elOne.typedValue = elTwoInputValue;
|
|
300
|
+
elTwo.typedValue = elOneInputValue;
|
|
301
|
+
}, 0);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
document.querySelector('#dynamicMenuSwapButton').addEventListener('click', () => {
|
|
305
|
+
swapValues();
|
|
306
|
+
});
|
|
307
|
+
|
|
233
308
|
// Generates HTML for menu and submenus using country & city data from an external API
|
|
234
|
-
function generateHtml(data) {
|
|
235
|
-
const initialMenu = document.querySelector(
|
|
309
|
+
function generateHtml(data, selector) {
|
|
310
|
+
const initialMenu = document.querySelector(selector);
|
|
236
311
|
|
|
237
312
|
resetMenu(initialMenu);
|
|
238
313
|
|
|
@@ -275,13 +350,31 @@ export async function dynamicMenuExample() {
|
|
|
275
350
|
let data = dynamicData.getData();
|
|
276
351
|
data = dynamicData.filterData(data, inputEl.value);
|
|
277
352
|
|
|
278
|
-
generateHtml(data);
|
|
353
|
+
generateHtml(data, '#initMenu');
|
|
279
354
|
});
|
|
280
355
|
|
|
281
356
|
if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
|
|
282
357
|
let data = dynamicData.getData();
|
|
283
358
|
data = dynamicData.filterData(data, inputEl.value);
|
|
284
|
-
generateHtml(data);
|
|
359
|
+
generateHtml(data, '#initMenu');
|
|
360
|
+
}
|
|
361
|
+
|
|
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');
|
|
285
378
|
}
|
|
286
379
|
}
|
|
287
380
|
```
|
|
@@ -40,9 +40,37 @@ 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
|
+
console.warn('timeout executed ============================');
|
|
62
|
+
elOne.typedValue = elTwoInputValue;
|
|
63
|
+
elTwo.typedValue = elOneInputValue;
|
|
64
|
+
}, 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
document.querySelector('#dynamicMenuSwapButton').addEventListener('click', () => {
|
|
68
|
+
swapValues();
|
|
69
|
+
});
|
|
70
|
+
|
|
43
71
|
// Generates HTML for menu and submenus using country & city data from an external API
|
|
44
|
-
function generateHtml(data) {
|
|
45
|
-
const initialMenu = document.querySelector(
|
|
72
|
+
function generateHtml(data, selector) {
|
|
73
|
+
const initialMenu = document.querySelector(selector);
|
|
46
74
|
|
|
47
75
|
resetMenu(initialMenu);
|
|
48
76
|
|
|
@@ -84,14 +112,32 @@ async function dynamicMenuExample() {
|
|
|
84
112
|
let data = dynamicData.getData();
|
|
85
113
|
data = dynamicData.filterData(data, inputEl.value);
|
|
86
114
|
|
|
87
|
-
generateHtml(data);
|
|
115
|
+
generateHtml(data, '#initMenu');
|
|
88
116
|
});
|
|
89
117
|
|
|
90
118
|
|
|
91
119
|
if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
|
|
92
120
|
let data = dynamicData.getData();
|
|
93
121
|
data = dynamicData.filterData(data, inputEl.value);
|
|
94
|
-
generateHtml(data);
|
|
122
|
+
generateHtml(data, '#initMenu');
|
|
123
|
+
}
|
|
124
|
+
|
|
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
|
|
|
@@ -10578,7 +10624,7 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10578
10624
|
...super.properties,
|
|
10579
10625
|
|
|
10580
10626
|
/**
|
|
10581
|
-
* If defined, the display value slot content will only mask the HTML5 input element. The
|
|
10627
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
10582
10628
|
*/
|
|
10583
10629
|
dvInputOnly: {
|
|
10584
10630
|
type: Boolean,
|
|
@@ -15855,7 +15901,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
15855
15901
|
|
|
15856
15902
|
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
15903
|
|
|
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]
|
|
15904
|
+
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
15905
|
|
|
15860
15906
|
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
15907
|
|
|
@@ -16193,80 +16239,60 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16193
16239
|
constructor() {
|
|
16194
16240
|
super();
|
|
16195
16241
|
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
this.privateDefaults();
|
|
16199
|
-
}
|
|
16200
|
-
|
|
16201
|
-
/**
|
|
16202
|
-
* @private
|
|
16203
|
-
* @returns {void} Internal defaults.
|
|
16204
|
-
*/
|
|
16205
|
-
privateDefaults() {
|
|
16206
|
-
this.touched = false;
|
|
16207
|
-
this.dropdownOpen = false;
|
|
16208
|
-
this.dropdownId = undefined;
|
|
16209
|
-
this.onDark = false;
|
|
16210
|
-
|
|
16211
|
-
this.noFilter = false;
|
|
16212
|
-
this.validity = undefined;
|
|
16213
|
-
this.value = undefined;
|
|
16214
|
-
this.optionSelected = undefined;
|
|
16215
|
-
|
|
16216
|
-
this.checkmark = false;
|
|
16242
|
+
// Defaults that effect the combobox behavior and state
|
|
16217
16243
|
this.disabled = false;
|
|
16244
|
+
this.msgSelectionMissing = 'Please select an option.';
|
|
16245
|
+
this.noFilter = false;
|
|
16218
16246
|
this.noValidate = false;
|
|
16219
|
-
this.required = false;
|
|
16220
|
-
this.triggerIcon = false;
|
|
16221
|
-
|
|
16222
|
-
this.availableOptions = [];
|
|
16223
16247
|
this.optionActive = null;
|
|
16224
|
-
this.msgSelectionMissing = 'Please select an option.';
|
|
16225
|
-
|
|
16226
|
-
this.fullscreenBreakpoint = 'sm';
|
|
16227
|
-
this.largeFullscreenHeadline = false;
|
|
16228
|
-
|
|
16229
|
-
this.validation = new AuroFormValidation$1();
|
|
16230
|
-
|
|
16231
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
16232
|
-
|
|
16233
|
-
this.isHiddenWhileLoading = false;
|
|
16234
|
-
|
|
16235
16248
|
this.persistInput = false;
|
|
16249
|
+
this.required = false;
|
|
16250
|
+
this.value = undefined;
|
|
16251
|
+
this.typedValue = undefined;
|
|
16236
16252
|
|
|
16253
|
+
// Defaults that effect the overall layout of the combobox
|
|
16254
|
+
this.checkmark = false;
|
|
16237
16255
|
this.dvInputOnly = false;
|
|
16238
|
-
|
|
16239
|
-
// Error message
|
|
16240
|
-
this.errorMessage = null;
|
|
16241
|
-
|
|
16242
|
-
// Layout Config
|
|
16243
|
-
/**
|
|
16244
|
-
* @private
|
|
16245
|
-
*/
|
|
16256
|
+
this.fullscreenBreakpoint = 'sm';
|
|
16246
16257
|
this.layout = 'classic';
|
|
16247
|
-
|
|
16248
|
-
/**
|
|
16249
|
-
* @private
|
|
16250
|
-
*/
|
|
16258
|
+
this.matchWidth = true;
|
|
16251
16259
|
this.shape = 'classic';
|
|
16252
|
-
|
|
16253
|
-
/**
|
|
16254
|
-
* @private
|
|
16255
|
-
*/
|
|
16256
16260
|
this.size = 'xl';
|
|
16261
|
+
this.triggerIcon = false;
|
|
16257
16262
|
|
|
16258
|
-
//
|
|
16263
|
+
// Defaults that effect the dropdown
|
|
16259
16264
|
this.placement = 'bottom-start';
|
|
16260
16265
|
this.offset = 0;
|
|
16261
16266
|
this.noFlip = false;
|
|
16262
16267
|
this.autoPlacement = false;
|
|
16263
16268
|
|
|
16269
|
+
this.privateDefaults();
|
|
16270
|
+
}
|
|
16271
|
+
|
|
16272
|
+
/**
|
|
16273
|
+
* @private
|
|
16274
|
+
* @returns {void} Internal defaults.
|
|
16275
|
+
*/
|
|
16276
|
+
privateDefaults() {
|
|
16264
16277
|
const versioning = new AuroDependencyVersioning$3();
|
|
16265
16278
|
|
|
16266
16279
|
this.dropdownTag = versioning.generateTag('auro-formkit-combobox-dropdown', dropdownVersion, AuroDropdown);
|
|
16267
16280
|
this.bibtemplateTag = versioning.generateTag('auro-formkit-combobox-bibtemplate', bibTemplateVersion, AuroBibtemplate);
|
|
16268
16281
|
this.inputTag = versioning.generateTag('auro-formkit-combobox-input', inputVersion, AuroInput);
|
|
16269
16282
|
this.helpTextTag = versioning.generateTag('auro-formkit-input-helptext', '1.0.0', AuroHelpText);
|
|
16283
|
+
|
|
16284
|
+
this.availableOptions = [];
|
|
16285
|
+
this.dropdownId = undefined;
|
|
16286
|
+
this.dropdownOpen = false;
|
|
16287
|
+
this.errorMessage = null;
|
|
16288
|
+
this.isHiddenWhileLoading = false;
|
|
16289
|
+
this.largeFullscreenHeadline = false;
|
|
16290
|
+
this.onDark = false;
|
|
16291
|
+
this.optionSelected = undefined;
|
|
16292
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$6();
|
|
16293
|
+
this.touched = false;
|
|
16294
|
+
this.validation = new AuroFormValidation$1();
|
|
16295
|
+
this.validity = undefined;
|
|
16270
16296
|
}
|
|
16271
16297
|
|
|
16272
16298
|
// This function is to define props used within the scope of this component
|
|
@@ -16521,6 +16547,14 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16521
16547
|
reflect: true
|
|
16522
16548
|
},
|
|
16523
16549
|
|
|
16550
|
+
/**
|
|
16551
|
+
* Specifies the value of the input element within the combobox.
|
|
16552
|
+
*/
|
|
16553
|
+
typedValue: {
|
|
16554
|
+
type: String,
|
|
16555
|
+
reflect: true
|
|
16556
|
+
},
|
|
16557
|
+
|
|
16524
16558
|
/**
|
|
16525
16559
|
* Specifies the `validityState` this element is in.
|
|
16526
16560
|
*/
|
|
@@ -16591,6 +16625,13 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16591
16625
|
return this.input.value;
|
|
16592
16626
|
}
|
|
16593
16627
|
|
|
16628
|
+
// /**
|
|
16629
|
+
// * Sets the value of the input element within the combobox.
|
|
16630
|
+
// */
|
|
16631
|
+
// set inputValue(value) {
|
|
16632
|
+
// this.input.value = value;
|
|
16633
|
+
// }
|
|
16634
|
+
|
|
16594
16635
|
/**
|
|
16595
16636
|
* Checks if the element is valid.
|
|
16596
16637
|
* @returns {boolean} - Returns true if the element is valid, false otherwise.
|
|
@@ -16709,6 +16750,8 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16709
16750
|
this.input.appendChild(displayValueEl.cloneNode(true));
|
|
16710
16751
|
}
|
|
16711
16752
|
}
|
|
16753
|
+
|
|
16754
|
+
this.requestUpdate();
|
|
16712
16755
|
}
|
|
16713
16756
|
|
|
16714
16757
|
/**
|
|
@@ -16735,6 +16778,10 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16735
16778
|
this.generateOptionsArray();
|
|
16736
16779
|
this.availableOptions = [];
|
|
16737
16780
|
this.updateFilter();
|
|
16781
|
+
|
|
16782
|
+
if (this.value && this.input.value && !this.menu.value) {
|
|
16783
|
+
this.syncValuesAndStates();
|
|
16784
|
+
}
|
|
16738
16785
|
}
|
|
16739
16786
|
|
|
16740
16787
|
/**
|
|
@@ -16922,7 +16969,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16922
16969
|
|
|
16923
16970
|
if (!this.value || this.value !== this.optionSelected.value) {
|
|
16924
16971
|
this.value = this.optionSelected.value;
|
|
16925
|
-
this.menu.value = this.value;
|
|
16972
|
+
// this.menu.value = this.value;
|
|
16926
16973
|
}
|
|
16927
16974
|
|
|
16928
16975
|
this.updateTriggerTextDisplay();
|
|
@@ -17174,10 +17221,11 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17174
17221
|
* @returns {void}
|
|
17175
17222
|
*/
|
|
17176
17223
|
reset() {
|
|
17177
|
-
this.input.reset();
|
|
17178
|
-
this.menu.reset();
|
|
17179
17224
|
this.optionSelected = undefined;
|
|
17180
17225
|
this.value = undefined;
|
|
17226
|
+
this.typedValue = undefined;
|
|
17227
|
+
this.input.value = undefined;
|
|
17228
|
+
this.menu.value = undefined;
|
|
17181
17229
|
this.validation.reset(this);
|
|
17182
17230
|
this.touched = false;
|
|
17183
17231
|
}
|
|
@@ -17382,6 +17430,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17382
17430
|
.inputmode="${this.inputmode}"
|
|
17383
17431
|
.placeholder="${this.placeholder}"
|
|
17384
17432
|
.type="${this.type}"
|
|
17433
|
+
.value="${this.typedValue}"
|
|
17385
17434
|
?disabled="${this.disabled}"
|
|
17386
17435
|
?icon="${this.triggerIcon}"
|
|
17387
17436
|
?dvInputOnly="${this.dvInputOnly}"
|
|
@@ -17416,6 +17465,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
17416
17465
|
.inputmode="${this.inputmode}"
|
|
17417
17466
|
.placeholder="${this.placeholder}"
|
|
17418
17467
|
.type="${this.type}"
|
|
17468
|
+
.value="${this.typedValue}"
|
|
17419
17469
|
?disabled="${this.disabled}"
|
|
17420
17470
|
?icon="${this.triggerIcon}"
|
|
17421
17471
|
?required="${this.required}"
|
|
@@ -17733,6 +17783,10 @@ class AuroMenu extends AuroElement$1 {
|
|
|
17733
17783
|
updated(changedProperties) {
|
|
17734
17784
|
super.updated(changedProperties);
|
|
17735
17785
|
|
|
17786
|
+
if (changedProperties.has('optionSelected')) {
|
|
17787
|
+
this.notifySelectionChange();
|
|
17788
|
+
}
|
|
17789
|
+
|
|
17736
17790
|
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
17737
17791
|
// Reset selection if multiSelect mode changes
|
|
17738
17792
|
this.clearSelection();
|
|
@@ -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
|