@aurodesignsystem-dev/auro-formkit 0.0.0-pr1451.2 → 0.0.0-pr1451.21
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/README.md +11 -27
- package/components/checkbox/demo/accessibility.html +49 -0
- package/components/checkbox/demo/accessibility.md +44 -0
- package/components/checkbox/demo/api.html +17 -25
- package/components/checkbox/demo/api.md +40 -416
- package/components/checkbox/demo/api.min.js +5 -4
- package/components/checkbox/demo/customize.html +52 -0
- package/components/checkbox/demo/customize.md +361 -0
- package/components/checkbox/demo/demo-support.js +60 -0
- package/components/checkbox/demo/design.html +52 -0
- package/components/checkbox/demo/design.md +149 -0
- package/components/checkbox/demo/getting-started.html +52 -0
- package/components/checkbox/demo/getting-started.md +261 -0
- package/components/checkbox/demo/index.html +17 -20
- package/components/checkbox/demo/index.md +144 -29
- package/components/checkbox/demo/index.min.js +5 -4
- package/components/checkbox/demo/keyboard-behavior.html +49 -0
- package/components/checkbox/demo/keyboard-behavior.md +0 -3
- package/components/checkbox/demo/layout.md +30 -0
- package/components/checkbox/demo/readme.html +10 -17
- package/components/checkbox/demo/readme.md +11 -27
- package/components/checkbox/demo/styles.css +974 -0
- package/components/checkbox/demo/voiceover.html +49 -0
- package/components/checkbox/demo/voiceover.md +37 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +1 -0
- package/components/checkbox/dist/index.js +5 -4
- package/components/checkbox/dist/registered.js +5 -4
- package/components/combobox/README.md +8 -29
- package/components/combobox/demo/accessibility.html +2 -20
- package/components/combobox/demo/accessibility.md +1 -1
- package/components/combobox/demo/api.html +5 -52
- package/components/combobox/demo/api.md +53 -2261
- package/components/combobox/demo/api.min.js +15 -12
- package/components/combobox/demo/customize.html +53 -0
- package/components/combobox/demo/customize.js +24 -0
- package/components/combobox/demo/customize.md +1249 -0
- package/components/combobox/demo/customize.min.js +18132 -0
- package/components/combobox/demo/demo-support.js +60 -0
- package/components/combobox/demo/design.html +2 -43
- package/components/combobox/demo/design.md +4 -4
- package/components/combobox/demo/getting-started.html +53 -0
- package/components/combobox/demo/{install.js → getting-started.js} +2 -5
- package/components/combobox/demo/getting-started.md +397 -0
- package/components/combobox/demo/{install.min.js → getting-started.min.js} +14 -38
- package/components/combobox/demo/index.html +4 -47
- package/components/combobox/demo/index.md +3 -569
- package/components/combobox/demo/index.min.js +15 -12
- package/components/combobox/demo/keyboard-behavior.html +2 -20
- package/components/combobox/demo/keyboard-behavior.md +2 -2
- package/components/combobox/demo/layout.md +2 -2
- package/components/combobox/demo/readme.html +2 -43
- package/components/combobox/demo/readme.md +8 -29
- package/components/combobox/demo/styles.css +98 -105
- package/components/combobox/demo/voiceover.html +2 -20
- package/components/combobox/demo/voiceover.md +1 -1
- package/components/combobox/dist/index.js +12 -10
- package/components/combobox/dist/registered.js +12 -10
- package/components/counter/README.md +21 -51
- package/components/counter/demo/accessibility.html +49 -0
- package/components/counter/demo/accessibility.md +34 -0
- package/components/counter/demo/api.html +12 -20
- package/components/counter/demo/api.md +49 -1299
- package/components/counter/demo/api.min.js +6 -6
- package/components/counter/demo/customize.html +53 -0
- package/components/counter/demo/customize.md +650 -0
- package/components/counter/demo/demo-support.js +60 -0
- package/components/counter/demo/design.html +52 -0
- package/components/counter/demo/design.md +192 -0
- package/components/counter/demo/getting-started.html +54 -0
- package/components/counter/demo/getting-started.md +332 -0
- package/components/counter/demo/index.html +14 -19
- package/components/counter/demo/index.md +113 -47
- package/components/counter/demo/index.min.js +6 -6
- package/components/counter/demo/keyboard-behavior.html +49 -0
- package/components/counter/demo/keyboard-behavior.md +1 -1
- package/components/counter/demo/keyboardBehavior.html +7 -39
- package/components/counter/demo/layout.md +10 -0
- package/components/counter/demo/readme.html +11 -15
- package/components/counter/demo/readme.md +21 -51
- package/components/counter/demo/styles.css +974 -0
- package/components/counter/demo/voiceover.html +51 -0
- package/components/counter/demo/voiceover.md +80 -0
- package/components/counter/dist/index.js +6 -6
- package/components/counter/dist/registered.js +6 -6
- package/components/datepicker/README.md +10 -24
- package/components/datepicker/demo/accessibility.html +50 -0
- package/components/datepicker/demo/accessibility.md +64 -0
- package/components/datepicker/demo/api.md +69 -1739
- package/components/datepicker/demo/api.min.js +14 -14
- package/components/datepicker/demo/customize.html +53 -0
- package/components/datepicker/demo/customize.md +723 -0
- package/components/datepicker/demo/demo-support.js +60 -0
- package/components/{select/demo/layout.html → datepicker/demo/design.html} +7 -47
- package/components/datepicker/demo/design.md +158 -0
- package/components/datepicker/demo/getting-started.html +53 -0
- package/components/datepicker/demo/getting-started.md +237 -0
- package/components/datepicker/demo/index.html +14 -34
- package/components/datepicker/demo/index.md +160 -103
- package/components/datepicker/demo/index.min.js +14 -14
- package/components/datepicker/demo/keyboard-behavior.html +12 -33
- package/components/datepicker/demo/layout.md +92 -0
- package/components/datepicker/demo/readme.md +10 -24
- package/components/datepicker/demo/styles.css +974 -0
- package/components/{dropdown/demo/keyboardBehavior.html → datepicker/demo/voiceover.html} +14 -36
- package/components/datepicker/demo/voiceover.md +98 -0
- package/components/datepicker/dist/index.js +14 -14
- package/components/datepicker/dist/registered.js +14 -14
- package/components/dropdown/README.md +0 -25
- package/components/dropdown/demo/accessibility.html +49 -0
- package/components/dropdown/demo/accessibility.md +45 -0
- package/components/dropdown/demo/api.html +10 -19
- package/components/dropdown/demo/api.md +40 -1364
- package/components/dropdown/demo/api.min.js +2 -2
- package/components/dropdown/demo/customize.html +54 -0
- package/components/dropdown/demo/customize.md +780 -0
- package/components/dropdown/demo/demo-support.js +60 -0
- package/components/dropdown/demo/design.html +52 -0
- package/components/dropdown/demo/design.md +186 -0
- package/components/dropdown/demo/getting-started.html +54 -0
- package/components/dropdown/demo/getting-started.md +317 -0
- package/components/dropdown/demo/index.html +12 -20
- package/components/dropdown/demo/index.md +70 -225
- package/components/dropdown/demo/index.min.js +2 -2
- package/components/dropdown/demo/keyboard-behavior.html +49 -0
- package/components/dropdown/demo/keyboard-behavior.md +4 -8
- package/components/dropdown/demo/layout.md +21 -0
- package/components/dropdown/demo/readme.html +7 -20
- package/components/dropdown/demo/readme.md +0 -25
- package/components/dropdown/demo/styles.css +974 -0
- package/components/dropdown/demo/voiceover.html +51 -0
- package/components/dropdown/demo/voiceover.md +63 -0
- package/components/dropdown/dist/index.js +2 -2
- package/components/dropdown/dist/registered.js +2 -2
- package/components/form/README.md +9 -13
- package/components/form/demo/accessibility.html +51 -0
- package/components/form/demo/accessibility.md +23 -0
- package/components/form/demo/api.html +11 -14
- package/components/form/demo/api.md +14 -290
- package/components/form/demo/api.min.js +53 -50
- package/components/form/demo/customize.html +54 -0
- package/components/form/demo/customize.md +246 -0
- package/components/form/demo/demo-support.js +60 -0
- package/components/form/demo/getting-started.html +54 -0
- package/components/form/demo/getting-started.md +291 -0
- package/components/form/demo/index.html +12 -14
- package/components/form/demo/index.md +66 -96
- package/components/form/demo/index.min.js +53 -50
- package/components/form/demo/keyboard-behavior.html +51 -0
- package/components/form/demo/readme.html +12 -17
- package/components/form/demo/readme.md +9 -13
- package/components/form/demo/styles.css +974 -0
- package/components/form/demo/voiceover.html +51 -0
- package/components/form/demo/voiceover.md +36 -0
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/README.md +17 -28
- package/components/input/demo/accessibility.html +38 -0
- package/components/input/demo/accessibility.md +69 -0
- package/components/input/demo/api.html +17 -22
- package/components/input/demo/api.js +4 -23
- package/components/input/demo/api.md +67 -1267
- package/components/input/demo/api.min.js +6 -98
- package/components/input/demo/customize.html +54 -0
- package/components/input/demo/customize.js +25 -0
- package/components/input/demo/customize.md +1372 -0
- package/components/input/demo/customize.min.js +7431 -0
- package/components/input/demo/demo-support.js +60 -0
- package/components/input/demo/design.html +39 -0
- package/components/input/demo/design.md +224 -0
- package/components/input/demo/getting-started.html +53 -0
- package/components/input/demo/getting-started.js +8 -0
- package/components/input/demo/getting-started.md +312 -0
- package/components/input/demo/getting-started.min.js +7369 -0
- package/components/input/demo/index.html +16 -22
- package/components/input/demo/index.js +0 -11
- package/components/input/demo/index.md +171 -139
- package/components/input/demo/index.min.js +6 -18
- package/components/input/demo/keyboard-behavior.html +38 -0
- package/components/input/demo/layout.md +77 -0
- package/components/input/demo/readme.md +17 -28
- package/components/input/demo/styles.css +974 -0
- package/components/input/demo/voiceover.html +38 -0
- package/components/input/demo/voiceover.md +70 -0
- package/components/input/dist/base-input.d.ts +1 -0
- package/components/input/dist/index.js +6 -6
- package/components/input/dist/registered.js +6 -6
- package/components/menu/README.md +1 -5
- package/components/menu/demo/api.md +43 -43
- package/components/menu/demo/api.min.js +2 -2
- package/components/menu/demo/index.md +1 -1
- package/components/menu/demo/index.min.js +2 -2
- package/components/menu/demo/readme.md +1 -5
- package/components/menu/dist/index.js +2 -2
- package/components/menu/dist/registered.js +2 -2
- package/components/radio/README.md +9 -22
- package/components/radio/demo/accessibility.html +51 -0
- package/components/radio/demo/accessibility.md +44 -0
- package/components/radio/demo/api.html +13 -20
- package/components/radio/demo/api.md +44 -589
- package/components/radio/demo/api.min.js +3 -3
- package/components/radio/demo/customize.html +53 -0
- package/components/radio/demo/customize.md +368 -0
- package/components/radio/demo/demo-support.js +60 -0
- package/components/radio/demo/design.html +52 -0
- package/components/radio/demo/design.md +143 -0
- package/components/radio/demo/getting-started.html +54 -0
- package/components/radio/demo/getting-started.md +296 -0
- package/components/radio/demo/index.html +16 -19
- package/components/radio/demo/index.md +110 -45
- package/components/radio/demo/index.min.js +3 -3
- package/components/radio/demo/keyboard-behavior.html +51 -0
- package/components/radio/demo/layout.md +30 -0
- package/components/radio/demo/readme.html +11 -17
- package/components/radio/demo/readme.md +9 -22
- package/components/radio/demo/styles.css +974 -0
- package/components/radio/demo/voiceover.html +51 -0
- package/components/radio/demo/voiceover.md +43 -0
- package/components/radio/dist/index.js +3 -3
- package/components/radio/dist/registered.js +3 -3
- package/components/select/README.md +7 -4
- package/components/select/demo/accessibility.html +5 -21
- package/components/select/demo/accessibility.md +1 -1
- package/components/select/demo/api.html +3 -48
- package/components/select/demo/api.md +52 -2342
- package/components/select/demo/customize.html +54 -0
- package/components/select/demo/customize.js +11 -0
- package/components/select/demo/customize.md +1049 -0
- package/components/select/demo/{api.min.js → customize.min.js} +12 -113
- package/components/select/demo/demo-support.js +60 -0
- package/components/select/demo/design.html +3 -44
- package/components/select/demo/design.md +2 -2
- package/components/select/demo/getting-started.html +5 -76
- package/components/select/demo/getting-started.js +20 -3
- package/components/select/demo/getting-started.md +97 -705
- package/components/select/demo/getting-started.min.js +58 -9
- package/components/select/demo/index.html +4 -43
- package/components/select/demo/index.js +5 -3
- package/components/select/demo/index.md +2 -2
- package/components/select/demo/index.min.js +14 -9
- package/components/select/demo/keyboard-behavior.html +6 -47
- package/components/select/demo/keyboard-behavior.md +5 -6
- package/components/select/demo/keyboardBehavior.html +4 -46
- package/components/select/demo/readme.html +3 -44
- package/components/select/demo/readme.md +7 -4
- package/components/select/demo/styles.css +57 -109
- package/components/select/demo/voiceover.html +3 -30
- package/components/select/dist/index.js +5 -5
- package/components/select/dist/registered.js +5 -5
- package/custom-elements.json +249 -246
- package/package.json +3 -3
- package/components/combobox/demo/install.html +0 -94
- package/components/combobox/demo/install.md +0 -98
- package/components/select/demo/api.js +0 -39
- package/components/select/demo/install.md +0 -92
|
@@ -0,0 +1,1372 @@
|
|
|
1
|
+
<auro-header level="1" id="overview">Input - Customize</auro-header>
|
|
2
|
+
<div class="contentWrapper">
|
|
3
|
+
<nav>
|
|
4
|
+
<auro-nav anchorNavContent=".scrollWrapper">
|
|
5
|
+
<span slot="mobileToggleCollapsed">View More</span>
|
|
6
|
+
<span slot="mobileToggleExpanded">View Less</span>
|
|
7
|
+
<auro-anchorlink fluid href="#appearance">Appearance</auro-anchorlink>
|
|
8
|
+
<auro-anchorlink fluid href="#activeLabel" class="level2 body-xs">Active Label</auro-anchorlink>
|
|
9
|
+
<auro-anchorlink fluid href="#dvInputOnly" class="level2 body-xs">Display Value Input Only</auro-anchorlink>
|
|
10
|
+
<auro-anchorlink fluid href="#icon" class="level2 body-xs">Icon</auro-anchorlink>
|
|
11
|
+
<auro-anchorlink fluid href="#lightDarkBackground" class="level2 body-xs">Light vs. Dark Background</auro-anchorlink>
|
|
12
|
+
<auro-anchorlink fluid href="#placeholder" class="level2 body-xs">Placeholder</auro-anchorlink>
|
|
13
|
+
<auro-anchorlink fluid href="#optionalFlag" class="level2 body-xs">Optional Flag</auro-anchorlink>
|
|
14
|
+
<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
|
+
<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
|
+
<auro-anchorlink fluid href="#behavior">Behavior</auro-anchorlink>
|
|
19
|
+
<auro-anchorlink fluid href="#autocapitalize" class="level2 body-xs">Autocapitalize</auro-anchorlink>
|
|
20
|
+
<auro-anchorlink fluid href="#autocomplete" class="level2 body-xs">Autocomplete</auro-anchorlink>
|
|
21
|
+
<auro-anchorlink fluid href="#autocorrect" class="level2 body-xs">Autocorrect</auro-anchorlink>
|
|
22
|
+
<auro-anchorlink fluid href="#disabled" class="level2 body-xs">Disabled</auro-anchorlink>
|
|
23
|
+
<auro-anchorlink fluid href="#error" class="level2 body-xs">Error</auro-anchorlink>
|
|
24
|
+
<auro-anchorlink fluid href="#format" class="level2 body-xs">Format</auro-anchorlink>
|
|
25
|
+
<auro-anchorlink fluid href="#inputMode" class="level2 body-xs">Input Mode</auro-anchorlink>
|
|
26
|
+
<auro-anchorlink fluid href="#max" class="level2 body-xs">Max</auro-anchorlink>
|
|
27
|
+
<auro-anchorlink fluid href="#maxLength" class="level2 body-xs">Max Length</auro-anchorlink>
|
|
28
|
+
<auro-anchorlink fluid href="#min" class="level2 body-xs">Min</auro-anchorlink>
|
|
29
|
+
<auro-anchorlink fluid href="#minLength" class="level2 body-xs">Min Length</auro-anchorlink>
|
|
30
|
+
<auro-anchorlink fluid href="#name" class="level2 body-xs">Name</auro-anchorlink>
|
|
31
|
+
<auro-anchorlink fluid href="#noValidate" class="level2 body-xs">No Validate</auro-anchorlink>
|
|
32
|
+
<auro-anchorlink fluid href="#pattern" class="level2 body-xs">Pattern</auro-anchorlink>
|
|
33
|
+
<auro-anchorlink fluid href="#readonly" class="level2 body-xs">Readonly</auro-anchorlink>
|
|
34
|
+
<auro-anchorlink fluid href="#required" class="level2 body-xs">Required</auro-anchorlink>
|
|
35
|
+
<auro-anchorlink fluid href="#setCustomValidity" class="level2 body-xs">Custom Validation Messages</auro-anchorlink>
|
|
36
|
+
<auro-anchorlink fluid href="#type" class="level2 body-xs">Type</auro-anchorlink>
|
|
37
|
+
<auro-anchorlink fluid href="#validateOnInput" class="level2 body-xs">Validate on Input</auro-anchorlink>
|
|
38
|
+
<auro-anchorlink fluid href="#value" class="level2 body-xs">Value</auro-anchorlink>
|
|
39
|
+
</auro-nav>
|
|
40
|
+
</nav>
|
|
41
|
+
<div class="mainContent">
|
|
42
|
+
<div class="scrollWrapper">
|
|
43
|
+
<section>
|
|
44
|
+
<auro-header level="2" id="appearance">Appearance</auro-header>
|
|
45
|
+
<auro-header level="3" id="activeLabel">Active Label</auro-header>
|
|
46
|
+
<p>Use the <code>activeLabel</code> attribute to make the label stay fixed in the active position.</p>
|
|
47
|
+
<div class="exampleWrapper">
|
|
48
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/active-label.html) -->
|
|
49
|
+
<!-- The below content is automatically added from ../apiExamples/active-label.html -->
|
|
50
|
+
<auro-input activeLabel>
|
|
51
|
+
<span slot="label">Address</span>
|
|
52
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
53
|
+
</auro-input>
|
|
54
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
55
|
+
</div>
|
|
56
|
+
<auro-accordion alignRight>
|
|
57
|
+
<span slot="trigger">See code</span>
|
|
58
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/active-label.html) -->
|
|
59
|
+
<!-- The below code snippet is automatically added from ../apiExamples/active-label.html -->
|
|
60
|
+
<pre class="language-html"><code class="language-html"><auro-input activeLabel>
|
|
61
|
+
<span slot="label">Address</span>
|
|
62
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
63
|
+
</auro-input></code></pre>
|
|
64
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
65
|
+
</auro-accordion>
|
|
66
|
+
<auro-header level="3" id="dvInputOnly">Display Value Input Only</auro-header>
|
|
67
|
+
<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>
|
|
68
|
+
<div class="exampleWrapper">
|
|
69
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/dv-input-only.html) -->
|
|
70
|
+
<!-- The below content is automatically added from ../apiExamples/dv-input-only.html -->
|
|
71
|
+
<auro-header level="4">Display Value Slot Content Only</auro-header>
|
|
72
|
+
<auro-input value="Hello World">
|
|
73
|
+
<span slot="label">Default display value behavior</span>
|
|
74
|
+
<span slot="displayValue">✨ Custom Display ✨</span>
|
|
75
|
+
</auro-input>
|
|
76
|
+
<auro-header level="4">Display Value Slot Content with <code>dvInputOnly</code></auro-header>
|
|
77
|
+
<auro-input dvInputOnly value="Hello World">
|
|
78
|
+
<span slot="label">With dvInputOnly</span>
|
|
79
|
+
<span slot="displayValue">✨ Custom Display ✨</span>
|
|
80
|
+
</auro-input>
|
|
81
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
|
+
</div>
|
|
83
|
+
<auro-accordion alignRight>
|
|
84
|
+
<span slot="trigger">See code</span>
|
|
85
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/dv-input-only.html) -->
|
|
86
|
+
<!-- The below code snippet is automatically added from ../apiExamples/dv-input-only.html -->
|
|
87
|
+
<pre class="language-html"><code class="language-html"><auro-header level="4">Display Value Slot Content Only</auro-header>
|
|
88
|
+
<auro-input value="Hello World">
|
|
89
|
+
<span slot="label">Default display value behavior</span>
|
|
90
|
+
<span slot="displayValue">✨ Custom Display ✨</span>
|
|
91
|
+
</auro-input>
|
|
92
|
+
<auro-header level="4">Display Value Slot Content with <code>dvInputOnly</code></auro-header>
|
|
93
|
+
<auro-input dvInputOnly value="Hello World">
|
|
94
|
+
<span slot="label">With dvInputOnly</span>
|
|
95
|
+
<span slot="displayValue">✨ Custom Display ✨</span>
|
|
96
|
+
</auro-input></code></pre>
|
|
97
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
98
|
+
</auro-accordion>
|
|
99
|
+
<auro-header level="3" id="icon">Icon</auro-header>
|
|
100
|
+
<p>Use the <code>icon</code> attribute to render an icon inside the input to the left of the value. Support is limited to <code>auro-input</code> instances with credit card format.</p>
|
|
101
|
+
<div class="exampleWrapper">
|
|
102
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/credit-card-icon.html) -->
|
|
103
|
+
<!-- The below content is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
104
|
+
<auro-input icon type="credit-card" required>
|
|
105
|
+
<span slot="label">Card number</span>
|
|
106
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
107
|
+
</auro-input>
|
|
108
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
109
|
+
</div>
|
|
110
|
+
<auro-accordion alignRight>
|
|
111
|
+
<span slot="trigger">See code</span>
|
|
112
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/credit-card-icon.html) -->
|
|
113
|
+
<!-- The below code snippet is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
114
|
+
<pre class="language-html"><code class="language-html"><auro-input icon type="credit-card" required>
|
|
115
|
+
<span slot="label">Card number</span>
|
|
116
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
117
|
+
</auro-input></code></pre>
|
|
118
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
119
|
+
</auro-accordion>
|
|
120
|
+
<auro-header level="3" id="lightDarkBackground">Light vs. Dark Background</auro-header>
|
|
121
|
+
<div class="exampleWrapper">
|
|
122
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-default.html) -->
|
|
123
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-default.html -->
|
|
124
|
+
<auro-input>
|
|
125
|
+
<span slot="label">Default Appearance</span>
|
|
126
|
+
<span slot="helpText">Help Text</span>
|
|
127
|
+
</auro-input>
|
|
128
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
129
|
+
</div>
|
|
130
|
+
<auro-accordion alignRight>
|
|
131
|
+
<span slot="trigger">See code</span>
|
|
132
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-default.html) -->
|
|
133
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-default.html -->
|
|
134
|
+
<pre class="language-html"><code class="language-html"><auro-input>
|
|
135
|
+
<span slot="label">Default Appearance</span>
|
|
136
|
+
<span slot="helpText">Help Text</span>
|
|
137
|
+
</auro-input></code></pre>
|
|
138
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
139
|
+
</auro-accordion>
|
|
140
|
+
<div class="exampleWrapper--ondark">
|
|
141
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
142
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
143
|
+
<auro-input appearance="inverse">
|
|
144
|
+
<span slot="label">Inverse Appearance</span>
|
|
145
|
+
<span slot="helpText">Help Text</span>
|
|
146
|
+
</auro-input>
|
|
147
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
148
|
+
</div>
|
|
149
|
+
<auro-accordion alignRight>
|
|
150
|
+
<span slot="trigger">See code</span>
|
|
151
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
152
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
153
|
+
<pre class="language-html"><code class="language-html"><auro-input appearance="inverse">
|
|
154
|
+
<span slot="label">Inverse Appearance</span>
|
|
155
|
+
<span slot="helpText">Help Text</span>
|
|
156
|
+
</auro-input></code></pre>
|
|
157
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
158
|
+
</auro-accordion>
|
|
159
|
+
<auro-header level="3" id="placeholder">Placeholder</auro-header>
|
|
160
|
+
<p>Use the <code>placeholder</code> attribute to add a custom placeholder message within the element.</p>
|
|
161
|
+
<div class="exampleWrapper">
|
|
162
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/placeholder.html) -->
|
|
163
|
+
<!-- The below content is automatically added from ../apiExamples/placeholder.html -->
|
|
164
|
+
<auro-input placeholder="John Doe" required>
|
|
165
|
+
<span slot="label">Full name</span>
|
|
166
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
167
|
+
</auro-input>
|
|
168
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
169
|
+
</div>
|
|
170
|
+
<auro-accordion alignRight>
|
|
171
|
+
<span slot="trigger">See code</span>
|
|
172
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/placeholder.html) -->
|
|
173
|
+
<!-- The below code snippet is automatically added from ../apiExamples/placeholder.html -->
|
|
174
|
+
<pre class="language-html"><code class="language-html"><auro-input placeholder="John Doe" required>
|
|
175
|
+
<span slot="label">Full name</span>
|
|
176
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
177
|
+
</auro-input></code></pre>
|
|
178
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
179
|
+
</auro-accordion>
|
|
180
|
+
<auro-header level="3" id="optionalFlag">Optional Flag</auro-header>
|
|
181
|
+
<p>The <code><auro-input></code> supports an <code>optionalLabel</code> slot, where users can override the default <code>(optional)</code> notification text.</p>
|
|
182
|
+
<p>Providing the slot with empty content will remove it.</p>
|
|
183
|
+
<div class="exampleWrapper">
|
|
184
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/optional-label.html) -->
|
|
185
|
+
<!-- The below content is automatically added from ./../apiExamples/optional-label.html -->
|
|
186
|
+
<auro-input placeholder="John Doe" bordered>
|
|
187
|
+
<span slot="label">Full name</span>
|
|
188
|
+
<span slot="optionalLabel"> - custom optional text</span>
|
|
189
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
190
|
+
</auro-input>
|
|
191
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
192
|
+
</div>
|
|
193
|
+
<auro-accordion alignRight>
|
|
194
|
+
<span slot="trigger">See code</span>
|
|
195
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/optional-label.html) -->
|
|
196
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/optional-label.html -->
|
|
197
|
+
<pre class="language-html"><code class="language-html"><auro-input placeholder="John Doe" bordered>
|
|
198
|
+
<span slot="label">Full name</span>
|
|
199
|
+
<span slot="optionalLabel"> - custom optional text</span>
|
|
200
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
201
|
+
</auro-input></code></pre>
|
|
202
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
203
|
+
</auro-accordion>
|
|
204
|
+
<auro-header level="3" id="simple">Simple</auro-header>
|
|
205
|
+
<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>
|
|
206
|
+
<div class="exampleWrapper">
|
|
207
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/simple.html) -->
|
|
208
|
+
<!-- The below content is automatically added from ./../apiExamples/simple.html -->
|
|
209
|
+
<auro-input simple>
|
|
210
|
+
<span slot="label">Simple Input</span>
|
|
211
|
+
<span slot="helpText">Help Text</span>
|
|
212
|
+
</auro-input>
|
|
213
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
214
|
+
</div>
|
|
215
|
+
<auro-accordion alignRight>
|
|
216
|
+
<span slot="trigger">See code</span>
|
|
217
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/simple.html) -->
|
|
218
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/simple.html -->
|
|
219
|
+
<pre class="language-html"><code class="language-html"><auro-input simple>
|
|
220
|
+
<span slot="label">Simple Input</span>
|
|
221
|
+
<span slot="helpText">Help Text</span>
|
|
222
|
+
</auro-input></code></pre>
|
|
223
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
224
|
+
</auro-accordion>
|
|
225
|
+
<auro-header level="3" id="nested">Nested</auro-header>
|
|
226
|
+
<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>
|
|
227
|
+
<div class="exampleWrapper">
|
|
228
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/nested.html) -->
|
|
229
|
+
<!-- The below content is automatically added from ./../apiExamples/nested.html -->
|
|
230
|
+
<auro-input nested>
|
|
231
|
+
<span slot="label">Nested Input</span>
|
|
232
|
+
<span slot="helpText">Help Text</span>
|
|
233
|
+
</auro-input>
|
|
234
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
235
|
+
</div>
|
|
236
|
+
<auro-accordion alignRight>
|
|
237
|
+
<span slot="trigger">See code</span>
|
|
238
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/nested.html) -->
|
|
239
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/nested.html -->
|
|
240
|
+
<pre class="language-html"><code class="language-html"><auro-input nested>
|
|
241
|
+
<span slot="label">Nested Input</span>
|
|
242
|
+
<span slot="helpText">Help Text</span>
|
|
243
|
+
</auro-input></code></pre>
|
|
244
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
245
|
+
</auro-accordion>
|
|
246
|
+
</section>
|
|
247
|
+
<section>
|
|
248
|
+
<auro-header level="3" id="cssTokens">Tokens</auro-header>
|
|
249
|
+
<p>The component may be restyled by changing the values of the following token(s).</p>
|
|
250
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
251
|
+
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
252
|
+
<pre class="language-scss"><code class="language-scss">/* stylelint-disable custom-property-empty-line-before */
|
|
253
|
+
|
|
254
|
+
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
255
|
+
|
|
256
|
+
:host(:not([ondark])),
|
|
257
|
+
:host(:not([appearance="inverse"])) {
|
|
258
|
+
--ds-auro-input-border-color: var(--ds-basic-color-border-bold, #{v.$ds-basic-color-border-bold});
|
|
259
|
+
--ds-auro-input-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
260
|
+
--ds-auro-input-caret-color: var(--ds-advanced-color-state-focused, #{v.$ds-advanced-color-state-focused});
|
|
261
|
+
--ds-auro-input-label-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
262
|
+
--ds-auro-input-placeholder-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
263
|
+
--ds-auro-input-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
264
|
+
--ds-auro-input-error-icon-color: var(--ds-basic-color-status-error, #{v.$ds-basic-color-status-error});
|
|
265
|
+
|
|
266
|
+
--ds-auro-input-outline-color: transparent;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:host([ondark]),
|
|
270
|
+
:host([appearance="inverse"]) {
|
|
271
|
+
--ds-auro-input-border-color: var(--ds-basic-color-border-inverse, #{v.$ds-basic-color-border-inverse});
|
|
272
|
+
--ds-auro-input-container-color: var(--ds-advanced-color-shared-background-inverse, #{v.$ds-advanced-color-shared-background-inverse});
|
|
273
|
+
--ds-auro-input-caret-color: var(--ds-advanced-color-state-focused-inverse, #{v.$ds-advanced-color-state-focused-inverse});
|
|
274
|
+
--ds-auro-input-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
|
|
275
|
+
--ds-auro-input-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
276
|
+
--ds-auro-input-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
277
|
+
--ds-auro-input-error-icon-color: var(--ds-advanced-color-state-error-inverse, #{v.$ds-advanced-color-state-error-inverse});
|
|
278
|
+
|
|
279
|
+
--ds-auro-input-outline-color: transparent;
|
|
280
|
+
}</code></pre>
|
|
281
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
282
|
+
</section>
|
|
283
|
+
<section>
|
|
284
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customize/css-parts.md) -->
|
|
285
|
+
<!-- The below content is automatically added from ./../docs/partials/customize/css-parts.md -->
|
|
286
|
+
<auro-header level="3" id="cssParts">CSS Shadow Parts</auro-header>
|
|
287
|
+
<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>
|
|
288
|
+
<table class="auro_table">
|
|
289
|
+
<thead>
|
|
290
|
+
<tr>
|
|
291
|
+
<th>Part</th>
|
|
292
|
+
<th>Description</th>
|
|
293
|
+
</tr>
|
|
294
|
+
</thead>
|
|
295
|
+
<tbody>
|
|
296
|
+
<tr><td><code>wrapper</code></td><td>The root wrapper element of the input.</td></tr>
|
|
297
|
+
<tr><td><code>label</code></td><td>The label element.</td></tr>
|
|
298
|
+
<tr><td><code>helpText</code></td><td>The help text element.</td></tr>
|
|
299
|
+
<tr><td><code>input</code></td><td>The native input element.</td></tr>
|
|
300
|
+
<tr><td><code>accentIcon</code></td><td>The accent icon element (e.g. credit card icon, calendar icon).</td></tr>
|
|
301
|
+
<tr><td><code>iconContainer</code></td><td>The icon container (e.g. X icon for clearing input value).</td></tr>
|
|
302
|
+
<tr><td><code>accent-left</code></td><td>The left accent element.</td></tr>
|
|
303
|
+
<tr><td><code>accent-right</code></td><td>The right accent element.</td></tr>
|
|
304
|
+
<tr><td><code>displayValue</code></td><td>The display value element.</td></tr>
|
|
305
|
+
<tr><td><code>inputHelpText</code></td><td>The input help text wrapper.</td></tr>
|
|
306
|
+
</tbody>
|
|
307
|
+
</table>
|
|
308
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
309
|
+
<div class="exampleWrapper">
|
|
310
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/css-parts.html) -->
|
|
311
|
+
<!-- The below content is automatically added from ../apiExamples/css-parts.html -->
|
|
312
|
+
<style>
|
|
313
|
+
auro-input.css-parts-demo::part(wrapper) {
|
|
314
|
+
border-color: orange;
|
|
315
|
+
}
|
|
316
|
+
auro-input.css-parts-demo::part(label) {
|
|
317
|
+
color: purple;
|
|
318
|
+
}
|
|
319
|
+
auro-input.css-parts-demo::part(helpText) {
|
|
320
|
+
color: green;
|
|
321
|
+
}
|
|
322
|
+
auro-input.css-parts-demo::part(input) {
|
|
323
|
+
font-style: italic;
|
|
324
|
+
}
|
|
325
|
+
</style>
|
|
326
|
+
<auro-input class="css-parts-demo" required>
|
|
327
|
+
<span slot="label">CSS Parts Example</span>
|
|
328
|
+
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
329
|
+
</auro-input>
|
|
330
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
331
|
+
</div>
|
|
332
|
+
<auro-accordion alignRight>
|
|
333
|
+
<span slot="trigger">See code</span>
|
|
334
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/css-parts.html) -->
|
|
335
|
+
<!-- The below code snippet is automatically added from ../apiExamples/css-parts.html -->
|
|
336
|
+
<pre class="language-html"><code class="language-html"><style>
|
|
337
|
+
auro-input.css-parts-demo::part(wrapper) {
|
|
338
|
+
border-color: orange;
|
|
339
|
+
}
|
|
340
|
+
auro-input.css-parts-demo::part(label) {
|
|
341
|
+
color: purple;
|
|
342
|
+
}
|
|
343
|
+
auro-input.css-parts-demo::part(helpText) {
|
|
344
|
+
color: green;
|
|
345
|
+
}
|
|
346
|
+
auro-input.css-parts-demo::part(input) {
|
|
347
|
+
font-style: italic;
|
|
348
|
+
}
|
|
349
|
+
</style>
|
|
350
|
+
<auro-input class="css-parts-demo" required>
|
|
351
|
+
<span slot="label">CSS Parts Example</span>
|
|
352
|
+
<span slot="helpText">This input has custom styles applied via CSS Shadow Parts.</span>
|
|
353
|
+
</auro-input></code></pre>
|
|
354
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
355
|
+
</auro-accordion>
|
|
356
|
+
</section>
|
|
357
|
+
<section>
|
|
358
|
+
<auro-header level="2" id="behavior">Behavior</auro-header>
|
|
359
|
+
<auro-header level="3" id="autocapitalize">Autocapitalize</auro-header>
|
|
360
|
+
<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>
|
|
361
|
+
<div class="exampleWrapper">
|
|
362
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/autocapitalize.html) -->
|
|
363
|
+
<!-- The below content is automatically added from ../apiExamples/autocapitalize.html -->
|
|
364
|
+
<auro-input autocapitalize="none">
|
|
365
|
+
<span slot="label">No capitalization</span>
|
|
366
|
+
<span slot="helpText">Autocapitalize is set to none.</span>
|
|
367
|
+
</auro-input>
|
|
368
|
+
<auro-input autocapitalize="words">
|
|
369
|
+
<span slot="label">Capitalize words</span>
|
|
370
|
+
<span slot="helpText">Autocapitalize is set to words.</span>
|
|
371
|
+
</auro-input>
|
|
372
|
+
<auro-input autocapitalize="characters">
|
|
373
|
+
<span slot="label">Capitalize characters</span>
|
|
374
|
+
<span slot="helpText">Autocapitalize is set to characters.</span>
|
|
375
|
+
</auro-input>
|
|
376
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
377
|
+
</div>
|
|
378
|
+
<auro-accordion alignRight>
|
|
379
|
+
<span slot="trigger">See code</span>
|
|
380
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/autocapitalize.html) -->
|
|
381
|
+
<!-- The below code snippet is automatically added from ../apiExamples/autocapitalize.html -->
|
|
382
|
+
<pre class="language-html"><code class="language-html"><auro-input autocapitalize="none">
|
|
383
|
+
<span slot="label">No capitalization</span>
|
|
384
|
+
<span slot="helpText">Autocapitalize is set to none.</span>
|
|
385
|
+
</auro-input>
|
|
386
|
+
<auro-input autocapitalize="words">
|
|
387
|
+
<span slot="label">Capitalize words</span>
|
|
388
|
+
<span slot="helpText">Autocapitalize is set to words.</span>
|
|
389
|
+
</auro-input>
|
|
390
|
+
<auro-input autocapitalize="characters">
|
|
391
|
+
<span slot="label">Capitalize characters</span>
|
|
392
|
+
<span slot="helpText">Autocapitalize is set to characters.</span>
|
|
393
|
+
</auro-input></code></pre>
|
|
394
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
395
|
+
</auro-accordion>
|
|
396
|
+
<auro-header level="3" id="autocomplete">Autocomplete</auro-header>
|
|
397
|
+
<p>Use the <code>autocomplete</code> attribute to control what the browser can suggest for autofill. At this time, only <code>autocomplete="off"</code> is supported.</p>
|
|
398
|
+
<div class="exampleWrapper">
|
|
399
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/autocomplete.html) -->
|
|
400
|
+
<!-- The below content is automatically added from ../apiExamples/autocomplete.html -->
|
|
401
|
+
<auro-input autocomplete="off">
|
|
402
|
+
<span slot="label">Username</span>
|
|
403
|
+
<span slot="helpText">Browser autofill is disabled for this input.</span>
|
|
404
|
+
</auro-input>
|
|
405
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
406
|
+
</div>
|
|
407
|
+
<auro-accordion alignRight>
|
|
408
|
+
<span slot="trigger">See code</span>
|
|
409
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/autocomplete.html) -->
|
|
410
|
+
<!-- The below code snippet is automatically added from ../apiExamples/autocomplete.html -->
|
|
411
|
+
<pre class="language-html"><code class="language-html"><auro-input autocomplete="off">
|
|
412
|
+
<span slot="label">Username</span>
|
|
413
|
+
<span slot="helpText">Browser autofill is disabled for this input.</span>
|
|
414
|
+
</auro-input></code></pre>
|
|
415
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
416
|
+
</auro-accordion>
|
|
417
|
+
<auro-header level="3" id="autocorrect">Autocorrect</auro-header>
|
|
418
|
+
<p>Use the <code>autocorrect</code> attribute set to <code>off</code> to stop iOS from auto-correcting words when typed into a text box.</p>
|
|
419
|
+
<div class="exampleWrapper">
|
|
420
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/autocorrect.html) -->
|
|
421
|
+
<!-- The below content is automatically added from ../apiExamples/autocorrect.html -->
|
|
422
|
+
<auro-input autocorrect="off">
|
|
423
|
+
<span slot="label">Autocorrect off</span>
|
|
424
|
+
<span slot="helpText">iOS autocorrect is disabled for this input.</span>
|
|
425
|
+
</auro-input>
|
|
426
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
427
|
+
</div>
|
|
428
|
+
<auro-accordion alignRight>
|
|
429
|
+
<span slot="trigger">See code</span>
|
|
430
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/autocorrect.html) -->
|
|
431
|
+
<!-- The below code snippet is automatically added from ../apiExamples/autocorrect.html -->
|
|
432
|
+
<pre class="language-html"><code class="language-html"><auro-input autocorrect="off">
|
|
433
|
+
<span slot="label">Autocorrect off</span>
|
|
434
|
+
<span slot="helpText">iOS autocorrect is disabled for this input.</span>
|
|
435
|
+
</auro-input></code></pre>
|
|
436
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
437
|
+
</auro-accordion>
|
|
438
|
+
<auro-header level="3" id="disabled">Disabled</auro-header>
|
|
439
|
+
<p>Use the <code>disable</code> attribute to prevent the user from interacting with the input.</p>
|
|
440
|
+
<div class="exampleWrapper">
|
|
441
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
442
|
+
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
443
|
+
<auro-input disabled>
|
|
444
|
+
<span slot="label">Disabled</span>
|
|
445
|
+
<span slot="helpText">Help Text</span>
|
|
446
|
+
</auro-input>
|
|
447
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
448
|
+
</div>
|
|
449
|
+
<auro-accordion alignRight>
|
|
450
|
+
<span slot="trigger">See code</span>
|
|
451
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
452
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
453
|
+
<pre class="language-html"><code class="language-html"><auro-input disabled>
|
|
454
|
+
<span slot="label">Disabled</span>
|
|
455
|
+
<span slot="helpText">Help Text</span>
|
|
456
|
+
</auro-input></code></pre>
|
|
457
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
458
|
+
</auro-accordion>
|
|
459
|
+
<auro-header level="3" id="error">Error</auro-header>
|
|
460
|
+
<p>Use the <code>error</code> attribute to apply a persistent custom error that supersedes the HTML5 validation logic.</p>
|
|
461
|
+
<p>A custom error message can be set using the <code>error</code> attribute, or it can be used in conjunction with the <code>setCustomValidityCustomError</code> attribute.</p>
|
|
462
|
+
<div class="exampleWrapper">
|
|
463
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/error.html) -->
|
|
464
|
+
<!-- The below content is automatically added from ../apiExamples/error.html -->
|
|
465
|
+
<auro-button id="setCustomErrorBtn">Set Custom Error</auro-button>
|
|
466
|
+
<auro-button id="setCustomErrorClearBtn">Clear Custom Error</auro-button>
|
|
467
|
+
<br /><br />
|
|
468
|
+
<auro-input id="setCustomErrorExample" error="Initial error attribute value">
|
|
469
|
+
<span slot="label">Name</span>
|
|
470
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
471
|
+
</auro-input>
|
|
472
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
473
|
+
</div>
|
|
474
|
+
<auro-accordion alignRight>
|
|
475
|
+
<span slot="trigger">See code</span>
|
|
476
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/error.html) -->
|
|
477
|
+
<!-- The below code snippet is automatically added from ../apiExamples/error.html -->
|
|
478
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setCustomErrorBtn">Set Custom Error</auro-button>
|
|
479
|
+
<auro-button id="setCustomErrorClearBtn">Clear Custom Error</auro-button>
|
|
480
|
+
<br /><br />
|
|
481
|
+
<auro-input id="setCustomErrorExample" error="Initial error attribute value">
|
|
482
|
+
<span slot="label">Name</span>
|
|
483
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
484
|
+
</auro-input></code></pre>
|
|
485
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
486
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/error.js) -->
|
|
487
|
+
<!-- The below code snippet is automatically added from ../apiExamples/error.js -->
|
|
488
|
+
<pre class="language-js"><code class="language-js">export function customError() {
|
|
489
|
+
const elem = document.querySelector('#setCustomErrorExample');
|
|
490
|
+
// set custom error
|
|
491
|
+
document.querySelector('#setCustomErrorBtn').addEventListener('click', () => {
|
|
492
|
+
elem.error = "Custom Error Message";
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// remove custom error
|
|
496
|
+
document.querySelector('#setCustomErrorClearBtn').addEventListener('click', () => {
|
|
497
|
+
elem.removeAttribute('error');
|
|
498
|
+
});
|
|
499
|
+
}</code></pre>
|
|
500
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
501
|
+
</auro-accordion>
|
|
502
|
+
<auro-header level="3" id="format">Format</auro-header>
|
|
503
|
+
<p>Use the <code>format</code> attribute to set the format of the IMask.</p>
|
|
504
|
+
<p>Default masking definitions:</p>
|
|
505
|
+
<ul>
|
|
506
|
+
<li>0 : number</li>
|
|
507
|
+
<li>a : letter</li>
|
|
508
|
+
<li>* : any character</li>
|
|
509
|
+
</ul>
|
|
510
|
+
<p>See <a href="https://imask.js.org/">IMask</a> for more information on how to configure a mask.</p>
|
|
511
|
+
<div class="exampleWrapper">
|
|
512
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/format.html) -->
|
|
513
|
+
<!-- The below content is automatically added from ../apiExamples/format.html -->
|
|
514
|
+
<auro-input format="47440000">
|
|
515
|
+
<span slot="label">Custom format</span>
|
|
516
|
+
<span slot="helpText">Format is: 47440000</span>
|
|
517
|
+
</auro-input>
|
|
518
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
519
|
+
</div>
|
|
520
|
+
<auro-accordion alignRight>
|
|
521
|
+
<span slot="trigger">See code</span>
|
|
522
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/format.html) -->
|
|
523
|
+
<!-- The below code snippet is automatically added from ../apiExamples/format.html -->
|
|
524
|
+
<pre class="language-html"><code class="language-html"><auro-input format="47440000">
|
|
525
|
+
<span slot="label">Custom format</span>
|
|
526
|
+
<span slot="helpText">Format is: 47440000</span>
|
|
527
|
+
</auro-input></code></pre>
|
|
528
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
529
|
+
</auro-accordion>
|
|
530
|
+
<auro-header level="3" id="inputMode">Input Mode</auro-header>
|
|
531
|
+
<p>Set the <code>inputmode</code> for the input.</p>
|
|
532
|
+
<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>
|
|
533
|
+
<div class="exampleWrapper">
|
|
534
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
535
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
536
|
+
<auro-input inputmode="tel">
|
|
537
|
+
<span slot="label">Telephone</span>
|
|
538
|
+
<span slot="helpText">Help Text</span>
|
|
539
|
+
</auro-input>
|
|
540
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
541
|
+
</div>
|
|
542
|
+
<auro-accordion alignRight>
|
|
543
|
+
<span slot="trigger">See code</span>
|
|
544
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
545
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
546
|
+
<pre class="language-html"><code class="language-html"><auro-input inputmode="tel">
|
|
547
|
+
<span slot="label">Telephone</span>
|
|
548
|
+
<span slot="helpText">Help Text</span>
|
|
549
|
+
</auro-input></code></pre>
|
|
550
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
551
|
+
</auro-accordion>
|
|
552
|
+
<auro-header level="3" id="max">Max</auro-header>
|
|
553
|
+
<p>Use the <code>max</code> attribute to define a maximum value used during validation. The attribute will only apply when <code><auro-input></code> also has a <code>type</code> attribute for <code>number</code> or any date format.</p>
|
|
554
|
+
<p>The <code>setCustomValidityRangeOverflow</code> attribute may optionally be used in combination with the <code>max</code> attribute to define custom help text used when the input value is greater than the value of the <code>max</code> attribute.</p>
|
|
555
|
+
<auro-header level="4">Date Example</auro-header>
|
|
556
|
+
<div class="exampleWrapper">
|
|
557
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-date.html) -->
|
|
558
|
+
<!-- The below content is automatically added from ../apiExamples/max-date.html -->
|
|
559
|
+
<auro-input type="date" max="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
|
|
560
|
+
<span slot="label">Choose a date</span>
|
|
561
|
+
<span slot="helpText">Help Text</span>
|
|
562
|
+
</auro-input>
|
|
563
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
564
|
+
</div>
|
|
565
|
+
<auro-accordion alignRight>
|
|
566
|
+
<span slot="trigger">See code</span>
|
|
567
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-date.html) -->
|
|
568
|
+
<!-- The below code snippet is automatically added from ../apiExamples/max-date.html -->
|
|
569
|
+
<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.">
|
|
570
|
+
<span slot="label">Choose a date</span>
|
|
571
|
+
<span slot="helpText">Help Text</span>
|
|
572
|
+
</auro-input></code></pre>
|
|
573
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
574
|
+
</auro-accordion>
|
|
575
|
+
<auro-header level="4">Number Example</auro-header>
|
|
576
|
+
<div class="exampleWrapper">
|
|
577
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-number.html) -->
|
|
578
|
+
<!-- The below content is automatically added from ../apiExamples/max-number.html -->
|
|
579
|
+
<auro-input type="number" max="10" setCustomValidityRangeOverflow="The selected value is above the defined maximum.">
|
|
580
|
+
<span slot="label">Choose a number</span>
|
|
581
|
+
<span slot="helpText">Help Text</span>
|
|
582
|
+
</auro-input>
|
|
583
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
584
|
+
</div>
|
|
585
|
+
<auro-accordion alignRight>
|
|
586
|
+
<span slot="trigger">See code</span>
|
|
587
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-number.html) -->
|
|
588
|
+
<!-- The below code snippet is automatically added from ../apiExamples/max-number.html -->
|
|
589
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" max="10" setCustomValidityRangeOverflow="The selected value is above the defined maximum.">
|
|
590
|
+
<span slot="label">Choose a number</span>
|
|
591
|
+
<span slot="helpText">Help Text</span>
|
|
592
|
+
</auro-input></code></pre>
|
|
593
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
594
|
+
</auro-accordion>
|
|
595
|
+
<auro-header level="3" id="maxLength">Max Length</auro-header>
|
|
596
|
+
<p>Use the <code>maxlength</code> attribute to control the length of the input entered.</p>
|
|
597
|
+
<p>The <code>setCustomValidityTooLong</code> attribute may optionally be used in combination with the <code>maxLength</code> attribute to define custom help text used when the length of the input is too long.</p>
|
|
598
|
+
<p class="note"><strong>Note:</strong> This attribute is not intended to be used with a <code>type</code> or <code>format</code> that already has a defined length, such as credit-cards, dates or phone numbers.</p>
|
|
599
|
+
<div class="exampleWrapper">
|
|
600
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-length.html) -->
|
|
601
|
+
<!-- The below content is automatically added from ../apiExamples/max-length.html -->
|
|
602
|
+
<auro-input maxlength="12" setCustomValidityTooLong="Oops! There were too many characters entered." required>
|
|
603
|
+
<span slot="label">Voucher Code</span>
|
|
604
|
+
<span slot="helpText">Please enter your 12 character voucher code.</span>
|
|
605
|
+
</auro-input>
|
|
606
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
607
|
+
</div>
|
|
608
|
+
<auro-accordion alignRight>
|
|
609
|
+
<span slot="trigger">See code</span>
|
|
610
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-length.html) -->
|
|
611
|
+
<!-- The below code snippet is automatically added from ../apiExamples/max-length.html -->
|
|
612
|
+
<pre class="language-html"><code class="language-html"><auro-input maxlength="12" setCustomValidityTooLong="Oops! There were too many characters entered." required>
|
|
613
|
+
<span slot="label">Voucher Code</span>
|
|
614
|
+
<span slot="helpText">Please enter your 12 character voucher code.</span>
|
|
615
|
+
</auro-input></code></pre>
|
|
616
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
617
|
+
</auro-accordion>
|
|
618
|
+
<auro-header level="3" id="min">Min</auro-header>
|
|
619
|
+
<p>Use the <code>min</code> attribute to define a minimum value used during validation. The attribute will only apply when <code><auro-input></code> also has a <code>type</code> attribute for <code>number</code> or any date format.</p>
|
|
620
|
+
<p>The <code>setCustomValidityRangeUnderflow</code> attribute may optionally be used in combination with the <code>min</code> attribute to define custom help text used when the input value is less than the value of the <code>min</code> attribute.</p>
|
|
621
|
+
<auro-header level="4">Date Example</auro-header>
|
|
622
|
+
<div class="exampleWrapper">
|
|
623
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-date.html) -->
|
|
624
|
+
<!-- The below content is automatically added from ../apiExamples/min-date.html -->
|
|
625
|
+
<auro-input type="date" min="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
|
|
626
|
+
<span slot="label">Choose a date</span>
|
|
627
|
+
<span slot="helpText">Help Text</span>
|
|
628
|
+
</auro-input>
|
|
629
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
630
|
+
</div>
|
|
631
|
+
<auro-accordion alignRight>
|
|
632
|
+
<span slot="trigger">See code</span>
|
|
633
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-date.html) -->
|
|
634
|
+
<!-- The below code snippet is automatically added from ../apiExamples/min-date.html -->
|
|
635
|
+
<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.">
|
|
636
|
+
<span slot="label">Choose a date</span>
|
|
637
|
+
<span slot="helpText">Help Text</span>
|
|
638
|
+
</auro-input></code></pre>
|
|
639
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
640
|
+
</auro-accordion>
|
|
641
|
+
<auro-header level="4">Number Example</auro-header>
|
|
642
|
+
<div class="exampleWrapper">
|
|
643
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-number.html) -->
|
|
644
|
+
<!-- The below content is automatically added from ../apiExamples/min-number.html -->
|
|
645
|
+
<auro-input type="number" min="10" setCustomValidityRangeUnderflow="The selected value is below the defined minimum.">
|
|
646
|
+
<span slot="label">Choose a number</span>
|
|
647
|
+
<span slot="helpText">Help Text</span>
|
|
648
|
+
</auro-input>
|
|
649
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
650
|
+
</div>
|
|
651
|
+
<auro-accordion alignRight>
|
|
652
|
+
<span slot="trigger">See code</span>
|
|
653
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-number.html) -->
|
|
654
|
+
<!-- The below code snippet is automatically added from ../apiExamples/min-number.html -->
|
|
655
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" min="10" setCustomValidityRangeUnderflow="The selected value is below the defined minimum.">
|
|
656
|
+
<span slot="label">Choose a number</span>
|
|
657
|
+
<span slot="helpText">Help Text</span>
|
|
658
|
+
</auro-input></code></pre>
|
|
659
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
660
|
+
</auro-accordion>
|
|
661
|
+
<auro-header level="3" id="minLength">Min Length</auro-header>
|
|
662
|
+
<p>Use the <code>minlength</code> attribute to control the length of the input entered.</p>
|
|
663
|
+
<p>The <code>setCustomValidityTooShort</code> attribute may optionally be used in combination with the <code>minLength</code> attribute to define custom help text used when the length of the input is not long enough.</p>
|
|
664
|
+
<div class="exampleWrapper">
|
|
665
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-length.html) -->
|
|
666
|
+
<!-- The below content is automatically added from ../apiExamples/min-length.html -->
|
|
667
|
+
<auro-input minlength="4" setCustomValidityTooShort="Please enter a full voucher code." required>
|
|
668
|
+
<span slot="label">Voucher Code</span>
|
|
669
|
+
<span slot="helpText">Please enter your 4 character voucher code.</span>
|
|
670
|
+
</auro-input>
|
|
671
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
672
|
+
</div>
|
|
673
|
+
<auro-accordion alignRight>
|
|
674
|
+
<span slot="trigger">See code</span>
|
|
675
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-length.html) -->
|
|
676
|
+
<!-- The below code snippet is automatically added from ../apiExamples/min-length.html -->
|
|
677
|
+
<pre class="language-html"><code class="language-html"><auro-input minlength="4" setCustomValidityTooShort="Please enter a full voucher code." required>
|
|
678
|
+
<span slot="label">Voucher Code</span>
|
|
679
|
+
<span slot="helpText">Please enter your 4 character voucher code.</span>
|
|
680
|
+
</auro-input></code></pre>
|
|
681
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
682
|
+
</auro-accordion>
|
|
683
|
+
<auro-header level="3" id="name">Name</auro-header>
|
|
684
|
+
<p>Use the <code>name</code> attribute to set the form field name for the input. This populates the <code>name</code> attribute on the internal HTML input element, which is used to identify the field when the form is submitted.</p>
|
|
685
|
+
<p>The <code>id</code> attribute is for identifying an element for client-side styling (CSS) and behavior (JavaScript), while <code>name</code> is for sending data to a server during form submission.</p>
|
|
686
|
+
<div class="exampleWrapper">
|
|
687
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/name.html) -->
|
|
688
|
+
<!-- The below content is automatically added from ../apiExamples/name.html -->
|
|
689
|
+
<auro-input name="firstName">
|
|
690
|
+
<span slot="label">First Name</span>
|
|
691
|
+
<span slot="helpText">Enter your legal first name.</span>
|
|
692
|
+
</auro-input>
|
|
693
|
+
<auro-input name="lastName">
|
|
694
|
+
<span slot="label">Last Name</span>
|
|
695
|
+
<span slot="helpText">Enter your legal last name.</span>
|
|
696
|
+
</auro-input>
|
|
697
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
698
|
+
</div>
|
|
699
|
+
<auro-accordion alignRight>
|
|
700
|
+
<span slot="trigger">See code</span>
|
|
701
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/name.html) -->
|
|
702
|
+
<!-- The below code snippet is automatically added from ../apiExamples/name.html -->
|
|
703
|
+
<pre class="language-html"><code class="language-html"><auro-input name="firstName">
|
|
704
|
+
<span slot="label">First Name</span>
|
|
705
|
+
<span slot="helpText">Enter your legal first name.</span>
|
|
706
|
+
</auro-input>
|
|
707
|
+
<auro-input name="lastName">
|
|
708
|
+
<span slot="label">Last Name</span>
|
|
709
|
+
<span slot="helpText">Enter your legal last name.</span>
|
|
710
|
+
</auro-input></code></pre>
|
|
711
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
712
|
+
</auro-accordion>
|
|
713
|
+
<auro-header level="3" id="noValidate">No Validate</auro-header>
|
|
714
|
+
<p>For use cases where the field is <code>required</code>, but live validation is not wanted, use the <code>noValidate</code> attribute.</p>
|
|
715
|
+
<div class="exampleWrapper">
|
|
716
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/no-validate.html) -->
|
|
717
|
+
<!-- The below content is automatically added from ../apiExamples/no-validate.html -->
|
|
718
|
+
<auro-input noValidate required>
|
|
719
|
+
<span slot="label">Address</span>
|
|
720
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
721
|
+
</auro-input>
|
|
722
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
723
|
+
</div>
|
|
724
|
+
<auro-accordion alignRight>
|
|
725
|
+
<span slot="trigger">See code</span>
|
|
726
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/no-validate.html) -->
|
|
727
|
+
<!-- The below code snippet is automatically added from ../apiExamples/no-validate.html -->
|
|
728
|
+
<pre class="language-html"><code class="language-html"><auro-input noValidate required>
|
|
729
|
+
<span slot="label">Address</span>
|
|
730
|
+
<span slot="helpText">Please enter your home address.</span>
|
|
731
|
+
</auro-input></code></pre>
|
|
732
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
733
|
+
</auro-accordion>
|
|
734
|
+
<auro-header level="3" id="pattern">Pattern</auro-header>
|
|
735
|
+
<p>Use the <code>pattern</code> attribute to set custom input validation. This example also uses the <code>spellcheck</code> attribute set to <code>false</code> which in turn sets <code>autocorrect</code> to <code>off</code> and <code>autocapitalize</code> to <code>none</code>. Additionally the <code>maxlength</code> attribute sets the maximum length of characters that can be entered.</p>
|
|
736
|
+
<p>The <code><auro-input></code> component supports setting a custom validity message specific to the pattern validation by using the <code>setCustomValidityPatternMismatch</code> attribute.</p>
|
|
737
|
+
<div class="exampleWrapper">
|
|
738
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/pattern.html) -->
|
|
739
|
+
<!-- The below content is automatically added from ../apiExamples/pattern.html -->
|
|
740
|
+
<auro-input pattern="[a-z]{1,15}" spellcheck="false" setCustomValidityPatternMismatch="Only contain lowercase letters w/no spaces">
|
|
741
|
+
<span slot="label">Username</span>
|
|
742
|
+
<span slot="helpText">Please enter a username.</span>
|
|
743
|
+
</auro-input>
|
|
744
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
745
|
+
</div>
|
|
746
|
+
<auro-accordion alignRight>
|
|
747
|
+
<span slot="trigger">See code</span>
|
|
748
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/pattern.html) -->
|
|
749
|
+
<!-- The below code snippet is automatically added from ../apiExamples/pattern.html -->
|
|
750
|
+
<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">
|
|
751
|
+
<span slot="label">Username</span>
|
|
752
|
+
<span slot="helpText">Please enter a username.</span>
|
|
753
|
+
</auro-input></code></pre>
|
|
754
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
755
|
+
</auro-accordion>
|
|
756
|
+
<auro-header level="3" id="readonly">Readonly</auro-header>
|
|
757
|
+
<p>Use the <code>readonly</code> attribute to prevent the user from editing the value of the input.</p>
|
|
758
|
+
<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>
|
|
759
|
+
<div class="exampleWrapper">
|
|
760
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/readonly.html) -->
|
|
761
|
+
<!-- The below content is automatically added from ../apiExamples/readonly.html -->
|
|
762
|
+
<auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
763
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
764
|
+
<br /><br />
|
|
765
|
+
<auro-input readonly id="readonlyExample">
|
|
766
|
+
<span slot="label">Name</span>
|
|
767
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
768
|
+
</auro-input>
|
|
769
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
770
|
+
</div>
|
|
771
|
+
<auro-accordion alignRight>
|
|
772
|
+
<span slot="trigger">See code</span>
|
|
773
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.html) -->
|
|
774
|
+
<!-- The below code snippet is automatically added from ../apiExamples/readonly.html -->
|
|
775
|
+
<pre class="language-html"><code class="language-html"><auro-button id="setReadonlyValueBtn">Set Value to Auro Alaska</auro-button>
|
|
776
|
+
<auro-button id="resetReadonlyValueBtn">Reset</auro-button>
|
|
777
|
+
<br /><br />
|
|
778
|
+
<auro-input readonly id="readonlyExample">
|
|
779
|
+
<span slot="label">Name</span>
|
|
780
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
781
|
+
</auro-input></code></pre>
|
|
782
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
783
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/readonly.js) -->
|
|
784
|
+
<!-- The below code snippet is automatically added from ../apiExamples/readonly.js -->
|
|
785
|
+
<pre class="language-js"><code class="language-js">export function setReadonlyValue() {
|
|
786
|
+
const elem = document.querySelector('#readonlyExample');
|
|
787
|
+
|
|
788
|
+
// set value of auro-input element
|
|
789
|
+
document.querySelector('#setReadonlyValueBtn').addEventListener('click', () => {
|
|
790
|
+
elem.value = "Auro Alaska";
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
document.querySelector('#resetReadonlyValueBtn').addEventListener('click', () => {
|
|
794
|
+
elem.value = undefined;
|
|
795
|
+
});
|
|
796
|
+
}</code></pre>
|
|
797
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
798
|
+
</auro-accordion>
|
|
799
|
+
<auro-header level="3" id="required">Required</auro-header>
|
|
800
|
+
<p>When present, the <code>required</code> attribute specifies that an input field must be filled out before submitting the form.</p>
|
|
801
|
+
<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>
|
|
802
|
+
<div class="exampleWrapper">
|
|
803
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/required.html) -->
|
|
804
|
+
<!-- The below content is automatically added from ../apiExamples/required.html -->
|
|
805
|
+
<auro-input required placeholder="John Doe">
|
|
806
|
+
<span slot="label">Full name</span>
|
|
807
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
808
|
+
</auro-input>
|
|
809
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
810
|
+
</div>
|
|
811
|
+
<auro-accordion alignRight>
|
|
812
|
+
<span slot="trigger">See code</span>
|
|
813
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/required.html) -->
|
|
814
|
+
<!-- The below code snippet is automatically added from ../apiExamples/required.html -->
|
|
815
|
+
<pre class="language-html"><code class="language-html"><auro-input required placeholder="John Doe">
|
|
816
|
+
<span slot="label">Full name</span>
|
|
817
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
818
|
+
</auro-input></code></pre>
|
|
819
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
820
|
+
</auro-accordion>
|
|
821
|
+
<auro-header level="3" id="setCustomValidity">Custom Validation Messages</auro-header>
|
|
822
|
+
<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>
|
|
823
|
+
<ul>
|
|
824
|
+
<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>
|
|
825
|
+
<li><strong><code>setCustomValidityValueMissing</code></strong> — Displayed when the component is <code>required</code> and the user leaves it empty.</li>
|
|
826
|
+
<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>
|
|
827
|
+
<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>
|
|
828
|
+
<li><strong><code>setCustomValidityRangeOverflow</code></strong> — Displayed when the value exceeds the <code>max</code> constraint.</li>
|
|
829
|
+
<li><strong><code>setCustomValidityRangeUnderflow</code></strong> — Displayed when the value is below the <code>min</code> constraint.</li>
|
|
830
|
+
<li><strong><code>setCustomValidityTooLong</code></strong> — Displayed when the value exceeds the <code>maxlength</code> constraint.</li>
|
|
831
|
+
<li><strong><code>setCustomValidityTooShort</code></strong> — Displayed when the value is shorter than the <code>minlength</code> constraint.</li>
|
|
832
|
+
</ul>
|
|
833
|
+
<p>The priority order for error messages is: state-specific property > <code>setCustomValidity</code> > default browser message.</p>
|
|
834
|
+
<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>
|
|
835
|
+
<auro-header level="4">Fallback Message</auro-header>
|
|
836
|
+
<p>Use <code>setCustomValidity</code> to set a single message for all validation states.</p>
|
|
837
|
+
<div class="exampleWrapper">
|
|
838
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity.html) -->
|
|
839
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
840
|
+
<auro-input required minlength="3" setCustomValidity="Sorry, please enter your first and last name (one space required).">
|
|
841
|
+
<span slot="label">Full Name</span>
|
|
842
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
843
|
+
</auro-input>
|
|
844
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
845
|
+
</div>
|
|
846
|
+
<auro-accordion alignRight>
|
|
847
|
+
<span slot="trigger">See code</span>
|
|
848
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity.html) -->
|
|
849
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity.html -->
|
|
850
|
+
<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).">
|
|
851
|
+
<span slot="label">Full Name</span>
|
|
852
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
853
|
+
</auro-input></code></pre>
|
|
854
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
855
|
+
</auro-accordion>
|
|
856
|
+
<auro-header level="4">Value Missing</auro-header>
|
|
857
|
+
<p>Use <code>setCustomValidityValueMissing</code> to customize the message when a <code>required</code> field is left empty.</p>
|
|
858
|
+
<div class="exampleWrapper">
|
|
859
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
860
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
861
|
+
<auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
862
|
+
<span slot="label">Full Name</span>
|
|
863
|
+
<span slot="helpText">Enter your legal first and last name.</span>
|
|
864
|
+
</auro-input>
|
|
865
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
866
|
+
</div>
|
|
867
|
+
<auro-accordion alignRight>
|
|
868
|
+
<span slot="trigger">See code</span>
|
|
869
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-value-missing.html) -->
|
|
870
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-value-missing.html -->
|
|
871
|
+
<pre class="language-html"><code class="language-html"><auro-input required setCustomValidityValueMissing="Please enter your name to continue.">
|
|
872
|
+
<span slot="label">Full Name</span>
|
|
873
|
+
<span slot="helpText">Enter your legal first and last name.</span>
|
|
874
|
+
</auro-input></code></pre>
|
|
875
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
876
|
+
</auro-accordion>
|
|
877
|
+
<auro-header level="4">Type Validation</auro-header>
|
|
878
|
+
<p>Use <code>setCustomValidityForType</code> to customize the message when the value doesn't match the declared <code>type</code> format.</p>
|
|
879
|
+
<div class="exampleWrapper">
|
|
880
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
881
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
882
|
+
<auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
883
|
+
<span slot="label">Email Address</span>
|
|
884
|
+
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
885
|
+
</auro-input>
|
|
886
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
887
|
+
</div>
|
|
888
|
+
<auro-accordion alignRight>
|
|
889
|
+
<span slot="trigger">See code</span>
|
|
890
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-for-type.html) -->
|
|
891
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-for-type.html -->
|
|
892
|
+
<pre class="language-html"><code class="language-html"><auro-input type="email" setCustomValidityForType="Please provide a valid email address (e.g. name@example.com).">
|
|
893
|
+
<span slot="label">Email Address</span>
|
|
894
|
+
<span slot="helpText">We'll use this to send your confirmation.</span>
|
|
895
|
+
</auro-input></code></pre>
|
|
896
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
897
|
+
</auro-accordion>
|
|
898
|
+
<auro-header level="4">Bad Input</auro-header>
|
|
899
|
+
<p>Use <code>setCustomValidityBadInput</code> to customize the message when the browser considers the input malformed.</p>
|
|
900
|
+
<div class="exampleWrapper">
|
|
901
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
902
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
903
|
+
<auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
904
|
+
<span slot="label">Quantity</span>
|
|
905
|
+
<span slot="helpText">Enter the number of items.</span>
|
|
906
|
+
</auro-input>
|
|
907
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
908
|
+
</div>
|
|
909
|
+
<auro-accordion alignRight>
|
|
910
|
+
<span slot="trigger">See code</span>
|
|
911
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-bad-input.html) -->
|
|
912
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-bad-input.html -->
|
|
913
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" minlength="1" setCustomValidityBadInput="Please enter a valid whole number.">
|
|
914
|
+
<span slot="label">Quantity</span>
|
|
915
|
+
<span slot="helpText">Enter the number of items.</span>
|
|
916
|
+
</auro-input></code></pre>
|
|
917
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
918
|
+
</auro-accordion>
|
|
919
|
+
<auro-header level="4">Range Overflow</auro-header>
|
|
920
|
+
<p>Use <code>setCustomValidityRangeOverflow</code> to customize the message when the value exceeds the <code>max</code> constraint.</p>
|
|
921
|
+
<div class="exampleWrapper">
|
|
922
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
923
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
924
|
+
<auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
|
|
925
|
+
<span slot="label">Event Date</span>
|
|
926
|
+
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
927
|
+
</auro-input>
|
|
928
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
929
|
+
</div>
|
|
930
|
+
<auro-accordion alignRight>
|
|
931
|
+
<span slot="trigger">See code</span>
|
|
932
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
|
|
933
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
|
|
934
|
+
<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.">
|
|
935
|
+
<span slot="label">Event Date</span>
|
|
936
|
+
<span slot="helpText">Enter a date no later than 12/31/2025.</span>
|
|
937
|
+
</auro-input></code></pre>
|
|
938
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
939
|
+
</auro-accordion>
|
|
940
|
+
<auro-header level="4">Range Underflow</auro-header>
|
|
941
|
+
<p>Use <code>setCustomValidityRangeUnderflow</code> to customize the message when the value is below the <code>min</code> constraint.</p>
|
|
942
|
+
<div class="exampleWrapper">
|
|
943
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
944
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
945
|
+
<auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
|
|
946
|
+
<span slot="label">Start Date</span>
|
|
947
|
+
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
948
|
+
</auro-input>
|
|
949
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
950
|
+
</div>
|
|
951
|
+
<auro-accordion alignRight>
|
|
952
|
+
<span slot="trigger">See code</span>
|
|
953
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
|
|
954
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
|
|
955
|
+
<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.">
|
|
956
|
+
<span slot="label">Start Date</span>
|
|
957
|
+
<span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
|
|
958
|
+
</auro-input></code></pre>
|
|
959
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
960
|
+
</auro-accordion>
|
|
961
|
+
<auro-header level="4">Too Long</auro-header>
|
|
962
|
+
<p>Use <code>setCustomValidityTooLong</code> to customize the message when the value exceeds the <code>maxlength</code> constraint.</p>
|
|
963
|
+
<div class="exampleWrapper">
|
|
964
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
965
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
966
|
+
<auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
967
|
+
<span slot="label">Username</span>
|
|
968
|
+
<span slot="helpText">Maximum 10 characters.</span>
|
|
969
|
+
</auro-input>
|
|
970
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
971
|
+
</div>
|
|
972
|
+
<auro-accordion alignRight>
|
|
973
|
+
<span slot="trigger">See code</span>
|
|
974
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-long.html) -->
|
|
975
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-long.html -->
|
|
976
|
+
<pre class="language-html"><code class="language-html"><auro-input maxlength="10" setCustomValidityTooLong="Please shorten your entry to 10 characters or fewer.">
|
|
977
|
+
<span slot="label">Username</span>
|
|
978
|
+
<span slot="helpText">Maximum 10 characters.</span>
|
|
979
|
+
</auro-input></code></pre>
|
|
980
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
981
|
+
</auro-accordion>
|
|
982
|
+
<auro-header level="4">Too Short</auro-header>
|
|
983
|
+
<p>Use <code>setCustomValidityTooShort</code> to customize the message when the value is shorter than the <code>minlength</code> constraint.</p>
|
|
984
|
+
<div class="exampleWrapper">
|
|
985
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
986
|
+
<!-- The below content is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
987
|
+
<auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
988
|
+
<span slot="label">Nickname</span>
|
|
989
|
+
<span slot="helpText">Minimum 3 characters.</span>
|
|
990
|
+
</auro-input>
|
|
991
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
992
|
+
</div>
|
|
993
|
+
<auro-accordion alignRight>
|
|
994
|
+
<span slot="trigger">See code</span>
|
|
995
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-too-short.html) -->
|
|
996
|
+
<!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-too-short.html -->
|
|
997
|
+
<pre class="language-html"><code class="language-html"><auro-input minlength="3" setCustomValidityTooShort="Please enter at least 3 characters.">
|
|
998
|
+
<span slot="label">Nickname</span>
|
|
999
|
+
<span slot="helpText">Minimum 3 characters.</span>
|
|
1000
|
+
</auro-input></code></pre>
|
|
1001
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1002
|
+
</auro-accordion>
|
|
1003
|
+
<auro-header level="3" id="type">Type</auro-header>
|
|
1004
|
+
<auro-header level="4" id="typePassword">Password</auro-header>
|
|
1005
|
+
<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>
|
|
1006
|
+
<p>Default help text will be added to the input <code>type="password"</code> if custom help text is not provided.</p>
|
|
1007
|
+
<div class="exampleWrapper">
|
|
1008
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/password.html) -->
|
|
1009
|
+
<!-- The below content is automatically added from ../apiExamples/password.html -->
|
|
1010
|
+
<auro-input type="password" required>
|
|
1011
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
1012
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
1013
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1014
|
+
<span slot="label">Password</span>
|
|
1015
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
1016
|
+
</auro-input>
|
|
1017
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1018
|
+
</div>
|
|
1019
|
+
<auro-accordion alignRight>
|
|
1020
|
+
<span slot="trigger">See code</span>
|
|
1021
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/password.html) -->
|
|
1022
|
+
<!-- The below code snippet is automatically added from ../apiExamples/password.html -->
|
|
1023
|
+
<pre class="language-html"><code class="language-html"><auro-input type="password" required>
|
|
1024
|
+
<span slot="ariaLabel.clear">Clear All</span>
|
|
1025
|
+
<span slot="ariaLabel.password.show">Show</span>
|
|
1026
|
+
<span slot="ariaLabel.password.hide">Hide</span>
|
|
1027
|
+
<span slot="label">Password</span>
|
|
1028
|
+
<span slot="helpText">Please enter a secure password.</span>
|
|
1029
|
+
</auro-input></code></pre>
|
|
1030
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1031
|
+
</auro-accordion>
|
|
1032
|
+
<auro-header level="4" id="typeEmail">Email</auro-header>
|
|
1033
|
+
<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>
|
|
1034
|
+
<p>Default help text will be added to the input <code>type="email"</code> if custom help text is not provided.</p>
|
|
1035
|
+
<div class="exampleWrapper">
|
|
1036
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/email.html) -->
|
|
1037
|
+
<!-- The below content is automatically added from ../apiExamples/email.html -->
|
|
1038
|
+
<auro-input type="email" required>
|
|
1039
|
+
<span slot="label">Email address</span>
|
|
1040
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
1041
|
+
</auro-input>
|
|
1042
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1043
|
+
</div>
|
|
1044
|
+
<auro-accordion alignRight>
|
|
1045
|
+
<span slot="trigger">See code</span>
|
|
1046
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/email.html) -->
|
|
1047
|
+
<!-- The below code snippet is automatically added from ../apiExamples/email.html -->
|
|
1048
|
+
<pre class="language-html"><code class="language-html"><auro-input type="email" required>
|
|
1049
|
+
<span slot="label">Email address</span>
|
|
1050
|
+
<span slot="helpText">Please enter your email address.</span>
|
|
1051
|
+
</auro-input></code></pre>
|
|
1052
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1053
|
+
</auro-accordion>
|
|
1054
|
+
<auro-header level="4" id="typeNumber">Number</auro-header>
|
|
1055
|
+
<p>Use the <code>type="number"</code> attribute for a numeric style input and invoke a numeric virtual keyboard on handheld devices.</p>
|
|
1056
|
+
<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>
|
|
1057
|
+
<p class="note"><strong>Note:</strong> We recommend using <code>type="number"</code> with <code>inputmode="numeric"</code> for the best mobile experience.</p>
|
|
1058
|
+
<div class="exampleWrapper">
|
|
1059
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/number.html) -->
|
|
1060
|
+
<!-- The below content is automatically added from ../apiExamples/number.html -->
|
|
1061
|
+
<auro-input type="number" required>
|
|
1062
|
+
<span slot="label">Number of Passengers</span>
|
|
1063
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
1064
|
+
</auro-input>
|
|
1065
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1066
|
+
</div>
|
|
1067
|
+
<auro-accordion alignRight>
|
|
1068
|
+
<span slot="trigger">See code</span>
|
|
1069
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/number.html) -->
|
|
1070
|
+
<!-- The below code snippet is automatically added from ../apiExamples/number.html -->
|
|
1071
|
+
<pre class="language-html"><code class="language-html"><auro-input type="number" required>
|
|
1072
|
+
<span slot="label">Number of Passengers</span>
|
|
1073
|
+
<span slot="helpText">Please enter the number of passengers.</span>
|
|
1074
|
+
</auro-input></code></pre>
|
|
1075
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1076
|
+
</auro-accordion>
|
|
1077
|
+
<auro-header level="4" id="typeCreditCard">Credit Card</auro-header>
|
|
1078
|
+
<p>Use the <code>type="credit-card"</code> attribute for a credit card formatted input.</p>
|
|
1079
|
+
<p>Default help text will be added to the input <code>type="credit-card"</code> if custom help text is not provided.</p>
|
|
1080
|
+
<div class="exampleWrapper">
|
|
1081
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/credit-card.html) -->
|
|
1082
|
+
<!-- The below content is automatically added from ../apiExamples/credit-card.html -->
|
|
1083
|
+
<auro-input type="credit-card" required>
|
|
1084
|
+
<span slot="label">Card number</span>
|
|
1085
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</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/credit-card.html) -->
|
|
1092
|
+
<!-- The below code snippet is automatically added from ../apiExamples/credit-card.html -->
|
|
1093
|
+
<pre class="language-html"><code class="language-html"><auro-input type="credit-card" required>
|
|
1094
|
+
<span slot="label">Card number</span>
|
|
1095
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
1096
|
+
</auro-input></code></pre>
|
|
1097
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1098
|
+
</auro-accordion>
|
|
1099
|
+
<p>Use the <code>type="credit-card"</code> and <code>icon</code> attributes for a credit card formatted input with credit card icon support.</p>
|
|
1100
|
+
<div class="exampleWrapper">
|
|
1101
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/credit-card-icon.html) -->
|
|
1102
|
+
<!-- The below content is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
1103
|
+
<auro-input icon type="credit-card" required>
|
|
1104
|
+
<span slot="label">Card number</span>
|
|
1105
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
1106
|
+
</auro-input>
|
|
1107
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1108
|
+
</div>
|
|
1109
|
+
<auro-accordion alignRight>
|
|
1110
|
+
<span slot="trigger">See code</span>
|
|
1111
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/credit-card-icon.html) -->
|
|
1112
|
+
<!-- The below code snippet is automatically added from ../apiExamples/credit-card-icon.html -->
|
|
1113
|
+
<pre class="language-html"><code class="language-html"><auro-input icon type="credit-card" required>
|
|
1114
|
+
<span slot="label">Card number</span>
|
|
1115
|
+
<span slot="helpText">Valid credit card numbers must include 16 digits (15 for Amex).</span>
|
|
1116
|
+
</auro-input></code></pre>
|
|
1117
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1118
|
+
</auro-accordion>
|
|
1119
|
+
<auro-header level="4" id="typePhone">Phone Number</auro-header>
|
|
1120
|
+
<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>
|
|
1121
|
+
<p class="note"><strong>Note:</strong> We recommend using <code>type="tel"</code> with <code>inputmode="tel"</code> for the best mobile experience.</p>
|
|
1122
|
+
<div class="exampleWrapper">
|
|
1123
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel.html) -->
|
|
1124
|
+
<!-- The below content is automatically added from ../apiExamples/tel.html -->
|
|
1125
|
+
<auro-input type="tel">
|
|
1126
|
+
<span slot="label">Telephone</span>
|
|
1127
|
+
<span slot="helpText">Help Text</span>
|
|
1128
|
+
</auro-input>
|
|
1129
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1130
|
+
</div>
|
|
1131
|
+
<auro-accordion alignRight>
|
|
1132
|
+
<span slot="trigger">See code</span>
|
|
1133
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel.html) -->
|
|
1134
|
+
<!-- The below code snippet is automatically added from ../apiExamples/tel.html -->
|
|
1135
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel">
|
|
1136
|
+
<span slot="label">Telephone</span>
|
|
1137
|
+
<span slot="helpText">Help Text</span>
|
|
1138
|
+
</auro-input></code></pre>
|
|
1139
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1140
|
+
</auro-accordion>
|
|
1141
|
+
<p>Use the <code>format</code> attribute to set a custom phone number format.</p>
|
|
1142
|
+
<div class="exampleWrapper">
|
|
1143
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/tel-format.html) -->
|
|
1144
|
+
<!-- The below content is automatically added from ../apiExamples/tel-format.html -->
|
|
1145
|
+
<auro-input type="tel" format="+00 000 00 0000">
|
|
1146
|
+
<span slot="label">Telephone</span>
|
|
1147
|
+
<span slot="helpText">Help Text</span>
|
|
1148
|
+
</auro-input>
|
|
1149
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1150
|
+
</div>
|
|
1151
|
+
<auro-accordion alignRight>
|
|
1152
|
+
<span slot="trigger">See code</span>
|
|
1153
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/tel-format.html) -->
|
|
1154
|
+
<!-- The below code snippet is automatically added from ../apiExamples/tel-format.html -->
|
|
1155
|
+
<pre class="language-html"><code class="language-html"><auro-input type="tel" format="+00 000 00 0000">
|
|
1156
|
+
<span slot="label">Telephone</span>
|
|
1157
|
+
<span slot="helpText">Help Text</span>
|
|
1158
|
+
</auro-input></code></pre>
|
|
1159
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1160
|
+
</auro-accordion>
|
|
1161
|
+
<auro-header level="4" id="typeDate">Date</auro-header>
|
|
1162
|
+
<p>Use the <code>type="date"</code> attribute for a date formatted input. The default date format is <code>mm/dd/yyyy</code>.</p>
|
|
1163
|
+
<div class="exampleWrapper">
|
|
1164
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/month-day-year.html) -->
|
|
1165
|
+
<!-- The below content is automatically added from ../apiExamples/month-day-year.html -->
|
|
1166
|
+
<auro-input type="date">
|
|
1167
|
+
<span slot="label">Arrival date</span>
|
|
1168
|
+
<span slot="helpText">Help Text</span>
|
|
1169
|
+
</auro-input>
|
|
1170
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1171
|
+
</div>
|
|
1172
|
+
<auro-accordion alignRight>
|
|
1173
|
+
<span slot="trigger">See code</span>
|
|
1174
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/month-day-year.html) -->
|
|
1175
|
+
<!-- The below code snippet is automatically added from ../apiExamples/month-day-year.html -->
|
|
1176
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date">
|
|
1177
|
+
<span slot="label">Arrival date</span>
|
|
1178
|
+
<span slot="helpText">Help Text</span>
|
|
1179
|
+
</auro-input></code></pre>
|
|
1180
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1181
|
+
</auro-accordion>
|
|
1182
|
+
<p>Use the <code>format</code> attribute to put together any combination of <code>mm</code>, <code>dd</code>, & <code>yyyy</code> or <code>yy</code>.</p>
|
|
1183
|
+
<div class="exampleWrapper">
|
|
1184
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/year-month-day.html) -->
|
|
1185
|
+
<!-- The below content is automatically added from ../apiExamples/year-month-day.html -->
|
|
1186
|
+
<auro-input type="date" format="yyyy/mm/dd">
|
|
1187
|
+
<span slot="label">Arrival date</span>
|
|
1188
|
+
<span slot="helpText">Help Text</span>
|
|
1189
|
+
</auro-input>
|
|
1190
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1191
|
+
</div>
|
|
1192
|
+
<auro-accordion alignRight>
|
|
1193
|
+
<span slot="trigger">See code</span>
|
|
1194
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/year-month-day.html) -->
|
|
1195
|
+
<!-- The below code snippet is automatically added from ../apiExamples/year-month-day.html -->
|
|
1196
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="yyyy/mm/dd">
|
|
1197
|
+
<span slot="label">Arrival date</span>
|
|
1198
|
+
<span slot="helpText">Help Text</span>
|
|
1199
|
+
</auro-input></code></pre>
|
|
1200
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1201
|
+
</auro-accordion>
|
|
1202
|
+
<div class="exampleWrapper">
|
|
1203
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/month-year.html) -->
|
|
1204
|
+
<!-- The below content is automatically added from ../apiExamples/month-year.html -->
|
|
1205
|
+
<auro-input type="date" format="mm/yy">
|
|
1206
|
+
<span slot="label">Expiration date</span>
|
|
1207
|
+
<span slot="helpText">Help Text</span>
|
|
1208
|
+
</auro-input>
|
|
1209
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1210
|
+
</div>
|
|
1211
|
+
<auro-accordion alignRight>
|
|
1212
|
+
<span slot="trigger">See code</span>
|
|
1213
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/month-year.html) -->
|
|
1214
|
+
<!-- The below code snippet is automatically added from ../apiExamples/month-year.html -->
|
|
1215
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="mm/yy">
|
|
1216
|
+
<span slot="label">Expiration date</span>
|
|
1217
|
+
<span slot="helpText">Help Text</span>
|
|
1218
|
+
</auro-input></code></pre>
|
|
1219
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1220
|
+
</auro-accordion>
|
|
1221
|
+
<div class="exampleWrapper">
|
|
1222
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/day.html) -->
|
|
1223
|
+
<!-- The below content is automatically added from ../apiExamples/day.html -->
|
|
1224
|
+
<auro-input type="date" format="dd">
|
|
1225
|
+
<span slot="label">Day</span>
|
|
1226
|
+
<span slot="helpText">Help Text</span>
|
|
1227
|
+
</auro-input>
|
|
1228
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1229
|
+
</div>
|
|
1230
|
+
<auro-accordion alignRight>
|
|
1231
|
+
<span slot="trigger">See code</span>
|
|
1232
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/day.html) -->
|
|
1233
|
+
<!-- The below code snippet is automatically added from ../apiExamples/day.html -->
|
|
1234
|
+
<pre class="language-html"><code class="language-html"><auro-input type="date" format="dd">
|
|
1235
|
+
<span slot="label">Day</span>
|
|
1236
|
+
<span slot="helpText">Help Text</span>
|
|
1237
|
+
</auro-input></code></pre>
|
|
1238
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1239
|
+
</auro-accordion>
|
|
1240
|
+
<auro-header level="3" id="validateOnInput">Validate on Input</auro-header>
|
|
1241
|
+
<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>
|
|
1242
|
+
<div class="exampleWrapper">
|
|
1243
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/validate-on-input.html) -->
|
|
1244
|
+
<!-- The below content is automatically added from ../apiExamples/validate-on-input.html -->
|
|
1245
|
+
<auro-input validateOnInput required pattern="[a-zA-Z-.']+( +[a-zA-Z-.']+)+" setCustomValidityPatternMismatch="Full name requires two or more names with at least one space.">
|
|
1246
|
+
<span slot="label">Full Name</span>
|
|
1247
|
+
<span slot="helpText">Please enter your full name as it appears on the card.</span>
|
|
1248
|
+
</auro-input>
|
|
1249
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1250
|
+
</div>
|
|
1251
|
+
<auro-accordion alignRight>
|
|
1252
|
+
<span slot="trigger">See code</span>
|
|
1253
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/validate-on-input.html) -->
|
|
1254
|
+
<!-- The below code snippet is automatically added from ../apiExamples/validate-on-input.html -->
|
|
1255
|
+
<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.">
|
|
1256
|
+
<span slot="label">Full Name</span>
|
|
1257
|
+
<span slot="helpText">Please enter your full name as it appears on the card.</span>
|
|
1258
|
+
</auro-input></code></pre>
|
|
1259
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1260
|
+
</auro-accordion>
|
|
1261
|
+
<auro-header level="3" id="value">Value</auro-header>
|
|
1262
|
+
<auro-header level="4" id="valueProgrammatic">Programmatic</auro-header>
|
|
1263
|
+
<p>Use the <code>value</code> attribute to programmatically set the value of the input.</p>
|
|
1264
|
+
<div class="exampleWrapper">
|
|
1265
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/programmatic-value.html) -->
|
|
1266
|
+
<!-- The below content is automatically added from ../apiExamples/programmatic-value.html -->
|
|
1267
|
+
<auro-input value="Alaska Airlines is the best!">
|
|
1268
|
+
<span slot="label">Name</span>
|
|
1269
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1270
|
+
</auro-input>
|
|
1271
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1272
|
+
</div>
|
|
1273
|
+
<auro-accordion alignRight>
|
|
1274
|
+
<span slot="trigger">See code</span>
|
|
1275
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/programmatic-value.html) -->
|
|
1276
|
+
<!-- The below code snippet is automatically added from ../apiExamples/programmatic-value.html -->
|
|
1277
|
+
<pre class="language-html"><code class="language-html"><auro-input value="Alaska Airlines is the best!">
|
|
1278
|
+
<span slot="label">Name</span>
|
|
1279
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1280
|
+
</auro-input></code></pre>
|
|
1281
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1282
|
+
</auro-accordion>
|
|
1283
|
+
</section>
|
|
1284
|
+
<section>
|
|
1285
|
+
<auro-header level="2" id="resetState">Reset State</auro-header>
|
|
1286
|
+
<p>Use the <code>reset()</code> method to reset the <code><auro-input></code>'s <code>value</code> and <code>validity</code> state. Doing so will preserve all other attributes and properties.</p>
|
|
1287
|
+
<div class="exampleWrapper">
|
|
1288
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/reset-state.html) -->
|
|
1289
|
+
<!-- The below content is automatically added from ../apiExamples/reset-state.html -->
|
|
1290
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1291
|
+
<br /><br />
|
|
1292
|
+
<auro-input id="resetStateExample" minlength="12" value="Auro Team" setCustomValidityTooShort="Please enter your full name!">
|
|
1293
|
+
<span slot="label">Full Name</span>
|
|
1294
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1295
|
+
</auro-input>
|
|
1296
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1297
|
+
</div>
|
|
1298
|
+
<auro-accordion alignRight>
|
|
1299
|
+
<span slot="trigger">See code</span>
|
|
1300
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/reset-state.html) -->
|
|
1301
|
+
<!-- The below code snippet is automatically added from ../apiExamples/reset-state.html -->
|
|
1302
|
+
<pre class="language-html"><code class="language-html"><auro-button id="resetStateBtn">Reset</auro-button>
|
|
1303
|
+
<br /><br />
|
|
1304
|
+
<auro-input id="resetStateExample" minlength="12" value="Auro Team" setCustomValidityTooShort="Please enter your full name!">
|
|
1305
|
+
<span slot="label">Full Name</span>
|
|
1306
|
+
<span slot="helpText">Please enter your full name.</span>
|
|
1307
|
+
</auro-input></code></pre>
|
|
1308
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1309
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/reset-state.js) -->
|
|
1310
|
+
<!-- The below code snippet is automatically added from ../apiExamples/reset-state.js -->
|
|
1311
|
+
<pre class="language-js"><code class="language-js">export function resetStateExample() {
|
|
1312
|
+
const elem = document.querySelector('#resetStateExample');
|
|
1313
|
+
|
|
1314
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1315
|
+
elem.reset();
|
|
1316
|
+
});
|
|
1317
|
+
}</code></pre>
|
|
1318
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1319
|
+
</auro-accordion>
|
|
1320
|
+
</section>
|
|
1321
|
+
<section>
|
|
1322
|
+
<auro-header level="2" id="swapValues">Swapping Values Between Inputs</auro-header>
|
|
1323
|
+
<p>Example illustrates using a JavaScript function attached to an <code>auro-button</code> component <code>click</code> event to swap the values of two <code>auro-input</code> elements. An example of this use case would be swapping the departure and arrival airports in a flight search form.</p>
|
|
1324
|
+
<div class="exampleWrapper">
|
|
1325
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/swap-value.html) -->
|
|
1326
|
+
<!-- The below content is automatically added from ../apiExamples/swap-value.html -->
|
|
1327
|
+
<auro-input id="swapExampleLeft">
|
|
1328
|
+
<span slot="label">Left Input</span>
|
|
1329
|
+
<span slot="helpText">Help Text</span>
|
|
1330
|
+
</auro-input>
|
|
1331
|
+
<auro-button id="swapExampleBtn">Swap Values</auro-button>
|
|
1332
|
+
<auro-input id="swapExampleRight">
|
|
1333
|
+
<span slot="label">Right Input</span>
|
|
1334
|
+
<span slot="helpText">Help Text</span>
|
|
1335
|
+
</auro-input>
|
|
1336
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1337
|
+
</div>
|
|
1338
|
+
<auro-accordion alignRight>
|
|
1339
|
+
<span slot="trigger">See code</span>
|
|
1340
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/swap-value.html) -->
|
|
1341
|
+
<!-- The below code snippet is automatically added from ../apiExamples/swap-value.html -->
|
|
1342
|
+
<pre class="language-html"><code class="language-html"><auro-input id="swapExampleLeft">
|
|
1343
|
+
<span slot="label">Left Input</span>
|
|
1344
|
+
<span slot="helpText">Help Text</span>
|
|
1345
|
+
</auro-input>
|
|
1346
|
+
<auro-button id="swapExampleBtn">Swap Values</auro-button>
|
|
1347
|
+
<auro-input id="swapExampleRight">
|
|
1348
|
+
<span slot="label">Right Input</span>
|
|
1349
|
+
<span slot="helpText">Help Text</span>
|
|
1350
|
+
</auro-input></code></pre>
|
|
1351
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1352
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/swap-value.js) -->
|
|
1353
|
+
<!-- The below code snippet is automatically added from ../apiExamples/swap-value.js -->
|
|
1354
|
+
<pre class="language-js"><code class="language-js">export function swapInputValues() {
|
|
1355
|
+
const btn = document.querySelector('#swapExampleBtn');
|
|
1356
|
+
const inputOne = document.querySelector('#swapExampleLeft');
|
|
1357
|
+
const inputTwo = document.querySelector('#swapExampleRight');
|
|
1358
|
+
|
|
1359
|
+
btn.addEventListener('click', () => {
|
|
1360
|
+
const valueOne = inputOne.value;
|
|
1361
|
+
const valueTwo = inputTwo.value;
|
|
1362
|
+
|
|
1363
|
+
inputOne.value = valueTwo;
|
|
1364
|
+
inputTwo.value = valueOne;
|
|
1365
|
+
});
|
|
1366
|
+
}</code></pre>
|
|
1367
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1368
|
+
</auro-accordion>
|
|
1369
|
+
</section>
|
|
1370
|
+
</div>
|
|
1371
|
+
</div>
|
|
1372
|
+
</div>
|