|
| 1 | +--- |
| 2 | +title: Email Input |
| 3 | +minver: 0.20.0 |
| 4 | +also: |
| 5 | + components/email/test.html: Testing - Email Input |
| 6 | + elements/hx-email-control/index.html: <hx-email-control> |
| 7 | +--- |
| 8 | +{% extends 'component.njk' %} |
| 9 | + |
| 10 | +{% block page_header %} |
| 11 | +<p> |
| 12 | + The {{page.title}} component provides supplmental markup to define |
| 13 | + and style an email address input control. |
| 14 | +</p> |
| 15 | +{% endblock %} |
| 16 | + |
| 17 | +{% block content %} |
| 18 | +<section> |
| 19 | + <header> |
| 20 | + <h2 id="basic-email-input">Basic Email Input</h2> |
| 21 | + {# TODO: add section description #} |
| 22 | + </header> |
| 23 | + |
| 24 | + <div class="example" id="vue-emailInputDemo" v-cloak> |
| 25 | + <header> |
| 26 | + <form class="beta-hxForm"> |
| 27 | + <fieldset> |
| 28 | + <legend class="beta-hxFieldName">Label Annotation</legend> |
| 29 | + <hx-radio-set> |
| 30 | + <hx-radio-control> |
| 31 | + <input |
| 32 | + id="radHasAsterisk" |
| 33 | + name="radReqOp" |
| 34 | + type="radio" |
| 35 | + value="hxRequired" |
| 36 | + v-model="labelState" |
| 37 | + /> |
| 38 | + <label for="radHasAsterisk"> |
| 39 | + <hx-radio></hx-radio> |
| 40 | + Required |
| 41 | + </label> |
| 42 | + </hx-radio-control> |
| 43 | + <hx-radio-control> |
| 44 | + <input |
| 45 | + id="radHasOptional" |
| 46 | + name="radReqOp" |
| 47 | + type="radio" |
| 48 | + value="hxOptional" |
| 49 | + v-model="labelState" |
| 50 | + /> |
| 51 | + <label for="radHasOptional"> |
| 52 | + <hx-radio></hx-radio> |
| 53 | + Optional |
| 54 | + </label> |
| 55 | + </hx-radio-control> |
| 56 | + </hx-radio-set> |
| 57 | + </fieldset> |
| 58 | + |
| 59 | + <fieldset> |
| 60 | + <legend class="beta-hxFieldName">Control Options</legend> |
| 61 | + <hx-checkbox-control> |
| 62 | + <input id="chkDisabled" type="checkbox" v-model="isDisabled" /> |
| 63 | + <label for="chkDisabled"> |
| 64 | + <hx-checkbox></hx-checkbox> |
| 65 | + Disabled |
| 66 | + </label> |
| 67 | + </hx-checkbox-control> |
| 68 | + |
| 69 | + <hx-checkbox-control> |
| 70 | + <input id="chkRequired" type="checkbox" v-model="isRequired" /> |
| 71 | + <label for="chkRequired"> |
| 72 | + <hx-checkbox></hx-checkbox> |
| 73 | + Required |
| 74 | + </label> |
| 75 | + <p> |
| 76 | + (Invalid styling applied <i>after</i> user interaction.) |
| 77 | + </p> |
| 78 | + </hx-checkbox-control> |
| 79 | + </fieldset> |
| 80 | + |
| 81 | + <fieldset> |
| 82 | + <legend class="beta-hxFieldName">Optional Text</legend> |
| 83 | + <hx-checkbox-control> |
| 84 | + <input |
| 85 | + id="chkHasHelpText" |
| 86 | + type="checkbox" |
| 87 | + v-model="helpTextToDisplay" |
| 88 | + /> |
| 89 | + <label for="chkHasHelpText"> |
| 90 | + <hx-checkbox></hx-checkbox> |
| 91 | + Help Text |
| 92 | + </label> |
| 93 | + </hx-checkbox-control> |
| 94 | + <hx-checkbox-control> |
| 95 | + <input |
| 96 | + id="chkHasErrorText" |
| 97 | + type="checkbox" |
| 98 | + v-model="errorTextToDisplay" |
| 99 | + /> |
| 100 | + <label for="chkHasErrorText"> |
| 101 | + <hx-checkbox></hx-checkbox> |
| 102 | + Error Text |
| 103 | + </label> |
| 104 | + </hx-checkbox-control> |
| 105 | + <hx-text-control> |
| 106 | + <input |
| 107 | + id="txtHelpText" |
| 108 | + type="text" |
| 109 | + v-model="helpText" |
| 110 | + :disabled="!helpTextToDisplay" |
| 111 | + /> |
| 112 | + <label for="txtHelpText"> |
| 113 | + Help Text |
| 114 | + </label> |
| 115 | + </hx-text-control> |
| 116 | + <hx-text-control> |
| 117 | + <input |
| 118 | + id="txtErrorText" |
| 119 | + type="text" |
| 120 | + v-model="errorText" |
| 121 | + :disabled="!errorTextToDisplay" |
| 122 | + /> |
| 123 | + <label for="txtErrorText"> |
| 124 | + Error Text |
| 125 | + </label> |
| 126 | + </hx-text-control> |
| 127 | + </fieldset> |
| 128 | + </form> |
| 129 | + </header> |
| 130 | + |
| 131 | + <div> |
| 132 | + <hx-email-control> |
| 133 | + <input |
| 134 | + id="emailInputDemo" |
| 135 | + type="email" |
| 136 | + placeholder="Please enter your email" |
| 137 | + :disabled="isDisabled" |
| 138 | + :required="isRequired" |
| 139 | + /> |
| 140 | + <label |
| 141 | + for="emailInputDemo" |
| 142 | + :class="labelState" |
| 143 | + > |
| 144 | + {% raw %}{{label}}{% endraw %} |
| 145 | + </label> |
| 146 | + <p class="hxHelpText" :hidden="!helpTextToDisplay"> |
| 147 | + {% raw %}{{helpText}} {% endraw %} |
| 148 | + </p> |
| 149 | + <p class="hxErrorText" :hidden="!errorTextToDisplay"> |
| 150 | + <hx-error> |
| 151 | + {% raw %}{{errorText}} {% endraw %} |
| 152 | + </hx-error> |
| 153 | + </p> |
| 154 | + </hx-email-control> |
| 155 | + </div> |
| 156 | + |
| 157 | + <footer> |
| 158 | + <pre><code v-text="snippet"></code></pre> |
| 159 | + </footer> |
| 160 | + </div> |
| 161 | + |
| 162 | + <footer> |
| 163 | + <p class="hxSubBody hxSubdued"> |
| 164 | + <hx-icon type="exclamation-triangle"></hx-icon> |
| 165 | + The <code><input></code> element <i>must</i> have the |
| 166 | + <code>type="email"</code> attribute, in order for CSS styles |
| 167 | + to apply. |
| 168 | + </p> |
| 169 | + </footer> |
| 170 | +</section> |
| 171 | + |
| 172 | +{% endblock %} |
0 commit comments