@aurodesignsystem/auro-formkit 2.0.0-beta.17 → 2.0.0-beta.19
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/00aadf5485902e7b-meta.json +1 -0
- package/.turbo/cache/00aadf5485902e7b.tar.zst +0 -0
- package/.turbo/cache/036445b490c155bd-meta.json +1 -0
- package/.turbo/cache/036445b490c155bd.tar.zst +0 -0
- package/.turbo/cache/0447d55c21d0ac8f-meta.json +1 -0
- package/.turbo/cache/0447d55c21d0ac8f.tar.zst +0 -0
- package/.turbo/cache/2059bc724ac24519-meta.json +1 -1
- package/.turbo/cache/2059bc724ac24519.tar.zst +0 -0
- package/.turbo/cache/2397ce215c2442f0-meta.json +1 -0
- package/.turbo/cache/2397ce215c2442f0.tar.zst +0 -0
- package/.turbo/cache/23b3a2fea223679d-meta.json +1 -1
- package/.turbo/cache/23b3a2fea223679d.tar.zst +0 -0
- package/.turbo/cache/2c0d681132c153dd-meta.json +1 -1
- package/.turbo/cache/3795ae4e6361b8af-meta.json +1 -0
- package/.turbo/cache/3795ae4e6361b8af.tar.zst +0 -0
- package/.turbo/cache/3c39004da91359c5-meta.json +1 -0
- package/.turbo/cache/3c39004da91359c5.tar.zst +0 -0
- package/.turbo/cache/4006a206400d5c7b-meta.json +1 -1
- package/.turbo/cache/45cd32cd38eacbcb-meta.json +1 -1
- package/.turbo/cache/492dda333b8d15f1-meta.json +1 -1
- package/.turbo/cache/4ee009a370d54a8e-meta.json +1 -0
- package/.turbo/cache/4ee009a370d54a8e.tar.zst +0 -0
- package/.turbo/cache/50cd7dcfc9f820c5-meta.json +1 -1
- package/.turbo/cache/51eaa58d5c167de8-meta.json +1 -1
- package/.turbo/cache/5b57cc0e26e1fd5d-meta.json +1 -1
- package/.turbo/cache/60ad74320c682a2b-meta.json +1 -1
- package/.turbo/cache/61e218aba69cff58-meta.json +1 -1
- package/.turbo/cache/631d441eebe7e4ac-meta.json +1 -0
- package/.turbo/cache/631d441eebe7e4ac.tar.zst +0 -0
- package/.turbo/cache/64238eb3ce19a23b-meta.json +1 -0
- package/.turbo/cache/64238eb3ce19a23b.tar.zst +0 -0
- package/.turbo/cache/72c248aead46dc7a-meta.json +1 -0
- package/.turbo/cache/72c248aead46dc7a.tar.zst +0 -0
- package/.turbo/cache/77da375a012de9d0-meta.json +1 -1
- package/.turbo/cache/78418f9089673a21-meta.json +1 -1
- 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/80ebd4b1fa5c1e3a-meta.json +1 -0
- package/.turbo/cache/80ebd4b1fa5c1e3a.tar.zst +0 -0
- package/.turbo/cache/899d530990daf6ee-meta.json +1 -0
- package/.turbo/cache/899d530990daf6ee.tar.zst +0 -0
- package/.turbo/cache/8bb856bd31b5b479-meta.json +1 -1
- package/.turbo/cache/8f5fef3e04a6fcfa-meta.json +1 -1
- package/.turbo/cache/9d99fa3ab31d272f-meta.json +1 -0
- package/.turbo/cache/9d99fa3ab31d272f.tar.zst +0 -0
- package/.turbo/cache/a5df9f29608a70d3-meta.json +1 -0
- package/.turbo/cache/a5df9f29608a70d3.tar.zst +0 -0
- package/.turbo/cache/a779ea8b78ce9d59-meta.json +1 -1
- package/.turbo/cache/a9c36a3534c5496b-meta.json +1 -1
- package/.turbo/cache/abdfc2bec9f4fa6e-meta.json +1 -0
- package/.turbo/cache/abdfc2bec9f4fa6e.tar.zst +0 -0
- package/.turbo/cache/abe75d67a97447a5-meta.json +1 -0
- package/.turbo/cache/abe75d67a97447a5.tar.zst +0 -0
- package/.turbo/cache/ae04f51e4ebab64d-meta.json +1 -0
- package/.turbo/cache/ae04f51e4ebab64d.tar.zst +0 -0
- package/.turbo/cache/af7a63c49a499d50-meta.json +1 -0
- package/.turbo/cache/af7a63c49a499d50.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 -1
- package/.turbo/cache/be0b95293ea517cc-meta.json +1 -1
- package/.turbo/cache/c03a12ff38ba1e02-meta.json +1 -1
- package/.turbo/cache/c1312c6f8c051461-meta.json +1 -1
- package/.turbo/cache/c1312c6f8c051461.tar.zst +0 -0
- package/.turbo/cache/c3c8d8535ef6869a-meta.json +1 -0
- package/.turbo/cache/{56f2745125fdd552.tar.zst → c3c8d8535ef6869a.tar.zst} +0 -0
- package/.turbo/cache/c6c6411199b68170-meta.json +1 -1
- package/.turbo/cache/c6dbc49c3038946d-meta.json +1 -1
- package/.turbo/cache/cae7586c45bed13e-meta.json +1 -1
- package/.turbo/cache/cae7586c45bed13e.tar.zst +0 -0
- package/.turbo/cache/d007a96bfd17f5e4-meta.json +1 -0
- package/.turbo/cache/d007a96bfd17f5e4.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/db5e65d819bfe66b-meta.json +1 -1
- package/.turbo/cache/dc597b3ea4f61ec8-meta.json +1 -1
- package/.turbo/cache/e12c0f24d2d8f95b-meta.json +1 -0
- package/.turbo/cache/e12c0f24d2d8f95b.tar.zst +0 -0
- package/.turbo/cache/e1875aafbbfef851-meta.json +1 -0
- package/.turbo/cache/e1875aafbbfef851.tar.zst +0 -0
- package/.turbo/cache/e210e1ea5fb692c5-meta.json +1 -0
- package/.turbo/cache/e210e1ea5fb692c5.tar.zst +0 -0
- package/.turbo/cache/e62cfee068e3ef36-meta.json +1 -1
- package/.turbo/cache/e9abd65ee0250c1e-meta.json +1 -0
- package/.turbo/cache/e9abd65ee0250c1e.tar.zst +0 -0
- package/CHANGELOG.md +25 -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/checkbox/demo/api.md +4 -3
- package/components/checkbox/demo/api.min.js +11 -3
- package/components/checkbox/demo/index.min.js +11 -3
- package/components/checkbox/dist/auro-checkbox-group.d.ts +5 -0
- package/components/checkbox/dist/auro-checkbox-group.d.ts.map +1 -1
- package/components/checkbox/dist/index.js +11 -3
- package/components/checkbox/src/auro-checkbox-group.js +11 -3
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/README.md +4 -4
- package/components/combobox/demo/api.md +5 -4
- package/components/combobox/demo/api.min.js +16 -8
- package/components/combobox/demo/index.min.js +16 -8
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +16 -8
- package/components/combobox/src/auro-combobox.js +11 -3
- package/components/counter/.turbo/turbo-build.log +2 -2
- package/components/counter/.turbo/turbo-bundler.log +6 -3
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.md +11 -4
- package/components/counter/demo/api.min.js +20 -3
- package/components/counter/demo/index.min.js +20 -3
- package/components/counter/dist/auro-counter-group.d.ts +5 -0
- package/components/counter/dist/auro-counter-group.d.ts.map +1 -1
- package/components/counter/dist/auro-counter.d.ts +5 -0
- package/components/counter/dist/auro-counter.d.ts.map +1 -1
- package/components/counter/dist/index.js +20 -3
- package/components/counter/src/auro-counter-group.js +9 -1
- package/components/counter/src/auro-counter.js +11 -2
- package/components/datepicker/.turbo/turbo-build.log +3 -3
- package/components/datepicker/README.md +4 -4
- package/components/datepicker/demo/api.md +5 -4
- package/components/datepicker/demo/api.min.js +15 -7
- package/components/datepicker/demo/index.min.js +15 -7
- package/components/datepicker/dist/auro-datepicker.d.ts +5 -0
- package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
- package/components/datepicker/dist/index.js +15 -7
- package/components/datepicker/src/auro-datepicker.js +10 -2
- 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 +1 -1
- package/components/form/demo/api.min.js +218 -70
- package/components/form/demo/index.min.js +218 -70
- package/components/form/demo/registerDemoDeps.js +3 -2
- package/components/form/demo/working.html +23 -1
- package/components/form/dist/auro-form.d.ts +60 -6
- package/components/form/dist/auro-form.d.ts.map +1 -1
- package/components/form/dist/index.js +218 -70
- package/components/form/src/auro-form.js +216 -68
- package/components/form/src/styles/style-css.js +1 -1
- package/components/form/src/styles/style.css +0 -8
- package/components/form/src/styles/style.scss +0 -10
- 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/input/demo/api.md +5 -5
- package/components/input/demo/api.min.js +5 -5
- package/components/input/demo/index.min.js +5 -5
- package/components/input/dist/base-input.d.ts +3 -3
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +5 -5
- package/components/input/src/base-input.js +5 -5
- 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/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/radio/demo/api.md +4 -3
- package/components/radio/demo/api.min.js +9 -1
- package/components/radio/demo/index.min.js +9 -1
- package/components/radio/dist/auro-radio-group.d.ts +5 -0
- package/components/radio/dist/auro-radio-group.d.ts.map +1 -1
- package/components/radio/dist/index.js +9 -1
- package/components/radio/src/auro-radio-group.js +9 -1
- package/components/select/.turbo/turbo-build.log +3 -3
- package/components/select/README.md +3 -3
- package/components/select/demo/api.md +4 -3
- package/components/select/demo/api.min.js +9 -1
- package/components/select/demo/index.min.js +9 -1
- package/components/select/dist/auro-select.d.ts +5 -0
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +9 -1
- package/components/select/src/auro-select.js +9 -1
- package/package.json +1 -1
- package/.turbo/cache/000950e13093845f-meta.json +0 -1
- package/.turbo/cache/000950e13093845f.tar.zst +0 -0
- package/.turbo/cache/02ee016619902665-meta.json +0 -1
- package/.turbo/cache/02ee016619902665.tar.zst +0 -0
- package/.turbo/cache/06ca4027e423c554-meta.json +0 -1
- package/.turbo/cache/06ca4027e423c554.tar.zst +0 -0
- package/.turbo/cache/1e855b2163b7c980-meta.json +0 -1
- package/.turbo/cache/1e855b2163b7c980.tar.zst +0 -0
- package/.turbo/cache/26dbf393768f87cc-meta.json +0 -1
- package/.turbo/cache/26dbf393768f87cc.tar.zst +0 -0
- package/.turbo/cache/31bd5687f46c7eba-meta.json +0 -1
- package/.turbo/cache/31bd5687f46c7eba.tar.zst +0 -0
- package/.turbo/cache/3488cff10dd06acd-meta.json +0 -1
- package/.turbo/cache/3488cff10dd06acd.tar.zst +0 -0
- package/.turbo/cache/3c8718d2ba6d3fe5-meta.json +0 -1
- package/.turbo/cache/3c8718d2ba6d3fe5.tar.zst +0 -0
- package/.turbo/cache/43693504bf6e7c4c-meta.json +0 -1
- package/.turbo/cache/43693504bf6e7c4c.tar.zst +0 -0
- package/.turbo/cache/56f2745125fdd552-meta.json +0 -1
- package/.turbo/cache/5f43911cbacf7df1-meta.json +0 -1
- package/.turbo/cache/5f43911cbacf7df1.tar.zst +0 -0
- package/.turbo/cache/647bda3b31d82dc2-meta.json +0 -1
- package/.turbo/cache/647bda3b31d82dc2.tar.zst +0 -0
- package/.turbo/cache/6951c2a52e5ab5f7-meta.json +0 -1
- package/.turbo/cache/6951c2a52e5ab5f7.tar.zst +0 -0
- package/.turbo/cache/876b8fa390c8ec81-meta.json +0 -1
- package/.turbo/cache/876b8fa390c8ec81.tar.zst +0 -0
- package/.turbo/cache/8f287fd5d33579ae-meta.json +0 -1
- package/.turbo/cache/8f287fd5d33579ae.tar.zst +0 -0
- package/.turbo/cache/8fcce3ba8357be57-meta.json +0 -1
- package/.turbo/cache/8fcce3ba8357be57.tar.zst +0 -0
- package/.turbo/cache/9b5868be65819fdf-meta.json +0 -1
- package/.turbo/cache/9b5868be65819fdf.tar.zst +0 -0
- package/.turbo/cache/a227e8174447e364-meta.json +0 -1
- package/.turbo/cache/a227e8174447e364.tar.zst +0 -0
- package/.turbo/cache/c3b2cc1b044a4135-meta.json +0 -1
- package/.turbo/cache/c3b2cc1b044a4135.tar.zst +0 -0
- package/.turbo/cache/cf143eb1a55684db-meta.json +0 -1
- package/.turbo/cache/cf143eb1a55684db.tar.zst +0 -0
- package/.turbo/cache/d5b85352bc667f19-meta.json +0 -1
- package/.turbo/cache/d5b85352bc667f19.tar.zst +0 -0
- package/.turbo/cache/e392fe0927e4af23-meta.json +0 -1
- package/.turbo/cache/e392fe0927e4af23.tar.zst +0 -0
- package/.turbo/cache/f2913bf19939d840-meta.json +0 -1
- package/.turbo/cache/f2913bf19939d840.tar.zst +0 -0
- package/.turbo/cache/f86b28e5ea2c66fe-meta.json +0 -1
- package/.turbo/cache/f86b28e5ea2c66fe.tar.zst +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable no-underscore-dangle */
|
|
1
|
+
/* eslint-disable no-underscore-dangle,max-lines */
|
|
2
2
|
|
|
3
3
|
// Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
4
4
|
// See LICENSE in the project root for license information.
|
|
@@ -37,7 +37,12 @@ import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/util
|
|
|
37
37
|
export class AuroForm extends LitElement {
|
|
38
38
|
static get properties() {
|
|
39
39
|
return {
|
|
40
|
-
|
|
40
|
+
formState: { attribute: false },
|
|
41
|
+
_validity: { attribute: false },
|
|
42
|
+
_isInitialState: { attribute: false },
|
|
43
|
+
_elements: { attribute: false },
|
|
44
|
+
_submitElements: { attribute: false },
|
|
45
|
+
_resetElements: { attribute: false },
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
48
|
|
|
@@ -45,7 +50,24 @@ export class AuroForm extends LitElement {
|
|
|
45
50
|
super();
|
|
46
51
|
|
|
47
52
|
/** @type {FormState} */
|
|
48
|
-
this.
|
|
53
|
+
this.formState = {};
|
|
54
|
+
|
|
55
|
+
/** @type {"valid" | "invalid" | null} */
|
|
56
|
+
this._validity = null;
|
|
57
|
+
this._isInitialState = true;
|
|
58
|
+
|
|
59
|
+
/** @type {(HTMLElement & {reset: () => void})[]} */
|
|
60
|
+
this._elements = [];
|
|
61
|
+
|
|
62
|
+
/** @type {HTMLButtonElement[]} */
|
|
63
|
+
this._submitelements = [];
|
|
64
|
+
|
|
65
|
+
/** @type {HTMLButtonElement[]} */
|
|
66
|
+
this._resetElements = [];
|
|
67
|
+
|
|
68
|
+
// Bind listeners
|
|
69
|
+
this.reset = this.reset.bind(this);
|
|
70
|
+
this.submit = this.submit.bind(this);
|
|
49
71
|
}
|
|
50
72
|
|
|
51
73
|
// Note: button is NOT considered a form element in this context
|
|
@@ -79,7 +101,7 @@ export class AuroForm extends LitElement {
|
|
|
79
101
|
return this._isInElementCollection(AuroForm.formElementTags, element);
|
|
80
102
|
}
|
|
81
103
|
|
|
82
|
-
static get
|
|
104
|
+
static get buttonElementTags() {
|
|
83
105
|
return [
|
|
84
106
|
'button',
|
|
85
107
|
'auro-button',
|
|
@@ -87,12 +109,12 @@ export class AuroForm extends LitElement {
|
|
|
87
109
|
}
|
|
88
110
|
|
|
89
111
|
/**
|
|
90
|
-
* Check if the tag name is a
|
|
112
|
+
* Check if the tag name is a button element.
|
|
91
113
|
* @param {HTMLElement} element - The element to check.
|
|
92
114
|
* @returns {boolean}
|
|
93
115
|
*/
|
|
94
|
-
|
|
95
|
-
return this._isInElementCollection(AuroForm.
|
|
116
|
+
isButtonElement(element) {
|
|
117
|
+
return this._isInElementCollection(AuroForm.buttonElementTags, element);
|
|
96
118
|
}
|
|
97
119
|
|
|
98
120
|
static get styles() {
|
|
@@ -109,45 +131,76 @@ export class AuroForm extends LitElement {
|
|
|
109
131
|
* @returns {Record<string, string | number | boolean | string[] | null>} The form value.
|
|
110
132
|
*/
|
|
111
133
|
get value() {
|
|
112
|
-
return Object.keys(this.
|
|
113
|
-
acc[key] = this.
|
|
134
|
+
return Object.keys(this.formState).reduce((acc, key) => {
|
|
135
|
+
acc[key] = this.formState[key].value;
|
|
114
136
|
return acc;
|
|
115
137
|
}, {});
|
|
116
138
|
}
|
|
117
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Infer validity status based on current formState.
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
_calculateValidity() {
|
|
145
|
+
if (this.isInitialState) {
|
|
146
|
+
this._validity = null;
|
|
147
|
+
} else {
|
|
148
|
+
// go through validity states and return the first invalid state (if any)
|
|
149
|
+
const invalidKey = Object.keys(this.formState).
|
|
150
|
+
find((key) => {
|
|
151
|
+
const formKey = this.formState[key];
|
|
152
|
+
// these are NOT extra parens
|
|
153
|
+
// eslint-disable-next-line no-extra-parens
|
|
154
|
+
return (formKey.validity !== 'valid' && formKey.required) || (formKey.validity !== 'valid' && formKey.value !== null);
|
|
155
|
+
});
|
|
156
|
+
this._validity = invalidKey ? 'invalid' : 'valid';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Current validity state of the form, based on form element events.
|
|
162
|
+
* @returns {"valid" | "invalid"}
|
|
163
|
+
*/
|
|
118
164
|
get validity() {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
});
|
|
165
|
+
return this._validity;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
_setInitialState() {
|
|
169
|
+
const anyTainted = Object.keys(this.formState).some((key) => this.formState[key].validity !== null || this.formState[key].value !== null);
|
|
128
170
|
|
|
129
|
-
|
|
171
|
+
this._isInitialState = !anyTainted;
|
|
172
|
+
|
|
173
|
+
this._resetElements.forEach((resetElement) => {
|
|
174
|
+
if (resetElement.hasAttribute("disabled")) {
|
|
175
|
+
resetElement.removeAttribute("disabled");
|
|
176
|
+
}
|
|
177
|
+
});
|
|
130
178
|
}
|
|
131
179
|
|
|
132
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Mostly internal way to determine if a form is in the initial state.
|
|
182
|
+
* @returns {boolean}
|
|
183
|
+
*/
|
|
133
184
|
get isInitialState() {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return !anyTainted;
|
|
185
|
+
return this._isInitialState;
|
|
137
186
|
}
|
|
138
187
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
188
|
+
setDisabledStateOnButtons() {
|
|
189
|
+
this._resetElements.forEach((element) => {
|
|
190
|
+
if (this.isInitialState) {
|
|
191
|
+
element.setAttribute("disabled", "");
|
|
192
|
+
} else {
|
|
193
|
+
element.removeAttribute("disabled");
|
|
194
|
+
}
|
|
195
|
+
});
|
|
144
196
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
197
|
+
this._submitelements.forEach((element) => {
|
|
198
|
+
if (this.isInitialState || this.validity !== "valid") {
|
|
199
|
+
element.setAttribute("disabled", "");
|
|
200
|
+
} else {
|
|
201
|
+
element.removeAttribute("disabled");
|
|
202
|
+
}
|
|
203
|
+
});
|
|
151
204
|
}
|
|
152
205
|
|
|
153
206
|
/**
|
|
@@ -155,16 +208,111 @@ export class AuroForm extends LitElement {
|
|
|
155
208
|
* @returns {NodeList}
|
|
156
209
|
*/
|
|
157
210
|
queryAuroElements() {
|
|
158
|
-
const
|
|
159
|
-
|
|
211
|
+
const queries = [
|
|
212
|
+
[
|
|
213
|
+
AuroForm.formElementTags,
|
|
214
|
+
'[name]'
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
AuroForm.buttonElementTags,
|
|
218
|
+
'[type=submit]'
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
AuroForm.buttonElementTags,
|
|
222
|
+
'[type=reset]'
|
|
223
|
+
]
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
return this.querySelectorAll(queries.flatMap(([
|
|
227
|
+
tags,
|
|
228
|
+
extraAttributes
|
|
229
|
+
]) => tags.map((tag) => `${tag}${extraAttributes}, [${tag}]${extraAttributes}`)).join(', '));
|
|
230
|
+
}
|
|
160
231
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Initialize (or reinitialize) the form state.
|
|
234
|
+
*/
|
|
235
|
+
initializeState() {
|
|
236
|
+
this.formState = {};
|
|
237
|
+
this._submitelements = [];
|
|
238
|
+
this._resetElements = [];
|
|
239
|
+
this._elements = [];
|
|
240
|
+
|
|
241
|
+
this.queryAuroElements().forEach((element) => {
|
|
242
|
+
if (this.isFormElement(element)) {
|
|
243
|
+
this.formState[element.getAttribute('name')] = {
|
|
244
|
+
value: element.getAttribute('value'),
|
|
245
|
+
validity: element.getAttribute('validity'),
|
|
246
|
+
required: element.hasAttribute('required'),
|
|
247
|
+
// element
|
|
248
|
+
};
|
|
164
249
|
|
|
165
|
-
|
|
250
|
+
this._elements.push(element);
|
|
251
|
+
}
|
|
166
252
|
|
|
167
|
-
|
|
253
|
+
if (this.isButtonElement(element) && element.getAttribute('type') === 'submit') {
|
|
254
|
+
element.removeEventListener('click', this.submit);
|
|
255
|
+
element.addEventListener('click', this.submit);
|
|
256
|
+
|
|
257
|
+
// Keep record of this element, so we can enable/disable as needed
|
|
258
|
+
this._submitelements.push(element);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (this.isButtonElement(element) && element.getAttribute('type') === 'reset') {
|
|
262
|
+
// Keep record of this element, so we can enable/disable as needed
|
|
263
|
+
element.removeEventListener('click', this.reset);
|
|
264
|
+
element.addEventListener('click', this.reset);
|
|
265
|
+
|
|
266
|
+
this._resetElements.push(element);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// Set enabled/disabled states on buttons
|
|
271
|
+
this.setDisabledStateOnButtons();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
reset() {
|
|
275
|
+
this._elements.forEach((element) => element.reset());
|
|
276
|
+
|
|
277
|
+
this.updateComplete.then(() => {
|
|
278
|
+
this.initializeState();
|
|
279
|
+
// Initial state must come first - validity can only be null if initial state is true
|
|
280
|
+
this._setInitialState();
|
|
281
|
+
this._calculateValidity();
|
|
282
|
+
|
|
283
|
+
// Wait for the above changes to run through, then disable submit/reset
|
|
284
|
+
this.updateComplete.then(() => {
|
|
285
|
+
this.setDisabledStateOnButtons();
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Submit fires an event called `submit` - just as you would expect from a normal form.
|
|
292
|
+
*
|
|
293
|
+
* @example ```
|
|
294
|
+
* const form = document.querySelector('auro-
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
submit() {
|
|
298
|
+
// Steps required to get out of beta:
|
|
299
|
+
// 1. Submit triggers a forced validation on ALL elements
|
|
300
|
+
// 2. Wait for validation to complete (this.updateComplete.then or similar)
|
|
301
|
+
// 3. If still valid, go ahead with submit.
|
|
302
|
+
this._elements.forEach((element) => {
|
|
303
|
+
if (element.tagName.toLowerCase() !== "auro-datepicker") {
|
|
304
|
+
// Next line currently does NOT force
|
|
305
|
+
element.validate();
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
this.dispatchEvent(new CustomEvent('submit', {
|
|
310
|
+
bubbles: true,
|
|
311
|
+
composed: true,
|
|
312
|
+
detail: {
|
|
313
|
+
value: this.value
|
|
314
|
+
}
|
|
315
|
+
}));
|
|
168
316
|
}
|
|
169
317
|
|
|
170
318
|
/**
|
|
@@ -186,49 +334,49 @@ export class AuroForm extends LitElement {
|
|
|
186
334
|
|
|
187
335
|
// Update the form state when a form element is detected
|
|
188
336
|
slot.addEventListener('input', (event) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (this.isFormElement(eventTarget)) {
|
|
193
|
-
this._formState[eventTarget.getAttribute("name")].value = eventTarget.value;
|
|
337
|
+
const targetName = event.target.getAttribute("name");
|
|
338
|
+
if (!this.isFormElement(event.target) || !targetName) {
|
|
339
|
+
return;
|
|
194
340
|
}
|
|
341
|
+
|
|
342
|
+
this.formState[targetName].value = event.target.value;
|
|
343
|
+
this.requestUpdate('formState');
|
|
195
344
|
});
|
|
196
345
|
|
|
197
346
|
slot.addEventListener('auroFormElement-validated', (event) => {
|
|
198
|
-
const
|
|
347
|
+
const targetName = event.target.getAttribute("name");
|
|
348
|
+
if (!this.isFormElement(event.target) || !targetName) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
199
351
|
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
352
|
+
this.formState[targetName].validity = event.detail.validity;
|
|
353
|
+
this._calculateValidity();
|
|
202
354
|
});
|
|
203
355
|
}
|
|
204
356
|
|
|
205
|
-
|
|
206
|
-
|
|
357
|
+
updated(_changedProperties) {
|
|
358
|
+
super.updated(_changedProperties);
|
|
207
359
|
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
}
|
|
360
|
+
if (_changedProperties.has("formState")) {
|
|
361
|
+
this._setInitialState();
|
|
217
362
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
363
|
+
// Automatically infer disabled state now
|
|
364
|
+
this.setDisabledStateOnButtons();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (_changedProperties.has("_validity")) {
|
|
368
|
+
this._setInitialState();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
onSlotChange() {
|
|
373
|
+
this.initializeState();
|
|
223
374
|
}
|
|
224
375
|
|
|
225
376
|
// function that renders the HTML and CSS into the scope of the component
|
|
226
377
|
render() {
|
|
227
378
|
return html`
|
|
228
379
|
<form>
|
|
229
|
-
<p>Value: ${JSON.stringify(this.value)}</p>
|
|
230
|
-
<p>Validity: ${this.validity}</p>
|
|
231
|
-
<h3>Auro form example</h3>
|
|
232
380
|
<slot @slotchange="${this.onSlotChange}"></slot>
|
|
233
381
|
</form>
|
|
234
382
|
`;
|
|
@@ -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)}`;
|
|
@@ -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 [
|
|
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 [1m972ms[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 [1m912ms[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 [1m843ms[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 [1m732ms[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.18/dist/auro-input__bundled.js" type="module"></script>
|
|
93
93
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
94
94
|
|
|
95
95
|
## auro-input use cases
|
|
@@ -54,11 +54,11 @@ Generate unique names for dependency components.
|
|
|
54
54
|
|
|
55
55
|
## Methods
|
|
56
56
|
|
|
57
|
-
| Method | Type
|
|
58
|
-
|
|
59
|
-
| [isDateType](#isDateType) | `(): boolean`
|
|
60
|
-
| [reset](#reset) | `(): void`
|
|
61
|
-
| [validate](#validate) | `(): void`
|
|
57
|
+
| Method | Type | Description |
|
|
58
|
+
|--------------|----------------------------------------|--------------------------------------------------|
|
|
59
|
+
| [isDateType](#isDateType) | `(): boolean` | |
|
|
60
|
+
| [reset](#reset) | `(): void` | Resets component to initial state. |
|
|
61
|
+
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value<br /><br />**force**: Whether to force validation. |
|
|
62
62
|
|
|
63
63
|
## Events
|
|
64
64
|
|
|
@@ -2827,7 +2827,7 @@ class BaseInput extends r {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
|
|
2829
2829
|
if (changedProperties.has('error')) {
|
|
2830
|
-
this.
|
|
2830
|
+
this.validate(true);
|
|
2831
2831
|
}
|
|
2832
2832
|
|
|
2833
2833
|
if (changedProperties.has('validity')) {
|
|
@@ -3019,11 +3019,11 @@ class BaseInput extends r {
|
|
|
3019
3019
|
}
|
|
3020
3020
|
|
|
3021
3021
|
/**
|
|
3022
|
-
*
|
|
3023
|
-
* @
|
|
3022
|
+
* Validates value
|
|
3023
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
3024
3024
|
*/
|
|
3025
|
-
validate() {
|
|
3026
|
-
this.validation.validate(this);
|
|
3025
|
+
validate(force = false) {
|
|
3026
|
+
this.validation.validate(this, force);
|
|
3027
3027
|
}
|
|
3028
3028
|
|
|
3029
3029
|
/**
|
|
@@ -2765,7 +2765,7 @@ class BaseInput extends r {
|
|
|
2765
2765
|
}
|
|
2766
2766
|
|
|
2767
2767
|
if (changedProperties.has('error')) {
|
|
2768
|
-
this.
|
|
2768
|
+
this.validate(true);
|
|
2769
2769
|
}
|
|
2770
2770
|
|
|
2771
2771
|
if (changedProperties.has('validity')) {
|
|
@@ -2957,11 +2957,11 @@ class BaseInput extends r {
|
|
|
2957
2957
|
}
|
|
2958
2958
|
|
|
2959
2959
|
/**
|
|
2960
|
-
*
|
|
2961
|
-
* @
|
|
2960
|
+
* Validates value
|
|
2961
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
2962
2962
|
*/
|
|
2963
|
-
validate() {
|
|
2964
|
-
this.validation.validate(this);
|
|
2963
|
+
validate(force = false) {
|
|
2964
|
+
this.validation.validate(this, force);
|
|
2965
2965
|
}
|
|
2966
2966
|
|
|
2967
2967
|
/**
|
|
@@ -347,10 +347,10 @@ export default class BaseInput extends LitElement {
|
|
|
347
347
|
*/
|
|
348
348
|
private getActiveElement;
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
351
|
-
* @
|
|
350
|
+
* Validates value
|
|
351
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
352
352
|
*/
|
|
353
|
-
validate(): void;
|
|
353
|
+
validate(force?: boolean): void;
|
|
354
354
|
/**
|
|
355
355
|
* Resets component to initial state.
|
|
356
356
|
* @returns {void}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-input.d.ts","sourceRoot":"","sources":["../src/base-input.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;GAgBG;AAEH;IA+EE;QAGI;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;;;;;QAUH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;MAMN;IAGD,+CAMC;IArVC,cAAiB;IACjB,kBAAqB;IACrB,kBAAqB;IACrB,oBAAuB;IACvB,SAAoB;IACpB,SAAoB;IACpB,eAA0B;IAC1B,eAA0B;IAC1B,qBAAwB;IACxB,iCAAyC;IAG3C;;;;OAIG;IACH,wBAsDC;IArDC,+BAA0C;IAC1C,mBAA8B;IAC9B,kBAAyB;IACzB,2BAAmC;IACnC,kBAAqB;IACrB,cAAuC;IAEvC,4BASC;IAED,yBAQC;IAED,8BAMC;IAED;;;OAGG;IACH,iCAIC;IAMD,iBAEwC;IAwZ1C,qBAwEC;IAlEC,+BAA0D;IAC1D,+BAA0D;IAIxD,6BAAqD;IAmC7C,uBAA0D;IA4BtE;;;;OAIG;IACH,2BAHW,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GACd,IAAI,CA6DhB;IArDG,iBAAwB;IAuD5B;;;OAGG;IACH,2BAkBC;IAED;;;OAGG;IACH,6BAMC;IAED;;;OAGG;IACH,sBAMC;IAED;;;;OAIG;IACH,cAEC;IAED;;;;;OAKG;IACH,sBAIC;IAED;;;;OAIG;IACH,2BAUC;IAED;;;;OAIG;IACH,yBAOC;IALC,cAAe;IAOjB;;;OAGG;IACH,oBA0BC;IAED;;;;OAIG;IACH,sBAWC;IAED;;;;OAIG;IACH,mBAMC;IAED;;;;;OAKG;IACH,yBAYC;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"base-input.d.ts","sourceRoot":"","sources":["../src/base-input.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;GAgBG;AAEH;IA+EE;QAGI;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;;;;;QAUH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;QAMH;;WAEG;;;;QAKH;;WAEG;;;;QAKH;;WAEG;;;;;MAMN;IAGD,+CAMC;IArVC,cAAiB;IACjB,kBAAqB;IACrB,kBAAqB;IACrB,oBAAuB;IACvB,SAAoB;IACpB,SAAoB;IACpB,eAA0B;IAC1B,eAA0B;IAC1B,qBAAwB;IACxB,iCAAyC;IAG3C;;;;OAIG;IACH,wBAsDC;IArDC,+BAA0C;IAC1C,mBAA8B;IAC9B,kBAAyB;IACzB,2BAAmC;IACnC,kBAAqB;IACrB,cAAuC;IAEvC,4BASC;IAED,yBAQC;IAED,8BAMC;IAED;;;OAGG;IACH,iCAIC;IAMD,iBAEwC;IAwZ1C,qBAwEC;IAlEC,+BAA0D;IAC1D,+BAA0D;IAIxD,6BAAqD;IAmC7C,uBAA0D;IA4BtE;;;;OAIG;IACH,2BAHW,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GACd,IAAI,CA6DhB;IArDG,iBAAwB;IAuD5B;;;OAGG;IACH,2BAkBC;IAED;;;OAGG;IACH,6BAMC;IAED;;;OAGG;IACH,sBAMC;IAED;;;;OAIG;IACH,cAEC;IAED;;;;;OAKG;IACH,sBAIC;IAED;;;;OAIG;IACH,2BAUC;IAED;;;;OAIG;IACH,yBAOC;IALC,cAAe;IAOjB;;;OAGG;IACH,oBA0BC;IAED;;;;OAIG;IACH,sBAWC;IAED;;;;OAIG;IACH,mBAMC;IAED;;;;;OAKG;IACH,yBAYC;IAED;;;OAGG;IACH,iBAFW,OAAO,QAIjB;IAED;;;OAGG;IACH,SAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,6BAYC;IAVG,sBAAuB;IAY3B;;;;;OAKG;IACH,qBAMC;IAED;;;;;OAKG;IACH,oBAwBC;IAED;;;;OAIG;IACH,gCAGC;IAED;;;;OAIG;IACH,uBAkBC;IAED;;;;OAIG;IACH,wBAQC;IAED;;;;OAIG;IACH,2BAQC;IAKD;;;;OAIG;IACH,0BAWC;IALC,kBAAqC;IAOvC;;;;OAIG;IACH,oCAqFC;CACF;2BAtkC+B,KAAK;+BAUN,+BAA+B"}
|
|
@@ -2748,7 +2748,7 @@ class BaseInput extends r {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
|
|
2750
2750
|
if (changedProperties.has('error')) {
|
|
2751
|
-
this.
|
|
2751
|
+
this.validate(true);
|
|
2752
2752
|
}
|
|
2753
2753
|
|
|
2754
2754
|
if (changedProperties.has('validity')) {
|
|
@@ -2940,11 +2940,11 @@ class BaseInput extends r {
|
|
|
2940
2940
|
}
|
|
2941
2941
|
|
|
2942
2942
|
/**
|
|
2943
|
-
*
|
|
2944
|
-
* @
|
|
2943
|
+
* Validates value
|
|
2944
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
2945
2945
|
*/
|
|
2946
|
-
validate() {
|
|
2947
|
-
this.validation.validate(this);
|
|
2946
|
+
validate(force = false) {
|
|
2947
|
+
this.validation.validate(this, force);
|
|
2948
2948
|
}
|
|
2949
2949
|
|
|
2950
2950
|
/**
|
|
@@ -651,7 +651,7 @@ export default class BaseInput extends LitElement {
|
|
|
651
651
|
}
|
|
652
652
|
|
|
653
653
|
if (changedProperties.has('error')) {
|
|
654
|
-
this.
|
|
654
|
+
this.validate(true);
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
if (changedProperties.has('validity')) {
|
|
@@ -843,11 +843,11 @@ export default class BaseInput extends LitElement {
|
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
/**
|
|
846
|
-
*
|
|
847
|
-
* @
|
|
846
|
+
* Validates value
|
|
847
|
+
* @param {boolean} [force=false] - Whether to force validation.
|
|
848
848
|
*/
|
|
849
|
-
validate() {
|
|
850
|
-
this.validation.validate(this);
|
|
849
|
+
validate(force = false) {
|
|
850
|
+
this.validation.validate(this, force);
|
|
851
851
|
}
|
|
852
852
|
|
|
853
853
|
/**
|
|
@@ -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 [1m578ms[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 [1m588ms[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 [1m526ms[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 [1m849ms[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 [1m660ms[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 [1m688ms[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.18/dist/auro-menu__bundled.js" type="module"></script>
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
106
106
|
## auro-menu use cases
|
|
@@ -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 [1m663ms[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 [1m437ms[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 [1m419ms[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
|