@hortiview/default-components 1.4.0 → 1.4.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.
- package/README.md +1 -1
- package/dist/{Iconify-Cjdr-ccS.js → Iconify-CUZc8WnW.js} +17 -16
- package/dist/InfoCard-CFmkh7DJ.js +58 -0
- package/dist/{LoadingSpinner-FRQEZvxs.js → LoadingSpinner-DVBQ1tGJ.js} +178 -192
- package/dist/OfflineView-DHtzNLwt-BmxTfGZq.js +46 -0
- package/dist/assets/InfoCard.css +1 -0
- package/dist/assets/OfflineView-DHtzNLwt.css +1 -0
- package/dist/{component-DsB0poTj-BDGiEcbP.js → component-DsB0poTj-CeLHB9Ok.js} +3 -3
- package/dist/components/DefaultFormNumber/DefaultFormNumber.js +1337 -505
- package/dist/components/DefaultFormSelect/DefaultFormSelect.js +25 -25
- package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +2 -2
- package/dist/components/GenericTable/GenericTable.js +11524 -9875
- package/dist/components/HealthChecks/DataBaseHealthCheck.d.ts +2 -2
- package/dist/components/HealthChecks/DataBaseHealthCheck.js +2 -2
- package/dist/components/HealthChecks/DefaultHealthCheck.d.ts +2 -2
- package/dist/components/HealthChecks/DefaultHealthCheck.js +2 -2
- package/dist/components/HealthChecks/IotServiceHealthCheck.d.ts +2 -2
- package/dist/components/HealthChecks/IotServiceHealthCheck.js +2 -2
- package/dist/components/HealthChecks/PlatformHealthCheck.d.ts +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-0QJC9VS2-CNPew9LK.js +360 -0
- package/dist/{index.es--yyG47az-DBKBm3yD.js → index.es-BGordhUK-C36NK84Q.js} +400 -365
- package/dist/index.es-Bg8hxXM8-BlFd894m.js +1083 -0
- package/dist/index.es-Bo1Rhtyb-B650l9Yk.js +79 -0
- package/dist/index.es-CK4oZMKs-Da8pin7D.js +14077 -0
- package/dist/{index.es-U5-b20Gv-ChQ_O81C.js → index.es-Cq04gn3U-Bvzrqtm6.js} +369 -535
- package/dist/{omit-1Eom1PmQ-BLY9iMqj.js → index.es-DENZVv7_-PUEN9sIa.js} +495 -869
- package/dist/index.es-IXyb5F6n-B5afcHX8.js +452 -0
- package/dist/isTypedArray-Dw_IY7Zq-BZ-4N8-Z.js +210 -0
- package/dist/main.d.ts +3 -2
- package/dist/main.js +8 -8
- package/dist/slicedToArray-BWk2gTCn-Cfzj7tjm.js +432 -0
- package/dist/useHelperText-3ahu6tTS.js +391 -0
- package/dist/useTranslation-CVaIJbcK.js +5277 -0
- package/package.json +4 -4
- package/dist/HealthCheckFailed-CqLYAwpc.js +0 -47
- package/dist/OfflineView-HbuDPpQL-kqlzfoUS.js +0 -46
- package/dist/assets/HealthCheckFailed.css +0 -1
- package/dist/assets/OfflineView-HbuDPpQL.css +0 -1
- package/dist/index.es-Bx1E5MPK-CaV59rEP.js +0 -344
- package/dist/index.es-CzUKBF7E-C0X-mcdY.js +0 -13567
- package/dist/index.es-D-ph6ImM-CWxTa_iD.js +0 -63
- package/dist/index.es-DDo_AHL0-VqD9ikmU.js +0 -1033
- package/dist/index.es-Kg9soDed-BkTwDySy.js +0 -440
- package/dist/useHelperText-DD9_Dtkk.js +0 -21
- package/dist/useTranslation-B_ODv8uN.js +0 -4306
|
@@ -1,281 +1,110 @@
|
|
|
1
|
-
import { P as Bt,
|
|
2
|
-
import
|
|
3
|
-
import { D as
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { P as Bt, ap as st, aq as wt, t as i, ar as jt, ao as $t, y as Mt, N as Ut, r as w, h as A, e as W, o as Et, g as j, i as Nt, j as B, k as Ct, as as Gt, L as Kt, q 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-CVaIJbcK.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-CeLHB9Ok.js";
|
|
4
|
+
import { I as ee, C as ne, X as oe, F as re, q as ie, S as z } from "./slicedToArray-BWk2gTCn-Cfzj7tjm.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 Bt < "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 = {
|
|
6
20
|
/**
|
|
7
21
|
* Content to be rendered inside the portal.
|
|
8
22
|
*
|
|
9
23
|
* Defaults to **null**.
|
|
10
24
|
*/
|
|
11
|
-
children:
|
|
25
|
+
children: i.node,
|
|
12
26
|
/**
|
|
13
27
|
* Disables the portal to rendering children in the natural flow of the DOM.
|
|
14
28
|
*
|
|
15
29
|
* Defaults to **false**.
|
|
16
30
|
*/
|
|
17
|
-
disabled:
|
|
31
|
+
disabled: i.bool,
|
|
18
32
|
/**
|
|
19
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`.
|
|
20
34
|
*
|
|
21
35
|
* Defaults to **'document.body'**.
|
|
22
36
|
*/
|
|
23
|
-
portalContainer:
|
|
24
|
-
},
|
|
37
|
+
portalContainer: i.oneOfType([i.string, i.node])
|
|
38
|
+
}, de = {
|
|
25
39
|
children: null,
|
|
26
|
-
disabled: !1
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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);
|
|
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);
|
|
41
50
|
else {
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
var f = wt(a);
|
|
52
|
+
v(f || s);
|
|
44
53
|
}
|
|
45
54
|
else
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
/* @__PURE__ */
|
|
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));
|
|
49
58
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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;
|
|
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;
|
|
111
64
|
ht = 1;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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;
|
|
115
69
|
}
|
|
116
|
-
return
|
|
70
|
+
return U = t, U;
|
|
117
71
|
}
|
|
118
|
-
var
|
|
119
|
-
function
|
|
120
|
-
if (mt) return
|
|
72
|
+
var G, mt;
|
|
73
|
+
function he() {
|
|
74
|
+
if (mt) return G;
|
|
121
75
|
mt = 1;
|
|
122
|
-
var
|
|
123
|
-
function
|
|
124
|
-
return
|
|
76
|
+
var t = Mt(), e = Ut(), n = "[object Symbol]";
|
|
77
|
+
function o(r) {
|
|
78
|
+
return typeof r == "symbol" || e(r) && t(r) == n;
|
|
125
79
|
}
|
|
126
|
-
return
|
|
80
|
+
return G = o, G;
|
|
127
81
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
130
|
-
if (vt) return
|
|
82
|
+
var K, vt;
|
|
83
|
+
function me() {
|
|
84
|
+
if (vt) return K;
|
|
131
85
|
vt = 1;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
86
|
+
var t = jt(), e = pe(), n = $t(), 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;
|
|
136
96
|
}
|
|
137
|
-
return
|
|
97
|
+
return K = u, K;
|
|
138
98
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
141
|
-
if (yt) return
|
|
99
|
+
var X, yt;
|
|
100
|
+
function Se() {
|
|
101
|
+
if (yt) return X;
|
|
142
102
|
yt = 1;
|
|
143
|
-
var
|
|
144
|
-
function n
|
|
145
|
-
return
|
|
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);
|
|
103
|
+
var t = me();
|
|
104
|
+
function e(n) {
|
|
105
|
+
return n == null ? "" : t(n);
|
|
173
106
|
}
|
|
174
|
-
return
|
|
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;
|
|
107
|
+
return X = e, X;
|
|
279
108
|
}
|
|
280
109
|
/**
|
|
281
110
|
* @license
|
|
@@ -299,7 +128,7 @@ function Fe() {
|
|
|
299
128
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
300
129
|
* THE SOFTWARE.
|
|
301
130
|
*/
|
|
302
|
-
var
|
|
131
|
+
var ve = {
|
|
303
132
|
LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
|
|
304
133
|
LABEL_REQUIRED: "mdc-floating-label--required",
|
|
305
134
|
LABEL_SHAKE: "mdc-floating-label--shake",
|
|
@@ -327,19 +156,19 @@ var Ee = {
|
|
|
327
156
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
328
157
|
* THE SOFTWARE.
|
|
329
158
|
*/
|
|
330
|
-
var
|
|
159
|
+
var Tt = (
|
|
331
160
|
/** @class */
|
|
332
|
-
function(
|
|
333
|
-
|
|
334
|
-
function e(
|
|
335
|
-
var
|
|
336
|
-
return
|
|
337
|
-
return
|
|
338
|
-
},
|
|
161
|
+
function(t) {
|
|
162
|
+
j(e, t);
|
|
163
|
+
function e(n) {
|
|
164
|
+
var o = t.call(this, B(B({}, e.defaultAdapter), n)) || this;
|
|
165
|
+
return o.shakeAnimationEndHandler_ = function() {
|
|
166
|
+
return o.handleShakeAnimationEnd_();
|
|
167
|
+
}, o;
|
|
339
168
|
}
|
|
340
169
|
return Object.defineProperty(e, "cssClasses", {
|
|
341
170
|
get: function() {
|
|
342
|
-
return
|
|
171
|
+
return ve;
|
|
343
172
|
},
|
|
344
173
|
enumerable: !1,
|
|
345
174
|
configurable: !0
|
|
@@ -370,20 +199,20 @@ var Rt = (
|
|
|
370
199
|
this.adapter.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
|
|
371
200
|
}, e.prototype.getWidth = function() {
|
|
372
201
|
return this.adapter.getWidth();
|
|
373
|
-
}, e.prototype.shake = function(
|
|
374
|
-
var
|
|
375
|
-
|
|
376
|
-
}, e.prototype.float = function(
|
|
377
|
-
var
|
|
378
|
-
|
|
379
|
-
}, e.prototype.setRequired = function(
|
|
380
|
-
var
|
|
381
|
-
|
|
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);
|
|
382
211
|
}, e.prototype.handleShakeAnimationEnd_ = function() {
|
|
383
|
-
var
|
|
384
|
-
this.adapter.removeClass(
|
|
212
|
+
var n = e.cssClasses.LABEL_SHAKE;
|
|
213
|
+
this.adapter.removeClass(n);
|
|
385
214
|
}, e;
|
|
386
|
-
}(
|
|
215
|
+
}(Ct)
|
|
387
216
|
);
|
|
388
217
|
/**
|
|
389
218
|
* @license
|
|
@@ -407,44 +236,44 @@ var Rt = (
|
|
|
407
236
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
408
237
|
* THE SOFTWARE.
|
|
409
238
|
*/
|
|
410
|
-
var
|
|
239
|
+
var ye = (
|
|
411
240
|
/** @class */
|
|
412
|
-
function(
|
|
413
|
-
|
|
241
|
+
function(t) {
|
|
242
|
+
j(e, t);
|
|
414
243
|
function e() {
|
|
415
|
-
return
|
|
244
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
416
245
|
}
|
|
417
|
-
return e.attachTo = function(
|
|
418
|
-
return new e(
|
|
419
|
-
}, e.prototype.shake = function(
|
|
420
|
-
this.foundation.shake(
|
|
421
|
-
}, e.prototype.float = function(
|
|
422
|
-
this.foundation.float(
|
|
423
|
-
}, e.prototype.setRequired = function(
|
|
424
|
-
this.foundation.setRequired(
|
|
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);
|
|
425
254
|
}, e.prototype.getWidth = function() {
|
|
426
255
|
return this.foundation.getWidth();
|
|
427
256
|
}, e.prototype.getDefaultFoundation = function() {
|
|
428
|
-
var
|
|
257
|
+
var n = this, o = {
|
|
429
258
|
addClass: function(r) {
|
|
430
|
-
return
|
|
259
|
+
return n.root.classList.add(r);
|
|
431
260
|
},
|
|
432
261
|
removeClass: function(r) {
|
|
433
|
-
return
|
|
262
|
+
return n.root.classList.remove(r);
|
|
434
263
|
},
|
|
435
264
|
getWidth: function() {
|
|
436
|
-
return
|
|
265
|
+
return te(n.root);
|
|
437
266
|
},
|
|
438
|
-
registerInteractionHandler: function(r,
|
|
439
|
-
return
|
|
267
|
+
registerInteractionHandler: function(r, a) {
|
|
268
|
+
return n.listen(r, a);
|
|
440
269
|
},
|
|
441
|
-
deregisterInteractionHandler: function(r,
|
|
442
|
-
return
|
|
270
|
+
deregisterInteractionHandler: function(r, a) {
|
|
271
|
+
return n.unlisten(r, a);
|
|
443
272
|
}
|
|
444
273
|
};
|
|
445
|
-
return new
|
|
274
|
+
return new Tt(o);
|
|
446
275
|
}, e;
|
|
447
|
-
}(
|
|
276
|
+
}(Nt)
|
|
448
277
|
);
|
|
449
278
|
/**
|
|
450
279
|
* @license
|
|
@@ -468,12 +297,12 @@ var Ne = (
|
|
|
468
297
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
469
298
|
* THE SOFTWARE.
|
|
470
299
|
*/
|
|
471
|
-
var
|
|
300
|
+
var Lt = {
|
|
472
301
|
NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
|
|
473
|
-
},
|
|
302
|
+
}, bt = {
|
|
474
303
|
// This should stay in sync with $mdc-notched-outline-padding * 2.
|
|
475
304
|
NOTCH_ELEMENT_PADDING: 8
|
|
476
|
-
},
|
|
305
|
+
}, V = {
|
|
477
306
|
NO_LABEL: "mdc-notched-outline--no-label",
|
|
478
307
|
OUTLINE_NOTCHED: "mdc-notched-outline--notched",
|
|
479
308
|
OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
|
|
@@ -500,28 +329,28 @@ var Ht = {
|
|
|
500
329
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
501
330
|
* THE SOFTWARE.
|
|
502
331
|
*/
|
|
503
|
-
var
|
|
332
|
+
var be = (
|
|
504
333
|
/** @class */
|
|
505
|
-
function(
|
|
506
|
-
|
|
507
|
-
function e(
|
|
508
|
-
return
|
|
334
|
+
function(t) {
|
|
335
|
+
j(e, t);
|
|
336
|
+
function e(n) {
|
|
337
|
+
return t.call(this, B(B({}, e.defaultAdapter), n)) || this;
|
|
509
338
|
}
|
|
510
339
|
return Object.defineProperty(e, "strings", {
|
|
511
340
|
get: function() {
|
|
512
|
-
return
|
|
341
|
+
return Lt;
|
|
513
342
|
},
|
|
514
343
|
enumerable: !1,
|
|
515
344
|
configurable: !0
|
|
516
345
|
}), Object.defineProperty(e, "cssClasses", {
|
|
517
346
|
get: function() {
|
|
518
|
-
return
|
|
347
|
+
return V;
|
|
519
348
|
},
|
|
520
349
|
enumerable: !1,
|
|
521
350
|
configurable: !0
|
|
522
351
|
}), Object.defineProperty(e, "numbers", {
|
|
523
352
|
get: function() {
|
|
524
|
-
return
|
|
353
|
+
return bt;
|
|
525
354
|
},
|
|
526
355
|
enumerable: !1,
|
|
527
356
|
configurable: !0
|
|
@@ -543,14 +372,14 @@ var Ce = (
|
|
|
543
372
|
},
|
|
544
373
|
enumerable: !1,
|
|
545
374
|
configurable: !0
|
|
546
|
-
}), e.prototype.notch = function(
|
|
547
|
-
var
|
|
548
|
-
|
|
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);
|
|
549
378
|
}, e.prototype.closeNotch = function() {
|
|
550
|
-
var
|
|
551
|
-
this.adapter.removeClass(
|
|
379
|
+
var n = e.cssClasses.OUTLINE_NOTCHED;
|
|
380
|
+
this.adapter.removeClass(n), this.adapter.removeNotchWidthProperty();
|
|
552
381
|
}, e;
|
|
553
|
-
}(
|
|
382
|
+
}(Ct)
|
|
554
383
|
);
|
|
555
384
|
/**
|
|
556
385
|
* @license
|
|
@@ -574,327 +403,334 @@ var Ce = (
|
|
|
574
403
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
575
404
|
* THE SOFTWARE.
|
|
576
405
|
*/
|
|
577
|
-
var
|
|
406
|
+
var ge = (
|
|
578
407
|
/** @class */
|
|
579
|
-
function(
|
|
580
|
-
|
|
408
|
+
function(t) {
|
|
409
|
+
j(e, t);
|
|
581
410
|
function e() {
|
|
582
|
-
return
|
|
411
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
583
412
|
}
|
|
584
|
-
return e.attachTo = function(
|
|
585
|
-
return new e(
|
|
413
|
+
return e.attachTo = function(n) {
|
|
414
|
+
return new e(n);
|
|
586
415
|
}, e.prototype.initialSyncWithDOM = function() {
|
|
587
|
-
this.notchElement_ = this.root.querySelector(
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
})) : this.root.classList.add(
|
|
592
|
-
}, e.prototype.notch = function(
|
|
593
|
-
this.foundation.notch(
|
|
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);
|
|
594
423
|
}, e.prototype.closeNotch = function() {
|
|
595
424
|
this.foundation.closeNotch();
|
|
596
425
|
}, e.prototype.getDefaultFoundation = function() {
|
|
597
|
-
var
|
|
426
|
+
var n = this, o = {
|
|
598
427
|
addClass: function(r) {
|
|
599
|
-
return
|
|
428
|
+
return n.root.classList.add(r);
|
|
600
429
|
},
|
|
601
430
|
removeClass: function(r) {
|
|
602
|
-
return
|
|
431
|
+
return n.root.classList.remove(r);
|
|
603
432
|
},
|
|
604
433
|
setNotchWidthProperty: function(r) {
|
|
605
|
-
return
|
|
434
|
+
return n.notchElement_.style.setProperty("width", r + "px");
|
|
606
435
|
},
|
|
607
436
|
removeNotchWidthProperty: function() {
|
|
608
|
-
return
|
|
437
|
+
return n.notchElement_.style.removeProperty("width");
|
|
609
438
|
}
|
|
610
439
|
};
|
|
611
|
-
return new
|
|
440
|
+
return new be(o);
|
|
612
441
|
}, e;
|
|
613
|
-
}(
|
|
614
|
-
)
|
|
615
|
-
const _e = {
|
|
442
|
+
}(Nt)
|
|
443
|
+
), Ee = {
|
|
616
444
|
/**
|
|
617
445
|
* Content to be rendered inside the label. Expects a string, though accepts any valid markup.
|
|
618
446
|
*
|
|
619
447
|
* Defaults to **null**.
|
|
620
448
|
*/
|
|
621
|
-
children:
|
|
449
|
+
children: i.node.isRequired,
|
|
622
450
|
/**
|
|
623
451
|
* The css class name to be passed through to the component markup.
|
|
624
452
|
*
|
|
625
453
|
* Defaults to **undefined**.
|
|
626
454
|
*/
|
|
627
|
-
className:
|
|
455
|
+
className: i.string,
|
|
628
456
|
/**
|
|
629
457
|
* The label will appear in the floating state.
|
|
630
458
|
*
|
|
631
459
|
* Defaults to **false**.
|
|
632
460
|
*/
|
|
633
|
-
float:
|
|
461
|
+
float: i.bool,
|
|
634
462
|
/**
|
|
635
463
|
* The id of the component to trigger on active
|
|
636
464
|
*
|
|
637
465
|
* Defaults to **empty string**.
|
|
638
466
|
*/
|
|
639
|
-
htmlFor:
|
|
467
|
+
htmlFor: i.string,
|
|
640
468
|
/**
|
|
641
469
|
* The label will shake briefly when set.
|
|
642
470
|
*
|
|
643
471
|
* Defaults to **false**.
|
|
644
472
|
*/
|
|
645
|
-
shake:
|
|
646
|
-
},
|
|
473
|
+
shake: i.bool
|
|
474
|
+
}, Ne = {
|
|
647
475
|
children: null,
|
|
648
|
-
className: void 0
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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, {
|
|
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 = w(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, {
|
|
671
492
|
style: s
|
|
672
|
-
}),
|
|
493
|
+
}), _);
|
|
673
494
|
});
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
const Le = {
|
|
495
|
+
Pt.displayName = "FloatingLabel";
|
|
496
|
+
Pt.propTypes = Ee;
|
|
497
|
+
var _e = {
|
|
678
498
|
/**
|
|
679
499
|
* Content to be rendered inside the notched outline. Accepts a string.
|
|
680
500
|
*
|
|
681
501
|
* Defaults to **null**.
|
|
682
502
|
*/
|
|
683
|
-
children:
|
|
503
|
+
children: i.node,
|
|
684
504
|
/**
|
|
685
505
|
* The css class name to be passed through to the component markup.
|
|
686
506
|
*
|
|
687
507
|
* Defaults to **undefined**.
|
|
688
508
|
*/
|
|
689
|
-
className:
|
|
509
|
+
className: i.string,
|
|
690
510
|
/**
|
|
691
511
|
* Determines if the notch is opened or closed.
|
|
692
512
|
*
|
|
693
513
|
* Defaults to **undefined**.
|
|
694
514
|
*/
|
|
695
|
-
closed:
|
|
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,
|
|
696
522
|
/**
|
|
697
523
|
*
|
|
698
524
|
*
|
|
699
525
|
* Defaults to **null**.
|
|
700
526
|
*/
|
|
701
|
-
width:
|
|
702
|
-
},
|
|
527
|
+
width: i.number
|
|
528
|
+
}, Oe = {
|
|
703
529
|
children: null,
|
|
704
530
|
className: void 0,
|
|
705
531
|
closed: void 0,
|
|
532
|
+
outlineOnly: void 0,
|
|
706
533
|
width: null
|
|
707
|
-
},
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
}, [
|
|
720
|
-
|
|
721
|
-
}, [o]), /* @__PURE__ */ f.createElement("div", N({
|
|
722
|
-
className: _("lmnt", "mdc-notched-outline", n),
|
|
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 = w(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),
|
|
723
548
|
ref: s
|
|
724
|
-
},
|
|
549
|
+
}, y), /* @__PURE__ */ p.createElement("div", {
|
|
725
550
|
className: "mdc-notched-outline__leading"
|
|
726
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), !h && /* @__PURE__ */ p.createElement("div", {
|
|
727
552
|
className: "mdc-notched-outline__notch"
|
|
728
|
-
},
|
|
553
|
+
}, l), /* @__PURE__ */ p.createElement("div", {
|
|
729
554
|
className: "mdc-notched-outline__trailing"
|
|
730
555
|
}));
|
|
731
556
|
});
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
const Pe = {
|
|
557
|
+
At.displayName = "NotchedOutline";
|
|
558
|
+
At.propTypes = _e;
|
|
559
|
+
var Le = {
|
|
736
560
|
/**
|
|
737
561
|
* Accepts any valid markup. This will be rendered before any value set with the `text` prop. For most use-cases use `text`.
|
|
738
562
|
*
|
|
739
563
|
* Defaults to **undefined**.
|
|
740
564
|
*/
|
|
741
|
-
children:
|
|
565
|
+
children: i.node.isRequired,
|
|
742
566
|
/**
|
|
743
567
|
* The css class name to be passed through to the component markup.
|
|
744
568
|
*
|
|
745
569
|
* Defaults to **undefined**.
|
|
746
570
|
*/
|
|
747
|
-
className:
|
|
571
|
+
className: i.string,
|
|
748
572
|
/**
|
|
749
573
|
* Container display type, inline or block.
|
|
750
574
|
*
|
|
751
575
|
* Defaults to **'inline'**.
|
|
752
576
|
*/
|
|
753
|
-
containerType:
|
|
577
|
+
containerType: i.oneOf(["inline", "block"]),
|
|
754
578
|
/**
|
|
755
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.
|
|
756
580
|
*
|
|
757
581
|
* Defaults to **false**.
|
|
758
582
|
*/
|
|
759
|
-
hoisted:
|
|
583
|
+
hoisted: i.bool,
|
|
760
584
|
/**
|
|
761
585
|
* Randomly generated id. May be overwritten.
|
|
762
586
|
*
|
|
763
587
|
* Defaults to **undefined**.
|
|
764
588
|
*/
|
|
765
|
-
id:
|
|
589
|
+
id: i.string,
|
|
766
590
|
/**
|
|
767
591
|
* Fired when the trigger is interacted with.
|
|
768
592
|
*
|
|
769
593
|
* Defaults to **null**.
|
|
770
594
|
*/
|
|
771
|
-
onClick:
|
|
595
|
+
onClick: i.func,
|
|
772
596
|
/**
|
|
773
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`.
|
|
774
598
|
*
|
|
775
599
|
* Defaults to **'document.body'**.
|
|
776
600
|
*/
|
|
777
|
-
portalContainer:
|
|
601
|
+
portalContainer: i.oneOfType([i.string, i.node]),
|
|
778
602
|
/**
|
|
779
603
|
* Position of tooltip. Options include: 'top', 'left', 'right', and 'bottom'(default).
|
|
780
604
|
*
|
|
781
605
|
* Defaults to **'bottom'**.
|
|
782
606
|
*/
|
|
783
|
-
position:
|
|
607
|
+
position: i.oneOf(["bottom", "top", "left", "right"]),
|
|
784
608
|
/**
|
|
785
609
|
* string
|
|
786
610
|
*
|
|
787
611
|
* Defaults to **null**.
|
|
788
612
|
*/
|
|
789
|
-
text:
|
|
613
|
+
text: i.oneOfType([i.string, i.func, i.node]).isRequired,
|
|
790
614
|
/**
|
|
791
615
|
* Custom properties to apply to the hovering element.
|
|
792
616
|
*
|
|
793
617
|
* Defaults to **null**.
|
|
794
618
|
*/
|
|
795
|
-
tooltipProps:
|
|
619
|
+
tooltipProps: i.object,
|
|
796
620
|
/**
|
|
797
621
|
* Custom properties to apply to the trigger element.
|
|
798
622
|
*
|
|
799
623
|
* Defaults to **null**.
|
|
800
624
|
*/
|
|
801
|
-
triggerProps:
|
|
802
|
-
},
|
|
625
|
+
triggerProps: i.object
|
|
626
|
+
}, Pe = {
|
|
803
627
|
children: void 0,
|
|
804
628
|
className: void 0,
|
|
805
629
|
containerType: "inline",
|
|
806
630
|
hoisted: !1,
|
|
807
631
|
id: void 0,
|
|
632
|
+
onClick: null,
|
|
808
633
|
portalContainer: "document.body",
|
|
809
634
|
position: "bottom",
|
|
810
635
|
text: null,
|
|
811
636
|
tooltipProps: null,
|
|
812
637
|
triggerProps: null
|
|
813
|
-
},
|
|
638
|
+
}, Ae = {
|
|
814
639
|
/**
|
|
815
640
|
* The css class name to be passed through to the component markup.
|
|
816
641
|
*
|
|
817
642
|
* Defaults to **undefined**.
|
|
818
643
|
*/
|
|
819
|
-
className:
|
|
644
|
+
className: i.string,
|
|
820
645
|
/**
|
|
821
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.
|
|
822
647
|
*
|
|
823
648
|
* Defaults to **false**.
|
|
824
649
|
*/
|
|
825
|
-
hoisted:
|
|
650
|
+
hoisted: i.bool,
|
|
826
651
|
/**
|
|
827
652
|
* Randomly generated id. May be overwritten.
|
|
828
653
|
*
|
|
829
654
|
* Defaults to **undefined**.
|
|
830
655
|
*/
|
|
831
|
-
id:
|
|
656
|
+
id: i.string,
|
|
832
657
|
/**
|
|
833
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`.
|
|
834
659
|
*
|
|
835
660
|
* Defaults to **'document.body'**.
|
|
836
661
|
*/
|
|
837
|
-
portalContainer:
|
|
662
|
+
portalContainer: i.oneOfType([i.string, i.node]),
|
|
838
663
|
/**
|
|
839
664
|
* The text to be rendered inside of the Tooltip.
|
|
840
665
|
*
|
|
841
666
|
* Defaults to **null**.
|
|
842
667
|
*/
|
|
843
|
-
text:
|
|
668
|
+
text: i.oneOfType([i.string, i.func, i.node]).isRequired
|
|
844
669
|
}, ke = {
|
|
845
670
|
className: void 0,
|
|
846
671
|
hoisted: !1,
|
|
847
672
|
id: void 0,
|
|
848
673
|
portalContainer: "document.body",
|
|
849
674
|
text: null
|
|
850
|
-
},
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}, /* @__PURE__ */ f.createElement("div", N({
|
|
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 = w(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({
|
|
865
689
|
role: "tooltip",
|
|
866
|
-
id:
|
|
867
|
-
className:
|
|
868
|
-
},
|
|
869
|
-
ref:
|
|
870
|
-
}),
|
|
690
|
+
id: C,
|
|
691
|
+
className: N
|
|
692
|
+
}, y, {
|
|
693
|
+
ref: _
|
|
694
|
+
}), v));
|
|
871
695
|
});
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
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 q(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 = w(t, De), $ = 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() {
|
|
892
728
|
s == null || s();
|
|
893
|
-
}, [s]),
|
|
729
|
+
}, [s]), Ft = H(function(c) {
|
|
894
730
|
c.key === "Enter" && (s == null || s());
|
|
895
731
|
}, [s]);
|
|
896
|
-
|
|
897
|
-
|
|
732
|
+
Gt(function() {
|
|
733
|
+
var c = [{
|
|
898
734
|
name: "flip",
|
|
899
735
|
options: {
|
|
900
736
|
enabled: !0,
|
|
@@ -904,7 +740,7 @@ const rt = /* @__PURE__ */ T((a, e) => {
|
|
|
904
740
|
}
|
|
905
741
|
}
|
|
906
742
|
}];
|
|
907
|
-
return
|
|
743
|
+
return h ? c.push({
|
|
908
744
|
name: "offset",
|
|
909
745
|
options: {
|
|
910
746
|
offset: [0, 6]
|
|
@@ -914,97 +750,95 @@ const rt = /* @__PURE__ */ T((a, e) => {
|
|
|
914
750
|
options: {
|
|
915
751
|
offset: [0, 12]
|
|
916
752
|
}
|
|
917
|
-
}),
|
|
918
|
-
placement:
|
|
753
|
+
}), $.current && T.current && (I.current = Kt($.current, T.current, {
|
|
754
|
+
placement: N,
|
|
919
755
|
modifiers: c
|
|
920
|
-
})), ()
|
|
921
|
-
var
|
|
922
|
-
(
|
|
756
|
+
})), function() {
|
|
757
|
+
var b;
|
|
758
|
+
(b = I.current) === null || b === void 0 || b.destroy();
|
|
923
759
|
};
|
|
924
|
-
}, [
|
|
925
|
-
|
|
926
|
-
var c,
|
|
927
|
-
(c =
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}, [
|
|
951
|
-
|
|
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 q(q({}, 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 q(q({}, 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(
|
|
952
792
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
953
|
-
()
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
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
|
+
), qt = s ? {
|
|
960
804
|
tabIndex: 0,
|
|
961
805
|
role: s ? "button" : "note",
|
|
962
|
-
onKeyPress:
|
|
963
|
-
onClick:
|
|
806
|
+
onKeyPress: Ft,
|
|
807
|
+
onClick: Wt
|
|
964
808
|
} : {};
|
|
965
|
-
return /* @__PURE__ */
|
|
966
|
-
className:
|
|
967
|
-
},
|
|
968
|
-
className:
|
|
969
|
-
},
|
|
970
|
-
ref:
|
|
809
|
+
return /* @__PURE__ */ p.createElement("span", A({
|
|
810
|
+
className: W("lmnt lmnt-tooltip", l === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
|
|
811
|
+
}, qt, Ht), /* @__PURE__ */ p.createElement("span", A({
|
|
812
|
+
className: W("lmnt-tooltip__content", l === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
|
|
813
|
+
}, Dt, {
|
|
814
|
+
ref: $,
|
|
971
815
|
onMouseEnter: ot,
|
|
972
816
|
onFocus: ot,
|
|
973
|
-
onMouseLeave:
|
|
974
|
-
onBlur:
|
|
975
|
-
}), /* @__PURE__ */
|
|
976
|
-
hoisted:
|
|
977
|
-
portalContainer:
|
|
817
|
+
onMouseLeave: rt,
|
|
818
|
+
onBlur: rt
|
|
819
|
+
}), /* @__PURE__ */ p.createElement(St, null)), k && /* @__PURE__ */ p.createElement(Y, A({
|
|
820
|
+
hoisted: h,
|
|
821
|
+
portalContainer: C,
|
|
978
822
|
role: "tooltip",
|
|
979
|
-
id:
|
|
980
|
-
className:
|
|
981
|
-
},
|
|
982
|
-
ref:
|
|
983
|
-
text:
|
|
823
|
+
id: L,
|
|
824
|
+
className: a
|
|
825
|
+
}, It, {
|
|
826
|
+
ref: T,
|
|
827
|
+
text: k
|
|
984
828
|
})));
|
|
985
829
|
});
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
rt.defaultProps = Ae;
|
|
830
|
+
kt.displayName = "Tooltip";
|
|
831
|
+
kt.propTypes = Le;
|
|
989
832
|
export {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
le as
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
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
|
|
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
|
|
1010
844
|
};
|