@aurodesignsystem-dev/auro-formkit 0.0.0-pr1448.0 → 0.0.0-pr1451.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/api.md +201 -221
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.md +21 -23
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/keyboard-behavior.md +39 -0
- package/components/checkbox/demo/readme.md +23 -35
- package/components/checkbox/dist/auro-checkbox-group.d.ts +6 -6
- package/components/checkbox/dist/auro-checkbox.d.ts +8 -8
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/README.md +13 -3
- package/components/combobox/demo/accessibility.html +57 -0
- package/components/combobox/demo/accessibility.md +77 -0
- package/components/combobox/demo/api.html +24 -0
- package/components/combobox/demo/api.md +1613 -1685
- package/components/combobox/demo/api.min.js +15 -21
- package/components/combobox/demo/design.html +83 -0
- package/components/combobox/demo/design.md +283 -0
- package/components/combobox/demo/index.html +49 -16
- package/components/combobox/demo/index.js +3 -2
- package/components/combobox/demo/index.md +861 -185
- package/components/combobox/demo/index.min.js +41 -22
- package/components/combobox/demo/install.html +84 -0
- package/components/combobox/demo/install.js +24 -0
- package/components/combobox/demo/install.md +100 -0
- package/components/combobox/demo/install.min.js +17991 -0
- package/components/combobox/demo/{keyboardBehavior.html → keyboard-behavior.html} +2 -1
- package/components/combobox/demo/keyboard-behavior.md +276 -0
- package/components/combobox/demo/layout.md +112 -0
- package/components/combobox/demo/readme.html +25 -1
- package/components/combobox/demo/readme.md +50 -52
- package/components/combobox/demo/styles.css +141 -0
- package/components/combobox/demo/voiceover.html +66 -0
- package/components/combobox/demo/voiceover.md +118 -0
- package/components/combobox/dist/auro-combobox.d.ts +36 -36
- package/components/combobox/dist/index.js +12 -17
- package/components/combobox/dist/registered.js +12 -17
- package/components/counter/demo/api.md +751 -819
- package/components/counter/demo/api.min.js +2 -2
- package/components/counter/demo/index.md +35 -39
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/demo/keyboard-behavior.md +127 -0
- package/components/counter/demo/readme.md +39 -51
- package/components/counter/dist/auro-counter-group.d.ts +2 -2
- package/components/counter/dist/auro-counter.d.ts +10 -10
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/api.md +827 -931
- package/components/datepicker/demo/api.min.js +4 -4
- package/components/datepicker/demo/index.md +79 -87
- package/components/datepicker/demo/index.min.js +4 -4
- package/components/datepicker/demo/keyboard-behavior.md +19 -0
- package/components/datepicker/demo/readme.md +19 -31
- package/components/datepicker/dist/index.js +4 -4
- package/components/datepicker/dist/registered.js +4 -4
- package/components/datepicker/dist/{auro-calendar-cell.d.ts → src/auro-calendar-cell.d.ts} +2 -2
- package/components/datepicker/dist/{auro-datepicker.d.ts → src/auro-datepicker.d.ts} +13 -13
- package/components/datepicker/dist/{utilities.d.ts → src/utilities.d.ts} +4 -4
- package/components/datepicker/dist/{utilitiesCalendar.d.ts → src/utilitiesCalendar.d.ts} +3 -3
- package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker-calendar.d.ts +2 -2
- package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker.d.ts +1 -1
- package/components/dropdown/demo/api.md +795 -851
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.md +145 -155
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/demo/keyboard-behavior.md +72 -0
- package/components/dropdown/demo/readme.md +39 -51
- package/components/dropdown/dist/auro-dropdown.d.ts +22 -22
- package/components/dropdown/dist/auro-dropdownBib.d.ts +3 -3
- package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/api.md +173 -179
- package/components/form/demo/api.min.js +27 -33
- package/components/form/demo/index.md +27 -33
- package/components/form/demo/index.min.js +27 -33
- package/components/form/demo/keyboard-behavior.md +38 -0
- package/components/form/demo/readme.md +14 -28
- package/components/input/demo/api.md +572 -664
- package/components/input/demo/api.min.js +2 -2
- package/components/input/demo/index.md +93 -99
- package/components/input/demo/index.min.js +2 -2
- package/components/input/demo/keyboard-behavior.md +25 -0
- package/components/input/demo/readme.md +17 -29
- package/components/input/dist/auro-input.d.ts +1 -1
- package/components/input/dist/base-input.d.ts +29 -29
- package/components/input/dist/index.js +2 -2
- package/components/input/dist/registered.js +2 -2
- package/components/menu/demo/api.md +745 -789
- package/components/menu/demo/api.min.js +3 -4
- package/components/menu/demo/index.md +35 -37
- package/components/menu/demo/index.min.js +3 -4
- package/components/menu/demo/keyboard-behavior.md +18 -0
- package/components/menu/demo/readme.md +23 -35
- package/components/menu/dist/auro-menu-utils.d.ts +1 -1
- package/components/menu/dist/auro-menu.context.d.ts +3 -3
- package/components/menu/dist/auro-menu.d.ts +5 -5
- package/components/menu/dist/auro-menuoption.d.ts +6 -6
- package/components/menu/dist/index.js +3 -4
- package/components/menu/dist/registered.js +3 -4
- package/components/radio/demo/api.md +318 -350
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.md +25 -29
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/demo/keyboard-behavior.md +72 -0
- package/components/radio/demo/readme.md +21 -33
- package/components/radio/dist/auro-radio-group.d.ts +9 -9
- package/components/radio/dist/auro-radio.d.ts +8 -8
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/README.md +12 -1
- package/components/select/demo/accessibility.html +65 -0
- package/components/select/demo/accessibility.md +76 -0
- package/components/select/demo/api.md +1713 -1793
- package/components/select/demo/api.min.js +5 -6
- package/components/select/demo/index.html +247 -37
- package/components/select/demo/index.md +225 -345
- package/components/select/demo/index.min.js +5 -6
- package/components/select/demo/keyboard-behavior.md +39 -0
- package/components/select/demo/layout.html +59 -0
- package/components/select/demo/layout.md +299 -0
- package/components/select/demo/readme.md +45 -46
- package/components/select/demo/voiceover.html +65 -0
- package/components/select/demo/voiceover.md +183 -0
- package/components/select/dist/auro-select.d.ts +11 -11
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +13 -11
- package/package.json +26 -26
- package/components/checkbox/demo/keyboardBehavior.md +0 -0
- package/components/combobox/demo/keyboardBehavior.md +0 -281
- package/components/counter/demo/keyboardBehavior.md +0 -127
- package/components/datepicker/demo/keyboardBehavior.md +0 -19
- package/components/dropdown/demo/keyboardBehavior.md +0 -77
- package/components/form/demo/keyboardBehavior.md +0 -0
- package/components/input/demo/keyboardBehavior.md +0 -0
- package/components/menu/demo/keyboardBehavior.md +0 -0
- package/components/radio/demo/keyboardBehavior.md +0 -0
- package/components/select/demo/keyboardBehavior.md +0 -245
- /package/components/datepicker/dist/{auro-calendar-month.d.ts → src/auro-calendar-month.d.ts} +0 -0
- /package/components/datepicker/dist/{auro-calendar.d.ts → src/auro-calendar.d.ts} +0 -0
- /package/components/datepicker/dist/{buttonVersion.d.ts → src/buttonVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{datepickerKeyboardStrategy.d.ts → src/datepickerKeyboardStrategy.d.ts} +0 -0
- /package/components/datepicker/dist/{iconVersion.d.ts → src/iconVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/components/datepicker/dist/{popoverVersion.d.ts → src/popoverVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/classic/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/classic/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/color-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/color-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/color-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/shapeSize-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/snowflake/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/snowflake/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{styles → src/styles}/tokens-css.d.ts +0 -0
- /package/components/datepicker/dist/{utilitiesCalendarRender.d.ts → src/utilitiesCalendarRender.d.ts} +0 -0
- /package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/day.d.ts +0 -0
- /package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker-cell.d.ts +0 -0
|
@@ -107,27 +107,25 @@ The `auro-input` element provides users a way to enter data into a text field.
|
|
|
107
107
|
## Basic
|
|
108
108
|
|
|
109
109
|
<div class="exampleWrapper">
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
111
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
112
|
+
<auro-input>
|
|
113
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
114
|
+
<span slot="label">Label</span>
|
|
115
|
+
<span slot="helpText">Help Text</span>
|
|
116
|
+
</auro-input>
|
|
117
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
118
118
|
</div>
|
|
119
119
|
<auro-accordion alignRight>
|
|
120
|
-
|
|
120
|
+
<span slot="trigger">See code</span>
|
|
121
121
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
122
122
|
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
</auro-input>
|
|
130
|
-
```
|
|
124
|
+
<pre class="language-html"><code class="language-html"><auro-input>
|
|
125
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
126
|
+
<span slot="label">Label</span>
|
|
127
|
+
<span slot="helpText">Help Text</span>
|
|
128
|
+
</auro-input></code></pre>
|
|
131
129
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
132
130
|
</auro-accordion>
|
|
133
131
|
|
|
@@ -138,50 +136,46 @@ The `auro-input` element provides users a way to enter data into a text field.
|
|
|
138
136
|
Use the `activeLabel` attribute to make the label stay fixed in the active position.
|
|
139
137
|
|
|
140
138
|
<div class="exampleWrapper">
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/active-label.html) -->
|
|
140
|
+
<!-- The below content is automatically added from ../apiExamples/active-label.html -->
|
|
141
|
+
<auro-input activeLabel>
|
|
142
|
+
<span slot="label">Address</span>
|
|
143
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
144
|
+
</auro-input>
|
|
145
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
148
146
|
</div>
|
|
149
147
|
<auro-accordion alignRight>
|
|
150
|
-
|
|
148
|
+
<span slot="trigger">See code</span>
|
|
151
149
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/active-label.html) -->
|
|
152
150
|
<!-- The below code snippet is automatically added from ../apiExamples/active-label.html -->
|
|
153
151
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
</auro-input>
|
|
159
|
-
```
|
|
152
|
+
<pre class="language-html"><code class="language-html"><auro-input activeLabel>
|
|
153
|
+
<span slot="label">Address</span>
|
|
154
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
155
|
+
</auro-input></code></pre>
|
|
160
156
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
161
157
|
</auro-accordion>
|
|
162
158
|
|
|
163
159
|
### Appearance on Dark Backgrounds
|
|
164
160
|
|
|
165
161
|
<div class="exampleWrapper--ondark">
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
162
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
163
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
164
|
+
<auro-input appearance="inverse">
|
|
165
|
+
<span slot="label">Label</span>
|
|
166
|
+
<span slot="helpText">Help Text</span>
|
|
167
|
+
</auro-input>
|
|
168
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
173
169
|
</div>
|
|
174
170
|
<auro-accordion alignRight>
|
|
175
|
-
|
|
171
|
+
<span slot="trigger">See code</span>
|
|
176
172
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
177
173
|
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
178
174
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
</auro-input>
|
|
184
|
-
```
|
|
175
|
+
<pre class="language-html"><code class="language-html"><auro-input appearance="inverse">
|
|
176
|
+
<span slot="label">Label</span>
|
|
177
|
+
<span slot="helpText">Help Text</span>
|
|
178
|
+
</auro-input></code></pre>
|
|
185
179
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
186
180
|
</auro-accordion>
|
|
187
181
|
|
|
@@ -190,47 +184,43 @@ Use the `activeLabel` attribute to make the label stay fixed in the active posit
|
|
|
190
184
|
Use the `disable` attribute to prevent the user from interacting with the input.
|
|
191
185
|
|
|
192
186
|
<div class="exampleWrapper">
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
188
|
+
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
189
|
+
<auro-input disabled type="date">
|
|
190
|
+
<span slot="label">Disabled</span>
|
|
191
|
+
<span slot="helpText">Help Text</span>
|
|
192
|
+
</auro-input>
|
|
193
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
200
194
|
</div>
|
|
201
195
|
<auro-accordion alignRight>
|
|
202
|
-
|
|
196
|
+
<span slot="trigger">See code</span>
|
|
203
197
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
204
198
|
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
205
199
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</auro-input>
|
|
211
|
-
```
|
|
200
|
+
<pre class="language-html"><code class="language-html"><auro-input disabled type="date">
|
|
201
|
+
<span slot="label">Disabled</span>
|
|
202
|
+
<span slot="helpText">Help Text</span>
|
|
203
|
+
</auro-input></code></pre>
|
|
212
204
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
213
205
|
</auro-accordion>
|
|
214
206
|
<div class="exampleWrapper--ondark" aria-hidden>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
207
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-disabled.html) -->
|
|
208
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-disabled.html -->
|
|
209
|
+
<auro-input appearance="inverse" disabled type="date">
|
|
210
|
+
<span slot="label">Arrival date</span>
|
|
211
|
+
<span slot="helpText">Help Text</span>
|
|
212
|
+
</auro-input>
|
|
213
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
222
214
|
</div>
|
|
223
215
|
<auro-accordion alignRight>
|
|
224
|
-
|
|
216
|
+
<span slot="trigger">See code</span>
|
|
225
217
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-disabled.html) -->
|
|
226
218
|
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-disabled.html -->
|
|
227
219
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
</auro-input>
|
|
233
|
-
```
|
|
220
|
+
<pre class="language-html"><code class="language-html"><auro-input appearance="inverse" disabled type="date">
|
|
221
|
+
<span slot="label">Arrival date</span>
|
|
222
|
+
<span slot="helpText">Help Text</span>
|
|
223
|
+
</auro-input></code></pre>
|
|
234
224
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
235
225
|
</auro-accordion>
|
|
236
226
|
|
|
@@ -241,95 +231,87 @@ Use the `error` attribute to apply a persistent custom error that supersedes the
|
|
|
241
231
|
A custom error message can be set using the `error` attribute, or it can be used in conjuction with the `setCustomValidityCustomError` attribute.
|
|
242
232
|
|
|
243
233
|
<div class="exampleWrapper">
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
234
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/error.html) -->
|
|
235
|
+
<!-- The below content is automatically added from ../apiExamples/error.html -->
|
|
236
|
+
<auro-button id="setCustomErrorBtn">Set Custom Error</auro-button>
|
|
237
|
+
<auro-button id="setCustomErrorClearBtn">Clear Custom Error</auro-button>
|
|
238
|
+
<br /><br />
|
|
239
|
+
<auro-input id="setCustomErrorExample" error="Initial error attribute value">
|
|
240
|
+
<span slot="label">Name</span>
|
|
241
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
242
|
+
</auro-input>
|
|
243
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
254
244
|
</div>
|
|
255
245
|
<auro-accordion alignRight>
|
|
256
|
-
|
|
246
|
+
<span slot="trigger">See code</span>
|
|
257
247
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/error.html) -->
|
|
258
248
|
<!-- The below code snippet is automatically added from ../apiExamples/error.html -->
|
|
259
249
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</auro-input>
|
|
268
|
-
```
|
|
250
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setCustomErrorBtn">Set Custom Error</auro-button>
|
|
251
|
+
<auro-button id="setCustomErrorClearBtn">Clear Custom Error</auro-button>
|
|
252
|
+
<br /><br />
|
|
253
|
+
<auro-input id="setCustomErrorExample" error="Initial error attribute value">
|
|
254
|
+
<span slot="label">Name</span>
|
|
255
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
256
|
+
</auro-input></code></pre>
|
|
269
257
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
270
258
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/error.js) -->
|
|
271
259
|
<!-- The below code snippet is automatically added from ../apiExamples/error.js -->
|
|
272
260
|
|
|
273
|
-
|
|
274
|
-
export function customError() {
|
|
261
|
+
<pre class="language-js"><code class="language-js">export function customError() {
|
|
275
262
|
const elem = document.querySelector('#setCustomErrorExample');
|
|
276
263
|
// set custom error
|
|
277
|
-
document.querySelector('#setCustomErrorBtn').addEventListener('click', ()
|
|
264
|
+
document.querySelector('#setCustomErrorBtn').addEventListener('click', () => {
|
|
278
265
|
elem.error = "Custom Error Message";
|
|
279
266
|
});
|
|
280
|
-
|
|
267
|
+
|
|
281
268
|
// remove custom error
|
|
282
|
-
document.querySelector('#setCustomErrorClearBtn').addEventListener('click', ()
|
|
269
|
+
document.querySelector('#setCustomErrorClearBtn').addEventListener('click', () => {
|
|
283
270
|
elem.removeAttribute('error');
|
|
284
271
|
});
|
|
285
|
-
}
|
|
286
|
-
```
|
|
272
|
+
}</code></pre>
|
|
287
273
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
288
274
|
</auro-accordion>
|
|
289
275
|
<div class="exampleWrapper--ondark" aria-hidden>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
276
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/appearance-inverse-error.html) -->
|
|
277
|
+
<!-- The below content is automatically added from ../apiExamples/appearance-inverse-error.html -->
|
|
278
|
+
<auro-button appearance="inverse" id="setCustomErrorBtnOnDark">Set Custom Error</auro-button>
|
|
279
|
+
<auro-button appearance="inverse" id="setCustomErrorClearBtnOnDark">Clear Custom Error</auro-button>
|
|
280
|
+
<br /><br />
|
|
281
|
+
<auro-input appearance="inverse" id="setCustomErrorExampleOnDark" error="Initial error attribute value">
|
|
282
|
+
<span slot="label">Name</span>
|
|
283
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
284
|
+
</auro-input>
|
|
285
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
300
286
|
</div>
|
|
301
287
|
<auro-accordion alignRight>
|
|
302
|
-
|
|
288
|
+
<span slot="trigger">See code</span>
|
|
303
289
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/appearance-inverse-error.html) -->
|
|
304
290
|
<!-- The below code snippet is automatically added from ../apiExamples/appearance-inverse-error.html -->
|
|
305
291
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
</auro-input>
|
|
314
|
-
```
|
|
292
|
+
<pre class="language-html"><code class="language-html"><auro-button appearance="inverse" id="setCustomErrorBtnOnDark">Set Custom Error</auro-button>
|
|
293
|
+
<auro-button appearance="inverse" id="setCustomErrorClearBtnOnDark">Clear Custom Error</auro-button>
|
|
294
|
+
<br /><br />
|
|
295
|
+
<auro-input appearance="inverse" id="setCustomErrorExampleOnDark" error="Initial error attribute value">
|
|
296
|
+
<span slot="label">Name</span>
|
|
297
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
298
|
+
</auro-input></code></pre>
|
|
315
299
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
316
300
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/appearance-inverse-error.js) -->
|
|
317
301
|
<!-- The below code snippet is automatically added from ../apiExamples/appearance-inverse-error.js -->
|
|
318
302
|
|
|
319
|
-
|
|
320
|
-
export function customErrorOnDark() {
|
|
303
|
+
<pre class="language-js"><code class="language-js">export function customErrorOnDark() {
|
|
321
304
|
const elem = document.querySelector('#setCustomErrorExampleOnDark');
|
|
322
305
|
// set custom error
|
|
323
|
-
document.querySelector('#setCustomErrorBtnOnDark').addEventListener('click', ()
|
|
306
|
+
document.querySelector('#setCustomErrorBtnOnDark').addEventListener('click', () => {
|
|
324
307
|
elem.error = "Custom Error Message";
|
|
325
308
|
});
|
|
326
|
-
|
|
309
|
+
|
|
327
310
|
// remove custom error
|
|
328
|
-
document.querySelector('#setCustomErrorClearBtnOnDark').addEventListener('click', ()
|
|
311
|
+
document.querySelector('#setCustomErrorClearBtnOnDark').addEventListener('click', () => {
|
|
329
312
|
elem.removeAttribute('error');
|
|
330
313
|
});
|
|
331
|
-
}
|
|
332
|
-
```
|
|
314
|
+
}</code></pre>
|
|
333
315
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
334
316
|
</auro-accordion>
|
|
335
317
|
|
|
@@ -344,25 +326,23 @@ Default masking definitions:
|
|
|
344
326
|
See [IMask](https://imask.js.org/) for more information on how to configure a mask.
|
|
345
327
|
|
|
346
328
|
<div class="exampleWrapper">
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
329
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/format.html) -->
|
|
330
|
+
<!-- The below content is automatically added from ../apiExamples/format.html -->
|
|
331
|
+
<auro-input format="47440000">
|
|
332
|
+
<span slot="label">Custom format</span>
|
|
333
|
+
<span slot="helpText">Format is: 47440000</span>
|
|
334
|
+
</auro-input>
|
|
335
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
354
336
|
</div>
|
|
355
337
|
<auro-accordion alignRight>
|
|
356
|
-
|
|
338
|
+
<span slot="trigger">See code</span>
|
|
357
339
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/format.html) -->
|
|
358
340
|
<!-- The below code snippet is automatically added from ../apiExamples/format.html -->
|
|
359
341
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
</auro-input>
|
|
365
|
-
```
|
|
342
|
+
<pre class="language-html"><code class="language-html"><auro-input format="47440000">
|
|
343
|
+
<span slot="label">Custom format</span>
|
|
344
|
+
<span slot="helpText">Format is: 47440000</span>
|
|
345
|
+
</auro-input></code></pre>
|
|
366
346
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
367
347
|
</auro-accordion>
|
|
368
348
|
|
|
@@ -373,25 +353,23 @@ Set the `inputmode` for the input.
|
|
|
373
353
|
**IMPORTANT**: If you are also passing a `type`, most browsers will use the `type` attribute to determine what keyboard to display on mobile devices and ignore the `inputmode` attribute.
|
|
374
354
|
|
|
375
355
|
<div class="exampleWrapper">
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
356
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
357
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
358
|
+
<auro-input inputmode="tel">
|
|
359
|
+
<span slot="label">Telephone</span>
|
|
360
|
+
<span slot="helpText">Help Text</span>
|
|
361
|
+
</auro-input>
|
|
362
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
383
363
|
</div>
|
|
384
364
|
<auro-accordion alignRight>
|
|
385
|
-
|
|
365
|
+
<span slot="trigger">See code</span>
|
|
386
366
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
387
367
|
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
388
368
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
</auro-input>
|
|
394
|
-
```
|
|
369
|
+
<pre class="language-html"><code class="language-html"><auro-input inputmode="tel">
|
|
370
|
+
<span slot="label">Telephone</span>
|
|
371
|
+
<span slot="helpText">Help Text</span>
|
|
372
|
+
</auro-input></code></pre>
|
|
395
373
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
396
374
|
</auro-accordion>
|
|
397
375
|
|
|
@@ -404,50 +382,46 @@ The `setCustomValidityRangeOverflow` attribute may optionally be used in combina
|
|
|
404
382
|
#### Date Example
|
|
405
383
|
|
|
406
384
|
<div class="exampleWrapper">
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
385
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-date.html) -->
|
|
386
|
+
<!-- The below content is automatically added from ../apiExamples/max-date.html -->
|
|
387
|
+
<auro-input type="date" max="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
|
|
388
|
+
<span slot="label">Choose a date</span>
|
|
389
|
+
<span slot="helpText">Help Text</span>
|
|
390
|
+
</auro-input>
|
|
391
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
414
392
|
</div>
|
|
415
393
|
<auro-accordion alignRight>
|
|
416
|
-
|
|
394
|
+
<span slot="trigger">See code</span>
|
|
417
395
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-date.html) -->
|
|
418
396
|
<!-- The below code snippet is automatically added from ../apiExamples/max-date.html -->
|
|
419
397
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
</auro-input>
|
|
425
|
-
```
|
|
398
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" max="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
|
|
399
|
+
<span slot="label">Choose a date</span>
|
|
400
|
+
<span slot="helpText">Help Text</span>
|
|
401
|
+
</auro-input></code></pre>
|
|
426
402
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
427
403
|
</auro-accordion>
|
|
428
404
|
|
|
429
405
|
#### Number Example
|
|
430
406
|
|
|
431
407
|
<div class="exampleWrapper">
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
408
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-number.html) -->
|
|
409
|
+
<!-- The below content is automatically added from ../apiExamples/max-number.html -->
|
|
410
|
+
<auro-input type="number" max="10" setCustomValidityRangeOverflow="The selected value is above the defined maximum.">
|
|
411
|
+
<span slot="label">Choose a number</span>
|
|
412
|
+
<span slot="helpText">Help Text</span>
|
|
413
|
+
</auro-input>
|
|
414
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
439
415
|
</div>
|
|
440
416
|
<auro-accordion alignRight>
|
|
441
|
-
|
|
417
|
+
<span slot="trigger">See code</span>
|
|
442
418
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-number.html) -->
|
|
443
419
|
<!-- The below code snippet is automatically added from ../apiExamples/max-number.html -->
|
|
444
420
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
</auro-input>
|
|
450
|
-
```
|
|
421
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" max="10" setCustomValidityRangeOverflow="The selected value is above the defined maximum.">
|
|
422
|
+
<span slot="label">Choose a number</span>
|
|
423
|
+
<span slot="helpText">Help Text</span>
|
|
424
|
+
</auro-input></code></pre>
|
|
451
425
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
452
426
|
</auro-accordion>
|
|
453
427
|
|
|
@@ -460,25 +434,23 @@ The `setCustomValidityTooLong` attribute may optionally be used in combination w
|
|
|
460
434
|
**Note**: This attribute is not intended to be used with a `type` or `format` that already has a defined length, such as credit-cards, dates or phone numbers.
|
|
461
435
|
|
|
462
436
|
<div class="exampleWrapper">
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
437
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-length.html) -->
|
|
438
|
+
<!-- The below content is automatically added from ../apiExamples/max-length.html -->
|
|
439
|
+
<auro-input maxlength="12" setCustomValidityTooLong="Oops! There were too many characters entered." required>
|
|
440
|
+
<span slot="label">Voucher Code</span>
|
|
441
|
+
<span slot="helpText">Please enter your 12 character voucher code.</span>
|
|
442
|
+
</auro-input>
|
|
443
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
470
444
|
</div>
|
|
471
445
|
<auro-accordion alignRight>
|
|
472
|
-
|
|
446
|
+
<span slot="trigger">See code</span>
|
|
473
447
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-length.html) -->
|
|
474
448
|
<!-- The below code snippet is automatically added from ../apiExamples/max-length.html -->
|
|
475
449
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
</auro-input>
|
|
481
|
-
```
|
|
450
|
+
<pre class="language-html"><code class="language-html"><auro-input maxlength="12" setCustomValidityTooLong="Oops! There were too many characters entered." required>
|
|
451
|
+
<span slot="label">Voucher Code</span>
|
|
452
|
+
<span slot="helpText">Please enter your 12 character voucher code.</span>
|
|
453
|
+
</auro-input></code></pre>
|
|
482
454
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
483
455
|
</auro-accordion>
|
|
484
456
|
|
|
@@ -490,50 +462,46 @@ The `setCustomValidityRangeUnderflow` attribute may optionally be used in combin
|
|
|
490
462
|
#### Date Example
|
|
491
463
|
|
|
492
464
|
<div class="exampleWrapper">
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
465
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-date.html) -->
|
|
466
|
+
<!-- The below content is automatically added from ../apiExamples/min-date.html -->
|
|
467
|
+
<auro-input type="date" min="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
|
|
468
|
+
<span slot="label">Choose a date</span>
|
|
469
|
+
<span slot="helpText">Help Text</span>
|
|
470
|
+
</auro-input>
|
|
471
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
500
472
|
</div>
|
|
501
473
|
<auro-accordion alignRight>
|
|
502
|
-
|
|
474
|
+
<span slot="trigger">See code</span>
|
|
503
475
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-date.html) -->
|
|
504
476
|
<!-- The below code snippet is automatically added from ../apiExamples/min-date.html -->
|
|
505
477
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
</auro-input>
|
|
511
|
-
```
|
|
478
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" min="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
|
|
479
|
+
<span slot="label">Choose a date</span>
|
|
480
|
+
<span slot="helpText">Help Text</span>
|
|
481
|
+
</auro-input></code></pre>
|
|
512
482
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
513
483
|
</auro-accordion>
|
|
514
484
|
|
|
515
485
|
#### Number Example
|
|
516
486
|
|
|
517
487
|
<div class="exampleWrapper">
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
488
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-number.html) -->
|
|
489
|
+
<!-- The below content is automatically added from ../apiExamples/min-number.html -->
|
|
490
|
+
<auro-input type="number" min="10" setCustomValidityRangeUnderflow="The selected value is below the defined minimum.">
|
|
491
|
+
<span slot="label">Choose a number</span>
|
|
492
|
+
<span slot="helpText">Help Text</span>
|
|
493
|
+
</auro-input>
|
|
494
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
525
495
|
</div>
|
|
526
496
|
<auro-accordion alignRight>
|
|
527
|
-
|
|
497
|
+
<span slot="trigger">See code</span>
|
|
528
498
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-number.html) -->
|
|
529
499
|
<!-- The below code snippet is automatically added from ../apiExamples/min-number.html -->
|
|
530
500
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
</auro-input>
|
|
536
|
-
```
|
|
501
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" min="10" setCustomValidityRangeUnderflow="The selected value is below the defined minimum.">
|
|
502
|
+
<span slot="label">Choose a number</span>
|
|
503
|
+
<span slot="helpText">Help Text</span>
|
|
504
|
+
</auro-input></code></pre>
|
|
537
505
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
538
506
|
</auro-accordion>
|
|
539
507
|
|
|
@@ -544,25 +512,23 @@ Use the `minlength` attribute to control the length of the input entered.
|
|
|
544
512
|
The `setCustomValidityTooShort` attribute may optionally be used in combination with the `minLength` attribute to define custom help text used when the length of the input is not long enough.
|
|
545
513
|
|
|
546
514
|
<div class="exampleWrapper">
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
515
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-length.html) -->
|
|
516
|
+
<!-- The below content is automatically added from ../apiExamples/min-length.html -->
|
|
517
|
+
<auro-input minlength="4" setCustomValidityTooShort="Please enter a full voucher code." required>
|
|
518
|
+
<span slot="label">Voucher Code</span>
|
|
519
|
+
<span slot="helpText">Please enter your 4 character voucher code.</span>
|
|
520
|
+
</auro-input>
|
|
521
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
554
522
|
</div>
|
|
555
523
|
<auro-accordion alignRight>
|
|
556
|
-
|
|
524
|
+
<span slot="trigger">See code</span>
|
|
557
525
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-length.html) -->
|
|
558
526
|
<!-- The below code snippet is automatically added from ../apiExamples/min-length.html -->
|
|
559
527
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
</auro-input>
|
|
565
|
-
```
|
|
528
|
+
<pre class="language-html"><code class="language-html"><auro-input minlength="4" setCustomValidityTooShort="Please enter a full voucher code." required>
|
|
529
|
+
<span slot="label">Voucher Code</span>
|
|
530
|
+
<span slot="helpText">Please enter your 4 character voucher code.</span>
|
|
531
|
+
</auro-input></code></pre>
|
|
566
532
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
567
533
|
</auro-accordion>
|
|
568
534
|
|
|
@@ -571,25 +537,23 @@ The `setCustomValidityTooShort` attribute may optionally be used in combination
|
|
|
571
537
|
For use cases where the field is `required`, but live validation is not wanted, use the `noValidate` attribute.
|
|
572
538
|
|
|
573
539
|
<div class="exampleWrapper">
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
540
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/no-validate.html) -->
|
|
541
|
+
<!-- The below content is automatically added from ../apiExamples/no-validate.html -->
|
|
542
|
+
<auro-input noValidate required>
|
|
543
|
+
<span slot="label">Address</span>
|
|
544
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
545
|
+
</auro-input>
|
|
546
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
581
547
|
</div>
|
|
582
548
|
<auro-accordion alignRight>
|
|
583
|
-
|
|
549
|
+
<span slot="trigger">See code</span>
|
|
584
550
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/no-validate.html) -->
|
|
585
551
|
<!-- The below code snippet is automatically added from ../apiExamples/no-validate.html -->
|
|
586
552
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
</auro-input>
|
|
592
|
-
```
|
|
553
|
+
<pre class="language-html"><code class="language-html"><auro-input noValidate required>
|
|
554
|
+
<span slot="label">Address</span>
|
|
555
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
556
|
+
</auro-input></code></pre>
|
|
593
557
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
594
558
|
</auro-accordion>
|
|
595
559
|
|
|
@@ -599,25 +563,23 @@ Use the `pattern` attribute to set custom input validation. This example also us
|
|
|
599
563
|
The `<auro-input>` component supports setting a custom validity message specific to the pattern validation by using the `setCustomValidityPatternMismatch` attribute.
|
|
600
564
|
|
|
601
565
|
<div class="exampleWrapper">
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
566
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/pattern.html) -->
|
|
567
|
+
<!-- The below content is automatically added from ../apiExamples/pattern.html -->
|
|
568
|
+
<auro-input pattern="[a-z]{1,15}" spellcheck="false" setCustomValidityPatternMismatch="Only contain lowercase letters w/no spaces">
|
|
569
|
+
<span slot="label">Username</span>
|
|
570
|
+
<span slot="helpText">Please enter a username.</span>
|
|
571
|
+
</auro-input>
|
|
572
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
609
573
|
</div>
|
|
610
574
|
<auro-accordion alignRight>
|
|
611
|
-
|
|
575
|
+
<span slot="trigger">See code</span>
|
|
612
576
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/pattern.html) -->
|
|
613
577
|
<!-- The below code snippet is automatically added from ../apiExamples/pattern.html -->
|
|
614
578
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
</auro-input>
|
|
620
|
-
```
|
|
579
|
+
<pre class="language-html"><code class="language-html"><auro-input pattern="[a-z]{1,15}" spellcheck="false" setCustomValidityPatternMismatch="Only contain lowercase letters w/no spaces">
|
|
580
|
+
<span slot="label">Username</span>
|
|
581
|
+
<span slot="helpText">Please enter a username.</span>
|
|
582
|
+
</auro-input></code></pre>
|
|
621
583
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
622
584
|
</auro-accordion>
|
|
623
585
|
|
|
@@ -626,25 +588,23 @@ The `<auro-input>` component supports setting a custom validity message specific
|
|
|
626
588
|
Use the `placeholder` attribute to add a custom placeholder message within the element.
|
|
627
589
|
|
|
628
590
|
<div class="exampleWrapper">
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
591
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/placeholder.html) -->
|
|
592
|
+
<!-- The below content is automatically added from ../apiExamples/placeholder.html -->
|
|
593
|
+
<auro-input placeholder="John Doe" required>
|
|
594
|
+
<span slot="label">Full name</span>
|
|
595
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
596
|
+
</auro-input>
|
|
597
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
636
598
|
</div>
|
|
637
599
|
<auro-accordion alignRight>
|
|
638
|
-
|
|
600
|
+
<span slot="trigger">See code</span>
|
|
639
601
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/placeholder.html) -->
|
|
640
602
|
<!-- The below code snippet is automatically added from ../apiExamples/placeholder.html -->
|
|
641
603
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
</auro-input>
|
|
647
|
-
```
|
|
604
|
+
<pre class="language-html"><code class="language-html"><auro-input placeholder="John Doe" required>
|
|
605
|
+
<span slot="label">Full name</span>
|
|
606
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
607
|
+
</auro-input></code></pre>
|
|
648
608
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
649
609
|
</auro-accordion>
|
|
650
610
|
|
|
@@ -655,49 +615,45 @@ Use the `readonly` attribute to prevent the user from editing the value of the i
|
|
|
655
615
|
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.
|
|
656
616
|
|
|
657
617
|
<div class="exampleWrapper">
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
618
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/readonly.html) -->
|
|
619
|
+
<!-- The below content is automatically added from ../apiExamples/readonly.html -->
|
|
620
|
+
<auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
621
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
622
|
+
<br /><br />
|
|
623
|
+
<auro-input readonly id="readonlyExample">
|
|
624
|
+
<span slot="label">Name</span>
|
|
625
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
626
|
+
</auro-input>
|
|
627
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
668
628
|
</div>
|
|
669
629
|
<auro-accordion alignRight>
|
|
670
|
-
|
|
630
|
+
<span slot="trigger">See code</span>
|
|
671
631
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.html) -->
|
|
672
632
|
<!-- The below code snippet is automatically added from ../apiExamples/readonly.html -->
|
|
673
633
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
</auro-input>
|
|
682
|
-
```
|
|
634
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
635
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
636
|
+
<br /><br />
|
|
637
|
+
<auro-input readonly id="readonlyExample">
|
|
638
|
+
<span slot="label">Name</span>
|
|
639
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
640
|
+
</auro-input></code></pre>
|
|
683
641
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
684
642
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.js) -->
|
|
685
643
|
<!-- The below code snippet is automatically added from ../apiExamples/readonly.js -->
|
|
686
644
|
|
|
687
|
-
|
|
688
|
-
export function setReadonlyValue() {
|
|
645
|
+
<pre class="language-js"><code class="language-js">export function setReadonlyValue() {
|
|
689
646
|
const elem = document.querySelector('#readonlyExample');
|
|
690
|
-
|
|
647
|
+
|
|
691
648
|
// set value of auro-input element
|
|
692
|
-
document.querySelector('#setReadonlyValueBtn').addEventListener('click', ()
|
|
649
|
+
document.querySelector('#setReadonlyValueBtn').addEventListener('click', () => {
|
|
693
650
|
elem.value = "Auro Alaska";
|
|
694
651
|
});
|
|
695
|
-
|
|
696
|
-
document.querySelector('#resetReadonlyValueBtn').addEventListener('click', ()
|
|
652
|
+
|
|
653
|
+
document.querySelector('#resetReadonlyValueBtn').addEventListener('click', () => {
|
|
697
654
|
elem.value = undefined;
|
|
698
655
|
});
|
|
699
|
-
}
|
|
700
|
-
```
|
|
656
|
+
}</code></pre>
|
|
701
657
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
702
658
|
</auro-accordion>
|
|
703
659
|
|
|
@@ -708,25 +664,23 @@ When present, the `required` attribute specifies that an input field must be fil
|
|
|
708
664
|
When the validity check fails, the validityState equals `valueMissing`. The error message for the `valueMissing` validityState can be changed to a custom string using the `setCustomValidityValueMissing`.
|
|
709
665
|
|
|
710
666
|
<div class="exampleWrapper">
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
667
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/required.html) -->
|
|
668
|
+
<!-- The below content is automatically added from ../apiExamples/required.html -->
|
|
669
|
+
<auro-input required placeholder="John Doe">
|
|
670
|
+
<span slot="label">Full name</span>
|
|
671
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
672
|
+
</auro-input>
|
|
673
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
718
674
|
</div>
|
|
719
675
|
<auro-accordion alignRight>
|
|
720
|
-
|
|
676
|
+
<span slot="trigger">See code</span>
|
|
721
677
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/required.html) -->
|
|
722
678
|
<!-- The below code snippet is automatically added from ../apiExamples/required.html -->
|
|
723
679
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
</auro-input>
|
|
729
|
-
```
|
|
680
|
+
<pre class="language-html"><code class="language-html"><auro-input required placeholder="John Doe">
|
|
681
|
+
<span slot="label">Full name</span>
|
|
682
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
683
|
+
</auro-input></code></pre>
|
|
730
684
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
731
685
|
</auro-accordion>
|
|
732
686
|
|
|
@@ -737,25 +691,23 @@ The `setCustomValidity` attribute can be used to set a custom string for all val
|
|
|
737
691
|
**NOTE:** Custom strings are NOT localized. It is the responsibility of the element consumer to provide localized strings when using this element property.
|
|
738
692
|
|
|
739
693
|
<div class="exampleWrapper">
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
694
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity.html) -->
|
|
695
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
696
|
+
<auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
697
|
+
<span slot="label">Full Name</span>
|
|
698
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
699
|
+
</auro-input>
|
|
700
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
747
701
|
</div>
|
|
748
702
|
<auro-accordion alignRight>
|
|
749
|
-
|
|
703
|
+
<span slot="trigger">See code</span>
|
|
750
704
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity.html) -->
|
|
751
705
|
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
752
706
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
</auro-input>
|
|
758
|
-
```
|
|
707
|
+
<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).">
|
|
708
|
+
<span slot="label">Full Name</span>
|
|
709
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
710
|
+
</auro-input></code></pre>
|
|
759
711
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
760
712
|
</auro-accordion>
|
|
761
713
|
|
|
@@ -768,53 +720,49 @@ Use the `type="password"` attribute for a password style input. The hide/show pa
|
|
|
768
720
|
Default help text will be added to the input `type="password"` if custom help text is not provided. See the example below.
|
|
769
721
|
|
|
770
722
|
<div class="exampleWrapper">
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
723
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/password.html) -->
|
|
724
|
+
<!-- The below content is automatically added from ../apiExamples/password.html -->
|
|
725
|
+
<auro-input type="password" required>
|
|
726
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
727
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
728
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
729
|
+
<span slot="label">Password</span>
|
|
730
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
731
|
+
</auro-input>
|
|
732
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
781
733
|
</div>
|
|
782
734
|
<auro-accordion alignRight>
|
|
783
|
-
|
|
735
|
+
<span slot="trigger">See code</span>
|
|
784
736
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/password.html) -->
|
|
785
737
|
<!-- The below code snippet is automatically added from ../apiExamples/password.html -->
|
|
786
738
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
</auro-input>
|
|
795
|
-
```
|
|
739
|
+
<pre class="language-html"><code class="language-html"><auro-input type="password" required>
|
|
740
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
741
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
742
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
743
|
+
<span slot="label">Password</span>
|
|
744
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
745
|
+
</auro-input></code></pre>
|
|
796
746
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
797
747
|
</auro-accordion>
|
|
798
748
|
<div class="exampleWrapper--ondark" aria-hidden>
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
749
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/appearance-inverse-password.html) -->
|
|
750
|
+
<!-- The below content is automatically added from ../apiExamples/appearance-inverse-password.html -->
|
|
751
|
+
<auro-input appearance="inverse" type="password" required>
|
|
752
|
+
<span slot="label">Password</span>
|
|
753
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
754
|
+
</auro-input>
|
|
755
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
806
756
|
</div>
|
|
807
757
|
<auro-accordion alignRight>
|
|
808
|
-
|
|
758
|
+
<span slot="trigger">See code</span>
|
|
809
759
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/appearance-inverse-password.html) -->
|
|
810
760
|
<!-- The below code snippet is automatically added from ../apiExamples/appearance-inverse-password.html -->
|
|
811
761
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
</auro-input>
|
|
817
|
-
```
|
|
762
|
+
<pre class="language-html"><code class="language-html"><auro-input appearance="inverse" type="password" required>
|
|
763
|
+
<span slot="label">Password</span>
|
|
764
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
765
|
+
</auro-input></code></pre>
|
|
818
766
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
819
767
|
</auro-accordion>
|
|
820
768
|
|
|
@@ -825,25 +773,23 @@ Use the `type="email"` attribute for a email style input. These examples illustr
|
|
|
825
773
|
Default help text will be added to the input `type="email"` if custom help text is not provided. See the example below.
|
|
826
774
|
|
|
827
775
|
<div class="exampleWrapper">
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
776
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/email.html) -->
|
|
777
|
+
<!-- The below content is automatically added from ../apiExamples/email.html -->
|
|
778
|
+
<auro-input type="email" required>
|
|
779
|
+
<span slot="label">Email address</span>
|
|
780
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
781
|
+
</auro-input>
|
|
782
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
835
783
|
</div>
|
|
836
784
|
<auro-accordion alignRight>
|
|
837
|
-
|
|
785
|
+
<span slot="trigger">See code</span>
|
|
838
786
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/email.html) -->
|
|
839
787
|
<!-- The below code snippet is automatically added from ../apiExamples/email.html -->
|
|
840
788
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
</auro-input>
|
|
846
|
-
```
|
|
789
|
+
<pre class="language-html"><code class="language-html"><auro-input type="email" required>
|
|
790
|
+
<span slot="label">Email address</span>
|
|
791
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
792
|
+
</auro-input></code></pre>
|
|
847
793
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
848
794
|
</auro-accordion>
|
|
849
795
|
|
|
@@ -854,25 +800,23 @@ Use the `type="number"` attribute for a numeric style input and invoke a numeric
|
|
|
854
800
|
This `number` input type should only be used for incremental numeric values, meaning values with decimals will be considered invalid. The `number` input type is not appropriate for values that happen to only consist of but aren't strictly speaking a number, such as postal codes in many countries or credit card numbers. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) for more information.
|
|
855
801
|
|
|
856
802
|
<div class="exampleWrapper">
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
803
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/number.html) -->
|
|
804
|
+
<!-- The below content is automatically added from ../apiExamples/number.html -->
|
|
805
|
+
<auro-input type="number" required>
|
|
806
|
+
<span slot="label">Number of Passengers</span>
|
|
807
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
808
|
+
</auro-input>
|
|
809
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
864
810
|
</div>
|
|
865
811
|
<auro-accordion alignRight>
|
|
866
|
-
|
|
812
|
+
<span slot="trigger">See code</span>
|
|
867
813
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/number.html) -->
|
|
868
814
|
<!-- The below code snippet is automatically added from ../apiExamples/number.html -->
|
|
869
815
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
</auro-input>
|
|
875
|
-
```
|
|
816
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" required>
|
|
817
|
+
<span slot="label">Number of Passengers</span>
|
|
818
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
819
|
+
</auro-input></code></pre>
|
|
876
820
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
877
821
|
</auro-accordion>
|
|
878
822
|
|
|
@@ -883,25 +827,23 @@ Use the `type="credit-card"` attribute for a credit card formatted input.
|
|
|
883
827
|
Default help text will be added to the input `type="credit-card"` if custom help text is not provided. See the example below.
|
|
884
828
|
|
|
885
829
|
<div class="exampleWrapper">
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
830
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/credit-card.html) -->
|
|
831
|
+
<!-- The below content is automatically added from ../apiExamples/credit-card.html -->
|
|
832
|
+
<auro-input type="credit-card" required>
|
|
833
|
+
<span slot="label">Card number</span>
|
|
834
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
835
|
+
</auro-input>
|
|
836
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
893
837
|
</div>
|
|
894
838
|
<auro-accordion alignRight>
|
|
895
|
-
|
|
839
|
+
<span slot="trigger">See code</span>
|
|
896
840
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/credit-card.html) -->
|
|
897
841
|
<!-- The below code snippet is automatically added from ../apiExamples/credit-card.html -->
|
|
898
842
|
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
</auro-input>
|
|
904
|
-
```
|
|
843
|
+
<pre class="language-html"><code class="language-html"><auro-input type="credit-card" required>
|
|
844
|
+
<span slot="label">Card number</span>
|
|
845
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
846
|
+
</auro-input></code></pre>
|
|
905
847
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
906
848
|
</auro-accordion>
|
|
907
849
|
Use the `type="credit-card"` and `icon` attributes for a credit card formatted input with credit card icon support.
|
|
@@ -909,26 +851,24 @@ Use the `type="credit-card"` and `icon` attributes for a credit card formatted i
|
|
|
909
851
|
**Dependency**: Please be sure to also install [auro-icon](https://auro.alaskaair.com/components/auro/icon/install) as a peer dependency.
|
|
910
852
|
|
|
911
853
|
<div class="exampleWrapper">
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
854
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/credit-card-icon.html) -->
|
|
855
|
+
<!-- The below content is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
856
|
+
<auro-input icon type="credit-card" required>
|
|
857
|
+
<span slot="label">Card number</span>
|
|
858
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
859
|
+
</auro-input>
|
|
860
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
919
861
|
</div>
|
|
920
862
|
<auro-accordion alignRight>
|
|
921
|
-
|
|
863
|
+
<span slot="trigger">See code</span>
|
|
922
864
|
// Use 4147 3411 1111 1111 to see the Alaska Airline's credit card!
|
|
923
865
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/credit-card-icon.html) -->
|
|
924
866
|
<!-- The below code snippet is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
925
867
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
</auro-input>
|
|
931
|
-
```
|
|
868
|
+
<pre class="language-html"><code class="language-html"><auro-input icon type="credit-card" required>
|
|
869
|
+
<span slot="label">Card number</span>
|
|
870
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
871
|
+
</auro-input></code></pre>
|
|
932
872
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
933
873
|
</auro-accordion>
|
|
934
874
|
|
|
@@ -937,25 +877,23 @@ Use the `type="credit-card"` and `icon` attributes for a credit card formatted i
|
|
|
937
877
|
Use the `type="tel"` attribute for a phone number formatted input. The default format is `+1 (000) 000-0000`.
|
|
938
878
|
|
|
939
879
|
<div class="exampleWrapper">
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
880
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel.html) -->
|
|
881
|
+
<!-- The below content is automatically added from ../apiExamples/tel.html -->
|
|
882
|
+
<auro-input type="tel">
|
|
883
|
+
<span slot="label">Telephone</span>
|
|
884
|
+
<span slot="helpText">Help Text</span>
|
|
885
|
+
</auro-input>
|
|
886
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
947
887
|
</div>
|
|
948
888
|
<auro-accordion alignRight>
|
|
949
|
-
|
|
889
|
+
<span slot="trigger">See code</span>
|
|
950
890
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel.html) -->
|
|
951
891
|
<!-- The below code snippet is automatically added from ../apiExamples/tel.html -->
|
|
952
892
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
</auro-input>
|
|
958
|
-
```
|
|
893
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel">
|
|
894
|
+
<span slot="label">Telephone</span>
|
|
895
|
+
<span slot="helpText">Help Text</span>
|
|
896
|
+
</auro-input></code></pre>
|
|
959
897
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
960
898
|
</auro-accordion>
|
|
961
899
|
|
|
@@ -964,25 +902,23 @@ Use the `type="tel"` attribute for a phone number formatted input. The default f
|
|
|
964
902
|
Use the `format` attribute to set a custom phone number format.
|
|
965
903
|
|
|
966
904
|
<div class="exampleWrapper">
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
905
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel-format.html) -->
|
|
906
|
+
<!-- The below content is automatically added from ../apiExamples/tel-format.html -->
|
|
907
|
+
<auro-input type="tel" format="+00 000 00 0000">
|
|
908
|
+
<span slot="label">Telephone</span>
|
|
909
|
+
<span slot="helpText">Help Text</span>
|
|
910
|
+
</auro-input>
|
|
911
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
974
912
|
</div>
|
|
975
913
|
<auro-accordion alignRight>
|
|
976
|
-
|
|
914
|
+
<span slot="trigger">See code</span>
|
|
977
915
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel-format.html) -->
|
|
978
916
|
<!-- The below code snippet is automatically added from ../apiExamples/tel-format.html -->
|
|
979
917
|
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
</auro-input>
|
|
985
|
-
```
|
|
918
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel" format="+00 000 00 0000">
|
|
919
|
+
<span slot="label">Telephone</span>
|
|
920
|
+
<span slot="helpText">Help Text</span>
|
|
921
|
+
</auro-input></code></pre>
|
|
986
922
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
987
923
|
</auro-accordion>
|
|
988
924
|
|
|
@@ -991,25 +927,23 @@ Use the `format` attribute to set a custom phone number format.
|
|
|
991
927
|
Use the `type="date"` attribute for a date formatted input. The default date format is `mm/dd/yyyy`.
|
|
992
928
|
|
|
993
929
|
<div class="exampleWrapper">
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
930
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/month-day-year.html) -->
|
|
931
|
+
<!-- The below content is automatically added from ../apiExamples/month-day-year.html -->
|
|
932
|
+
<auro-input type="date">
|
|
933
|
+
<span slot="label">Arrival date</span>
|
|
934
|
+
<span slot="helpText">Help Text</span>
|
|
935
|
+
</auro-input>
|
|
936
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1001
937
|
</div>
|
|
1002
938
|
<auro-accordion alignRight>
|
|
1003
|
-
|
|
939
|
+
<span slot="trigger">See code</span>
|
|
1004
940
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/month-day-year.html) -->
|
|
1005
941
|
<!-- The below code snippet is automatically added from ../apiExamples/month-day-year.html -->
|
|
1006
942
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
</auro-input>
|
|
1012
|
-
```
|
|
943
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date">
|
|
944
|
+
<span slot="label">Arrival date</span>
|
|
945
|
+
<span slot="helpText">Help Text</span>
|
|
946
|
+
</auro-input></code></pre>
|
|
1013
947
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1014
948
|
</auro-accordion>
|
|
1015
949
|
|
|
@@ -1018,69 +952,63 @@ Use the `type="date"` attribute for a date formatted input. The default date for
|
|
|
1018
952
|
Use the `format` attribute to put together any combination of `mm`, `dd`, & `yyyy` or `yy`.
|
|
1019
953
|
|
|
1020
954
|
<div class="exampleWrapper">
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
955
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/year-month-day.html) -->
|
|
956
|
+
<!-- The below content is automatically added from ../apiExamples/year-month-day.html -->
|
|
957
|
+
<auro-input type="date" format="yyyy/mm/dd">
|
|
958
|
+
<span slot="label">Arrival date</span>
|
|
959
|
+
<span slot="helpText">Help Text</span>
|
|
960
|
+
</auro-input>
|
|
961
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1028
962
|
</div>
|
|
1029
963
|
<auro-accordion alignRight>
|
|
1030
|
-
|
|
964
|
+
<span slot="trigger">See code</span>
|
|
1031
965
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/year-month-day.html) -->
|
|
1032
966
|
<!-- The below code snippet is automatically added from ../apiExamples/year-month-day.html -->
|
|
1033
967
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
</auro-input>
|
|
1039
|
-
```
|
|
968
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="yyyy/mm/dd">
|
|
969
|
+
<span slot="label">Arrival date</span>
|
|
970
|
+
<span slot="helpText">Help Text</span>
|
|
971
|
+
</auro-input></code></pre>
|
|
1040
972
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1041
973
|
</auro-accordion>
|
|
1042
974
|
<div class="exampleWrapper">
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
975
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/month-year.html) -->
|
|
976
|
+
<!-- The below content is automatically added from ../apiExamples/month-year.html -->
|
|
977
|
+
<auro-input type="date" format="mm/yy">
|
|
978
|
+
<span slot="label">Expiration date</span>
|
|
979
|
+
<span slot="helpText">Help Text</span>
|
|
980
|
+
</auro-input>
|
|
981
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1050
982
|
</div>
|
|
1051
983
|
<auro-accordion alignRight>
|
|
1052
|
-
|
|
984
|
+
<span slot="trigger">See code</span>
|
|
1053
985
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/month-year.html) -->
|
|
1054
986
|
<!-- The below code snippet is automatically added from ../apiExamples/month-year.html -->
|
|
1055
987
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
</auro-input>
|
|
1061
|
-
```
|
|
988
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="mm/yy">
|
|
989
|
+
<span slot="label">Expiration date</span>
|
|
990
|
+
<span slot="helpText">Help Text</span>
|
|
991
|
+
</auro-input></code></pre>
|
|
1062
992
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1063
993
|
</auro-accordion>
|
|
1064
994
|
<div class="exampleWrapper">
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
995
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/day.html) -->
|
|
996
|
+
<!-- The below content is automatically added from ../apiExamples/day.html -->
|
|
997
|
+
<auro-input type="date" format="dd">
|
|
998
|
+
<span slot="label">Day</span>
|
|
999
|
+
<span slot="helpText">Help Text</span>
|
|
1000
|
+
</auro-input>
|
|
1001
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1072
1002
|
</div>
|
|
1073
1003
|
<auro-accordion alignRight>
|
|
1074
|
-
|
|
1004
|
+
<span slot="trigger">See code</span>
|
|
1075
1005
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/day.html) -->
|
|
1076
1006
|
<!-- The below code snippet is automatically added from ../apiExamples/day.html -->
|
|
1077
1007
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
</auro-input>
|
|
1083
|
-
```
|
|
1008
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="dd">
|
|
1009
|
+
<span slot="label">Day</span>
|
|
1010
|
+
<span slot="helpText">Help Text</span>
|
|
1011
|
+
</auro-input></code></pre>
|
|
1084
1012
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1085
1013
|
</auro-accordion>
|
|
1086
1014
|
|
|
@@ -1089,25 +1017,23 @@ Use the `format` attribute to put together any combination of `mm`, `dd`, & `yyy
|
|
|
1089
1017
|
Use the `validateOnInput` attribute to enable live validation on the `input` event. Recommended use is with setting a custom `pattern` and validation is required prior to a `blur` event.
|
|
1090
1018
|
|
|
1091
1019
|
<div class="exampleWrapper">
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1020
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/validate-on-input.html) -->
|
|
1021
|
+
<!-- The below content is automatically added from ../apiExamples/validate-on-input.html -->
|
|
1022
|
+
<auro-input validateOnInput required pattern="[a-zA-Z-.']+( +[a-zA-Z-.']+)+" setCustomValidityPatternMismatch="Full name requires two or more names with at least one space.">
|
|
1023
|
+
<span slot="label">Full Name</span>
|
|
1024
|
+
<span slot="helpText">Please enter your full name as it appears on the card.</span>
|
|
1025
|
+
</auro-input>
|
|
1026
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1099
1027
|
</div>
|
|
1100
1028
|
<auro-accordion alignRight>
|
|
1101
|
-
|
|
1029
|
+
<span slot="trigger">See code</span>
|
|
1102
1030
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/validate-on-input.html) -->
|
|
1103
1031
|
<!-- The below code snippet is automatically added from ../apiExamples/validate-on-input.html -->
|
|
1104
1032
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
</auro-input>
|
|
1110
|
-
```
|
|
1033
|
+
<pre class="language-html"><code class="language-html"><auro-input validateOnInput required pattern="[a-zA-Z-.']+( +[a-zA-Z-.']+)+" setCustomValidityPatternMismatch="Full name requires two or more names with at least one space.">
|
|
1034
|
+
<span slot="label">Full Name</span>
|
|
1035
|
+
<span slot="helpText">Please enter your full name as it appears on the card.</span>
|
|
1036
|
+
</auro-input></code></pre>
|
|
1111
1037
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1112
1038
|
</auro-accordion>
|
|
1113
1039
|
|
|
@@ -1115,25 +1041,23 @@ Use the `validateOnInput` attribute to enable live validation on the `input` eve
|
|
|
1115
1041
|
Use the `value` attribute to programmatically set the value of the input.
|
|
1116
1042
|
|
|
1117
1043
|
<div class="exampleWrapper">
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1044
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/programmatic-value.html) -->
|
|
1045
|
+
<!-- The below content is automatically added from ../apiExamples/programmatic-value.html -->
|
|
1046
|
+
<auro-input value="Alaska Airlines is the best!">
|
|
1047
|
+
<span slot="label">Name</span>
|
|
1048
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1049
|
+
</auro-input>
|
|
1050
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1125
1051
|
</div>
|
|
1126
1052
|
<auro-accordion alignRight>
|
|
1127
|
-
|
|
1053
|
+
<span slot="trigger">See code</span>
|
|
1128
1054
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/programmatic-value.html) -->
|
|
1129
1055
|
<!-- The below code snippet is automatically added from ../apiExamples/programmatic-value.html -->
|
|
1130
1056
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
</auro-input>
|
|
1136
|
-
```
|
|
1057
|
+
<pre class="language-html"><code class="language-html"><auro-input value="Alaska Airlines is the best!">
|
|
1058
|
+
<span slot="label">Name</span>
|
|
1059
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1060
|
+
</auro-input></code></pre>
|
|
1137
1061
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1138
1062
|
</auro-accordion>
|
|
1139
1063
|
|
|
@@ -1144,50 +1068,46 @@ Use the `value` and other components to dynamically set the value of the input.
|
|
|
1144
1068
|
Note: Setting the `value` to `undefined` will also reset the element.
|
|
1145
1069
|
|
|
1146
1070
|
<div class="exampleWrapper">
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1071
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/value.html) -->
|
|
1072
|
+
<!-- The below content is automatically added from ../apiExamples/value.html -->
|
|
1073
|
+
<auro-button id="setValidValueBtn">Set Value to Alaska</auro-button>
|
|
1074
|
+
<auro-button id="setUndefinedValueBtn">Set Value to Undefined</auro-button>
|
|
1075
|
+
<br /><br />
|
|
1076
|
+
<auro-input id="setProgrammaticValueExample" value="Press one of the buttons above!">
|
|
1077
|
+
<span slot="label">Name</span>
|
|
1078
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1079
|
+
</auro-input>
|
|
1080
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1157
1081
|
</div>
|
|
1158
1082
|
<auro-accordion alignRight>
|
|
1159
|
-
|
|
1083
|
+
<span slot="trigger">See code</span>
|
|
1160
1084
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/value.html) -->
|
|
1161
1085
|
<!-- The below code snippet is automatically added from ../apiExamples/value.html -->
|
|
1162
1086
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
</auro-input>
|
|
1171
|
-
```
|
|
1087
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setValidValueBtn">Set Value to Alaska</auro-button>
|
|
1088
|
+
<auro-button id="setUndefinedValueBtn">Set Value to Undefined</auro-button>
|
|
1089
|
+
<br /><br />
|
|
1090
|
+
<auro-input id="setProgrammaticValueExample" value="Press one of the buttons above!">
|
|
1091
|
+
<span slot="label">Name</span>
|
|
1092
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1093
|
+
</auro-input></code></pre>
|
|
1172
1094
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1173
1095
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/value.js) -->
|
|
1174
1096
|
<!-- The below code snippet is automatically added from ../apiExamples/value.js -->
|
|
1175
1097
|
|
|
1176
|
-
|
|
1177
|
-
export function programmaticallySetValue() {
|
|
1098
|
+
<pre class="language-js"><code class="language-js">export function programmaticallySetValue() {
|
|
1178
1099
|
const elem = document.querySelector('#setProgrammaticValueExample');
|
|
1179
|
-
|
|
1100
|
+
|
|
1180
1101
|
// set value of auro-input element
|
|
1181
|
-
document.querySelector('#setValidValueBtn').addEventListener('click', ()
|
|
1102
|
+
document.querySelector('#setValidValueBtn').addEventListener('click', () => {
|
|
1182
1103
|
elem.value = "Alaska Airlines is the best";
|
|
1183
1104
|
});
|
|
1184
|
-
|
|
1105
|
+
|
|
1185
1106
|
// reset the value of auro-input element
|
|
1186
|
-
document.querySelector('#setUndefinedValueBtn').addEventListener('click', ()
|
|
1107
|
+
document.querySelector('#setUndefinedValueBtn').addEventListener('click', () => {
|
|
1187
1108
|
elem.value = undefined;
|
|
1188
1109
|
});
|
|
1189
|
-
}
|
|
1190
|
-
```
|
|
1110
|
+
}</code></pre>
|
|
1191
1111
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1192
1112
|
</auro-accordion>
|
|
1193
1113
|
|
|
@@ -1198,42 +1118,38 @@ export function programmaticallySetValue() {
|
|
|
1198
1118
|
Use the `reset()` method to reset the `<auro-input>`'s `value` and `validity` state. Doing so will preserve all other attributes and properties.
|
|
1199
1119
|
|
|
1200
1120
|
<div class="exampleWrapper">
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1121
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/reset-state.html) -->
|
|
1122
|
+
<!-- The below content is automatically added from ../apiExamples/reset-state.html -->
|
|
1123
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1124
|
+
<br /><br />
|
|
1125
|
+
<auro-input id="resetStateExample" minlength="12" value="Auro Team" setCustomValidityTooShort="Please enter your full name!">
|
|
1126
|
+
<span slot="label">Full Name</span>
|
|
1127
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1128
|
+
</auro-input>
|
|
1129
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1210
1130
|
</div>
|
|
1211
1131
|
<auro-accordion alignRight>
|
|
1212
|
-
|
|
1132
|
+
<span slot="trigger">See code</span>
|
|
1213
1133
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/reset-state.html) -->
|
|
1214
1134
|
<!-- The below code snippet is automatically added from ../apiExamples/reset-state.html -->
|
|
1215
1135
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
</auro-input>
|
|
1223
|
-
```
|
|
1136
|
+
<pre class="language-html"><code class="language-html"><auro-button id="resetStateBtn">Reset</auro-button>
|
|
1137
|
+
<br /><br />
|
|
1138
|
+
<auro-input id="resetStateExample" minlength="12" value="Auro Team" setCustomValidityTooShort="Please enter your full name!">
|
|
1139
|
+
<span slot="label">Full Name</span>
|
|
1140
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1141
|
+
</auro-input></code></pre>
|
|
1224
1142
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1225
1143
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/reset-state.js) -->
|
|
1226
1144
|
<!-- The below code snippet is automatically added from ../apiExamples/reset-state.js -->
|
|
1227
1145
|
|
|
1228
|
-
|
|
1229
|
-
export function resetStateExample() {
|
|
1146
|
+
<pre class="language-js"><code class="language-js">export function resetStateExample() {
|
|
1230
1147
|
const elem = document.querySelector('#resetStateExample');
|
|
1231
|
-
|
|
1232
|
-
document.querySelector('#resetStateBtn').addEventListener('click', ()
|
|
1148
|
+
|
|
1149
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1233
1150
|
elem.reset();
|
|
1234
1151
|
});
|
|
1235
|
-
}
|
|
1236
|
-
```
|
|
1152
|
+
}</code></pre>
|
|
1237
1153
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1238
1154
|
</auro-accordion>
|
|
1239
1155
|
|
|
@@ -1244,27 +1160,25 @@ export function resetStateExample() {
|
|
|
1244
1160
|
The `<auro-input>` supports an `optionalLabel` slot, where users can can override the default `(optional)` notification text.
|
|
1245
1161
|
|
|
1246
1162
|
<div class="exampleWrapper">
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1163
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/optional-label.html) -->
|
|
1164
|
+
<!-- The below content is automatically added from ./../apiExamples/optional-label.html -->
|
|
1165
|
+
<auro-input placeholder="John Doe" bordered>
|
|
1166
|
+
<span slot="label">Full name</span>
|
|
1167
|
+
<span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
|
|
1168
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1169
|
+
</auro-input>
|
|
1170
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1255
1171
|
</div>
|
|
1256
1172
|
<auro-accordion alignRight>
|
|
1257
|
-
|
|
1173
|
+
<span slot="trigger">See code</span>
|
|
1258
1174
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/optional-label.html) -->
|
|
1259
1175
|
<!-- The below code snippet is automatically added from ./../apiExamples/optional-label.html -->
|
|
1260
1176
|
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
</auro-input>
|
|
1267
|
-
```
|
|
1177
|
+
<pre class="language-html"><code class="language-html"><auro-input placeholder="John Doe" bordered>
|
|
1178
|
+
<span slot="label">Full name</span>
|
|
1179
|
+
<span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
|
|
1180
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1181
|
+
</auro-input></code></pre>
|
|
1268
1182
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1269
1183
|
</auro-accordion>
|
|
1270
1184
|
|
|
@@ -1275,84 +1189,80 @@ The `<auro-input>` supports an `optionalLabel` slot, where users can can overrid
|
|
|
1275
1189
|
Example illustrates using a JavaScript function attached to an `auro-button` component `click` event to swap the values of two `auro-input` elements. An example of this use case would be swapping the departure and arrival airports in a flight search form.
|
|
1276
1190
|
|
|
1277
1191
|
<div class="exampleWrapper">
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
<auro-input id="swapExampleLeft">
|
|
1281
|
-
<span slot="label">Left Input</span>
|
|
1282
|
-
<span slot="helpText">Help Text</span>
|
|
1283
|
-
</auro-input>
|
|
1284
|
-
<auro-button id="swapExampleBtn">Swap Values</auro-button>
|
|
1285
|
-
<auro-input id="swapExampleRight">
|
|
1286
|
-
<span slot="label">Right Input</span>
|
|
1287
|
-
<span slot="helpText">Help Text</span>
|
|
1288
|
-
</auro-input>
|
|
1289
|
-
<style>
|
|
1290
|
-
#swapExampleWrapper {
|
|
1291
|
-
align-items: center;
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
#swapExampleLeft,
|
|
1295
|
-
#swapExampleRight {
|
|
1296
|
-
flex: 1;
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
#swapExampleBtn {
|
|
1300
|
-
width: unset;
|
|
1301
|
-
margin: 0 var(--auro-size-xs);
|
|
1302
|
-
}
|
|
1303
|
-
</style>
|
|
1304
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1305
|
-
</div>
|
|
1306
|
-
<auro-accordion alignRight>
|
|
1307
|
-
<span slot="trigger">See code</span>
|
|
1308
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/swap-value.html) -->
|
|
1309
|
-
<!-- The below code snippet is automatically added from ../apiExamples/swap-value.html -->
|
|
1310
|
-
|
|
1311
|
-
```html
|
|
1192
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/swap-value.html) -->
|
|
1193
|
+
<!-- The below content is automatically added from ../apiExamples/swap-value.html -->
|
|
1312
1194
|
<auro-input id="swapExampleLeft">
|
|
1313
|
-
|
|
1314
|
-
|
|
1195
|
+
<span slot="label">Left Input</span>
|
|
1196
|
+
<span slot="helpText">Help Text</span>
|
|
1315
1197
|
</auro-input>
|
|
1316
1198
|
<auro-button id="swapExampleBtn">Swap Values</auro-button>
|
|
1317
1199
|
<auro-input id="swapExampleRight">
|
|
1318
|
-
|
|
1319
|
-
|
|
1200
|
+
<span slot="label">Right Input</span>
|
|
1201
|
+
<span slot="helpText">Help Text</span>
|
|
1320
1202
|
</auro-input>
|
|
1321
1203
|
<style>
|
|
1204
|
+
#swapExampleWrapper {
|
|
1205
|
+
align-items: center;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
#swapExampleLeft,
|
|
1209
|
+
#swapExampleRight {
|
|
1210
|
+
flex: 1;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
#swapExampleBtn {
|
|
1214
|
+
width: unset;
|
|
1215
|
+
margin: 0 var(--auro-size-xs);
|
|
1216
|
+
}
|
|
1217
|
+
</style>
|
|
1218
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1219
|
+
</div>
|
|
1220
|
+
<auro-accordion alignRight>
|
|
1221
|
+
<span slot="trigger">See code</span>
|
|
1222
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/swap-value.html) -->
|
|
1223
|
+
<!-- The below code snippet is automatically added from ../apiExamples/swap-value.html -->
|
|
1224
|
+
|
|
1225
|
+
<pre class="language-html"><code class="language-html"><auro-input id="swapExampleLeft">
|
|
1226
|
+
<span slot="label">Left Input</span>
|
|
1227
|
+
<span slot="helpText">Help Text</span>
|
|
1228
|
+
</auro-input>
|
|
1229
|
+
<auro-button id="swapExampleBtn">Swap Values</auro-button>
|
|
1230
|
+
<auro-input id="swapExampleRight">
|
|
1231
|
+
<span slot="label">Right Input</span>
|
|
1232
|
+
<span slot="helpText">Help Text</span>
|
|
1233
|
+
</auro-input>
|
|
1234
|
+
<style>
|
|
1322
1235
|
#swapExampleWrapper {
|
|
1323
1236
|
align-items: center;
|
|
1324
1237
|
}
|
|
1325
|
-
|
|
1238
|
+
|
|
1326
1239
|
#swapExampleLeft,
|
|
1327
1240
|
#swapExampleRight {
|
|
1328
1241
|
flex: 1;
|
|
1329
1242
|
}
|
|
1330
|
-
|
|
1243
|
+
|
|
1331
1244
|
#swapExampleBtn {
|
|
1332
1245
|
width: unset;
|
|
1333
1246
|
margin: 0 var(--auro-size-xs);
|
|
1334
1247
|
}
|
|
1335
|
-
|
|
1336
|
-
```
|
|
1248
|
+
</style></code></pre>
|
|
1337
1249
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1338
1250
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/swap-value.js) -->
|
|
1339
1251
|
<!-- The below code snippet is automatically added from ../apiExamples/swap-value.js -->
|
|
1340
1252
|
|
|
1341
|
-
|
|
1342
|
-
export function swapInputValues() {
|
|
1253
|
+
<pre class="language-js"><code class="language-js">export function swapInputValues() {
|
|
1343
1254
|
const btn = document.querySelector('#swapExampleBtn');
|
|
1344
1255
|
const inputOne = document.querySelector('#swapExampleLeft');
|
|
1345
1256
|
const inputTwo = document.querySelector('#swapExampleRight');
|
|
1346
|
-
|
|
1347
|
-
btn.addEventListener('click', ()
|
|
1257
|
+
|
|
1258
|
+
btn.addEventListener('click', () => {
|
|
1348
1259
|
const valueOne = inputOne.value;
|
|
1349
1260
|
const valueTwo = inputTwo.value;
|
|
1350
|
-
|
|
1261
|
+
|
|
1351
1262
|
inputOne.value = valueTwo;
|
|
1352
1263
|
inputTwo.value = valueOne;
|
|
1353
1264
|
});
|
|
1354
|
-
}
|
|
1355
|
-
```
|
|
1265
|
+
}</code></pre>
|
|
1356
1266
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1357
1267
|
</auro-accordion>
|
|
1358
1268
|
|
|
@@ -1363,11 +1273,10 @@ The component may be restyled by changing the values of the following token(s).
|
|
|
1363
1273
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
1364
1274
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
1365
1275
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1276
|
+
<pre class="language-scss"><code class="language-scss">/* stylelint-disable custom-property-empty-line-before */
|
|
1277
|
+
|
|
1369
1278
|
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
1370
|
-
|
|
1279
|
+
|
|
1371
1280
|
:host(:not([ondark])),
|
|
1372
1281
|
:host(:not([appearance="inverse"])) {
|
|
1373
1282
|
--ds-auro-input-border-color: var(--ds-basic-color-border-bold, #{v.$ds-basic-color-border-bold});
|
|
@@ -1377,10 +1286,10 @@ The component may be restyled by changing the values of the following token(s).
|
|
|
1377
1286
|
--ds-auro-input-placeholder-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1378
1287
|
--ds-auro-input-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1379
1288
|
--ds-auro-input-error-icon-color: var(--ds-basic-color-status-error, #{v.$ds-basic-color-status-error});
|
|
1380
|
-
|
|
1289
|
+
|
|
1381
1290
|
--ds-auro-input-outline-color: transparent;
|
|
1382
1291
|
}
|
|
1383
|
-
|
|
1292
|
+
|
|
1384
1293
|
:host([ondark]),
|
|
1385
1294
|
:host([appearance="inverse"]) {
|
|
1386
1295
|
--ds-auro-input-border-color: var(--ds-basic-color-border-inverse, #{v.$ds-basic-color-border-inverse});
|
|
@@ -1390,8 +1299,7 @@ The component may be restyled by changing the values of the following token(s).
|
|
|
1390
1299
|
--ds-auro-input-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
1391
1300
|
--ds-auro-input-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
1392
1301
|
--ds-auro-input-error-icon-color: var(--ds-advanced-color-state-error-inverse, #{v.$ds-advanced-color-state-error-inverse});
|
|
1393
|
-
|
|
1302
|
+
|
|
1394
1303
|
--ds-auro-input-outline-color: transparent;
|
|
1395
|
-
}
|
|
1396
|
-
```
|
|
1304
|
+
}</code></pre>
|
|
1397
1305
|
<!-- AURO-GENERATED-CONTENT:END -->
|