@hortiview/shared-components 0.0.4723 → 0.0.4724
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/dist/_getTag-DyrzUAbj.js +494 -0
- package/dist/components/BaseView/BaseView.js +43 -297
- package/dist/components/BasicHeading/BasicHeading.js +24 -25
- package/dist/components/BasicHeading/BasicHeading.test.js +4 -4
- package/dist/components/BlockView/BlockView.js +14 -14
- package/dist/components/DeleteModal/DeleteModal.js +49 -4687
- package/dist/components/Disclaimer/Disclaimer.js +8 -10
- package/dist/components/EmptyView/EmptyView.js +8 -247
- package/dist/components/HashTabView/HashTabView.js +52 -1838
- package/dist/components/HeaderFilter/HeaderFilter.js +18 -7595
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/ListArea/ListArea.js +316 -261
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.js +34 -35
- package/dist/components/SearchBar/SearchBar.js +21 -2043
- package/package.json +1 -1
- package/dist/BlockView.module-ypKp14Lt.cjs +0 -1
- package/dist/HashTabView.module-B20c3S70.cjs +0 -1
- package/dist/HeaderFilter.module-DSCJz6-s.cjs +0 -1
- package/dist/_commonjsHelpers-DwTZ_eVU.cjs +0 -1
- package/dist/_getTag-DNUtgXkb.js +0 -136
- package/dist/_getTag-DSIzMwlx.cjs +0 -1
- package/dist/_stringToPath-B-GSTJ2e.cjs +0 -1
- package/dist/_stringToPath-BfzwTbL6.js +0 -54
- package/dist/baseView.module--VUY4h_X.cjs +0 -1
- package/dist/basicHeading.module-BbcVMp42.cjs +0 -1
- package/dist/component-DJvMx3oL.cjs +0 -148
- package/dist/component-Rx4bNsGO.js +0 -680
- package/dist/disclaimer.module-BfrBh-Rf.cjs +0 -1
- package/dist/index.es-80RhGkCD.cjs +0 -1
- package/dist/index.es-Ba9oZK_n.js +0 -769
- package/dist/index.es-C1ojb4Lq.js +0 -106
- package/dist/index.es-CEydmFbW.cjs +0 -23
- package/dist/index.es-CKdjg72r.cjs +0 -64
- package/dist/index.es-CNBieliG.js +0 -151
- package/dist/index.es-CPRODq-I.cjs +0 -127
- package/dist/index.es-CQ3ep412.js +0 -305
- package/dist/index.es-CSD_u-fK.cjs +0 -1
- package/dist/index.es-CVCp4d0C.js +0 -45
- package/dist/index.es-Cct4Uapb.js +0 -1776
- package/dist/index.es-Cj9DW-2T.js +0 -430
- package/dist/index.es-Cm4X20_S.js +0 -673
- package/dist/index.es-Cqx46S1V.cjs +0 -540
- package/dist/index.es-DiO-sp-V.cjs +0 -1
- package/dist/index.es-DyXn5zZ8.cjs +0 -1
- package/dist/index.es-InSNsV4f.js +0 -1067
- package/dist/index.es-J3ub0jmR.cjs +0 -1
- package/dist/index.es-L0ZCcbUf.js +0 -4939
- package/dist/index.es-gvcK6-6t.cjs +0 -1
- package/dist/listArea.module-CMO-yRdf.cjs +0 -1
- package/dist/magic-string.es-EQkD18No.cjs +0 -10
- package/dist/react.esm-CMNZXU0t.cjs +0 -93
- package/dist/searchBar.module-CFi8D8zn.cjs +0 -1
- package/dist/tslib.es6-CIXEwqhg.js +0 -72
- package/dist/tslib.es6-D1TYK0An.cjs +0 -1
- package/dist/useBreakpoint-PUopk3AO.cjs +0 -1
- package/dist/verticalDivider.module-Ciw9Fnt1.cjs +0 -1
- package/dist/vi.JYQecGiw-M1q0RI3O.cjs +0 -512
|
@@ -1,2053 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* Copyright 2018 Google Inc.
|
|
13
|
-
*
|
|
14
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
-
* in the Software without restriction, including without limitation the rights
|
|
17
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
-
* furnished to do so, subject to the following conditions:
|
|
20
|
-
*
|
|
21
|
-
* The above copyright notice and this permission notice shall be included in
|
|
22
|
-
* all copies or substantial portions of the Software.
|
|
23
|
-
*
|
|
24
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
30
|
-
* THE SOFTWARE.
|
|
31
|
-
*/
|
|
32
|
-
var P = {
|
|
33
|
-
LINE_RIPPLE_ACTIVE: "mdc-line-ripple--active",
|
|
34
|
-
LINE_RIPPLE_DEACTIVATING: "mdc-line-ripple--deactivating"
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2018 Google Inc.
|
|
39
|
-
*
|
|
40
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
41
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
42
|
-
* in the Software without restriction, including without limitation the rights
|
|
43
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
44
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
45
|
-
* furnished to do so, subject to the following conditions:
|
|
46
|
-
*
|
|
47
|
-
* The above copyright notice and this permission notice shall be included in
|
|
48
|
-
* all copies or substantial portions of the Software.
|
|
49
|
-
*
|
|
50
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
51
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
52
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
53
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
54
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
55
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
56
|
-
* THE SOFTWARE.
|
|
57
|
-
*/
|
|
58
|
-
var At = (
|
|
59
|
-
/** @class */
|
|
60
|
-
function(a) {
|
|
61
|
-
C(t, a);
|
|
62
|
-
function t(e) {
|
|
63
|
-
var n = a.call(this, f(f({}, t.defaultAdapter), e)) || this;
|
|
64
|
-
return n.transitionEndHandler_ = function(i) {
|
|
65
|
-
return n.handleTransitionEnd(i);
|
|
66
|
-
}, n;
|
|
67
|
-
}
|
|
68
|
-
return Object.defineProperty(t, "cssClasses", {
|
|
69
|
-
get: function() {
|
|
70
|
-
return P;
|
|
71
|
-
},
|
|
72
|
-
enumerable: !1,
|
|
73
|
-
configurable: !0
|
|
74
|
-
}), Object.defineProperty(t, "defaultAdapter", {
|
|
75
|
-
/**
|
|
76
|
-
* See {@link MDCLineRippleAdapter} for typing information on parameters and return types.
|
|
77
|
-
*/
|
|
78
|
-
get: function() {
|
|
79
|
-
return {
|
|
80
|
-
addClass: function() {
|
|
81
|
-
},
|
|
82
|
-
removeClass: function() {
|
|
83
|
-
},
|
|
84
|
-
hasClass: function() {
|
|
85
|
-
return !1;
|
|
86
|
-
},
|
|
87
|
-
setStyle: function() {
|
|
88
|
-
},
|
|
89
|
-
registerEventHandler: function() {
|
|
90
|
-
},
|
|
91
|
-
deregisterEventHandler: function() {
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
enumerable: !1,
|
|
96
|
-
configurable: !0
|
|
97
|
-
}), t.prototype.init = function() {
|
|
98
|
-
this.adapter.registerEventHandler("transitionend", this.transitionEndHandler_);
|
|
99
|
-
}, t.prototype.destroy = function() {
|
|
100
|
-
this.adapter.deregisterEventHandler("transitionend", this.transitionEndHandler_);
|
|
101
|
-
}, t.prototype.activate = function() {
|
|
102
|
-
this.adapter.removeClass(P.LINE_RIPPLE_DEACTIVATING), this.adapter.addClass(P.LINE_RIPPLE_ACTIVE);
|
|
103
|
-
}, t.prototype.setRippleCenter = function(e) {
|
|
104
|
-
this.adapter.setStyle("transform-origin", e + "px center");
|
|
105
|
-
}, t.prototype.deactivate = function() {
|
|
106
|
-
this.adapter.addClass(P.LINE_RIPPLE_DEACTIVATING);
|
|
107
|
-
}, t.prototype.handleTransitionEnd = function(e) {
|
|
108
|
-
var n = this.adapter.hasClass(P.LINE_RIPPLE_DEACTIVATING);
|
|
109
|
-
e.propertyName === "opacity" && n && (this.adapter.removeClass(P.LINE_RIPPLE_ACTIVE), this.adapter.removeClass(P.LINE_RIPPLE_DEACTIVATING));
|
|
110
|
-
}, t;
|
|
111
|
-
}(z)
|
|
112
|
-
);
|
|
113
|
-
/**
|
|
114
|
-
* @license
|
|
115
|
-
* Copyright 2018 Google Inc.
|
|
116
|
-
*
|
|
117
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
118
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
119
|
-
* in the Software without restriction, including without limitation the rights
|
|
120
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
121
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
122
|
-
* furnished to do so, subject to the following conditions:
|
|
123
|
-
*
|
|
124
|
-
* The above copyright notice and this permission notice shall be included in
|
|
125
|
-
* all copies or substantial portions of the Software.
|
|
126
|
-
*
|
|
127
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
128
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
129
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
130
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
131
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
132
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
133
|
-
* THE SOFTWARE.
|
|
134
|
-
*/
|
|
135
|
-
var Ye = (
|
|
136
|
-
/** @class */
|
|
137
|
-
function(a) {
|
|
138
|
-
C(t, a);
|
|
139
|
-
function t() {
|
|
140
|
-
return a !== null && a.apply(this, arguments) || this;
|
|
141
|
-
}
|
|
142
|
-
return t.attachTo = function(e) {
|
|
143
|
-
return new t(e);
|
|
144
|
-
}, t.prototype.activate = function() {
|
|
145
|
-
this.foundation.activate();
|
|
146
|
-
}, t.prototype.deactivate = function() {
|
|
147
|
-
this.foundation.deactivate();
|
|
148
|
-
}, t.prototype.setRippleCenter = function(e) {
|
|
149
|
-
this.foundation.setRippleCenter(e);
|
|
150
|
-
}, t.prototype.getDefaultFoundation = function() {
|
|
151
|
-
var e = this, n = {
|
|
152
|
-
addClass: function(i) {
|
|
153
|
-
return e.root.classList.add(i);
|
|
154
|
-
},
|
|
155
|
-
removeClass: function(i) {
|
|
156
|
-
return e.root.classList.remove(i);
|
|
157
|
-
},
|
|
158
|
-
hasClass: function(i) {
|
|
159
|
-
return e.root.classList.contains(i);
|
|
160
|
-
},
|
|
161
|
-
setStyle: function(i, o) {
|
|
162
|
-
return e.root.style.setProperty(i, o);
|
|
163
|
-
},
|
|
164
|
-
registerEventHandler: function(i, o) {
|
|
165
|
-
return e.listen(i, o);
|
|
166
|
-
},
|
|
167
|
-
deregisterEventHandler: function(i, o) {
|
|
168
|
-
return e.unlisten(i, o);
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
return new At(n);
|
|
172
|
-
}, t;
|
|
173
|
-
}(Y)
|
|
174
|
-
);
|
|
175
|
-
/**
|
|
176
|
-
* @license
|
|
177
|
-
* Copyright 2019 Google Inc.
|
|
178
|
-
*
|
|
179
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
180
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
181
|
-
* in the Software without restriction, including without limitation the rights
|
|
182
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
183
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
184
|
-
* furnished to do so, subject to the following conditions:
|
|
185
|
-
*
|
|
186
|
-
* The above copyright notice and this permission notice shall be included in
|
|
187
|
-
* all copies or substantial portions of the Software.
|
|
188
|
-
*
|
|
189
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
190
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
191
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
192
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
193
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
194
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
195
|
-
* THE SOFTWARE.
|
|
196
|
-
*/
|
|
197
|
-
var Ke = {
|
|
198
|
-
ROOT: "mdc-text-field-character-counter"
|
|
199
|
-
}, Rt = {
|
|
200
|
-
ROOT_SELECTOR: "." + Ke.ROOT
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* @license
|
|
204
|
-
* Copyright 2019 Google Inc.
|
|
205
|
-
*
|
|
206
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
207
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
208
|
-
* in the Software without restriction, including without limitation the rights
|
|
209
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
210
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
211
|
-
* furnished to do so, subject to the following conditions:
|
|
212
|
-
*
|
|
213
|
-
* The above copyright notice and this permission notice shall be included in
|
|
214
|
-
* all copies or substantial portions of the Software.
|
|
215
|
-
*
|
|
216
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
217
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
218
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
219
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
220
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
221
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
222
|
-
* THE SOFTWARE.
|
|
223
|
-
*/
|
|
224
|
-
var Je = (
|
|
225
|
-
/** @class */
|
|
226
|
-
function(a) {
|
|
227
|
-
C(t, a);
|
|
228
|
-
function t(e) {
|
|
229
|
-
return a.call(this, f(f({}, t.defaultAdapter), e)) || this;
|
|
230
|
-
}
|
|
231
|
-
return Object.defineProperty(t, "cssClasses", {
|
|
232
|
-
get: function() {
|
|
233
|
-
return Ke;
|
|
234
|
-
},
|
|
235
|
-
enumerable: !1,
|
|
236
|
-
configurable: !0
|
|
237
|
-
}), Object.defineProperty(t, "strings", {
|
|
238
|
-
get: function() {
|
|
239
|
-
return Rt;
|
|
240
|
-
},
|
|
241
|
-
enumerable: !1,
|
|
242
|
-
configurable: !0
|
|
243
|
-
}), Object.defineProperty(t, "defaultAdapter", {
|
|
244
|
-
/**
|
|
245
|
-
* See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.
|
|
246
|
-
*/
|
|
247
|
-
get: function() {
|
|
248
|
-
return {
|
|
249
|
-
setContent: function() {
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
},
|
|
253
|
-
enumerable: !1,
|
|
254
|
-
configurable: !0
|
|
255
|
-
}), t.prototype.setCounterValue = function(e, n) {
|
|
256
|
-
e = Math.min(e, n), this.adapter.setContent(e + " / " + n);
|
|
257
|
-
}, t;
|
|
258
|
-
}(z)
|
|
259
|
-
);
|
|
260
|
-
/**
|
|
261
|
-
* @license
|
|
262
|
-
* Copyright 2019 Google Inc.
|
|
263
|
-
*
|
|
264
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
265
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
266
|
-
* in the Software without restriction, including without limitation the rights
|
|
267
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
268
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
269
|
-
* furnished to do so, subject to the following conditions:
|
|
270
|
-
*
|
|
271
|
-
* The above copyright notice and this permission notice shall be included in
|
|
272
|
-
* all copies or substantial portions of the Software.
|
|
273
|
-
*
|
|
274
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
275
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
276
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
277
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
278
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
279
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
280
|
-
* THE SOFTWARE.
|
|
281
|
-
*/
|
|
282
|
-
var Nt = (
|
|
283
|
-
/** @class */
|
|
284
|
-
function(a) {
|
|
285
|
-
C(t, a);
|
|
286
|
-
function t() {
|
|
287
|
-
return a !== null && a.apply(this, arguments) || this;
|
|
288
|
-
}
|
|
289
|
-
return t.attachTo = function(e) {
|
|
290
|
-
return new t(e);
|
|
291
|
-
}, Object.defineProperty(t.prototype, "foundationForTextField", {
|
|
292
|
-
// Provided for access by MDCTextField component
|
|
293
|
-
get: function() {
|
|
294
|
-
return this.foundation;
|
|
295
|
-
},
|
|
296
|
-
enumerable: !1,
|
|
297
|
-
configurable: !0
|
|
298
|
-
}), t.prototype.getDefaultFoundation = function() {
|
|
299
|
-
var e = this, n = {
|
|
300
|
-
setContent: function(i) {
|
|
301
|
-
e.root.textContent = i;
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
return new Je(n);
|
|
305
|
-
}, t;
|
|
306
|
-
}(Y)
|
|
307
|
-
);
|
|
308
|
-
/**
|
|
309
|
-
* @license
|
|
310
|
-
* Copyright 2016 Google Inc.
|
|
311
|
-
*
|
|
312
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
313
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
314
|
-
* in the Software without restriction, including without limitation the rights
|
|
315
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
316
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
317
|
-
* furnished to do so, subject to the following conditions:
|
|
318
|
-
*
|
|
319
|
-
* The above copyright notice and this permission notice shall be included in
|
|
320
|
-
* all copies or substantial portions of the Software.
|
|
321
|
-
*
|
|
322
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
323
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
324
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
325
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
326
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
327
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
328
|
-
* THE SOFTWARE.
|
|
329
|
-
*/
|
|
330
|
-
var x = {
|
|
331
|
-
ARIA_CONTROLS: "aria-controls",
|
|
332
|
-
ARIA_DESCRIBEDBY: "aria-describedby",
|
|
333
|
-
INPUT_SELECTOR: ".mdc-text-field__input",
|
|
334
|
-
LABEL_SELECTOR: ".mdc-floating-label",
|
|
335
|
-
LEADING_ICON_SELECTOR: ".mdc-text-field__icon--leading",
|
|
336
|
-
LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
|
|
337
|
-
OUTLINE_SELECTOR: ".mdc-notched-outline",
|
|
338
|
-
PREFIX_SELECTOR: ".mdc-text-field__affix--prefix",
|
|
339
|
-
SUFFIX_SELECTOR: ".mdc-text-field__affix--suffix",
|
|
340
|
-
TRAILING_ICON_SELECTOR: ".mdc-text-field__icon--trailing"
|
|
341
|
-
}, ae = {
|
|
342
|
-
DISABLED: "mdc-text-field--disabled",
|
|
343
|
-
FOCUSED: "mdc-text-field--focused",
|
|
344
|
-
HELPER_LINE: "mdc-text-field-helper-line",
|
|
345
|
-
INVALID: "mdc-text-field--invalid",
|
|
346
|
-
LABEL_FLOATING: "mdc-text-field--label-floating",
|
|
347
|
-
NO_LABEL: "mdc-text-field--no-label",
|
|
348
|
-
OUTLINED: "mdc-text-field--outlined",
|
|
349
|
-
ROOT: "mdc-text-field",
|
|
350
|
-
TEXTAREA: "mdc-text-field--textarea",
|
|
351
|
-
WITH_LEADING_ICON: "mdc-text-field--with-leading-icon",
|
|
352
|
-
WITH_TRAILING_ICON: "mdc-text-field--with-trailing-icon"
|
|
353
|
-
}, Me = {
|
|
354
|
-
LABEL_SCALE: 0.75
|
|
355
|
-
}, Ft = [
|
|
356
|
-
"pattern",
|
|
357
|
-
"min",
|
|
358
|
-
"max",
|
|
359
|
-
"required",
|
|
360
|
-
"step",
|
|
361
|
-
"minlength",
|
|
362
|
-
"maxlength"
|
|
363
|
-
], Pt = [
|
|
364
|
-
"color",
|
|
365
|
-
"date",
|
|
366
|
-
"datetime-local",
|
|
367
|
-
"month",
|
|
368
|
-
"range",
|
|
369
|
-
"time",
|
|
370
|
-
"week"
|
|
371
|
-
];
|
|
372
|
-
/**
|
|
373
|
-
* @license
|
|
374
|
-
* Copyright 2016 Google Inc.
|
|
375
|
-
*
|
|
376
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
377
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
378
|
-
* in the Software without restriction, including without limitation the rights
|
|
379
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
380
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
381
|
-
* furnished to do so, subject to the following conditions:
|
|
382
|
-
*
|
|
383
|
-
* The above copyright notice and this permission notice shall be included in
|
|
384
|
-
* all copies or substantial portions of the Software.
|
|
385
|
-
*
|
|
386
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
387
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
388
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
389
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
390
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
391
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
392
|
-
* THE SOFTWARE.
|
|
393
|
-
*/
|
|
394
|
-
var je = ["mousedown", "touchstart"], Be = ["click", "keydown"], Vt = (
|
|
395
|
-
/** @class */
|
|
396
|
-
function(a) {
|
|
397
|
-
C(t, a);
|
|
398
|
-
function t(e, n) {
|
|
399
|
-
n === void 0 && (n = {});
|
|
400
|
-
var i = a.call(this, f(f({}, t.defaultAdapter), e)) || this;
|
|
401
|
-
return i.isFocused_ = !1, i.receivedUserInput_ = !1, i.isValid_ = !0, i.useNativeValidation_ = !0, i.validateOnValueChange_ = !0, i.helperText_ = n.helperText, i.characterCounter_ = n.characterCounter, i.leadingIcon_ = n.leadingIcon, i.trailingIcon_ = n.trailingIcon, i.inputFocusHandler_ = function() {
|
|
402
|
-
return i.activateFocus();
|
|
403
|
-
}, i.inputBlurHandler_ = function() {
|
|
404
|
-
return i.deactivateFocus();
|
|
405
|
-
}, i.inputInputHandler_ = function() {
|
|
406
|
-
return i.handleInput();
|
|
407
|
-
}, i.setPointerXOffset_ = function(o) {
|
|
408
|
-
return i.setTransformOrigin(o);
|
|
409
|
-
}, i.textFieldInteractionHandler_ = function() {
|
|
410
|
-
return i.handleTextFieldInteraction();
|
|
411
|
-
}, i.validationAttributeChangeHandler_ = function(o) {
|
|
412
|
-
return i.handleValidationAttributeChange(o);
|
|
413
|
-
}, i;
|
|
414
|
-
}
|
|
415
|
-
return Object.defineProperty(t, "cssClasses", {
|
|
416
|
-
get: function() {
|
|
417
|
-
return ae;
|
|
418
|
-
},
|
|
419
|
-
enumerable: !1,
|
|
420
|
-
configurable: !0
|
|
421
|
-
}), Object.defineProperty(t, "strings", {
|
|
422
|
-
get: function() {
|
|
423
|
-
return x;
|
|
424
|
-
},
|
|
425
|
-
enumerable: !1,
|
|
426
|
-
configurable: !0
|
|
427
|
-
}), Object.defineProperty(t, "numbers", {
|
|
428
|
-
get: function() {
|
|
429
|
-
return Me;
|
|
430
|
-
},
|
|
431
|
-
enumerable: !1,
|
|
432
|
-
configurable: !0
|
|
433
|
-
}), Object.defineProperty(t.prototype, "shouldAlwaysFloat_", {
|
|
434
|
-
get: function() {
|
|
435
|
-
var e = this.getNativeInput_().type;
|
|
436
|
-
return Pt.indexOf(e) >= 0;
|
|
437
|
-
},
|
|
438
|
-
enumerable: !1,
|
|
439
|
-
configurable: !0
|
|
440
|
-
}), Object.defineProperty(t.prototype, "shouldFloat", {
|
|
441
|
-
get: function() {
|
|
442
|
-
return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
|
|
443
|
-
},
|
|
444
|
-
enumerable: !1,
|
|
445
|
-
configurable: !0
|
|
446
|
-
}), Object.defineProperty(t.prototype, "shouldShake", {
|
|
447
|
-
get: function() {
|
|
448
|
-
return !this.isFocused_ && !this.isValid() && !!this.getValue();
|
|
449
|
-
},
|
|
450
|
-
enumerable: !1,
|
|
451
|
-
configurable: !0
|
|
452
|
-
}), Object.defineProperty(t, "defaultAdapter", {
|
|
453
|
-
/**
|
|
454
|
-
* See {@link MDCTextFieldAdapter} for typing information on parameters and
|
|
455
|
-
* return types.
|
|
456
|
-
*/
|
|
457
|
-
get: function() {
|
|
458
|
-
return {
|
|
459
|
-
addClass: function() {
|
|
460
|
-
},
|
|
461
|
-
removeClass: function() {
|
|
462
|
-
},
|
|
463
|
-
hasClass: function() {
|
|
464
|
-
return !0;
|
|
465
|
-
},
|
|
466
|
-
setInputAttr: function() {
|
|
467
|
-
},
|
|
468
|
-
removeInputAttr: function() {
|
|
469
|
-
},
|
|
470
|
-
registerTextFieldInteractionHandler: function() {
|
|
471
|
-
},
|
|
472
|
-
deregisterTextFieldInteractionHandler: function() {
|
|
473
|
-
},
|
|
474
|
-
registerInputInteractionHandler: function() {
|
|
475
|
-
},
|
|
476
|
-
deregisterInputInteractionHandler: function() {
|
|
477
|
-
},
|
|
478
|
-
registerValidationAttributeChangeHandler: function() {
|
|
479
|
-
return new MutationObserver(function() {
|
|
480
|
-
});
|
|
481
|
-
},
|
|
482
|
-
deregisterValidationAttributeChangeHandler: function() {
|
|
483
|
-
},
|
|
484
|
-
getNativeInput: function() {
|
|
485
|
-
return null;
|
|
486
|
-
},
|
|
487
|
-
isFocused: function() {
|
|
488
|
-
return !1;
|
|
489
|
-
},
|
|
490
|
-
activateLineRipple: function() {
|
|
491
|
-
},
|
|
492
|
-
deactivateLineRipple: function() {
|
|
493
|
-
},
|
|
494
|
-
setLineRippleTransformOrigin: function() {
|
|
495
|
-
},
|
|
496
|
-
shakeLabel: function() {
|
|
497
|
-
},
|
|
498
|
-
floatLabel: function() {
|
|
499
|
-
},
|
|
500
|
-
setLabelRequired: function() {
|
|
501
|
-
},
|
|
502
|
-
hasLabel: function() {
|
|
503
|
-
return !1;
|
|
504
|
-
},
|
|
505
|
-
getLabelWidth: function() {
|
|
506
|
-
return 0;
|
|
507
|
-
},
|
|
508
|
-
hasOutline: function() {
|
|
509
|
-
return !1;
|
|
510
|
-
},
|
|
511
|
-
notchOutline: function() {
|
|
512
|
-
},
|
|
513
|
-
closeOutline: function() {
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
},
|
|
517
|
-
enumerable: !1,
|
|
518
|
-
configurable: !0
|
|
519
|
-
}), t.prototype.init = function() {
|
|
520
|
-
var e = this;
|
|
521
|
-
this.adapter.hasLabel() && this.getNativeInput_().required && this.adapter.setLabelRequired(!0), this.adapter.isFocused() ? this.inputFocusHandler_() : this.adapter.hasLabel() && this.shouldFloat && (this.notchOutline(!0), this.adapter.floatLabel(!0), this.styleFloating_(!0)), this.adapter.registerInputInteractionHandler("focus", this.inputFocusHandler_), this.adapter.registerInputInteractionHandler("blur", this.inputBlurHandler_), this.adapter.registerInputInteractionHandler("input", this.inputInputHandler_), je.forEach(function(n) {
|
|
522
|
-
e.adapter.registerInputInteractionHandler(n, e.setPointerXOffset_);
|
|
523
|
-
}), Be.forEach(function(n) {
|
|
524
|
-
e.adapter.registerTextFieldInteractionHandler(n, e.textFieldInteractionHandler_);
|
|
525
|
-
}), this.validationObserver_ = this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_), this.setCharacterCounter_(this.getValue().length);
|
|
526
|
-
}, t.prototype.destroy = function() {
|
|
527
|
-
var e = this;
|
|
528
|
-
this.adapter.deregisterInputInteractionHandler("focus", this.inputFocusHandler_), this.adapter.deregisterInputInteractionHandler("blur", this.inputBlurHandler_), this.adapter.deregisterInputInteractionHandler("input", this.inputInputHandler_), je.forEach(function(n) {
|
|
529
|
-
e.adapter.deregisterInputInteractionHandler(n, e.setPointerXOffset_);
|
|
530
|
-
}), Be.forEach(function(n) {
|
|
531
|
-
e.adapter.deregisterTextFieldInteractionHandler(n, e.textFieldInteractionHandler_);
|
|
532
|
-
}), this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_);
|
|
533
|
-
}, t.prototype.handleTextFieldInteraction = function() {
|
|
534
|
-
var e = this.adapter.getNativeInput();
|
|
535
|
-
e && e.disabled || (this.receivedUserInput_ = !0);
|
|
536
|
-
}, t.prototype.handleValidationAttributeChange = function(e) {
|
|
537
|
-
var n = this;
|
|
538
|
-
e.some(function(i) {
|
|
539
|
-
return Ft.indexOf(i) > -1 ? (n.styleValidity_(!0), n.adapter.setLabelRequired(n.getNativeInput_().required), !0) : !1;
|
|
540
|
-
}), e.indexOf("maxlength") > -1 && this.setCharacterCounter_(this.getValue().length);
|
|
541
|
-
}, t.prototype.notchOutline = function(e) {
|
|
542
|
-
if (!(!this.adapter.hasOutline() || !this.adapter.hasLabel()))
|
|
543
|
-
if (e) {
|
|
544
|
-
var n = this.adapter.getLabelWidth() * Me.LABEL_SCALE;
|
|
545
|
-
this.adapter.notchOutline(n);
|
|
546
|
-
} else
|
|
547
|
-
this.adapter.closeOutline();
|
|
548
|
-
}, t.prototype.activateFocus = function() {
|
|
549
|
-
this.isFocused_ = !0, this.styleFocused_(this.isFocused_), this.adapter.activateLineRipple(), this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating_(this.shouldFloat), this.adapter.shakeLabel(this.shouldShake)), this.helperText_ && (this.helperText_.isPersistent() || !this.helperText_.isValidation() || !this.isValid_) && this.helperText_.showToScreenReader();
|
|
550
|
-
}, t.prototype.setTransformOrigin = function(e) {
|
|
551
|
-
if (!(this.isDisabled() || this.adapter.hasOutline())) {
|
|
552
|
-
var n = e.touches, i = n ? n[0] : e, o = i.target.getBoundingClientRect(), l = i.clientX - o.left;
|
|
553
|
-
this.adapter.setLineRippleTransformOrigin(l);
|
|
554
|
-
}
|
|
555
|
-
}, t.prototype.handleInput = function() {
|
|
556
|
-
this.autoCompleteFocus(), this.setCharacterCounter_(this.getValue().length);
|
|
557
|
-
}, t.prototype.autoCompleteFocus = function() {
|
|
558
|
-
this.receivedUserInput_ || this.activateFocus();
|
|
559
|
-
}, t.prototype.deactivateFocus = function() {
|
|
560
|
-
this.isFocused_ = !1, this.adapter.deactivateLineRipple();
|
|
561
|
-
var e = this.isValid();
|
|
562
|
-
this.styleValidity_(e), this.styleFocused_(this.isFocused_), this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating_(this.shouldFloat), this.adapter.shakeLabel(this.shouldShake)), this.shouldFloat || (this.receivedUserInput_ = !1);
|
|
563
|
-
}, t.prototype.getValue = function() {
|
|
564
|
-
return this.getNativeInput_().value;
|
|
565
|
-
}, t.prototype.setValue = function(e) {
|
|
566
|
-
if (this.getValue() !== e && (this.getNativeInput_().value = e), this.setCharacterCounter_(e.length), this.validateOnValueChange_) {
|
|
567
|
-
var n = this.isValid();
|
|
568
|
-
this.styleValidity_(n);
|
|
569
|
-
}
|
|
570
|
-
this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating_(this.shouldFloat), this.validateOnValueChange_ && this.adapter.shakeLabel(this.shouldShake));
|
|
571
|
-
}, t.prototype.isValid = function() {
|
|
572
|
-
return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
|
|
573
|
-
}, t.prototype.setValid = function(e) {
|
|
574
|
-
this.isValid_ = e, this.styleValidity_(e);
|
|
575
|
-
var n = !e && !this.isFocused_ && !!this.getValue();
|
|
576
|
-
this.adapter.hasLabel() && this.adapter.shakeLabel(n);
|
|
577
|
-
}, t.prototype.setValidateOnValueChange = function(e) {
|
|
578
|
-
this.validateOnValueChange_ = e;
|
|
579
|
-
}, t.prototype.getValidateOnValueChange = function() {
|
|
580
|
-
return this.validateOnValueChange_;
|
|
581
|
-
}, t.prototype.setUseNativeValidation = function(e) {
|
|
582
|
-
this.useNativeValidation_ = e;
|
|
583
|
-
}, t.prototype.isDisabled = function() {
|
|
584
|
-
return this.getNativeInput_().disabled;
|
|
585
|
-
}, t.prototype.setDisabled = function(e) {
|
|
586
|
-
this.getNativeInput_().disabled = e, this.styleDisabled_(e);
|
|
587
|
-
}, t.prototype.setHelperTextContent = function(e) {
|
|
588
|
-
this.helperText_ && this.helperText_.setContent(e);
|
|
589
|
-
}, t.prototype.setLeadingIconAriaLabel = function(e) {
|
|
590
|
-
this.leadingIcon_ && this.leadingIcon_.setAriaLabel(e);
|
|
591
|
-
}, t.prototype.setLeadingIconContent = function(e) {
|
|
592
|
-
this.leadingIcon_ && this.leadingIcon_.setContent(e);
|
|
593
|
-
}, t.prototype.setTrailingIconAriaLabel = function(e) {
|
|
594
|
-
this.trailingIcon_ && this.trailingIcon_.setAriaLabel(e);
|
|
595
|
-
}, t.prototype.setTrailingIconContent = function(e) {
|
|
596
|
-
this.trailingIcon_ && this.trailingIcon_.setContent(e);
|
|
597
|
-
}, t.prototype.setCharacterCounter_ = function(e) {
|
|
598
|
-
if (this.characterCounter_) {
|
|
599
|
-
var n = this.getNativeInput_().maxLength;
|
|
600
|
-
if (n === -1)
|
|
601
|
-
throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");
|
|
602
|
-
this.characterCounter_.setCounterValue(e, n);
|
|
603
|
-
}
|
|
604
|
-
}, t.prototype.isBadInput_ = function() {
|
|
605
|
-
return this.getNativeInput_().validity.badInput || !1;
|
|
606
|
-
}, t.prototype.isNativeInputValid_ = function() {
|
|
607
|
-
return this.getNativeInput_().validity.valid;
|
|
608
|
-
}, t.prototype.styleValidity_ = function(e) {
|
|
609
|
-
var n = t.cssClasses.INVALID;
|
|
610
|
-
if (e ? this.adapter.removeClass(n) : this.adapter.addClass(n), this.helperText_) {
|
|
611
|
-
this.helperText_.setValidity(e);
|
|
612
|
-
var i = this.helperText_.isValidation();
|
|
613
|
-
if (!i)
|
|
614
|
-
return;
|
|
615
|
-
var o = this.helperText_.isVisible(), l = this.helperText_.getId();
|
|
616
|
-
o && l ? this.adapter.setInputAttr(x.ARIA_DESCRIBEDBY, l) : this.adapter.removeInputAttr(x.ARIA_DESCRIBEDBY);
|
|
617
|
-
}
|
|
618
|
-
}, t.prototype.styleFocused_ = function(e) {
|
|
619
|
-
var n = t.cssClasses.FOCUSED;
|
|
620
|
-
e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
|
|
621
|
-
}, t.prototype.styleDisabled_ = function(e) {
|
|
622
|
-
var n = t.cssClasses, i = n.DISABLED, o = n.INVALID;
|
|
623
|
-
e ? (this.adapter.addClass(i), this.adapter.removeClass(o)) : this.adapter.removeClass(i), this.leadingIcon_ && this.leadingIcon_.setDisabled(e), this.trailingIcon_ && this.trailingIcon_.setDisabled(e);
|
|
624
|
-
}, t.prototype.styleFloating_ = function(e) {
|
|
625
|
-
var n = t.cssClasses.LABEL_FLOATING;
|
|
626
|
-
e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
|
|
627
|
-
}, t.prototype.getNativeInput_ = function() {
|
|
628
|
-
var e = this.adapter ? this.adapter.getNativeInput() : null;
|
|
629
|
-
return e || {
|
|
630
|
-
disabled: !1,
|
|
631
|
-
maxLength: -1,
|
|
632
|
-
required: !1,
|
|
633
|
-
type: "input",
|
|
634
|
-
validity: {
|
|
635
|
-
badInput: !1,
|
|
636
|
-
valid: !0
|
|
637
|
-
},
|
|
638
|
-
value: ""
|
|
639
|
-
};
|
|
640
|
-
}, t;
|
|
641
|
-
}(z)
|
|
642
|
-
);
|
|
643
|
-
/**
|
|
644
|
-
* @license
|
|
645
|
-
* Copyright 2016 Google Inc.
|
|
646
|
-
*
|
|
647
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
648
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
649
|
-
* in the Software without restriction, including without limitation the rights
|
|
650
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
651
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
652
|
-
* furnished to do so, subject to the following conditions:
|
|
653
|
-
*
|
|
654
|
-
* The above copyright notice and this permission notice shall be included in
|
|
655
|
-
* all copies or substantial portions of the Software.
|
|
656
|
-
*
|
|
657
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
658
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
659
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
660
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
661
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
662
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
663
|
-
* THE SOFTWARE.
|
|
664
|
-
*/
|
|
665
|
-
var y = {
|
|
666
|
-
HELPER_TEXT_PERSISTENT: "mdc-text-field-helper-text--persistent",
|
|
667
|
-
HELPER_TEXT_VALIDATION_MSG: "mdc-text-field-helper-text--validation-msg",
|
|
668
|
-
ROOT: "mdc-text-field-helper-text"
|
|
669
|
-
}, k = {
|
|
670
|
-
ARIA_HIDDEN: "aria-hidden",
|
|
671
|
-
ROLE: "role",
|
|
672
|
-
ROOT_SELECTOR: "." + y.ROOT
|
|
673
|
-
};
|
|
674
|
-
/**
|
|
675
|
-
* @license
|
|
676
|
-
* Copyright 2017 Google Inc.
|
|
677
|
-
*
|
|
678
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
679
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
680
|
-
* in the Software without restriction, including without limitation the rights
|
|
681
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
682
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
683
|
-
* furnished to do so, subject to the following conditions:
|
|
684
|
-
*
|
|
685
|
-
* The above copyright notice and this permission notice shall be included in
|
|
686
|
-
* all copies or substantial portions of the Software.
|
|
687
|
-
*
|
|
688
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
689
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
690
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
691
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
692
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
693
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
694
|
-
* THE SOFTWARE.
|
|
695
|
-
*/
|
|
696
|
-
var Qe = (
|
|
697
|
-
/** @class */
|
|
698
|
-
function(a) {
|
|
699
|
-
C(t, a);
|
|
700
|
-
function t(e) {
|
|
701
|
-
return a.call(this, f(f({}, t.defaultAdapter), e)) || this;
|
|
702
|
-
}
|
|
703
|
-
return Object.defineProperty(t, "cssClasses", {
|
|
704
|
-
get: function() {
|
|
705
|
-
return y;
|
|
706
|
-
},
|
|
707
|
-
enumerable: !1,
|
|
708
|
-
configurable: !0
|
|
709
|
-
}), Object.defineProperty(t, "strings", {
|
|
710
|
-
get: function() {
|
|
711
|
-
return k;
|
|
712
|
-
},
|
|
713
|
-
enumerable: !1,
|
|
714
|
-
configurable: !0
|
|
715
|
-
}), Object.defineProperty(t, "defaultAdapter", {
|
|
716
|
-
/**
|
|
717
|
-
* See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.
|
|
718
|
-
*/
|
|
719
|
-
get: function() {
|
|
720
|
-
return {
|
|
721
|
-
addClass: function() {
|
|
722
|
-
},
|
|
723
|
-
removeClass: function() {
|
|
724
|
-
},
|
|
725
|
-
hasClass: function() {
|
|
726
|
-
return !1;
|
|
727
|
-
},
|
|
728
|
-
getAttr: function() {
|
|
729
|
-
return null;
|
|
730
|
-
},
|
|
731
|
-
setAttr: function() {
|
|
732
|
-
},
|
|
733
|
-
removeAttr: function() {
|
|
734
|
-
},
|
|
735
|
-
setContent: function() {
|
|
736
|
-
}
|
|
737
|
-
};
|
|
738
|
-
},
|
|
739
|
-
enumerable: !1,
|
|
740
|
-
configurable: !0
|
|
741
|
-
}), t.prototype.getId = function() {
|
|
742
|
-
return this.adapter.getAttr("id");
|
|
743
|
-
}, t.prototype.isVisible = function() {
|
|
744
|
-
return this.adapter.getAttr(k.ARIA_HIDDEN) !== "true";
|
|
745
|
-
}, t.prototype.setContent = function(e) {
|
|
746
|
-
this.adapter.setContent(e);
|
|
747
|
-
}, t.prototype.isPersistent = function() {
|
|
748
|
-
return this.adapter.hasClass(y.HELPER_TEXT_PERSISTENT);
|
|
749
|
-
}, t.prototype.setPersistent = function(e) {
|
|
750
|
-
e ? this.adapter.addClass(y.HELPER_TEXT_PERSISTENT) : this.adapter.removeClass(y.HELPER_TEXT_PERSISTENT);
|
|
751
|
-
}, t.prototype.isValidation = function() {
|
|
752
|
-
return this.adapter.hasClass(y.HELPER_TEXT_VALIDATION_MSG);
|
|
753
|
-
}, t.prototype.setValidation = function(e) {
|
|
754
|
-
e ? this.adapter.addClass(y.HELPER_TEXT_VALIDATION_MSG) : this.adapter.removeClass(y.HELPER_TEXT_VALIDATION_MSG);
|
|
755
|
-
}, t.prototype.showToScreenReader = function() {
|
|
756
|
-
this.adapter.removeAttr(k.ARIA_HIDDEN);
|
|
757
|
-
}, t.prototype.setValidity = function(e) {
|
|
758
|
-
var n = this.adapter.hasClass(y.HELPER_TEXT_PERSISTENT), i = this.adapter.hasClass(y.HELPER_TEXT_VALIDATION_MSG), o = i && !e;
|
|
759
|
-
o ? (this.showToScreenReader(), this.adapter.setAttr(k.ROLE, "alert")) : this.adapter.removeAttr(k.ROLE), !n && !o && this.hide_();
|
|
760
|
-
}, t.prototype.hide_ = function() {
|
|
761
|
-
this.adapter.setAttr(k.ARIA_HIDDEN, "true");
|
|
762
|
-
}, t;
|
|
763
|
-
}(z)
|
|
764
|
-
);
|
|
765
|
-
/**
|
|
766
|
-
* @license
|
|
767
|
-
* Copyright 2017 Google Inc.
|
|
768
|
-
*
|
|
769
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
770
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
771
|
-
* in the Software without restriction, including without limitation the rights
|
|
772
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
773
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
774
|
-
* furnished to do so, subject to the following conditions:
|
|
775
|
-
*
|
|
776
|
-
* The above copyright notice and this permission notice shall be included in
|
|
777
|
-
* all copies or substantial portions of the Software.
|
|
778
|
-
*
|
|
779
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
780
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
781
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
782
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
783
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
784
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
785
|
-
* THE SOFTWARE.
|
|
786
|
-
*/
|
|
787
|
-
var Ze = (
|
|
788
|
-
/** @class */
|
|
789
|
-
function(a) {
|
|
790
|
-
C(t, a);
|
|
791
|
-
function t() {
|
|
792
|
-
return a !== null && a.apply(this, arguments) || this;
|
|
793
|
-
}
|
|
794
|
-
return t.attachTo = function(e) {
|
|
795
|
-
return new t(e);
|
|
796
|
-
}, Object.defineProperty(t.prototype, "foundationForTextField", {
|
|
797
|
-
// Provided for access by MDCTextField component
|
|
798
|
-
get: function() {
|
|
799
|
-
return this.foundation;
|
|
800
|
-
},
|
|
801
|
-
enumerable: !1,
|
|
802
|
-
configurable: !0
|
|
803
|
-
}), t.prototype.getDefaultFoundation = function() {
|
|
804
|
-
var e = this, n = {
|
|
805
|
-
addClass: function(i) {
|
|
806
|
-
return e.root.classList.add(i);
|
|
807
|
-
},
|
|
808
|
-
removeClass: function(i) {
|
|
809
|
-
return e.root.classList.remove(i);
|
|
810
|
-
},
|
|
811
|
-
hasClass: function(i) {
|
|
812
|
-
return e.root.classList.contains(i);
|
|
813
|
-
},
|
|
814
|
-
getAttr: function(i) {
|
|
815
|
-
return e.root.getAttribute(i);
|
|
816
|
-
},
|
|
817
|
-
setAttr: function(i, o) {
|
|
818
|
-
return e.root.setAttribute(i, o);
|
|
819
|
-
},
|
|
820
|
-
removeAttr: function(i) {
|
|
821
|
-
return e.root.removeAttribute(i);
|
|
822
|
-
},
|
|
823
|
-
setContent: function(i) {
|
|
824
|
-
e.root.textContent = i;
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
return new Qe(n);
|
|
828
|
-
}, t;
|
|
829
|
-
}(Y)
|
|
830
|
-
);
|
|
831
|
-
/**
|
|
832
|
-
* @license
|
|
833
|
-
* Copyright 2016 Google Inc.
|
|
834
|
-
*
|
|
835
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
836
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
837
|
-
* in the Software without restriction, including without limitation the rights
|
|
838
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
839
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
840
|
-
* furnished to do so, subject to the following conditions:
|
|
841
|
-
*
|
|
842
|
-
* The above copyright notice and this permission notice shall be included in
|
|
843
|
-
* all copies or substantial portions of the Software.
|
|
844
|
-
*
|
|
845
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
846
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
847
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
848
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
849
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
850
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
851
|
-
* THE SOFTWARE.
|
|
852
|
-
*/
|
|
853
|
-
var ke = {
|
|
854
|
-
ICON_EVENT: "MDCTextField:icon",
|
|
855
|
-
ICON_ROLE: "button"
|
|
856
|
-
}, Dt = {
|
|
857
|
-
ROOT: "mdc-text-field__icon"
|
|
858
|
-
};
|
|
859
|
-
/**
|
|
860
|
-
* @license
|
|
861
|
-
* Copyright 2017 Google Inc.
|
|
862
|
-
*
|
|
863
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
864
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
865
|
-
* in the Software without restriction, including without limitation the rights
|
|
866
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
867
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
868
|
-
* furnished to do so, subject to the following conditions:
|
|
869
|
-
*
|
|
870
|
-
* The above copyright notice and this permission notice shall be included in
|
|
871
|
-
* all copies or substantial portions of the Software.
|
|
872
|
-
*
|
|
873
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
874
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
875
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
876
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
877
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
878
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
879
|
-
* THE SOFTWARE.
|
|
880
|
-
*/
|
|
881
|
-
var Ue = ["click", "keydown"], qe = (
|
|
882
|
-
/** @class */
|
|
883
|
-
function(a) {
|
|
884
|
-
C(t, a);
|
|
885
|
-
function t(e) {
|
|
886
|
-
var n = a.call(this, f(f({}, t.defaultAdapter), e)) || this;
|
|
887
|
-
return n.savedTabIndex_ = null, n.interactionHandler_ = function(i) {
|
|
888
|
-
return n.handleInteraction(i);
|
|
889
|
-
}, n;
|
|
890
|
-
}
|
|
891
|
-
return Object.defineProperty(t, "strings", {
|
|
892
|
-
get: function() {
|
|
893
|
-
return ke;
|
|
894
|
-
},
|
|
895
|
-
enumerable: !1,
|
|
896
|
-
configurable: !0
|
|
897
|
-
}), Object.defineProperty(t, "cssClasses", {
|
|
898
|
-
get: function() {
|
|
899
|
-
return Dt;
|
|
900
|
-
},
|
|
901
|
-
enumerable: !1,
|
|
902
|
-
configurable: !0
|
|
903
|
-
}), Object.defineProperty(t, "defaultAdapter", {
|
|
904
|
-
/**
|
|
905
|
-
* See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.
|
|
906
|
-
*/
|
|
907
|
-
get: function() {
|
|
908
|
-
return {
|
|
909
|
-
getAttr: function() {
|
|
910
|
-
return null;
|
|
911
|
-
},
|
|
912
|
-
setAttr: function() {
|
|
913
|
-
},
|
|
914
|
-
removeAttr: function() {
|
|
915
|
-
},
|
|
916
|
-
setContent: function() {
|
|
917
|
-
},
|
|
918
|
-
registerInteractionHandler: function() {
|
|
919
|
-
},
|
|
920
|
-
deregisterInteractionHandler: function() {
|
|
921
|
-
},
|
|
922
|
-
notifyIconAction: function() {
|
|
923
|
-
}
|
|
924
|
-
};
|
|
925
|
-
},
|
|
926
|
-
enumerable: !1,
|
|
927
|
-
configurable: !0
|
|
928
|
-
}), t.prototype.init = function() {
|
|
929
|
-
var e = this;
|
|
930
|
-
this.savedTabIndex_ = this.adapter.getAttr("tabindex"), Ue.forEach(function(n) {
|
|
931
|
-
e.adapter.registerInteractionHandler(n, e.interactionHandler_);
|
|
932
|
-
});
|
|
933
|
-
}, t.prototype.destroy = function() {
|
|
934
|
-
var e = this;
|
|
935
|
-
Ue.forEach(function(n) {
|
|
936
|
-
e.adapter.deregisterInteractionHandler(n, e.interactionHandler_);
|
|
937
|
-
});
|
|
938
|
-
}, t.prototype.setDisabled = function(e) {
|
|
939
|
-
this.savedTabIndex_ && (e ? (this.adapter.setAttr("tabindex", "-1"), this.adapter.removeAttr("role")) : (this.adapter.setAttr("tabindex", this.savedTabIndex_), this.adapter.setAttr("role", ke.ICON_ROLE)));
|
|
940
|
-
}, t.prototype.setAriaLabel = function(e) {
|
|
941
|
-
this.adapter.setAttr("aria-label", e);
|
|
942
|
-
}, t.prototype.setContent = function(e) {
|
|
943
|
-
this.adapter.setContent(e);
|
|
944
|
-
}, t.prototype.handleInteraction = function(e) {
|
|
945
|
-
var n = e.key === "Enter" || e.keyCode === 13;
|
|
946
|
-
(e.type === "click" || n) && (e.preventDefault(), this.adapter.notifyIconAction());
|
|
947
|
-
}, t;
|
|
948
|
-
}(z)
|
|
949
|
-
);
|
|
950
|
-
/**
|
|
951
|
-
* @license
|
|
952
|
-
* Copyright 2017 Google Inc.
|
|
953
|
-
*
|
|
954
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
955
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
956
|
-
* in the Software without restriction, including without limitation the rights
|
|
957
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
958
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
959
|
-
* furnished to do so, subject to the following conditions:
|
|
960
|
-
*
|
|
961
|
-
* The above copyright notice and this permission notice shall be included in
|
|
962
|
-
* all copies or substantial portions of the Software.
|
|
963
|
-
*
|
|
964
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
965
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
966
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
967
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
968
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
969
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
970
|
-
* THE SOFTWARE.
|
|
971
|
-
*/
|
|
972
|
-
var St = (
|
|
973
|
-
/** @class */
|
|
974
|
-
function(a) {
|
|
975
|
-
C(t, a);
|
|
976
|
-
function t() {
|
|
977
|
-
return a !== null && a.apply(this, arguments) || this;
|
|
978
|
-
}
|
|
979
|
-
return t.attachTo = function(e) {
|
|
980
|
-
return new t(e);
|
|
981
|
-
}, Object.defineProperty(t.prototype, "foundationForTextField", {
|
|
982
|
-
// Provided for access by MDCTextField component
|
|
983
|
-
get: function() {
|
|
984
|
-
return this.foundation;
|
|
985
|
-
},
|
|
986
|
-
enumerable: !1,
|
|
987
|
-
configurable: !0
|
|
988
|
-
}), t.prototype.getDefaultFoundation = function() {
|
|
989
|
-
var e = this, n = {
|
|
990
|
-
getAttr: function(i) {
|
|
991
|
-
return e.root.getAttribute(i);
|
|
992
|
-
},
|
|
993
|
-
setAttr: function(i, o) {
|
|
994
|
-
return e.root.setAttribute(i, o);
|
|
995
|
-
},
|
|
996
|
-
removeAttr: function(i) {
|
|
997
|
-
return e.root.removeAttribute(i);
|
|
998
|
-
},
|
|
999
|
-
setContent: function(i) {
|
|
1000
|
-
e.root.textContent = i;
|
|
1001
|
-
},
|
|
1002
|
-
registerInteractionHandler: function(i, o) {
|
|
1003
|
-
return e.listen(i, o);
|
|
1004
|
-
},
|
|
1005
|
-
deregisterInteractionHandler: function(i, o) {
|
|
1006
|
-
return e.unlisten(i, o);
|
|
1007
|
-
},
|
|
1008
|
-
notifyIconAction: function() {
|
|
1009
|
-
return e.emit(
|
|
1010
|
-
qe.strings.ICON_EVENT,
|
|
1011
|
-
{},
|
|
1012
|
-
!0
|
|
1013
|
-
/* shouldBubble */
|
|
1014
|
-
);
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
|
-
return new qe(n);
|
|
1018
|
-
}, t;
|
|
1019
|
-
}(Y)
|
|
1020
|
-
);
|
|
1021
|
-
/**
|
|
1022
|
-
* @license
|
|
1023
|
-
* Copyright 2016 Google Inc.
|
|
1024
|
-
*
|
|
1025
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1026
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1027
|
-
* in the Software without restriction, including without limitation the rights
|
|
1028
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1029
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1030
|
-
* furnished to do so, subject to the following conditions:
|
|
1031
|
-
*
|
|
1032
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1033
|
-
* all copies or substantial portions of the Software.
|
|
1034
|
-
*
|
|
1035
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1036
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1037
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1038
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1039
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1040
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1041
|
-
* THE SOFTWARE.
|
|
1042
|
-
*/
|
|
1043
|
-
var Ht = (
|
|
1044
|
-
/** @class */
|
|
1045
|
-
function(a) {
|
|
1046
|
-
C(t, a);
|
|
1047
|
-
function t() {
|
|
1048
|
-
return a !== null && a.apply(this, arguments) || this;
|
|
1049
|
-
}
|
|
1050
|
-
return t.attachTo = function(e) {
|
|
1051
|
-
return new t(e);
|
|
1052
|
-
}, t.prototype.initialize = function(e, n, i, o, l, s, p) {
|
|
1053
|
-
e === void 0 && (e = function(u, de) {
|
|
1054
|
-
return new we(u, de);
|
|
1055
|
-
}), n === void 0 && (n = function(u) {
|
|
1056
|
-
return new Ye(u);
|
|
1057
|
-
}), i === void 0 && (i = function(u) {
|
|
1058
|
-
return new Ze(u);
|
|
1059
|
-
}), o === void 0 && (o = function(u) {
|
|
1060
|
-
return new Nt(u);
|
|
1061
|
-
}), l === void 0 && (l = function(u) {
|
|
1062
|
-
return new St(u);
|
|
1063
|
-
}), s === void 0 && (s = function(u) {
|
|
1064
|
-
return new It(u);
|
|
1065
|
-
}), p === void 0 && (p = function(u) {
|
|
1066
|
-
return new xt(u);
|
|
1067
|
-
}), this.input_ = this.root.querySelector(x.INPUT_SELECTOR);
|
|
1068
|
-
var D = this.root.querySelector(x.LABEL_SELECTOR);
|
|
1069
|
-
this.label_ = D ? s(D) : null;
|
|
1070
|
-
var R = this.root.querySelector(x.LINE_RIPPLE_SELECTOR);
|
|
1071
|
-
this.lineRipple_ = R ? n(R) : null;
|
|
1072
|
-
var U = this.root.querySelector(x.OUTLINE_SELECTOR);
|
|
1073
|
-
this.outline_ = U ? p(U) : null;
|
|
1074
|
-
var ue = Qe.strings, A = this.root.nextElementSibling, K = A && A.classList.contains(ae.HELPER_LINE), h = K && A && A.querySelector(ue.ROOT_SELECTOR);
|
|
1075
|
-
this.helperText_ = h ? i(h) : null;
|
|
1076
|
-
var J = Je.strings, E = this.root.querySelector(J.ROOT_SELECTOR);
|
|
1077
|
-
!E && K && A && (E = A.querySelector(J.ROOT_SELECTOR)), this.characterCounter_ = E ? o(E) : null;
|
|
1078
|
-
var S = this.root.querySelector(x.LEADING_ICON_SELECTOR);
|
|
1079
|
-
this.leadingIcon_ = S ? l(S) : null;
|
|
1080
|
-
var Q = this.root.querySelector(x.TRAILING_ICON_SELECTOR);
|
|
1081
|
-
this.trailingIcon_ = Q ? l(Q) : null, this.prefix_ = this.root.querySelector(x.PREFIX_SELECTOR), this.suffix_ = this.root.querySelector(x.SUFFIX_SELECTOR), this.ripple = this.createRipple_(e);
|
|
1082
|
-
}, t.prototype.destroy = function() {
|
|
1083
|
-
this.ripple && this.ripple.destroy(), this.lineRipple_ && this.lineRipple_.destroy(), this.helperText_ && this.helperText_.destroy(), this.characterCounter_ && this.characterCounter_.destroy(), this.leadingIcon_ && this.leadingIcon_.destroy(), this.trailingIcon_ && this.trailingIcon_.destroy(), this.label_ && this.label_.destroy(), this.outline_ && this.outline_.destroy(), a.prototype.destroy.call(this);
|
|
1084
|
-
}, t.prototype.initialSyncWithDOM = function() {
|
|
1085
|
-
this.disabled = this.input_.disabled;
|
|
1086
|
-
}, Object.defineProperty(t.prototype, "value", {
|
|
1087
|
-
get: function() {
|
|
1088
|
-
return this.foundation.getValue();
|
|
1089
|
-
},
|
|
1090
|
-
/**
|
|
1091
|
-
* @param value The value to set on the input.
|
|
1092
|
-
*/
|
|
1093
|
-
set: function(e) {
|
|
1094
|
-
this.foundation.setValue(e);
|
|
1095
|
-
},
|
|
1096
|
-
enumerable: !1,
|
|
1097
|
-
configurable: !0
|
|
1098
|
-
}), Object.defineProperty(t.prototype, "disabled", {
|
|
1099
|
-
get: function() {
|
|
1100
|
-
return this.foundation.isDisabled();
|
|
1101
|
-
},
|
|
1102
|
-
/**
|
|
1103
|
-
* @param disabled Sets the Text Field disabled or enabled.
|
|
1104
|
-
*/
|
|
1105
|
-
set: function(e) {
|
|
1106
|
-
this.foundation.setDisabled(e);
|
|
1107
|
-
},
|
|
1108
|
-
enumerable: !1,
|
|
1109
|
-
configurable: !0
|
|
1110
|
-
}), Object.defineProperty(t.prototype, "valid", {
|
|
1111
|
-
get: function() {
|
|
1112
|
-
return this.foundation.isValid();
|
|
1113
|
-
},
|
|
1114
|
-
/**
|
|
1115
|
-
* @param valid Sets the Text Field valid or invalid.
|
|
1116
|
-
*/
|
|
1117
|
-
set: function(e) {
|
|
1118
|
-
this.foundation.setValid(e);
|
|
1119
|
-
},
|
|
1120
|
-
enumerable: !1,
|
|
1121
|
-
configurable: !0
|
|
1122
|
-
}), Object.defineProperty(t.prototype, "required", {
|
|
1123
|
-
get: function() {
|
|
1124
|
-
return this.input_.required;
|
|
1125
|
-
},
|
|
1126
|
-
/**
|
|
1127
|
-
* @param required Sets the Text Field to required.
|
|
1128
|
-
*/
|
|
1129
|
-
set: function(e) {
|
|
1130
|
-
this.input_.required = e;
|
|
1131
|
-
},
|
|
1132
|
-
enumerable: !1,
|
|
1133
|
-
configurable: !0
|
|
1134
|
-
}), Object.defineProperty(t.prototype, "pattern", {
|
|
1135
|
-
get: function() {
|
|
1136
|
-
return this.input_.pattern;
|
|
1137
|
-
},
|
|
1138
|
-
/**
|
|
1139
|
-
* @param pattern Sets the input element's validation pattern.
|
|
1140
|
-
*/
|
|
1141
|
-
set: function(e) {
|
|
1142
|
-
this.input_.pattern = e;
|
|
1143
|
-
},
|
|
1144
|
-
enumerable: !1,
|
|
1145
|
-
configurable: !0
|
|
1146
|
-
}), Object.defineProperty(t.prototype, "minLength", {
|
|
1147
|
-
get: function() {
|
|
1148
|
-
return this.input_.minLength;
|
|
1149
|
-
},
|
|
1150
|
-
/**
|
|
1151
|
-
* @param minLength Sets the input element's minLength.
|
|
1152
|
-
*/
|
|
1153
|
-
set: function(e) {
|
|
1154
|
-
this.input_.minLength = e;
|
|
1155
|
-
},
|
|
1156
|
-
enumerable: !1,
|
|
1157
|
-
configurable: !0
|
|
1158
|
-
}), Object.defineProperty(t.prototype, "maxLength", {
|
|
1159
|
-
get: function() {
|
|
1160
|
-
return this.input_.maxLength;
|
|
1161
|
-
},
|
|
1162
|
-
/**
|
|
1163
|
-
* @param maxLength Sets the input element's maxLength.
|
|
1164
|
-
*/
|
|
1165
|
-
set: function(e) {
|
|
1166
|
-
e < 0 ? this.input_.removeAttribute("maxLength") : this.input_.maxLength = e;
|
|
1167
|
-
},
|
|
1168
|
-
enumerable: !1,
|
|
1169
|
-
configurable: !0
|
|
1170
|
-
}), Object.defineProperty(t.prototype, "min", {
|
|
1171
|
-
get: function() {
|
|
1172
|
-
return this.input_.min;
|
|
1173
|
-
},
|
|
1174
|
-
/**
|
|
1175
|
-
* @param min Sets the input element's min.
|
|
1176
|
-
*/
|
|
1177
|
-
set: function(e) {
|
|
1178
|
-
this.input_.min = e;
|
|
1179
|
-
},
|
|
1180
|
-
enumerable: !1,
|
|
1181
|
-
configurable: !0
|
|
1182
|
-
}), Object.defineProperty(t.prototype, "max", {
|
|
1183
|
-
get: function() {
|
|
1184
|
-
return this.input_.max;
|
|
1185
|
-
},
|
|
1186
|
-
/**
|
|
1187
|
-
* @param max Sets the input element's max.
|
|
1188
|
-
*/
|
|
1189
|
-
set: function(e) {
|
|
1190
|
-
this.input_.max = e;
|
|
1191
|
-
},
|
|
1192
|
-
enumerable: !1,
|
|
1193
|
-
configurable: !0
|
|
1194
|
-
}), Object.defineProperty(t.prototype, "step", {
|
|
1195
|
-
get: function() {
|
|
1196
|
-
return this.input_.step;
|
|
1197
|
-
},
|
|
1198
|
-
/**
|
|
1199
|
-
* @param step Sets the input element's step.
|
|
1200
|
-
*/
|
|
1201
|
-
set: function(e) {
|
|
1202
|
-
this.input_.step = e;
|
|
1203
|
-
},
|
|
1204
|
-
enumerable: !1,
|
|
1205
|
-
configurable: !0
|
|
1206
|
-
}), Object.defineProperty(t.prototype, "helperTextContent", {
|
|
1207
|
-
/**
|
|
1208
|
-
* Sets the helper text element content.
|
|
1209
|
-
*/
|
|
1210
|
-
set: function(e) {
|
|
1211
|
-
this.foundation.setHelperTextContent(e);
|
|
1212
|
-
},
|
|
1213
|
-
enumerable: !1,
|
|
1214
|
-
configurable: !0
|
|
1215
|
-
}), Object.defineProperty(t.prototype, "leadingIconAriaLabel", {
|
|
1216
|
-
/**
|
|
1217
|
-
* Sets the aria label of the leading icon.
|
|
1218
|
-
*/
|
|
1219
|
-
set: function(e) {
|
|
1220
|
-
this.foundation.setLeadingIconAriaLabel(e);
|
|
1221
|
-
},
|
|
1222
|
-
enumerable: !1,
|
|
1223
|
-
configurable: !0
|
|
1224
|
-
}), Object.defineProperty(t.prototype, "leadingIconContent", {
|
|
1225
|
-
/**
|
|
1226
|
-
* Sets the text content of the leading icon.
|
|
1227
|
-
*/
|
|
1228
|
-
set: function(e) {
|
|
1229
|
-
this.foundation.setLeadingIconContent(e);
|
|
1230
|
-
},
|
|
1231
|
-
enumerable: !1,
|
|
1232
|
-
configurable: !0
|
|
1233
|
-
}), Object.defineProperty(t.prototype, "trailingIconAriaLabel", {
|
|
1234
|
-
/**
|
|
1235
|
-
* Sets the aria label of the trailing icon.
|
|
1236
|
-
*/
|
|
1237
|
-
set: function(e) {
|
|
1238
|
-
this.foundation.setTrailingIconAriaLabel(e);
|
|
1239
|
-
},
|
|
1240
|
-
enumerable: !1,
|
|
1241
|
-
configurable: !0
|
|
1242
|
-
}), Object.defineProperty(t.prototype, "trailingIconContent", {
|
|
1243
|
-
/**
|
|
1244
|
-
* Sets the text content of the trailing icon.
|
|
1245
|
-
*/
|
|
1246
|
-
set: function(e) {
|
|
1247
|
-
this.foundation.setTrailingIconContent(e);
|
|
1248
|
-
},
|
|
1249
|
-
enumerable: !1,
|
|
1250
|
-
configurable: !0
|
|
1251
|
-
}), Object.defineProperty(t.prototype, "useNativeValidation", {
|
|
1252
|
-
/**
|
|
1253
|
-
* Enables or disables the use of native validation. Use this for custom validation.
|
|
1254
|
-
* @param useNativeValidation Set this to false to ignore native input validation.
|
|
1255
|
-
*/
|
|
1256
|
-
set: function(e) {
|
|
1257
|
-
this.foundation.setUseNativeValidation(e);
|
|
1258
|
-
},
|
|
1259
|
-
enumerable: !1,
|
|
1260
|
-
configurable: !0
|
|
1261
|
-
}), Object.defineProperty(t.prototype, "prefixText", {
|
|
1262
|
-
/**
|
|
1263
|
-
* Gets the text content of the prefix, or null if it does not exist.
|
|
1264
|
-
*/
|
|
1265
|
-
get: function() {
|
|
1266
|
-
return this.prefix_ ? this.prefix_.textContent : null;
|
|
1267
|
-
},
|
|
1268
|
-
/**
|
|
1269
|
-
* Sets the text content of the prefix, if it exists.
|
|
1270
|
-
*/
|
|
1271
|
-
set: function(e) {
|
|
1272
|
-
this.prefix_ && (this.prefix_.textContent = e);
|
|
1273
|
-
},
|
|
1274
|
-
enumerable: !1,
|
|
1275
|
-
configurable: !0
|
|
1276
|
-
}), Object.defineProperty(t.prototype, "suffixText", {
|
|
1277
|
-
/**
|
|
1278
|
-
* Gets the text content of the suffix, or null if it does not exist.
|
|
1279
|
-
*/
|
|
1280
|
-
get: function() {
|
|
1281
|
-
return this.suffix_ ? this.suffix_.textContent : null;
|
|
1282
|
-
},
|
|
1283
|
-
/**
|
|
1284
|
-
* Sets the text content of the suffix, if it exists.
|
|
1285
|
-
*/
|
|
1286
|
-
set: function(e) {
|
|
1287
|
-
this.suffix_ && (this.suffix_.textContent = e);
|
|
1288
|
-
},
|
|
1289
|
-
enumerable: !1,
|
|
1290
|
-
configurable: !0
|
|
1291
|
-
}), t.prototype.focus = function() {
|
|
1292
|
-
this.input_.focus();
|
|
1293
|
-
}, t.prototype.layout = function() {
|
|
1294
|
-
var e = this.foundation.shouldFloat;
|
|
1295
|
-
this.foundation.notchOutline(e);
|
|
1296
|
-
}, t.prototype.getDefaultFoundation = function() {
|
|
1297
|
-
var e = f(f(f(f(f({}, this.getRootAdapterMethods_()), this.getInputAdapterMethods_()), this.getLabelAdapterMethods_()), this.getLineRippleAdapterMethods_()), this.getOutlineAdapterMethods_());
|
|
1298
|
-
return new Vt(e, this.getFoundationMap_());
|
|
1299
|
-
}, t.prototype.getRootAdapterMethods_ = function() {
|
|
1300
|
-
var e = this;
|
|
1301
|
-
return {
|
|
1302
|
-
addClass: function(n) {
|
|
1303
|
-
return e.root.classList.add(n);
|
|
1304
|
-
},
|
|
1305
|
-
removeClass: function(n) {
|
|
1306
|
-
return e.root.classList.remove(n);
|
|
1307
|
-
},
|
|
1308
|
-
hasClass: function(n) {
|
|
1309
|
-
return e.root.classList.contains(n);
|
|
1310
|
-
},
|
|
1311
|
-
registerTextFieldInteractionHandler: function(n, i) {
|
|
1312
|
-
e.listen(n, i);
|
|
1313
|
-
},
|
|
1314
|
-
deregisterTextFieldInteractionHandler: function(n, i) {
|
|
1315
|
-
e.unlisten(n, i);
|
|
1316
|
-
},
|
|
1317
|
-
registerValidationAttributeChangeHandler: function(n) {
|
|
1318
|
-
var i = function(s) {
|
|
1319
|
-
return s.map(function(p) {
|
|
1320
|
-
return p.attributeName;
|
|
1321
|
-
}).filter(function(p) {
|
|
1322
|
-
return p;
|
|
1323
|
-
});
|
|
1324
|
-
}, o = new MutationObserver(function(s) {
|
|
1325
|
-
return n(i(s));
|
|
1326
|
-
}), l = { attributes: !0 };
|
|
1327
|
-
return o.observe(e.input_, l), o;
|
|
1328
|
-
},
|
|
1329
|
-
deregisterValidationAttributeChangeHandler: function(n) {
|
|
1330
|
-
n.disconnect();
|
|
1331
|
-
}
|
|
1332
|
-
};
|
|
1333
|
-
}, t.prototype.getInputAdapterMethods_ = function() {
|
|
1334
|
-
var e = this;
|
|
1335
|
-
return {
|
|
1336
|
-
getNativeInput: function() {
|
|
1337
|
-
return e.input_;
|
|
1338
|
-
},
|
|
1339
|
-
setInputAttr: function(n, i) {
|
|
1340
|
-
e.input_.setAttribute(n, i);
|
|
1341
|
-
},
|
|
1342
|
-
removeInputAttr: function(n) {
|
|
1343
|
-
e.input_.removeAttribute(n);
|
|
1344
|
-
},
|
|
1345
|
-
isFocused: function() {
|
|
1346
|
-
return document.activeElement === e.input_;
|
|
1347
|
-
},
|
|
1348
|
-
registerInputInteractionHandler: function(n, i) {
|
|
1349
|
-
e.input_.addEventListener(n, i, ie());
|
|
1350
|
-
},
|
|
1351
|
-
deregisterInputInteractionHandler: function(n, i) {
|
|
1352
|
-
e.input_.removeEventListener(n, i, ie());
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
}, t.prototype.getLabelAdapterMethods_ = function() {
|
|
1356
|
-
var e = this;
|
|
1357
|
-
return {
|
|
1358
|
-
floatLabel: function(n) {
|
|
1359
|
-
return e.label_ && e.label_.float(n);
|
|
1360
|
-
},
|
|
1361
|
-
getLabelWidth: function() {
|
|
1362
|
-
return e.label_ ? e.label_.getWidth() : 0;
|
|
1363
|
-
},
|
|
1364
|
-
hasLabel: function() {
|
|
1365
|
-
return !!e.label_;
|
|
1366
|
-
},
|
|
1367
|
-
shakeLabel: function(n) {
|
|
1368
|
-
return e.label_ && e.label_.shake(n);
|
|
1369
|
-
},
|
|
1370
|
-
setLabelRequired: function(n) {
|
|
1371
|
-
return e.label_ && e.label_.setRequired(n);
|
|
1372
|
-
}
|
|
1373
|
-
};
|
|
1374
|
-
}, t.prototype.getLineRippleAdapterMethods_ = function() {
|
|
1375
|
-
var e = this;
|
|
1376
|
-
return {
|
|
1377
|
-
activateLineRipple: function() {
|
|
1378
|
-
e.lineRipple_ && e.lineRipple_.activate();
|
|
1379
|
-
},
|
|
1380
|
-
deactivateLineRipple: function() {
|
|
1381
|
-
e.lineRipple_ && e.lineRipple_.deactivate();
|
|
1382
|
-
},
|
|
1383
|
-
setLineRippleTransformOrigin: function(n) {
|
|
1384
|
-
e.lineRipple_ && e.lineRipple_.setRippleCenter(n);
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1387
|
-
}, t.prototype.getOutlineAdapterMethods_ = function() {
|
|
1388
|
-
var e = this;
|
|
1389
|
-
return {
|
|
1390
|
-
closeOutline: function() {
|
|
1391
|
-
return e.outline_ && e.outline_.closeNotch();
|
|
1392
|
-
},
|
|
1393
|
-
hasOutline: function() {
|
|
1394
|
-
return !!e.outline_;
|
|
1395
|
-
},
|
|
1396
|
-
notchOutline: function(n) {
|
|
1397
|
-
return e.outline_ && e.outline_.notch(n);
|
|
1398
|
-
}
|
|
1399
|
-
};
|
|
1400
|
-
}, t.prototype.getFoundationMap_ = function() {
|
|
1401
|
-
return {
|
|
1402
|
-
characterCounter: this.characterCounter_ ? this.characterCounter_.foundationForTextField : void 0,
|
|
1403
|
-
helperText: this.helperText_ ? this.helperText_.foundationForTextField : void 0,
|
|
1404
|
-
leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundationForTextField : void 0,
|
|
1405
|
-
trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundationForTextField : void 0
|
|
1406
|
-
};
|
|
1407
|
-
}, t.prototype.createRipple_ = function(e) {
|
|
1408
|
-
var n = this, i = this.root.classList.contains(ae.TEXTAREA), o = this.root.classList.contains(ae.OUTLINED);
|
|
1409
|
-
if (i || o)
|
|
1410
|
-
return null;
|
|
1411
|
-
var l = f(f({}, we.createAdapter(this)), { isSurfaceActive: function() {
|
|
1412
|
-
return Ct(n.input_, ":active");
|
|
1413
|
-
}, registerInteractionHandler: function(s, p) {
|
|
1414
|
-
return n.input_.addEventListener(s, p, ie());
|
|
1415
|
-
}, deregisterInteractionHandler: function(s, p) {
|
|
1416
|
-
return n.input_.removeEventListener(s, p, ie());
|
|
1417
|
-
} });
|
|
1418
|
-
return e(this.root, new Et(l));
|
|
1419
|
-
}, t;
|
|
1420
|
-
}(Y)
|
|
1421
|
-
);
|
|
1422
|
-
const wt = {
|
|
1423
|
-
/**
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1426
|
-
* Defaults to **null**.
|
|
1427
|
-
*/
|
|
1428
|
-
activated: r.bool,
|
|
1429
|
-
/**
|
|
1430
|
-
* The css class name to be passed through to the component markup.
|
|
1431
|
-
*
|
|
1432
|
-
* Defaults to **undefined**.
|
|
1433
|
-
*/
|
|
1434
|
-
className: r.string,
|
|
1435
|
-
/**
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1438
|
-
* Defaults to **null**.
|
|
1439
|
-
*/
|
|
1440
|
-
rippleCenter: r.string
|
|
1441
|
-
}, Mt = {
|
|
1442
|
-
activated: null,
|
|
1443
|
-
className: void 0,
|
|
1444
|
-
rippleCenter: null
|
|
1445
|
-
}, oe = /* @__PURE__ */ Ie((a, t) => {
|
|
1446
|
-
const {
|
|
1447
|
-
activated: e,
|
|
1448
|
-
rippleCenter: n,
|
|
1449
|
-
className: i,
|
|
1450
|
-
...o
|
|
1451
|
-
} = a, l = I(), s = I();
|
|
1452
|
-
return We(t, () => s.current, []), _(() => (l.current = Ye.attachTo(s.current), () => {
|
|
1453
|
-
l.current.destroy();
|
|
1454
|
-
}), [s]), _(() => {
|
|
1455
|
-
e ? l.current.activate() : l.current.deactivate();
|
|
1456
|
-
}, [e]), _(() => {
|
|
1457
|
-
n && l.current.setRippleCenter(n);
|
|
1458
|
-
}, [n]), /* @__PURE__ */ c.createElement("div", re({
|
|
1459
|
-
ref: s,
|
|
1460
|
-
className: V("lmnt", "mdc-line-ripple", i)
|
|
1461
|
-
}, o));
|
|
1462
|
-
});
|
|
1463
|
-
oe.displayName = "LineRipple";
|
|
1464
|
-
oe.propTypes = wt;
|
|
1465
|
-
oe.defaultProps = Mt;
|
|
1466
|
-
const se = /* @__PURE__ */ Ie((a, t) => {
|
|
1467
|
-
const {
|
|
1468
|
-
wrap: e,
|
|
1469
|
-
children: n
|
|
1470
|
-
} = a;
|
|
1471
|
-
return e ? /* @__PURE__ */ c.createElement("span", {
|
|
1472
|
-
ref: t,
|
|
1473
|
-
className: "mdc-text-field__resizer"
|
|
1474
|
-
}, n) : n;
|
|
1475
|
-
});
|
|
1476
|
-
se.displayName = "TextfieldSpanShim";
|
|
1477
|
-
se.propTypes = {
|
|
1478
|
-
children: r.node,
|
|
1479
|
-
wrap: r.bool
|
|
1480
|
-
};
|
|
1481
|
-
se.defaultProps = {
|
|
1482
|
-
children: void 0,
|
|
1483
|
-
wrap: !1
|
|
1484
|
-
};
|
|
1485
|
-
const jt = {
|
|
1486
|
-
/**
|
|
1487
|
-
* @deprecated _Use `fullWidth` instead._
|
|
1488
|
-
*
|
|
1489
|
-
* Applies a full-width style where the Textfield will fill its container.
|
|
1490
|
-
*
|
|
1491
|
-
* Defaults to **undefined**.
|
|
1492
|
-
*/
|
|
1493
|
-
block: O(r.bool, "Textfield", "Use `fullWidth` instead."),
|
|
1494
|
-
/**
|
|
1495
|
-
* The css class name to be passed through to the component markup.
|
|
1496
|
-
*
|
|
1497
|
-
* Defaults to **undefined**.
|
|
1498
|
-
*/
|
|
1499
|
-
className: r.string,
|
|
1500
|
-
/**
|
|
1501
|
-
* @deprecated _See `containerProps`._
|
|
1502
|
-
*
|
|
1503
|
-
* Add a custom class to the `Textfield` container.
|
|
1504
|
-
*
|
|
1505
|
-
* Defaults to **undefined**.
|
|
1506
|
-
*/
|
|
1507
|
-
containerClass: O(r.string, "Textfield", "See `containerProps`."),
|
|
1508
|
-
/**
|
|
1509
|
-
* Properties to be added to the container of the textfield.
|
|
1510
|
-
*
|
|
1511
|
-
* Defaults to **undefined**.
|
|
1512
|
-
*/
|
|
1513
|
-
containerProps: r.object,
|
|
1514
|
-
/**
|
|
1515
|
-
* Enables a character count. _Warning_ requires `maxlength` to be set.
|
|
1516
|
-
*
|
|
1517
|
-
* Defaults to **false**.
|
|
1518
|
-
*/
|
|
1519
|
-
counter: r.bool,
|
|
1520
|
-
/**
|
|
1521
|
-
* The starting value of the Textfield when working in uncontrolled mode.
|
|
1522
|
-
*
|
|
1523
|
-
* Defaults to **undefined**.
|
|
1524
|
-
*/
|
|
1525
|
-
defaultValue: r.oneOfType([r.string, r.number]),
|
|
1526
|
-
/**
|
|
1527
|
-
* The size of the Textfield will be reduced.
|
|
1528
|
-
*
|
|
1529
|
-
* Defaults to **false**.
|
|
1530
|
-
*/
|
|
1531
|
-
dense: r.bool,
|
|
1532
|
-
/**
|
|
1533
|
-
* Textfield will be disabled.
|
|
1534
|
-
*
|
|
1535
|
-
* Defaults to **false**.
|
|
1536
|
-
*/
|
|
1537
|
-
disabled: r.bool,
|
|
1538
|
-
/**
|
|
1539
|
-
* @deprecated _Use `variant='embedded'_
|
|
1540
|
-
*
|
|
1541
|
-
* An unfilled, non-outlined and full-width variant of Textfield, intended to be embedded in other components such as TopAppBar or TableHeader.
|
|
1542
|
-
*
|
|
1543
|
-
* Defaults to **undefined**.
|
|
1544
|
-
*/
|
|
1545
|
-
embedded: O(r.bool, "Textfield", 'Use `variant="embedded"'),
|
|
1546
|
-
/**
|
|
1547
|
-
* @deprecated _Use variant='filled' instead._
|
|
1548
|
-
*
|
|
1549
|
-
* Apply filled style to the Textfield. Previously called primary.
|
|
1550
|
-
*
|
|
1551
|
-
* Defaults to **undefined**.
|
|
1552
|
-
*/
|
|
1553
|
-
filled: O(r.bool, "Textfield", 'Use variant="filled" instead.'),
|
|
1554
|
-
/**
|
|
1555
|
-
* Sets the Textfield to the focused state.
|
|
1556
|
-
*
|
|
1557
|
-
* Defaults to **false**.
|
|
1558
|
-
*/
|
|
1559
|
-
focused: r.bool,
|
|
1560
|
-
/**
|
|
1561
|
-
* The Textfield will expand to 100% width.
|
|
1562
|
-
*
|
|
1563
|
-
* Defaults to **false**.
|
|
1564
|
-
*/
|
|
1565
|
-
fullWidth: r.bool,
|
|
1566
|
-
/**
|
|
1567
|
-
* Helper text to be displayed below Textfield, by default only visible on focus.
|
|
1568
|
-
*
|
|
1569
|
-
* Defaults to **null**.
|
|
1570
|
-
*/
|
|
1571
|
-
helperText: r.node,
|
|
1572
|
-
/**
|
|
1573
|
-
* Randomly generated id for the helper text container element. May be overwritten.
|
|
1574
|
-
*
|
|
1575
|
-
* Defaults to **undefined**.
|
|
1576
|
-
*/
|
|
1577
|
-
helperTextId: r.string,
|
|
1578
|
-
/**
|
|
1579
|
-
* Set the helper text to be permanently visible.
|
|
1580
|
-
*
|
|
1581
|
-
* Defaults to **false**.
|
|
1582
|
-
*/
|
|
1583
|
-
helperTextPersistent: r.bool,
|
|
1584
|
-
/**
|
|
1585
|
-
* Set the helper text to use validation styles. Helper text changes with `valid` (e.g., helper text will appear red when `valid` is set to 'false').
|
|
1586
|
-
*
|
|
1587
|
-
* Defaults to **false**.
|
|
1588
|
-
*/
|
|
1589
|
-
helperTextValidation: r.bool,
|
|
1590
|
-
/**
|
|
1591
|
-
* Randomly generated id for the input element. May be overwritten.
|
|
1592
|
-
*
|
|
1593
|
-
* Defaults to **undefined**.
|
|
1594
|
-
*/
|
|
1595
|
-
id: r.string,
|
|
1596
|
-
/**
|
|
1597
|
-
* Floating input label. Note: full-width Textfields do not support floating labels - any label on a full-width Textfield will be automatically mapped to a placeholder.
|
|
1598
|
-
*
|
|
1599
|
-
* Defaults to **null**.
|
|
1600
|
-
*/
|
|
1601
|
-
label: r.string,
|
|
1602
|
-
/**
|
|
1603
|
-
* Randomly generated id for the label element. May be overwritten.
|
|
1604
|
-
*
|
|
1605
|
-
* Defaults to **undefined**.
|
|
1606
|
-
*/
|
|
1607
|
-
labelId: r.string,
|
|
1608
|
-
/**
|
|
1609
|
-
* Custom content to appear before the input.
|
|
1610
|
-
*
|
|
1611
|
-
* Defaults to **null**.
|
|
1612
|
-
*/
|
|
1613
|
-
leadingContent: r.node,
|
|
1614
|
-
/**
|
|
1615
|
-
* Adds the given Icon or Icon Button to the left of the Textfield. Expects the name of a valid Material.io icon, however in React an icon or icon button component may be passed in instead for more control,
|
|
1616
|
-
*
|
|
1617
|
-
* Defaults to **null**.
|
|
1618
|
-
*/
|
|
1619
|
-
leadingIcon: r.oneOfType([r.string, r.node]),
|
|
1620
|
-
/**
|
|
1621
|
-
* @deprecated _Use `maxlength` instead. The case of this prop has changed to be more consistent._
|
|
1622
|
-
*
|
|
1623
|
-
* Restricts the number of characters that can be entered, best used with counter.
|
|
1624
|
-
*
|
|
1625
|
-
* Defaults to **undefined**.
|
|
1626
|
-
*/
|
|
1627
|
-
maxLength: O(r.number, "Textfield", "Use `maxlength` instead. The case of this prop has changed to be more consistent."),
|
|
1628
|
-
/**
|
|
1629
|
-
* Restricts the number of characters that can be entered, best used with counter.
|
|
1630
|
-
*
|
|
1631
|
-
* Defaults to **null**.
|
|
1632
|
-
*/
|
|
1633
|
-
maxlength: bt(r.number, "Textfield", "counter"),
|
|
1634
|
-
/**
|
|
1635
|
-
* Prevents resizing when using `textarea`.
|
|
1636
|
-
*
|
|
1637
|
-
* Defaults to **true**.
|
|
1638
|
-
*/
|
|
1639
|
-
noResize: r.bool,
|
|
1640
|
-
/**
|
|
1641
|
-
* Fired when focus leaves the input.
|
|
1642
|
-
*
|
|
1643
|
-
* Defaults to **null**.
|
|
1644
|
-
*/
|
|
1645
|
-
onBlur: r.func,
|
|
1646
|
-
/**
|
|
1647
|
-
* Fired when each character is entered into the Textfield.
|
|
1648
|
-
*
|
|
1649
|
-
* Defaults to **null**.
|
|
1650
|
-
*/
|
|
1651
|
-
onChange: r.func,
|
|
1652
|
-
/**
|
|
1653
|
-
* Fired when the input gains focus.
|
|
1654
|
-
*
|
|
1655
|
-
* Defaults to **null**.
|
|
1656
|
-
*/
|
|
1657
|
-
onFocus: r.func,
|
|
1658
|
-
/**
|
|
1659
|
-
* @deprecated _Use `variant='outlined'` instead_
|
|
1660
|
-
*
|
|
1661
|
-
* Apply outlined style to the Textfield. Previously called secondary.
|
|
1662
|
-
*
|
|
1663
|
-
* Defaults to **undefined**.
|
|
1664
|
-
*/
|
|
1665
|
-
outlined: O(r.bool, "Textfield", 'Use `variant="outlined"` instead'),
|
|
1666
|
-
/**
|
|
1667
|
-
* Non-floating label text, will be replaced when the user starts typing.
|
|
1668
|
-
*
|
|
1669
|
-
* Defaults to **null**.
|
|
1670
|
-
*/
|
|
1671
|
-
placeholder: r.string,
|
|
1672
|
-
/**
|
|
1673
|
-
* Text that will appear before the label or value of the Textfield. It will be shown on focus. An example use-case might be a currency symbol such as `$`. _Warning:_ This cannot be used with `leadingIcon` or `textarea`.
|
|
1674
|
-
*
|
|
1675
|
-
* Defaults to **null**.
|
|
1676
|
-
*/
|
|
1677
|
-
prefixText: r.string,
|
|
1678
|
-
/**
|
|
1679
|
-
* @deprecated _This feature is no longer supported. Use `variant='filled'` instead._
|
|
1680
|
-
*
|
|
1681
|
-
* Enable filled styling.
|
|
1682
|
-
*
|
|
1683
|
-
* Defaults to **undefined**.
|
|
1684
|
-
*/
|
|
1685
|
-
primary: O(r.bool, "Textfield", 'This feature is no longer supported. Use `variant="filled"` instead.'),
|
|
1686
|
-
/**
|
|
1687
|
-
* @deprecated _Use `variant='embedded'`_
|
|
1688
|
-
*
|
|
1689
|
-
* Enabled search bar styling, including a full width style.
|
|
1690
|
-
*
|
|
1691
|
-
* Defaults to **undefined**.
|
|
1692
|
-
*/
|
|
1693
|
-
search: O(r.bool, "Textfield", 'Use `variant="embedded"`'),
|
|
1694
|
-
/**
|
|
1695
|
-
* @deprecated _Use `variant='outlined'` instead._
|
|
1696
|
-
*
|
|
1697
|
-
* Apply secondary style to the Textfield.
|
|
1698
|
-
*
|
|
1699
|
-
* Defaults to **undefined**.
|
|
1700
|
-
*/
|
|
1701
|
-
secondary: O(r.bool, "Textfield", 'Use `variant="outlined"` instead.'),
|
|
1702
|
-
/**
|
|
1703
|
-
* Text that will appear after the label or value of the Textfield. It will be shown on focus. An example use-case might be `.00` if handling currency. _Warning:_ This cannot be used with `trailingIcon` or `textarea`.
|
|
1704
|
-
*
|
|
1705
|
-
* Defaults to **null**.
|
|
1706
|
-
*/
|
|
1707
|
-
suffixText: r.string,
|
|
1708
|
-
/**
|
|
1709
|
-
* Enabled multi-line text input. _Note_ `textarea` cannot be used with the embedded variant.
|
|
1710
|
-
*
|
|
1711
|
-
* Defaults to **false**.
|
|
1712
|
-
*/
|
|
1713
|
-
textarea: r.bool,
|
|
1714
|
-
/**
|
|
1715
|
-
* If defined, a Tooltip will appear on the Textfield. Useful to show the full value, if the value is too long for the Textfield width. The object should be the needed Tooltip properties. Tooltip `text` prop will be set to the current value of the Textfield. See Tooltip docs for available props.
|
|
1716
|
-
*
|
|
1717
|
-
* Defaults to **null**.
|
|
1718
|
-
*/
|
|
1719
|
-
tooltip: r.oneOfType([r.bool, r.object]),
|
|
1720
|
-
/**
|
|
1721
|
-
* Custom content to appear after the input.
|
|
1722
|
-
*
|
|
1723
|
-
* Defaults to **null**.
|
|
1724
|
-
*/
|
|
1725
|
-
trailingContent: r.node,
|
|
1726
|
-
/**
|
|
1727
|
-
* Adds the given Icon or Icon Button to the right of the Textfield . Expects the name of a valid Material.io icon, however in React an icon icon button component may be passed in instead for more control.
|
|
1728
|
-
*
|
|
1729
|
-
* Defaults to **null**.
|
|
1730
|
-
*/
|
|
1731
|
-
trailingIcon: r.oneOfType([r.string, r.node]),
|
|
1732
|
-
/**
|
|
1733
|
-
* Support for built-in input types. Browser support for some advanced types such as color or date may be limited or appear differently between browsers. _Note_ the `Datepicker` component should be preferred over the built-in date/time types as it offers more consistency and features._Note_ Slider type is not support, please use the Element `Slider` component instead.
|
|
1734
|
-
*
|
|
1735
|
-
* Defaults to **'text'**.
|
|
1736
|
-
*/
|
|
1737
|
-
type: r.oneOf(["text", "password", "color", "email", "url", "number", "tel", "search", "datetime-local", "month", "time", "week", "date"]),
|
|
1738
|
-
/**
|
|
1739
|
-
* Applies an invalid style to the Textfield.
|
|
1740
|
-
*
|
|
1741
|
-
* Defaults to **true**.
|
|
1742
|
-
*/
|
|
1743
|
-
valid: r.bool,
|
|
1744
|
-
/**
|
|
1745
|
-
* The current value of the Textfield component.
|
|
1746
|
-
*
|
|
1747
|
-
* Defaults to **undefined**.
|
|
1748
|
-
*/
|
|
1749
|
-
value: r.oneOfType([r.string, r.number]),
|
|
1750
|
-
/**
|
|
1751
|
-
* Applies the selected styling to the Textfield. _Note_ `textarea` does not support the `embedded` variant.
|
|
1752
|
-
*
|
|
1753
|
-
* Defaults to **'filled'**.
|
|
1754
|
-
*/
|
|
1755
|
-
variant: r.oneOf(["filled", "outlined", "embedded"])
|
|
1756
|
-
}, Bt = {
|
|
1757
|
-
block: void 0,
|
|
1758
|
-
className: void 0,
|
|
1759
|
-
containerClass: void 0,
|
|
1760
|
-
containerProps: void 0,
|
|
1761
|
-
counter: !1,
|
|
1762
|
-
defaultValue: void 0,
|
|
1763
|
-
dense: !1,
|
|
1764
|
-
disabled: !1,
|
|
1765
|
-
embedded: void 0,
|
|
1766
|
-
filled: void 0,
|
|
1767
|
-
focused: !1,
|
|
1768
|
-
fullWidth: !1,
|
|
1769
|
-
helperText: null,
|
|
1770
|
-
helperTextId: void 0,
|
|
1771
|
-
helperTextPersistent: !1,
|
|
1772
|
-
helperTextValidation: !1,
|
|
1773
|
-
id: void 0,
|
|
1774
|
-
label: null,
|
|
1775
|
-
labelId: void 0,
|
|
1776
|
-
leadingContent: null,
|
|
1777
|
-
leadingIcon: null,
|
|
1778
|
-
maxLength: void 0,
|
|
1779
|
-
maxlength: null,
|
|
1780
|
-
noResize: !0,
|
|
1781
|
-
outlined: void 0,
|
|
1782
|
-
placeholder: null,
|
|
1783
|
-
prefixText: null,
|
|
1784
|
-
primary: void 0,
|
|
1785
|
-
search: void 0,
|
|
1786
|
-
secondary: void 0,
|
|
1787
|
-
suffixText: null,
|
|
1788
|
-
textarea: !1,
|
|
1789
|
-
tooltip: null,
|
|
1790
|
-
trailingContent: null,
|
|
1791
|
-
trailingIcon: null,
|
|
1792
|
-
type: "text",
|
|
1793
|
-
valid: !0,
|
|
1794
|
-
value: void 0,
|
|
1795
|
-
variant: "filled"
|
|
1796
|
-
}, Xe = (a, t) => a ? /* @__PURE__ */ c.createElement("div", {
|
|
1797
|
-
className: "mdc-text-field-character-counter"
|
|
1798
|
-
}, "0 / ", t) : null, kt = (a) => {
|
|
1799
|
-
const {
|
|
1800
|
-
type: t
|
|
1801
|
-
} = {
|
|
1802
|
-
...a
|
|
1803
|
-
}, {
|
|
1804
|
-
displayName: e
|
|
1805
|
-
} = {
|
|
1806
|
-
...t
|
|
1807
|
-
};
|
|
1808
|
-
return typeof a == "string" ? /* @__PURE__ */ c.createElement(ze, {
|
|
1809
|
-
role: "button",
|
|
1810
|
-
className: "mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--leading",
|
|
1811
|
-
icon: a
|
|
1812
|
-
}) : Ge(a, {
|
|
1813
|
-
className: V("mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--leading", e === "IconButton" && "lmnt-text-field__icon-button--leading"),
|
|
1814
|
-
dense: e === "IconButton" ? !0 : void 0,
|
|
1815
|
-
role: "button"
|
|
1816
|
-
});
|
|
1817
|
-
}, Ut = (a) => {
|
|
1818
|
-
const {
|
|
1819
|
-
type: t
|
|
1820
|
-
} = {
|
|
1821
|
-
...a
|
|
1822
|
-
}, {
|
|
1823
|
-
displayName: e
|
|
1824
|
-
} = {
|
|
1825
|
-
...t
|
|
1826
|
-
};
|
|
1827
|
-
return typeof a == "string" ? /* @__PURE__ */ c.createElement(ze, {
|
|
1828
|
-
className: "mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--trailing",
|
|
1829
|
-
icon: a
|
|
1830
|
-
}) : Ge(a, {
|
|
1831
|
-
className: V("mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--trailing", e === "IconButton" && "lmnt-text-field__icon-button--trailing"),
|
|
1832
|
-
dense: e === "IconButton" ? !0 : void 0,
|
|
1833
|
-
role: e === "IconButton" ? "button" : null
|
|
1834
|
-
});
|
|
1835
|
-
}, le = /* @__PURE__ */ Ie((a, t) => {
|
|
1836
|
-
const {
|
|
1837
|
-
block: e,
|
|
1838
|
-
className: n,
|
|
1839
|
-
containerClass: i,
|
|
1840
|
-
containerProps: o,
|
|
1841
|
-
containerStyle: l,
|
|
1842
|
-
counter: s,
|
|
1843
|
-
defaultValue: p,
|
|
1844
|
-
dense: D,
|
|
1845
|
-
disabled: R,
|
|
1846
|
-
embedded: U,
|
|
1847
|
-
filled: ue,
|
|
1848
|
-
focused: A,
|
|
1849
|
-
fullWidth: K,
|
|
1850
|
-
helperText: h,
|
|
1851
|
-
helperTextId: J,
|
|
1852
|
-
helperTextPersistent: E,
|
|
1853
|
-
helperTextValidation: S,
|
|
1854
|
-
id: Q,
|
|
1855
|
-
label: u,
|
|
1856
|
-
labelId: de,
|
|
1857
|
-
leadingContent: $e,
|
|
1858
|
-
leadingIcon: q,
|
|
1859
|
-
maxLength: ce,
|
|
1860
|
-
maxlength: Z,
|
|
1861
|
-
noResize: $,
|
|
1862
|
-
onBlur: xe,
|
|
1863
|
-
outlined: et,
|
|
1864
|
-
placeholder: tt,
|
|
1865
|
-
prefixText: Te,
|
|
1866
|
-
primary: nt = null,
|
|
1867
|
-
search: it,
|
|
1868
|
-
secondary: rt,
|
|
1869
|
-
suffixText: ye,
|
|
1870
|
-
textarea: g,
|
|
1871
|
-
tooltip: b,
|
|
1872
|
-
trailingContent: at,
|
|
1873
|
-
trailingIcon: X,
|
|
1874
|
-
type: Ce,
|
|
1875
|
-
valid: H,
|
|
1876
|
-
value: L,
|
|
1877
|
-
variant: fe,
|
|
1878
|
-
...ot
|
|
1879
|
-
} = a, {
|
|
1880
|
-
hoisted: st,
|
|
1881
|
-
position: Ee = "bottom"
|
|
1882
|
-
} = b && typeof b == "object" ? b : {}, [ee] = B(() => Q || ve()), [pe] = B(() => J || ve()), [he] = B(() => de || ve()), [Le, lt] = B(!0), [_e, ut] = B(!1), [N, dt] = B(Z), ct = h || s && N, ft = g ? "textarea" : "input", pt = I(), Oe = I(), F = I(), m = I(), ge = I(), Ae = I(), Re = I(), te = I(), G = I(), ht = (X || q) && !g, w = vt(() => H ?? !0, [H]), M = !g && (U || it || fe === "embedded"), me = !U && (et || rt || fe === "outlined"), ne = !me && !M && (nt || ue || fe === "filled"), W = M || K || e, be = !M && !!u && !D;
|
|
1883
|
-
_(() => (m.current = Ht.attachTo(ge.current), () => {
|
|
1884
|
-
m.current.destroy();
|
|
1885
|
-
}), [_e]), We(t, () => ({
|
|
1886
|
-
mdc: m.current,
|
|
1887
|
-
input: Ae.current,
|
|
1888
|
-
container: Re.current,
|
|
1889
|
-
label: ge.current
|
|
1890
|
-
})), _(() => (h && typeof h == "string" && (F.current = new Ze(Oe.current)), () => {
|
|
1891
|
-
F.current && F.current.destroy();
|
|
1892
|
-
}), [h]), _(() => {
|
|
1893
|
-
if (h) {
|
|
1894
|
-
var d, v, T, j;
|
|
1895
|
-
(d = F.current) === null || d === void 0 || d.foundation.setValidation(S), (v = F.current) === null || v === void 0 || v.foundation.setValidity(w), (T = F.current) === null || T === void 0 || T.foundation.setPersistent(E), (j = F.current) === null || j === void 0 || j.foundation.setContent(h);
|
|
1896
|
-
}
|
|
1897
|
-
}, [h, E, S, w]), _(() => {
|
|
1898
|
-
p || (m.current.value = L || L === 0 ? L : ""), m.current.valid = w;
|
|
1899
|
-
}, [m, L, w, p]), _(() => {
|
|
1900
|
-
m.current.disabled = R;
|
|
1901
|
-
}, [m, R]), _(() => {
|
|
1902
|
-
dt(ce && !Z ? ce : Z);
|
|
1903
|
-
}, [Z, ce]), _(() => {
|
|
1904
|
-
ut(N > 0 && s);
|
|
1905
|
-
}, [N, s]), _(() => {
|
|
1906
|
-
lt(W || s || h);
|
|
1907
|
-
}, [W, s, h]);
|
|
1908
|
-
const _t = () => {
|
|
1909
|
-
H !== void 0 && L !== null && (m.current.valid = H);
|
|
1910
|
-
}, gt = (d) => {
|
|
1911
|
-
xe && xe(d), _t();
|
|
1912
|
-
}, Ne = () => {
|
|
1913
|
-
m.current.value = "", m.current.valid = w;
|
|
1914
|
-
};
|
|
1915
|
-
_(() => (window.addEventListener("reset", Ne), () => {
|
|
1916
|
-
window.removeEventListener("reset", Ne);
|
|
1917
|
-
}), []), _(() => {
|
|
1918
|
-
if (b) {
|
|
1919
|
-
const d = [{
|
|
1920
|
-
name: "flip",
|
|
1921
|
-
options: {
|
|
1922
|
-
enabled: !0,
|
|
1923
|
-
padding: {
|
|
1924
|
-
bottom: 32,
|
|
1925
|
-
top: 32
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
}, {
|
|
1929
|
-
name: "offset",
|
|
1930
|
-
options: {
|
|
1931
|
-
offset: [0, 12]
|
|
1932
|
-
}
|
|
1933
|
-
}];
|
|
1934
|
-
G.current = Lt(pt.current, te.current, {
|
|
1935
|
-
placement: Ee,
|
|
1936
|
-
modifiers: d
|
|
1937
|
-
});
|
|
1938
|
-
}
|
|
1939
|
-
return () => {
|
|
1940
|
-
var d;
|
|
1941
|
-
(d = G.current) === null || d === void 0 || d.destroy();
|
|
1942
|
-
};
|
|
1943
|
-
}, [Ee, st, b]);
|
|
1944
|
-
const Fe = Se(() => {
|
|
1945
|
-
if (L) {
|
|
1946
|
-
const j = m.current.input_;
|
|
1947
|
-
if (j.offsetWidth < j.scrollWidth) {
|
|
1948
|
-
var d, v, T;
|
|
1949
|
-
(d = te.current) === null || d === void 0 || d.setAttribute("data-show", ""), (v = G.current) === null || v === void 0 || v.setOptions((Ve) => ({
|
|
1950
|
-
...Ve,
|
|
1951
|
-
modifiers: [...Ve.modifiers, {
|
|
1952
|
-
name: "eventListeners",
|
|
1953
|
-
enabled: !0
|
|
1954
|
-
}]
|
|
1955
|
-
})), (T = G.current) === null || T === void 0 || T.update();
|
|
1956
|
-
}
|
|
1957
|
-
}
|
|
1958
|
-
}, [L]), Pe = Se(() => {
|
|
1959
|
-
var d, v;
|
|
1960
|
-
(d = te.current) === null || d === void 0 || d.removeAttribute("data-show"), (v = G.current) === null || v === void 0 || v.setOptions((T) => ({
|
|
1961
|
-
...T,
|
|
1962
|
-
modifiers: [...T.modifiers, {
|
|
1963
|
-
name: "eventListeners",
|
|
1964
|
-
enabled: !1
|
|
1965
|
-
}]
|
|
1966
|
-
}));
|
|
1967
|
-
}, []);
|
|
1968
|
-
return /* @__PURE__ */ c.createElement("div", re({
|
|
1969
|
-
ref: Re,
|
|
1970
|
-
style: l,
|
|
1971
|
-
className: V("lmnt", "lmnt-text-field--container", W && "lmnt-text-field--container-full-width", !W && Le && "lmnt-text-field--container-to-content-width", !Le && "lmnt-text-field-inline-container", i)
|
|
1972
|
-
}, o, {
|
|
1973
|
-
onMouseEnter: b && Fe,
|
|
1974
|
-
onFocus: b && Fe,
|
|
1975
|
-
onMouseLeave: b && Pe,
|
|
1976
|
-
onBlur: b && Pe
|
|
1977
|
-
}), $e, /* @__PURE__ */ c.createElement("label", {
|
|
1978
|
-
htmlFor: ee,
|
|
1979
|
-
ref: ge,
|
|
1980
|
-
className: V(["lmnt", "mdc-text-field", "lmnt-text-field", M && "lmnt-text-field--embedded", W && "lmnt-text-field--full-width", ht && "lmnt-text-field--with-icon", !w && "mdc-text-field--invalid", R && "mdc-text-field--disabled", A && "mdc-text-field--focused", !be && "mdc-text-field--no-label", q && !g && "mdc-text-field--with-leading-icon", g && "mdc-text-field--textarea", g && s && N && !$ && "mdc-text-field--with-internal-counter", X && !g && "mdc-text-field--with-trailing-icon", ne && "mdc-text-field--filled", me && "mdc-text-field--outlined", D && "lmnt-text-field--dense", n])
|
|
1981
|
-
}, ne && /* @__PURE__ */ c.createElement("span", {
|
|
1982
|
-
className: "mdc-text-field__ripple"
|
|
1983
|
-
}), q && !g && kt(q), Te && !q && !g && /* @__PURE__ */ c.createElement("span", {
|
|
1984
|
-
className: "mdc-text-field__affix mdc-text-field__affix--prefix"
|
|
1985
|
-
}, Te), /* @__PURE__ */ c.createElement(se, {
|
|
1986
|
-
wrap: !$ && g
|
|
1987
|
-
}, /* @__PURE__ */ c.createElement(ft, re({
|
|
1988
|
-
"aria-controls": pe,
|
|
1989
|
-
"aria-describedby": pe,
|
|
1990
|
-
"aria-labelledby": he,
|
|
1991
|
-
className: V("mdc-text-field__input", Ce === "color" && "lmnt-text-field__input--color"),
|
|
1992
|
-
disabled: R,
|
|
1993
|
-
id: ee,
|
|
1994
|
-
type: Ce,
|
|
1995
|
-
onBlur: gt,
|
|
1996
|
-
defaultValue: p,
|
|
1997
|
-
placeholder: tt || (M && u ? u : "") || (D && u ? u : ""),
|
|
1998
|
-
maxLength: N,
|
|
1999
|
-
ref: Ae,
|
|
2000
|
-
value: L
|
|
2001
|
-
}, ot)), !$ && Xe(_e, N)), X && !g && Ut(X), ye && !X && !g && /* @__PURE__ */ c.createElement("span", {
|
|
2002
|
-
className: "mdc-text-field__affix mdc-text-field__affix--suffix"
|
|
2003
|
-
}, ye), me && /* @__PURE__ */ c.createElement(Tt, null, be && /* @__PURE__ */ c.createElement(He, {
|
|
2004
|
-
id: he,
|
|
2005
|
-
htmlFor: ee
|
|
2006
|
-
}, u)), ne && be && /* @__PURE__ */ c.createElement(He, {
|
|
2007
|
-
id: he,
|
|
2008
|
-
htmlFor: ee
|
|
2009
|
-
}, u), (ne || M) && /* @__PURE__ */ c.createElement(oe, null)), at, ct && /* @__PURE__ */ c.createElement("div", {
|
|
2010
|
-
className: "mdc-text-field-helper-line"
|
|
2011
|
-
}, h && /* @__PURE__ */ c.createElement("div", {
|
|
2012
|
-
ref: Oe,
|
|
2013
|
-
id: pe,
|
|
2014
|
-
"aria-hidden": E ? "false" : "true",
|
|
2015
|
-
className: V(["mdc-text-field-helper-text", E && "mdc-text-field-helper-text--persistent", S && "mdc-text-field-helper-text--validation-msg"])
|
|
2016
|
-
}, h), $ && Xe(_e, N)), b && /* @__PURE__ */ c.createElement(yt, re({
|
|
2017
|
-
role: "tooltip"
|
|
2018
|
-
}, b, {
|
|
2019
|
-
ref: te,
|
|
2020
|
-
text: L
|
|
2021
|
-
})));
|
|
2022
|
-
});
|
|
2023
|
-
le.displayName = "Textfield";
|
|
2024
|
-
le.propTypes = jt;
|
|
2025
|
-
le.defaultProps = Bt;
|
|
2026
|
-
const Zt = ({
|
|
2027
|
-
className: a = "",
|
|
2028
|
-
dense: t = !1,
|
|
2029
|
-
searchTerm: e,
|
|
2030
|
-
setSearchTerm: n,
|
|
2031
|
-
placeholder: i
|
|
2032
|
-
}) => /* @__PURE__ */ De(
|
|
2033
|
-
le,
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Textfield as e, IconButton as s } from "@element/react-components";
|
|
3
|
+
import { s as c } from "../../searchBar.module-9gKyrZRT.js";
|
|
4
|
+
const m = ({
|
|
5
|
+
className: i = "",
|
|
6
|
+
dense: l = !1,
|
|
7
|
+
searchTerm: o,
|
|
8
|
+
setSearchTerm: t,
|
|
9
|
+
placeholder: n
|
|
10
|
+
}) => /* @__PURE__ */ a(
|
|
11
|
+
e,
|
|
2034
12
|
{
|
|
2035
|
-
className: `${
|
|
2036
|
-
dense:
|
|
13
|
+
className: `${i ?? ""} ${c.searchbar}`,
|
|
14
|
+
dense: l,
|
|
2037
15
|
variant: "outlined",
|
|
2038
|
-
placeholder:
|
|
2039
|
-
value:
|
|
2040
|
-
onChange: (
|
|
16
|
+
placeholder: n,
|
|
17
|
+
value: o,
|
|
18
|
+
onChange: (r) => t(r.target.value),
|
|
2041
19
|
fullWidth: !0,
|
|
2042
|
-
trailingIcon: /* @__PURE__ */
|
|
2043
|
-
|
|
20
|
+
trailingIcon: /* @__PURE__ */ a(
|
|
21
|
+
s,
|
|
2044
22
|
{
|
|
2045
|
-
icon:
|
|
2046
|
-
onClick: () =>
|
|
23
|
+
icon: o ? "close" : "search",
|
|
24
|
+
onClick: () => o ? t("") : void 0
|
|
2047
25
|
}
|
|
2048
26
|
)
|
|
2049
27
|
}
|
|
2050
28
|
);
|
|
2051
29
|
export {
|
|
2052
|
-
|
|
30
|
+
m as SearchBar
|
|
2053
31
|
};
|