@aurodesignsystem-dev/auro-formkit 0.0.0-pr1471.4 → 0.0.0-pr1474.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.min.js +3 -3
- package/components/combobox/demo/getting-started.min.js +3 -3
- package/components/combobox/demo/index.min.js +3 -3
- package/components/combobox/dist/index.js +3 -3
- package/components/combobox/dist/registered.js +3 -3
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +1 -1
- package/components/counter/dist/registered.js +1 -1
- package/components/datepicker/demo/index.min.js +3 -3
- package/components/datepicker/dist/index.js +3 -3
- package/components/datepicker/dist/registered.js +3 -3
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.html +6 -6
- package/components/form/demo/customize.js +17 -0
- package/components/form/demo/customize.md +125 -51
- package/components/form/demo/customize.min.js +196 -20
- package/components/form/demo/getting-started.min.js +160 -20
- package/components/form/demo/index.min.js +160 -20
- package/components/form/demo/registerDemoDeps.min.js +13 -13
- package/components/form/dist/auro-form.d.ts +45 -5
- package/components/form/dist/index.js +147 -7
- package/components/form/dist/registered.js +147 -7
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.min.js +2 -2
- package/components/select/demo/getting-started.min.js +2 -2
- package/components/select/demo/index.min.js +2 -2
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +69 -0
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
<auro-anchorlink fluid href="#layout">Layout</auro-anchorlink>
|
|
8
8
|
<auro-anchorlink fluid href="#columnLayout" class="level2 body-xs">Column Layout</auro-anchorlink>
|
|
9
9
|
<auro-anchorlink fluid href="#complexForm" class="level2 body-xs">Complex Form</auro-anchorlink>
|
|
10
|
+
<auro-anchorlink fluid href="#fieldState">Field State</auro-anchorlink>
|
|
11
|
+
<auro-anchorlink fluid href="#disabledFields" class="level2 body-xs">Disabled Fields</auro-anchorlink>
|
|
10
12
|
</auro-nav>
|
|
11
13
|
</nav>
|
|
12
14
|
<div class="mainContent">
|
|
@@ -24,16 +26,14 @@
|
|
|
24
26
|
display: grid;
|
|
25
27
|
grid-template-columns: 1fr 1fr;
|
|
26
28
|
gap: 1rem;
|
|
29
|
+
align-items: start;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
.columned-form
|
|
30
|
-
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
padding: 1rem;
|
|
33
|
-
gap: 1rem;
|
|
32
|
+
.columned-form .span-2 {
|
|
33
|
+
grid-column: span 2;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.controls {
|
|
36
|
+
.columned-form-controls {
|
|
37
37
|
display: flex;
|
|
38
38
|
justify-content: flex-end;
|
|
39
39
|
margin-top: 1rem;
|
|
@@ -41,29 +41,25 @@
|
|
|
41
41
|
</style>
|
|
42
42
|
<auro-form>
|
|
43
43
|
<div class="columned-form">
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<span slot="label">Search flights</span>
|
|
44
|
+
<auro-input id="cl-first-name" name="firstName" required>
|
|
45
|
+
<span slot="label">First Name</span>
|
|
47
46
|
</auro-input>
|
|
48
|
-
<auro-input id="last-name" name="lastName" required>
|
|
47
|
+
<auro-input id="cl-last-name" name="lastName" required>
|
|
49
48
|
<span slot="label">Last Name</span>
|
|
50
|
-
</auro-input>
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<span slot="
|
|
57
|
-
<span slot="
|
|
58
|
-
<span slot="bib.fullscreen.
|
|
59
|
-
<span slot="bib.fullscreen.toLabel">End</span>
|
|
49
|
+
</auro-input>
|
|
50
|
+
<auro-input id="cl-email" name="email" type="email" class="span-2" required>
|
|
51
|
+
<span slot="label">Email</span>
|
|
52
|
+
</auro-input>
|
|
53
|
+
<auro-datepicker id="cl-date-range" name="dateRange" class="span-2" required range>
|
|
54
|
+
<span slot="fromLabel">Departure</span>
|
|
55
|
+
<span slot="toLabel">Return</span>
|
|
56
|
+
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
57
|
+
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
60
58
|
</auro-datepicker>
|
|
61
59
|
</div>
|
|
62
|
-
<div class="controls">
|
|
60
|
+
<div class="columned-form-controls">
|
|
63
61
|
<auro-button type="submit">Submit</auro-button>
|
|
64
62
|
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
63
|
</auro-form>
|
|
68
64
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
69
65
|
</div>
|
|
@@ -76,16 +72,14 @@
|
|
|
76
72
|
display: grid;
|
|
77
73
|
grid-template-columns: 1fr 1fr;
|
|
78
74
|
gap: 1rem;
|
|
75
|
+
align-items: start;
|
|
79
76
|
}
|
|
80
77
|
|
|
81
|
-
.columned-form
|
|
82
|
-
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
padding: 1rem;
|
|
85
|
-
gap: 1rem;
|
|
78
|
+
.columned-form .span-2 {
|
|
79
|
+
grid-column: span 2;
|
|
86
80
|
}
|
|
87
81
|
|
|
88
|
-
.controls {
|
|
82
|
+
.columned-form-controls {
|
|
89
83
|
display: flex;
|
|
90
84
|
justify-content: flex-end;
|
|
91
85
|
margin-top: 1rem;
|
|
@@ -93,28 +87,24 @@
|
|
|
93
87
|
</style>
|
|
94
88
|
<auro-form>
|
|
95
89
|
<div class="columned-form">
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
<div class="controls">
|
|
115
|
-
<auro-button type="submit">Submit</auro-button>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
90
|
+
<auro-input id="cl-first-name" name="firstName" required>
|
|
91
|
+
<span slot="label">First Name</span>
|
|
92
|
+
</auro-input>
|
|
93
|
+
<auro-input id="cl-last-name" name="lastName" required>
|
|
94
|
+
<span slot="label">Last Name</span>
|
|
95
|
+
</auro-input>
|
|
96
|
+
<auro-input id="cl-email" name="email" type="email" class="span-2" required>
|
|
97
|
+
<span slot="label">Email</span>
|
|
98
|
+
</auro-input>
|
|
99
|
+
<auro-datepicker id="cl-date-range" name="dateRange" class="span-2" required range>
|
|
100
|
+
<span slot="fromLabel">Departure</span>
|
|
101
|
+
<span slot="toLabel">Return</span>
|
|
102
|
+
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
103
|
+
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
104
|
+
</auro-datepicker>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="columned-form-controls">
|
|
107
|
+
<auro-button type="submit">Submit</auro-button>
|
|
118
108
|
</div>
|
|
119
109
|
</auro-form></code></pre>
|
|
120
110
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -241,6 +231,90 @@
|
|
|
241
231
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
242
232
|
</auro-accordion>
|
|
243
233
|
</section>
|
|
234
|
+
<section>
|
|
235
|
+
<auro-header level="2" id="fieldState">Field State</auro-header>
|
|
236
|
+
<p>Per the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/disabled">HTML spec</a>, form controls with the <code>disabled</code> attribute are excluded from form submission and are not validated. <code>auro-form</code> mirrors that behavior.</p>
|
|
237
|
+
<auro-header level="3" id="disabledFields">Disabled Fields</auro-header>
|
|
238
|
+
<p>When a child form element has the <code>disabled</code> attribute:</p>
|
|
239
|
+
<ul>
|
|
240
|
+
<li>Its <code>name</code> is omitted from <code>form.value</code> and from the <code>submit</code> event's <code>detail.value</code>, even if the element carries a value.</li>
|
|
241
|
+
<li>It does not contribute to <code>validity</code> — a disabled <code>required</code> field will not block submission.</li>
|
|
242
|
+
<li>It does not taint <code>isInitialState</code> — a disabled field carrying a preset value still leaves the form in its initial state.</li>
|
|
243
|
+
</ul>
|
|
244
|
+
<p><strong>Behavior change:</strong> a form whose only invalid field was a <code>disabled</code> AND <code>required</code> field is now submittable, where previously it would have been blocked. If your application relied on a <code>disabled</code>/<code>required</code> field gating submission, surface that constraint a different way (for example, only render the field once the prerequisite is met).</p>
|
|
245
|
+
<p>In the example below the Mileage Plan number is preset and disabled. Fill in the remaining required fields and submit the form — the output region below the form will show the contents of the <code>submit</code> event's <code>detail.value</code>. Notice that only <code>firstName</code> and <code>lastName</code> appear; <code>loyaltyNumber</code> is omitted even though the field has a value.</p>
|
|
246
|
+
<div class="exampleWrapper">
|
|
247
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
248
|
+
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
249
|
+
<auro-form id="disabledExampleForm">
|
|
250
|
+
<auro-input id="first-name" name="firstName" required>
|
|
251
|
+
<span slot="label">First Name</span>
|
|
252
|
+
</auro-input>
|
|
253
|
+
<br />
|
|
254
|
+
<auro-input id="last-name" name="lastName" required>
|
|
255
|
+
<span slot="label">Last Name</span>
|
|
256
|
+
</auro-input>
|
|
257
|
+
<br />
|
|
258
|
+
<auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled>
|
|
259
|
+
<span slot="label">Mileage Plan number</span>
|
|
260
|
+
<span slot="helpText">Account number is read-only and is not submitted with the form.</span>
|
|
261
|
+
</auro-input>
|
|
262
|
+
<br />
|
|
263
|
+
<auro-button type="submit">Submit</auro-button>
|
|
264
|
+
</auro-form>
|
|
265
|
+
<output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite">Submit the form to see what data gets stored.</output>
|
|
266
|
+
<style>
|
|
267
|
+
#disabledExampleOutput {
|
|
268
|
+
display: block;
|
|
269
|
+
margin-top: 2rem;
|
|
270
|
+
padding: 1rem 1.25rem;
|
|
271
|
+
border-left: 4px solid #2a2a2a;
|
|
272
|
+
border-radius: 0.25rem;
|
|
273
|
+
background: #f5f5f5;
|
|
274
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
275
|
+
font-size: 0.875rem;
|
|
276
|
+
white-space: pre-wrap;
|
|
277
|
+
}
|
|
278
|
+
</style>
|
|
279
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
280
|
+
</div>
|
|
281
|
+
<auro-accordion alignRight>
|
|
282
|
+
<span slot="trigger">See code</span>
|
|
283
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
284
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
285
|
+
<pre class="language-html"><code class="language-html"><auro-form id="disabledExampleForm">
|
|
286
|
+
<auro-input id="first-name" name="firstName" required>
|
|
287
|
+
<span slot="label">First Name</span>
|
|
288
|
+
</auro-input>
|
|
289
|
+
<br />
|
|
290
|
+
<auro-input id="last-name" name="lastName" required>
|
|
291
|
+
<span slot="label">Last Name</span>
|
|
292
|
+
</auro-input>
|
|
293
|
+
<br />
|
|
294
|
+
<auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled>
|
|
295
|
+
<span slot="label">Mileage Plan number</span>
|
|
296
|
+
<span slot="helpText">Account number is read-only and is not submitted with the form.</span>
|
|
297
|
+
</auro-input>
|
|
298
|
+
<br />
|
|
299
|
+
<auro-button type="submit">Submit</auro-button>
|
|
300
|
+
</auro-form>
|
|
301
|
+
<output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite">Submit the form to see what data gets stored.</output>
|
|
302
|
+
<style>
|
|
303
|
+
#disabledExampleOutput {
|
|
304
|
+
display: block;
|
|
305
|
+
margin-top: 2rem;
|
|
306
|
+
padding: 1rem 1.25rem;
|
|
307
|
+
border-left: 4px solid #2a2a2a;
|
|
308
|
+
border-radius: 0.25rem;
|
|
309
|
+
background: #f5f5f5;
|
|
310
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
311
|
+
font-size: 0.875rem;
|
|
312
|
+
white-space: pre-wrap;
|
|
313
|
+
}
|
|
314
|
+
</style></code></pre>
|
|
315
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
316
|
+
</auro-accordion>
|
|
317
|
+
</section>
|
|
244
318
|
</div>
|
|
245
319
|
</div>
|
|
246
320
|
</div>
|