@aurodesignsystem/auro-formkit 3.4.1-rc-602.2.1 → 3.5.0-rc-627.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/api.md +1 -1
- package/components/checkbox/demo/api.min.js +31 -8
- package/components/checkbox/demo/index.min.js +31 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +13 -6
- package/components/checkbox/dist/index.js +31 -8
- package/components/checkbox/dist/registered.js +31 -8
- package/components/combobox/demo/api.md +25 -25
- package/components/combobox/demo/api.min.js +48 -13
- package/components/combobox/demo/index.min.js +48 -13
- package/components/combobox/dist/auro-combobox.d.ts +2 -4
- package/components/combobox/dist/index.js +47 -12
- package/components/combobox/dist/registered.js +47 -12
- package/components/counter/demo/api.min.js +14 -1
- package/components/counter/demo/index.min.js +14 -1
- package/components/counter/dist/index.js +14 -1
- package/components/counter/dist/registered.js +14 -1
- package/components/datepicker/demo/api.min.js +45 -12
- package/components/datepicker/demo/index.min.js +45 -12
- package/components/datepicker/dist/index.js +45 -12
- package/components/datepicker/dist/registered.js +45 -12
- package/components/form/demo/api.md +1 -5
- package/components/form/demo/api.min.js +8 -2
- package/components/form/demo/index.html +1 -0
- package/components/form/demo/index.md +321 -27
- package/components/form/demo/index.min.js +8 -2
- package/components/form/demo/registerDemoDeps.js +1 -0
- package/components/form/dist/auro-form.d.ts +12 -6
- package/components/form/dist/index.js +8 -2
- package/components/form/dist/registered.js +8 -2
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +31 -11
- package/components/input/demo/index.min.js +31 -11
- package/components/input/dist/base-input.d.ts +13 -6
- package/components/input/dist/index.js +31 -11
- package/components/input/dist/registered.js +31 -11
- package/components/menu/demo/api.md +11 -17
- package/components/menu/demo/api.min.js +1 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/dist/registered.js +1 -1
- package/components/radio/demo/api.md +1 -1
- package/components/radio/demo/api.min.js +32 -4
- package/components/radio/demo/index.min.js +32 -4
- package/components/radio/dist/auro-radio.d.ts +14 -3
- package/components/radio/dist/index.js +32 -4
- package/components/radio/dist/registered.js +32 -4
- package/components/select/demo/api.html +15 -0
- package/components/select/demo/api.md +178 -0
- package/components/select/demo/api.min.js +84 -3
- package/components/select/demo/index.html +15 -0
- package/components/select/demo/index.md +177 -0
- package/components/select/demo/index.min.js +84 -3
- package/components/select/dist/auro-select.d.ts +27 -0
- package/components/select/dist/index.js +84 -2
- package/components/select/dist/registered.js +84 -2
- package/package.json +1 -1
|
@@ -92,6 +92,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
92
92
|
* @attr {Boolean} error - If set to true, sets an error state on the radio button.
|
|
93
93
|
* @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
|
|
94
94
|
* @event toggleSelected - Notifies that the component has toggled the checked/selected state.
|
|
95
|
+
*
|
|
96
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
97
|
+
* @attr id
|
|
98
|
+
*
|
|
95
99
|
* @event focusSelected - Notifies that the component has gained focus.
|
|
96
100
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
97
101
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
@@ -147,7 +151,6 @@ class AuroRadio extends LitElement {
|
|
|
147
151
|
type: Boolean,
|
|
148
152
|
reflect: true
|
|
149
153
|
},
|
|
150
|
-
id: { type: String },
|
|
151
154
|
label: { type: String },
|
|
152
155
|
name: { type: String },
|
|
153
156
|
value: { type: String },
|
|
@@ -164,6 +167,16 @@ class AuroRadio extends LitElement {
|
|
|
164
167
|
type: Boolean,
|
|
165
168
|
reflect: true,
|
|
166
169
|
attribute: false
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @private
|
|
174
|
+
* id for input node
|
|
175
|
+
*/
|
|
176
|
+
inputId: {
|
|
177
|
+
type: String,
|
|
178
|
+
reflect: false,
|
|
179
|
+
attribute: false
|
|
167
180
|
}
|
|
168
181
|
};
|
|
169
182
|
}
|
|
@@ -299,6 +312,8 @@ class AuroRadio extends LitElement {
|
|
|
299
312
|
|
|
300
313
|
this.input = this.shadowRoot.querySelector('input');
|
|
301
314
|
|
|
315
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
316
|
+
|
|
302
317
|
this.addEventListener('click', () => {
|
|
303
318
|
this.input.click();
|
|
304
319
|
});
|
|
@@ -325,14 +340,14 @@ class AuroRadio extends LitElement {
|
|
|
325
340
|
aria-invalid="${this.invalid(this.error)}"
|
|
326
341
|
aria-required="${this.isRequired(this.required)}"
|
|
327
342
|
.checked="${this.checked}"
|
|
328
|
-
id="${
|
|
343
|
+
id="${this.inputId}"
|
|
329
344
|
name="${ifDefined(this.name)}"
|
|
330
345
|
type="radio"
|
|
331
346
|
.value="${this.value}"
|
|
332
347
|
tabIndex="-1"
|
|
333
348
|
/>
|
|
334
349
|
|
|
335
|
-
<label for="${
|
|
350
|
+
<label for="${this.inputId}" class="${classMap(labelClasses)}">
|
|
336
351
|
<slot>${this.label}</slot>
|
|
337
352
|
</label>
|
|
338
353
|
|
|
@@ -1003,7 +1018,20 @@ class AuroFormValidation {
|
|
|
1003
1018
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
1004
1019
|
*/
|
|
1005
1020
|
|
|
1006
|
-
let hasValue =
|
|
1021
|
+
let hasValue = false;
|
|
1022
|
+
|
|
1023
|
+
// Check string for having a value
|
|
1024
|
+
if (typeof elem.value === "string") {
|
|
1025
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// Check array value types for having a value
|
|
1029
|
+
if (Array.isArray(elem.value)) {
|
|
1030
|
+
hasValue = Boolean(
|
|
1031
|
+
elem.value.length > 0 &&
|
|
1032
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1007
1035
|
|
|
1008
1036
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
1009
1037
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -92,6 +92,10 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
|
92
92
|
* @attr {Boolean} error - If set to true, sets an error state on the radio button.
|
|
93
93
|
* @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
|
|
94
94
|
* @event toggleSelected - Notifies that the component has toggled the checked/selected state.
|
|
95
|
+
*
|
|
96
|
+
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
97
|
+
* @attr id
|
|
98
|
+
*
|
|
95
99
|
* @event focusSelected - Notifies that the component has gained focus.
|
|
96
100
|
* @event auroRadio-blur - Notifies that the component has lost focus.
|
|
97
101
|
* @event resetRadio - Notifies that the component has reset the checked/selected state.
|
|
@@ -147,7 +151,6 @@ class AuroRadio extends LitElement {
|
|
|
147
151
|
type: Boolean,
|
|
148
152
|
reflect: true
|
|
149
153
|
},
|
|
150
|
-
id: { type: String },
|
|
151
154
|
label: { type: String },
|
|
152
155
|
name: { type: String },
|
|
153
156
|
value: { type: String },
|
|
@@ -164,6 +167,16 @@ class AuroRadio extends LitElement {
|
|
|
164
167
|
type: Boolean,
|
|
165
168
|
reflect: true,
|
|
166
169
|
attribute: false
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @private
|
|
174
|
+
* id for input node
|
|
175
|
+
*/
|
|
176
|
+
inputId: {
|
|
177
|
+
type: String,
|
|
178
|
+
reflect: false,
|
|
179
|
+
attribute: false
|
|
167
180
|
}
|
|
168
181
|
};
|
|
169
182
|
}
|
|
@@ -299,6 +312,8 @@ class AuroRadio extends LitElement {
|
|
|
299
312
|
|
|
300
313
|
this.input = this.shadowRoot.querySelector('input');
|
|
301
314
|
|
|
315
|
+
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
316
|
+
|
|
302
317
|
this.addEventListener('click', () => {
|
|
303
318
|
this.input.click();
|
|
304
319
|
});
|
|
@@ -325,14 +340,14 @@ class AuroRadio extends LitElement {
|
|
|
325
340
|
aria-invalid="${this.invalid(this.error)}"
|
|
326
341
|
aria-required="${this.isRequired(this.required)}"
|
|
327
342
|
.checked="${this.checked}"
|
|
328
|
-
id="${
|
|
343
|
+
id="${this.inputId}"
|
|
329
344
|
name="${ifDefined(this.name)}"
|
|
330
345
|
type="radio"
|
|
331
346
|
.value="${this.value}"
|
|
332
347
|
tabIndex="-1"
|
|
333
348
|
/>
|
|
334
349
|
|
|
335
|
-
<label for="${
|
|
350
|
+
<label for="${this.inputId}" class="${classMap(labelClasses)}">
|
|
336
351
|
<slot>${this.label}</slot>
|
|
337
352
|
</label>
|
|
338
353
|
|
|
@@ -1003,7 +1018,20 @@ class AuroFormValidation {
|
|
|
1003
1018
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
1004
1019
|
*/
|
|
1005
1020
|
|
|
1006
|
-
let hasValue =
|
|
1021
|
+
let hasValue = false;
|
|
1022
|
+
|
|
1023
|
+
// Check string for having a value
|
|
1024
|
+
if (typeof elem.value === "string") {
|
|
1025
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// Check array value types for having a value
|
|
1029
|
+
if (Array.isArray(elem.value)) {
|
|
1030
|
+
hasValue = Boolean(
|
|
1031
|
+
elem.value.length > 0 &&
|
|
1032
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1007
1035
|
|
|
1008
1036
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
1009
1037
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -52,5 +52,20 @@
|
|
|
52
52
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/dist/auro-button__bundled.js" type="module"></script>
|
|
53
53
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/dist/auro-dialog__bundled.js" type="module"></script>
|
|
54
54
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-loader@latest/dist/auro-loader__bundled.js" type="module"></script>
|
|
55
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.4/auro-input/+esm"></script>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
.autofill-example-form .input-row {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
margin-bottom: 1rem;
|
|
63
|
+
gap: 15px;
|
|
64
|
+
}
|
|
65
|
+
.autofill-example-form .input-row auro-input,
|
|
66
|
+
.autofill-example-form .input-row auro-select {
|
|
67
|
+
flex: 1 0 auto;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
55
70
|
</body>
|
|
56
71
|
</html>
|
|
@@ -17,12 +17,14 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
17
17
|
| Property | Attribute | Type | Default | Description |
|
|
18
18
|
|---------------------------------|---------------------------------|-----------|----------------|--------------------------------------------------|
|
|
19
19
|
| [autoPlacement](#autoPlacement) | `autoPlacement` | `boolean` | "false" | If declared, bib's position will be automatically calculated where to appear. |
|
|
20
|
+
| [autocomplete](#autocomplete) | `autocomplete` | `string` | | If declared, sets the autocomplete attribute for the select element. |
|
|
20
21
|
| [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
|
|
21
22
|
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
22
23
|
| [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
|
|
23
24
|
| [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. |
|
|
24
25
|
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
|
|
25
26
|
| [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
|
|
27
|
+
| [name](#name) | `name` | `string` | | The name for the select element. |
|
|
26
28
|
| [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
|
|
27
29
|
| [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`. |
|
|
28
30
|
| [noValidate](#noValidate) | `noValidate` | `boolean` | | If set, disables auto-validation on blur. |
|
|
@@ -215,6 +217,182 @@ export function valueExample() {
|
|
|
215
217
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
216
218
|
</auro-accordion>
|
|
217
219
|
|
|
220
|
+
#### Autocomplete <a name="autocomplete"></a>
|
|
221
|
+
Use the `autocomplete` attribute to let browser's know what information to use to fill out the form.
|
|
222
|
+
|
|
223
|
+
<div class="exampleWrapper">
|
|
224
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/autocomplete.html) -->
|
|
225
|
+
<!-- The below content is automatically added from ./../apiExamples/autocomplete.html -->
|
|
226
|
+
<div class="autofill-example-form">
|
|
227
|
+
<div class="input-row">
|
|
228
|
+
<auro-input autocomplete="given-name">
|
|
229
|
+
<span slot="label">First Name</span>
|
|
230
|
+
<span slot="bib.fullscreen.headline">First Name</span>
|
|
231
|
+
</auro-input>
|
|
232
|
+
<auro-input autocomplete="family-name">
|
|
233
|
+
<span slot="label">Last Name</span>
|
|
234
|
+
<span slot="bib.fullscreen.headline">Last Name</span>
|
|
235
|
+
</auro-input>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="input-row">
|
|
238
|
+
<auro-input autocomplete="address-line1">
|
|
239
|
+
<span slot="label">Street Address</span>
|
|
240
|
+
<span slot="bib.fullscreen.headline">Street Address</span>
|
|
241
|
+
</auro-input>
|
|
242
|
+
<auro-input autocomplete="address-level2">
|
|
243
|
+
<span slot="label">City</span>
|
|
244
|
+
<span slot="bib.fullscreen.headline">City</span>
|
|
245
|
+
</auro-input>
|
|
246
|
+
<auro-select autocomplete="address-level1">
|
|
247
|
+
<span slot="bib.fullscreen.headline">Select Your State</span>
|
|
248
|
+
<span slot="label">Select Your State</span>
|
|
249
|
+
<auro-menu>
|
|
250
|
+
<auro-menuoption value="AL">Alabama</auro-menuoption>
|
|
251
|
+
<auro-menuoption value="AK">Alaska</auro-menuoption>
|
|
252
|
+
<auro-menuoption value="AZ">Arizona</auro-menuoption>
|
|
253
|
+
<auro-menuoption value="AR">Arkansas</auro-menuoption>
|
|
254
|
+
<auro-menuoption value="CA">California</auro-menuoption>
|
|
255
|
+
<auro-menuoption value="CO">Colorado</auro-menuoption>
|
|
256
|
+
<auro-menuoption value="CT">Connecticut</auro-menuoption>
|
|
257
|
+
<auro-menuoption value="DE">Delaware</auro-menuoption>
|
|
258
|
+
<auro-menuoption value="DC">District of Columbia</auro-menuoption>
|
|
259
|
+
<auro-menuoption value="FL">Florida</auro-menuoption>
|
|
260
|
+
<auro-menuoption value="GA">Georgia</auro-menuoption>
|
|
261
|
+
<auro-menuoption value="HI">Hawaii</auro-menuoption>
|
|
262
|
+
<auro-menuoption value="ID">Idaho</auro-menuoption>
|
|
263
|
+
<auro-menuoption value="IL">Illinois</auro-menuoption>
|
|
264
|
+
<auro-menuoption value="IN">Indiana</auro-menuoption>
|
|
265
|
+
<auro-menuoption value="IA">Iowa</auro-menuoption>
|
|
266
|
+
<auro-menuoption value="KS">Kansas</auro-menuoption>
|
|
267
|
+
<auro-menuoption value="KY">Kentucky</auro-menuoption>
|
|
268
|
+
<auro-menuoption value="LA">Louisiana</auro-menuoption>
|
|
269
|
+
<auro-menuoption value="ME">Maine</auro-menuoption>
|
|
270
|
+
<auro-menuoption value="MD">Maryland</auro-menuoption>
|
|
271
|
+
<auro-menuoption value="MA">Massachusetts</auro-menuoption>
|
|
272
|
+
<auro-menuoption value="MI">Michigan</auro-menuoption>
|
|
273
|
+
<auro-menuoption value="MN">Minnesota</auro-menuoption>
|
|
274
|
+
<auro-menuoption value="MS">Mississippi</auro-menuoption>
|
|
275
|
+
<auro-menuoption value="MO">Missouri</auro-menuoption>
|
|
276
|
+
<auro-menuoption value="MT">Montana</auro-menuoption>
|
|
277
|
+
<auro-menuoption value="NE">Nebraska</auro-menuoption>
|
|
278
|
+
<auro-menuoption value="NV">Nevada</auro-menuoption>
|
|
279
|
+
<auro-menuoption value="NH">New Hampshire</auro-menuoption>
|
|
280
|
+
<auro-menuoption value="NJ">New Jersey</auro-menuoption>
|
|
281
|
+
<auro-menuoption value="NM">New Mexico</auro-menuoption>
|
|
282
|
+
<auro-menuoption value="NY">New York</auro-menuoption>
|
|
283
|
+
<auro-menuoption value="NC">North Carolina</auro-menuoption>
|
|
284
|
+
<auro-menuoption value="ND">North Dakota</auro-menuoption>
|
|
285
|
+
<auro-menuoption value="OH">Ohio</auro-menuoption>
|
|
286
|
+
<auro-menuoption value="OK">Oklahoma</auro-menuoption>
|
|
287
|
+
<auro-menuoption value="OR">Oregon</auro-menuoption>
|
|
288
|
+
<auro-menuoption value="PA">Pennsylvania</auro-menuoption>
|
|
289
|
+
<auro-menuoption value="RI">Rhode Island</auro-menuoption>
|
|
290
|
+
<auro-menuoption value="SC">South Carolina</auro-menuoption>
|
|
291
|
+
<auro-menuoption value="SD">South Dakota</auro-menuoption>
|
|
292
|
+
<auro-menuoption value="TN">Tennessee</auro-menuoption>
|
|
293
|
+
<auro-menuoption value="TX">Texas</auro-menuoption>
|
|
294
|
+
<auro-menuoption value="UT">Utah</auro-menuoption>
|
|
295
|
+
<auro-menuoption value="VT">Vermont</auro-menuoption>
|
|
296
|
+
<auro-menuoption value="VA">Virginia</auro-menuoption>
|
|
297
|
+
<auro-menuoption value="WA">Washington</auro-menuoption>
|
|
298
|
+
<auro-menuoption value="WV">West Virginia</auro-menuoption>
|
|
299
|
+
<auro-menuoption value="WI">Wisconsin</auro-menuoption>
|
|
300
|
+
<auro-menuoption value="WY">Wyoming</auro-menuoption>
|
|
301
|
+
</auro-menu>
|
|
302
|
+
</auro-select>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
306
|
+
</div>
|
|
307
|
+
<auro-accordion alignRight>
|
|
308
|
+
<span slot="trigger">See code</span>
|
|
309
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/autocomplete.html) -->
|
|
310
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/autocomplete.html -->
|
|
311
|
+
|
|
312
|
+
```html
|
|
313
|
+
<div class="autofill-example-form">
|
|
314
|
+
<div class="input-row">
|
|
315
|
+
<auro-input autocomplete="given-name">
|
|
316
|
+
<span slot="label">First Name</span>
|
|
317
|
+
<span slot="bib.fullscreen.headline">First Name</span>
|
|
318
|
+
</auro-input>
|
|
319
|
+
<auro-input autocomplete="family-name">
|
|
320
|
+
<span slot="label">Last Name</span>
|
|
321
|
+
<span slot="bib.fullscreen.headline">Last Name</span>
|
|
322
|
+
</auro-input>
|
|
323
|
+
</div>
|
|
324
|
+
<div class="input-row">
|
|
325
|
+
<auro-input autocomplete="address-line1">
|
|
326
|
+
<span slot="label">Street Address</span>
|
|
327
|
+
<span slot="bib.fullscreen.headline">Street Address</span>
|
|
328
|
+
</auro-input>
|
|
329
|
+
<auro-input autocomplete="address-level2">
|
|
330
|
+
<span slot="label">City</span>
|
|
331
|
+
<span slot="bib.fullscreen.headline">City</span>
|
|
332
|
+
</auro-input>
|
|
333
|
+
<auro-select autocomplete="address-level1">
|
|
334
|
+
<span slot="bib.fullscreen.headline">Select Your State</span>
|
|
335
|
+
<span slot="label">Select Your State</span>
|
|
336
|
+
<auro-menu>
|
|
337
|
+
<auro-menuoption value="AL">Alabama</auro-menuoption>
|
|
338
|
+
<auro-menuoption value="AK">Alaska</auro-menuoption>
|
|
339
|
+
<auro-menuoption value="AZ">Arizona</auro-menuoption>
|
|
340
|
+
<auro-menuoption value="AR">Arkansas</auro-menuoption>
|
|
341
|
+
<auro-menuoption value="CA">California</auro-menuoption>
|
|
342
|
+
<auro-menuoption value="CO">Colorado</auro-menuoption>
|
|
343
|
+
<auro-menuoption value="CT">Connecticut</auro-menuoption>
|
|
344
|
+
<auro-menuoption value="DE">Delaware</auro-menuoption>
|
|
345
|
+
<auro-menuoption value="DC">District of Columbia</auro-menuoption>
|
|
346
|
+
<auro-menuoption value="FL">Florida</auro-menuoption>
|
|
347
|
+
<auro-menuoption value="GA">Georgia</auro-menuoption>
|
|
348
|
+
<auro-menuoption value="HI">Hawaii</auro-menuoption>
|
|
349
|
+
<auro-menuoption value="ID">Idaho</auro-menuoption>
|
|
350
|
+
<auro-menuoption value="IL">Illinois</auro-menuoption>
|
|
351
|
+
<auro-menuoption value="IN">Indiana</auro-menuoption>
|
|
352
|
+
<auro-menuoption value="IA">Iowa</auro-menuoption>
|
|
353
|
+
<auro-menuoption value="KS">Kansas</auro-menuoption>
|
|
354
|
+
<auro-menuoption value="KY">Kentucky</auro-menuoption>
|
|
355
|
+
<auro-menuoption value="LA">Louisiana</auro-menuoption>
|
|
356
|
+
<auro-menuoption value="ME">Maine</auro-menuoption>
|
|
357
|
+
<auro-menuoption value="MD">Maryland</auro-menuoption>
|
|
358
|
+
<auro-menuoption value="MA">Massachusetts</auro-menuoption>
|
|
359
|
+
<auro-menuoption value="MI">Michigan</auro-menuoption>
|
|
360
|
+
<auro-menuoption value="MN">Minnesota</auro-menuoption>
|
|
361
|
+
<auro-menuoption value="MS">Mississippi</auro-menuoption>
|
|
362
|
+
<auro-menuoption value="MO">Missouri</auro-menuoption>
|
|
363
|
+
<auro-menuoption value="MT">Montana</auro-menuoption>
|
|
364
|
+
<auro-menuoption value="NE">Nebraska</auro-menuoption>
|
|
365
|
+
<auro-menuoption value="NV">Nevada</auro-menuoption>
|
|
366
|
+
<auro-menuoption value="NH">New Hampshire</auro-menuoption>
|
|
367
|
+
<auro-menuoption value="NJ">New Jersey</auro-menuoption>
|
|
368
|
+
<auro-menuoption value="NM">New Mexico</auro-menuoption>
|
|
369
|
+
<auro-menuoption value="NY">New York</auro-menuoption>
|
|
370
|
+
<auro-menuoption value="NC">North Carolina</auro-menuoption>
|
|
371
|
+
<auro-menuoption value="ND">North Dakota</auro-menuoption>
|
|
372
|
+
<auro-menuoption value="OH">Ohio</auro-menuoption>
|
|
373
|
+
<auro-menuoption value="OK">Oklahoma</auro-menuoption>
|
|
374
|
+
<auro-menuoption value="OR">Oregon</auro-menuoption>
|
|
375
|
+
<auro-menuoption value="PA">Pennsylvania</auro-menuoption>
|
|
376
|
+
<auro-menuoption value="RI">Rhode Island</auro-menuoption>
|
|
377
|
+
<auro-menuoption value="SC">South Carolina</auro-menuoption>
|
|
378
|
+
<auro-menuoption value="SD">South Dakota</auro-menuoption>
|
|
379
|
+
<auro-menuoption value="TN">Tennessee</auro-menuoption>
|
|
380
|
+
<auro-menuoption value="TX">Texas</auro-menuoption>
|
|
381
|
+
<auro-menuoption value="UT">Utah</auro-menuoption>
|
|
382
|
+
<auro-menuoption value="VT">Vermont</auro-menuoption>
|
|
383
|
+
<auro-menuoption value="VA">Virginia</auro-menuoption>
|
|
384
|
+
<auro-menuoption value="WA">Washington</auro-menuoption>
|
|
385
|
+
<auro-menuoption value="WV">West Virginia</auro-menuoption>
|
|
386
|
+
<auro-menuoption value="WI">Wisconsin</auro-menuoption>
|
|
387
|
+
<auro-menuoption value="WY">Wyoming</auro-menuoption>
|
|
388
|
+
</auro-menu>
|
|
389
|
+
</auro-select>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
```
|
|
393
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
394
|
+
</auro-accordion>
|
|
395
|
+
|
|
218
396
|
#### required <a name="required"></a>
|
|
219
397
|
When present, the `required` attribute specifies that a select field must be filled out before submitting the form.
|
|
220
398
|
|
|
@@ -863,7 +863,20 @@ class AuroFormValidation {
|
|
|
863
863
|
* The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
|
|
864
864
|
*/
|
|
865
865
|
|
|
866
|
-
let hasValue =
|
|
866
|
+
let hasValue = false;
|
|
867
|
+
|
|
868
|
+
// Check string for having a value
|
|
869
|
+
if (typeof elem.value === "string") {
|
|
870
|
+
hasValue = elem.value && elem.value.length > 0;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// Check array value types for having a value
|
|
874
|
+
if (Array.isArray(elem.value)) {
|
|
875
|
+
hasValue = Boolean(
|
|
876
|
+
elem.value.length > 0 &&
|
|
877
|
+
elem.value.some((value) => typeof value === "string" && value.length > 0)
|
|
878
|
+
);
|
|
879
|
+
}
|
|
867
880
|
|
|
868
881
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
869
882
|
if (this.auroInputElements?.length === 2) {
|
|
@@ -5564,7 +5577,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
|
|
|
5564
5577
|
|
|
5565
5578
|
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
|
|
5566
5579
|
|
|
5567
|
-
var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.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}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}[slot=trigger] .nestingSpacer{display:none}[slot=trigger] #placeholder.hidden{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){max-height:var(--ds-size-300, 1.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available;overflow-y:scroll}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{padding:0;pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}:host([multiselect]) [slot=trigger]{display:flex}:host([multiselect]) auro-menuoption:not(:first-child){margin-left:var(--ds-size-100)}#slotHolder{display:none}`;
|
|
5580
|
+
var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.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}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}[slot=trigger] .nestingSpacer{display:none}[slot=trigger] #placeholder.hidden{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host .nativeSelectWrapper{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip:rect(0, 0, 0, 0);opacity:.01}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){max-height:var(--ds-size-300, 1.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available;overflow-y:scroll}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{padding:0;pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}:host([multiselect]) [slot=trigger]{display:flex}:host([multiselect]) auro-menuoption:not(:first-child){margin-left:var(--ds-size-100)}#slotHolder{display:none}`;
|
|
5568
5581
|
|
|
5569
5582
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
5570
5583
|
// See LICENSE in the project root for license information.
|
|
@@ -5659,6 +5672,14 @@ class AuroSelect extends i$2 {
|
|
|
5659
5672
|
static get properties() {
|
|
5660
5673
|
return {
|
|
5661
5674
|
|
|
5675
|
+
/**
|
|
5676
|
+
* If declared, sets the autocomplete attribute for the select element.
|
|
5677
|
+
*/
|
|
5678
|
+
autocomplete: {
|
|
5679
|
+
type: String,
|
|
5680
|
+
reflect: true
|
|
5681
|
+
},
|
|
5682
|
+
|
|
5662
5683
|
/**
|
|
5663
5684
|
* If declared, bib's position will be automatically calculated where to appear.
|
|
5664
5685
|
* @default false
|
|
@@ -5676,6 +5697,14 @@ class AuroSelect extends i$2 {
|
|
|
5676
5697
|
reflect: true
|
|
5677
5698
|
},
|
|
5678
5699
|
|
|
5700
|
+
/**
|
|
5701
|
+
* The name for the select element.
|
|
5702
|
+
*/
|
|
5703
|
+
name: {
|
|
5704
|
+
type: String,
|
|
5705
|
+
reflect: true
|
|
5706
|
+
},
|
|
5707
|
+
|
|
5679
5708
|
/**
|
|
5680
5709
|
* If set, makes dropdown width match the size of the content, rather than the width of the trigger.
|
|
5681
5710
|
*/
|
|
@@ -6219,6 +6248,7 @@ class AuroSelect extends i$2 {
|
|
|
6219
6248
|
this.menu.value = undefined;
|
|
6220
6249
|
}
|
|
6221
6250
|
|
|
6251
|
+
this._updateNativeSelect();
|
|
6222
6252
|
this.validation.validate(this);
|
|
6223
6253
|
|
|
6224
6254
|
// LEGACY EVENT
|
|
@@ -6270,6 +6300,34 @@ class AuroSelect extends i$2 {
|
|
|
6270
6300
|
this.validation.validate(this, force);
|
|
6271
6301
|
}
|
|
6272
6302
|
|
|
6303
|
+
/**
|
|
6304
|
+
* Syncs the value from the native select element to the component's value.
|
|
6305
|
+
* @param {Event} event // The change event from the native select element.
|
|
6306
|
+
* @returns {void}
|
|
6307
|
+
* @private
|
|
6308
|
+
*/
|
|
6309
|
+
_handleNativeSelectChange(event) {
|
|
6310
|
+
const selectedOption = event.target.options[event.target.selectedIndex];
|
|
6311
|
+
const selectedValue = selectedOption.value;
|
|
6312
|
+
const [currentValue] = this.value || [];
|
|
6313
|
+
this.value = !currentValue || currentValue !== selectedValue ? [selectedValue] : this.value;
|
|
6314
|
+
}
|
|
6315
|
+
|
|
6316
|
+
/**
|
|
6317
|
+
* Updates the native select element's value based on the component's value.
|
|
6318
|
+
* @returns {void}
|
|
6319
|
+
* @private
|
|
6320
|
+
*/
|
|
6321
|
+
_updateNativeSelect() {
|
|
6322
|
+
const nativeSelect = this.shadowRoot.querySelector('select');
|
|
6323
|
+
if (!nativeSelect) {
|
|
6324
|
+
return;
|
|
6325
|
+
}
|
|
6326
|
+
const [value] = this.value || [];
|
|
6327
|
+
nativeSelect.value = value || '';
|
|
6328
|
+
}
|
|
6329
|
+
|
|
6330
|
+
|
|
6273
6331
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
6274
6332
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
6275
6333
|
|
|
@@ -6336,6 +6394,29 @@ class AuroSelect extends i$2 {
|
|
|
6336
6394
|
}
|
|
6337
6395
|
</p>
|
|
6338
6396
|
</${this.dropdownTag}>
|
|
6397
|
+
<div class="nativeSelectWrapper">
|
|
6398
|
+
<select
|
|
6399
|
+
tabindex="-1"
|
|
6400
|
+
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
6401
|
+
name="${this.name || ''}"
|
|
6402
|
+
?disabled="${this.disabled}"
|
|
6403
|
+
?required="${this.required}"
|
|
6404
|
+
aria-hidden="true"
|
|
6405
|
+
autocomplete="${o(this.autocomplete)}"
|
|
6406
|
+
@change="${this._handleNativeSelectChange}">
|
|
6407
|
+
<option value="" ?selected="${!this.value}"></option>
|
|
6408
|
+
${this.options.map((option) => {
|
|
6409
|
+
const optionValue = option.value || option.textContent;
|
|
6410
|
+
return u`
|
|
6411
|
+
<option
|
|
6412
|
+
value="${optionValue}"
|
|
6413
|
+
?selected="${this.value === optionValue}">
|
|
6414
|
+
${option.textContent}
|
|
6415
|
+
</option>
|
|
6416
|
+
`;
|
|
6417
|
+
})}
|
|
6418
|
+
</select>
|
|
6419
|
+
</div>
|
|
6339
6420
|
<!-- Help text and error message template -->
|
|
6340
6421
|
</div>
|
|
6341
6422
|
`;
|
|
@@ -6488,7 +6569,7 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
6488
6569
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
6489
6570
|
/**
|
|
6490
6571
|
* The auro-menu element provides users a way to select from a list of options.
|
|
6491
|
-
* @attr {Array<HTMLElement>|undefined}
|
|
6572
|
+
* @attr {Array<HTMLElement>|undefined} optionSelected - An array of currently selected menu options. In single-select mode, the array will contain only one HTMLElement. `undefined` when no options are selected.
|
|
6492
6573
|
* @attr {object} optionactive - Specifies the current active menuOption.
|
|
6493
6574
|
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
6494
6575
|
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
@@ -47,5 +47,20 @@
|
|
|
47
47
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
48
48
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
|
|
49
49
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/dist/auro-button__bundled.js" type="module"></script>
|
|
50
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.2.4/auro-input/+esm"></script>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
.autofill-example-form .input-row {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin-bottom: 1rem;
|
|
58
|
+
gap: 15px;
|
|
59
|
+
}
|
|
60
|
+
.autofill-example-form .input-row auro-input,
|
|
61
|
+
.autofill-example-form .input-row auro-select {
|
|
62
|
+
flex: 1 0 auto;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
50
65
|
</body>
|
|
51
66
|
</html>
|