@aurodesignsystem-dev/auro-formkit 0.0.0-pr1492.5 → 0.0.0-pr1493.0
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/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
- package/components/bibtemplate/dist/index.js +9 -1
- package/components/bibtemplate/dist/registered.js +9 -1
- package/components/checkbox/demo/css-only.html +57 -0
- package/components/checkbox/demo/css-only.md +146 -0
- package/components/checkbox/demo/customize.min.js +2 -2
- package/components/checkbox/demo/getting-started.min.js +2 -2
- package/components/checkbox/demo/index.min.js +2 -2
- package/components/checkbox/demo/pages.json +1 -1
- package/components/checkbox/demo/styles.min.css +1 -1
- package/components/checkbox/demo/why-checkbox.html +57 -0
- package/components/checkbox/demo/why-checkbox.md +86 -0
- package/components/checkbox/dist/index.js +2 -2
- package/components/checkbox/dist/registered.js +2 -2
- package/components/combobox/demo/css-only.html +57 -0
- package/components/combobox/demo/css-only.md +209 -0
- package/components/combobox/demo/customize.md +7 -3
- package/components/combobox/demo/customize.min.js +1846 -1804
- package/components/combobox/demo/getting-started.min.js +1846 -1804
- package/components/combobox/demo/index.min.js +1846 -1804
- package/components/combobox/demo/pages.json +1 -1
- package/components/combobox/demo/styles.min.css +1 -1
- package/components/combobox/demo/why-combobox.html +57 -0
- package/components/combobox/demo/why-combobox.md +113 -0
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +796 -179
- package/components/combobox/dist/registered.js +796 -179
- package/components/counter/demo/css-only.html +57 -0
- package/components/counter/demo/css-only.md +184 -0
- package/components/counter/demo/customize.min.js +276 -16
- package/components/counter/demo/index.min.js +276 -16
- package/components/counter/demo/keyboard-behavior.md +1 -0
- package/components/counter/demo/pages.json +1 -1
- package/components/counter/demo/styles.min.css +1 -1
- package/components/counter/demo/why-counter.html +57 -0
- package/components/counter/demo/why-counter.md +108 -0
- package/components/counter/dist/index.js +5457 -193
- package/components/counter/dist/registered.js +5457 -193
- package/components/datepicker/demo/accessibility.md +54 -3
- package/components/datepicker/demo/api.md +65 -55
- package/components/datepicker/demo/css-only.html +57 -0
- package/components/datepicker/demo/css-only.md +151 -0
- package/components/datepicker/demo/customize.html +2 -0
- package/components/datepicker/demo/customize.js +19 -0
- package/components/datepicker/demo/customize.md +474 -298
- package/components/datepicker/demo/customize.min.js +36243 -0
- package/components/datepicker/demo/design.md +5 -3
- package/components/datepicker/demo/getting-started.md +6 -6
- package/components/datepicker/demo/index.js +5 -1
- package/components/datepicker/demo/index.md +113 -16
- package/components/datepicker/demo/index.min.js +2735 -396
- package/components/datepicker/demo/keyboard-behavior.md +201 -2
- package/components/datepicker/demo/pages.json +1 -1
- package/components/datepicker/demo/styles.min.css +1 -1
- package/components/datepicker/demo/voiceover.md +21 -12
- package/components/datepicker/demo/why-datepicker.html +57 -0
- package/components/datepicker/demo/why-datepicker.md +133 -0
- package/components/datepicker/dist/index.js +2649 -397
- package/components/datepicker/dist/registered.js +2649 -397
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +116 -14
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +54 -1
- package/components/datepicker/dist/src/auro-calendar.d.ts +264 -0
- package/components/datepicker/dist/src/auro-datepicker.d.ts +189 -53
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
- package/components/datepicker/dist/src/utilities.d.ts +0 -14
- package/components/dropdown/demo/accessibility.md +11 -0
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/css-only.html +57 -0
- package/components/dropdown/demo/css-only.md +219 -0
- package/components/dropdown/demo/customize.md +3 -0
- package/components/dropdown/demo/customize.min.js +265 -13
- package/components/dropdown/demo/getting-started.min.js +265 -13
- package/components/dropdown/demo/index.min.js +265 -13
- package/components/dropdown/demo/keyboard-behavior.md +1 -0
- package/components/dropdown/demo/pages.json +1 -1
- package/components/dropdown/demo/styles.min.css +1 -1
- package/components/dropdown/demo/why-dropdown.html +57 -0
- package/components/dropdown/demo/why-dropdown.md +97 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +36 -1
- package/components/dropdown/dist/index.js +265 -13
- package/components/dropdown/dist/registered.js +265 -13
- package/components/form/demo/css-only.html +57 -0
- package/components/form/demo/css-only.md +156 -0
- package/components/form/demo/customize.min.js +11084 -8072
- package/components/form/demo/getting-started.min.js +11084 -8072
- package/components/form/demo/index.min.js +11084 -8072
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +11083 -8071
- package/components/form/demo/styles.min.css +1 -1
- package/components/form/demo/why-form.html +57 -0
- package/components/form/demo/why-form.md +101 -0
- package/components/input/demo/css-only.html +57 -0
- package/components/input/demo/css-only.md +199 -0
- package/components/input/demo/customize.md +625 -636
- package/components/input/demo/customize.min.js +150 -75
- package/components/input/demo/getting-started.md +16 -6
- package/components/input/demo/getting-started.min.js +150 -75
- package/components/input/demo/index.min.js +150 -75
- package/components/input/demo/pages.json +1 -1
- package/components/input/demo/styles.min.css +1 -1
- package/components/input/demo/why-input.html +57 -0
- package/components/input/demo/why-input.md +121 -0
- package/components/input/dist/auro-input-util.d.ts +1 -1
- package/components/input/dist/base-input.d.ts +16 -0
- package/components/input/dist/index.js +150 -75
- package/components/input/dist/registered.js +150 -75
- package/components/input/dist/utilities.d.ts +1 -2
- package/components/menu/demo/api.md +41 -45
- package/components/menu/demo/css-only.html +57 -0
- package/components/menu/demo/css-only.md +166 -0
- package/components/menu/demo/customize.md +0 -28
- package/components/menu/demo/index.min.js +779 -1354
- package/components/menu/demo/pages.json +1 -1
- package/components/menu/demo/styles.min.css +1 -1
- package/components/menu/demo/why-menu.html +57 -0
- package/components/menu/demo/why-menu.md +104 -0
- package/components/menu/dist/auro-menu.d.ts +95 -110
- package/components/menu/dist/auro-menuoption.d.ts +32 -138
- package/components/menu/dist/index.js +753 -1308
- package/components/menu/dist/registered.js +765 -1308
- package/components/radio/demo/css-only.html +57 -0
- package/components/radio/demo/css-only.md +151 -0
- package/components/radio/demo/customize.min.js +1764 -0
- package/components/radio/demo/demo-support.min.js +55807 -0
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/getting-started.min.js +1783 -0
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/demo/pages.json +1 -1
- package/components/radio/demo/styles.min.css +1 -1
- package/components/radio/demo/why-radio.html +57 -0
- package/components/radio/demo/why-radio.md +92 -0
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/api.md +1 -0
- package/components/select/demo/css-only.html +57 -0
- package/components/select/demo/css-only.md +203 -0
- package/components/select/demo/customize.md +78 -3
- package/components/select/demo/customize.min.js +1341 -1533
- package/components/select/demo/getting-started.min.js +1341 -1533
- package/components/select/demo/index.min.js +1341 -1533
- package/components/select/demo/keyboard-behavior.md +19 -0
- package/components/select/demo/pages.json +1 -1
- package/components/select/demo/styles.min.css +1 -1
- package/components/select/demo/why-select.html +57 -0
- package/components/select/demo/why-select.md +128 -0
- package/components/select/dist/auro-select.d.ts +38 -2
- package/components/select/dist/index.js +435 -52
- package/components/select/dist/registered.js +435 -52
- package/components/select/dist/selectUtils.d.ts +12 -0
- package/custom-elements.json +4206 -3708
- package/package.json +8 -8
- package/components/menu/dist/auro-menu.context.d.ts +0 -238
|
@@ -6,23 +6,24 @@
|
|
|
6
6
|
<span slot="mobileToggleExpanded">View Less</span>
|
|
7
7
|
<auro-anchorlink fluid href="#appearance">Appearance</auro-anchorlink>
|
|
8
8
|
<auro-anchorlink fluid href="#activeLabel" class="level2 body-xs">Active Label</auro-anchorlink>
|
|
9
|
+
<auro-anchorlink fluid href="#cssParts" class="level2 body-xs">CSS Shadow Parts</auro-anchorlink>
|
|
9
10
|
<auro-anchorlink fluid href="#dvInputOnly" class="level2 body-xs">Display Value Input Only</auro-anchorlink>
|
|
10
11
|
<auro-anchorlink fluid href="#icon" class="level2 body-xs">Icon</auro-anchorlink>
|
|
11
12
|
<auro-anchorlink fluid href="#lightDarkBackground" class="level2 body-xs">Light vs. Dark Background</auro-anchorlink>
|
|
12
|
-
<auro-anchorlink fluid href="#
|
|
13
|
+
<auro-anchorlink fluid href="#localization" class="level2 body-xs">Localization</auro-anchorlink>
|
|
14
|
+
<auro-anchorlink fluid href="#nested" class="level2 body-xs">Nested</auro-anchorlink>
|
|
13
15
|
<auro-anchorlink fluid href="#optionalFlag" class="level2 body-xs">Optional Flag</auro-anchorlink>
|
|
16
|
+
<auro-anchorlink fluid href="#placeholder" class="level2 body-xs">Placeholder</auro-anchorlink>
|
|
14
17
|
<auro-anchorlink fluid href="#simple" class="level2 body-xs">Simple</auro-anchorlink>
|
|
15
|
-
<auro-anchorlink fluid href="#nested" class="level2 body-xs">Nested</auro-anchorlink>
|
|
16
18
|
<auro-anchorlink fluid href="#cssTokens" class="level2 body-xs">Tokens</auro-anchorlink>
|
|
17
|
-
<auro-anchorlink fluid href="#cssParts" class="level2 body-xs">CSS Shadow Parts</auro-anchorlink>
|
|
18
19
|
<auro-anchorlink fluid href="#behavior">Behavior</auro-anchorlink>
|
|
19
20
|
<auro-anchorlink fluid href="#autocapitalize" class="level2 body-xs">Autocapitalize</auro-anchorlink>
|
|
20
21
|
<auro-anchorlink fluid href="#autocomplete" class="level2 body-xs">Autocomplete</auro-anchorlink>
|
|
21
22
|
<auro-anchorlink fluid href="#autocorrect" class="level2 body-xs">Autocorrect</auro-anchorlink>
|
|
23
|
+
<auro-anchorlink fluid href="#setCustomValidity" class="level2 body-xs">Custom Validation Messages</auro-anchorlink>
|
|
22
24
|
<auro-anchorlink fluid href="#disabled" class="level2 body-xs">Disabled</auro-anchorlink>
|
|
23
25
|
<auro-anchorlink fluid href="#error" class="level2 body-xs">Error</auro-anchorlink>
|
|
24
26
|
<auro-anchorlink fluid href="#format" class="level2 body-xs">Format</auro-anchorlink>
|
|
25
|
-
<auro-anchorlink fluid href="#regionalDateFormat" class="level2 body-xs">Regional Date</auro-anchorlink>
|
|
26
27
|
<auro-anchorlink fluid href="#inputMode" class="level2 body-xs">Input Mode</auro-anchorlink>
|
|
27
28
|
<auro-anchorlink fluid href="#max" class="level2 body-xs">Max</auro-anchorlink>
|
|
28
29
|
<auro-anchorlink fluid href="#maxLength" class="level2 body-xs">Max Length</auro-anchorlink>
|
|
@@ -33,13 +34,9 @@
|
|
|
33
34
|
<auro-anchorlink fluid href="#pattern" class="level2 body-xs">Pattern</auro-anchorlink>
|
|
34
35
|
<auro-anchorlink fluid href="#readonly" class="level2 body-xs">Readonly</auro-anchorlink>
|
|
35
36
|
<auro-anchorlink fluid href="#required" class="level2 body-xs">Required</auro-anchorlink>
|
|
36
|
-
<auro-anchorlink fluid href="#setCustomValidity" class="level2 body-xs">Custom Validation Messages</auro-anchorlink>
|
|
37
37
|
<auro-anchorlink fluid href="#type" class="level2 body-xs">Type</auro-anchorlink>
|
|
38
38
|
<auro-anchorlink fluid href="#validateOnInput" class="level2 body-xs">Validate on Input</auro-anchorlink>
|
|
39
39
|
<auro-anchorlink fluid href="#value" class="level2 body-xs">Value</auro-anchorlink>
|
|
40
|
-
<auro-anchorlink fluid href="#auroInputUtil">AuroInputUtil</auro-anchorlink>
|
|
41
|
-
<auro-anchorlink fluid href="#auroInputUtilFormatIso" class="level2 body-xs">Format ISO value</auro-anchorlink>
|
|
42
|
-
<auro-anchorlink fluid href="#auroInputUtilToIso" class="level2 body-xs">Date to ISO</auro-anchorlink>
|
|
43
40
|
</auro-nav>
|
|
44
41
|
</nav>
|
|
45
42
|
<div class="mainContent">
|
|
@@ -67,6 +64,78 @@
|
|
|
67
64
|
</auro-input></code></pre>
|
|
68
65
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
69
66
|
</auro-accordion>
|
|
67
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customize/css-parts.md) -->
|
|
68
|
+
<!-- The below content is automatically added from ./../docs/partials/customize/css-parts.md -->
|
|
69
|
+
<auro-header level="3" id="cssParts">CSS Shadow Parts</auro-header>
|
|
70
|
+
<p>CSS Shadow Parts allow you to style elements inside a web component's shadow DOM using the <code>::part()</code> pseudo-element. The following parts are exposed by <code><auro-input></code>.</p>
|
|
71
|
+
<table class="auro_table">
|
|
72
|
+
<thead>
|
|
73
|
+
<tr>
|
|
74
|
+
<th>Part</th>
|
|
75
|
+
<th>Description</th>
|
|
76
|
+
</tr>
|
|
77
|
+
</thead>
|
|
78
|
+
<tbody>
|
|
79
|
+
<tr><td><code>wrapper</code></td><td>The root wrapper element of the input.</td></tr>
|
|
80
|
+
<tr><td><code>label</code></td><td>The label element.</td></tr>
|
|
81
|
+
<tr><td><code>helpText</code></td><td>The help text element.</td></tr>
|
|
82
|
+
<tr><td><code>input</code></td><td>The native input element.</td></tr>
|
|
83
|
+
<tr><td><code>accentIcon</code></td><td>The accent icon element (e.g. credit card icon, calendar icon).</td></tr>
|
|
84
|
+
<tr><td><code>iconContainer</code></td><td>The icon container (e.g. X icon for clearing input value).</td></tr>
|
|
85
|
+
<tr><td><code>accent-left</code></td><td>The left accent element.</td></tr>
|
|
86
|
+
<tr><td><code>accent-right</code></td><td>The right accent element.</td></tr>
|
|
87
|
+
<tr><td><code>displayValue</code></td><td>The display value element.</td></tr>
|
|
88
|
+
<tr><td><code>inputHelpText</code></td><td>The input help text wrapper.</td></tr>
|
|
89
|
+
</tbody>
|
|
90
|
+
</table>
|
|
91
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
92
|
+
<div class="exampleWrapper">
|
|
93
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/css-parts.html) -->
|
|
94
|
+
<!-- The below content is automatically added from ../apiExamples/css-parts.html -->
|
|
95
|
+
<style>
|
|
96
|
+
auro-input.css-parts-demo::part(wrapper) {
|
|
97
|
+
border-color: orange;
|
|
98
|
+
}
|
|
99
|
+
auro-input.css-parts-demo::part(label) {
|
|
100
|
+
color: purple;
|
|
101
|
+
}
|
|
102
|
+
auro-input.css-parts-demo::part(helpText) {
|
|
103
|
+
color: green;
|
|
104
|
+
}
|
|
105
|
+
auro-input.css-parts-demo::part(input) {
|
|
106
|
+
font-style: italic;
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
109
|
+
<auro-input class="css-parts-demo" required>
|
|
110
|
+
<span slot="label">CSS Parts Example</span>
|
|
111
|
+
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
112
|
+
</auro-input>
|
|
113
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
114
|
+
</div>
|
|
115
|
+
<auro-accordion alignRight>
|
|
116
|
+
<span slot="trigger">See code</span>
|
|
117
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/css-parts.html) -->
|
|
118
|
+
<!-- The below code snippet is automatically added from ../apiExamples/css-parts.html -->
|
|
119
|
+
<pre class="language-html"><code class="language-html"><style>
|
|
120
|
+
auro-input.css-parts-demo::part(wrapper) {
|
|
121
|
+
border-color: orange;
|
|
122
|
+
}
|
|
123
|
+
auro-input.css-parts-demo::part(label) {
|
|
124
|
+
color: purple;
|
|
125
|
+
}
|
|
126
|
+
auro-input.css-parts-demo::part(helpText) {
|
|
127
|
+
color: green;
|
|
128
|
+
}
|
|
129
|
+
auro-input.css-parts-demo::part(input) {
|
|
130
|
+
font-style: italic;
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
133
|
+
<auro-input class="css-parts-demo" required>
|
|
134
|
+
<span slot="label">CSS Parts Example</span>
|
|
135
|
+
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
136
|
+
</auro-input></code></pre>
|
|
137
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
138
|
+
</auro-accordion>
|
|
70
139
|
<auro-header level="3" id="dvInputOnly">Display Value Input Only</auro-header>
|
|
71
140
|
<p>Use the <code>dvInputOnly</code> attribute so that the <code>displayValue</code> slot content only masks the HTML5 input element. The input's label will not be masked. Without this attribute, the display value slot content covers both the label and the input.</p>
|
|
72
141
|
<div class="exampleWrapper">
|
|
@@ -160,24 +229,175 @@
|
|
|
160
229
|
</auro-input></code></pre>
|
|
161
230
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
162
231
|
</auro-accordion>
|
|
163
|
-
<auro-header level="3" id="
|
|
164
|
-
|
|
232
|
+
<auro-header level="3" id="localization">Localization</auro-header>
|
|
233
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customize/localization.md) -->
|
|
234
|
+
<!-- The below content is automatically added from ./../docs/partials/customize/localization.md -->
|
|
235
|
+
<p>The component supports complete localization, including visible strings, screen reader announcements and locale based date formatting.</p>
|
|
236
|
+
<auro-header level="4" id="localizationVisibleStrings">Visible strings</auro-header>
|
|
237
|
+
<p>The visible strings rendered in the input are not derived from <code>locale</code> — they are projected through named slots so each language can supply its own translation. Pass a <code><span></code> with the matching <code>slot</code> attribute for every string you need to localize.</p>
|
|
238
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-visible-strings.html) -->
|
|
239
|
+
<!-- The below content is automatically added from ./../apiExamples/localization-visible-strings.html -->
|
|
240
|
+
<auro-input locale="ja-JP">
|
|
241
|
+
<span slot="label">出発日</span>
|
|
242
|
+
<span slot="helpText">日付を選択してください</span>
|
|
243
|
+
<span slot="optionalLabel">(任意)</span>
|
|
244
|
+
<span slot="ariaLabel.clear">入力をクリア</span>
|
|
245
|
+
<span slot="ariaLabel.password.show">パスワードを表示</span>
|
|
246
|
+
<span slot="ariaLabel.password.hide">パスワードを非表示</span>
|
|
247
|
+
</auro-input>
|
|
248
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
249
|
+
<auro-header level="4" id="localizationA11yStrings">Screen reader strings</auro-header>
|
|
250
|
+
<p>Assistive-technology announcements that are not visible in the UI are also exposed as named slots so they can be translated independently. These strings are not derived from <code>locale</code>; supply translated values for every language you support.</p>
|
|
251
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-screenreader-strings.html) -->
|
|
252
|
+
<!-- The below content is automatically added from ./../apiExamples/localization-screenreader-strings.html -->
|
|
253
|
+
|
|
254
|
+
<pre class="language-diff"><code class="language-diff"> <auro-input locale="de-DE" type="password" value="geheim">
|
|
255
|
+
<span slot="label">Passwort</span>
|
|
256
|
+
<span slot="helpText">Geben Sie Ihr Passwort ein</span>
|
|
257
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
258
|
+
+ <span slot="ariaLabel.clear">Eingabe löschen</span>
|
|
259
|
+
+ <span slot="ariaLabel.password.show">Passwort anzeigen</span>
|
|
260
|
+
+ <span slot="ariaLabel.password.hide">Passwort verbergen</span>
|
|
261
|
+
</auro-input></code></pre>
|
|
262
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
263
|
+
<p class="note"><strong>Note:</strong> Custom validation messages set via <code>setCustomValidity*</code> attributes are also not localized — supply translated strings yourself when using those properties.</p>
|
|
264
|
+
<auro-header level="4" id="localizationDateFormatting">Date formatting</auro-header>
|
|
265
|
+
<p>When <code>type="date"</code> is set, the <code>locale</code> attribute drives the date format used by the input mask. Setting <code>locale</code> automatically selects the regional format (for example <code>en-US</code> → <code>mm/dd/yyyy</code>, <code>de-DE</code> → <code>dd.mm.yyyy</code>, <code>ja-JP</code> → <code>yyyy/mm/dd</code>), derived from the browser's <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank">Intl</auro-hyperlink> API, so <code>format</code> does not need to be set manually.</p>
|
|
266
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-locale.html) -->
|
|
267
|
+
<!-- The below content is automatically added from ./../apiExamples/localization-locale.html -->
|
|
268
|
+
|
|
269
|
+
<pre class="language-diff"><code class="language-diff">- <auro-input>
|
|
270
|
+
+ <auro-input locale="de-DE">
|
|
271
|
+
<span slot="label">Abreisedatum</span>
|
|
272
|
+
<span slot="helpText">Wählen Sie ein Datum</span>
|
|
273
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
274
|
+
</auro-input></code></pre>
|
|
275
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
276
|
+
<p>If no <code>locale</code> attribute is present, the component walks up the DOM looking for the nearest ancestor with a <code>data-locale</code> attribute; if none is found, it defaults to <code>en-US</code>.</p>
|
|
277
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-locale-inherited.html) -->
|
|
278
|
+
<!-- The below content is automatically added from ./../apiExamples/localization-locale-inherited.html -->
|
|
279
|
+
|
|
280
|
+
<pre class="language-diff"><code class="language-diff">+ <div data-locale="de-DE">
|
|
281
|
+
<div>
|
|
282
|
+
<auro-input>
|
|
283
|
+
<span slot="label">Abreisedatum</span>
|
|
284
|
+
<span slot="helpText">Wählen Sie ein Datum</span>
|
|
285
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
286
|
+
</auro-input>
|
|
287
|
+
</div>
|
|
288
|
+
</div></code></pre>
|
|
289
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
290
|
+
<p>If <code>format</code> is set alongside <code>locale</code>, <code>format</code> always wins.</p>
|
|
291
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization-locale-formatted.html) -->
|
|
292
|
+
<!-- The below content is automatically added from ./../apiExamples/localization-locale-formatted.html -->
|
|
293
|
+
|
|
294
|
+
<pre class="language-diff"><code class="language-diff">- <auro-input locale="de-DE">
|
|
295
|
+
+ <auro-input locale="de-DE" format="MM/DD/YYYY">
|
|
296
|
+
<span slot="label">Abreisedatum</span>
|
|
297
|
+
<span slot="helpText">Wählen Sie ein Datum</span>
|
|
298
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
299
|
+
</auro-input></code></pre>
|
|
300
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
165
301
|
<div class="exampleWrapper">
|
|
166
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src
|
|
167
|
-
<!-- The below content is automatically added from
|
|
168
|
-
<
|
|
169
|
-
<
|
|
170
|
-
<
|
|
302
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/locale.html) -->
|
|
303
|
+
<!-- The below content is automatically added from ./../apiExamples/locale.html -->
|
|
304
|
+
<div data-locale="de-DE">
|
|
305
|
+
<auro-header level="4">en-GB Example</auro-header>
|
|
306
|
+
<auro-input type="date" locale="en-GB">
|
|
307
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
308
|
+
<span slot="label">en-GB Date</span>
|
|
309
|
+
<span slot="helpText">Help Text</span>
|
|
310
|
+
</auro-input>
|
|
311
|
+
<auro-header level="4">en-US Example</auro-header>
|
|
312
|
+
<auro-input type="date" locale="en-US">
|
|
313
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
314
|
+
<span slot="label">en-US Date</span>
|
|
315
|
+
<span slot="helpText">Help Text</span>
|
|
316
|
+
</auro-input>
|
|
317
|
+
<auro-header level="4">zh-CN Example</auro-header>
|
|
318
|
+
<auro-input type="date" locale="zh-CN">
|
|
319
|
+
<span slot="ariaLabel.clear">全部清除</span>
|
|
320
|
+
<span slot="label">中文日期</span>
|
|
321
|
+
<span slot="helpText">帮助文本</span>
|
|
322
|
+
<span slot="optionalLabel">(可选)</span>
|
|
323
|
+
</auro-input>
|
|
324
|
+
<auro-header level="4">Inherited de-DE date-locale Example</auro-header>
|
|
325
|
+
<auro-input type="date">
|
|
326
|
+
<span slot="ariaLabel.clear">Alles löschen</span>
|
|
327
|
+
<span slot="label">Nächstes `data-locale`-Attributformat (`de-DE` in diesem Fall)</span>
|
|
328
|
+
<span slot="helpText">Hilfetext</span>
|
|
329
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
330
|
+
</auro-input>
|
|
331
|
+
<auro-header level="4">en-US with `yyyy.mm.dd` format Example</auro-header>
|
|
332
|
+
<auro-input type="date" locale="en-US" format="yyyy.mm.dd">
|
|
333
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
334
|
+
<span slot="label">en-US with yyyy.mm.dd format</span>
|
|
335
|
+
<span slot="helpText">Help Text</span>
|
|
336
|
+
</div>
|
|
337
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
338
|
+
</div>
|
|
339
|
+
<auro-accordion alignRight>
|
|
340
|
+
<span slot="trigger">See code</span>
|
|
341
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/locale.html) -->
|
|
342
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/locale.html -->
|
|
343
|
+
<pre class="language-html"><code class="language-html"><div data-locale="de-DE">
|
|
344
|
+
<auro-header level="4">en-GB Example</auro-header>
|
|
345
|
+
<auro-input type="date" locale="en-GB">
|
|
346
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
347
|
+
<span slot="label">en-GB Date</span>
|
|
348
|
+
<span slot="helpText">Help Text</span>
|
|
349
|
+
</auro-input>
|
|
350
|
+
|
|
351
|
+
<auro-header level="4">en-US Example</auro-header>
|
|
352
|
+
<auro-input type="date" locale="en-US">
|
|
353
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
354
|
+
<span slot="label">en-US Date</span>
|
|
355
|
+
<span slot="helpText">Help Text</span>
|
|
356
|
+
</auro-input>
|
|
357
|
+
|
|
358
|
+
<auro-header level="4">zh-CN Example</auro-header>
|
|
359
|
+
<auro-input type="date" locale="zh-CN">
|
|
360
|
+
<span slot="ariaLabel.clear">全部清除</span>
|
|
361
|
+
<span slot="label">中文日期</span>
|
|
362
|
+
<span slot="helpText">帮助文本</span>
|
|
363
|
+
<span slot="optionalLabel">(可选)</span>
|
|
364
|
+
</auro-input>
|
|
365
|
+
|
|
366
|
+
<auro-header level="4">Inherited de-DE date-locale Example</auro-header>
|
|
367
|
+
<auro-input type="date">
|
|
368
|
+
<span slot="ariaLabel.clear">Alles löschen</span>
|
|
369
|
+
<span slot="label">Nächstes `data-locale`-Attributformat (`de-DE` in diesem Fall)</span>
|
|
370
|
+
<span slot="helpText">Hilfetext</span>
|
|
371
|
+
<span slot="optionalLabel">(freiwillig)</span>
|
|
372
|
+
</auro-input>
|
|
373
|
+
|
|
374
|
+
<auro-header level="4">en-US with `yyyy.mm.dd` format Example</auro-header>
|
|
375
|
+
<auro-input type="date" locale="en-US" format="yyyy.mm.dd">
|
|
376
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
377
|
+
<span slot="label">en-US with yyyy.mm.dd format</span>
|
|
378
|
+
<span slot="helpText">Help Text</span>
|
|
379
|
+
</div></code></pre>
|
|
380
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
381
|
+
</auro-accordion>
|
|
382
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
383
|
+
<auro-header level="3" id="nested">Nested</auro-header>
|
|
384
|
+
<p>Use the <code>nested</code> attribute to render the input without borders, help text, error text, or accents. This is intended for use when the input is embedded inside the trigger of an auro-droopdown.</p>
|
|
385
|
+
<div class="exampleWrapper">
|
|
386
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested.html) -->
|
|
387
|
+
<!-- The below content is automatically added from ./../apiExamples/nested.html -->
|
|
388
|
+
<auro-input nested>
|
|
389
|
+
<span slot="label">Nested Input</span>
|
|
390
|
+
<span slot="helpText">Help Text</span>
|
|
171
391
|
</auro-input>
|
|
172
392
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
173
393
|
</div>
|
|
174
394
|
<auro-accordion alignRight>
|
|
175
395
|
<span slot="trigger">See code</span>
|
|
176
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src
|
|
177
|
-
<!-- The below code snippet is automatically added from
|
|
178
|
-
<pre class="language-html"><code class="language-html"><auro-input
|
|
179
|
-
<span slot="label">
|
|
180
|
-
<span slot="helpText">
|
|
396
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested.html) -->
|
|
397
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/nested.html -->
|
|
398
|
+
<pre class="language-html"><code class="language-html"><auro-input nested>
|
|
399
|
+
<span slot="label">Nested Input</span>
|
|
400
|
+
<span slot="helpText">Help Text</span>
|
|
181
401
|
</auro-input></code></pre>
|
|
182
402
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
183
403
|
</auro-accordion>
|
|
@@ -205,6 +425,27 @@
|
|
|
205
425
|
</auro-input></code></pre>
|
|
206
426
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
207
427
|
</auro-accordion>
|
|
428
|
+
<auro-header level="3" id="placeholder">Placeholder</auro-header>
|
|
429
|
+
<p>Use the <code>placeholder</code> attribute to add a custom placeholder message within the element.</p>
|
|
430
|
+
<div class="exampleWrapper">
|
|
431
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/placeholder.html) -->
|
|
432
|
+
<!-- The below content is automatically added from ../apiExamples/placeholder.html -->
|
|
433
|
+
<auro-input placeholder="John Doe" required>
|
|
434
|
+
<span slot="label">Full name</span>
|
|
435
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
436
|
+
</auro-input>
|
|
437
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
438
|
+
</div>
|
|
439
|
+
<auro-accordion alignRight>
|
|
440
|
+
<span slot="trigger">See code</span>
|
|
441
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/placeholder.html) -->
|
|
442
|
+
<!-- The below code snippet is automatically added from ../apiExamples/placeholder.html -->
|
|
443
|
+
<pre class="language-html"><code class="language-html"><auro-input placeholder="John Doe" required>
|
|
444
|
+
<span slot="label">Full name</span>
|
|
445
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
446
|
+
</auro-input></code></pre>
|
|
447
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
448
|
+
</auro-accordion>
|
|
208
449
|
<auro-header level="3" id="simple">Simple</auro-header>
|
|
209
450
|
<p>Use the <code>simple</code> attribute to render the input without a border. This is intended for use when the input is embedded inside the trigger of an auro-droopdown.</p>
|
|
210
451
|
<div class="exampleWrapper">
|
|
@@ -226,29 +467,6 @@
|
|
|
226
467
|
</auro-input></code></pre>
|
|
227
468
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
228
469
|
</auro-accordion>
|
|
229
|
-
<auro-header level="3" id="nested">Nested</auro-header>
|
|
230
|
-
<p>Use the <code>nested</code> attribute to render the input without borders, help text, error text, or accents. This is intended for use when the input is embedded inside the trigger of an auro-droopdown.</p>
|
|
231
|
-
<div class="exampleWrapper">
|
|
232
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested.html) -->
|
|
233
|
-
<!-- The below content is automatically added from ./../apiExamples/nested.html -->
|
|
234
|
-
<auro-input nested>
|
|
235
|
-
<span slot="label">Nested Input</span>
|
|
236
|
-
<span slot="helpText">Help Text</span>
|
|
237
|
-
</auro-input>
|
|
238
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
239
|
-
</div>
|
|
240
|
-
<auro-accordion alignRight>
|
|
241
|
-
<span slot="trigger">See code</span>
|
|
242
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested.html) -->
|
|
243
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/nested.html -->
|
|
244
|
-
<pre class="language-html"><code class="language-html"><auro-input nested>
|
|
245
|
-
<span slot="label">Nested Input</span>
|
|
246
|
-
<span slot="helpText">Help Text</span>
|
|
247
|
-
</auro-input></code></pre>
|
|
248
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
249
|
-
</auro-accordion>
|
|
250
|
-
</section>
|
|
251
|
-
<section>
|
|
252
470
|
<auro-header level="3" id="cssTokens">Tokens</auro-header>
|
|
253
471
|
<p>The component may be restyled by changing the values of the following token(s).</p>
|
|
254
472
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
@@ -285,89 +503,15 @@
|
|
|
285
503
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
286
504
|
</section>
|
|
287
505
|
<section>
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
<
|
|
291
|
-
<p>CSS Shadow Parts allow you to style elements inside a web component's shadow DOM using the <code>::part()</code> pseudo-element. The following parts are exposed by <code><auro-input></code>.</p>
|
|
292
|
-
<table class="auro_table">
|
|
293
|
-
<thead>
|
|
294
|
-
<tr>
|
|
295
|
-
<th>Part</th>
|
|
296
|
-
<th>Description</th>
|
|
297
|
-
</tr>
|
|
298
|
-
</thead>
|
|
299
|
-
<tbody>
|
|
300
|
-
<tr><td><code>wrapper</code></td><td>The root wrapper element of the input.</td></tr>
|
|
301
|
-
<tr><td><code>label</code></td><td>The label element.</td></tr>
|
|
302
|
-
<tr><td><code>helpText</code></td><td>The help text element.</td></tr>
|
|
303
|
-
<tr><td><code>input</code></td><td>The native input element.</td></tr>
|
|
304
|
-
<tr><td><code>accentIcon</code></td><td>The accent icon element (e.g. credit card icon, calendar icon).</td></tr>
|
|
305
|
-
<tr><td><code>iconContainer</code></td><td>The icon container (e.g. X icon for clearing input value).</td></tr>
|
|
306
|
-
<tr><td><code>accent-left</code></td><td>The left accent element.</td></tr>
|
|
307
|
-
<tr><td><code>accent-right</code></td><td>The right accent element.</td></tr>
|
|
308
|
-
<tr><td><code>displayValue</code></td><td>The display value element.</td></tr>
|
|
309
|
-
<tr><td><code>inputHelpText</code></td><td>The input help text wrapper.</td></tr>
|
|
310
|
-
</tbody>
|
|
311
|
-
</table>
|
|
312
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
506
|
+
<auro-header level="2" id="behavior">Behavior</auro-header>
|
|
507
|
+
<auro-header level="3" id="autocapitalize">Autocapitalize</auro-header>
|
|
508
|
+
<p>Use the <code>autocapitalize</code> attribute to control whether and how text input is automatically capitalized as it is entered by the user. Supported values: <code>off</code>/<code>none</code>, <code>on</code>/<code>sentences</code>, <code>words</code>, <code>characters</code>.</p>
|
|
313
509
|
<div class="exampleWrapper">
|
|
314
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/
|
|
315
|
-
<!-- The below content is automatically added from ../apiExamples/
|
|
316
|
-
<
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
auro-input.css-parts-demo::part(label) {
|
|
321
|
-
color: purple;
|
|
322
|
-
}
|
|
323
|
-
auro-input.css-parts-demo::part(helpText) {
|
|
324
|
-
color: green;
|
|
325
|
-
}
|
|
326
|
-
auro-input.css-parts-demo::part(input) {
|
|
327
|
-
font-style: italic;
|
|
328
|
-
}
|
|
329
|
-
</style>
|
|
330
|
-
<auro-input class="css-parts-demo" required>
|
|
331
|
-
<span slot="label">CSS Parts Example</span>
|
|
332
|
-
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
333
|
-
</auro-input>
|
|
334
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
335
|
-
</div>
|
|
336
|
-
<auro-accordion alignRight>
|
|
337
|
-
<span slot="trigger">See code</span>
|
|
338
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/css-parts.html) -->
|
|
339
|
-
<!-- The below code snippet is automatically added from ../apiExamples/css-parts.html -->
|
|
340
|
-
<pre class="language-html"><code class="language-html"><style>
|
|
341
|
-
auro-input.css-parts-demo::part(wrapper) {
|
|
342
|
-
border-color: orange;
|
|
343
|
-
}
|
|
344
|
-
auro-input.css-parts-demo::part(label) {
|
|
345
|
-
color: purple;
|
|
346
|
-
}
|
|
347
|
-
auro-input.css-parts-demo::part(helpText) {
|
|
348
|
-
color: green;
|
|
349
|
-
}
|
|
350
|
-
auro-input.css-parts-demo::part(input) {
|
|
351
|
-
font-style: italic;
|
|
352
|
-
}
|
|
353
|
-
</style>
|
|
354
|
-
<auro-input class="css-parts-demo" required>
|
|
355
|
-
<span slot="label">CSS Parts Example</span>
|
|
356
|
-
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
357
|
-
</auro-input></code></pre>
|
|
358
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
359
|
-
</auro-accordion>
|
|
360
|
-
</section>
|
|
361
|
-
<section>
|
|
362
|
-
<auro-header level="2" id="behavior">Behavior</auro-header>
|
|
363
|
-
<auro-header level="3" id="autocapitalize">Autocapitalize</auro-header>
|
|
364
|
-
<p>Use the <code>autocapitalize</code> attribute to control whether and how text input is automatically capitalized as it is entered by the user. Supported values: <code>off</code>/<code>none</code>, <code>on</code>/<code>sentences</code>, <code>words</code>, <code>characters</code>.</p>
|
|
365
|
-
<div class="exampleWrapper">
|
|
366
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/autocapitalize.html) -->
|
|
367
|
-
<!-- The below content is automatically added from ../apiExamples/autocapitalize.html -->
|
|
368
|
-
<auro-input autocapitalize="none">
|
|
369
|
-
<span slot="label">No capitalization</span>
|
|
370
|
-
<span slot="helpText">Autocapitalize is set to none.</span>
|
|
510
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/autocapitalize.html) -->
|
|
511
|
+
<!-- The below content is automatically added from ../apiExamples/autocapitalize.html -->
|
|
512
|
+
<auro-input autocapitalize="none">
|
|
513
|
+
<span slot="label">No capitalization</span>
|
|
514
|
+
<span slot="helpText">Autocapitalize is set to none.</span>
|
|
371
515
|
</auro-input>
|
|
372
516
|
<auro-input autocapitalize="words">
|
|
373
517
|
<span slot="label">Capitalize words</span>
|
|
@@ -439,6 +583,189 @@
|
|
|
439
583
|
</auro-input></code></pre>
|
|
440
584
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
441
585
|
</auro-accordion>
|
|
586
|
+
<auro-header level="3" id="setCustomValidity">Custom Validation Messages</auro-header>
|
|
587
|
+
<p>The input provides several properties to customize the error messages displayed for different validation states. When a validation error occurs, the component checks for a state-specific message first, then falls back to the general <code>setCustomValidity</code> message.</p>
|
|
588
|
+
<ul>
|
|
589
|
+
<li><strong><code>setCustomValidity</code></strong> — Sets a fallback error message displayed for any validation error. This message is used when no state-specific message is defined.</li>
|
|
590
|
+
<li><strong><code>setCustomValidityValueMissing</code></strong> — Displayed when the component is <code>required</code> and the user leaves it empty.</li>
|
|
591
|
+
<li><strong><code>setCustomValidityForType</code></strong> — Displayed when the value does not match the expected format for the declared <code>type</code> (e.g. invalid email, phone number).</li>
|
|
592
|
+
<li><strong><code>setCustomValidityBadInput</code></strong> — Displayed when the browser considers the input value to be malformed (e.g. non-numeric characters in a <code>number</code> field).</li>
|
|
593
|
+
<li><strong><code>setCustomValidityRangeOverflow</code></strong> — Displayed when the value exceeds the <code>max</code> constraint.</li>
|
|
594
|
+
<li><strong><code>setCustomValidityRangeUnderflow</code></strong> — Displayed when the value is below the <code>min</code> constraint.</li>
|
|
595
|
+
<li><strong><code>setCustomValidityTooLong</code></strong> — Displayed when the value exceeds the <code>maxlength</code> constraint.</li>
|
|
596
|
+
<li><strong><code>setCustomValidityTooShort</code></strong> — Displayed when the value is shorter than the <code>minlength</code> constraint.</li>
|
|
597
|
+
<li><strong><code>setCustomValidityPatternMismatch</code></strong> — Displayed when the value does not match the declared <code>pattern</code>, or when <code>type="date"</code> and the entered date is not a valid calendar date (e.g. month/day values out of range). Falls back to <code>"Invalid Date Format Entered"</code> if not set.</li>
|
|
598
|
+
</ul>
|
|
599
|
+
<p>The priority order for error messages is: state-specific property > <code>setCustomValidity</code> > default browser message.</p>
|
|
600
|
+
<p class="note"><strong>Note:</strong> Custom strings are NOT localized. It is the responsibility of the element consumer to provide localized strings when using these properties.</p>
|
|
601
|
+
<auro-header level="4">Bad Input</auro-header>
|
|
602
|
+
<p>Use <code>setCustomValidityBadInput</code> to customize the message when the browser considers the input malformed.</p>
|
|
603
|
+
<div class="exampleWrapper">
|
|
604
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
605
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
606
|
+
<auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
607
|
+
<span slot="label">Quantity</span>
|
|
608
|
+
<span slot="helpText">Enter the number of items.</span>
|
|
609
|
+
</auro-input>
|
|
610
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
611
|
+
</div>
|
|
612
|
+
<auro-accordion alignRight>
|
|
613
|
+
<span slot="trigger">See code</span>
|
|
614
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
615
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
616
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
617
|
+
<span slot="label">Quantity</span>
|
|
618
|
+
<span slot="helpText">Enter the number of items.</span>
|
|
619
|
+
</auro-input></code></pre>
|
|
620
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
621
|
+
</auro-accordion>
|
|
622
|
+
<auro-header level="4">Fallback Message</auro-header>
|
|
623
|
+
<p>Use <code>setCustomValidity</code> to set a single message for all validation states.</p>
|
|
624
|
+
<div class="exampleWrapper">
|
|
625
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity.html) -->
|
|
626
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
627
|
+
<auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
628
|
+
<span slot="label">Full Name</span>
|
|
629
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
630
|
+
</auro-input>
|
|
631
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
632
|
+
</div>
|
|
633
|
+
<auro-accordion alignRight>
|
|
634
|
+
<span slot="trigger">See code</span>
|
|
635
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity.html) -->
|
|
636
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
637
|
+
<pre class="language-html"><code class="language-html"><auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
638
|
+
<span slot="label">Full Name</span>
|
|
639
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
640
|
+
</auro-input></code></pre>
|
|
641
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
642
|
+
</auro-accordion>
|
|
643
|
+
<auro-header level="4">Range Overflow</auro-header>
|
|
644
|
+
<p>Use <code>setCustomValidityRangeOverflow</code> to customize the message when the value exceeds the <code>max</code> constraint.</p>
|
|
645
|
+
<div class="exampleWrapper">
|
|
646
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
647
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
648
|
+
<auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
|
|
649
|
+
<span slot="label">Event Date</span>
|
|
650
|
+
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
651
|
+
</auro-input>
|
|
652
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
653
|
+
</div>
|
|
654
|
+
<auro-accordion alignRight>
|
|
655
|
+
<span slot="trigger">See code</span>
|
|
656
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
657
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
658
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
|
|
659
|
+
<span slot="label">Event Date</span>
|
|
660
|
+
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
661
|
+
</auro-input></code></pre>
|
|
662
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
663
|
+
</auro-accordion>
|
|
664
|
+
<auro-header level="4">Range Underflow</auro-header>
|
|
665
|
+
<p>Use <code>setCustomValidityRangeUnderflow</code> to customize the message when the value is below the <code>min</code> constraint.</p>
|
|
666
|
+
<div class="exampleWrapper">
|
|
667
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
668
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
669
|
+
<auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
|
|
670
|
+
<span slot="label">Start Date</span>
|
|
671
|
+
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
672
|
+
</auro-input>
|
|
673
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
674
|
+
</div>
|
|
675
|
+
<auro-accordion alignRight>
|
|
676
|
+
<span slot="trigger">See code</span>
|
|
677
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
678
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
679
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
|
|
680
|
+
<span slot="label">Start Date</span>
|
|
681
|
+
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
682
|
+
</auro-input></code></pre>
|
|
683
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
684
|
+
</auro-accordion>
|
|
685
|
+
<auro-header level="4">Too Long</auro-header>
|
|
686
|
+
<p>Use <code>setCustomValidityTooLong</code> to customize the message when the value exceeds the <code>maxlength</code> constraint.</p>
|
|
687
|
+
<div class="exampleWrapper">
|
|
688
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
689
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
690
|
+
<auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
691
|
+
<span slot="label">Username</span>
|
|
692
|
+
<span slot="helpText">Maximum 10 characters.</span>
|
|
693
|
+
</auro-input>
|
|
694
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
695
|
+
</div>
|
|
696
|
+
<auro-accordion alignRight>
|
|
697
|
+
<span slot="trigger">See code</span>
|
|
698
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
699
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
700
|
+
<pre class="language-html"><code class="language-html"><auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
701
|
+
<span slot="label">Username</span>
|
|
702
|
+
<span slot="helpText">Maximum 10 characters.</span>
|
|
703
|
+
</auro-input></code></pre>
|
|
704
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
705
|
+
</auro-accordion>
|
|
706
|
+
<auro-header level="4">Too Short</auro-header>
|
|
707
|
+
<p>Use <code>setCustomValidityTooShort</code> to customize the message when the value is shorter than the <code>minlength</code> constraint.</p>
|
|
708
|
+
<div class="exampleWrapper">
|
|
709
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
710
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
711
|
+
<auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
712
|
+
<span slot="label">Nickname</span>
|
|
713
|
+
<span slot="helpText">Minimum 3 characters.</span>
|
|
714
|
+
</auro-input>
|
|
715
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
716
|
+
</div>
|
|
717
|
+
<auro-accordion alignRight>
|
|
718
|
+
<span slot="trigger">See code</span>
|
|
719
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
720
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
721
|
+
<pre class="language-html"><code class="language-html"><auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
722
|
+
<span slot="label">Nickname</span>
|
|
723
|
+
<span slot="helpText">Minimum 3 characters.</span>
|
|
724
|
+
</auro-input></code></pre>
|
|
725
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
726
|
+
</auro-accordion>
|
|
727
|
+
<auro-header level="4">Type Validation</auro-header>
|
|
728
|
+
<p>Use <code>setCustomValidityForType</code> to customize the message when the value doesn't match the declared <code>type</code> format.</p>
|
|
729
|
+
<div class="exampleWrapper">
|
|
730
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
731
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
732
|
+
<auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
733
|
+
<span slot="label">Email Address</span>
|
|
734
|
+
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
735
|
+
</auro-input>
|
|
736
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
737
|
+
</div>
|
|
738
|
+
<auro-accordion alignRight>
|
|
739
|
+
<span slot="trigger">See code</span>
|
|
740
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
741
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
742
|
+
<pre class="language-html"><code class="language-html"><auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
743
|
+
<span slot="label">Email Address</span>
|
|
744
|
+
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
745
|
+
</auro-input></code></pre>
|
|
746
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
747
|
+
</auro-accordion>
|
|
748
|
+
<auro-header level="4">Value Missing</auro-header>
|
|
749
|
+
<p>Use <code>setCustomValidityValueMissing</code> to customize the message when a <code>required</code> field is left empty.</p>
|
|
750
|
+
<div class="exampleWrapper">
|
|
751
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
752
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
753
|
+
<auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
754
|
+
<span slot="label">Full Name</span>
|
|
755
|
+
<span slot="helpText">Enter your legal first and last name.</span>
|
|
756
|
+
</auro-input>
|
|
757
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
758
|
+
</div>
|
|
759
|
+
<auro-accordion alignRight>
|
|
760
|
+
<span slot="trigger">See code</span>
|
|
761
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
762
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
763
|
+
<pre class="language-html"><code class="language-html"><auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
764
|
+
<span slot="label">Full Name</span>
|
|
765
|
+
<span slot="helpText">Enter your legal first and last name.</span>
|
|
766
|
+
</auro-input></code></pre>
|
|
767
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
768
|
+
</auro-accordion>
|
|
442
769
|
<auro-header level="3" id="disabled">Disabled</auro-header>
|
|
443
770
|
<p>Use the <code>disable</code> attribute to prevent the user from interacting with the input.</p>
|
|
444
771
|
<div class="exampleWrapper">
|
|
@@ -511,7 +838,7 @@
|
|
|
511
838
|
<li>a : letter</li>
|
|
512
839
|
<li>* : any character</li>
|
|
513
840
|
</ul>
|
|
514
|
-
<p>See <
|
|
841
|
+
<p>See <auro-hyperlink href="https://imask.js.org/">IMask</auro-hyperlink> for more information on how to configure a mask.</p>
|
|
515
842
|
<div class="exampleWrapper">
|
|
516
843
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/format.html) -->
|
|
517
844
|
<!-- The below content is automatically added from ../apiExamples/format.html -->
|
|
@@ -531,82 +858,16 @@
|
|
|
531
858
|
</auro-input></code></pre>
|
|
532
859
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
533
860
|
</auro-accordion>
|
|
534
|
-
<auro-header level="3" id="
|
|
535
|
-
<p>
|
|
536
|
-
<p>If
|
|
861
|
+
<auro-header level="3" id="inputMode">Input Mode</auro-header>
|
|
862
|
+
<p>Set the <code>inputmode</code> for the input.</p>
|
|
863
|
+
<p><strong>IMPORTANT</strong>: If you are also passing a <code>type</code>, most browsers will use the <code>type</code> attribute to determine what keyboard to display on mobile devices and ignore the <code>inputmode</code> attribute.</p>
|
|
537
864
|
<div class="exampleWrapper">
|
|
538
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src
|
|
539
|
-
<!-- The below content is automatically added from
|
|
540
|
-
<
|
|
541
|
-
<
|
|
542
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
543
|
-
<span slot="label">en-GB Date</span>
|
|
544
|
-
<span slot="helpText">Help Text</span>
|
|
545
|
-
</auro-input>
|
|
546
|
-
<auro-input type="date" locale="en-US">
|
|
547
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
548
|
-
<span slot="label">en-US Date</span>
|
|
549
|
-
<span slot="helpText">Help Text</span>
|
|
550
|
-
</auro-input>
|
|
551
|
-
<auro-input type="date" locale="zh-CN">
|
|
552
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
553
|
-
<span slot="label">zh-CN Date</span>
|
|
554
|
-
<span slot="helpText">Help Text</span>
|
|
555
|
-
</auro-input>
|
|
556
|
-
<auro-input type="date">
|
|
557
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
558
|
-
<span slot="label">Nearest `data-locale` attribute format (`de-DE` in this case)</span>
|
|
559
|
-
<span slot="helpText">Help Text</span>
|
|
560
|
-
</auro-input>
|
|
561
|
-
<auro-input type="date" locale="en-US" format="yyyy.mm.dd">
|
|
562
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
563
|
-
<span slot="label">en-US with yyyy.mm.dd format</span>
|
|
865
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
866
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
867
|
+
<auro-input inputmode="tel">
|
|
868
|
+
<span slot="label">Telephone</span>
|
|
564
869
|
<span slot="helpText">Help Text</span>
|
|
565
|
-
</
|
|
566
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
567
|
-
</div>
|
|
568
|
-
<auro-accordion alignRight>
|
|
569
|
-
<span slot="trigger">See code</span>
|
|
570
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/locale.html) -->
|
|
571
|
-
<!-- The below code snippet is automatically added from ../apiExamples/locale.html -->
|
|
572
|
-
<pre class="language-html"><code class="language-html"><div data-locale="de-DE">
|
|
573
|
-
<auro-input type="date" locale="en-GB">
|
|
574
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
575
|
-
<span slot="label">en-GB Date</span>
|
|
576
|
-
<span slot="helpText">Help Text</span>
|
|
577
|
-
</auro-input>
|
|
578
|
-
<auro-input type="date" locale="en-US">
|
|
579
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
580
|
-
<span slot="label">en-US Date</span>
|
|
581
|
-
<span slot="helpText">Help Text</span>
|
|
582
|
-
</auro-input>
|
|
583
|
-
<auro-input type="date" locale="zh-CN">
|
|
584
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
585
|
-
<span slot="label">zh-CN Date</span>
|
|
586
|
-
<span slot="helpText">Help Text</span>
|
|
587
|
-
</auro-input>
|
|
588
|
-
<auro-input type="date">
|
|
589
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
590
|
-
<span slot="label">Nearest `data-locale` attribute format (`de-DE` in this case)</span>
|
|
591
|
-
<span slot="helpText">Help Text</span>
|
|
592
|
-
</auro-input>
|
|
593
|
-
<auro-input type="date" locale="en-US" format="yyyy.mm.dd">
|
|
594
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
595
|
-
<span slot="label">en-US with yyyy.mm.dd format</span>
|
|
596
|
-
<span slot="helpText">Help Text</span>
|
|
597
|
-
</div></code></pre>
|
|
598
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
599
|
-
</auro-accordion>
|
|
600
|
-
<auro-header level="3" id="inputMode">Input Mode</auro-header>
|
|
601
|
-
<p>Set the <code>inputmode</code> for the input.</p>
|
|
602
|
-
<p><strong>IMPORTANT</strong>: If you are also passing a <code>type</code>, most browsers will use the <code>type</code> attribute to determine what keyboard to display on mobile devices and ignore the <code>inputmode</code> attribute.</p>
|
|
603
|
-
<div class="exampleWrapper">
|
|
604
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
605
|
-
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
606
|
-
<auro-input inputmode="tel">
|
|
607
|
-
<span slot="label">Telephone</span>
|
|
608
|
-
<span slot="helpText">Help Text</span>
|
|
609
|
-
</auro-input>
|
|
870
|
+
</auro-input>
|
|
610
871
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
611
872
|
</div>
|
|
612
873
|
<auro-accordion alignRight>
|
|
@@ -822,328 +1083,73 @@
|
|
|
822
1083
|
<span slot="helpText">Please enter a username.</span>
|
|
823
1084
|
</auro-input></code></pre>
|
|
824
1085
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
825
|
-
</auro-accordion>
|
|
826
|
-
<auro-header level="3" id="readonly">Readonly</auro-header>
|
|
827
|
-
<p>Use the <code>readonly</code> attribute to prevent the user from editing the value of the input.</p>
|
|
828
|
-
<p>In this example, the user is able to programmatically change the value of the input by clicking the button or clear out the contents of the input.</p>
|
|
829
|
-
<div class="exampleWrapper">
|
|
830
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/readonly.html) -->
|
|
831
|
-
<!-- The below content is automatically added from ../apiExamples/readonly.html -->
|
|
832
|
-
<auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
833
|
-
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
834
|
-
<br /><br />
|
|
835
|
-
<auro-input readonly id="readonlyExample">
|
|
836
|
-
<span slot="label">Name</span>
|
|
837
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
838
|
-
</auro-input>
|
|
839
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
840
|
-
</div>
|
|
841
|
-
<auro-accordion alignRight>
|
|
842
|
-
<span slot="trigger">See code</span>
|
|
843
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.html) -->
|
|
844
|
-
<!-- The below code snippet is automatically added from ../apiExamples/readonly.html -->
|
|
845
|
-
<pre class="language-html"><code class="language-html"><auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
846
|
-
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
847
|
-
<br /><br />
|
|
848
|
-
<auro-input readonly id="readonlyExample">
|
|
849
|
-
<span slot="label">Name</span>
|
|
850
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
851
|
-
</auro-input></code></pre>
|
|
852
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
853
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.js) -->
|
|
854
|
-
<!-- The below code snippet is automatically added from ../apiExamples/readonly.js -->
|
|
855
|
-
<pre class="language-js"><code class="language-js">export function setReadonlyValue() {
|
|
856
|
-
const elem = document.querySelector('#readonlyExample');
|
|
857
|
-
|
|
858
|
-
// set value of auro-input element
|
|
859
|
-
document.querySelector('#setReadonlyValueBtn').addEventListener('click', () => {
|
|
860
|
-
elem.value = "Auro Alaska";
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
document.querySelector('#resetReadonlyValueBtn').addEventListener('click', () => {
|
|
864
|
-
elem.value = undefined;
|
|
865
|
-
});
|
|
866
|
-
}</code></pre>
|
|
867
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
868
|
-
</auro-accordion>
|
|
869
|
-
<auro-header level="3" id="required">Required</auro-header>
|
|
870
|
-
<p>When present, the <code>required</code> attribute specifies that an input field must be filled out before submitting the form.</p>
|
|
871
|
-
<p>When the validity check fails, the validityState equals <code>valueMissing</code>. The error message for the <code>valueMissing</code> validityState can be changed to a custom string using the <code>setCustomValidityValueMissing</code>.</p>
|
|
872
|
-
<div class="exampleWrapper">
|
|
873
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/required.html) -->
|
|
874
|
-
<!-- The below content is automatically added from ../apiExamples/required.html -->
|
|
875
|
-
<auro-input required placeholder="John Doe">
|
|
876
|
-
<span slot="label">Full name</span>
|
|
877
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
878
|
-
</auro-input>
|
|
879
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
880
|
-
</div>
|
|
881
|
-
<auro-accordion alignRight>
|
|
882
|
-
<span slot="trigger">See code</span>
|
|
883
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/required.html) -->
|
|
884
|
-
<!-- The below code snippet is automatically added from ../apiExamples/required.html -->
|
|
885
|
-
<pre class="language-html"><code class="language-html"><auro-input required placeholder="John Doe">
|
|
886
|
-
<span slot="label">Full name</span>
|
|
887
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
888
|
-
</auro-input></code></pre>
|
|
889
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
890
|
-
</auro-accordion>
|
|
891
|
-
<auro-header level="3" id="setCustomValidity">Custom Validation Messages</auro-header>
|
|
892
|
-
<p>The input provides several properties to customize the error messages displayed for different validation states. When a validation error occurs, the component checks for a state-specific message first, then falls back to the general <code>setCustomValidity</code> message.</p>
|
|
893
|
-
<ul>
|
|
894
|
-
<li><strong><code>setCustomValidity</code></strong> — Sets a fallback error message displayed for any validation error. This message is used when no state-specific message is defined.</li>
|
|
895
|
-
<li><strong><code>setCustomValidityValueMissing</code></strong> — Displayed when the component is <code>required</code> and the user leaves it empty.</li>
|
|
896
|
-
<li><strong><code>setCustomValidityForType</code></strong> — Displayed when the value does not match the expected format for the declared <code>type</code> (e.g. invalid email, phone number).</li>
|
|
897
|
-
<li><strong><code>setCustomValidityBadInput</code></strong> — Displayed when the browser considers the input value to be malformed (e.g. non-numeric characters in a <code>number</code> field).</li>
|
|
898
|
-
<li><strong><code>setCustomValidityRangeOverflow</code></strong> — Displayed when the value exceeds the <code>max</code> constraint.</li>
|
|
899
|
-
<li><strong><code>setCustomValidityRangeUnderflow</code></strong> — Displayed when the value is below the <code>min</code> constraint.</li>
|
|
900
|
-
<li><strong><code>setCustomValidityTooLong</code></strong> — Displayed when the value exceeds the <code>maxlength</code> constraint.</li>
|
|
901
|
-
<li><strong><code>setCustomValidityTooShort</code></strong> — Displayed when the value is shorter than the <code>minlength</code> constraint.</li>
|
|
902
|
-
</ul>
|
|
903
|
-
<p>The priority order for error messages is: state-specific property > <code>setCustomValidity</code> > default browser message.</p>
|
|
904
|
-
<p class="note"><strong>Note:</strong> Custom strings are NOT localized. It is the responsibility of the element consumer to provide localized strings when using these properties.</p>
|
|
905
|
-
<auro-header level="4">Fallback Message</auro-header>
|
|
906
|
-
<p>Use <code>setCustomValidity</code> to set a single message for all validation states.</p>
|
|
907
|
-
<div class="exampleWrapper">
|
|
908
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity.html) -->
|
|
909
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
910
|
-
<auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
911
|
-
<span slot="label">Full Name</span>
|
|
912
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
913
|
-
</auro-input>
|
|
914
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
915
|
-
</div>
|
|
916
|
-
<auro-accordion alignRight>
|
|
917
|
-
<span slot="trigger">See code</span>
|
|
918
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity.html) -->
|
|
919
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
920
|
-
<pre class="language-html"><code class="language-html"><auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
921
|
-
<span slot="label">Full Name</span>
|
|
922
|
-
<span slot="helpText">Please enter your full name.</span>
|
|
923
|
-
</auro-input></code></pre>
|
|
924
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
925
|
-
</auro-accordion>
|
|
926
|
-
<auro-header level="4">Value Missing</auro-header>
|
|
927
|
-
<p>Use <code>setCustomValidityValueMissing</code> to customize the message when a <code>required</code> field is left empty.</p>
|
|
928
|
-
<div class="exampleWrapper">
|
|
929
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
930
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
931
|
-
<auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
932
|
-
<span slot="label">Full Name</span>
|
|
933
|
-
<span slot="helpText">Enter your legal first and last name.</span>
|
|
934
|
-
</auro-input>
|
|
935
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
936
|
-
</div>
|
|
937
|
-
<auro-accordion alignRight>
|
|
938
|
-
<span slot="trigger">See code</span>
|
|
939
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
940
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
941
|
-
<pre class="language-html"><code class="language-html"><auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
942
|
-
<span slot="label">Full Name</span>
|
|
943
|
-
<span slot="helpText">Enter your legal first and last name.</span>
|
|
944
|
-
</auro-input></code></pre>
|
|
945
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
946
|
-
</auro-accordion>
|
|
947
|
-
<auro-header level="4">Type Validation</auro-header>
|
|
948
|
-
<p>Use <code>setCustomValidityForType</code> to customize the message when the value doesn't match the declared <code>type</code> format.</p>
|
|
949
|
-
<div class="exampleWrapper">
|
|
950
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
951
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
952
|
-
<auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
953
|
-
<span slot="label">Email Address</span>
|
|
954
|
-
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
955
|
-
</auro-input>
|
|
956
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
957
|
-
</div>
|
|
958
|
-
<auro-accordion alignRight>
|
|
959
|
-
<span slot="trigger">See code</span>
|
|
960
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
961
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
962
|
-
<pre class="language-html"><code class="language-html"><auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
963
|
-
<span slot="label">Email Address</span>
|
|
964
|
-
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
965
|
-
</auro-input></code></pre>
|
|
966
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
967
|
-
</auro-accordion>
|
|
968
|
-
<auro-header level="4">Bad Input</auro-header>
|
|
969
|
-
<p>Use <code>setCustomValidityBadInput</code> to customize the message when the browser considers the input malformed.</p>
|
|
970
|
-
<div class="exampleWrapper">
|
|
971
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
972
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
973
|
-
<auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
974
|
-
<span slot="label">Quantity</span>
|
|
975
|
-
<span slot="helpText">Enter the number of items.</span>
|
|
976
|
-
</auro-input>
|
|
977
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
978
|
-
</div>
|
|
979
|
-
<auro-accordion alignRight>
|
|
980
|
-
<span slot="trigger">See code</span>
|
|
981
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
982
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
983
|
-
<pre class="language-html"><code class="language-html"><auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
984
|
-
<span slot="label">Quantity</span>
|
|
985
|
-
<span slot="helpText">Enter the number of items.</span>
|
|
986
|
-
</auro-input></code></pre>
|
|
987
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
988
|
-
</auro-accordion>
|
|
989
|
-
<auro-header level="4">Range Overflow</auro-header>
|
|
990
|
-
<p>Use <code>setCustomValidityRangeOverflow</code> to customize the message when the value exceeds the <code>max</code> constraint.</p>
|
|
991
|
-
<div class="exampleWrapper">
|
|
992
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
993
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
994
|
-
<auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
|
|
995
|
-
<span slot="label">Event Date</span>
|
|
996
|
-
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
997
|
-
</auro-input>
|
|
998
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
999
|
-
</div>
|
|
1000
|
-
<auro-accordion alignRight>
|
|
1001
|
-
<span slot="trigger">See code</span>
|
|
1002
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
1003
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
1004
|
-
<pre class="language-html"><code class="language-html"><auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
|
|
1005
|
-
<span slot="label">Event Date</span>
|
|
1006
|
-
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
1007
|
-
</auro-input></code></pre>
|
|
1008
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1009
|
-
</auro-accordion>
|
|
1010
|
-
<auro-header level="4">Range Underflow</auro-header>
|
|
1011
|
-
<p>Use <code>setCustomValidityRangeUnderflow</code> to customize the message when the value is below the <code>min</code> constraint.</p>
|
|
1012
|
-
<div class="exampleWrapper">
|
|
1013
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
1014
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
1015
|
-
<auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
|
|
1016
|
-
<span slot="label">Start Date</span>
|
|
1017
|
-
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
1018
|
-
</auro-input>
|
|
1019
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1020
|
-
</div>
|
|
1021
|
-
<auro-accordion alignRight>
|
|
1022
|
-
<span slot="trigger">See code</span>
|
|
1023
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
1024
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
1025
|
-
<pre class="language-html"><code class="language-html"><auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
|
|
1026
|
-
<span slot="label">Start Date</span>
|
|
1027
|
-
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
1028
|
-
</auro-input></code></pre>
|
|
1029
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1030
|
-
</auro-accordion>
|
|
1031
|
-
<auro-header level="4">Too Long</auro-header>
|
|
1032
|
-
<p>Use <code>setCustomValidityTooLong</code> to customize the message when the value exceeds the <code>maxlength</code> constraint.</p>
|
|
1033
|
-
<div class="exampleWrapper">
|
|
1034
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
1035
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
1036
|
-
<auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
1037
|
-
<span slot="label">Username</span>
|
|
1038
|
-
<span slot="helpText">Maximum 10 characters.</span>
|
|
1039
|
-
</auro-input>
|
|
1040
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1041
|
-
</div>
|
|
1042
|
-
<auro-accordion alignRight>
|
|
1043
|
-
<span slot="trigger">See code</span>
|
|
1044
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
1045
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
1046
|
-
<pre class="language-html"><code class="language-html"><auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
1047
|
-
<span slot="label">Username</span>
|
|
1048
|
-
<span slot="helpText">Maximum 10 characters.</span>
|
|
1049
|
-
</auro-input></code></pre>
|
|
1050
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1051
|
-
</auro-accordion>
|
|
1052
|
-
<auro-header level="4">Too Short</auro-header>
|
|
1053
|
-
<p>Use <code>setCustomValidityTooShort</code> to customize the message when the value is shorter than the <code>minlength</code> constraint.</p>
|
|
1054
|
-
<div class="exampleWrapper">
|
|
1055
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
1056
|
-
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
1057
|
-
<auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
1058
|
-
<span slot="label">Nickname</span>
|
|
1059
|
-
<span slot="helpText">Minimum 3 characters.</span>
|
|
1060
|
-
</auro-input>
|
|
1061
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1062
|
-
</div>
|
|
1063
|
-
<auro-accordion alignRight>
|
|
1064
|
-
<span slot="trigger">See code</span>
|
|
1065
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
1066
|
-
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
1067
|
-
<pre class="language-html"><code class="language-html"><auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
1068
|
-
<span slot="label">Nickname</span>
|
|
1069
|
-
<span slot="helpText">Minimum 3 characters.</span>
|
|
1070
|
-
</auro-input></code></pre>
|
|
1071
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1072
|
-
</auro-accordion>
|
|
1073
|
-
<auro-header level="3" id="type">Type</auro-header>
|
|
1074
|
-
<auro-header level="4" id="typePassword">Password</auro-header>
|
|
1075
|
-
<p>Use the <code>type="password"</code> attribute for a password style input. The hide/show password feature will automatically appear once a user begins to enter data.</p>
|
|
1076
|
-
<p>Default help text will be added to the input <code>type="password"</code> if custom help text is not provided.</p>
|
|
1077
|
-
<div class="exampleWrapper">
|
|
1078
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/password.html) -->
|
|
1079
|
-
<!-- The below content is automatically added from ../apiExamples/password.html -->
|
|
1080
|
-
<auro-input type="password" required>
|
|
1081
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
1082
|
-
<span slot="ariaLabel.password.show">Show</span>
|
|
1083
|
-
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1084
|
-
<span slot="label">Password</span>
|
|
1085
|
-
<span slot="helpText">Please enter a secure password.</span>
|
|
1086
|
-
</auro-input>
|
|
1087
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1088
|
-
</div>
|
|
1089
|
-
<auro-accordion alignRight>
|
|
1090
|
-
<span slot="trigger">See code</span>
|
|
1091
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/password.html) -->
|
|
1092
|
-
<!-- The below code snippet is automatically added from ../apiExamples/password.html -->
|
|
1093
|
-
<pre class="language-html"><code class="language-html"><auro-input type="password" required>
|
|
1094
|
-
<span slot="ariaLabel.clear">Clear All</span>
|
|
1095
|
-
<span slot="ariaLabel.password.show">Show</span>
|
|
1096
|
-
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1097
|
-
<span slot="label">Password</span>
|
|
1098
|
-
<span slot="helpText">Please enter a secure password.</span>
|
|
1099
|
-
</auro-input></code></pre>
|
|
1100
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1101
|
-
</auro-accordion>
|
|
1102
|
-
<auro-header level="4" id="typeEmail">Email</auro-header>
|
|
1103
|
-
<p>Use the <code>type="email"</code> attribute for an email style input. These examples illustrate the default error messaging per that browser. Content may vary.</p>
|
|
1104
|
-
<p>Default help text will be added to the input <code>type="email"</code> if custom help text is not provided.</p>
|
|
1086
|
+
</auro-accordion>
|
|
1087
|
+
<auro-header level="3" id="readonly">Readonly</auro-header>
|
|
1088
|
+
<p>Use the <code>readonly</code> attribute to prevent the user from editing the value of the input.</p>
|
|
1089
|
+
<p>In this example, the user is able to programmatically change the value of the input by clicking the button or clear out the contents of the input.</p>
|
|
1105
1090
|
<div class="exampleWrapper">
|
|
1106
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/
|
|
1107
|
-
<!-- The below content is automatically added from ../apiExamples/
|
|
1108
|
-
<auro-
|
|
1109
|
-
<
|
|
1110
|
-
<
|
|
1091
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/readonly.html) -->
|
|
1092
|
+
<!-- The below content is automatically added from ../apiExamples/readonly.html -->
|
|
1093
|
+
<auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
1094
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
1095
|
+
<br /><br />
|
|
1096
|
+
<auro-input readonly id="readonlyExample">
|
|
1097
|
+
<span slot="label">Name</span>
|
|
1098
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1111
1099
|
</auro-input>
|
|
1112
1100
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1113
1101
|
</div>
|
|
1114
1102
|
<auro-accordion alignRight>
|
|
1115
1103
|
<span slot="trigger">See code</span>
|
|
1116
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/
|
|
1117
|
-
<!-- The below code snippet is automatically added from ../apiExamples/
|
|
1118
|
-
<pre class="language-html"><code class="language-html"><auro-
|
|
1119
|
-
|
|
1120
|
-
|
|
1104
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.html) -->
|
|
1105
|
+
<!-- The below code snippet is automatically added from ../apiExamples/readonly.html -->
|
|
1106
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
1107
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
1108
|
+
<br /><br />
|
|
1109
|
+
<auro-input readonly id="readonlyExample">
|
|
1110
|
+
<span slot="label">Name</span>
|
|
1111
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1121
1112
|
</auro-input></code></pre>
|
|
1122
1113
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1114
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.js) -->
|
|
1115
|
+
<!-- The below code snippet is automatically added from ../apiExamples/readonly.js -->
|
|
1116
|
+
<pre class="language-js"><code class="language-js">export function setReadonlyValue() {
|
|
1117
|
+
const elem = document.querySelector('#readonlyExample');
|
|
1118
|
+
|
|
1119
|
+
// set value of auro-input element
|
|
1120
|
+
document.querySelector('#setReadonlyValueBtn').addEventListener('click', () => {
|
|
1121
|
+
elem.value = "Auro Alaska";
|
|
1122
|
+
});
|
|
1123
|
+
|
|
1124
|
+
document.querySelector('#resetReadonlyValueBtn').addEventListener('click', () => {
|
|
1125
|
+
elem.value = undefined;
|
|
1126
|
+
});
|
|
1127
|
+
}</code></pre>
|
|
1128
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1123
1129
|
</auro-accordion>
|
|
1124
|
-
<auro-header level="
|
|
1125
|
-
<p>
|
|
1126
|
-
<p>
|
|
1127
|
-
<p class="note"><strong>Note:</strong> We recommend using <code>type="number"</code> with <code>inputmode="numeric"</code> for the best mobile experience.</p>
|
|
1130
|
+
<auro-header level="3" id="required">Required</auro-header>
|
|
1131
|
+
<p>When present, the <code>required</code> attribute specifies that an input field must be filled out before submitting the form.</p>
|
|
1132
|
+
<p>When the validity check fails, the validityState equals <code>valueMissing</code>. The error message for the <code>valueMissing</code> validityState can be changed to a custom string using the <code>setCustomValidityValueMissing</code>.</p>
|
|
1128
1133
|
<div class="exampleWrapper">
|
|
1129
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/
|
|
1130
|
-
<!-- The below content is automatically added from ../apiExamples/
|
|
1131
|
-
<auro-input
|
|
1132
|
-
<span slot="label">
|
|
1133
|
-
<span slot="helpText">Please enter
|
|
1134
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/required.html) -->
|
|
1135
|
+
<!-- The below content is automatically added from ../apiExamples/required.html -->
|
|
1136
|
+
<auro-input required placeholder="John Doe">
|
|
1137
|
+
<span slot="label">Full name</span>
|
|
1138
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1134
1139
|
</auro-input>
|
|
1135
1140
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1136
1141
|
</div>
|
|
1137
1142
|
<auro-accordion alignRight>
|
|
1138
1143
|
<span slot="trigger">See code</span>
|
|
1139
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/
|
|
1140
|
-
<!-- The below code snippet is automatically added from ../apiExamples/
|
|
1141
|
-
<pre class="language-html"><code class="language-html"><auro-input
|
|
1142
|
-
<span slot="label">
|
|
1143
|
-
<span slot="helpText">Please enter
|
|
1144
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/required.html) -->
|
|
1145
|
+
<!-- The below code snippet is automatically added from ../apiExamples/required.html -->
|
|
1146
|
+
<pre class="language-html"><code class="language-html"><auro-input required placeholder="John Doe">
|
|
1147
|
+
<span slot="label">Full name</span>
|
|
1148
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1144
1149
|
</auro-input></code></pre>
|
|
1145
1150
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1146
1151
|
</auro-accordion>
|
|
1152
|
+
<auro-header level="3" id="type">Type</auro-header>
|
|
1147
1153
|
<auro-header level="4" id="typeCreditCard">Credit Card</auro-header>
|
|
1148
1154
|
<p>Use the <code>type="credit-card"</code> attribute for a credit card formatted input.</p>
|
|
1149
1155
|
<p>Default help text will be added to the input <code>type="credit-card"</code> if custom help text is not provided.</p>
|
|
@@ -1186,48 +1192,6 @@
|
|
|
1186
1192
|
</auro-input></code></pre>
|
|
1187
1193
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1188
1194
|
</auro-accordion>
|
|
1189
|
-
<auro-header level="4" id="typePhone">Phone Number</auro-header>
|
|
1190
|
-
<p>Use the <code>type="tel"</code> attribute for a phone number formatted input. The default format is <code>+1 (000) 000-0000</code>.</p>
|
|
1191
|
-
<p class="note"><strong>Note:</strong> We recommend using <code>type="tel"</code> with <code>inputmode="tel"</code> for the best mobile experience.</p>
|
|
1192
|
-
<div class="exampleWrapper">
|
|
1193
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel.html) -->
|
|
1194
|
-
<!-- The below content is automatically added from ../apiExamples/tel.html -->
|
|
1195
|
-
<auro-input type="tel">
|
|
1196
|
-
<span slot="label">Telephone</span>
|
|
1197
|
-
<span slot="helpText">Help Text</span>
|
|
1198
|
-
</auro-input>
|
|
1199
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1200
|
-
</div>
|
|
1201
|
-
<auro-accordion alignRight>
|
|
1202
|
-
<span slot="trigger">See code</span>
|
|
1203
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel.html) -->
|
|
1204
|
-
<!-- The below code snippet is automatically added from ../apiExamples/tel.html -->
|
|
1205
|
-
<pre class="language-html"><code class="language-html"><auro-input type="tel">
|
|
1206
|
-
<span slot="label">Telephone</span>
|
|
1207
|
-
<span slot="helpText">Help Text</span>
|
|
1208
|
-
</auro-input></code></pre>
|
|
1209
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1210
|
-
</auro-accordion>
|
|
1211
|
-
<p>Use the <code>format</code> attribute to set a custom phone number format.</p>
|
|
1212
|
-
<div class="exampleWrapper">
|
|
1213
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel-format.html) -->
|
|
1214
|
-
<!-- The below content is automatically added from ../apiExamples/tel-format.html -->
|
|
1215
|
-
<auro-input type="tel" format="+00 000 00 0000">
|
|
1216
|
-
<span slot="label">Telephone</span>
|
|
1217
|
-
<span slot="helpText">Help Text</span>
|
|
1218
|
-
</auro-input>
|
|
1219
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1220
|
-
</div>
|
|
1221
|
-
<auro-accordion alignRight>
|
|
1222
|
-
<span slot="trigger">See code</span>
|
|
1223
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel-format.html) -->
|
|
1224
|
-
<!-- The below code snippet is automatically added from ../apiExamples/tel-format.html -->
|
|
1225
|
-
<pre class="language-html"><code class="language-html"><auro-input type="tel" format="+00 000 00 0000">
|
|
1226
|
-
<span slot="label">Telephone</span>
|
|
1227
|
-
<span slot="helpText">Help Text</span>
|
|
1228
|
-
</auro-input></code></pre>
|
|
1229
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1230
|
-
</auro-accordion>
|
|
1231
1195
|
<auro-header level="4" id="typeDate">Date</auro-header>
|
|
1232
1196
|
<p>Use the <code>type="date"</code> attribute for a date formatted input. The default date format is <code>mm/dd/yyyy</code>.</p>
|
|
1233
1197
|
<div class="exampleWrapper">
|
|
@@ -1307,6 +1271,121 @@
|
|
|
1307
1271
|
</auro-input></code></pre>
|
|
1308
1272
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1309
1273
|
</auro-accordion>
|
|
1274
|
+
<auro-header level="4" id="typeEmail">Email</auro-header>
|
|
1275
|
+
<p>Use the <code>type="email"</code> attribute for an email style input. These examples illustrate the default error messaging per that browser. Content may vary.</p>
|
|
1276
|
+
<p>Default help text will be added to the input <code>type="email"</code> if custom help text is not provided.</p>
|
|
1277
|
+
<div class="exampleWrapper">
|
|
1278
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/email.html) -->
|
|
1279
|
+
<!-- The below content is automatically added from ../apiExamples/email.html -->
|
|
1280
|
+
<auro-input type="email" required>
|
|
1281
|
+
<span slot="label">Email address</span>
|
|
1282
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
1283
|
+
</auro-input>
|
|
1284
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1285
|
+
</div>
|
|
1286
|
+
<auro-accordion alignRight>
|
|
1287
|
+
<span slot="trigger">See code</span>
|
|
1288
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/email.html) -->
|
|
1289
|
+
<!-- The below code snippet is automatically added from ../apiExamples/email.html -->
|
|
1290
|
+
<pre class="language-html"><code class="language-html"><auro-input type="email" required>
|
|
1291
|
+
<span slot="label">Email address</span>
|
|
1292
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
1293
|
+
</auro-input></code></pre>
|
|
1294
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1295
|
+
</auro-accordion>
|
|
1296
|
+
<auro-header level="4" id="typeNumber">Number</auro-header>
|
|
1297
|
+
<p>Use the <code>type="number"</code> attribute for a numeric style input and invoke a numeric virtual keyboard on handheld devices.</p>
|
|
1298
|
+
<p>This <code>number</code> input type should only be used for incremental numeric values, meaning values with decimals will be considered invalid. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number">MDN Web Docs</a> for more information.</p>
|
|
1299
|
+
<p class="note"><strong>Note:</strong> We recommend using <code>type="number"</code> with <code>inputmode="numeric"</code> for the best mobile experience.</p>
|
|
1300
|
+
<div class="exampleWrapper">
|
|
1301
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/number.html) -->
|
|
1302
|
+
<!-- The below content is automatically added from ../apiExamples/number.html -->
|
|
1303
|
+
<auro-input type="number" required>
|
|
1304
|
+
<span slot="label">Number of Passengers</span>
|
|
1305
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
1306
|
+
</auro-input>
|
|
1307
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1308
|
+
</div>
|
|
1309
|
+
<auro-accordion alignRight>
|
|
1310
|
+
<span slot="trigger">See code</span>
|
|
1311
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/number.html) -->
|
|
1312
|
+
<!-- The below code snippet is automatically added from ../apiExamples/number.html -->
|
|
1313
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" required>
|
|
1314
|
+
<span slot="label">Number of Passengers</span>
|
|
1315
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
1316
|
+
</auro-input></code></pre>
|
|
1317
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1318
|
+
</auro-accordion>
|
|
1319
|
+
<auro-header level="4" id="typePassword">Password</auro-header>
|
|
1320
|
+
<p>Use the <code>type="password"</code> attribute for a password style input. The hide/show password feature will automatically appear once a user begins to enter data.</p>
|
|
1321
|
+
<p>Default help text will be added to the input <code>type="password"</code> if custom help text is not provided.</p>
|
|
1322
|
+
<div class="exampleWrapper">
|
|
1323
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/password.html) -->
|
|
1324
|
+
<!-- The below content is automatically added from ../apiExamples/password.html -->
|
|
1325
|
+
<auro-input type="password" required>
|
|
1326
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
1327
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
1328
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1329
|
+
<span slot="label">Password</span>
|
|
1330
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
1331
|
+
</auro-input>
|
|
1332
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1333
|
+
</div>
|
|
1334
|
+
<auro-accordion alignRight>
|
|
1335
|
+
<span slot="trigger">See code</span>
|
|
1336
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/password.html) -->
|
|
1337
|
+
<!-- The below code snippet is automatically added from ../apiExamples/password.html -->
|
|
1338
|
+
<pre class="language-html"><code class="language-html"><auro-input type="password" required>
|
|
1339
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
1340
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
1341
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1342
|
+
<span slot="label">Password</span>
|
|
1343
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
1344
|
+
</auro-input></code></pre>
|
|
1345
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1346
|
+
</auro-accordion>
|
|
1347
|
+
<auro-header level="4" id="typePhone">Phone Number</auro-header>
|
|
1348
|
+
<p>Use the <code>type="tel"</code> attribute for a phone number formatted input. The default format is <code>+1 (000) 000-0000</code>.</p>
|
|
1349
|
+
<p class="note"><strong>Note:</strong> We recommend using <code>type="tel"</code> with <code>inputmode="tel"</code> for the best mobile experience.</p>
|
|
1350
|
+
<div class="exampleWrapper">
|
|
1351
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel.html) -->
|
|
1352
|
+
<!-- The below content is automatically added from ../apiExamples/tel.html -->
|
|
1353
|
+
<auro-input type="tel">
|
|
1354
|
+
<span slot="label">Telephone</span>
|
|
1355
|
+
<span slot="helpText">Help Text</span>
|
|
1356
|
+
</auro-input>
|
|
1357
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1358
|
+
</div>
|
|
1359
|
+
<auro-accordion alignRight>
|
|
1360
|
+
<span slot="trigger">See code</span>
|
|
1361
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel.html) -->
|
|
1362
|
+
<!-- The below code snippet is automatically added from ../apiExamples/tel.html -->
|
|
1363
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel">
|
|
1364
|
+
<span slot="label">Telephone</span>
|
|
1365
|
+
<span slot="helpText">Help Text</span>
|
|
1366
|
+
</auro-input></code></pre>
|
|
1367
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1368
|
+
</auro-accordion>
|
|
1369
|
+
<p>Use the <code>format</code> attribute to set a custom phone number format.</p>
|
|
1370
|
+
<div class="exampleWrapper">
|
|
1371
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel-format.html) -->
|
|
1372
|
+
<!-- The below content is automatically added from ../apiExamples/tel-format.html -->
|
|
1373
|
+
<auro-input type="tel" format="+00 000 00 0000">
|
|
1374
|
+
<span slot="label">Telephone</span>
|
|
1375
|
+
<span slot="helpText">Help Text</span>
|
|
1376
|
+
</auro-input>
|
|
1377
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1378
|
+
</div>
|
|
1379
|
+
<auro-accordion alignRight>
|
|
1380
|
+
<span slot="trigger">See code</span>
|
|
1381
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel-format.html) -->
|
|
1382
|
+
<!-- The below code snippet is automatically added from ../apiExamples/tel-format.html -->
|
|
1383
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel" format="+00 000 00 0000">
|
|
1384
|
+
<span slot="label">Telephone</span>
|
|
1385
|
+
<span slot="helpText">Help Text</span>
|
|
1386
|
+
</auro-input></code></pre>
|
|
1387
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1388
|
+
</auro-accordion>
|
|
1310
1389
|
<auro-header level="3" id="validateOnInput">Validate on Input</auro-header>
|
|
1311
1390
|
<p>Use the <code>validateOnInput</code> attribute to enable live validation on the <code>input</code> event. Recommended use is with setting a custom <code>pattern</code> and validation is required prior to a <code>blur</code> event.</p>
|
|
1312
1391
|
<div class="exampleWrapper">
|
|
@@ -1437,96 +1516,6 @@
|
|
|
1437
1516
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1438
1517
|
</auro-accordion>
|
|
1439
1518
|
</section>
|
|
1440
|
-
<section>
|
|
1441
|
-
<auro-header level="2" id="auroInputUtil">AuroInputUtil</auro-header>
|
|
1442
|
-
<p>When <code>type="date"</code> is used, the <code>.value</code> property always stores and returns the date in ISO format (<code>YYYY-MM-DD</code>) regardless of the displayed locale or <code>format</code> attribute. Use the <code>AuroInputUtil</code> helper to convert between ISO and any display format in your application code.</p>
|
|
1443
|
-
<auro-header level="3" id="auroInputUtilFormatIso">formatISODate — ISO to display format</auro-header>
|
|
1444
|
-
<p>Use <code>AuroInputUtil.formatISODate(isoStr, format)</code> to convert the ISO value read from the input into any display string. The format argument uses the same tokens as the <code>format</code> attribute (<code>mm</code>, <code>dd</code>, <code>yyyy</code>, <code>yy</code>).</p>
|
|
1445
|
-
<p>Returns <code>undefined</code> when either argument is empty or the ISO string is not a valid date.</p>
|
|
1446
|
-
<div class="exampleWrapper">
|
|
1447
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/format-iso-value.html) -->
|
|
1448
|
-
<!-- The below content is automatically added from ../apiExamples/format-iso-value.html -->
|
|
1449
|
-
<auro-input id="formatIsoExample" type="date" locale="en-US" value="2024-01-15">
|
|
1450
|
-
<span slot="label">Date</span>
|
|
1451
|
-
<span slot="helpText">The <code>.value</code> property always stores the date as ISO (YYYY-MM-DD)</span>
|
|
1452
|
-
</auro-input>
|
|
1453
|
-
<br />
|
|
1454
|
-
<table>
|
|
1455
|
-
<thead>
|
|
1456
|
-
<tr><th>Property / Method</th><th>Result</th></tr>
|
|
1457
|
-
</thead>
|
|
1458
|
-
<tbody>
|
|
1459
|
-
<tr><td><code>.value</code> (ISO)</td><td><code id="isoVal">2024-01-15</code></td></tr>
|
|
1460
|
-
<tr><td><code>formatISODate(value, 'mm/dd/yyyy')</code></td><td><code id="fmtUs">01/15/2024</code></td></tr>
|
|
1461
|
-
<tr><td><code>formatISODate(value, 'dd/mm/yyyy')</code></td><td><code id="fmtGb">15/01/2024</code></td></tr>
|
|
1462
|
-
<tr><td><code>formatISODate(value, 'yyyy/mm/dd')</code></td><td><code id="fmtIso">2024/01/15</code></td></tr>
|
|
1463
|
-
</tbody>
|
|
1464
|
-
</table>
|
|
1465
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1466
|
-
</div>
|
|
1467
|
-
<auro-accordion alignRight>
|
|
1468
|
-
<span slot="trigger">See code</span>
|
|
1469
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/format-iso-value.html) -->
|
|
1470
|
-
<!-- The below code snippet is automatically added from ../apiExamples/format-iso-value.html -->
|
|
1471
|
-
<pre class="language-html"><code class="language-html"><auro-input id="formatIsoExample" type="date" locale="en-US" value="2024-01-15">
|
|
1472
|
-
<span slot="label">Date</span>
|
|
1473
|
-
<span slot="helpText">The <code>.value</code> property always stores the date as ISO (YYYY-MM-DD)</span>
|
|
1474
|
-
</auro-input>
|
|
1475
|
-
<br />
|
|
1476
|
-
<table>
|
|
1477
|
-
<thead>
|
|
1478
|
-
<tr><th>Property / Method</th><th>Result</th></tr>
|
|
1479
|
-
</thead>
|
|
1480
|
-
<tbody>
|
|
1481
|
-
<tr><td><code>.value</code> (ISO)</td><td><code id="isoVal">2024-01-15</code></td></tr>
|
|
1482
|
-
<tr><td><code>formatISODate(value, 'mm/dd/yyyy')</code></td><td><code id="fmtUs">01/15/2024</code></td></tr>
|
|
1483
|
-
<tr><td><code>formatISODate(value, 'dd/mm/yyyy')</code></td><td><code id="fmtGb">15/01/2024</code></td></tr>
|
|
1484
|
-
<tr><td><code>formatISODate(value, 'yyyy/mm/dd')</code></td><td><code id="fmtIso">2024/01/15</code></td></tr>
|
|
1485
|
-
</tbody>
|
|
1486
|
-
</table></code></pre>
|
|
1487
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1488
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/auro-input-util-format-iso.js) -->
|
|
1489
|
-
<!-- The below code snippet is automatically added from ../apiExamples/auro-input-util-format-iso.js -->
|
|
1490
|
-
<pre class="language-js"><code class="language-js">import { AuroInputUtil } from '@aurodesignsystem/auro-formkit/input';
|
|
1491
|
-
|
|
1492
|
-
const input = document.querySelector('auro-input');
|
|
1493
|
-
|
|
1494
|
-
// .value is always ISO, regardless of locale or format attribute
|
|
1495
|
-
const iso = input.value; // e.g. '2024-01-15'
|
|
1496
|
-
|
|
1497
|
-
// Date string that's converted to user's locale and format.
|
|
1498
|
-
AuroInputUtil.formatISODate(iso, input.format);
|
|
1499
|
-
|
|
1500
|
-
// Examples with explicit format:
|
|
1501
|
-
AuroInputUtil.formatISODate(iso, 'mm/dd/yyyy'); // → '01/15/2024'
|
|
1502
|
-
AuroInputUtil.formatISODate(iso, 'dd/mm/yyyy'); // → '15/01/2024'
|
|
1503
|
-
AuroInputUtil.formatISODate(iso, 'yyyy/mm/dd'); // → '2024/01/15'
|
|
1504
|
-
AuroInputUtil.formatISODate(iso, 'dd.mm.yyyy'); // → '15.01.2024'
|
|
1505
|
-
|
|
1506
|
-
// Returns undefined for empty or invalid input
|
|
1507
|
-
AuroInputUtil.formatISODate(undefined, 'mm/dd/yyyy'); // → undefined
|
|
1508
|
-
AuroInputUtil.formatISODate('not-a-date', 'mm/dd/yyyy'); // → undefined</code></pre>
|
|
1509
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1510
|
-
</auro-accordion>
|
|
1511
|
-
</section>
|
|
1512
|
-
<section>
|
|
1513
|
-
<auro-header level="3" id="auroInputUtilToIso">toISOFormatString — Date instance to ISO</auro-header>
|
|
1514
|
-
<p>Use <code>AuroInputUtil.toISOFormatString(date)</code> to convert a JavaScript <code>Date</code> instance into an ISO string suitable for setting <code>input.value</code>.</p>
|
|
1515
|
-
<p>Throws when the argument is not a valid <code>Date</code> instance.</p>
|
|
1516
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/auro-input-util-to-iso.js) -->
|
|
1517
|
-
<!-- The below code snippet is automatically added from ../apiExamples/auro-input-util-to-iso.js -->
|
|
1518
|
-
<pre class="language-js"><code class="language-js">import { AuroInputUtil } from '@aurodesignsystem/auro-formkit/input';
|
|
1519
|
-
|
|
1520
|
-
const input = document.querySelector('auro-input');
|
|
1521
|
-
|
|
1522
|
-
// Convert a Date to ISO, then set it on the input
|
|
1523
|
-
const today = new Date();
|
|
1524
|
-
input.value = AuroInputUtil.toISOFormatString(today); // e.g. '2024-01-15'
|
|
1525
|
-
|
|
1526
|
-
// Convert a specific date
|
|
1527
|
-
AuroInputUtil.toISOFormatString(new Date(2024, 0, 15)); // → '2024-01-15'</code></pre>
|
|
1528
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1529
|
-
</section>
|
|
1530
1519
|
</div>
|
|
1531
1520
|
</div>
|
|
1532
1521
|
</div>
|