51
51
< ion-content id ="content " class ="ion-padding ">
52
52
< div class ="grid ">
53
53
< div class ="grid-item ">
54
- < h2 > No Fill / Start</ h2 >
54
+ < h2 > No Fill / Start Label </ h2 >
55
55
< ion-textarea label-placement ="
start "
value ="
[email protected] "
>
56
56
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
57
57
</ ion-textarea >
58
58
</ div >
59
59
60
60
< div class ="grid-item ">
61
- < h2 > Solid / Start</ h2 >
61
+ < h2 > Solid / Start Label </ h2 >
62
62
< ion-textarea label-placement ="
start "
fill ="
solid "
value ="
[email protected] "
>
63
63
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
64
64
</ ion-textarea >
65
65
</ div >
66
66
67
67
< div class ="grid-item ">
68
- < h2 > Outline / Start</ h2 >
68
+ < h2 > Outline / Start Label </ h2 >
69
69
< ion-textarea label-placement ="
start "
fill ="
outline "
value ="
[email protected] "
>
70
70
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
71
71
</ ion-textarea >
72
72
</ div >
73
73
74
74
< div class ="grid-item ">
75
- < h2 > No Fill / Floating</ h2 >
75
+ < h2 > No Fill / Floating Label </ h2 >
76
76
< ion-textarea label-placement ="
floating "
value ="
[email protected] "
>
77
77
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
78
78
</ ion-textarea >
79
79
</ div >
80
80
81
81
< div class ="grid-item ">
82
- < h2 > Solid / Floating</ h2 >
82
+ < h2 > Solid / Floating Label </ h2 >
83
83
< ion-textarea label-placement ="
floating "
fill ="
solid "
value ="
[email protected] "
>
84
84
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
85
85
</ ion-textarea >
86
86
</ div >
87
87
88
88
< div class ="grid-item ">
89
- < h2 > Outline / Floating</ h2 >
89
+ < h2 > Outline / Floating Label </ h2 >
90
90
< ion-textarea label-placement ="
floating "
fill ="
outline "
value ="
[email protected] "
>
91
91
< div slot ="label "> Email < span class ="required "> *</ span > </ div >
92
92
</ ion-textarea >
93
93
</ div >
94
94
95
95
< div class ="grid-item ">
96
- < h2 > Outline / Floating / Async</ h2 >
96
+ < h2 > No Fill / Start Label / Buttons</ h2 >
97
+ < ion-textarea label-placement ="
start "
value ="
[email protected] "
label ="
Email "
>
98
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
99
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
100
+ </ ion-button >
101
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
102
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
103
+ </ ion-button >
104
+ </ ion-textarea >
105
+ </ div >
106
+
107
+ < div class ="grid-item ">
108
+ < h2 > Solid / Start Label / Buttons</ h2 >
109
+ < ion-textarea label-placement ="
start "
fill ="
solid "
value ="
[email protected] "
label ="
Email "
>
110
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
111
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
112
+ </ ion-button >
113
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
114
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
115
+ </ ion-button >
116
+ </ ion-textarea >
117
+ </ div >
118
+
119
+ < div class ="grid-item ">
120
+ < h2 > Outline / Start Label / Buttons</ h2 >
121
+ < ion-textarea label-placement ="
start "
fill ="
outline "
value ="
[email protected] "
label ="
Email "
>
122
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
123
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
124
+ </ ion-button >
125
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
126
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
127
+ </ ion-button >
128
+ </ ion-textarea >
129
+ </ div >
130
+
131
+ < div class ="grid-item ">
132
+ < h2 > No Fill / Floating Label / Buttons</ h2 >
133
+ < ion-textarea label-placement ="
floating "
value ="
[email protected] "
label ="
Email "
>
134
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
135
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
136
+ </ ion-button >
137
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
138
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
139
+ </ ion-button >
140
+ </ ion-textarea >
141
+ </ div >
142
+
143
+ < div class ="grid-item ">
144
+ < h2 > Solid / Floating Label / Buttons</ h2 >
145
+ < ion-textarea label-placement ="
floating "
fill ="
solid "
value ="
[email protected] "
label ="
Email "
>
146
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
147
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
148
+ </ ion-button >
149
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
150
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
151
+ </ ion-button >
152
+ </ ion-textarea >
153
+ </ div >
154
+
155
+ < div class ="grid-item ">
156
+ < h2 > Outline / Floating Label / Buttons</ h2 >
157
+ < ion-textarea label-placement ="
floating "
fill ="
outline "
value ="
[email protected] "
label ="
Email "
>
158
+ < ion-button fill ="clear " slot ="start " aria-label ="Lock ">
159
+ < ion-icon slot ="icon-only " name ="lock-closed " aria-hidden ="true "> </ ion-icon >
160
+ </ ion-button >
161
+ < ion-button fill ="clear " slot ="end " aria-label ="Show/hide password ">
162
+ < ion-icon slot ="icon-only " name ="eye " aria-hidden ="true "> </ ion-icon >
163
+ </ ion-button >
164
+ </ ion-textarea >
165
+ </ div >
166
+
167
+ < div class ="grid-item ">
168
+ < h2 > No Fill / Start Label / Decorations</ h2 >
169
+ < ion-textarea label-placement ="start " value ="100 " label ="Weight ">
170
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
171
+ < ion-label slot ="end "> lbs</ ion-label >
172
+ </ ion-textarea >
173
+ </ div >
174
+
175
+ < div class ="grid-item ">
176
+ < h2 > Solid / Start Label / Decorations</ h2 >
177
+ < ion-textarea label-placement ="start " fill ="solid " value ="100 " label ="Weight ">
178
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
179
+ < ion-label slot ="end "> lbs</ ion-label >
180
+ </ ion-textarea >
181
+ </ div >
182
+
183
+ < div class ="grid-item ">
184
+ < h2 > Outline / Start Label / Decorations</ h2 >
185
+ < ion-textarea label-placement ="start " fill ="outline " value ="100 " label ="Weight ">
186
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
187
+ < ion-label slot ="end "> lbs</ ion-label >
188
+ </ ion-textarea >
189
+ </ div >
190
+
191
+ < div class ="grid-item ">
192
+ < h2 > No Fill / Floating Label / Decorations</ h2 >
193
+ < ion-textarea label-placement ="floating " value ="100 " label ="Weight ">
194
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
195
+ < ion-label slot ="end "> lbs</ ion-label >
196
+ </ ion-textarea >
197
+ </ div >
198
+
199
+ < div class ="grid-item ">
200
+ < h2 > Solid / Floating Label / Decorations</ h2 >
201
+ < ion-textarea label-placement ="floating " fill ="solid " value ="100 " label ="Weight ">
202
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
203
+ < ion-label slot ="end "> lbs</ ion-label >
204
+ </ ion-textarea >
205
+ </ div >
206
+
207
+ < div class ="grid-item ">
208
+ < h2 > Outline / Floating Label / Decorations</ h2 >
209
+ < ion-textarea label-placement ="floating " fill ="outline " value ="100 " label ="Weight ">
210
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
211
+ < ion-label slot ="end "> lbs</ ion-label >
212
+ </ ion-textarea >
213
+ </ div >
214
+
215
+ < div class ="grid-item ">
216
+ < h2 > Outline / Async Label</ h2 >
97
217
< ion-textarea id ="
solid-async "
label-placement ="
floating "
fill ="
outline "
value ="
[email protected] "
> </ ion-textarea >
98
218
</ div >
219
+
220
+ < div class ="grid-item ">
221
+ < h2 > Outline / Async Decorations</ h2 >
222
+ < ion-textarea id ="async-decorations " label-placement ="floating " fill ="outline " label ="Email "> </ ion-textarea >
223
+ </ div >
224
+
225
+ < div class ="grid-item ">
226
+ < h2 > Outline / Autogrow / Decorations</ h2 >
227
+ < ion-textarea label-placement ="
start "
fill ="
outline "
label ="
Email "
auto-grow ="
true "
value ="
[email protected] "
>
228
+ < ion-icon slot ="start " name ="barbell " aria-hidden ="true "> </ ion-icon >
229
+ < ion-label slot ="end "> lbs</ ion-label >
230
+ </ ion-textarea >
231
+ </ div >
99
232
</ div >
100
233
101
234
< ion-button onclick ="addSlot() "> Add Slotted Content</ ion-button >
@@ -106,29 +239,65 @@ <h2>Outline / Floating / Async</h2>
106
239
107
240
< script >
108
241
const solidAsync = document . querySelector ( '#solid-async' ) ;
242
+ const asyncDecos = document . querySelector ( '#async-decorations' ) ;
109
243
110
- const getSlottedContent = ( ) => {
244
+ const getSlottedLabel = ( ) => {
111
245
return solidAsync . querySelector ( '[slot="label"]' ) ;
112
246
} ;
113
247
248
+ const getSlottedStartDeco = ( ) => {
249
+ return asyncDecos . querySelector ( '[slot="start"]' ) ;
250
+ } ;
251
+
252
+ const getSlottedEndDeco = ( ) => {
253
+ return asyncDecos . querySelector ( '[slot="end"]' ) ;
254
+ } ;
255
+
114
256
const addSlot = ( ) => {
115
- if ( getSlottedContent ( ) === null ) {
257
+ if ( getSlottedLabel ( ) === null ) {
116
258
const labelEl = document . createElement ( 'div' ) ;
117
259
labelEl . slot = 'label' ;
118
260
labelEl . innerHTML = 'Comments <span class="required">*</span>' ;
119
261
120
262
solidAsync . appendChild ( labelEl ) ;
121
263
}
264
+
265
+ if ( getSlottedStartDeco ( ) === null ) {
266
+ const startEl = document . createElement ( 'div' ) ;
267
+ startEl . slot = 'start' ;
268
+ startEl . innerHTML = 'Start' ;
269
+
270
+ asyncDecos . insertAdjacentElement ( 'afterbegin' , startEl ) ;
271
+ }
272
+
273
+ if ( getSlottedEndDeco ( ) === null ) {
274
+ const endEl = document . createElement ( 'div' ) ;
275
+ endEl . slot = 'end' ;
276
+ endEl . innerHTML = 'End' ;
277
+
278
+ asyncDecos . insertAdjacentElement ( 'beforeend' , endEl ) ;
279
+ }
122
280
} ;
123
281
124
282
const removeSlot = ( ) => {
125
- if ( getSlottedContent ( ) !== null ) {
126
- solidAsync . querySelector ( '[slot="label"]' ) . remove ( ) ;
283
+ const slottedLabel = getSlottedLabel ( ) ;
284
+ if ( slottedLabel !== null ) {
285
+ slottedLabel . remove ( ) ;
286
+ }
287
+
288
+ const slottedStartDeco = getSlottedStartDeco ( ) ;
289
+ if ( slottedStartDeco !== null ) {
290
+ slottedStartDeco . remove ( ) ;
291
+ }
292
+
293
+ const slottedEndDeco = getSlottedEndDeco ( ) ;
294
+ if ( slottedEndDeco !== null ) {
295
+ slottedEndDeco . remove ( ) ;
127
296
}
128
297
} ;
129
298
130
299
const updateSlot = ( ) => {
131
- const slottedContent = getSlottedContent ( ) ;
300
+ const slottedContent = getSlottedLabel ( ) ;
132
301
133
302
if ( slottedContent !== null ) {
134
303
slottedContent . textContent = 'This is my really really really long text' ;
0 commit comments