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