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