@hortiview/shared-components 0.0.4539 → 0.0.4624

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.
Files changed (82) hide show
  1. package/README.md +101 -29
  2. package/dist/BlockView.module-8kbPxxc4.js +15 -0
  3. package/dist/HashTabView.module-BY0tbl3B.js +13 -0
  4. package/dist/HeaderFilter.module-DiBmulr5.js +7 -0
  5. package/dist/_getTag-DNUtgXkb.js +136 -0
  6. package/dist/_stringToPath-BfzwTbL6.js +54 -0
  7. package/dist/assets/{main.css → DeleteModal.css} +2 -2
  8. package/dist/assets/HeaderFilter.css +1 -0
  9. package/dist/assets/Scrollbar.css +1 -0
  10. package/dist/assets/disclaimer.css +1 -0
  11. package/dist/baseView.module-DXWalo9p.js +7 -0
  12. package/dist/basicHeading.module-ClcvD7x2.js +16 -0
  13. package/dist/{component-D1YrRAXe.js → component-Rx4bNsGO.js} +61 -54
  14. package/dist/components/BaseView/BaseView.d.ts +5 -1
  15. package/dist/components/BaseView/BaseView.js +75 -75
  16. package/dist/components/BaseView/BaseView.test.js +15 -14
  17. package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
  18. package/dist/components/BasicHeading/BasicHeading.js +38 -49
  19. package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
  20. package/dist/components/BlockView/BlockView.js +41 -51
  21. package/dist/components/BlockView/BlockView.test.js +15 -14
  22. package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
  23. package/dist/components/DeleteModal/DeleteModal.js +4719 -0
  24. package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
  25. package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
  26. package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
  27. package/dist/components/Disclaimer/Disclaimer.js +21 -0
  28. package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
  29. package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
  30. package/dist/components/EmptyView/EmptyView.js +4 -4
  31. package/dist/components/EmptyView/EmptyView.test.js +14 -13
  32. package/dist/components/HashTabView/HashTabView.js +60 -68
  33. package/dist/components/HashTabView/HashTabView.test.js +9 -8
  34. package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
  35. package/dist/components/HeaderFilter/HeaderFilter.js +7605 -0
  36. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
  37. package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
  38. package/dist/components/Iconify/Iconify.js +1 -1
  39. package/dist/components/Iconify/Iconify.test.js +8 -7
  40. package/dist/components/ListArea/ListArea.js +247 -5344
  41. package/dist/components/ListArea/ListArea.test.js +4 -3
  42. package/dist/components/ListArea/ListAreaService.js +56 -9
  43. package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
  44. package/dist/components/Scrollbar/Scrollbar.js +9 -0
  45. package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
  46. package/dist/components/Scrollbar/scrollbar.test.js +15 -0
  47. package/dist/components/SearchBar/SearchBar.js +2051 -3
  48. package/dist/components/SearchBar/SearchBar.test.js +16 -15
  49. package/dist/components/VerticalDivider/VerticalDivider.js +4 -6
  50. package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
  51. package/dist/disclaimer.module-BZydt-Q_.js +8 -0
  52. package/dist/index.es-Ba9oZK_n.js +769 -0
  53. package/dist/{index.es-CUWXKh7P.js → index.es-C1ojb4Lq.js} +8 -8
  54. package/dist/{index.es-DYsXox--.js → index.es-CNBieliG.js} +1 -1
  55. package/dist/index.es-CQ3ep412.js +305 -0
  56. package/dist/{index.es-mBp_Btvi.js → index.es-CVCp4d0C.js} +2 -2
  57. package/dist/{index.es-WZ1mqvGz.js → index.es-Cct4Uapb.js} +106 -99
  58. package/dist/index.es-Cj9DW-2T.js +430 -0
  59. package/dist/{index.es-BD4kFWFx.js → index.es-Cm4X20_S.js} +4 -4
  60. package/dist/{index.es-Cv6meSAn.js → index.es-InSNsV4f.js} +1 -1
  61. package/dist/index.es-L0ZCcbUf.js +4939 -0
  62. package/dist/listArea.module-B04TR5bj.js +14 -0
  63. package/dist/main.d.ts +6 -0
  64. package/dist/main.js +33 -23
  65. package/dist/react.esm-BeDwcQWb.js +12741 -0
  66. package/dist/searchBar.module-9gKyrZRT.js +7 -0
  67. package/dist/services/UtilService.d.ts +6 -0
  68. package/dist/services/UtilService.js +4 -0
  69. package/dist/services/services.test.d.ts +1 -0
  70. package/dist/services/services.test.js +22 -0
  71. package/dist/{tslib.es6-BOWp4lfV.js → tslib.es6-CIXEwqhg.js} +4 -4
  72. package/dist/verticalDivider.module-C3_GL-fH.js +7 -0
  73. package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
  74. package/package.json +1 -1
  75. package/dist/ListAreaService-CFOmATRF.js +0 -68
  76. package/dist/SearchBar-CY2zfu6B.js +0 -3232
  77. package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
  78. /package/dist/assets/{BaseView.css → baseView.css} +0 -0
  79. /package/dist/assets/{BasicHeading.css → basicHeading.css} +0 -0
  80. /package/dist/assets/{ListAreaService.css → listArea.css} +0 -0
  81. /package/dist/assets/{SearchBar.css → searchBar.css} +0 -0
  82. /package/dist/assets/{VerticalDivider.css → verticalDivider.css} +0 -0
