@hortiview/default-components 1.5.0 → 1.5.2

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