@hortiview/default-components 1.4.4 → 1.5.1

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 (51) hide show
  1. package/README.md +51 -0
  2. package/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.d.ts +11 -0
  3. package/dist/components/DefaultAllowedComponent/DefaultAllowedComponent.js +11 -0
  4. package/dist/components/DefaultFormNumber/DefaultFormNumber.js +12 -1496
  5. package/dist/components/DefaultFormSelect/DefaultFormSelect.js +9 -178
  6. package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +6 -6
  7. package/dist/components/GenericTable/GenericTable.js +12 -18731
  8. package/dist/components/HealthChecks/DataBaseHealthCheck.js +2 -2
  9. package/dist/components/HealthChecks/DefaultHealthCheck.js +4 -4
  10. package/dist/components/HealthChecks/IotServiceHealthCheck.js +5 -5
  11. package/dist/components/HealthChecks/PlatformHealthCheck.js +4 -4
  12. package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +9 -9
  13. package/dist/components/InternationalizationWrapper/InternationalizationWrapper.js +4 -4
  14. package/dist/components/OfflineView/OfflineView.js +9 -9
  15. package/dist/i18n.js +1696 -5
  16. package/dist/{i18nInstance-D_96ADqd.js → i18nInstance-CYqpK5II.js} +2 -2
  17. package/dist/locales/en-US.js +16 -14
  18. package/dist/locales/en-US.json.d.ts +3 -0
  19. package/dist/locales/es-MX.js +16 -14
  20. package/dist/locales/es-MX.json.d.ts +3 -0
  21. package/dist/locales/tr-TR.js +17 -15
  22. package/dist/locales/tr-TR.json.d.ts +3 -0
  23. package/dist/main.d.ts +1 -0
  24. package/dist/main.js +24 -22
  25. package/dist/useTranslation-DGtUf8nl.js +101 -0
  26. package/package.json +3 -32
  27. package/dist/Iconify-aUog1Oez.js +0 -83
  28. package/dist/InfoCard-BxjAQiFE.js +0 -58
  29. package/dist/LoadingSpinner-DBMjIfY1.js +0 -502
  30. package/dist/OfflineView-NUM9WE0F-BI9rnget.js +0 -46
  31. package/dist/assets/DefaultFormNumber.css +0 -1
  32. package/dist/assets/DefaultFormSelect.css +0 -1
  33. package/dist/assets/GenericTable.css +0 -1
  34. package/dist/assets/Iconify.css +0 -1
  35. package/dist/assets/InfoCard.css +0 -1
  36. package/dist/assets/LoadingSpinner.css +0 -1
  37. package/dist/assets/OfflineView-NUM9WE0F.css +0 -1
  38. package/dist/component-DsB0poTj-DgsYK0_R.js +0 -570
  39. package/dist/correct-is-regexp-logic-BBlm4UpN-CvII841s.js +0 -493
  40. package/dist/i18n-CCQpJsQK.js +0 -1707
  41. package/dist/index.es-B0QNuIUR-Bte5aF5M.js +0 -360
  42. package/dist/index.es-CIsLNz4j-ZEEcPmTs.js +0 -79
  43. package/dist/index.es-CvHDFF6V-CjZvA03R.js +0 -2004
  44. package/dist/index.es-DiONypF4-eT98Y3u_.js +0 -844
  45. package/dist/index.es-DnEIFMjv-DuuORGfo.js +0 -1044
  46. package/dist/index.es-NEYPxnlS-C8xQv2De.js +0 -860
  47. package/dist/index.es-fV9oWpEf-BXuhoGtE.js +0 -14374
  48. package/dist/isTypedArray-Dw_IY7Zq-wj3MphCb.js +0 -210
  49. package/dist/slicedToArray-h0Nnkd_P-C4SkVJMK.js +0 -432
  50. package/dist/useHelperText-B7OMZXvE.js +0 -391
  51. package/dist/useTranslation-B_lNCuLm.js +0 -5343