@@ -1,3232 +0,0 @@
1
- import "./assets/SearchBar.css";
2
- import { jsx as tt } from "react/jsx-runtime";
3
- import { P as r, b as St, c as L, _ as k, a as fe, g as Ht, h as me, u as Vt, i as Bt, d as z, r as wt } from "./index.es-WZ1mqvGz.js";
4
- import s, { forwardRef as Q, useRef as b, useImperativeHandle as J, useEffect as v, useState as Y, useMemo as je, useCallback as oe, Fragment as nt } from "react";
5
- import { c as A, _ } from "./tslib.es6-BOWp4lfV.js";
6
- import { a as Z, M as Le, c as ee, e as kt, b as Ee, m as Mt, d as jt } from "./component-D1YrRAXe.js";
7
- import { I as Ue, c as ct } from "./index.es-Cv6meSAn.js";
8
- import Ut from "react-dom";
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 Ce = {
32
- ICON_BUTTON_ON: "mdc-icon-button--on",
33
- ROOT: "mdc-icon-button"
34
- }, K = {
35
- ARIA_LABEL: "aria-label",
36
- ARIA_PRESSED: "aria-pressed",
37
- DATA_ARIA_LABEL_OFF: "data-aria-label-off",
38
- DATA_ARIA_LABEL_ON: "data-aria-label-on",
39
- CHANGE_EVENT: "MDCIconButtonToggle:change"
40
- };
41
- /**
42
- * @license
43
- * Copyright 2018 Google Inc.
44
- *
45
- * Permission is hereby granted, free of charge, to any person obtaining a copy
46
- * of this software and associated documentation files (the "Software"), to deal
47
- * in the Software without restriction, including without limitation the rights
48
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49
- * copies of the Software, and to permit persons to whom the Software is
50
- * furnished to do so, subject to the following conditions:
51
- *
52
- * The above copyright notice and this permission notice shall be included in
53
- * all copies or substantial portions of the Software.
54
- *
55
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
61
- * THE SOFTWARE.
62
- */
63
- var ft = (
64
- /** @class */
65
- function(o) {
66
- A(t, o);
67
- function t(e) {
68
- var n = o.call(this, _(_({}, t.defaultAdapter), e)) || this;
69
- return n.hasToggledAriaLabel = !1, n;
70
- }
71
- return Object.defineProperty(t, "cssClasses", {
72
- get: function() {
73
- return Ce;
74
- },
75
- enumerable: !1,
76
- configurable: !0
77
- }), Object.defineProperty(t, "strings", {
78
- get: function() {
79
- return K;
80
- },
81
- enumerable: !1,
82
- configurable: !0
83
- }), Object.defineProperty(t, "defaultAdapter", {
84
- get: function() {
85
- return {
86
- addClass: function() {
87
- },
88
- hasClass: function() {
89
- return !1;
90
- },
91
- notifyChange: function() {
92
- },
93
- removeClass: function() {
94
- },
95
- getAttr: function() {
96
- return null;
97
- },
98
- setAttr: function() {
99
- }
100
- };
101
- },
102
- enumerable: !1,
103
- configurable: !0
104
- }), t.prototype.init = function() {
105
- var e = this.adapter.getAttr(K.DATA_ARIA_LABEL_ON), n = this.adapter.getAttr(K.DATA_ARIA_LABEL_OFF);
106
- if (e && n) {
107
- if (this.adapter.getAttr(K.ARIA_PRESSED) !== null)
108
- throw new Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");
109
- this.hasToggledAriaLabel = !0;
110
- } else
111
- this.adapter.setAttr(K.ARIA_PRESSED, String(this.isOn()));
112
- }, t.prototype.handleClick = function() {
113
- this.toggle(), this.adapter.notifyChange({ isOn: this.isOn() });
114
- }, t.prototype.isOn = function() {
115
- return this.adapter.hasClass(Ce.ICON_BUTTON_ON);
116
- }, t.prototype.toggle = function(e) {
117
- if (e === void 0 && (e = !this.isOn()), e ? this.adapter.addClass(Ce.ICON_BUTTON_ON) : this.adapter.removeClass(Ce.ICON_BUTTON_ON), this.hasToggledAriaLabel) {
118
- var n = e ? this.adapter.getAttr(K.DATA_ARIA_LABEL_ON) : this.adapter.getAttr(K.DATA_ARIA_LABEL_OFF);
119
- this.adapter.setAttr(K.ARIA_LABEL, n || "");
120
- } else
121
- this.adapter.setAttr(K.ARIA_PRESSED, "" + e);
122
- }, t;
123
- }(Z)
124
- );
125
- /**
126
- * @license
127
- * Copyright 2018 Google Inc.
128
- *
129
- * Permission is hereby granted, free of charge, to any person obtaining a copy
130
- * of this software and associated documentation files (the "Software"), to deal
131
- * in the Software without restriction, including without limitation the rights
132
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
133
- * copies of the Software, and to permit persons to whom the Software is
134
- * furnished to do so, subject to the following conditions:
135
- *
136
- * The above copyright notice and this permission notice shall be included in
137
- * all copies or substantial portions of the Software.
138
- *
139
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
140
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
141
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
142
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
143
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
144
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
145
- * THE SOFTWARE.
146
- */
147
- var qt = ft.strings, Wt = (
148
- /** @class */
149
- function(o) {
150
- A(t, o);
151
- function t() {
152
- var e = o !== null && o.apply(this, arguments) || this;
153
- return e.rippleComponent = e.createRipple(), e;
154
- }
155
- return t.attachTo = function(e) {
156
- return new t(e);
157
- }, t.prototype.initialSyncWithDOM = function() {
158
- var e = this;
159
- this.handleClick = function() {
160
- e.foundation.handleClick();
161
- }, this.listen("click", this.handleClick);
162
- }, t.prototype.destroy = function() {
163
- this.unlisten("click", this.handleClick), this.ripple.destroy(), o.prototype.destroy.call(this);
164
- }, t.prototype.getDefaultFoundation = function() {
165
- var e = this, n = {
166
- addClass: function(i) {
167
- return e.root.classList.add(i);
168
- },
169
- hasClass: function(i) {
170
- return e.root.classList.contains(i);
171
- },
172
- notifyChange: function(i) {
173
- e.emit(qt.CHANGE_EVENT, i);
174
- },
175
- removeClass: function(i) {
176
- return e.root.classList.remove(i);
177
- },
178
- getAttr: function(i) {
179
- return e.root.getAttribute(i);
180
- },
181
- setAttr: function(i, a) {
182
- return e.root.setAttribute(i, a);
183
- }
184
- };
185
- return new ft(n);
186
- }, Object.defineProperty(t.prototype, "ripple", {
187
- get: function() {
188
- return this.rippleComponent;
189
- },
190
- enumerable: !1,
191
- configurable: !0
192
- }), Object.defineProperty(t.prototype, "on", {
193
- get: function() {
194
- return this.foundation.isOn();
195
- },
196
- set: function(e) {
197
- this.foundation.toggle(e);
198
- },
199
- enumerable: !1,
200
- configurable: !0
201
- }), t.prototype.createRipple = function() {
202
- var e = new Le(this.root);
203
- return e.unbounded = !0, e;
204
- }, t;
205
- }(ee)
206
- );
207
- const Gt = {
208
- /**
209
- * Programmatically sets the toggle state of the button when used as a toggle button. If not set, the toggle state will be managed internally.
210
- *
211
- * Defaults to **false**.
212
- */
213
- active: r.bool,
214
- /**
215
- * Accessibility label for assistive technologies.
216
- *
217
- * Defaults to **null**.
218
- */
219
- ariaLabel: r.string,
220
- /**
221
- * Id of an element serving as a label for this IconButton instance. Used by assistive technologies.
222
- *
223
- * Defaults to **null**.
224
- */
225
- ariaLabelledBy: r.string,
226
- /**
227
- * The custom icon button notification badge to be rendered.
228
- *
229
- * Defaults to **undefined**.
230
- */
231
- badge: r.node,
232
- /**
233
- * The placement of the notification badge on the icon to start. It will flip to the opposite side if there is no room.
234
- *
235
- * Defaults to **'right-start'**.
236
- */
237
- badgePlacement: r.oneOf(["right-start", "left-start"]),
238
- /**
239
- * The content when when using the IconButton normally. Expects an `Icon` component. For toggle button functionality, use `toggleOn` and `toggleOff` instead.
240
- *
241
- * Defaults to **null**.
242
- */
243
- children: r.node,
244
- /**
245
- * The css class name to be passed through to the component markup.
246
- *
247
- * Defaults to **undefined**.
248
- */
249
- className: r.string,
250
- /**
251
- * Enables a smaller IconButton.
252
- *
253
- * Defaults to **false**.
254
- */
255
- dense: r.bool,
256
- /**
257
- * Disables the icon button.
258
- *
259
- * Defaults to **false**.
260
- */
261
- disabled: r.bool,
262
- /**
263
- * For simple use-cases, this will automatically create the icon object. Does not work with `toggle='true'`
264
- *
265
- * Defaults to **null**.
266
- */
267
- icon: r.oneOfType([r.string, r.node]),
268
- /**
269
- * One of 'xsmall', 'small', 'medium', 'large', and 'xlarge' will change the size of the icon. Defaults to medium.
270
- *
271
- * Defaults to **'medium'**.
272
- */
273
- iconSize: r.oneOf(["xsmall", "small", "medium", "large", "xlarge"]),
274
- /**
275
- * The icon type to be rendered. Not all icons have every type. To see which icons are available for different types see [Material Icons docs](https://material.io/tools/icons)
276
- *
277
- * Defaults to **'filled'**.
278
- */
279
- iconType: r.oneOf(["filled", "outlined", "rounded", "two-tone", "sharp"]),
280
- /**
281
- * Fired when the user clicks the IconButton, will return toggle state, if applicable.
282
- *
283
- * Defaults to **null**.
284
- */
285
- onClick: r.func,
286
- /**
287
- * TabIndex of the button.
288
- *
289
- * Defaults to **0**.
290
- */
291
- tabIndex: r.number,
292
- /**
293
- * The content to be rendered when the `IconButton` is toggled off. Expects an `Icon` component. The typical use case for a toggle button would be to set an Icon for `toggleOn` and `toggleOff`, leaving children blank.
294
- *
295
- * Defaults to **null**.
296
- */
297
- toggleOff: r.node,
298
- /**
299
- * The `aria-label` value to be read by a screen-reader when the button is toggled off. Example 'Add to Favorites'. Alternatively, `toggleOffAriaLabelledBy` may be used instead.
300
- *
301
- * Defaults to **null**.
302
- */
303
- toggleOffAriaLabel: r.string,
304
- /**
305
- * The `aria-labelledby`value when the button is toggled on. This should be the `id `of a parent element to be read by a screen reader instead of `aria-label`.
306
- *
307
- * Defaults to **null**.
308
- */
309
- toggleOffAriaLabelledBy: r.string,
310
- /**
311
- * The content to be rendered when the `IconButton` is toggled on. Expects an `Icon` component. The typical use case for a toggle button would be to set an Icon for `toggleOn` and `toggleOff`, leaving children blank.
312
- *
313
- * Defaults to **null**.
314
- */
315
- toggleOn: r.node,
316
- /**
317
- * The `aria-label` value to be read by a screen-reader when the button is toggled on. Example 'Remove from Favorites'. Alternatively, `toggleOnAriaLabelledBy` may be used instead.
318
- *
319
- * Defaults to **null**.
320
- */
321
- toggleOnAriaLabel: r.string,
322
- /**
323
- * The `aria-labelledby`value when the button is toggled on. This should be the `id` of a parent element to be read by a screen reader instead of `aria-label`.
324
- *
325
- * Defaults to **null**.
326
- */
327
- toggleOnAriaLabelledBy: r.string,
328
- /**
329
- * Variants prefixed with `filled-` will add a background color to the icon according to the theme. Variants prefixed with ` color-` will change the color of the icon according to the theme.
330
- *
331
- * Defaults to **empty string**.
332
- */
333
- variant: St(r.oneOf(["", "filled-danger-alt", "filled-danger", "filled-primary", "filled-secondary", "color-primary", "color-secondary", "color-on-dark", "color-on-unknown-black"]), ["primary-alt", "secondary-alt", "primary", "danger-alt", "danger"], "IconButton", "Please use one of '','filled-danger-alt','filled-danger','filled-primary','filled-secondary','color-primary','color-secondary','color-on-dark','color-on-unknown-black'.")
334
- }, $t = {
335
- active: !1,
336
- ariaLabel: null,
337
- ariaLabelledBy: null,
338
- badge: void 0,
339
- badgePlacement: "right-start",
340
- children: null,
341
- className: void 0,
342
- dense: !1,
343
- disabled: !1,
344
- icon: null,
345
- iconSize: "medium",
346
- iconType: "filled",
347
- tabIndex: 0,
348
- toggleOff: null,
349
- toggleOffAriaLabel: null,
350
- toggleOffAriaLabelledBy: null,
351
- toggleOn: null,
352
- toggleOnAriaLabel: null,
353
- toggleOnAriaLabelledBy: null,
354
- variant: ""
355
- }, Ae = /* @__PURE__ */ Q((o, t) => {
356
- const {
357
- active: e,
358
- ariaLabel: n,
359
- ariaLabelledBy: i,
360
- badge: a,
361
- badgePlacement: u,
362
- children: l,
363
- className: d,
364
- dense: C,
365
- disabled: E,
366
- icon: O,
367
- iconSize: te,
368
- iconType: P,
369
- onClick: H,
370
- tabIndex: g,
371
- toggleOff: x,
372
- toggleOffAriaLabel: y,
373
- toggleOffAriaLabelledBy: F,
374
- toggleOn: W,
375
- toggleOnAriaLabel: p,
376
- toggleOnAriaLabelledBy: M,
377
- variant: h,
378
- ...G
379
- } = o, j = b(), f = b(), m = b(), I = W && x;
380
- J(t, () => j.current, []);
381
- const ae = L("lmnt", "lmnt-icon-button", "mdc-icon-button", C && "lmnt-icon-button--dense", (h === "primary" || h === "primary-alt" || h === "secondary" || h === "danger" || h === "danger-alt" || h === "filled-primary" || h === "filled-primary-alt" || h === "filled-secondary" || h === "filled-danger" || h === "filled-danger-alt") && "lmnt-icon-button--fill", (h === "danger-alt" || h === "filled-danger-alt") && "lmnt-icon-button--fill-danger-alt", (h === "danger" || h === "filled-danger") && "lmnt-icon-button--fill-danger", (h === "primary" || h === "filled-primary") && "lmnt-icon-button--fill-primary", (h === "primary-alt" || h === "filled-secondary") && "lmnt-icon-button--fill-secondary", (h === "secondary-alt" || h === "color-on-dark") && "lmnt-icon-button--color-on-dark", h === "color-primary" && "lmnt-icon-button--color-primary", h === "color-secondary" && "lmnt-icon-button--color-secondary", h === "color-on-unknown-black" && "lmnt-icon-button--on-unknown-black", d);
382
- v(() => (I ? m.current = Wt.attachTo(j.current) : (f.current = Le.attachTo(j.current), f.current.unbounded = !0), () => {
383
- I ? m.current.destroy() : f.current.destroy();
384
- }), [m, I, f]), v(() => {
385
- I && (m.current.on = e);
386
- }, [e, I, m]);
387
- const Fe = (c) => {
388
- H && H(I ? m.current.on : c);
389
- };
390
- return /* @__PURE__ */ s.createElement("button", k({
391
- "aria-label": n,
392
- "aria-labelledby": i,
393
- "data-aria-label-on": p || M || n,
394
- "data-aria-label-off": y || F || n,
395
- onClick: Fe,
396
- ref: j,
397
- className: ae,
398
- disabled: E,
399
- tabIndex: g
400
- }, G), O && /* @__PURE__ */ s.createElement(Ue, {
401
- badge: a,
402
- badgePlacement: u,
403
- icon: O,
404
- iconSize: te,
405
- iconType: P
406
- }), l && fe(l, (c) => {
407
- var N, R;
408
- return {
409
- className: L("mdc-icon-button__icon", c == null || (N = c.props) === null || N === void 0 ? void 0 : N.className),
410
- "aria-hidden": (c == null || (R = c.props) === null || R === void 0 ? void 0 : R["aria-hidden"]) || n || i
411
- };
412
- }), I && fe(W, (c) => {
413
- var N, R, $;
414
- return {
415
- className: L("mdc-icon-button__icon mdc-icon-button__icon--on", c == null || (N = c.props) === null || N === void 0 ? void 0 : N.className),
416
- "aria-label": (c == null || (R = c.props) === null || R === void 0 ? void 0 : R["aria-label"]) || p || M || n,
417
- "aria-hidden": (c == null || ($ = c.props) === null || $ === void 0 ? void 0 : $["aria-hidden"]) || p || M || n
418
- };
419
- }), I && fe(x, (c) => {
420
- var N, R, $;
421
- return {
422
- className: L("mdc-icon-button__icon", c == null || (N = c.props) === null || N === void 0 ? void 0 : N.className),
423
- "aria-label": (c == null || (R = c.props) === null || R === void 0 ? void 0 : R["aria-label"]) || y || F || n,
424
- "aria-hidden": (c == null || ($ = c.props) === null || $ === void 0 ? void 0 : $["aria-hidden"]) || y || F || n
425
- };
426
- }));
427
- });
428
- Ae.displayName = "IconButton";
429
- Ae.propTypes = Gt;
430
- Ae.defaultProps = $t;
431
- /**
432
- * @license
433
- * Copyright 2016 Google Inc.
434
- *
435
- * Permission is hereby granted, free of charge, to any person obtaining a copy
436
- * of this software and associated documentation files (the "Software"), to deal
437
- * in the Software without restriction, including without limitation the rights
438
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
439
- * copies of the Software, and to permit persons to whom the Software is
440
- * furnished to do so, subject to the following conditions:
441
- *
442
- * The above copyright notice and this permission notice shall be included in
443
- * all copies or substantial portions of the Software.
444
- *
445
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
446
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
447
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
448
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
449
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
450
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
451
- * THE SOFTWARE.
452
- */
453
- var Xt = {
454
- LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
455
- LABEL_REQUIRED: "mdc-floating-label--required",
456
- LABEL_SHAKE: "mdc-floating-label--shake",
457
- ROOT: "mdc-floating-label"
458
- };
459
- /**
460
- * @license
461
- * Copyright 2016 Google Inc.
462
- *
463
- * Permission is hereby granted, free of charge, to any person obtaining a copy
464
- * of this software and associated documentation files (the "Software"), to deal
465
- * in the Software without restriction, including without limitation the rights
466
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
467
- * copies of the Software, and to permit persons to whom the Software is
468
- * furnished to do so, subject to the following conditions:
469
- *
470
- * The above copyright notice and this permission notice shall be included in
471
- * all copies or substantial portions of the Software.
472
- *
473
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
474
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
475
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
476
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
477
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
478
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
479
- * THE SOFTWARE.
480
- */
481
- var pt = (
482
- /** @class */
483
- function(o) {
484
- A(t, o);
485
- function t(e) {
486
- var n = o.call(this, _(_({}, t.defaultAdapter), e)) || this;
487
- return n.shakeAnimationEndHandler_ = function() {
488
- return n.handleShakeAnimationEnd_();
489
- }, n;
490
- }
491
- return Object.defineProperty(t, "cssClasses", {
492
- get: function() {
493
- return Xt;
494
- },
495
- enumerable: !1,
496
- configurable: !0
497
- }), Object.defineProperty(t, "defaultAdapter", {
498
- /**
499
- * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.
500
- */
501
- get: function() {
502
- return {
503
- addClass: function() {
504
- },
505
- removeClass: function() {
506
- },
507
- getWidth: function() {
508
- return 0;
509
- },
510
- registerInteractionHandler: function() {
511
- },
512
- deregisterInteractionHandler: function() {
513
- }
514
- };
515
- },
516
- enumerable: !1,
517
- configurable: !0
518
- }), t.prototype.init = function() {
519
- this.adapter.registerInteractionHandler("animationend", this.shakeAnimationEndHandler_);
520
- }, t.prototype.destroy = function() {
521
- this.adapter.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
522
- }, t.prototype.getWidth = function() {
523
- return this.adapter.getWidth();
524
- }, t.prototype.shake = function(e) {
525
- var n = t.cssClasses.LABEL_SHAKE;
526
- e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
527
- }, t.prototype.float = function(e) {
528
- var n = t.cssClasses, i = n.LABEL_FLOAT_ABOVE, a = n.LABEL_SHAKE;
529
- e ? this.adapter.addClass(i) : (this.adapter.removeClass(i), this.adapter.removeClass(a));
530
- }, t.prototype.setRequired = function(e) {
531
- var n = t.cssClasses.LABEL_REQUIRED;
532
- e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
533
- }, t.prototype.handleShakeAnimationEnd_ = function() {
534
- var e = t.cssClasses.LABEL_SHAKE;
535
- this.adapter.removeClass(e);
536
- }, t;
537
- }(Z)
538
- );
539
- /**
540
- * @license
541
- * Copyright 2016 Google Inc.
542
- *
543
- * Permission is hereby granted, free of charge, to any person obtaining a copy
544
- * of this software and associated documentation files (the "Software"), to deal
545
- * in the Software without restriction, including without limitation the rights
546
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
547
- * copies of the Software, and to permit persons to whom the Software is
548
- * furnished to do so, subject to the following conditions:
549
- *
550
- * The above copyright notice and this permission notice shall be included in
551
- * all copies or substantial portions of the Software.
552
- *
553
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
554
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
555
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
556
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
557
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
558
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
559
- * THE SOFTWARE.
560
- */
561
- var ht = (
562
- /** @class */
563
- function(o) {
564
- A(t, o);
565
- function t() {
566
- return o !== null && o.apply(this, arguments) || this;
567
- }
568
- return t.attachTo = function(e) {
569
- return new t(e);
570
- }, t.prototype.shake = function(e) {
571
- this.foundation.shake(e);
572
- }, t.prototype.float = function(e) {
573
- this.foundation.float(e);
574
- }, t.prototype.setRequired = function(e) {
575
- this.foundation.setRequired(e);
576
- }, t.prototype.getWidth = function() {
577
- return this.foundation.getWidth();
578
- }, t.prototype.getDefaultFoundation = function() {
579
- var e = this, n = {
580
- addClass: function(i) {
581
- return e.root.classList.add(i);
582
- },
583
- removeClass: function(i) {
584
- return e.root.classList.remove(i);
585
- },
586
- getWidth: function() {
587
- return kt(e.root);
588
- },
589
- registerInteractionHandler: function(i, a) {
590
- return e.listen(i, a);
591
- },
592
- deregisterInteractionHandler: function(i, a) {
593
- return e.unlisten(i, a);
594
- }
595
- };
596
- return new pt(n);
597
- }, t;
598
- }(ee)
599
- );
600
- /**
601
- * @license
602
- * Copyright 2018 Google Inc.
603
- *
604
- * Permission is hereby granted, free of charge, to any person obtaining a copy
605
- * of this software and associated documentation files (the "Software"), to deal
606
- * in the Software without restriction, including without limitation the rights
607
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
608
- * copies of the Software, and to permit persons to whom the Software is
609
- * furnished to do so, subject to the following conditions:
610
- *
611
- * The above copyright notice and this permission notice shall be included in
612
- * all copies or substantial portions of the Software.
613
- *
614
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
615
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
616
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
617
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
618
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
619
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
620
- * THE SOFTWARE.
621
- */
622
- var re = {
623
- LINE_RIPPLE_ACTIVE: "mdc-line-ripple--active",
624
- LINE_RIPPLE_DEACTIVATING: "mdc-line-ripple--deactivating"
625
- };
626
- /**
627
- * @license
628
- * Copyright 2018 Google Inc.
629
- *
630
- * Permission is hereby granted, free of charge, to any person obtaining a copy
631
- * of this software and associated documentation files (the "Software"), to deal
632
- * in the Software without restriction, including without limitation the rights
633
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
634
- * copies of the Software, and to permit persons to whom the Software is
635
- * furnished to do so, subject to the following conditions:
636
- *
637
- * The above copyright notice and this permission notice shall be included in
638
- * all copies or substantial portions of the Software.
639
- *
640
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
641
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
642
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
643
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
644
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
645
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
646
- * THE SOFTWARE.
647
- */
648
- var zt = (
649
- /** @class */
650
- function(o) {
651
- A(t, o);
652
- function t(e) {
653
- var n = o.call(this, _(_({}, t.defaultAdapter), e)) || this;
654
- return n.transitionEndHandler_ = function(i) {
655
- return n.handleTransitionEnd(i);
656
- }, n;
657
- }
658
- return Object.defineProperty(t, "cssClasses", {
659
- get: function() {
660
- return re;
661
- },
662
- enumerable: !1,
663
- configurable: !0
664
- }), Object.defineProperty(t, "defaultAdapter", {
665
- /**
666
- * See {@link MDCLineRippleAdapter} for typing information on parameters and return types.
667
- */
668
- get: function() {
669
- return {
670
- addClass: function() {
671
- },
672
- removeClass: function() {
673
- },
674
- hasClass: function() {
675
- return !1;
676
- },
677
- setStyle: function() {
678
- },
679
- registerEventHandler: function() {
680
- },
681
- deregisterEventHandler: function() {
682
- }
683
- };
684
- },
685
- enumerable: !1,
686
- configurable: !0
687
- }), t.prototype.init = function() {
688
- this.adapter.registerEventHandler("transitionend", this.transitionEndHandler_);
689
- }, t.prototype.destroy = function() {
690
- this.adapter.deregisterEventHandler("transitionend", this.transitionEndHandler_);
691
- }, t.prototype.activate = function() {
692
- this.adapter.removeClass(re.LINE_RIPPLE_DEACTIVATING), this.adapter.addClass(re.LINE_RIPPLE_ACTIVE);
693
- }, t.prototype.setRippleCenter = function(e) {
694
- this.adapter.setStyle("transform-origin", e + "px center");
695
- }, t.prototype.deactivate = function() {
696
- this.adapter.addClass(re.LINE_RIPPLE_DEACTIVATING);
697
- }, t.prototype.handleTransitionEnd = function(e) {
698
- var n = this.adapter.hasClass(re.LINE_RIPPLE_DEACTIVATING);
699
- e.propertyName === "opacity" && n && (this.adapter.removeClass(re.LINE_RIPPLE_ACTIVE), this.adapter.removeClass(re.LINE_RIPPLE_DEACTIVATING));
700
- }, t;
701
- }(Z)
702
- );
703
- /**
704
- * @license
705
- * Copyright 2018 Google Inc.
706
- *
707
- * Permission is hereby granted, free of charge, to any person obtaining a copy
708
- * of this software and associated documentation files (the "Software"), to deal
709
- * in the Software without restriction, including without limitation the rights
710
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
711
- * copies of the Software, and to permit persons to whom the Software is
712
- * furnished to do so, subject to the following conditions:
713
- *
714
- * The above copyright notice and this permission notice shall be included in
715
- * all copies or substantial portions of the Software.
716
- *
717
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
718
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
719
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
720
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
721
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
722
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
723
- * THE SOFTWARE.
724
- */
725
- var gt = (
726
- /** @class */
727
- function(o) {
728
- A(t, o);
729
- function t() {
730
- return o !== null && o.apply(this, arguments) || this;
731
- }
732
- return t.attachTo = function(e) {
733
- return new t(e);
734
- }, t.prototype.activate = function() {
735
- this.foundation.activate();
736
- }, t.prototype.deactivate = function() {
737
- this.foundation.deactivate();
738
- }, t.prototype.setRippleCenter = function(e) {
739
- this.foundation.setRippleCenter(e);
740
- }, t.prototype.getDefaultFoundation = function() {
741
- var e = this, n = {
742
- addClass: function(i) {
743
- return e.root.classList.add(i);
744
- },
745
- removeClass: function(i) {
746
- return e.root.classList.remove(i);
747
- },
748
- hasClass: function(i) {
749
- return e.root.classList.contains(i);
750
- },
751
- setStyle: function(i, a) {
752
- return e.root.style.setProperty(i, a);
753
- },
754
- registerEventHandler: function(i, a) {
755
- return e.listen(i, a);
756
- },
757
- deregisterEventHandler: function(i, a) {
758
- return e.unlisten(i, a);
759
- }
760
- };
761
- return new zt(n);
762
- }, t;
763
- }(ee)
764
- );
765
- /**
766
- * @license
767
- * Copyright 2018 Google Inc.
768
- *
769
- * Permission is hereby granted, free of charge, to any person obtaining a copy
770
- * of this software and associated documentation files (the "Software"), to deal
771
- * in the Software without restriction, including without limitation the rights
772
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
773
- * copies of the Software, and to permit persons to whom the Software is
774
- * furnished to do so, subject to the following conditions:
775
- *
776
- * The above copyright notice and this permission notice shall be included in
777
- * all copies or substantial portions of the Software.
778
- *
779
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
780
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
781
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
782
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
783
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
784
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
785
- * THE SOFTWARE.
786
- */
787
- var mt = {
788
- NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
789
- }, it = {
790
- // This should stay in sync with $mdc-notched-outline-padding * 2.
791
- NOTCH_ELEMENT_PADDING: 8
792
- }, Me = {
793
- NO_LABEL: "mdc-notched-outline--no-label",
794
- OUTLINE_NOTCHED: "mdc-notched-outline--notched",
795
- OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
796
- };
797
- /**
798
- * @license
799
- * Copyright 2017 Google Inc.
800
- *
801
- * Permission is hereby granted, free of charge, to any person obtaining a copy
802
- * of this software and associated documentation files (the "Software"), to deal
803
- * in the Software without restriction, including without limitation the rights
804
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
805
- * copies of the Software, and to permit persons to whom the Software is
806
- * furnished to do so, subject to the following conditions:
807
- *
808
- * The above copyright notice and this permission notice shall be included in
809
- * all copies or substantial portions of the Software.
810
- *
811
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
812
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
813
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
814
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
815
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
816
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
817
- * THE SOFTWARE.
818
- */
819
- var Kt = (
820
- /** @class */
821
- function(o) {
822
- A(t, o);
823
- function t(e) {
824
- return o.call(this, _(_({}, t.defaultAdapter), e)) || this;
825
- }
826
- return Object.defineProperty(t, "strings", {
827
- get: function() {
828
- return mt;
829
- },
830
- enumerable: !1,
831
- configurable: !0
832
- }), Object.defineProperty(t, "cssClasses", {
833
- get: function() {
834
- return Me;
835
- },
836
- enumerable: !1,
837
- configurable: !0
838
- }), Object.defineProperty(t, "numbers", {
839
- get: function() {
840
- return it;
841
- },
842
- enumerable: !1,
843
- configurable: !0
844
- }), Object.defineProperty(t, "defaultAdapter", {
845
- /**
846
- * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.
847
- */
848
- get: function() {
849
- return {
850
- addClass: function() {
851
- },
852
- removeClass: function() {
853
- },
854
- setNotchWidthProperty: function() {
855
- },
856
- removeNotchWidthProperty: function() {
857
- }
858
- };
859
- },
860
- enumerable: !1,
861
- configurable: !0
862
- }), t.prototype.notch = function(e) {
863
- var n = t.cssClasses.OUTLINE_NOTCHED;
864
- e > 0 && (e += it.NOTCH_ELEMENT_PADDING), this.adapter.setNotchWidthProperty(e), this.adapter.addClass(n);
865
- }, t.prototype.closeNotch = function() {
866
- var e = t.cssClasses.OUTLINE_NOTCHED;
867
- this.adapter.removeClass(e), this.adapter.removeNotchWidthProperty();
868
- }, t;
869
- }(Z)
870
- );
871
- /**
872
- * @license
873
- * Copyright 2017 Google Inc.
874
- *
875
- * Permission is hereby granted, free of charge, to any person obtaining a copy
876
- * of this software and associated documentation files (the "Software"), to deal
877
- * in the Software without restriction, including without limitation the rights
878
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
879
- * copies of the Software, and to permit persons to whom the Software is
880
- * furnished to do so, subject to the following conditions:
881
- *
882
- * The above copyright notice and this permission notice shall be included in
883
- * all copies or substantial portions of the Software.
884
- *
885
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
886
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
887
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
888
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
889
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
890
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
891
- * THE SOFTWARE.
892
- */
893
- var bt = (
894
- /** @class */
895
- function(o) {
896
- A(t, o);
897
- function t() {
898
- return o !== null && o.apply(this, arguments) || this;
899
- }
900
- return t.attachTo = function(e) {
901
- return new t(e);
902
- }, t.prototype.initialSyncWithDOM = function() {
903
- this.notchElement_ = this.root.querySelector(mt.NOTCH_ELEMENT_SELECTOR);
904
- var e = this.root.querySelector("." + pt.cssClasses.ROOT);
905
- e ? (e.style.transitionDuration = "0s", this.root.classList.add(Me.OUTLINE_UPGRADED), requestAnimationFrame(function() {
906
- e.style.transitionDuration = "";
907
- })) : this.root.classList.add(Me.NO_LABEL);
908
- }, t.prototype.notch = function(e) {
909
- this.foundation.notch(e);
910
- }, t.prototype.closeNotch = function() {
911
- this.foundation.closeNotch();
912
- }, t.prototype.getDefaultFoundation = function() {
913
- var e = this, n = {
914
- addClass: function(i) {
915
- return e.root.classList.add(i);
916
- },
917
- removeClass: function(i) {
918
- return e.root.classList.remove(i);
919
- },
920
- setNotchWidthProperty: function(i) {
921
- return e.notchElement_.style.setProperty("width", i + "px");
922
- },
923
- removeNotchWidthProperty: function() {
924
- return e.notchElement_.style.removeProperty("width");
925
- }
926
- };
927
- return new Kt(n);
928
- }, t;
929
- }(ee)
930
- );
931
- const Yt = {
932
- /**
933
- * Content to be rendered inside the portal.
934
- *
935
- * Defaults to **null**.
936
- */
937
- children: r.node,
938
- /**
939
- * Disables the portal to rendering children in the natural flow of the DOM.
940
- *
941
- * Defaults to **false**.
942
- */
943
- disabled: r.bool,
944
- /**
945
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
946
- *
947
- * Defaults to **'document.body'**.
948
- */
949
- portalContainer: r.oneOfType([r.string, r.node])
950
- }, Qt = {
951
- children: null,
952
- disabled: !1,
953
- portalContainer: "document.body"
954
- }, Oe = /* @__PURE__ */ Q((o, t) => {
955
- const [e, n] = Y(document.body), {
956
- children: i,
957
- container: a,
958
- disabled: u
959
- } = o, l = b();
960
- return J(t, () => l.current, []), v(() => {
961
- if (typeof a == "string")
962
- if (a === "document.body")
963
- n(document.body);
964
- else {
965
- const d = Ht(a);
966
- n(d || document.body);
967
- }
968
- else
969
- n(a || document.body);
970
- }, [a]), // eslint-disable-next-line react/jsx-no-useless-fragment
971
- /* @__PURE__ */ s.createElement(s.Fragment, null, u ? i : /* @__PURE__ */ Ut.createPortal(i, e));
972
- });
973
- Oe.displayName = "Portal";
974
- Oe.propTypes = Yt;
975
- Oe.defaultProps = Qt;
976
- var Jt = /* @__PURE__ */ s.memo(Oe);
977
- const Zt = {
978
- /**
979
- * Accepts any valid markup. This will be rendered before any value set with the `text` prop. For most use-cases use `text`.
980
- *
981
- * Defaults to **undefined**.
982
- */
983
- children: r.node.isRequired,
984
- /**
985
- * The css class name to be passed through to the component markup.
986
- *
987
- * Defaults to **undefined**.
988
- */
989
- className: r.string,
990
- /**
991
- * Container display type, inline or block.
992
- *
993
- * Defaults to **'inline'**.
994
- */
995
- containerType: r.oneOf(["inline", "block"]),
996
- /**
997
- * Whether or not the tooltip is hoisted to render outside of the parent element. Useful for when the tooltip needs to render in a parent with `overflow: hidden` ie. a table cell.
998
- *
999
- * Defaults to **false**.
1000
- */
1001
- hoisted: r.bool,
1002
- /**
1003
- * Randomly generated id. May be overwritten.
1004
- *
1005
- * Defaults to **undefined**.
1006
- */
1007
- id: r.string,
1008
- /**
1009
- * Fired when the trigger is interacted with.
1010
- *
1011
- * Defaults to **null**.
1012
- */
1013
- onClick: r.func,
1014
- /**
1015
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
1016
- *
1017
- * Defaults to **'document.body'**.
1018
- */
1019
- portalContainer: r.oneOfType([r.string, r.node]),
1020
- /**
1021
- * Position of tooltip. Options include: 'top', 'left', 'right', and 'bottom'(default).
1022
- *
1023
- * Defaults to **'bottom'**.
1024
- */
1025
- position: r.oneOf(["bottom", "top", "left", "right"]),
1026
- /**
1027
- * string
1028
- *
1029
- * Defaults to **null**.
1030
- */
1031
- text: r.oneOfType([r.string, r.func, r.node]).isRequired,
1032
- /**
1033
- * Custom properties to apply to the hovering element.
1034
- *
1035
- * Defaults to **null**.
1036
- */
1037
- tooltipProps: r.object,
1038
- /**
1039
- * Custom properties to apply to the trigger element.
1040
- *
1041
- * Defaults to **null**.
1042
- */
1043
- triggerProps: r.object
1044
- }, en = {
1045
- children: void 0,
1046
- className: void 0,
1047
- containerType: "inline",
1048
- hoisted: !1,
1049
- id: void 0,
1050
- portalContainer: "document.body",
1051
- position: "bottom",
1052
- text: null,
1053
- tooltipProps: null,
1054
- triggerProps: null
1055
- }, tn = {
1056
- /**
1057
- * The css class name to be passed through to the component markup.
1058
- *
1059
- * Defaults to **undefined**.
1060
- */
1061
- className: r.string,
1062
- /**
1063
- * Whether or not the tooltip is hoisted to render outside of the parent element. Useful for when the tooltip needs to render in a parent with `overflow: hidden` ie. a table cell.
1064
- *
1065
- * Defaults to **false**.
1066
- */
1067
- hoisted: r.bool,
1068
- /**
1069
- * Randomly generated id. May be overwritten.
1070
- *
1071
- * Defaults to **undefined**.
1072
- */
1073
- id: r.string,
1074
- /**
1075
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
1076
- *
1077
- * Defaults to **'document.body'**.
1078
- */
1079
- portalContainer: r.oneOfType([r.string, r.node]),
1080
- /**
1081
- * The text to be rendered inside of the Tooltip.
1082
- *
1083
- * Defaults to **null**.
1084
- */
1085
- text: r.oneOfType([r.string, r.func, r.node]).isRequired
1086
- }, nn = {
1087
- className: void 0,
1088
- hoisted: !1,
1089
- id: void 0,
1090
- portalContainer: "document.body",
1091
- text: null
1092
- }, _e = /* @__PURE__ */ Q((o, t) => {
1093
- const {
1094
- className: e,
1095
- hoisted: n,
1096
- id: i,
1097
- portalContainer: a,
1098
- text: u,
1099
- ...l
1100
- } = o, [d] = Y(() => i || me()), C = b();
1101
- J(t, () => C.current, []);
1102
- const E = je(() => L(["lmnt", e, "lmnt-tooltip__text-content", "mdc-typography--caption"]), [e]);
1103
- return /* @__PURE__ */ s.createElement(Jt, {
1104
- disabled: !n,
1105
- container: a
1106
- }, /* @__PURE__ */ s.createElement("div", k({
1107
- role: "tooltip",
1108
- id: d,
1109
- className: E
1110
- }, l, {
1111
- ref: C
1112
- }), u));
1113
- });
1114
- _e.displayName = "TooltipText";
1115
- _e.propTypes = tn;
1116
- _e.defaultProps = nn;
1117
- const qe = /* @__PURE__ */ Q((o, t) => {
1118
- const {
1119
- children: e,
1120
- className: n,
1121
- containerType: i,
1122
- hoisted: a,
1123
- id: u,
1124
- onClick: l,
1125
- portalContainer: d,
1126
- position: C,
1127
- text: E,
1128
- tooltipProps: O,
1129
- triggerProps: te,
1130
- ...P
1131
- } = o, H = b(), g = b(), x = b();
1132
- J(t, () => g.current, []);
1133
- const [y] = Y(() => u || me()), F = oe(() => {
1134
- l?.();
1135
- }, [l]), W = oe((f) => {
1136
- f.key === "Enter" && l?.();
1137
- }, [l]);
1138
- Vt(() => {
1139
- const f = [{
1140
- name: "flip",
1141
- options: {
1142
- enabled: !0,
1143
- padding: {
1144
- bottom: 32,
1145
- top: 32
1146
- }
1147
- }
1148
- }];
1149
- return a ? f.push({
1150
- name: "offset",
1151
- options: {
1152
- offset: [0, 6]
1153
- }
1154
- }) : f.push({
1155
- name: "offset",
1156
- options: {
1157
- offset: [0, 12]
1158
- }
1159
- }), H.current && g.current && (x.current = ct(H.current, g.current, {
1160
- placement: C,
1161
- modifiers: f
1162
- })), () => {
1163
- var m;
1164
- (m = x.current) === null || m === void 0 || m.destroy();
1165
- };
1166
- }, [C, a]);
1167
- const p = oe(() => {
1168
- var f, m, I;
1169
- (f = g.current) === null || f === void 0 || f.setAttribute("data-show", ""), (m = x.current) === null || m === void 0 || m.setOptions((ae) => ({
1170
- ...ae,
1171
- modifiers: [...ae.modifiers, {
1172
- name: "eventListeners",
1173
- enabled: !0
1174
- }]
1175
- })), (I = x.current) === null || I === void 0 || I.update();
1176
- }, []), M = oe(() => {
1177
- var f, m;
1178
- (f = g.current) === null || f === void 0 || f.removeAttribute("data-show"), (m = x.current) === null || m === void 0 || m.setOptions((I) => ({
1179
- ...I,
1180
- modifiers: [...I.modifiers, {
1181
- name: "eventListeners",
1182
- enabled: !1
1183
- }]
1184
- }));
1185
- }, []), h = oe(() => {
1186
- const f = e;
1187
- return f.type ? f.type === nt : f === nt;
1188
- }, [e]);
1189
- v(() => {
1190
- const f = `Tooltips should only include short text for additional context and should not exceed three lines visually. (Toolitip ID ${y}).`;
1191
- E && E.length > 100 && Bt(f);
1192
- }, [E, y]);
1193
- const G = je(
1194
- // eslint-disable-next-line react/no-unstable-nested-components
1195
- () => () => e ? typeof e == "string" || h(e) ? /* @__PURE__ */ s.createElement("span", {
1196
- "aria-describedby": y
1197
- }, e) : fe(e, {
1198
- "aria-describedby": y
1199
- }) : null,
1200
- [e, y, h]
1201
- ), j = l ? {
1202
- tabIndex: 0,
1203
- role: l ? "button" : "note",
1204
- onKeyPress: W,
1205
- onClick: F
1206
- } : {};
1207
- return /* @__PURE__ */ s.createElement("span", k({
1208
- className: L("lmnt lmnt-tooltip", i === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
1209
- }, j, P), /* @__PURE__ */ s.createElement("span", k({
1210
- className: L("lmnt-tooltip__content", i === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
1211
- }, te, {
1212
- ref: H,
1213
- onMouseEnter: p,
1214
- onFocus: p,
1215
- onMouseLeave: M,
1216
- onBlur: M
1217
- }), /* @__PURE__ */ s.createElement(G, null)), E && /* @__PURE__ */ s.createElement(_e, k({
1218
- hoisted: a,
1219
- portalContainer: d,
1220
- role: "tooltip",
1221
- id: y,
1222
- className: n
1223
- }, O, {
1224
- ref: g,
1225
- text: E
1226
- })));
1227
- });
1228
- qe.displayName = "Tooltip";
1229
- qe.propTypes = Zt;
1230
- qe.defaultProps = en;
1231
- const rn = {
1232
- /**
1233
- * Content to be rendered inside the label. Expects a string, though accepts any valid markup.
1234
- *
1235
- * Defaults to **null**.
1236
- */
1237
- children: r.node.isRequired,
1238
- /**
1239
- * The css class name to be passed through to the component markup.
1240
- *
1241
- * Defaults to **undefined**.
1242
- */
1243
- className: r.string,
1244
- /**
1245
- * The label will appear in the floating state.
1246
- *
1247
- * Defaults to **false**.
1248
- */
1249
- float: r.bool,
1250
- /**
1251
- * The id of the component to trigger on active
1252
- *
1253
- * Defaults to **empty string**.
1254
- */
1255
- htmlFor: r.string,
1256
- /**
1257
- * The label will shake briefly when set.
1258
- *
1259
- * Defaults to **false**.
1260
- */
1261
- shake: r.bool
1262
- }, on = {
1263
- children: null,
1264
- className: void 0,
1265
- float: !1,
1266
- htmlFor: "",
1267
- shake: !1
1268
- }, be = /* @__PURE__ */ Q((o, t) => {
1269
- const {
1270
- children: e,
1271
- htmlFor: n = "",
1272
- shake: i = !1,
1273
- float: a = !1,
1274
- className: u,
1275
- style: l,
1276
- ...d
1277
- } = o, C = b(), E = e, O = b();
1278
- return J(t, () => O.current, []), v(() => (C.current = ht.attachTo(O.current), () => {
1279
- C.current.destroy();
1280
- })), v(() => {
1281
- C.current.float(a);
1282
- }, [a]), /* @__PURE__ */ s.createElement("label", k({
1283
- ref: O,
1284
- htmlFor: n,
1285
- className: L("lmnt", "mdc-floating-label", a && "mdc-floating-label--float-above", i && "mdc-floating-label--shake", u)
1286
- }, d, {
1287
- style: l
1288
- }), E);
1289
- });
1290
- be.displayName = "FloatingLabel";
1291
- be.propTypes = rn;
1292
- be.defaultProps = on;
1293
- const an = {
1294
- /**
1295
- * Content to be rendered inside the notched outline. Accepts a string.
1296
- *
1297
- * Defaults to **null**.
1298
- */
1299
- children: r.node,
1300
- /**
1301
- * The css class name to be passed through to the component markup.
1302
- *
1303
- * Defaults to **undefined**.
1304
- */
1305
- className: r.string,
1306
- /**
1307
- * Determines if the notch is opened or closed.
1308
- *
1309
- * Defaults to **undefined**.
1310
- */
1311
- closed: r.bool,
1312
- /**
1313
- *
1314
- *
1315
- * Defaults to **null**.
1316
- */
1317
- width: r.number
1318
- }, ln = {
1319
- children: null,
1320
- className: void 0,
1321
- closed: void 0,
1322
- width: null
1323
- }, xe = /* @__PURE__ */ Q((o, t) => {
1324
- const {
1325
- closed: e,
1326
- className: n,
1327
- children: i,
1328
- width: a,
1329
- ...u
1330
- } = o, l = b(), d = b();
1331
- return J(t, () => l.current, []), v(() => (d.current = bt.attachTo(l.current), () => {
1332
- d.current.destroy();
1333
- }), []), v(() => {
1334
- e !== void 0 && (e ? d.current.closeNotch() : d.current.notch());
1335
- }, [e]), v(() => {
1336
- a ? d.current.foundation.adapter.setNotchWidthProperty(a) : d.current.foundation.adapter.removeNotchWidthProperty();
1337
- }, [a]), /* @__PURE__ */ s.createElement("div", k({
1338
- className: L("lmnt", "mdc-notched-outline", n),
1339
- ref: l
1340
- }, u), /* @__PURE__ */ s.createElement("div", {
1341
- className: "mdc-notched-outline__leading"
1342
- }), /* @__PURE__ */ s.createElement("div", {
1343
- className: "mdc-notched-outline__notch"
1344
- }, i), /* @__PURE__ */ s.createElement("div", {
1345
- className: "mdc-notched-outline__trailing"
1346
- }));
1347
- });
1348
- xe.displayName = "NotchedOutline";
1349
- xe.propTypes = an;
1350
- xe.defaultProps = ln;
1351
- /**
1352
- * @license
1353
- * Copyright 2019 Google Inc.
1354
- *
1355
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1356
- * of this software and associated documentation files (the "Software"), to deal
1357
- * in the Software without restriction, including without limitation the rights
1358
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1359
- * copies of the Software, and to permit persons to whom the Software is
1360
- * furnished to do so, subject to the following conditions:
1361
- *
1362
- * The above copyright notice and this permission notice shall be included in
1363
- * all copies or substantial portions of the Software.
1364
- *
1365
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1366
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1367
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1368
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1369
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1370
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1371
- * THE SOFTWARE.
1372
- */
1373
- var _t = {
1374
- ROOT: "mdc-text-field-character-counter"
1375
- }, sn = {
1376
- ROOT_SELECTOR: "." + _t.ROOT
1377
- };
1378
- /**
1379
- * @license
1380
- * Copyright 2019 Google Inc.
1381
- *
1382
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1383
- * of this software and associated documentation files (the "Software"), to deal
1384
- * in the Software without restriction, including without limitation the rights
1385
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1386
- * copies of the Software, and to permit persons to whom the Software is
1387
- * furnished to do so, subject to the following conditions:
1388
- *
1389
- * The above copyright notice and this permission notice shall be included in
1390
- * all copies or substantial portions of the Software.
1391
- *
1392
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1393
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1394
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1395
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1396
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1397
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1398
- * THE SOFTWARE.
1399
- */
1400
- var vt = (
1401
- /** @class */
1402
- function(o) {
1403
- A(t, o);
1404
- function t(e) {
1405
- return o.call(this, _(_({}, t.defaultAdapter), e)) || this;
1406
- }
1407
- return Object.defineProperty(t, "cssClasses", {
1408
- get: function() {
1409
- return _t;
1410
- },
1411
- enumerable: !1,
1412
- configurable: !0
1413
- }), Object.defineProperty(t, "strings", {
1414
- get: function() {
1415
- return sn;
1416
- },
1417
- enumerable: !1,
1418
- configurable: !0
1419
- }), Object.defineProperty(t, "defaultAdapter", {
1420
- /**
1421
- * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.
1422
- */
1423
- get: function() {
1424
- return {
1425
- setContent: function() {
1426
- }
1427
- };
1428
- },
1429
- enumerable: !1,
1430
- configurable: !0
1431
- }), t.prototype.setCounterValue = function(e, n) {
1432
- e = Math.min(e, n), this.adapter.setContent(e + " / " + n);
1433
- }, t;
1434
- }(Z)
1435
- );
1436
- /**
1437
- * @license
1438
- * Copyright 2019 Google Inc.
1439
- *
1440
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1441
- * of this software and associated documentation files (the "Software"), to deal
1442
- * in the Software without restriction, including without limitation the rights
1443
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1444
- * copies of the Software, and to permit persons to whom the Software is
1445
- * furnished to do so, subject to the following conditions:
1446
- *
1447
- * The above copyright notice and this permission notice shall be included in
1448
- * all copies or substantial portions of the Software.
1449
- *
1450
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1451
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1452
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1453
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1454
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1455
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1456
- * THE SOFTWARE.
1457
- */
1458
- var un = (
1459
- /** @class */
1460
- function(o) {
1461
- A(t, o);
1462
- function t() {
1463
- return o !== null && o.apply(this, arguments) || this;
1464
- }
1465
- return t.attachTo = function(e) {
1466
- return new t(e);
1467
- }, Object.defineProperty(t.prototype, "foundationForTextField", {
1468
- // Provided for access by MDCTextField component
1469
- get: function() {
1470
- return this.foundation;
1471
- },
1472
- enumerable: !1,
1473
- configurable: !0
1474
- }), t.prototype.getDefaultFoundation = function() {
1475
- var e = this, n = {
1476
- setContent: function(i) {
1477
- e.root.textContent = i;
1478
- }
1479
- };
1480
- return new vt(n);
1481
- }, t;
1482
- }(ee)
1483
- );
1484
- /**
1485
- * @license
1486
- * Copyright 2016 Google Inc.
1487
- *
1488
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1489
- * of this software and associated documentation files (the "Software"), to deal
1490
- * in the Software without restriction, including without limitation the rights
1491
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1492
- * copies of the Software, and to permit persons to whom the Software is
1493
- * furnished to do so, subject to the following conditions:
1494
- *
1495
- * The above copyright notice and this permission notice shall be included in
1496
- * all copies or substantial portions of the Software.
1497
- *
1498
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1499
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1500
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1501
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1502
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1503
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1504
- * THE SOFTWARE.
1505
- */
1506
- var w = {
1507
- ARIA_CONTROLS: "aria-controls",
1508
- ARIA_DESCRIBEDBY: "aria-describedby",
1509
- INPUT_SELECTOR: ".mdc-text-field__input",
1510
- LABEL_SELECTOR: ".mdc-floating-label",
1511
- LEADING_ICON_SELECTOR: ".mdc-text-field__icon--leading",
1512
- LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
1513
- OUTLINE_SELECTOR: ".mdc-notched-outline",
1514
- PREFIX_SELECTOR: ".mdc-text-field__affix--prefix",
1515
- SUFFIX_SELECTOR: ".mdc-text-field__affix--suffix",
1516
- TRAILING_ICON_SELECTOR: ".mdc-text-field__icon--trailing"
1517
- }, Ie = {
1518
- DISABLED: "mdc-text-field--disabled",
1519
- FOCUSED: "mdc-text-field--focused",
1520
- HELPER_LINE: "mdc-text-field-helper-line",
1521
- INVALID: "mdc-text-field--invalid",
1522
- LABEL_FLOATING: "mdc-text-field--label-floating",
1523
- NO_LABEL: "mdc-text-field--no-label",
1524
- OUTLINED: "mdc-text-field--outlined",
1525
- ROOT: "mdc-text-field",
1526
- TEXTAREA: "mdc-text-field--textarea",
1527
- WITH_LEADING_ICON: "mdc-text-field--with-leading-icon",
1528
- WITH_TRAILING_ICON: "mdc-text-field--with-trailing-icon"
1529
- }, rt = {
1530
- LABEL_SCALE: 0.75
1531
- }, dn = [
1532
- "pattern",
1533
- "min",
1534
- "max",
1535
- "required",
1536
- "step",
1537
- "minlength",
1538
- "maxlength"
1539
- ], cn = [
1540
- "color",
1541
- "date",
1542
- "datetime-local",
1543
- "month",
1544
- "range",
1545
- "time",
1546
- "week"
1547
- ];
1548
- /**
1549
- * @license
1550
- * Copyright 2016 Google Inc.
1551
- *
1552
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1553
- * of this software and associated documentation files (the "Software"), to deal
1554
- * in the Software without restriction, including without limitation the rights
1555
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1556
- * copies of the Software, and to permit persons to whom the Software is
1557
- * furnished to do so, subject to the following conditions:
1558
- *
1559
- * The above copyright notice and this permission notice shall be included in
1560
- * all copies or substantial portions of the Software.
1561
- *
1562
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1563
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1564
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1565
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1566
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1567
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1568
- * THE SOFTWARE.
1569
- */
1570
- var ot = ["mousedown", "touchstart"], at = ["click", "keydown"], fn = (
1571
- /** @class */
1572
- function(o) {
1573
- A(t, o);
1574
- function t(e, n) {
1575
- n === void 0 && (n = {});
1576
- var i = o.call(this, _(_({}, t.defaultAdapter), e)) || this;
1577
- 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() {
1578
- return i.activateFocus();
1579
- }, i.inputBlurHandler_ = function() {
1580
- return i.deactivateFocus();
1581
- }, i.inputInputHandler_ = function() {
1582
- return i.handleInput();
1583
- }, i.setPointerXOffset_ = function(a) {
1584
- return i.setTransformOrigin(a);
1585
- }, i.textFieldInteractionHandler_ = function() {
1586
- return i.handleTextFieldInteraction();
1587
- }, i.validationAttributeChangeHandler_ = function(a) {
1588
- return i.handleValidationAttributeChange(a);
1589
- }, i;
1590
- }
1591
- return Object.defineProperty(t, "cssClasses", {
1592
- get: function() {
1593
- return Ie;
1594
- },
1595
- enumerable: !1,
1596
- configurable: !0
1597
- }), Object.defineProperty(t, "strings", {
1598
- get: function() {
1599
- return w;
1600
- },
1601
- enumerable: !1,
1602
- configurable: !0
1603
- }), Object.defineProperty(t, "numbers", {
1604
- get: function() {
1605
- return rt;
1606
- },
1607
- enumerable: !1,
1608
- configurable: !0
1609
- }), Object.defineProperty(t.prototype, "shouldAlwaysFloat_", {
1610
- get: function() {
1611
- var e = this.getNativeInput_().type;
1612
- return cn.indexOf(e) >= 0;
1613
- },
1614
- enumerable: !1,
1615
- configurable: !0
1616
- }), Object.defineProperty(t.prototype, "shouldFloat", {
1617
- get: function() {
1618
- return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
1619
- },
1620
- enumerable: !1,
1621
- configurable: !0
1622
- }), Object.defineProperty(t.prototype, "shouldShake", {
1623
- get: function() {
1624
- return !this.isFocused_ && !this.isValid() && !!this.getValue();
1625
- },
1626
- enumerable: !1,
1627
- configurable: !0
1628
- }), Object.defineProperty(t, "defaultAdapter", {
1629
- /**
1630
- * See {@link MDCTextFieldAdapter} for typing information on parameters and
1631
- * return types.
1632
- */
1633
- get: function() {
1634
- return {
1635
- addClass: function() {
1636
- },
1637
- removeClass: function() {
1638
- },
1639
- hasClass: function() {
1640
- return !0;
1641
- },
1642
- setInputAttr: function() {
1643
- },
1644
- removeInputAttr: function() {
1645
- },
1646
- registerTextFieldInteractionHandler: function() {
1647
- },
1648
- deregisterTextFieldInteractionHandler: function() {
1649
- },
1650
- registerInputInteractionHandler: function() {
1651
- },
1652
- deregisterInputInteractionHandler: function() {
1653
- },
1654
- registerValidationAttributeChangeHandler: function() {
1655
- return new MutationObserver(function() {
1656
- });
1657
- },
1658
- deregisterValidationAttributeChangeHandler: function() {
1659
- },
1660
- getNativeInput: function() {
1661
- return null;
1662
- },
1663
- isFocused: function() {
1664
- return !1;
1665
- },
1666
- activateLineRipple: function() {
1667
- },
1668
- deactivateLineRipple: function() {
1669
- },
1670
- setLineRippleTransformOrigin: function() {
1671
- },
1672
- shakeLabel: function() {
1673
- },
1674
- floatLabel: function() {
1675
- },
1676
- setLabelRequired: function() {
1677
- },
1678
- hasLabel: function() {
1679
- return !1;
1680
- },
1681
- getLabelWidth: function() {
1682
- return 0;
1683
- },
1684
- hasOutline: function() {
1685
- return !1;
1686
- },
1687
- notchOutline: function() {
1688
- },
1689
- closeOutline: function() {
1690
- }
1691
- };
1692
- },
1693
- enumerable: !1,
1694
- configurable: !0
1695
- }), t.prototype.init = function() {
1696
- var e = this;
1697
- 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_), ot.forEach(function(n) {
1698
- e.adapter.registerInputInteractionHandler(n, e.setPointerXOffset_);
1699
- }), at.forEach(function(n) {
1700
- e.adapter.registerTextFieldInteractionHandler(n, e.textFieldInteractionHandler_);
1701
- }), this.validationObserver_ = this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_), this.setCharacterCounter_(this.getValue().length);
1702
- }, t.prototype.destroy = function() {
1703
- var e = this;
1704
- this.adapter.deregisterInputInteractionHandler("focus", this.inputFocusHandler_), this.adapter.deregisterInputInteractionHandler("blur", this.inputBlurHandler_), this.adapter.deregisterInputInteractionHandler("input", this.inputInputHandler_), ot.forEach(function(n) {
1705
- e.adapter.deregisterInputInteractionHandler(n, e.setPointerXOffset_);
1706
- }), at.forEach(function(n) {
1707
- e.adapter.deregisterTextFieldInteractionHandler(n, e.textFieldInteractionHandler_);
1708
- }), this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_);
1709
- }, t.prototype.handleTextFieldInteraction = function() {
1710
- var e = this.adapter.getNativeInput();
1711
- e && e.disabled || (this.receivedUserInput_ = !0);
1712
- }, t.prototype.handleValidationAttributeChange = function(e) {
1713
- var n = this;
1714
- e.some(function(i) {
1715
- return dn.indexOf(i) > -1 ? (n.styleValidity_(!0), n.adapter.setLabelRequired(n.getNativeInput_().required), !0) : !1;
1716
- }), e.indexOf("maxlength") > -1 && this.setCharacterCounter_(this.getValue().length);
1717
- }, t.prototype.notchOutline = function(e) {
1718
- if (!(!this.adapter.hasOutline() || !this.adapter.hasLabel()))
1719
- if (e) {
1720
- var n = this.adapter.getLabelWidth() * rt.LABEL_SCALE;
1721
- this.adapter.notchOutline(n);
1722
- } else
1723
- this.adapter.closeOutline();
1724
- }, t.prototype.activateFocus = function() {
1725
- 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();
1726
- }, t.prototype.setTransformOrigin = function(e) {
1727
- if (!(this.isDisabled() || this.adapter.hasOutline())) {
1728
- var n = e.touches, i = n ? n[0] : e, a = i.target.getBoundingClientRect(), u = i.clientX - a.left;
1729
- this.adapter.setLineRippleTransformOrigin(u);
1730
- }
1731
- }, t.prototype.handleInput = function() {
1732
- this.autoCompleteFocus(), this.setCharacterCounter_(this.getValue().length);
1733
- }, t.prototype.autoCompleteFocus = function() {
1734
- this.receivedUserInput_ || this.activateFocus();
1735
- }, t.prototype.deactivateFocus = function() {
1736
- this.isFocused_ = !1, this.adapter.deactivateLineRipple();
1737
- var e = this.isValid();
1738
- 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);
1739
- }, t.prototype.getValue = function() {
1740
- return this.getNativeInput_().value;
1741
- }, t.prototype.setValue = function(e) {
1742
- if (this.getValue() !== e && (this.getNativeInput_().value = e), this.setCharacterCounter_(e.length), this.validateOnValueChange_) {
1743
- var n = this.isValid();
1744
- this.styleValidity_(n);
1745
- }
1746
- this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating_(this.shouldFloat), this.validateOnValueChange_ && this.adapter.shakeLabel(this.shouldShake));
1747
- }, t.prototype.isValid = function() {
1748
- return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
1749
- }, t.prototype.setValid = function(e) {
1750
- this.isValid_ = e, this.styleValidity_(e);
1751
- var n = !e && !this.isFocused_ && !!this.getValue();
1752
- this.adapter.hasLabel() && this.adapter.shakeLabel(n);
1753
- }, t.prototype.setValidateOnValueChange = function(e) {
1754
- this.validateOnValueChange_ = e;
1755
- }, t.prototype.getValidateOnValueChange = function() {
1756
- return this.validateOnValueChange_;
1757
- }, t.prototype.setUseNativeValidation = function(e) {
1758
- this.useNativeValidation_ = e;
1759
- }, t.prototype.isDisabled = function() {
1760
- return this.getNativeInput_().disabled;
1761
- }, t.prototype.setDisabled = function(e) {
1762
- this.getNativeInput_().disabled = e, this.styleDisabled_(e);
1763
- }, t.prototype.setHelperTextContent = function(e) {
1764
- this.helperText_ && this.helperText_.setContent(e);
1765
- }, t.prototype.setLeadingIconAriaLabel = function(e) {
1766
- this.leadingIcon_ && this.leadingIcon_.setAriaLabel(e);
1767
- }, t.prototype.setLeadingIconContent = function(e) {
1768
- this.leadingIcon_ && this.leadingIcon_.setContent(e);
1769
- }, t.prototype.setTrailingIconAriaLabel = function(e) {
1770
- this.trailingIcon_ && this.trailingIcon_.setAriaLabel(e);
1771
- }, t.prototype.setTrailingIconContent = function(e) {
1772
- this.trailingIcon_ && this.trailingIcon_.setContent(e);
1773
- }, t.prototype.setCharacterCounter_ = function(e) {
1774
- if (this.characterCounter_) {
1775
- var n = this.getNativeInput_().maxLength;
1776
- if (n === -1)
1777
- throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");
1778
- this.characterCounter_.setCounterValue(e, n);
1779
- }
1780
- }, t.prototype.isBadInput_ = function() {
1781
- return this.getNativeInput_().validity.badInput || !1;
1782
- }, t.prototype.isNativeInputValid_ = function() {
1783
- return this.getNativeInput_().validity.valid;
1784
- }, t.prototype.styleValidity_ = function(e) {
1785
- var n = t.cssClasses.INVALID;
1786
- if (e ? this.adapter.removeClass(n) : this.adapter.addClass(n), this.helperText_) {
1787
- this.helperText_.setValidity(e);
1788
- var i = this.helperText_.isValidation();
1789
- if (!i)
1790
- return;
1791
- var a = this.helperText_.isVisible(), u = this.helperText_.getId();
1792
- a && u ? this.adapter.setInputAttr(w.ARIA_DESCRIBEDBY, u) : this.adapter.removeInputAttr(w.ARIA_DESCRIBEDBY);
1793
- }
1794
- }, t.prototype.styleFocused_ = function(e) {
1795
- var n = t.cssClasses.FOCUSED;
1796
- e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
1797
- }, t.prototype.styleDisabled_ = function(e) {
1798
- var n = t.cssClasses, i = n.DISABLED, a = n.INVALID;
1799
- e ? (this.adapter.addClass(i), this.adapter.removeClass(a)) : this.adapter.removeClass(i), this.leadingIcon_ && this.leadingIcon_.setDisabled(e), this.trailingIcon_ && this.trailingIcon_.setDisabled(e);
1800
- }, t.prototype.styleFloating_ = function(e) {
1801
- var n = t.cssClasses.LABEL_FLOATING;
1802
- e ? this.adapter.addClass(n) : this.adapter.removeClass(n);
1803
- }, t.prototype.getNativeInput_ = function() {
1804
- var e = this.adapter ? this.adapter.getNativeInput() : null;
1805
- return e || {
1806
- disabled: !1,
1807
- maxLength: -1,
1808
- required: !1,
1809
- type: "input",
1810
- validity: {
1811
- badInput: !1,
1812
- valid: !0
1813
- },
1814
- value: ""
1815
- };
1816
- }, t;
1817
- }(Z)
1818
- );
1819
- /**
1820
- * @license
1821
- * Copyright 2016 Google Inc.
1822
- *
1823
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1824
- * of this software and associated documentation files (the "Software"), to deal
1825
- * in the Software without restriction, including without limitation the rights
1826
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1827
- * copies of the Software, and to permit persons to whom the Software is
1828
- * furnished to do so, subject to the following conditions:
1829
- *
1830
- * The above copyright notice and this permission notice shall be included in
1831
- * all copies or substantial portions of the Software.
1832
- *
1833
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1834
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1835
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1836
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1837
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1838
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1839
- * THE SOFTWARE.
1840
- */
1841
- var q = {
1842
- HELPER_TEXT_PERSISTENT: "mdc-text-field-helper-text--persistent",
1843
- HELPER_TEXT_VALIDATION_MSG: "mdc-text-field-helper-text--validation-msg",
1844
- ROOT: "mdc-text-field-helper-text"
1845
- }, ce = {
1846
- ARIA_HIDDEN: "aria-hidden",
1847
- ROLE: "role",
1848
- ROOT_SELECTOR: "." + q.ROOT
1849
- };
1850
- /**
1851
- * @license
1852
- * Copyright 2017 Google Inc.
1853
- *
1854
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1855
- * of this software and associated documentation files (the "Software"), to deal
1856
- * in the Software without restriction, including without limitation the rights
1857
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1858
- * copies of the Software, and to permit persons to whom the Software is
1859
- * furnished to do so, subject to the following conditions:
1860
- *
1861
- * The above copyright notice and this permission notice shall be included in
1862
- * all copies or substantial portions of the Software.
1863
- *
1864
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1865
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1866
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1867
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1868
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1869
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1870
- * THE SOFTWARE.
1871
- */
1872
- var yt = (
1873
- /** @class */
1874
- function(o) {
1875
- A(t, o);
1876
- function t(e) {
1877
- return o.call(this, _(_({}, t.defaultAdapter), e)) || this;
1878
- }
1879
- return Object.defineProperty(t, "cssClasses", {
1880
- get: function() {
1881
- return q;
1882
- },
1883
- enumerable: !1,
1884
- configurable: !0
1885
- }), Object.defineProperty(t, "strings", {
1886
- get: function() {
1887
- return ce;
1888
- },
1889
- enumerable: !1,
1890
- configurable: !0
1891
- }), Object.defineProperty(t, "defaultAdapter", {
1892
- /**
1893
- * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.
1894
- */
1895
- get: function() {
1896
- return {
1897
- addClass: function() {
1898
- },
1899
- removeClass: function() {
1900
- },
1901
- hasClass: function() {
1902
- return !1;
1903
- },
1904
- getAttr: function() {
1905
- return null;
1906
- },
1907
- setAttr: function() {
1908
- },
1909
- removeAttr: function() {
1910
- },
1911
- setContent: function() {
1912
- }
1913
- };
1914
- },
1915
- enumerable: !1,
1916
- configurable: !0
1917
- }), t.prototype.getId = function() {
1918
- return this.adapter.getAttr("id");
1919
- }, t.prototype.isVisible = function() {
1920
- return this.adapter.getAttr(ce.ARIA_HIDDEN) !== "true";
1921
- }, t.prototype.setContent = function(e) {
1922
- this.adapter.setContent(e);
1923
- }, t.prototype.isPersistent = function() {
1924
- return this.adapter.hasClass(q.HELPER_TEXT_PERSISTENT);
1925
- }, t.prototype.setPersistent = function(e) {
1926
- e ? this.adapter.addClass(q.HELPER_TEXT_PERSISTENT) : this.adapter.removeClass(q.HELPER_TEXT_PERSISTENT);
1927
- }, t.prototype.isValidation = function() {
1928
- return this.adapter.hasClass(q.HELPER_TEXT_VALIDATION_MSG);
1929
- }, t.prototype.setValidation = function(e) {
1930
- e ? this.adapter.addClass(q.HELPER_TEXT_VALIDATION_MSG) : this.adapter.removeClass(q.HELPER_TEXT_VALIDATION_MSG);
1931
- }, t.prototype.showToScreenReader = function() {
1932
- this.adapter.removeAttr(ce.ARIA_HIDDEN);
1933
- }, t.prototype.setValidity = function(e) {
1934
- var n = this.adapter.hasClass(q.HELPER_TEXT_PERSISTENT), i = this.adapter.hasClass(q.HELPER_TEXT_VALIDATION_MSG), a = i && !e;
1935
- a ? (this.showToScreenReader(), this.adapter.setAttr(ce.ROLE, "alert")) : this.adapter.removeAttr(ce.ROLE), !n && !a && this.hide_();
1936
- }, t.prototype.hide_ = function() {
1937
- this.adapter.setAttr(ce.ARIA_HIDDEN, "true");
1938
- }, t;
1939
- }(Z)
1940
- );
1941
- /**
1942
- * @license
1943
- * Copyright 2017 Google Inc.
1944
- *
1945
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1946
- * of this software and associated documentation files (the "Software"), to deal
1947
- * in the Software without restriction, including without limitation the rights
1948
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1949
- * copies of the Software, and to permit persons to whom the Software is
1950
- * furnished to do so, subject to the following conditions:
1951
- *
1952
- * The above copyright notice and this permission notice shall be included in
1953
- * all copies or substantial portions of the Software.
1954
- *
1955
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1956
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1957
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1958
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1959
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1960
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1961
- * THE SOFTWARE.
1962
- */
1963
- var Tt = (
1964
- /** @class */
1965
- function(o) {
1966
- A(t, o);
1967
- function t() {
1968
- return o !== null && o.apply(this, arguments) || this;
1969
- }
1970
- return t.attachTo = function(e) {
1971
- return new t(e);
1972
- }, Object.defineProperty(t.prototype, "foundationForTextField", {
1973
- // Provided for access by MDCTextField component
1974
- get: function() {
1975
- return this.foundation;
1976
- },
1977
- enumerable: !1,
1978
- configurable: !0
1979
- }), t.prototype.getDefaultFoundation = function() {
1980
- var e = this, n = {
1981
- addClass: function(i) {
1982
- return e.root.classList.add(i);
1983
- },
1984
- removeClass: function(i) {
1985
- return e.root.classList.remove(i);
1986
- },
1987
- hasClass: function(i) {
1988
- return e.root.classList.contains(i);
1989
- },
1990
- getAttr: function(i) {
1991
- return e.root.getAttribute(i);
1992
- },
1993
- setAttr: function(i, a) {
1994
- return e.root.setAttribute(i, a);
1995
- },
1996
- removeAttr: function(i) {
1997
- return e.root.removeAttribute(i);
1998
- },
1999
- setContent: function(i) {
2000
- e.root.textContent = i;
2001
- }
2002
- };
2003
- return new yt(n);
2004
- }, t;
2005
- }(ee)
2006
- );
2007
- /**
2008
- * @license
2009
- * Copyright 2016 Google Inc.
2010
- *
2011
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2012
- * of this software and associated documentation files (the "Software"), to deal
2013
- * in the Software without restriction, including without limitation the rights
2014
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2015
- * copies of the Software, and to permit persons to whom the Software is
2016
- * furnished to do so, subject to the following conditions:
2017
- *
2018
- * The above copyright notice and this permission notice shall be included in
2019
- * all copies or substantial portions of the Software.
2020
- *
2021
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2022
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2023
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2024
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2025
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2026
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2027
- * THE SOFTWARE.
2028
- */
2029
- var lt = {
2030
- ICON_EVENT: "MDCTextField:icon",
2031
- ICON_ROLE: "button"
2032
- }, pn = {
2033
- ROOT: "mdc-text-field__icon"
2034
- };
2035
- /**
2036
- * @license
2037
- * Copyright 2017 Google Inc.
2038
- *
2039
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2040
- * of this software and associated documentation files (the "Software"), to deal
2041
- * in the Software without restriction, including without limitation the rights
2042
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2043
- * copies of the Software, and to permit persons to whom the Software is
2044
- * furnished to do so, subject to the following conditions:
2045
- *
2046
- * The above copyright notice and this permission notice shall be included in
2047
- * all copies or substantial portions of the Software.
2048
- *
2049
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2050
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2051
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2052
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2053
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2054
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2055
- * THE SOFTWARE.
2056
- */
2057
- var st = ["click", "keydown"], ut = (
2058
- /** @class */
2059
- function(o) {
2060
- A(t, o);
2061
- function t(e) {
2062
- var n = o.call(this, _(_({}, t.defaultAdapter), e)) || this;
2063
- return n.savedTabIndex_ = null, n.interactionHandler_ = function(i) {
2064
- return n.handleInteraction(i);
2065
- }, n;
2066
- }
2067
- return Object.defineProperty(t, "strings", {
2068
- get: function() {
2069
- return lt;
2070
- },
2071
- enumerable: !1,
2072
- configurable: !0
2073
- }), Object.defineProperty(t, "cssClasses", {
2074
- get: function() {
2075
- return pn;
2076
- },
2077
- enumerable: !1,
2078
- configurable: !0
2079
- }), Object.defineProperty(t, "defaultAdapter", {
2080
- /**
2081
- * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.
2082
- */
2083
- get: function() {
2084
- return {
2085
- getAttr: function() {
2086
- return null;
2087
- },
2088
- setAttr: function() {
2089
- },
2090
- removeAttr: function() {
2091
- },
2092
- setContent: function() {
2093
- },
2094
- registerInteractionHandler: function() {
2095
- },
2096
- deregisterInteractionHandler: function() {
2097
- },
2098
- notifyIconAction: function() {
2099
- }
2100
- };
2101
- },
2102
- enumerable: !1,
2103
- configurable: !0
2104
- }), t.prototype.init = function() {
2105
- var e = this;
2106
- this.savedTabIndex_ = this.adapter.getAttr("tabindex"), st.forEach(function(n) {
2107
- e.adapter.registerInteractionHandler(n, e.interactionHandler_);
2108
- });
2109
- }, t.prototype.destroy = function() {
2110
- var e = this;
2111
- st.forEach(function(n) {
2112
- e.adapter.deregisterInteractionHandler(n, e.interactionHandler_);
2113
- });
2114
- }, t.prototype.setDisabled = function(e) {
2115
- this.savedTabIndex_ && (e ? (this.adapter.setAttr("tabindex", "-1"), this.adapter.removeAttr("role")) : (this.adapter.setAttr("tabindex", this.savedTabIndex_), this.adapter.setAttr("role", lt.ICON_ROLE)));
2116
- }, t.prototype.setAriaLabel = function(e) {
2117
- this.adapter.setAttr("aria-label", e);
2118
- }, t.prototype.setContent = function(e) {
2119
- this.adapter.setContent(e);
2120
- }, t.prototype.handleInteraction = function(e) {
2121
- var n = e.key === "Enter" || e.keyCode === 13;
2122
- (e.type === "click" || n) && (e.preventDefault(), this.adapter.notifyIconAction());
2123
- }, t;
2124
- }(Z)
2125
- );
2126
- /**
2127
- * @license
2128
- * Copyright 2017 Google Inc.
2129
- *
2130
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2131
- * of this software and associated documentation files (the "Software"), to deal
2132
- * in the Software without restriction, including without limitation the rights
2133
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2134
- * copies of the Software, and to permit persons to whom the Software is
2135
- * furnished to do so, subject to the following conditions:
2136
- *
2137
- * The above copyright notice and this permission notice shall be included in
2138
- * all copies or substantial portions of the Software.
2139
- *
2140
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2141
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2142
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2143
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2144
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2145
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2146
- * THE SOFTWARE.
2147
- */
2148
- var hn = (
2149
- /** @class */
2150
- function(o) {
2151
- A(t, o);
2152
- function t() {
2153
- return o !== null && o.apply(this, arguments) || this;
2154
- }
2155
- return t.attachTo = function(e) {
2156
- return new t(e);
2157
- }, Object.defineProperty(t.prototype, "foundationForTextField", {
2158
- // Provided for access by MDCTextField component
2159
- get: function() {
2160
- return this.foundation;
2161
- },
2162
- enumerable: !1,
2163
- configurable: !0
2164
- }), t.prototype.getDefaultFoundation = function() {
2165
- var e = this, n = {
2166
- getAttr: function(i) {
2167
- return e.root.getAttribute(i);
2168
- },
2169
- setAttr: function(i, a) {
2170
- return e.root.setAttribute(i, a);
2171
- },
2172
- removeAttr: function(i) {
2173
- return e.root.removeAttribute(i);
2174
- },
2175
- setContent: function(i) {
2176
- e.root.textContent = i;
2177
- },
2178
- registerInteractionHandler: function(i, a) {
2179
- return e.listen(i, a);
2180
- },
2181
- deregisterInteractionHandler: function(i, a) {
2182
- return e.unlisten(i, a);
2183
- },
2184
- notifyIconAction: function() {
2185
- return e.emit(
2186
- ut.strings.ICON_EVENT,
2187
- {},
2188
- !0
2189
- /* shouldBubble */
2190
- );
2191
- }
2192
- };
2193
- return new ut(n);
2194
- }, t;
2195
- }(ee)
2196
- );
2197
- /**
2198
- * @license
2199
- * Copyright 2016 Google Inc.
2200
- *
2201
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2202
- * of this software and associated documentation files (the "Software"), to deal
2203
- * in the Software without restriction, including without limitation the rights
2204
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2205
- * copies of the Software, and to permit persons to whom the Software is
2206
- * furnished to do so, subject to the following conditions:
2207
- *
2208
- * The above copyright notice and this permission notice shall be included in
2209
- * all copies or substantial portions of the Software.
2210
- *
2211
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2212
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2213
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2214
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2215
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2216
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2217
- * THE SOFTWARE.
2218
- */
2219
- var gn = (
2220
- /** @class */
2221
- function(o) {
2222
- A(t, o);
2223
- function t() {
2224
- return o !== null && o.apply(this, arguments) || this;
2225
- }
2226
- return t.attachTo = function(e) {
2227
- return new t(e);
2228
- }, t.prototype.initialize = function(e, n, i, a, u, l, d) {
2229
- e === void 0 && (e = function(p, M) {
2230
- return new Le(p, M);
2231
- }), n === void 0 && (n = function(p) {
2232
- return new gt(p);
2233
- }), i === void 0 && (i = function(p) {
2234
- return new Tt(p);
2235
- }), a === void 0 && (a = function(p) {
2236
- return new un(p);
2237
- }), u === void 0 && (u = function(p) {
2238
- return new hn(p);
2239
- }), l === void 0 && (l = function(p) {
2240
- return new ht(p);
2241
- }), d === void 0 && (d = function(p) {
2242
- return new bt(p);
2243
- }), this.input_ = this.root.querySelector(w.INPUT_SELECTOR);
2244
- var C = this.root.querySelector(w.LABEL_SELECTOR);
2245
- this.label_ = C ? l(C) : null;
2246
- var E = this.root.querySelector(w.LINE_RIPPLE_SELECTOR);
2247
- this.lineRipple_ = E ? n(E) : null;
2248
- var O = this.root.querySelector(w.OUTLINE_SELECTOR);
2249
- this.outline_ = O ? d(O) : null;
2250
- var te = yt.strings, P = this.root.nextElementSibling, H = P && P.classList.contains(Ie.HELPER_LINE), g = H && P && P.querySelector(te.ROOT_SELECTOR);
2251
- this.helperText_ = g ? i(g) : null;
2252
- var x = vt.strings, y = this.root.querySelector(x.ROOT_SELECTOR);
2253
- !y && H && P && (y = P.querySelector(x.ROOT_SELECTOR)), this.characterCounter_ = y ? a(y) : null;
2254
- var F = this.root.querySelector(w.LEADING_ICON_SELECTOR);
2255
- this.leadingIcon_ = F ? u(F) : null;
2256
- var W = this.root.querySelector(w.TRAILING_ICON_SELECTOR);
2257
- this.trailingIcon_ = W ? u(W) : null, this.prefix_ = this.root.querySelector(w.PREFIX_SELECTOR), this.suffix_ = this.root.querySelector(w.SUFFIX_SELECTOR), this.ripple = this.createRipple_(e);
2258
- }, t.prototype.destroy = function() {
2259
- 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(), o.prototype.destroy.call(this);
2260
- }, t.prototype.initialSyncWithDOM = function() {
2261
- this.disabled = this.input_.disabled;
2262
- }, Object.defineProperty(t.prototype, "value", {
2263
- get: function() {
2264
- return this.foundation.getValue();
2265
- },
2266
- /**
2267
- * @param value The value to set on the input.
2268
- */
2269
- set: function(e) {
2270
- this.foundation.setValue(e);
2271
- },
2272
- enumerable: !1,
2273
- configurable: !0
2274
- }), Object.defineProperty(t.prototype, "disabled", {
2275
- get: function() {
2276
- return this.foundation.isDisabled();
2277
- },
2278
- /**
2279
- * @param disabled Sets the Text Field disabled or enabled.
2280
- */
2281
- set: function(e) {
2282
- this.foundation.setDisabled(e);
2283
- },
2284
- enumerable: !1,
2285
- configurable: !0
2286
- }), Object.defineProperty(t.prototype, "valid", {
2287
- get: function() {
2288
- return this.foundation.isValid();
2289
- },
2290
- /**
2291
- * @param valid Sets the Text Field valid or invalid.
2292
- */
2293
- set: function(e) {
2294
- this.foundation.setValid(e);
2295
- },
2296
- enumerable: !1,
2297
- configurable: !0
2298
- }), Object.defineProperty(t.prototype, "required", {
2299
- get: function() {
2300
- return this.input_.required;
2301
- },
2302
- /**
2303
- * @param required Sets the Text Field to required.
2304
- */
2305
- set: function(e) {
2306
- this.input_.required = e;
2307
- },
2308
- enumerable: !1,
2309
- configurable: !0
2310
- }), Object.defineProperty(t.prototype, "pattern", {
2311
- get: function() {
2312
- return this.input_.pattern;
2313
- },
2314
- /**
2315
- * @param pattern Sets the input element's validation pattern.
2316
- */
2317
- set: function(e) {
2318
- this.input_.pattern = e;
2319
- },
2320
- enumerable: !1,
2321
- configurable: !0
2322
- }), Object.defineProperty(t.prototype, "minLength", {
2323
- get: function() {
2324
- return this.input_.minLength;
2325
- },
2326
- /**
2327
- * @param minLength Sets the input element's minLength.
2328
- */
2329
- set: function(e) {
2330
- this.input_.minLength = e;
2331
- },
2332
- enumerable: !1,
2333
- configurable: !0
2334
- }), Object.defineProperty(t.prototype, "maxLength", {
2335
- get: function() {
2336
- return this.input_.maxLength;
2337
- },
2338
- /**
2339
- * @param maxLength Sets the input element's maxLength.
2340
- */
2341
- set: function(e) {
2342
- e < 0 ? this.input_.removeAttribute("maxLength") : this.input_.maxLength = e;
2343
- },
2344
- enumerable: !1,
2345
- configurable: !0
2346
- }), Object.defineProperty(t.prototype, "min", {
2347
- get: function() {
2348
- return this.input_.min;
2349
- },
2350
- /**
2351
- * @param min Sets the input element's min.
2352
- */
2353
- set: function(e) {
2354
- this.input_.min = e;
2355
- },
2356
- enumerable: !1,
2357
- configurable: !0
2358
- }), Object.defineProperty(t.prototype, "max", {
2359
- get: function() {
2360
- return this.input_.max;
2361
- },
2362
- /**
2363
- * @param max Sets the input element's max.
2364
- */
2365
- set: function(e) {
2366
- this.input_.max = e;
2367
- },
2368
- enumerable: !1,
2369
- configurable: !0
2370
- }), Object.defineProperty(t.prototype, "step", {
2371
- get: function() {
2372
- return this.input_.step;
2373
- },
2374
- /**
2375
- * @param step Sets the input element's step.
2376
- */
2377
- set: function(e) {
2378
- this.input_.step = e;
2379
- },
2380
- enumerable: !1,
2381
- configurable: !0
2382
- }), Object.defineProperty(t.prototype, "helperTextContent", {
2383
- /**
2384
- * Sets the helper text element content.
2385
- */
2386
- set: function(e) {
2387
- this.foundation.setHelperTextContent(e);
2388
- },
2389
- enumerable: !1,
2390
- configurable: !0
2391
- }), Object.defineProperty(t.prototype, "leadingIconAriaLabel", {
2392
- /**
2393
- * Sets the aria label of the leading icon.
2394
- */
2395
- set: function(e) {
2396
- this.foundation.setLeadingIconAriaLabel(e);
2397
- },
2398
- enumerable: !1,
2399
- configurable: !0
2400
- }), Object.defineProperty(t.prototype, "leadingIconContent", {
2401
- /**
2402
- * Sets the text content of the leading icon.
2403
- */
2404
- set: function(e) {
2405
- this.foundation.setLeadingIconContent(e);
2406
- },
2407
- enumerable: !1,
2408
- configurable: !0
2409
- }), Object.defineProperty(t.prototype, "trailingIconAriaLabel", {
2410
- /**
2411
- * Sets the aria label of the trailing icon.
2412
- */
2413
- set: function(e) {
2414
- this.foundation.setTrailingIconAriaLabel(e);
2415
- },
2416
- enumerable: !1,
2417
- configurable: !0
2418
- }), Object.defineProperty(t.prototype, "trailingIconContent", {
2419
- /**
2420
- * Sets the text content of the trailing icon.
2421
- */
2422
- set: function(e) {
2423
- this.foundation.setTrailingIconContent(e);
2424
- },
2425
- enumerable: !1,
2426
- configurable: !0
2427
- }), Object.defineProperty(t.prototype, "useNativeValidation", {
2428
- /**
2429
- * Enables or disables the use of native validation. Use this for custom validation.
2430
- * @param useNativeValidation Set this to false to ignore native input validation.
2431
- */
2432
- set: function(e) {
2433
- this.foundation.setUseNativeValidation(e);
2434
- },
2435
- enumerable: !1,
2436
- configurable: !0
2437
- }), Object.defineProperty(t.prototype, "prefixText", {
2438
- /**
2439
- * Gets the text content of the prefix, or null if it does not exist.
2440
- */
2441
- get: function() {
2442
- return this.prefix_ ? this.prefix_.textContent : null;
2443
- },
2444
- /**
2445
- * Sets the text content of the prefix, if it exists.
2446
- */
2447
- set: function(e) {
2448
- this.prefix_ && (this.prefix_.textContent = e);
2449
- },
2450
- enumerable: !1,
2451
- configurable: !0
2452
- }), Object.defineProperty(t.prototype, "suffixText", {
2453
- /**
2454
- * Gets the text content of the suffix, or null if it does not exist.
2455
- */
2456
- get: function() {
2457
- return this.suffix_ ? this.suffix_.textContent : null;
2458
- },
2459
- /**
2460
- * Sets the text content of the suffix, if it exists.
2461
- */
2462
- set: function(e) {
2463
- this.suffix_ && (this.suffix_.textContent = e);
2464
- },
2465
- enumerable: !1,
2466
- configurable: !0
2467
- }), t.prototype.focus = function() {
2468
- this.input_.focus();
2469
- }, t.prototype.layout = function() {
2470
- var e = this.foundation.shouldFloat;
2471
- this.foundation.notchOutline(e);
2472
- }, t.prototype.getDefaultFoundation = function() {
2473
- var e = _(_(_(_(_({}, this.getRootAdapterMethods_()), this.getInputAdapterMethods_()), this.getLabelAdapterMethods_()), this.getLineRippleAdapterMethods_()), this.getOutlineAdapterMethods_());
2474
- return new fn(e, this.getFoundationMap_());
2475
- }, t.prototype.getRootAdapterMethods_ = function() {
2476
- var e = this;
2477
- return {
2478
- addClass: function(n) {
2479
- return e.root.classList.add(n);
2480
- },
2481
- removeClass: function(n) {
2482
- return e.root.classList.remove(n);
2483
- },
2484
- hasClass: function(n) {
2485
- return e.root.classList.contains(n);
2486
- },
2487
- registerTextFieldInteractionHandler: function(n, i) {
2488
- e.listen(n, i);
2489
- },
2490
- deregisterTextFieldInteractionHandler: function(n, i) {
2491
- e.unlisten(n, i);
2492
- },
2493
- registerValidationAttributeChangeHandler: function(n) {
2494
- var i = function(l) {
2495
- return l.map(function(d) {
2496
- return d.attributeName;
2497
- }).filter(function(d) {
2498
- return d;
2499
- });
2500
- }, a = new MutationObserver(function(l) {
2501
- return n(i(l));
2502
- }), u = { attributes: !0 };
2503
- return a.observe(e.input_, u), a;
2504
- },
2505
- deregisterValidationAttributeChangeHandler: function(n) {
2506
- n.disconnect();
2507
- }
2508
- };
2509
- }, t.prototype.getInputAdapterMethods_ = function() {
2510
- var e = this;
2511
- return {
2512
- getNativeInput: function() {
2513
- return e.input_;
2514
- },
2515
- setInputAttr: function(n, i) {
2516
- e.input_.setAttribute(n, i);
2517
- },
2518
- removeInputAttr: function(n) {
2519
- e.input_.removeAttribute(n);
2520
- },
2521
- isFocused: function() {
2522
- return document.activeElement === e.input_;
2523
- },
2524
- registerInputInteractionHandler: function(n, i) {
2525
- e.input_.addEventListener(n, i, Ee());
2526
- },
2527
- deregisterInputInteractionHandler: function(n, i) {
2528
- e.input_.removeEventListener(n, i, Ee());
2529
- }
2530
- };
2531
- }, t.prototype.getLabelAdapterMethods_ = function() {
2532
- var e = this;
2533
- return {
2534
- floatLabel: function(n) {
2535
- return e.label_ && e.label_.float(n);
2536
- },
2537
- getLabelWidth: function() {
2538
- return e.label_ ? e.label_.getWidth() : 0;
2539
- },
2540
- hasLabel: function() {
2541
- return !!e.label_;
2542
- },
2543
- shakeLabel: function(n) {
2544
- return e.label_ && e.label_.shake(n);
2545
- },
2546
- setLabelRequired: function(n) {
2547
- return e.label_ && e.label_.setRequired(n);
2548
- }
2549
- };
2550
- }, t.prototype.getLineRippleAdapterMethods_ = function() {
2551
- var e = this;
2552
- return {
2553
- activateLineRipple: function() {
2554
- e.lineRipple_ && e.lineRipple_.activate();
2555
- },
2556
- deactivateLineRipple: function() {
2557
- e.lineRipple_ && e.lineRipple_.deactivate();
2558
- },
2559
- setLineRippleTransformOrigin: function(n) {
2560
- e.lineRipple_ && e.lineRipple_.setRippleCenter(n);
2561
- }
2562
- };
2563
- }, t.prototype.getOutlineAdapterMethods_ = function() {
2564
- var e = this;
2565
- return {
2566
- closeOutline: function() {
2567
- return e.outline_ && e.outline_.closeNotch();
2568
- },
2569
- hasOutline: function() {
2570
- return !!e.outline_;
2571
- },
2572
- notchOutline: function(n) {
2573
- return e.outline_ && e.outline_.notch(n);
2574
- }
2575
- };
2576
- }, t.prototype.getFoundationMap_ = function() {
2577
- return {
2578
- characterCounter: this.characterCounter_ ? this.characterCounter_.foundationForTextField : void 0,
2579
- helperText: this.helperText_ ? this.helperText_.foundationForTextField : void 0,
2580
- leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundationForTextField : void 0,
2581
- trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundationForTextField : void 0
2582
- };
2583
- }, t.prototype.createRipple_ = function(e) {
2584
- var n = this, i = this.root.classList.contains(Ie.TEXTAREA), a = this.root.classList.contains(Ie.OUTLINED);
2585
- if (i || a)
2586
- return null;
2587
- var u = _(_({}, Le.createAdapter(this)), { isSurfaceActive: function() {
2588
- return Mt(n.input_, ":active");
2589
- }, registerInteractionHandler: function(l, d) {
2590
- return n.input_.addEventListener(l, d, Ee());
2591
- }, deregisterInteractionHandler: function(l, d) {
2592
- return n.input_.removeEventListener(l, d, Ee());
2593
- } });
2594
- return e(this.root, new jt(u));
2595
- }, t;
2596
- }(ee)
2597
- );
2598
- const mn = {
2599
- /**
2600
- *
2601
- *
2602
- * Defaults to **null**.
2603
- */
2604
- activated: r.bool,
2605
- /**
2606
- * The css class name to be passed through to the component markup.
2607
- *
2608
- * Defaults to **undefined**.
2609
- */
2610
- className: r.string,
2611
- /**
2612
- *
2613
- *
2614
- * Defaults to **null**.
2615
- */
2616
- rippleCenter: r.string
2617
- }, bn = {
2618
- activated: null,
2619
- className: void 0,
2620
- rippleCenter: null
2621
- }, Ne = /* @__PURE__ */ Q((o, t) => {
2622
- const {
2623
- activated: e,
2624
- rippleCenter: n,
2625
- className: i,
2626
- ...a
2627
- } = o, u = b(), l = b();
2628
- return J(t, () => l.current, []), v(() => (u.current = gt.attachTo(l.current), () => {
2629
- u.current.destroy();
2630
- }), [l]), v(() => {
2631
- e ? u.current.activate() : u.current.deactivate();
2632
- }, [e]), v(() => {
2633
- n && u.current.setRippleCenter(n);
2634
- }, [n]), /* @__PURE__ */ s.createElement("div", k({
2635
- ref: l,
2636
- className: L("lmnt", "mdc-line-ripple", i)
2637
- }, a));
2638
- });
2639
- Ne.displayName = "LineRipple";
2640
- Ne.propTypes = mn;
2641
- Ne.defaultProps = bn;
2642
- const Re = /* @__PURE__ */ Q((o, t) => {
2643
- const {
2644
- wrap: e,
2645
- children: n
2646
- } = o;
2647
- return e ? /* @__PURE__ */ s.createElement("span", {
2648
- ref: t,
2649
- className: "mdc-text-field__resizer"
2650
- }, n) : n;
2651
- });
2652
- Re.displayName = "TextfieldSpanShim";
2653
- Re.propTypes = {
2654
- children: r.node,
2655
- wrap: r.bool
2656
- };
2657
- Re.defaultProps = {
2658
- children: void 0,
2659
- wrap: !1
2660
- };
2661
- const _n = {
2662
- /**
2663
- * @deprecated _Use `fullWidth` instead._
2664
- *
2665
- * Applies a full-width style where the Textfield will fill its container.
2666
- *
2667
- * Defaults to **undefined**.
2668
- */
2669
- block: z(r.bool, "Textfield", "Use `fullWidth` instead."),
2670
- /**
2671
- * The css class name to be passed through to the component markup.
2672
- *
2673
- * Defaults to **undefined**.
2674
- */
2675
- className: r.string,
2676
- /**
2677
- * @deprecated _See `containerProps`._
2678
- *
2679
- * Add a custom class to the `Textfield` container.
2680
- *
2681
- * Defaults to **undefined**.
2682
- */
2683
- containerClass: z(r.string, "Textfield", "See `containerProps`."),
2684
- /**
2685
- * Properties to be added to the container of the textfield.
2686
- *
2687
- * Defaults to **undefined**.
2688
- */
2689
- containerProps: r.object,
2690
- /**
2691
- * Enables a character count. _Warning_ requires `maxlength` to be set.
2692
- *
2693
- * Defaults to **false**.
2694
- */
2695
- counter: r.bool,
2696
- /**
2697
- * The starting value of the Textfield when working in uncontrolled mode.
2698
- *
2699
- * Defaults to **undefined**.
2700
- */
2701
- defaultValue: r.oneOfType([r.string, r.number]),
2702
- /**
2703
- * The size of the Textfield will be reduced.
2704
- *
2705
- * Defaults to **false**.
2706
- */
2707
- dense: r.bool,
2708
- /**
2709
- * Textfield will be disabled.
2710
- *
2711
- * Defaults to **false**.
2712
- */
2713
- disabled: r.bool,
2714
- /**
2715
- * @deprecated _Use `variant='embedded'_
2716
- *
2717
- * An unfilled, non-outlined and full-width variant of Textfield, intended to be embedded in other components such as TopAppBar or TableHeader.
2718
- *
2719
- * Defaults to **undefined**.
2720
- */
2721
- embedded: z(r.bool, "Textfield", 'Use `variant="embedded"'),
2722
- /**
2723
- * @deprecated _Use variant='filled' instead._
2724
- *
2725
- * Apply filled style to the Textfield. Previously called primary.
2726
- *
2727
- * Defaults to **undefined**.
2728
- */
2729
- filled: z(r.bool, "Textfield", 'Use variant="filled" instead.'),
2730
- /**
2731
- * Sets the Textfield to the focused state.
2732
- *
2733
- * Defaults to **false**.
2734
- */
2735
- focused: r.bool,
2736
- /**
2737
- * The Textfield will expand to 100% width.
2738
- *
2739
- * Defaults to **false**.
2740
- */
2741
- fullWidth: r.bool,
2742
- /**
2743
- * Helper text to be displayed below Textfield, by default only visible on focus.
2744
- *
2745
- * Defaults to **null**.
2746
- */
2747
- helperText: r.node,
2748
- /**
2749
- * Randomly generated id for the helper text container element. May be overwritten.
2750
- *
2751
- * Defaults to **undefined**.
2752
- */
2753
- helperTextId: r.string,
2754
- /**
2755
- * Set the helper text to be permanently visible.
2756
- *
2757
- * Defaults to **false**.
2758
- */
2759
- helperTextPersistent: r.bool,
2760
- /**
2761
- * 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').
2762
- *
2763
- * Defaults to **false**.
2764
- */
2765
- helperTextValidation: r.bool,
2766
- /**
2767
- * Randomly generated id for the input element. May be overwritten.
2768
- *
2769
- * Defaults to **undefined**.
2770
- */
2771
- id: r.string,
2772
- /**
2773
- * 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.
2774
- *
2775
- * Defaults to **null**.
2776
- */
2777
- label: r.string,
2778
- /**
2779
- * Randomly generated id for the label element. May be overwritten.
2780
- *
2781
- * Defaults to **undefined**.
2782
- */
2783
- labelId: r.string,
2784
- /**
2785
- * Custom content to appear before the input.
2786
- *
2787
- * Defaults to **null**.
2788
- */
2789
- leadingContent: r.node,
2790
- /**
2791
- * 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,
2792
- *
2793
- * Defaults to **null**.
2794
- */
2795
- leadingIcon: r.oneOfType([r.string, r.node]),
2796
- /**
2797
- * @deprecated _Use `maxlength` instead. The case of this prop has changed to be more consistent._
2798
- *
2799
- * Restricts the number of characters that can be entered, best used with counter.
2800
- *
2801
- * Defaults to **undefined**.
2802
- */
2803
- maxLength: z(r.number, "Textfield", "Use `maxlength` instead. The case of this prop has changed to be more consistent."),
2804
- /**
2805
- * Restricts the number of characters that can be entered, best used with counter.
2806
- *
2807
- * Defaults to **null**.
2808
- */
2809
- maxlength: wt(r.number, "Textfield", "counter"),
2810
- /**
2811
- * Prevents resizing when using `textarea`.
2812
- *
2813
- * Defaults to **true**.
2814
- */
2815
- noResize: r.bool,
2816
- /**
2817
- * Fired when focus leaves the input.
2818
- *
2819
- * Defaults to **null**.
2820
- */
2821
- onBlur: r.func,
2822
- /**
2823
- * Fired when each character is entered into the Textfield.
2824
- *
2825
- * Defaults to **null**.
2826
- */
2827
- onChange: r.func,
2828
- /**
2829
- * Fired when the input gains focus.
2830
- *
2831
- * Defaults to **null**.
2832
- */
2833
- onFocus: r.func,
2834
- /**
2835
- * @deprecated _Use `variant='outlined'` instead_
2836
- *
2837
- * Apply outlined style to the Textfield. Previously called secondary.
2838
- *
2839
- * Defaults to **undefined**.
2840
- */
2841
- outlined: z(r.bool, "Textfield", 'Use `variant="outlined"` instead'),
2842
- /**
2843
- * Non-floating label text, will be replaced when the user starts typing.
2844
- *
2845
- * Defaults to **null**.
2846
- */
2847
- placeholder: r.string,
2848
- /**
2849
- * 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`.
2850
- *
2851
- * Defaults to **null**.
2852
- */
2853
- prefixText: r.string,
2854
- /**
2855
- * @deprecated _This feature is no longer supported. Use `variant='filled'` instead._
2856
- *
2857
- * Enable filled styling.
2858
- *
2859
- * Defaults to **undefined**.
2860
- */
2861
- primary: z(r.bool, "Textfield", 'This feature is no longer supported. Use `variant="filled"` instead.'),
2862
- /**
2863
- * @deprecated _Use `variant='embedded'`_
2864
- *
2865
- * Enabled search bar styling, including a full width style.
2866
- *
2867
- * Defaults to **undefined**.
2868
- */
2869
- search: z(r.bool, "Textfield", 'Use `variant="embedded"`'),
2870
- /**
2871
- * @deprecated _Use `variant='outlined'` instead._
2872
- *
2873
- * Apply secondary style to the Textfield.
2874
- *
2875
- * Defaults to **undefined**.
2876
- */
2877
- secondary: z(r.bool, "Textfield", 'Use `variant="outlined"` instead.'),
2878
- /**
2879
- * 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`.
2880
- *
2881
- * Defaults to **null**.
2882
- */
2883
- suffixText: r.string,
2884
- /**
2885
- * Enabled multi-line text input. _Note_ `textarea` cannot be used with the embedded variant.
2886
- *
2887
- * Defaults to **false**.
2888
- */
2889
- textarea: r.bool,
2890
- /**
2891
- * 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.
2892
- *
2893
- * Defaults to **null**.
2894
- */
2895
- tooltip: r.oneOfType([r.bool, r.object]),
2896
- /**
2897
- * Custom content to appear after the input.
2898
- *
2899
- * Defaults to **null**.
2900
- */
2901
- trailingContent: r.node,
2902
- /**
2903
- * 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.
2904
- *
2905
- * Defaults to **null**.
2906
- */
2907
- trailingIcon: r.oneOfType([r.string, r.node]),
2908
- /**
2909
- * 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.
2910
- *
2911
- * Defaults to **'text'**.
2912
- */
2913
- type: r.oneOf(["text", "password", "color", "email", "url", "number", "tel", "search", "datetime-local", "month", "time", "week", "date"]),
2914
- /**
2915
- * Applies an invalid style to the Textfield.
2916
- *
2917
- * Defaults to **true**.
2918
- */
2919
- valid: r.bool,
2920
- /**
2921
- * The current value of the Textfield component.
2922
- *
2923
- * Defaults to **undefined**.
2924
- */
2925
- value: r.oneOfType([r.string, r.number]),
2926
- /**
2927
- * Applies the selected styling to the Textfield. _Note_ `textarea` does not support the `embedded` variant.
2928
- *
2929
- * Defaults to **'filled'**.
2930
- */
2931
- variant: r.oneOf(["filled", "outlined", "embedded"])
2932
- }, vn = {
2933
- block: void 0,
2934
- className: void 0,
2935
- containerClass: void 0,
2936
- containerProps: void 0,
2937
- counter: !1,
2938
- defaultValue: void 0,
2939
- dense: !1,
2940
- disabled: !1,
2941
- embedded: void 0,
2942
- filled: void 0,
2943
- focused: !1,
2944
- fullWidth: !1,
2945
- helperText: null,
2946
- helperTextId: void 0,
2947
- helperTextPersistent: !1,
2948
- helperTextValidation: !1,
2949
- id: void 0,
2950
- label: null,
2951
- labelId: void 0,
2952
- leadingContent: null,
2953
- leadingIcon: null,
2954
- maxLength: void 0,
2955
- maxlength: null,
2956
- noResize: !0,
2957
- outlined: void 0,
2958
- placeholder: null,
2959
- prefixText: null,
2960
- primary: void 0,
2961
- search: void 0,
2962
- secondary: void 0,
2963
- suffixText: null,
2964
- textarea: !1,
2965
- tooltip: null,
2966
- trailingContent: null,
2967
- trailingIcon: null,
2968
- type: "text",
2969
- valid: !0,
2970
- value: void 0,
2971
- variant: "filled"
2972
- }, dt = (o, t) => o ? /* @__PURE__ */ s.createElement("div", {
2973
- className: "mdc-text-field-character-counter"
2974
- }, "0 / ", t) : null, yn = (o) => {
2975
- const {
2976
- type: t
2977
- } = {
2978
- ...o
2979
- }, {
2980
- displayName: e
2981
- } = {
2982
- ...t
2983
- };
2984
- return typeof o == "string" ? /* @__PURE__ */ s.createElement(Ue, {
2985
- role: "button",
2986
- className: "mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--leading",
2987
- icon: o
2988
- }) : fe(o, {
2989
- className: L("mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--leading", e === "IconButton" && "lmnt-text-field__icon-button--leading"),
2990
- dense: e === "IconButton" ? !0 : void 0,
2991
- role: "button"
2992
- });
2993
- }, Tn = (o) => {
2994
- const {
2995
- type: t
2996
- } = {
2997
- ...o
2998
- }, {
2999
- displayName: e
3000
- } = {
3001
- ...t
3002
- };
3003
- return typeof o == "string" ? /* @__PURE__ */ s.createElement(Ue, {
3004
- className: "mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--trailing",
3005
- icon: o
3006
- }) : fe(o, {
3007
- className: L("mdc-text-field__icon lmnt-text-field__icon mdc-text-field__icon--trailing", e === "IconButton" && "lmnt-text-field__icon-button--trailing"),
3008
- dense: e === "IconButton" ? !0 : void 0,
3009
- role: e === "IconButton" ? "button" : null
3010
- });
3011
- }, Pe = /* @__PURE__ */ Q((o, t) => {
3012
- const {
3013
- block: e,
3014
- className: n,
3015
- containerClass: i,
3016
- containerProps: a,
3017
- containerStyle: u,
3018
- counter: l,
3019
- defaultValue: d,
3020
- dense: C,
3021
- disabled: E,
3022
- embedded: O,
3023
- filled: te,
3024
- focused: P,
3025
- fullWidth: H,
3026
- helperText: g,
3027
- helperTextId: x,
3028
- helperTextPersistent: y,
3029
- helperTextValidation: F,
3030
- id: W,
3031
- label: p,
3032
- labelId: M,
3033
- leadingContent: h,
3034
- leadingIcon: G,
3035
- maxLength: j,
3036
- maxlength: f,
3037
- noResize: m,
3038
- onBlur: I,
3039
- outlined: ae,
3040
- placeholder: Fe,
3041
- prefixText: c,
3042
- primary: N = null,
3043
- search: R,
3044
- secondary: $,
3045
- suffixText: We,
3046
- textarea: D,
3047
- tooltip: V,
3048
- trailingContent: Et,
3049
- trailingIcon: pe,
3050
- type: Ge,
3051
- valid: le,
3052
- value: X,
3053
- variant: De,
3054
- ...Ct
3055
- } = o, {
3056
- hoisted: It,
3057
- position: $e = "bottom"
3058
- } = V && typeof V == "object" ? V : {}, [ve] = Y(() => W || me()), [Se] = Y(() => x || me()), [He] = Y(() => M || me()), [Xe, Lt] = Y(!0), [Ve, At] = Y(!1), [ne, Ot] = Y(f), xt = g || l && ne, Nt = D ? "textarea" : "input", Rt = b(), ze = b(), ie = b(), S = b(), Be = b(), Ke = b(), Ye = b(), ye = b(), he = b(), Pt = (pe || G) && !D, se = je(() => le ?? !0, [le]), ue = !D && (O || R || De === "embedded"), we = !O && (ae || $ || De === "outlined"), Te = !we && !ue && (N || te || De === "filled"), ge = ue || H || e, ke = !ue && !!p && !C;
3059
- v(() => (S.current = gn.attachTo(Be.current), () => {
3060
- S.current.destroy();
3061
- }), [Ve]), J(t, () => ({
3062
- mdc: S.current,
3063
- input: Ke.current,
3064
- container: Ye.current,
3065
- label: Be.current
3066
- })), v(() => (g && typeof g == "string" && (ie.current = new Tt(ze.current)), () => {
3067
- ie.current && ie.current.destroy();
3068
- }), [g]), v(() => {
3069
- if (g) {
3070
- var T, B, U, de;
3071
- (T = ie.current) === null || T === void 0 || T.foundation.setValidation(F), (B = ie.current) === null || B === void 0 || B.foundation.setValidity(se), (U = ie.current) === null || U === void 0 || U.foundation.setPersistent(y), (de = ie.current) === null || de === void 0 || de.foundation.setContent(g);
3072
- }
3073
- }, [g, y, F, se]), v(() => {
3074
- d || (S.current.value = X || X === 0 ? X : ""), S.current.valid = se;
3075
- }, [S, X, se, d]), v(() => {
3076
- S.current.disabled = E;
3077
- }, [S, E]), v(() => {
3078
- Ot(j && !f ? j : f);
3079
- }, [f, j]), v(() => {
3080
- At(ne > 0 && l);
3081
- }, [ne, l]), v(() => {
3082
- Lt(ge || l || g);
3083
- }, [ge, l, g]);
3084
- const Ft = () => {
3085
- le !== void 0 && X !== null && (S.current.valid = le);
3086
- }, Dt = (T) => {
3087
- I && I(T), Ft();
3088
- }, Qe = () => {
3089
- S.current.value = "", S.current.valid = se;
3090
- };
3091
- v(() => (window.addEventListener("reset", Qe), () => {
3092
- window.removeEventListener("reset", Qe);
3093
- }), []), v(() => {
3094
- if (V) {
3095
- const T = [{
3096
- name: "flip",
3097
- options: {
3098
- enabled: !0,
3099
- padding: {
3100
- bottom: 32,
3101
- top: 32
3102
- }
3103
- }
3104
- }, {
3105
- name: "offset",
3106
- options: {
3107
- offset: [0, 12]
3108
- }
3109
- }];
3110
- he.current = ct(Rt.current, ye.current, {
3111
- placement: $e,
3112
- modifiers: T
3113
- });
3114
- }
3115
- return () => {
3116
- var T;
3117
- (T = he.current) === null || T === void 0 || T.destroy();
3118
- };
3119
- }, [$e, It, V]);
3120
- const Je = oe(() => {
3121
- if (X) {
3122
- const de = S.current.input_;
3123
- if (de.offsetWidth < de.scrollWidth) {
3124
- var T, B, U;
3125
- (T = ye.current) === null || T === void 0 || T.setAttribute("data-show", ""), (B = he.current) === null || B === void 0 || B.setOptions((et) => ({
3126
- ...et,
3127
- modifiers: [...et.modifiers, {
3128
- name: "eventListeners",
3129
- enabled: !0
3130
- }]
3131
- })), (U = he.current) === null || U === void 0 || U.update();
3132
- }
3133
- }
3134
- }, [X]), Ze = oe(() => {
3135
- var T, B;
3136
- (T = ye.current) === null || T === void 0 || T.removeAttribute("data-show"), (B = he.current) === null || B === void 0 || B.setOptions((U) => ({
3137
- ...U,
3138
- modifiers: [...U.modifiers, {
3139
- name: "eventListeners",
3140
- enabled: !1
3141
- }]
3142
- }));
3143
- }, []);
3144
- return /* @__PURE__ */ s.createElement("div", k({
3145
- ref: Ye,
3146
- style: u,
3147
- className: L("lmnt", "lmnt-text-field--container", ge && "lmnt-text-field--container-full-width", !ge && Xe && "lmnt-text-field--container-to-content-width", !Xe && "lmnt-text-field-inline-container", i)
3148
- }, a, {
3149
- onMouseEnter: V && Je,
3150
- onFocus: V && Je,
3151
- onMouseLeave: V && Ze,
3152
- onBlur: V && Ze
3153
- }), h, /* @__PURE__ */ s.createElement("label", {
3154
- htmlFor: ve,
3155
- ref: Be,
3156
- className: L(["lmnt", "mdc-text-field", "lmnt-text-field", ue && "lmnt-text-field--embedded", ge && "lmnt-text-field--full-width", Pt && "lmnt-text-field--with-icon", !se && "mdc-text-field--invalid", E && "mdc-text-field--disabled", P && "mdc-text-field--focused", !ke && "mdc-text-field--no-label", G && !D && "mdc-text-field--with-leading-icon", D && "mdc-text-field--textarea", D && l && ne && !m && "mdc-text-field--with-internal-counter", pe && !D && "mdc-text-field--with-trailing-icon", Te && "mdc-text-field--filled", we && "mdc-text-field--outlined", C && "lmnt-text-field--dense", n])
3157
- }, Te && /* @__PURE__ */ s.createElement("span", {
3158
- className: "mdc-text-field__ripple"
3159
- }), G && !D && yn(G), c && !G && !D && /* @__PURE__ */ s.createElement("span", {
3160
- className: "mdc-text-field__affix mdc-text-field__affix--prefix"
3161
- }, c), /* @__PURE__ */ s.createElement(Re, {
3162
- wrap: !m && D
3163
- }, /* @__PURE__ */ s.createElement(Nt, k({
3164
- "aria-controls": Se,
3165
- "aria-describedby": Se,
3166
- "aria-labelledby": He,
3167
- className: L("mdc-text-field__input", Ge === "color" && "lmnt-text-field__input--color"),
3168
- disabled: E,
3169
- id: ve,
3170
- type: Ge,
3171
- onBlur: Dt,
3172
- defaultValue: d,
3173
- placeholder: Fe || (ue && p ? p : "") || (C && p ? p : ""),
3174
- maxLength: ne,
3175
- ref: Ke,
3176
- value: X
3177
- }, Ct)), !m && dt(Ve, ne)), pe && !D && Tn(pe), We && !pe && !D && /* @__PURE__ */ s.createElement("span", {
3178
- className: "mdc-text-field__affix mdc-text-field__affix--suffix"
3179
- }, We), we && /* @__PURE__ */ s.createElement(xe, null, ke && /* @__PURE__ */ s.createElement(be, {
3180
- id: He,
3181
- htmlFor: ve
3182
- }, p)), Te && ke && /* @__PURE__ */ s.createElement(be, {
3183
- id: He,
3184
- htmlFor: ve
3185
- }, p), (Te || ue) && /* @__PURE__ */ s.createElement(Ne, null)), Et, xt && /* @__PURE__ */ s.createElement("div", {
3186
- className: "mdc-text-field-helper-line"
3187
- }, g && /* @__PURE__ */ s.createElement("div", {
3188
- ref: ze,
3189
- id: Se,
3190
- "aria-hidden": y ? "false" : "true",
3191
- className: L(["mdc-text-field-helper-text", y && "mdc-text-field-helper-text--persistent", F && "mdc-text-field-helper-text--validation-msg"])
3192
- }, g), m && dt(Ve, ne)), V && /* @__PURE__ */ s.createElement(_e, k({
3193
- role: "tooltip"
3194
- }, V, {
3195
- ref: ye,
3196
- text: X
3197
- })));
3198
- });
3199
- Pe.displayName = "Textfield";
3200
- Pe.propTypes = _n;
3201
- Pe.defaultProps = vn;
3202
- const En = "_searchbar_gnvwc_1", Cn = {
3203
- searchbar: En
3204
- }, Fn = ({
3205
- className: o = "",
3206
- dense: t = !1,
3207
- searchTerm: e,
3208
- setSearchTerm: n,
3209
- placeholder: i
3210
- }) => /* @__PURE__ */ tt(
3211
- Pe,
3212
- {
3213
- className: `${o ?? ""} ${Cn.searchbar}`,
3214
- dense: t,
3215
- variant: "outlined",
3216
- placeholder: i,
3217
- value: e,
3218
- onChange: (a) => n(a.target.value),
3219
- fullWidth: !0,
3220
- trailingIcon: /* @__PURE__ */ tt(
3221
- Ae,
3222
- {
3223
- icon: e ? "close" : "search",
3224
- onClick: () => e ? n("") : void 0
3225
- }
3226
- )
3227
- }
3228
- );
3229
- export {
3230
- Jt as P,
3231
- Fn as S
3232
- };