@aurodesignsystem/auro-formkit 2.0.0-beta.14 → 2.0.0-beta.16
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/.turbo/cache/000950e13093845f-meta.json +1 -0
- package/.turbo/cache/{d4b8a79a27266a26.tar.zst → 000950e13093845f.tar.zst} +0 -0
- package/.turbo/cache/02ee016619902665-meta.json +1 -0
- package/.turbo/cache/02ee016619902665.tar.zst +0 -0
- package/.turbo/cache/1b97859030a6d60b-meta.json +1 -0
- package/.turbo/cache/1e855b2163b7c980-meta.json +1 -0
- package/.turbo/cache/1e855b2163b7c980.tar.zst +0 -0
- package/.turbo/cache/1f6653e2ed4c0087-meta.json +1 -0
- package/.turbo/cache/1f6653e2ed4c0087.tar.zst +0 -0
- package/.turbo/cache/2059bc724ac24519-meta.json +1 -0
- package/.turbo/cache/2059bc724ac24519.tar.zst +0 -0
- package/.turbo/cache/23b3a2fea223679d-meta.json +1 -0
- package/.turbo/cache/23b3a2fea223679d.tar.zst +0 -0
- package/.turbo/cache/2c0d681132c153dd-meta.json +1 -1
- package/.turbo/cache/31bd5687f46c7eba-meta.json +1 -0
- package/.turbo/cache/3488cff10dd06acd-meta.json +1 -0
- package/.turbo/cache/{e89dfa7c665c8763.tar.zst → 3488cff10dd06acd.tar.zst} +0 -0
- package/.turbo/cache/3c8718d2ba6d3fe5-meta.json +1 -0
- package/.turbo/cache/3c8718d2ba6d3fe5.tar.zst +0 -0
- package/.turbo/cache/4006a206400d5c7b-meta.json +1 -1
- package/.turbo/cache/43693504bf6e7c4c-meta.json +1 -0
- package/.turbo/cache/45cd32cd38eacbcb-meta.json +1 -0
- package/.turbo/cache/45cd32cd38eacbcb.tar.zst +0 -0
- package/.turbo/cache/492dda333b8d15f1-meta.json +1 -1
- package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -1
- package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -1
- package/.turbo/cache/56f2745125fdd552-meta.json +1 -0
- package/.turbo/cache/{5ddbe69f2cb372c5.tar.zst → 56f2745125fdd552.tar.zst} +0 -0
- package/.turbo/cache/5f43911cbacf7df1-meta.json +1 -0
- package/.turbo/cache/{32545b759b9ce644.tar.zst → 5f43911cbacf7df1.tar.zst} +0 -0
- package/.turbo/cache/6081837e8943b62e-meta.json +1 -1
- package/.turbo/cache/60ad74320c682a2b-meta.json +1 -1
- package/.turbo/cache/61e218aba69cff58-meta.json +1 -1
- package/.turbo/cache/6951c2a52e5ab5f7-meta.json +1 -0
- package/.turbo/cache/{35b02758b1702fa7.tar.zst → 6951c2a52e5ab5f7.tar.zst} +0 -0
- package/.turbo/cache/77da375a012de9d0-meta.json +1 -1
- package/.turbo/cache/78418f9089673a21-meta.json +1 -0
- package/.turbo/cache/78418f9089673a21.tar.zst +0 -0
- package/.turbo/cache/7964d1656e9e702a-meta.json +1 -1
- package/.turbo/cache/7bf2b06a479d0b30-meta.json +1 -1
- package/.turbo/cache/7c9ca6163e61285c-meta.json +1 -1
- package/.turbo/cache/80410f4b5990ab83-meta.json +1 -0
- package/.turbo/cache/876b8fa390c8ec81-meta.json +1 -0
- package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -1
- package/.turbo/cache/8f287fd5d33579ae-meta.json +1 -0
- package/.turbo/cache/{4302d0f3b7325335.tar.zst → 8f287fd5d33579ae.tar.zst} +0 -0
- package/.turbo/cache/8f5fef3e04a6fcfa-meta.json +1 -0
- package/.turbo/cache/8fcce3ba8357be57-meta.json +1 -0
- package/.turbo/cache/8fcce3ba8357be57.tar.zst +0 -0
- package/.turbo/cache/9b5868be65819fdf-meta.json +1 -0
- package/.turbo/cache/9b5868be65819fdf.tar.zst +0 -0
- package/.turbo/cache/b5e6dc7fb9ae1a2f-meta.json +1 -1
- package/.turbo/cache/b6a202cc85cb61a0-meta.json +1 -1
- package/.turbo/cache/ba270a0ef147f2e5-meta.json +1 -0
- package/.turbo/cache/be0b95293ea517cc-meta.json +1 -1
- package/.turbo/cache/c03a12ff38ba1e02-meta.json +1 -0
- package/.turbo/cache/c03a12ff38ba1e02.tar.zst +0 -0
- package/.turbo/cache/c1312c6f8c051461-meta.json +1 -0
- package/.turbo/cache/c1312c6f8c051461.tar.zst +0 -0
- package/.turbo/cache/c3b2cc1b044a4135-meta.json +1 -0
- package/.turbo/cache/c3b2cc1b044a4135.tar.zst +0 -0
- package/.turbo/cache/c6c6411199b68170-meta.json +1 -1
- package/.turbo/cache/c6dbc49c3038946d-meta.json +1 -0
- package/.turbo/cache/c6dbc49c3038946d.tar.zst +0 -0
- package/.turbo/cache/cae7586c45bed13e-meta.json +1 -0
- package/.turbo/cache/cae7586c45bed13e.tar.zst +0 -0
- package/.turbo/cache/cf143eb1a55684db-meta.json +1 -0
- package/.turbo/cache/cf143eb1a55684db.tar.zst +0 -0
- package/.turbo/cache/d5b85352bc667f19-meta.json +1 -0
- package/.turbo/cache/d5b85352bc667f19.tar.zst +0 -0
- package/.turbo/cache/d5db503b2eaf239c-meta.json +1 -1
- package/.turbo/cache/d775555355d6b8fc-meta.json +1 -1
- package/.turbo/cache/d7c3007be148d2a1-meta.json +1 -1
- package/.turbo/cache/dad3d78b33edd9e4-meta.json +1 -1
- package/.turbo/cache/db5e65d819bfe66b-meta.json +1 -0
- package/.turbo/cache/{0b22557b4944c6e3.tar.zst → db5e65d819bfe66b.tar.zst} +0 -0
- package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -1
- package/.turbo/cache/e392fe0927e4af23-meta.json +1 -0
- package/.turbo/cache/e392fe0927e4af23.tar.zst +0 -0
- package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -1
- package/.turbo/cache/e9e36823f6c98f07-meta.json +1 -1
- package/.turbo/cache/ea8dd91dba19ddee-meta.json +1 -0
- package/.turbo/cache/ea8dd91dba19ddee.tar.zst +0 -0
- package/.turbo/cache/f2913bf19939d840-meta.json +1 -0
- package/.turbo/cache/f2913bf19939d840.tar.zst +0 -0
- package/.turbo/cache/f86b28e5ea2c66fe-meta.json +1 -0
- package/CHANGELOG.md +23 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/README.md +1 -1
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/README.md +4 -4
- package/components/combobox/demo/api.min.js +2 -4
- package/components/combobox/demo/index.min.js +2 -4
- package/components/combobox/dist/index.js +1 -2
- package/components/counter/.turbo/turbo-build.log +3 -3
- package/components/counter/.turbo/turbo-bundler.log +3 -3
- package/components/counter/README.md +1 -1
- package/components/datepicker/.turbo/turbo-build.log +2 -2
- package/components/datepicker/README.md +4 -4
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +3 -3
- package/components/dropdown/README.md +1 -1
- package/components/form/.turbo/turbo-build.log +3 -3
- package/components/form/.turbo/turbo-bundler.log +3 -3
- package/components/form/README.md +11 -9
- package/components/form/demo/api.min.js +187 -22
- package/components/form/demo/index.min.js +187 -22
- package/components/form/demo/registerDemoDeps.js +5 -0
- package/components/form/demo/working.html +86 -0
- package/components/form/dist/auro-form.d.ts +83 -2
- package/components/form/dist/auro-form.d.ts.map +1 -1
- package/components/form/dist/index.js +187 -22
- package/components/form/package.json +3 -1
- package/components/form/src/auro-form.js +187 -25
- package/components/form/src/styles/style-css.js +1 -1
- package/components/form/src/styles/style.css +8 -0
- package/components/form/src/styles/style.scss +10 -0
- package/components/input/.turbo/turbo-build.log +3 -3
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/README.md +1 -1
- package/components/menu/.turbo/turbo-build.log +3 -3
- package/components/menu/.turbo/turbo-bundler.log +3 -3
- package/components/menu/README.md +1 -1
- package/components/menu/demo/api.min.js +1 -2
- package/components/menu/demo/index.min.js +1 -2
- package/components/menu/dist/auro-menu.d.ts.map +1 -1
- package/components/menu/dist/index.js +1 -2
- package/components/menu/src/auro-menu.js +0 -1
- package/components/menu/src/styles/color-menuoption-css.js +1 -1
- package/components/menu/src/styles/color-menuoption.css +3 -0
- package/components/menu/src/styles/color-menuoption.scss +4 -0
- package/components/radio/.turbo/turbo-build.log +3 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/README.md +1 -1
- package/components/select/.turbo/turbo-build.log +3 -3
- package/components/select/README.md +3 -3
- package/components/select/demo/api.min.js +2 -4
- package/components/select/demo/index.min.js +2 -4
- package/components/select/dist/index.js +1 -2
- package/package.json +1 -1
- package/.turbo/cache/0b22557b4944c6e3-meta.json +0 -1
- package/.turbo/cache/0c8124a987c1cc05-meta.json +0 -1
- package/.turbo/cache/0c8124a987c1cc05.tar.zst +0 -0
- package/.turbo/cache/1502c5fc71126643-meta.json +0 -1
- package/.turbo/cache/1502c5fc71126643.tar.zst +0 -0
- package/.turbo/cache/18129dba20f51b6b-meta.json +0 -1
- package/.turbo/cache/18129dba20f51b6b.tar.zst +0 -0
- package/.turbo/cache/1d461617c524c257-meta.json +0 -1
- package/.turbo/cache/1d461617c524c257.tar.zst +0 -0
- package/.turbo/cache/1f8549ade1f226ed-meta.json +0 -1
- package/.turbo/cache/2787020e69f50af2-meta.json +0 -1
- package/.turbo/cache/2787020e69f50af2.tar.zst +0 -0
- package/.turbo/cache/32545b759b9ce644-meta.json +0 -1
- package/.turbo/cache/34e8aaa18849b071-meta.json +0 -1
- package/.turbo/cache/34e8aaa18849b071.tar.zst +0 -0
- package/.turbo/cache/35b02758b1702fa7-meta.json +0 -1
- package/.turbo/cache/4302d0f3b7325335-meta.json +0 -1
- package/.turbo/cache/4db3f888378e8c97-meta.json +0 -1
- package/.turbo/cache/50993de942ec15a9-meta.json +0 -1
- package/.turbo/cache/50993de942ec15a9.tar.zst +0 -0
- package/.turbo/cache/559969de09c2dc0b-meta.json +0 -1
- package/.turbo/cache/559969de09c2dc0b.tar.zst +0 -0
- package/.turbo/cache/584cc436c8078114-meta.json +0 -1
- package/.turbo/cache/584cc436c8078114.tar.zst +0 -0
- package/.turbo/cache/5c16e68b6c2fe505-meta.json +0 -1
- package/.turbo/cache/5c16e68b6c2fe505.tar.zst +0 -0
- package/.turbo/cache/5ddbe69f2cb372c5-meta.json +0 -1
- package/.turbo/cache/759b0d821dae60c9-meta.json +0 -1
- package/.turbo/cache/76a76201dfec8a47-meta.json +0 -1
- package/.turbo/cache/76a76201dfec8a47.tar.zst +0 -0
- package/.turbo/cache/79b7301ce5cb7388-meta.json +0 -1
- package/.turbo/cache/8a1d75ce1555da17-meta.json +0 -1
- package/.turbo/cache/8a1d75ce1555da17.tar.zst +0 -0
- package/.turbo/cache/8aa9a0ccdac4b3f6-meta.json +0 -1
- package/.turbo/cache/9ae99e8e7bd83d06-meta.json +0 -1
- package/.turbo/cache/9ae99e8e7bd83d06.tar.zst +0 -0
- package/.turbo/cache/a12b45bee8b447ec-meta.json +0 -1
- package/.turbo/cache/a12b45bee8b447ec.tar.zst +0 -0
- package/.turbo/cache/a2c5639ae99f332a-meta.json +0 -1
- package/.turbo/cache/a2c5639ae99f332a.tar.zst +0 -0
- package/.turbo/cache/ab77cb0b089f1928-meta.json +0 -1
- package/.turbo/cache/b30c78f2c15f720d-meta.json +0 -1
- package/.turbo/cache/b30c78f2c15f720d.tar.zst +0 -0
- package/.turbo/cache/ba69fd787d0ded42-meta.json +0 -1
- package/.turbo/cache/c44efc9e4ddd8a0e-meta.json +0 -1
- package/.turbo/cache/c44efc9e4ddd8a0e.tar.zst +0 -0
- package/.turbo/cache/d4b8a79a27266a26-meta.json +0 -1
- package/.turbo/cache/da4d6d64c2b8c14c-meta.json +0 -1
- package/.turbo/cache/da4d6d64c2b8c14c.tar.zst +0 -0
- package/.turbo/cache/e89dfa7c665c8763-meta.json +0 -1
- package/.turbo/cache/e9070f00d98f5229-meta.json +0 -1
- package/.turbo/cache/e9070f00d98f5229.tar.zst +0 -0
- package/.turbo/cache/eaaba23b39cfd96e-meta.json +0 -1
- package/.turbo/cache/eaaba23b39cfd96e.tar.zst +0 -0
- package/.turbo/cache/fb11be9bb5bed06e-meta.json +0 -1
- /package/.turbo/cache/{1f8549ade1f226ed.tar.zst → 1b97859030a6d60b.tar.zst} +0 -0
- /package/.turbo/cache/{ab77cb0b089f1928.tar.zst → 31bd5687f46c7eba.tar.zst} +0 -0
- /package/.turbo/cache/{8aa9a0ccdac4b3f6.tar.zst → 43693504bf6e7c4c.tar.zst} +0 -0
- /package/.turbo/cache/{4db3f888378e8c97.tar.zst → 80410f4b5990ab83.tar.zst} +0 -0
- /package/.turbo/cache/{79b7301ce5cb7388.tar.zst → 876b8fa390c8ec81.tar.zst} +0 -0
- /package/.turbo/cache/{fb11be9bb5bed06e.tar.zst → 8f5fef3e04a6fcfa.tar.zst} +0 -0
- /package/.turbo/cache/{759b0d821dae60c9.tar.zst → ba270a0ef147f2e5.tar.zst} +0 -0
- /package/.turbo/cache/{ba69fd787d0ded42.tar.zst → f86b28e5ea2c66fe.tar.zst} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
2
|
+
|
|
1
3
|
// Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2
4
|
// See LICENSE in the project root for license information.
|
|
3
5
|
|
|
@@ -6,16 +8,23 @@
|
|
|
6
8
|
// If using litElement base class
|
|
7
9
|
import { LitElement, html } from "lit";
|
|
8
10
|
|
|
9
|
-
// If using auroElement base class
|
|
10
|
-
// See instructions for importing auroElement base class https://git.io/JULq4
|
|
11
|
-
// import { LitElement, html } from "lit";
|
|
12
|
-
// import AuroElement from '@aurodesignsystem/webcorestylesheets/dist/auroElement/auroElement';
|
|
13
|
-
|
|
14
|
-
// Import touch detection lib
|
|
15
11
|
import styleCss from "./styles/style-css.js";
|
|
16
12
|
|
|
17
13
|
import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
18
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Object} FormStateMember - The form state member.
|
|
17
|
+
* @property {string | number | boolean | string[] | null} value - The value of the form element.
|
|
18
|
+
* @property {ValidityState} validity - The validity state of the form element, stored when fired from the form element.
|
|
19
|
+
* @property {boolean} required - Whether the form element is required or not.
|
|
20
|
+
* @property {HTMLElement} element - Whether the form element is required or not.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object.<string, FormStateMember>} FormState - The form state.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
19
28
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
20
29
|
/**
|
|
21
30
|
* The auro-form element provides users a way to ... (it would be great if you fill this out).
|
|
@@ -26,26 +35,138 @@ import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/util
|
|
|
26
35
|
|
|
27
36
|
// build the component class
|
|
28
37
|
export class AuroForm extends LitElement {
|
|
29
|
-
// constructor() {
|
|
30
|
-
// super();
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
// This function is to define props used within the scope of this component
|
|
34
|
-
// Be sure to review https://lit.dev/docs/components/properties/
|
|
35
|
-
// to understand how to use reflected attributes with your property settings.
|
|
36
38
|
static get properties() {
|
|
37
39
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// this property is DEMO ONLY! Please delete.
|
|
41
|
-
cssClass: { type: String }
|
|
40
|
+
_formState: { attribute: false },
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
constructor() {
|
|
45
|
+
super();
|
|
46
|
+
|
|
47
|
+
/** @type {FormState} */
|
|
48
|
+
this._formState = {};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Note: button is NOT considered a form element in this context
|
|
52
|
+
// as it does not have a .value property.
|
|
53
|
+
static get formElementTags() {
|
|
54
|
+
return [
|
|
55
|
+
'auro-input',
|
|
56
|
+
'auro-select',
|
|
57
|
+
'auro-datepicker',
|
|
58
|
+
'auro-checkbox-group',
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Shared code for determining if an element is something we care about (submit, form element, etc.).
|
|
64
|
+
* @param {string[]} collection - The array to use for tag name search.
|
|
65
|
+
* @param {HTMLElement} element - The element to compare against the master list.
|
|
66
|
+
* @returns boolean
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
_isInElementCollection(collection, element) {
|
|
70
|
+
return collection.some((elementTag) => element.tagName.toLowerCase() === elementTag || element.hasAttribute(elementTag.toLowerCase()));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Check if the tag name is a form element.
|
|
75
|
+
* @param {HTMLElement} element - The element to check (attr or tag name).
|
|
76
|
+
* @returns {boolean}
|
|
77
|
+
*/
|
|
78
|
+
isFormElement(element) {
|
|
79
|
+
return this._isInElementCollection(AuroForm.formElementTags, element);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static get submitElementTags() {
|
|
83
|
+
return [
|
|
84
|
+
'button',
|
|
85
|
+
'auro-button',
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Check if the tag name is a submit element.
|
|
91
|
+
* @param {HTMLElement} element - The element to check.
|
|
92
|
+
* @returns {boolean}
|
|
93
|
+
*/
|
|
94
|
+
isSubmitElement(element) {
|
|
95
|
+
return this._isInElementCollection(AuroForm.submitElementTags, element);
|
|
96
|
+
}
|
|
97
|
+
|
|
45
98
|
static get styles() {
|
|
46
99
|
return [styleCss];
|
|
47
100
|
}
|
|
48
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Reduce the form value into a key-value pair.
|
|
104
|
+
*
|
|
105
|
+
* NOTE: form keys use `name` first, and `id` second if `name` is not available.
|
|
106
|
+
* This follows standard HTML5 form behavior - submission uses `name` by default when creating
|
|
107
|
+
* the FormData object.
|
|
108
|
+
*
|
|
109
|
+
* @returns {Record<string, string | number | boolean | string[] | null>} The form value.
|
|
110
|
+
*/
|
|
111
|
+
get value() {
|
|
112
|
+
return Object.keys(this._formState).reduce((acc, key) => {
|
|
113
|
+
acc[key] = this._formState[key].value;
|
|
114
|
+
return acc;
|
|
115
|
+
}, {});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get validity() {
|
|
119
|
+
// go through validity states and return the first invalid state (if any)
|
|
120
|
+
const invalidKey = Object.keys(this._formState).
|
|
121
|
+
find((key) => {
|
|
122
|
+
const formKey = this._formState[key];
|
|
123
|
+
|
|
124
|
+
// these are NOT extra :(
|
|
125
|
+
// eslint-disable-next-line no-extra-parens
|
|
126
|
+
return (formKey.validity !== 'valid' && formKey.required) || (formKey.validity !== 'valid' && formKey.value !== null);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
return invalidKey ? 'invalid' : 'valid';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Below is not implemented yet
|
|
133
|
+
get isInitialState() {
|
|
134
|
+
const anyTainted = Object.keys(this._formState).some((key) => this._formState[key].validity !== null);
|
|
135
|
+
|
|
136
|
+
return !anyTainted;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
getSubmitFunction() {
|
|
140
|
+
// We return an arrow function here to ensure that the `this` context points at this same AuroForm context.
|
|
141
|
+
// Otherwise, submission tries to read `this.value` on the button element.
|
|
142
|
+
return (event) => {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
|
|
145
|
+
this.dispatchEvent(new CustomEvent('submit', {
|
|
146
|
+
detail: {
|
|
147
|
+
value: this.value
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Construct the query strings from elements, append them together, execute, and return the NodeList.
|
|
155
|
+
* @returns {NodeList}
|
|
156
|
+
*/
|
|
157
|
+
queryAuroElements() {
|
|
158
|
+
const formElementQuery = AuroForm.formElementTags.map((tag) => `${tag}[name]`).join(',');
|
|
159
|
+
const submitterQuery = AuroForm.submitElementTags.map((tag) => `${tag}[type=submit]`).join(',');
|
|
160
|
+
|
|
161
|
+
// Alternatively, for renamed components...
|
|
162
|
+
const renamedFormElementQuery = AuroForm.formElementTags.map((tag) => `[${tag}][name]`).join(',');
|
|
163
|
+
const renamedSubmitterQuery = AuroForm.formElementTags.map((tag) => `[${tag}][type=submit]`).join(',');
|
|
164
|
+
|
|
165
|
+
const unifiedElementQuery = `${formElementQuery},${submitterQuery},${renamedFormElementQuery},${renamedSubmitterQuery}`;
|
|
166
|
+
|
|
167
|
+
return this.querySelectorAll(unifiedElementQuery);
|
|
168
|
+
}
|
|
169
|
+
|
|
49
170
|
/**
|
|
50
171
|
* This will register this element with the browser.
|
|
51
172
|
* @param {string} [name="auro-form"] - The name of element that you want to register to.
|
|
@@ -58,17 +179,58 @@ export class AuroForm extends LitElement {
|
|
|
58
179
|
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroForm);
|
|
59
180
|
}
|
|
60
181
|
|
|
61
|
-
|
|
62
|
-
|
|
182
|
+
firstUpdated(_changedProperties) {
|
|
183
|
+
super.firstUpdated(_changedProperties);
|
|
184
|
+
|
|
185
|
+
const slot = this.shadowRoot.querySelector('slot');
|
|
186
|
+
|
|
187
|
+
// Update the form state when a form element is detected
|
|
188
|
+
slot.addEventListener('input', (event) => {
|
|
189
|
+
|
|
190
|
+
/** @type {HTMLInputElement} */
|
|
191
|
+
const eventTarget = event.target;
|
|
192
|
+
if (this.isFormElement(eventTarget)) {
|
|
193
|
+
this._formState[eventTarget.getAttribute("name")].value = eventTarget.value;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
slot.addEventListener('auroFormElement-validated', (event) => {
|
|
198
|
+
const oldValue = this._formState;
|
|
199
|
+
|
|
200
|
+
this._formState[event.target.getAttribute("name")].validity = event.detail.validity;
|
|
201
|
+
this.requestUpdate('formState', oldValue);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
onSlotChange() {
|
|
206
|
+
this._formState = {};
|
|
63
207
|
|
|
64
|
-
|
|
208
|
+
this.queryAuroElements().forEach((element) => {
|
|
209
|
+
if (this.isFormElement(element)) {
|
|
210
|
+
this._formState[element.getAttribute('name')] = {
|
|
211
|
+
value: element.getAttribute('value'),
|
|
212
|
+
validity: element.getAttribute('validity'),
|
|
213
|
+
required: element.hasAttribute('required'),
|
|
214
|
+
element
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (this.isSubmitElement(element) && element.getAttribute('type') === 'submit') {
|
|
219
|
+
element.removeEventListener('click', this.getSubmitFunction());
|
|
220
|
+
element.addEventListener('click', this.getSubmitFunction());
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
65
226
|
render() {
|
|
66
227
|
return html`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
228
|
+
<form>
|
|
229
|
+
<p>Value: ${JSON.stringify(this.value)}</p>
|
|
230
|
+
<p>Validity: ${this.validity}</p>
|
|
231
|
+
<h3>Auro form example</h3>
|
|
232
|
+
<slot @slotchange="${this.onSlotChange}"></slot>
|
|
233
|
+
</form>
|
|
72
234
|
`;
|
|
73
235
|
}
|
|
74
236
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export default css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.testClass{display:inline-block;padding:var(--auro-text-body-size-default);border:1px solid var(--auro-color-border-error-on-light);color:var(--auro-color-border-error-on-light)}:focus-visible{background-color:var(--auro-color-border-error-on-light);color:var(--auro-color-base-white)}`;
|
|
2
|
+
export default css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.testClass{display:inline-block;padding:var(--auro-text-body-size-default);border:1px solid var(--auro-color-border-error-on-light);color:var(--auro-color-border-error-on-light)}:focus-visible{background-color:var(--auro-color-border-error-on-light);color:var(--auro-color-base-white)}:host form{display:block;width:100%;padding:1rem;border:1px solid #2a2a2a;border-radius:1rem}`;
|
|
@@ -216,13 +216,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
216
216
|
|
|
217
217
|
[36m
|
|
218
218
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
219
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
219
|
+
[32mcreated [1mdist[22m in [1m1.3s[22m[39m
|
|
220
220
|
[36m
|
|
221
221
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
222
|
-
[32mcreated [1m./demo/[22m in [
|
|
222
|
+
[32mcreated [1m./demo/[22m in [1m698ms[22m[39m
|
|
223
223
|
[36m
|
|
224
224
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
225
|
-
[32mcreated [1m./demo/[22m in [
|
|
225
|
+
[32mcreated [1m./demo/[22m in [1m910ms[22m[39m
|
|
226
226
|
|
|
227
227
|
> @aurodesignsystem/auro-input@4.2.0 build:docs
|
|
228
228
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component input
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [1m1.
|
|
7
|
+
[32mcreated [1mdist[22m in [1m1.3s[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m616ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m659ms[22m[39m
|
|
@@ -89,7 +89,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
89
89
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
90
90
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
91
91
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
92
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.
|
|
92
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-input@2.0.0-beta.15/dist/auro-input__bundled.js" type="module"></script>
|
|
93
93
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
94
94
|
|
|
95
95
|
## auro-input use cases
|
|
@@ -101,13 +101,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
101
101
|
|
|
102
102
|
[36m
|
|
103
103
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
104
|
-
[32mcreated [1mdist[22m in [
|
|
104
|
+
[32mcreated [1mdist[22m in [1m751ms[22m[39m
|
|
105
105
|
[36m
|
|
106
106
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
107
|
-
[32mcreated [1m./demo/[22m in [
|
|
107
|
+
[32mcreated [1m./demo/[22m in [1m786ms[22m[39m
|
|
108
108
|
[36m
|
|
109
109
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
110
|
-
[32mcreated [1m./demo/[22m in [
|
|
110
|
+
[32mcreated [1m./demo/[22m in [1m626ms[22m[39m
|
|
111
111
|
|
|
112
112
|
> @aurodesignsystem/auro-menu@4.1.4 build:docs
|
|
113
113
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component menu
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [
|
|
7
|
+
[32mcreated [1mdist[22m in [1m858ms[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m715ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m523ms[22m[39m
|
|
@@ -100,7 +100,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
100
100
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
101
101
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
102
102
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
103
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.15/dist/auro-menu__bundled.js" type="module"></script>
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
106
106
|
## auro-menu use cases
|
|
@@ -531,7 +531,6 @@ class AuroMenu extends r {
|
|
|
531
531
|
// Update selection if option or value changed
|
|
532
532
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
533
533
|
const isSelected = this.isOptionSelected(option);
|
|
534
|
-
option.classList.toggle('active', isSelected);
|
|
535
534
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
536
535
|
|
|
537
536
|
// Add/remove selected attribute based on state
|
|
@@ -993,7 +992,7 @@ const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litS
|
|
|
993
992
|
|
|
994
993
|
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
995
994
|
|
|
996
|
-
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
995
|
+
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
997
996
|
|
|
998
997
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
999
998
|
// See LICENSE in the project root for license information.
|
|
@@ -491,7 +491,6 @@ class AuroMenu extends r {
|
|
|
491
491
|
// Update selection if option or value changed
|
|
492
492
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
493
493
|
const isSelected = this.isOptionSelected(option);
|
|
494
|
-
option.classList.toggle('active', isSelected);
|
|
495
494
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
496
495
|
|
|
497
496
|
// Add/remove selected attribute based on state
|
|
@@ -953,7 +952,7 @@ const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litS
|
|
|
953
952
|
|
|
954
953
|
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
955
954
|
|
|
956
|
-
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
955
|
+
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
957
956
|
|
|
958
957
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
959
958
|
// See LICENSE in the project root for license information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auro-menu.d.ts","sourceRoot":"","sources":["../src/auro-menu.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;IA8DE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwCC;IAED,+CAMC;IAED;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IAnHC,WAAsB;IAEtB,oBAA+B;IAE/B,eAA0B;IAE1B,qBAAwB;IAExB,sBAA6B;IAE7B,iBAAoB;IAEpB,qBAAwB;
|
|
1
|
+
{"version":3,"file":"auro-menu.d.ts","sourceRoot":"","sources":["../src/auro-menu.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;IA8DE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwCC;IAED,+CAMC;IAED;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IAnHC,WAAsB;IAEtB,oBAA+B;IAE/B,eAA0B;IAE1B,qBAAwB;IAExB,sBAA6B;IAE7B,iBAAoB;IAEpB,qBAAwB;IA6Z1B;;;;OAIG;IACH,sBAeC;IAsDD;;;;OAIG;IACH,0BAUC;IAED;;;;OAIG;IACH,0BAIC;IAED;;;OAGG;IACH,yBAeC;IAzZD,qBAKC;IAFC,kCAAuF;IAIzF,sCA+CC;IAzCK,WAAe;IA2CrB;;;;OAIG;IACH,yBA+DC;IAID;;;OAGG;IACH,uBAOC;IAED;;;OAGG;IACH,kBAUC;IATC,iBAAoF;IAatF;;;;OAIG;IACH,0BAwBC;IAED;;;;OAIG;IACH,4BAiCC;IAED;;;OAGG;IACH,uBAGC;IAED;;;;OAIG;IACH,qBAgBC;IAED;;;;OAIG;IACH,0BAiBC;IA0BD;;;OAGG;IACH,sBA6BC;IAED;;;;OAIG;IACH,qBAUC;IAoCG,kBAAqB;IAezB;;;;OAIG;IACH,wBA2CC;IAED;;;;OAIG;IACH,2BAUC;IAED;;;;OAIG;IACH,0BAIC;IAED;;;OAGG;IACH,8BAEC;IAED;;;;;OAKG;IACH,yBAMC;IAED;;;OAGG;IACH,6BAFa,OAAO,CAInB;IAED;;;OAGG;IACH,UAFa,OAAO,CAenB;CACF;2BAjtBgC,KAAK;+BAY/B,sBAAsB;2CAAtB,sBAAsB"}
|
|
@@ -491,7 +491,6 @@ class AuroMenu extends r {
|
|
|
491
491
|
// Update selection if option or value changed
|
|
492
492
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
493
493
|
const isSelected = this.isOptionSelected(option);
|
|
494
|
-
option.classList.toggle('active', isSelected);
|
|
495
494
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
496
495
|
|
|
497
496
|
// Add/remove selected attribute based on state
|
|
@@ -953,7 +952,7 @@ const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litS
|
|
|
953
952
|
|
|
954
953
|
var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
955
954
|
|
|
956
|
-
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
955
|
+
var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
957
956
|
|
|
958
957
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
959
958
|
// See LICENSE in the project root for license information.
|
|
@@ -272,7 +272,6 @@ export class AuroMenu extends LitElement {
|
|
|
272
272
|
// Update selection if option or value changed
|
|
273
273
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
274
274
|
const isSelected = this.isOptionSelected(option);
|
|
275
|
-
option.classList.toggle('active', isSelected);
|
|
276
275
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
277
276
|
|
|
278
277
|
// Add/remove selected attribute based on state
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export default css`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
2
|
+
export default css`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
@@ -21,3 +21,6 @@
|
|
|
21
21
|
--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);
|
|
22
22
|
--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff);
|
|
23
23
|
}
|
|
24
|
+
:host([selected]):host(.active) {
|
|
25
|
+
--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296);
|
|
26
|
+
}
|
|
@@ -29,5 +29,9 @@
|
|
|
29
29
|
--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #{$ds-color-container-ui-primary-default-default});
|
|
30
30
|
--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #{$ds-color-text-primary-inverse});
|
|
31
31
|
--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #{$ds-color-icon-emphasis-inverse});
|
|
32
|
+
|
|
33
|
+
&:host(.active) {
|
|
34
|
+
--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #{$ds-color-container-ui-primary-active-default});
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
|
|
@@ -138,13 +138,13 @@ Run in verbose mode to see all warnings.
|
|
|
138
138
|
|
|
139
139
|
[36m
|
|
140
140
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
141
|
-
[32mcreated [1mdist[22m in [
|
|
141
|
+
[32mcreated [1mdist[22m in [1m812ms[22m[39m
|
|
142
142
|
[36m
|
|
143
143
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
144
|
-
[32mcreated [1m./demo/[22m in [
|
|
144
|
+
[32mcreated [1m./demo/[22m in [1m498ms[22m[39m
|
|
145
145
|
[36m
|
|
146
146
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
147
|
-
[32mcreated [1m./demo/[22m in [
|
|
147
|
+
[32mcreated [1m./demo/[22m in [1m486ms[22m[39m
|
|
148
148
|
|
|
149
149
|
> @aurodesignsystem/auro-radio@4.1.1 build:docs
|
|
150
150
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component radio
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
7
|
-
[32mcreated [1mdist[22m in [
|
|
7
|
+
[32mcreated [1mdist[22m in [1m846ms[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
10
|
-
[32mcreated [1m./demo/[22m in [
|
|
10
|
+
[32mcreated [1m./demo/[22m in [1m476ms[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
13
|
-
[32mcreated [1m./demo/[22m in [
|
|
13
|
+
[32mcreated [1m./demo/[22m in [1m462ms[22m[39m
|
|
@@ -90,7 +90,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
90
90
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
91
91
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.9.2/dist/tokens/CSSCustomProperties.css" />
|
|
92
92
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
93
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-radio@2.0.0-beta.
|
|
93
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-radio@2.0.0-beta.15/dist/auro-radio__bundled.js" type="module"></script>
|
|
94
94
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
95
95
|
|
|
96
96
|
## auro-radio use cases
|
|
@@ -137,13 +137,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
137
137
|
|
|
138
138
|
[36m
|
|
139
139
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
140
|
-
[32mcreated [1mdist[22m in [
|
|
140
|
+
[32mcreated [1mdist[22m in [1m657ms[22m[39m
|
|
141
141
|
[36m
|
|
142
142
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
143
|
-
[32mcreated [1m./demo/[22m in [
|
|
143
|
+
[32mcreated [1m./demo/[22m in [1m631ms[22m[39m
|
|
144
144
|
[36m
|
|
145
145
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
146
|
-
[32mcreated [1m./demo/[22m in [
|
|
146
|
+
[32mcreated [1m./demo/[22m in [1m467ms[22m[39m
|
|
147
147
|
|
|
148
148
|
> @aurodesignsystem/auro-select@3.3.0 build:docs
|
|
149
149
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component select
|
|
@@ -99,9 +99,9 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
99
99
|
<!-- The below content is automatically added from ../../docs/templates/componentBundleUseModBrowsers.md -->
|
|
100
100
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.12.1/dist/tokens/CSSCustomProperties.css" />
|
|
101
101
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
102
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.
|
|
103
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.
|
|
104
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-select@2.0.0-beta.
|
|
102
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-dropdown@2.0.0-beta.15/dist/auro-dropdown__bundled.js" type="module"></script>
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-menu@2.0.0-beta.15/dist/auro-menu__bundled.js" type="module"></script>
|
|
104
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit/auro-select@2.0.0-beta.15/dist/auro-select__bundled.js" type="module"></script>
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
107
107
|
## auro-select use cases
|
|
@@ -4032,7 +4032,6 @@ let AuroMenu$1 = class AuroMenu extends r {
|
|
|
4032
4032
|
// Update selection if option or value changed
|
|
4033
4033
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
4034
4034
|
const isSelected = this.isOptionSelected(option);
|
|
4035
|
-
option.classList.toggle('active', isSelected);
|
|
4036
4035
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
4037
4036
|
|
|
4038
4037
|
// Add/remove selected attribute based on state
|
|
@@ -4494,7 +4493,7 @@ const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litS
|
|
|
4494
4493
|
|
|
4495
4494
|
var styleCss$1$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
4496
4495
|
|
|
4497
|
-
var colorCss$1$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
4496
|
+
var colorCss$1$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
4498
4497
|
|
|
4499
4498
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
4500
4499
|
// See LICENSE in the project root for license information.
|
|
@@ -6018,7 +6017,6 @@ class AuroMenu extends r$5 {
|
|
|
6018
6017
|
// Update selection if option or value changed
|
|
6019
6018
|
if (changedProperties.has('optionSelected') || changedProperties.has('value')) {
|
|
6020
6019
|
const isSelected = this.isOptionSelected(option);
|
|
6021
|
-
option.classList.toggle('active', isSelected);
|
|
6022
6020
|
option.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
6023
6021
|
|
|
6024
6022
|
// Add/remove selected attribute based on state
|
|
@@ -6473,7 +6471,7 @@ class AuroMenu extends r$5 {
|
|
|
6473
6471
|
|
|
6474
6472
|
var styleCss$1 = i$c`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
6475
6473
|
|
|
6476
|
-
var colorCss$1 = i$c`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
6474
|
+
var colorCss$1 = i$c`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-active-default, #225296)}`;
|
|
6477
6475
|
|
|
6478
6476
|
/**
|
|
6479
6477
|
* @license
|