@@ -1,844 +0,0 @@
1
- import { P as wt, ap as st, aq as $t, t as i, ar as jt, ao as qt, F as Mt, N as Ut, r as $, h as A, e as W, g as Et, k as j, m as Nt, l as w, o as Ct, as as Gt, L as Kt, i as lt, at as Xt, B as Qt, Z as ct, c as Vt, p as ut, f as Zt, v as zt, s as _t, X as Jt, a as dt, b as Yt } from "./useTranslation-B_lNCuLm.js";
2
- import p, { forwardRef as F, useState as Z, useRef as E, useImperativeHandle as S, useEffect as O, useMemo as Ot, useCallback as H, Fragment as ft } from "react";
3
- import { D as te } from "./component-DsB0poTj-DgsYK0_R.js";
4
- import { I as ee, C as ne, X as oe, F as re, p as ie, S as z } from "./slicedToArray-h0Nnkd_P-C4SkVJMK.js";
5
- import ae from "react-dom";
6
- function se(t) {
7
- if (ne(t)) return oe(t);
8
- }
9
- function le(t) {
10
- if (typeof wt < "u" && re(t) != null || t["@@iterator"] != null) return ie(t);
11
- }
12
- function ce() {
13
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
15
- }
16
- function pt(t) {
17
- return se(t) || le(t) || ee(t) || ce();
18
- }
19
- var ue = {
20
- /**
21
- * Content to be rendered inside the portal.
22
- *
23
- * Defaults to **null**.
24
- */
25
- children: i.node,
26
- /**
27
- * Disables the portal to rendering children in the natural flow of the DOM.
28
- *
29
- * Defaults to **false**.
30
- */
31
- disabled: i.bool,
32
- /**
33
- * 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`.
34
- *
35
- * Defaults to **'document.body'**.
36
- */
37
- portalContainer: i.oneOfType([i.string, i.node])
38
- }, de = {
39
- children: null,
40
- disabled: !1
41
- }, M = de, J = /* @__PURE__ */ F(function(t, e) {
42
- var n = t.children, o = n === void 0 ? M.children : n, r = t.container, a = r === void 0 ? M.container : r, u = t.disabled, l = u === void 0 ? M.disabled : u, d = Z(st() ? document.body : null), h = z(d, 2), m = h[0], v = h[1], y = E();
43
- return S(e, function() {
44
- return y.current;
45
- }, []), O(function() {
46
- var s = st() ? document.body : null;
47
- if (typeof a == "string")
48
- if (a === "document.body")
49
- v(s);
50
- else {
51
- var f = $t(a);
52
- v(f || s);
53
- }
54
- else
55
- v(a || s);
56
- }, [a]), // eslint-disable-next-line react/jsx-no-useless-fragment
57
- /* @__PURE__ */ p.createElement(p.Fragment, null, l || !m ? o : /* @__PURE__ */ ae.createPortal(o, m));
58
- });
59
- J.displayName = "Portal";
60
- J.propTypes = ue;
61
- var fe = /* @__PURE__ */ p.memo(J), U, ht;
62
- function pe() {
63
- if (ht) return U;
64
- ht = 1;
65
- function t(e, n) {
66
- for (var o = -1, r = e == null ? 0 : e.length, a = Array(r); ++o < r; )
67
- a[o] = n(e[o], o, e);
68
- return a;
69
- }
70
- return U = t, U;
71
- }
72
- var G, mt;
73
- function he() {
74
- if (mt) return G;
75
- mt = 1;
76
- var t = Mt(), e = Ut(), n = "[object Symbol]";
77
- function o(r) {
78
- return typeof r == "symbol" || e(r) && t(r) == n;
79
- }
80
- return G = o, G;
81
- }
82
- var K, vt;
83
- function me() {
84
- if (vt) return K;
85
- vt = 1;
86
- var t = jt(), e = pe(), n = qt(), o = he(), r = t ? t.prototype : void 0, a = r ? r.toString : void 0;
87
- function u(l) {
88
- if (typeof l == "string")
89
- return l;
90
- if (n(l))
91
- return e(l, u) + "";
92
- if (o(l))
93
- return a ? a.call(l) : "";
94
- var d = l + "";
95
- return d == "0" && 1 / l == -1 / 0 ? "-0" : d;
96
- }
97
- return K = u, K;
98
- }
99
- var X, yt;
100
- function Se() {
101
- if (yt) return X;
102
- yt = 1;
103
- var t = me();
104
- function e(n) {
105
- return n == null ? "" : t(n);
106
- }
107
- return X = e, X;
108
- }
109
- /**
110
- * @license
111
- * Copyright 2016 Google Inc.
112
- *
113
- * Permission is hereby granted, free of charge, to any person obtaining a copy
114
- * of this software and associated documentation files (the "Software"), to deal
115
- * in the Software without restriction, including without limitation the rights
116
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117
- * copies of the Software, and to permit persons to whom the Software is
118
- * furnished to do so, subject to the following conditions:
119
- *
120
- * The above copyright notice and this permission notice shall be included in
121
- * all copies or substantial portions of the Software.
122
- *
123
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
129
- * THE SOFTWARE.
130
- */
131
- var ve = {
132
- LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
133
- LABEL_REQUIRED: "mdc-floating-label--required",
134
- LABEL_SHAKE: "mdc-floating-label--shake",
135
- ROOT: "mdc-floating-label"
136
- };
137
- /**
138
- * @license
139
- * Copyright 2016 Google Inc.
140
- *
141
- * Permission is hereby granted, free of charge, to any person obtaining a copy
142
- * of this software and associated documentation files (the "Software"), to deal
143
- * in the Software without restriction, including without limitation the rights
144
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
- * copies of the Software, and to permit persons to whom the Software is
146
- * furnished to do so, subject to the following conditions:
147
- *
148
- * The above copyright notice and this permission notice shall be included in
149
- * all copies or substantial portions of the Software.
150
- *
151
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
157
- * THE SOFTWARE.
158
- */
159
- var Tt = (
160
- /** @class */
161
- function(t) {
162
- j(e, t);
163
- function e(n) {
164
- var o = t.call(this, w(w({}, e.defaultAdapter), n)) || this;
165
- return o.shakeAnimationEndHandler_ = function() {
166
- return o.handleShakeAnimationEnd_();
167
- }, o;
168
- }
169
- return Object.defineProperty(e, "cssClasses", {
170
- get: function() {
171
- return ve;
172
- },
173
- enumerable: !1,
174
- configurable: !0
175
- }), Object.defineProperty(e, "defaultAdapter", {
176
- /**
177
- * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.
178
- */
179
- get: function() {
180
- return {
181
- addClass: function() {
182
- },
183
- removeClass: function() {
184
- },
185
- getWidth: function() {
186
- return 0;
187
- },
188
- registerInteractionHandler: function() {
189
- },
190
- deregisterInteractionHandler: function() {
191
- }
192
- };
193
- },
194
- enumerable: !1,
195
- configurable: !0
196
- }), e.prototype.init = function() {
197
- this.adapter.registerInteractionHandler("animationend", this.shakeAnimationEndHandler_);
198
- }, e.prototype.destroy = function() {
199
- this.adapter.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
200
- }, e.prototype.getWidth = function() {
201
- return this.adapter.getWidth();
202
- }, e.prototype.shake = function(n) {
203
- var o = e.cssClasses.LABEL_SHAKE;
204
- n ? this.adapter.addClass(o) : this.adapter.removeClass(o);
205
- }, e.prototype.float = function(n) {
206
- var o = e.cssClasses, r = o.LABEL_FLOAT_ABOVE, a = o.LABEL_SHAKE;
207
- n ? this.adapter.addClass(r) : (this.adapter.removeClass(r), this.adapter.removeClass(a));
208
- }, e.prototype.setRequired = function(n) {
209
- var o = e.cssClasses.LABEL_REQUIRED;
210
- n ? this.adapter.addClass(o) : this.adapter.removeClass(o);
211
- }, e.prototype.handleShakeAnimationEnd_ = function() {
212
- var n = e.cssClasses.LABEL_SHAKE;
213
- this.adapter.removeClass(n);
214
- }, e;
215
- }(Ct)
216
- );
217
- /**
218
- * @license
219
- * Copyright 2016 Google Inc.
220
- *
221
- * Permission is hereby granted, free of charge, to any person obtaining a copy
222
- * of this software and associated documentation files (the "Software"), to deal
223
- * in the Software without restriction, including without limitation the rights
224
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
225
- * copies of the Software, and to permit persons to whom the Software is
226
- * furnished to do so, subject to the following conditions:
227
- *
228
- * The above copyright notice and this permission notice shall be included in
229
- * all copies or substantial portions of the Software.
230
- *
231
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
232
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
233
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
234
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
235
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
236
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
237
- * THE SOFTWARE.
238
- */
239
- var ye = (
240
- /** @class */
241
- function(t) {
242
- j(e, t);
243
- function e() {
244
- return t !== null && t.apply(this, arguments) || this;
245
- }
246
- return e.attachTo = function(n) {
247
- return new e(n);
248
- }, e.prototype.shake = function(n) {
249
- this.foundation.shake(n);
250
- }, e.prototype.float = function(n) {
251
- this.foundation.float(n);
252
- }, e.prototype.setRequired = function(n) {
253
- this.foundation.setRequired(n);
254
- }, e.prototype.getWidth = function() {
255
- return this.foundation.getWidth();
256
- }, e.prototype.getDefaultFoundation = function() {
257
- var n = this, o = {
258
- addClass: function(r) {
259
- return n.root.classList.add(r);
260
- },
261
- removeClass: function(r) {
262
- return n.root.classList.remove(r);
263
- },
264
- getWidth: function() {
265
- return te(n.root);
266
- },
267
- registerInteractionHandler: function(r, a) {
268
- return n.listen(r, a);
269
- },
270
- deregisterInteractionHandler: function(r, a) {
271
- return n.unlisten(r, a);
272
- }
273
- };
274
- return new Tt(o);
275
- }, e;
276
- }(Nt)
277
- );
278
- /**
279
- * @license
280
- * Copyright 2018 Google Inc.
281
- *
282
- * Permission is hereby granted, free of charge, to any person obtaining a copy
283
- * of this software and associated documentation files (the "Software"), to deal
284
- * in the Software without restriction, including without limitation the rights
285
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
286
- * copies of the Software, and to permit persons to whom the Software is
287
- * furnished to do so, subject to the following conditions:
288
- *
289
- * The above copyright notice and this permission notice shall be included in
290
- * all copies or substantial portions of the Software.
291
- *
292
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
293
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
294
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
295
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
296
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
297
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
298
- * THE SOFTWARE.
299
- */
300
- var Lt = {
301
- NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
302
- }, bt = {
303
- // This should stay in sync with $mdc-notched-outline-padding * 2.
304
- NOTCH_ELEMENT_PADDING: 8
305
- }, V = {
306
- NO_LABEL: "mdc-notched-outline--no-label",
307
- OUTLINE_NOTCHED: "mdc-notched-outline--notched",
308
- OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
309
- };
310
- /**
311
- * @license
312
- * Copyright 2017 Google Inc.
313
- *
314
- * Permission is hereby granted, free of charge, to any person obtaining a copy
315
- * of this software and associated documentation files (the "Software"), to deal
316
- * in the Software without restriction, including without limitation the rights
317
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
318
- * copies of the Software, and to permit persons to whom the Software is
319
- * furnished to do so, subject to the following conditions:
320
- *
321
- * The above copyright notice and this permission notice shall be included in
322
- * all copies or substantial portions of the Software.
323
- *
324
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
325
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
326
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
327
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
328
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
329
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
330
- * THE SOFTWARE.
331
- */
332
- var be = (
333
- /** @class */
334
- function(t) {
335
- j(e, t);
336
- function e(n) {
337
- return t.call(this, w(w({}, e.defaultAdapter), n)) || this;
338
- }
339
- return Object.defineProperty(e, "strings", {
340
- get: function() {
341
- return Lt;
342
- },
343
- enumerable: !1,
344
- configurable: !0
345
- }), Object.defineProperty(e, "cssClasses", {
346
- get: function() {
347
- return V;
348
- },
349
- enumerable: !1,
350
- configurable: !0
351
- }), Object.defineProperty(e, "numbers", {
352
- get: function() {
353
- return bt;
354
- },
355
- enumerable: !1,
356
- configurable: !0
357
- }), Object.defineProperty(e, "defaultAdapter", {
358
- /**
359
- * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.
360
- */
361
- get: function() {
362
- return {
363
- addClass: function() {
364
- },
365
- removeClass: function() {
366
- },
367
- setNotchWidthProperty: function() {
368
- },
369
- removeNotchWidthProperty: function() {
370
- }
371
- };
372
- },
373
- enumerable: !1,
374
- configurable: !0
375
- }), e.prototype.notch = function(n) {
376
- var o = e.cssClasses.OUTLINE_NOTCHED;
377
- n > 0 && (n += bt.NOTCH_ELEMENT_PADDING), this.adapter.setNotchWidthProperty(n), this.adapter.addClass(o);
378
- }, e.prototype.closeNotch = function() {
379
- var n = e.cssClasses.OUTLINE_NOTCHED;
380
- this.adapter.removeClass(n), this.adapter.removeNotchWidthProperty();
381
- }, e;
382
- }(Ct)
383
- );
384
- /**
385
- * @license
386
- * Copyright 2017 Google Inc.
387
- *
388
- * Permission is hereby granted, free of charge, to any person obtaining a copy
389
- * of this software and associated documentation files (the "Software"), to deal
390
- * in the Software without restriction, including without limitation the rights
391
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
392
- * copies of the Software, and to permit persons to whom the Software is
393
- * furnished to do so, subject to the following conditions:
394
- *
395
- * The above copyright notice and this permission notice shall be included in
396
- * all copies or substantial portions of the Software.
397
- *
398
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
399
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
400
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
401
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
402
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
403
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
404
- * THE SOFTWARE.
405
- */
406
- var ge = (
407
- /** @class */
408
- function(t) {
409
- j(e, t);
410
- function e() {
411
- return t !== null && t.apply(this, arguments) || this;
412
- }
413
- return e.attachTo = function(n) {
414
- return new e(n);
415
- }, e.prototype.initialSyncWithDOM = function() {
416
- this.notchElement_ = this.root.querySelector(Lt.NOTCH_ELEMENT_SELECTOR);
417
- var n = this.root.querySelector("." + Tt.cssClasses.ROOT);
418
- n ? (n.style.transitionDuration = "0s", this.root.classList.add(V.OUTLINE_UPGRADED), requestAnimationFrame(function() {
419
- n.style.transitionDuration = "";
420
- })) : this.root.classList.add(V.NO_LABEL);
421
- }, e.prototype.notch = function(n) {
422
- this.foundation.notch(n);
423
- }, e.prototype.closeNotch = function() {
424
- this.foundation.closeNotch();
425
- }, e.prototype.getDefaultFoundation = function() {
426
- var n = this, o = {
427
- addClass: function(r) {
428
- return n.root.classList.add(r);
429
- },
430
- removeClass: function(r) {
431
- return n.root.classList.remove(r);
432
- },
433
- setNotchWidthProperty: function(r) {
434
- return n.notchElement_.style.setProperty("width", r + "px");
435
- },
436
- removeNotchWidthProperty: function() {
437
- return n.notchElement_.style.removeProperty("width");
438
- }
439
- };
440
- return new be(o);
441
- }, e;
442
- }(Nt)
443
- ), Ee = {
444
- /**
445
- * Content to be rendered inside the label. Expects a string, though accepts any valid markup.
446
- *
447
- * Defaults to **null**.
448
- */
449
- children: i.node.isRequired,
450
- /**
451
- * The css class name to be passed through to the component markup.
452
- *
453
- * Defaults to **undefined**.
454
- */
455
- className: i.string,
456
- /**
457
- * The label will appear in the floating state.
458
- *
459
- * Defaults to **false**.
460
- */
461
- float: i.bool,
462
- /**
463
- * The id of the component to trigger on active
464
- *
465
- * Defaults to **empty string**.
466
- */
467
- htmlFor: i.string,
468
- /**
469
- * The label will shake briefly when set.
470
- *
471
- * Defaults to **false**.
472
- */
473
- shake: i.bool
474
- }, Ne = {
475
- children: null,
476
- className: void 0
477
- }, Ce = ["children", "htmlFor", "shake", "float", "className", "style"], Q = Ne, Pt = /* @__PURE__ */ F(function(t, e) {
478
- var n = t.children, o = n === void 0 ? Q.children : n, r = t.htmlFor, a = r === void 0 ? "" : r, u = t.shake, l = u === void 0 ? !1 : u, d = t.float, h = d === void 0 ? !1 : d, m = t.className, v = m === void 0 ? Q.className : m, y = t.style, s = y === void 0 ? Q.style : y, f = $(t, Ce), C = E(), _ = o, N = E();
479
- return S(e, function() {
480
- return N.current;
481
- }, []), O(function() {
482
- return C.current = ye.attachTo(N.current), function() {
483
- C.current.destroy();
484
- };
485
- }), O(function() {
486
- C.current.float(h);
487
- }, [h]), /* @__PURE__ */ p.createElement("label", A({
488
- ref: N,
489
- htmlFor: a,
490
- className: W("lmnt", "mdc-floating-label", h && "mdc-floating-label--float-above", l && "mdc-floating-label--shake", v)
491
- }, f, {
492
- style: s
493
- }), _);
494
- });
495
- Pt.displayName = "FloatingLabel";
496
- Pt.propTypes = Ee;
497
- var _e = {
498
- /**
499
- * Content to be rendered inside the notched outline. Accepts a string.
500
- *
501
- * Defaults to **null**.
502
- */
503
- children: i.node,
504
- /**
505
- * The css class name to be passed through to the component markup.
506
- *
507
- * Defaults to **undefined**.
508
- */
509
- className: i.string,
510
- /**
511
- * Determines if the notch is opened or closed.
512
- *
513
- * Defaults to **undefined**.
514
- */
515
- closed: i.bool,
516
- /**
517
- * Keep the outline, but prevent the notch (and label from showing up).
518
- *
519
- * Defaults to **undefined**.
520
- */
521
- outlineOnly: i.bool,
522
- /**
523
- *
524
- *
525
- * Defaults to **null**.
526
- */
527
- width: i.number
528
- }, Oe = {
529
- children: null,
530
- className: void 0,
531
- closed: void 0,
532
- outlineOnly: void 0,
533
- width: null
534
- }, Te = ["closed", "className", "children", "outlineOnly", "width"], x = Oe, At = /* @__PURE__ */ F(function(t, e) {
535
- var n = t.closed, o = n === void 0 ? x.closed : n, r = t.className, a = r === void 0 ? x.className : r, u = t.children, l = u === void 0 ? x.children : u, d = t.outlineOnly, h = d === void 0 ? x.outlineOnly : d, m = t.width, v = m === void 0 ? x.width : m, y = $(t, Te), s = E(), f = E();
536
- return S(e, function() {
537
- return s.current;
538
- }, []), O(function() {
539
- return f.current = ge.attachTo(s.current), function() {
540
- f.current.destroy();
541
- };
542
- }, []), O(function() {
543
- o !== void 0 && (o ? f.current.closeNotch() : f.current.notch());
544
- }, [o]), O(function() {
545
- v ? f.current.foundation.adapter.setNotchWidthProperty(v) : f.current.foundation.adapter.removeNotchWidthProperty();
546
- }, [v]), /* @__PURE__ */ p.createElement("div", A({
547
- className: W("lmnt", "mdc-notched-outline", a),
548
- ref: s
549
- }, y), /* @__PURE__ */ p.createElement("div", {
550
- className: "mdc-notched-outline__leading"
551
- }), !h && /* @__PURE__ */ p.createElement("div", {
552
- className: "mdc-notched-outline__notch"
553
- }, l), /* @__PURE__ */ p.createElement("div", {
554
- className: "mdc-notched-outline__trailing"
555
- }));
556
- });
557
- At.displayName = "NotchedOutline";
558
- At.propTypes = _e;
559
- var Le = {
560
- /**
561
- * Accepts any valid markup. This will be rendered before any value set with the `text` prop. For most use-cases use `text`.
562
- *
563
- * Defaults to **undefined**.
564
- */
565
- children: i.node.isRequired,
566
- /**
567
- * The css class name to be passed through to the component markup.
568
- *
569
- * Defaults to **undefined**.
570
- */
571
- className: i.string,
572
- /**
573
- * Container display type, inline or block.
574
- *
575
- * Defaults to **'inline'**.
576
- */
577
- containerType: i.oneOf(["inline", "block"]),
578
- /**
579
- * 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.
580
- *
581
- * Defaults to **false**.
582
- */
583
- hoisted: i.bool,
584
- /**
585
- * Randomly generated id. May be overwritten.
586
- *
587
- * Defaults to **undefined**.
588
- */
589
- id: i.string,
590
- /**
591
- * Fired when the trigger is interacted with.
592
- *
593
- * Defaults to **null**.
594
- */
595
- onClick: i.func,
596
- /**
597
- * 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`.
598
- *
599
- * Defaults to **'document.body'**.
600
- */
601
- portalContainer: i.oneOfType([i.string, i.node]),
602
- /**
603
- * Position of tooltip. Options include: 'top', 'left', 'right', and 'bottom'(default).
604
- *
605
- * Defaults to **'bottom'**.
606
- */
607
- position: i.oneOf(["bottom", "top", "left", "right"]),
608
- /**
609
- * string
610
- *
611
- * Defaults to **null**.
612
- */
613
- text: i.oneOfType([i.string, i.func, i.node]).isRequired,
614
- /**
615
- * Custom properties to apply to the hovering element.
616
- *
617
- * Defaults to **null**.
618
- */
619
- tooltipProps: i.object,
620
- /**
621
- * Custom properties to apply to the trigger element.
622
- *
623
- * Defaults to **null**.
624
- */
625
- triggerProps: i.object
626
- }, Pe = {
627
- children: void 0,
628
- className: void 0,
629
- containerType: "inline",
630
- hoisted: !1,
631
- id: void 0,
632
- onClick: null,
633
- portalContainer: "document.body",
634
- position: "bottom",
635
- text: null,
636
- tooltipProps: null,
637
- triggerProps: null
638
- }, Ae = {
639
- /**
640
- * The css class name to be passed through to the component markup.
641
- *
642
- * Defaults to **undefined**.
643
- */
644
- className: i.string,
645
- /**
646
- * 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.
647
- *
648
- * Defaults to **false**.
649
- */
650
- hoisted: i.bool,
651
- /**
652
- * Randomly generated id. May be overwritten.
653
- *
654
- * Defaults to **undefined**.
655
- */
656
- id: i.string,
657
- /**
658
- * 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`.
659
- *
660
- * Defaults to **'document.body'**.
661
- */
662
- portalContainer: i.oneOfType([i.string, i.node]),
663
- /**
664
- * The text to be rendered inside of the Tooltip.
665
- *
666
- * Defaults to **null**.
667
- */
668
- text: i.oneOfType([i.string, i.func, i.node]).isRequired
669
- }, ke = {
670
- className: void 0,
671
- hoisted: !1,
672
- id: void 0,
673
- portalContainer: "document.body",
674
- text: null
675
- }, Ie = ["className", "hoisted", "id", "portalContainer", "text"], R = ke, Y = /* @__PURE__ */ F(function(t, e) {
676
- var n = t.className, o = n === void 0 ? R.className : n, r = t.hoisted, a = r === void 0 ? R.hoisted : r, u = t.id, l = u === void 0 ? R.id : u, d = t.portalContainer, h = d === void 0 ? R.portalContainer : d, m = t.text, v = m === void 0 ? R.text : m, y = $(t, Ie), s = Z(function() {
677
- return l || Et();
678
- }), f = z(s, 1), C = f[0], _ = E();
679
- S(e, function() {
680
- return _.current;
681
- }, []);
682
- var N = Ot(function() {
683
- return W(["lmnt", o, "lmnt-tooltip__text-content", "mdc-typography--caption"]);
684
- }, [o]);
685
- return /* @__PURE__ */ p.createElement(fe, {
686
- disabled: !a,
687
- container: h
688
- }, /* @__PURE__ */ p.createElement("div", A({
689
- role: "tooltip",
690
- id: C,
691
- className: N
692
- }, y, {
693
- ref: _
694
- }), v));
695
- });
696
- Y.displayName = "TooltipText";
697
- Y.propTypes = Ae;
698
- var De = ["children", "className", "containerType", "hoisted", "id", "onClick", "portalContainer", "position", "text", "tooltipProps", "triggerProps"];
699
- function gt(t, e) {
700
- var n = Jt(t);
701
- if (dt) {
702
- var o = dt(t);
703
- e && (o = Yt(o).call(o, function(r) {
704
- return _t(t, r).enumerable;
705
- })), n.push.apply(n, o);
706
- }
707
- return n;
708
- }
709
- function B(t) {
710
- for (var e = 1; e < arguments.length; e++) {
711
- var n, o, r = arguments[e] != null ? arguments[e] : {};
712
- e % 2 ? ct(n = gt(Object(r), !0)).call(n, function(a) {
713
- Vt(t, a, r[a]);
714
- }) : ut ? Zt(t, ut(r)) : ct(o = gt(Object(r))).call(o, function(a) {
715
- zt(t, a, _t(r, a));
716
- });
717
- }
718
- return t;
719
- }
720
- var g = Pe, kt = /* @__PURE__ */ F(function(t, e) {
721
- var n = t.children, o = n === void 0 ? g.children : n, r = t.className, a = r === void 0 ? g.className : r, u = t.containerType, l = u === void 0 ? g.containerType : u, d = t.hoisted, h = d === void 0 ? g.hoisted : d, m = t.id, v = m === void 0 ? g.id : m, y = t.onClick, s = y === void 0 ? g.onClick : y, f = t.portalContainer, C = f === void 0 ? g.portalContainer : f, _ = t.position, N = _ === void 0 ? g.position : _, tt = t.text, k = tt === void 0 ? g.text : tt, et = t.tooltipProps, It = et === void 0 ? g.tooltipProps : et, nt = t.triggerProps, Dt = nt === void 0 ? g.triggerProps : nt, Ht = $(t, De), q = E(), T = E(), I = E();
722
- S(e, function() {
723
- return T.current;
724
- }, []);
725
- var xt = Z(function() {
726
- return v || Et();
727
- }), Rt = z(xt, 1), L = Rt[0], Wt = H(function() {
728
- s == null || s();
729
- }, [s]), Ft = H(function(c) {
730
- c.key === "Enter" && (s == null || s());
731
- }, [s]);
732
- Gt(function() {
733
- var c = [{
734
- name: "flip",
735
- options: {
736
- enabled: !0,
737
- padding: {
738
- bottom: 32,
739
- top: 32
740
- }
741
- }
742
- }];
743
- return h ? c.push({
744
- name: "offset",
745
- options: {
746
- offset: [0, 6]
747
- }
748
- }) : c.push({
749
- name: "offset",
750
- options: {
751
- offset: [0, 12]
752
- }
753
- }), q.current && T.current && (I.current = Kt(q.current, T.current, {
754
- placement: N,
755
- modifiers: c
756
- })), function() {
757
- var b;
758
- (b = I.current) === null || b === void 0 || b.destroy();
759
- };
760
- }, [N, h]);
761
- var ot = H(function() {
762
- var c, b, P;
763
- (c = T.current) === null || c === void 0 || c.setAttribute("data-show", ""), (b = I.current) === null || b === void 0 || b.setOptions(function(D) {
764
- var at;
765
- return B(B({}, D), {}, {
766
- modifiers: lt(at = []).call(at, pt(D.modifiers), [{
767
- name: "eventListeners",
768
- enabled: !0
769
- }])
770
- });
771
- }), (P = I.current) === null || P === void 0 || P.update();
772
- }, []), rt = H(function() {
773
- var c, b;
774
- (c = T.current) === null || c === void 0 || c.removeAttribute("data-show"), (b = I.current) === null || b === void 0 || b.setOptions(function(P) {
775
- var D;
776
- return B(B({}, P), {}, {
777
- modifiers: lt(D = []).call(D, pt(P.modifiers), [{
778
- name: "eventListeners",
779
- enabled: !1
780
- }])
781
- });
782
- });
783
- }, []), it = H(function() {
784
- var c = o;
785
- return c.type ? c.type === ft : c === ft;
786
- }, [o]);
787
- O(function() {
788
- var c = "Tooltips should only include short text for additional context and should not exceed three lines visually. (Toolitip ID ".concat(L, ").");
789
- k && k.length > 100 && Xt(c);
790
- }, [k, L]);
791
- var St = Ot(
792
- // eslint-disable-next-line react/no-unstable-nested-components
793
- function() {
794
- return function() {
795
- return o ? typeof o == "string" || it(o) ? /* @__PURE__ */ p.createElement("span", {
796
- "aria-describedby": L
797
- }, o) : Qt(o, {
798
- "aria-describedby": L
799
- }) : null;
800
- };
801
- },
802
- [o, L, it]
803
- ), Bt = s ? {
804
- tabIndex: 0,
805
- role: s ? "button" : "note",
806
- onKeyPress: Ft,
807
- onClick: Wt
808
- } : {};
809
- return /* @__PURE__ */ p.createElement("span", A({
810
- className: W("lmnt lmnt-tooltip", l === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
811
- }, Bt, Ht), /* @__PURE__ */ p.createElement("span", A({
812
- className: W("lmnt-tooltip__content", l === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
813
- }, Dt, {
814
- ref: q,
815
- onMouseEnter: ot,
816
- onFocus: ot,
817
- onMouseLeave: rt,
818
- onBlur: rt
819
- }), /* @__PURE__ */ p.createElement(St, null)), k && /* @__PURE__ */ p.createElement(Y, A({
820
- hoisted: h,
821
- portalContainer: C,
822
- role: "tooltip",
823
- id: L,
824
- className: a
825
- }, It, {
826
- ref: T,
827
- text: k
828
- })));
829
- });
830
- kt.displayName = "Tooltip";
831
- kt.propTypes = Le;
832
- export {
833
- pt as B,
834
- fe as G,
835
- Y as K,
836
- Se as M,
837
- le as O,
838
- ge as W,
839
- ye as a,
840
- pe as d,
841
- he as h,
842
- Pt as v,
843
- At as y
844
- };