react-luminus-components 1.4.32 → 1.4.34
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 +349 -349
- package/dist/.vite/manifest.json +30 -30
- package/dist/FormDisabledProvider-Ck3Wl-xT.cjs +1 -0
- package/dist/{FormDisabledProvider-Ch-vDjrq.js → FormDisabledProvider-prNEKV5X.js} +1 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +138 -126
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +43 -43
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +33 -33
- package/dist/main.cjs.js +50 -50
- package/dist/main.es.js +9695 -9695
- package/dist/{ShortcutLinksContext-JGNprvNi.js → nivo-bar.es-CTs3Ptar.js} +12666 -12653
- package/dist/nivo-bar.es-Cz-_XfUi.cjs +281 -0
- package/dist/style.css +1 -1
- package/dist/useLocalStorageState-CIf5aDoR.cjs +1 -0
- package/dist/{useLocalStorageState-D8hmkEYj.js → useLocalStorageState-rNuPqT1C.js} +6 -2
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +13 -13
- package/dist/variables.scss +165 -165
- package/package.json +122 -122
- package/dist/FormDisabledProvider-EDeNuvxV.cjs +0 -1
- package/dist/ShortcutLinksContext-BtGiohBt.cjs +0 -281
- package/dist/useLocalStorageState-Chn1OW--.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
var Ee = Object.defineProperty;
|
|
2
2
|
var Oe = (e, t, r) => t in e ? Ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var
|
|
4
|
-
import { t as F, bC as we, j as f, bD as
|
|
5
|
-
import { bK as
|
|
6
|
-
import O, { useState as x, useCallback as
|
|
3
|
+
var C = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { t as F, bC as we, j as f, bD as De, P as z, ak as Ie, bE as de, a1 as A, ag as Pe, Q as q, bF as je, ao as ke, am as Le, b4 as me, br as pe, b5 as Me, b6 as j, an as He, bG as _e, aB as se, bH as $e, aT as he, bI as oe, bJ as Re, al as Ue, aX as Fe, a2 as Ne } from "./nivo-bar.es-CTs3Ptar.js";
|
|
5
|
+
import { bK as Bt, ad as Vt } from "./nivo-bar.es-CTs3Ptar.js";
|
|
6
|
+
import O, { useState as x, useCallback as p, useMemo as g, useContext as H, useEffect as P, useRef as ye, Component as te } from "react";
|
|
7
7
|
import { EventType as W } from "@azure/msal-browser";
|
|
8
8
|
import { MsalProvider as Ge } from "@azure/msal-react";
|
|
9
9
|
import "react-router-dom";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
import "react-hook-form";
|
|
12
12
|
import "react-flexmonster";
|
|
13
|
-
import { L as qe } from "./FormDisabledProvider-
|
|
14
|
-
import { F as Jt } from "./FormDisabledProvider-
|
|
15
|
-
import { a as ze, u as Ke } from "./useLocalStorageState-
|
|
16
|
-
function
|
|
13
|
+
import { L as qe } from "./FormDisabledProvider-prNEKV5X.js";
|
|
14
|
+
import { F as Jt } from "./FormDisabledProvider-prNEKV5X.js";
|
|
15
|
+
import { a as ze, u as Ke } from "./useLocalStorageState-rNuPqT1C.js";
|
|
16
|
+
function Be(e) {
|
|
17
17
|
const t = F(e);
|
|
18
18
|
return t.setHours(23, 59, 59, 999), t;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function Ve() {
|
|
21
|
+
return Be(Date.now());
|
|
22
22
|
}
|
|
23
23
|
function Ye(e, t) {
|
|
24
24
|
const r = +F(e), [n, s] = [
|
|
@@ -31,19 +31,19 @@ function Je() {
|
|
|
31
31
|
return we(Date.now());
|
|
32
32
|
}
|
|
33
33
|
const We = ({ children: e }) => {
|
|
34
|
-
const [t, r] = x(!1), [n, s] = x(""), [o, c] = x(void 0), i =
|
|
34
|
+
const [t, r] = x(!1), [n, s] = x(""), [o, c] = x(void 0), i = p((u, d) => {
|
|
35
35
|
r(!0), s(u), c(d);
|
|
36
|
-
}, []), l =
|
|
36
|
+
}, []), l = p(() => {
|
|
37
37
|
r(!1);
|
|
38
38
|
}, []), a = g(() => ({ show: t, text: n, showConfirm: i, hideConfirm: l, textSm: o }), [t, n, i, l, o]);
|
|
39
|
-
return /* @__PURE__ */ f.jsxs(
|
|
39
|
+
return /* @__PURE__ */ f.jsxs(De.Provider, { value: a, children: [
|
|
40
40
|
/* @__PURE__ */ f.jsx(Ot, {}),
|
|
41
41
|
e
|
|
42
42
|
] });
|
|
43
43
|
}, Qe = () => {
|
|
44
|
-
const { texts: { confirm: e } } =
|
|
44
|
+
const { texts: { confirm: e } } = H(z), { isShown: t, text: r, onFinish: n } = Ie(), { options: s } = H(de), [o, c] = x(s.defaultValue ?? ""), i = p(() => {
|
|
45
45
|
n(null);
|
|
46
|
-
}, [n]), l =
|
|
46
|
+
}, [n]), l = p((u) => {
|
|
47
47
|
u.preventDefault(), !(s.required && !o) && n(o);
|
|
48
48
|
}, [n, s.required, o]);
|
|
49
49
|
P(() => {
|
|
@@ -71,9 +71,9 @@ const We = ({ children: e }) => {
|
|
|
71
71
|
] });
|
|
72
72
|
}, Xe = ({ children: e }) => {
|
|
73
73
|
const [t, r] = x(!1), [n, s] = x(""), [o, c] = x({ input: "textarea", type: "text" }), i = ye(() => {
|
|
74
|
-
}), l =
|
|
74
|
+
}), l = p((d) => {
|
|
75
75
|
s(d), r(!0);
|
|
76
|
-
}, []), a =
|
|
76
|
+
}, []), a = p(() => {
|
|
77
77
|
r(!1);
|
|
78
78
|
}, []), u = g(() => ({
|
|
79
79
|
isShown: t,
|
|
@@ -111,9 +111,9 @@ const We = ({ children: e }) => {
|
|
|
111
111
|
i
|
|
112
112
|
] }) }) });
|
|
113
113
|
}, Ut = ({ children: e }) => {
|
|
114
|
-
const [t, r] = x(!1), [n] = x(/* @__PURE__ */ new Set()), s =
|
|
114
|
+
const [t, r] = x(!1), [n] = x(/* @__PURE__ */ new Set()), s = p((i) => {
|
|
115
115
|
n.add(i), r(!0);
|
|
116
|
-
}, [n]), o =
|
|
116
|
+
}, [n]), o = p((i) => {
|
|
117
117
|
n.delete(i), n.size === 0 && r(!1);
|
|
118
118
|
}, [n]), c = g(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
|
|
119
119
|
return /* @__PURE__ */ f.jsxs(ke.Provider, { value: c, children: [
|
|
@@ -121,37 +121,37 @@ const We = ({ children: e }) => {
|
|
|
121
121
|
e
|
|
122
122
|
] });
|
|
123
123
|
}, Ft = ({ children: e }) => {
|
|
124
|
-
const t = Le(), { msalInstance: r } =
|
|
124
|
+
const t = Le(), { msalInstance: r } = H(me), { delegation: n, setDelegation: s, setAvailableDelegations: o, refreshAvailableDelegations: c } = H(pe), { getToken: i } = Me(), [l, a] = x(null), u = p(async () => {
|
|
125
125
|
const y = await i();
|
|
126
126
|
y && a(y.token);
|
|
127
127
|
}, [i]);
|
|
128
128
|
P(() => {
|
|
129
129
|
u();
|
|
130
130
|
}, [u]);
|
|
131
|
-
const
|
|
131
|
+
const m = p(() => {
|
|
132
132
|
const y = localStorage.getItem("user") ?? null;
|
|
133
133
|
return y ? JSON.parse(y ?? "") : null;
|
|
134
|
-
}, [])(), [
|
|
135
|
-
state:
|
|
136
|
-
user:
|
|
137
|
-
}),
|
|
134
|
+
}, [])(), [h, T] = x({
|
|
135
|
+
state: m ? j.LOGGED_IN : j.LOGGING_IN,
|
|
136
|
+
user: m
|
|
137
|
+
}), _ = p(async (y) => {
|
|
138
138
|
let b = null;
|
|
139
139
|
return await t.get("/user/detail", y ? { headers: { Authorization: `Bearer ${y}` } } : void 0).then((K) => {
|
|
140
140
|
b = K.data;
|
|
141
141
|
}).catch(() => {
|
|
142
142
|
b = null;
|
|
143
143
|
}), b;
|
|
144
|
-
}, [t]), w =
|
|
144
|
+
}, [t]), w = p(() => {
|
|
145
145
|
localStorage.removeItem("user"), T({
|
|
146
146
|
state: j.LOGGED_OUT,
|
|
147
147
|
user: null
|
|
148
148
|
}), s(null), o(null);
|
|
149
|
-
}, [o, s]), E =
|
|
149
|
+
}, [o, s]), E = p(async (y) => {
|
|
150
150
|
T({
|
|
151
151
|
state: j.LOGGING_IN,
|
|
152
152
|
user: null
|
|
153
153
|
});
|
|
154
|
-
const b = await
|
|
154
|
+
const b = await _(y);
|
|
155
155
|
return b ? (T({
|
|
156
156
|
state: j.LOGGED_IN,
|
|
157
157
|
user: b
|
|
@@ -159,7 +159,7 @@ const We = ({ children: e }) => {
|
|
|
159
159
|
state: j.LOGIN_FAILED,
|
|
160
160
|
user: null
|
|
161
161
|
}), !1);
|
|
162
|
-
}, [
|
|
162
|
+
}, [_, c]), D = p(() => {
|
|
163
163
|
w();
|
|
164
164
|
}, [w]);
|
|
165
165
|
P(() => {
|
|
@@ -176,66 +176,78 @@ const We = ({ children: e }) => {
|
|
|
176
176
|
}
|
|
177
177
|
return () => {
|
|
178
178
|
};
|
|
179
|
-
}, [r, E,
|
|
180
|
-
const ne =
|
|
179
|
+
}, [r, E, D]);
|
|
180
|
+
const ne = p(async (y) => {
|
|
181
181
|
y && await E(y).catch(() => {
|
|
182
|
-
|
|
182
|
+
D(), s(null);
|
|
183
183
|
});
|
|
184
|
-
}, [E,
|
|
184
|
+
}, [E, D, s]);
|
|
185
185
|
P(() => {
|
|
186
186
|
ne(l);
|
|
187
187
|
}, [l, n == null ? void 0 : n.id, ne]);
|
|
188
188
|
const Ae = g(() => ({
|
|
189
|
-
user:
|
|
190
|
-
userLoginState:
|
|
189
|
+
user: h.user,
|
|
190
|
+
userLoginState: h,
|
|
191
191
|
loginUser: E,
|
|
192
|
-
logoutUser:
|
|
193
|
-
}), [
|
|
194
|
-
return /* @__PURE__ */ f.jsx(
|
|
192
|
+
logoutUser: D
|
|
193
|
+
}), [h, E, D]);
|
|
194
|
+
return /* @__PURE__ */ f.jsx(He.Provider, { value: Ae, children: e });
|
|
195
195
|
}, Nt = ({ ...e }) => {
|
|
196
|
-
const { cookieDomain: t } =
|
|
196
|
+
const { cookieDomain: t } = H(z), [, r] = _e(["Authorization"]), n = g(
|
|
197
|
+
() => e.useMsal ? e.msalInstance : null,
|
|
198
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
199
|
+
[e.useMsal, e.useMsal ? e.msalInstance : null]
|
|
200
|
+
), s = g(
|
|
201
|
+
() => e.useMsal ? e.msalScopes : [],
|
|
202
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
|
+
[e.useMsal, e.useMsal ? e.msalScopes : null]
|
|
204
|
+
), o = g(
|
|
205
|
+
() => e.useMsal ? e.msalExtraScopes : [],
|
|
206
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
|
+
[e.useMsal, e.useMsal ? e.msalExtraScopes : null]
|
|
208
|
+
), c = g(() => ({
|
|
197
209
|
useMsal: e.useMsal ?? !1,
|
|
198
|
-
msalInstance:
|
|
199
|
-
msalScopes:
|
|
200
|
-
msalExtraScopes:
|
|
201
|
-
}), [e]);
|
|
210
|
+
msalInstance: n,
|
|
211
|
+
msalScopes: s,
|
|
212
|
+
msalExtraScopes: o
|
|
213
|
+
}), [e.useMsal, n, s, o]);
|
|
202
214
|
return P(() => {
|
|
203
|
-
if (e.useMsal) {
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
r("Authorization",
|
|
215
|
+
if (e.useMsal && n) {
|
|
216
|
+
const i = n.addEventCallback((l) => {
|
|
217
|
+
if (l.eventType === W.LOGIN_SUCCESS || l.eventType === W.ACQUIRE_TOKEN_SUCCESS && l.payload) {
|
|
218
|
+
const a = l.payload, u = a.account;
|
|
219
|
+
n.setActiveAccount(u);
|
|
220
|
+
const d = a.accessToken, m = a.expiresOn;
|
|
221
|
+
r("Authorization", d, {
|
|
210
222
|
path: "/",
|
|
211
223
|
secure: !0,
|
|
212
224
|
sameSite: "none",
|
|
213
225
|
domain: t,
|
|
214
|
-
expires:
|
|
226
|
+
expires: m ?? void 0
|
|
215
227
|
});
|
|
216
228
|
}
|
|
217
|
-
|
|
229
|
+
l.error && console.error("AuthProvider MSAL Error", l);
|
|
218
230
|
});
|
|
219
231
|
return () => {
|
|
220
|
-
|
|
232
|
+
i && n.removeEventCallback(i);
|
|
221
233
|
};
|
|
222
234
|
}
|
|
223
235
|
return () => {
|
|
224
236
|
};
|
|
225
|
-
}, [e, r, t]), /* @__PURE__ */ f.jsx(me.Provider, { value:
|
|
237
|
+
}, [e.useMsal, n, r, t]), /* @__PURE__ */ f.jsx(me.Provider, { value: c, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ge, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
226
238
|
}, Gt = ({ children: e, relativeEndpoint: t }) => {
|
|
227
239
|
const [r, n, s] = ze("user-delegation", null), o = g(() => {
|
|
228
240
|
if (!r)
|
|
229
241
|
return null;
|
|
230
|
-
const d = r.from ? se(r.from) : Je(),
|
|
231
|
-
return Ye(new Date(Date.now()), { start: d, end:
|
|
242
|
+
const d = r.from ? se(r.from) : Je(), m = r.to ? se(r.to) : Ve();
|
|
243
|
+
return Ye(new Date(Date.now()), { start: d, end: m }) ? r : (n(null), null);
|
|
232
244
|
}, [r, n]), { data: c, setData: i, reloadData: l } = Ke(t, {
|
|
233
245
|
nullStateBeforeLoad: !1,
|
|
234
246
|
nullStateOnFail: !0
|
|
235
247
|
}), a = ye(null);
|
|
236
248
|
P(() => {
|
|
237
249
|
const d = () => {
|
|
238
|
-
l(), a.current = window.setTimeout(d,
|
|
250
|
+
l(), a.current = window.setTimeout(d, $e() + 5e3);
|
|
239
251
|
};
|
|
240
252
|
return d(), () => {
|
|
241
253
|
a.current !== null && window.clearTimeout(a.current);
|
|
@@ -335,14 +347,14 @@ var ot = function(t, r, n, s) {
|
|
|
335
347
|
var u = c[a];
|
|
336
348
|
if (!l(u))
|
|
337
349
|
return !1;
|
|
338
|
-
var d = t[u],
|
|
339
|
-
if (o = n ? n.call(s, d,
|
|
350
|
+
var d = t[u], m = r[u];
|
|
351
|
+
if (o = n ? n.call(s, d, m, u) : void 0, o === !1 || o === void 0 && d !== m)
|
|
340
352
|
return !1;
|
|
341
353
|
}
|
|
342
354
|
return !0;
|
|
343
355
|
};
|
|
344
356
|
const at = /* @__PURE__ */ he(ot);
|
|
345
|
-
var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(ge || {}),
|
|
357
|
+
var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(ge || {}), B = {
|
|
346
358
|
link: { rel: ["amphtml", "canonical", "alternate"] },
|
|
347
359
|
script: { type: ["application/ld+json"] },
|
|
348
360
|
meta: {
|
|
@@ -376,14 +388,14 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
376
388
|
}, it = Object.entries(re).reduce(
|
|
377
389
|
(e, [t, r]) => (e[r] = t, e),
|
|
378
390
|
{}
|
|
379
|
-
),
|
|
391
|
+
), S = "data-rh", L = {
|
|
380
392
|
DEFAULT_TITLE: "defaultTitle",
|
|
381
393
|
DEFER: "defer",
|
|
382
394
|
ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
|
|
383
395
|
ON_CHANGE_CLIENT_STATE: "onChangeClientState",
|
|
384
396
|
TITLE_TEMPLATE: "titleTemplate",
|
|
385
397
|
PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
|
|
386
|
-
},
|
|
398
|
+
}, M = (e, t) => {
|
|
387
399
|
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
388
400
|
const n = e[r];
|
|
389
401
|
if (Object.prototype.hasOwnProperty.call(n, t))
|
|
@@ -391,18 +403,18 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
391
403
|
}
|
|
392
404
|
return null;
|
|
393
405
|
}, lt = (e) => {
|
|
394
|
-
let t =
|
|
406
|
+
let t = M(
|
|
395
407
|
e,
|
|
396
408
|
"title"
|
|
397
409
|
/* TITLE */
|
|
398
410
|
);
|
|
399
|
-
const r =
|
|
411
|
+
const r = M(e, L.TITLE_TEMPLATE);
|
|
400
412
|
if (Array.isArray(t) && (t = t.join("")), r && t)
|
|
401
413
|
return r.replace(/%s/g, () => t);
|
|
402
|
-
const n =
|
|
414
|
+
const n = M(e, L.DEFAULT_TITLE);
|
|
403
415
|
return t || n || void 0;
|
|
404
|
-
}, ct = (e) =>
|
|
405
|
-
}),
|
|
416
|
+
}, ct = (e) => M(e, L.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
417
|
+
}), V = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), ut = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
|
|
406
418
|
if (!r.length) {
|
|
407
419
|
const s = Object.keys(n);
|
|
408
420
|
for (let o = 0; o < s.length; o += 1) {
|
|
@@ -412,7 +424,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
412
424
|
}
|
|
413
425
|
}
|
|
414
426
|
return r;
|
|
415
|
-
}, []), ft = (e) => console && typeof console.warn == "function" && console.warn(e),
|
|
427
|
+
}, []), ft = (e) => console && typeof console.warn == "function" && console.warn(e), $ = (e, t, r) => {
|
|
416
428
|
const n = {};
|
|
417
429
|
return r.filter((s) => Array.isArray(s[e]) ? !0 : (typeof s[e] < "u" && ft(
|
|
418
430
|
`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`
|
|
@@ -421,9 +433,9 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
421
433
|
o.filter((l) => {
|
|
422
434
|
let a;
|
|
423
435
|
const u = Object.keys(l);
|
|
424
|
-
for (let
|
|
425
|
-
const
|
|
426
|
-
t.indexOf(T) !== -1 && !(a === "rel" && l[a].toLowerCase() === "canonical") && !(T === "rel" && l[T].toLowerCase() === "stylesheet") && (a = T), t.indexOf(
|
|
436
|
+
for (let m = 0; m < u.length; m += 1) {
|
|
437
|
+
const h = u[m], T = h.toLowerCase();
|
|
438
|
+
t.indexOf(T) !== -1 && !(a === "rel" && l[a].toLowerCase() === "canonical") && !(T === "rel" && l[T].toLowerCase() === "stylesheet") && (a = T), t.indexOf(h) !== -1 && (h === "innerHTML" || h === "cssText" || h === "itemprop") && (a = h);
|
|
427
439
|
}
|
|
428
440
|
if (!a || !l[a])
|
|
429
441
|
return !1;
|
|
@@ -452,11 +464,11 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
452
464
|
"href"
|
|
453
465
|
/* HREF */
|
|
454
466
|
], e),
|
|
455
|
-
bodyAttributes:
|
|
456
|
-
defer:
|
|
457
|
-
encode:
|
|
458
|
-
htmlAttributes:
|
|
459
|
-
linkTags:
|
|
467
|
+
bodyAttributes: V("bodyAttributes", e),
|
|
468
|
+
defer: M(e, L.DEFER),
|
|
469
|
+
encode: M(e, L.ENCODE_SPECIAL_CHARACTERS),
|
|
470
|
+
htmlAttributes: V("htmlAttributes", e),
|
|
471
|
+
linkTags: $(
|
|
460
472
|
"link",
|
|
461
473
|
[
|
|
462
474
|
"rel",
|
|
@@ -465,7 +477,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
465
477
|
],
|
|
466
478
|
e
|
|
467
479
|
),
|
|
468
|
-
metaTags:
|
|
480
|
+
metaTags: $(
|
|
469
481
|
"meta",
|
|
470
482
|
[
|
|
471
483
|
"name",
|
|
@@ -477,12 +489,12 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
477
489
|
],
|
|
478
490
|
e
|
|
479
491
|
),
|
|
480
|
-
noscriptTags:
|
|
492
|
+
noscriptTags: $("noscript", [
|
|
481
493
|
"innerHTML"
|
|
482
494
|
/* INNER_HTML */
|
|
483
495
|
], e),
|
|
484
496
|
onChangeClientState: ct(e),
|
|
485
|
-
scriptTags:
|
|
497
|
+
scriptTags: $(
|
|
486
498
|
"script",
|
|
487
499
|
[
|
|
488
500
|
"src",
|
|
@@ -491,12 +503,12 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
491
503
|
],
|
|
492
504
|
e
|
|
493
505
|
),
|
|
494
|
-
styleTags:
|
|
506
|
+
styleTags: $("style", [
|
|
495
507
|
"cssText"
|
|
496
508
|
/* CSS_TEXT */
|
|
497
509
|
], e),
|
|
498
510
|
title: lt(e),
|
|
499
|
-
titleAttributes:
|
|
511
|
+
titleAttributes: V("titleAttributes", e),
|
|
500
512
|
prioritizeSeoTags: dt(e, L.PRIORITIZE_SEO_TAGS)
|
|
501
513
|
}), Te = (e) => Array.isArray(e) ? e.join("") : e, pt = (e, t) => {
|
|
502
514
|
const r = Object.keys(e);
|
|
@@ -520,10 +532,10 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
520
532
|
return t ? `${t} ${n}` : n;
|
|
521
533
|
}, ""), yt = (e, t, r, n) => {
|
|
522
534
|
const s = ve(r), o = Te(t);
|
|
523
|
-
return s ? `<${e} ${
|
|
535
|
+
return s ? `<${e} ${S}="true" ${s}>${Q(
|
|
524
536
|
o,
|
|
525
537
|
n
|
|
526
|
-
)}</${e}>` : `<${e} ${
|
|
538
|
+
)}</${e}>` : `<${e} ${S}="true">${Q(
|
|
527
539
|
o,
|
|
528
540
|
n
|
|
529
541
|
)}</${e}>`;
|
|
@@ -534,20 +546,20 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
534
546
|
const d = typeof o[u] > "u" ? u : `${u}="${Q(o[u], r)}"`;
|
|
535
547
|
return a ? `${a} ${d}` : d;
|
|
536
548
|
}, ""), i = o.innerHTML || o.cssText || "", l = ht.indexOf(e) === -1;
|
|
537
|
-
return `${n}<${e} ${
|
|
549
|
+
return `${n}<${e} ${S}="true" ${c}${l ? "/>" : `>${i}</${e}>`}`;
|
|
538
550
|
}, ""), xe = (e, t = {}) => Object.keys(e).reduce((r, n) => {
|
|
539
551
|
const s = re[n];
|
|
540
552
|
return r[s || n] = e[n], r;
|
|
541
553
|
}, t), Tt = (e, t, r) => {
|
|
542
554
|
const n = {
|
|
543
555
|
key: t,
|
|
544
|
-
[
|
|
556
|
+
[S]: !0
|
|
545
557
|
}, s = xe(r, n);
|
|
546
558
|
return [O.createElement("title", s, t)];
|
|
547
559
|
}, G = (e, t) => t.map((r, n) => {
|
|
548
560
|
const s = {
|
|
549
561
|
key: n,
|
|
550
|
-
[
|
|
562
|
+
[S]: !0
|
|
551
563
|
};
|
|
552
564
|
return Object.keys(r).forEach((o) => {
|
|
553
565
|
const i = re[o] || o;
|
|
@@ -577,7 +589,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
577
589
|
};
|
|
578
590
|
}
|
|
579
591
|
}, vt = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
|
|
580
|
-
const s = Y(e,
|
|
592
|
+
const s = Y(e, B.meta), o = Y(t, B.link), c = Y(r, B.script);
|
|
581
593
|
return {
|
|
582
594
|
priorityMethods: {
|
|
583
595
|
toComponent: () => [
|
|
@@ -610,29 +622,29 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
610
622
|
titleAttributes: l,
|
|
611
623
|
prioritizeSeoTags: a
|
|
612
624
|
} = e;
|
|
613
|
-
let { linkTags: u, metaTags: d, scriptTags:
|
|
625
|
+
let { linkTags: u, metaTags: d, scriptTags: m } = e, h = {
|
|
614
626
|
toComponent: () => {
|
|
615
627
|
},
|
|
616
628
|
toString: () => ""
|
|
617
629
|
};
|
|
618
|
-
return a && ({ priorityMethods:
|
|
619
|
-
priority:
|
|
630
|
+
return a && ({ priorityMethods: h, linkTags: u, metaTags: d, scriptTags: m } = vt(e)), {
|
|
631
|
+
priority: h,
|
|
620
632
|
base: v("base", t, n),
|
|
621
633
|
bodyAttributes: v("bodyAttributes", r, n),
|
|
622
634
|
htmlAttributes: v("htmlAttributes", s, n),
|
|
623
635
|
link: v("link", u, n),
|
|
624
636
|
meta: v("meta", d, n),
|
|
625
637
|
noscript: v("noscript", o, n),
|
|
626
|
-
script: v("script",
|
|
638
|
+
script: v("script", m, n),
|
|
627
639
|
style: v("style", c, n),
|
|
628
640
|
title: v("title", { title: i, titleAttributes: l }, n)
|
|
629
641
|
};
|
|
630
642
|
}, X = xt, U = [], be = !!(typeof window < "u" && window.document && window.document.createElement), Z = class {
|
|
631
643
|
constructor(e, t) {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
644
|
+
C(this, "instances", []);
|
|
645
|
+
C(this, "canUseDOM", be);
|
|
646
|
+
C(this, "context");
|
|
647
|
+
C(this, "value", {
|
|
636
648
|
setHelmet: (e) => {
|
|
637
649
|
this.context.helmet = e;
|
|
638
650
|
},
|
|
@@ -661,20 +673,20 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
661
673
|
titleAttributes: {}
|
|
662
674
|
}));
|
|
663
675
|
}
|
|
664
|
-
}, bt = {},
|
|
676
|
+
}, bt = {}, Se = O.createContext(bt), I, Ce = (I = class extends te {
|
|
665
677
|
constructor(r) {
|
|
666
678
|
super(r);
|
|
667
|
-
|
|
668
|
-
this.helmetData = new Z(this.props.context || {},
|
|
679
|
+
C(this, "helmetData");
|
|
680
|
+
this.helmetData = new Z(this.props.context || {}, I.canUseDOM);
|
|
669
681
|
}
|
|
670
682
|
render() {
|
|
671
|
-
return /* @__PURE__ */ O.createElement(
|
|
683
|
+
return /* @__PURE__ */ O.createElement(Se.Provider, { value: this.helmetData.value }, this.props.children);
|
|
672
684
|
}
|
|
673
|
-
},
|
|
685
|
+
}, C(I, "canUseDOM", be), I), k = (e, t) => {
|
|
674
686
|
const r = document.head || document.querySelector(
|
|
675
687
|
"head"
|
|
676
688
|
/* HEAD */
|
|
677
|
-
), n = r.querySelectorAll(`${e}[${
|
|
689
|
+
), n = r.querySelectorAll(`${e}[${S}]`), s = [].slice.call(n), o = [];
|
|
678
690
|
let c;
|
|
679
691
|
return t && t.length && t.forEach((i) => {
|
|
680
692
|
const l = document.createElement(e);
|
|
@@ -688,7 +700,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
688
700
|
const u = a, d = typeof i[u] > "u" ? "" : i[u];
|
|
689
701
|
l.setAttribute(a, d);
|
|
690
702
|
}
|
|
691
|
-
l.setAttribute(
|
|
703
|
+
l.setAttribute(S, "true"), s.some((a, u) => (c = u, l.isEqualNode(a))) ? s.splice(c, 1) : o.push(l);
|
|
692
704
|
}), s.forEach((i) => {
|
|
693
705
|
var l;
|
|
694
706
|
return (l = i.parentNode) == null ? void 0 : l.removeChild(i);
|
|
@@ -700,7 +712,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
700
712
|
const r = document.getElementsByTagName(e)[0];
|
|
701
713
|
if (!r)
|
|
702
714
|
return;
|
|
703
|
-
const n = r.getAttribute(
|
|
715
|
+
const n = r.getAttribute(S), s = n ? n.split(",") : [], o = [...s], c = Object.keys(t);
|
|
704
716
|
for (const i of c) {
|
|
705
717
|
const l = t[i] || "";
|
|
706
718
|
r.getAttribute(i) !== l && r.setAttribute(i, l), s.indexOf(i) === -1 && s.push(i);
|
|
@@ -709,8 +721,8 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
709
721
|
}
|
|
710
722
|
for (let i = o.length - 1; i >= 0; i -= 1)
|
|
711
723
|
r.removeAttribute(o[i]);
|
|
712
|
-
s.length === o.length ? r.removeAttribute(
|
|
713
|
-
},
|
|
724
|
+
s.length === o.length ? r.removeAttribute(S) : r.getAttribute(S) !== c.join(",") && r.setAttribute(S, c.join(","));
|
|
725
|
+
}, St = (e, t) => {
|
|
714
726
|
typeof e < "u" && document.title !== e && (document.title = Te(e)), ee("title", t);
|
|
715
727
|
}, le = (e, t) => {
|
|
716
728
|
const {
|
|
@@ -724,31 +736,31 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
724
736
|
scriptTags: a,
|
|
725
737
|
styleTags: u,
|
|
726
738
|
title: d,
|
|
727
|
-
titleAttributes:
|
|
739
|
+
titleAttributes: m
|
|
728
740
|
} = e;
|
|
729
|
-
ee("body", n), ee("html", s),
|
|
730
|
-
const
|
|
741
|
+
ee("body", n), ee("html", s), St(d, m);
|
|
742
|
+
const h = {
|
|
731
743
|
baseTag: k("base", r),
|
|
732
744
|
linkTags: k("link", o),
|
|
733
745
|
metaTags: k("meta", c),
|
|
734
746
|
noscriptTags: k("noscript", i),
|
|
735
747
|
scriptTags: k("script", a),
|
|
736
748
|
styleTags: k("style", u)
|
|
737
|
-
}, T = {},
|
|
738
|
-
Object.keys(
|
|
739
|
-
const { newTags: E, oldTags:
|
|
740
|
-
E.length && (T[w] = E),
|
|
741
|
-
}), t && t(), l(e, T,
|
|
742
|
-
}, R = null,
|
|
749
|
+
}, T = {}, _ = {};
|
|
750
|
+
Object.keys(h).forEach((w) => {
|
|
751
|
+
const { newTags: E, oldTags: D } = h[w];
|
|
752
|
+
E.length && (T[w] = E), D.length && (_[w] = h[w].oldTags);
|
|
753
|
+
}), t && t(), l(e, T, _);
|
|
754
|
+
}, R = null, Ct = (e) => {
|
|
743
755
|
R && cancelAnimationFrame(R), e.defer ? R = requestAnimationFrame(() => {
|
|
744
756
|
le(e, () => {
|
|
745
757
|
R = null;
|
|
746
758
|
});
|
|
747
759
|
}) : (le(e), R = null);
|
|
748
|
-
}, At =
|
|
760
|
+
}, At = Ct, ce = class extends te {
|
|
749
761
|
constructor() {
|
|
750
762
|
super(...arguments);
|
|
751
|
-
|
|
763
|
+
C(this, "rendered", !1);
|
|
752
764
|
}
|
|
753
765
|
shouldComponentUpdate(t) {
|
|
754
766
|
return !at(t, this.props);
|
|
@@ -769,7 +781,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
769
781
|
return delete c.context, c;
|
|
770
782
|
})
|
|
771
783
|
);
|
|
772
|
-
|
|
784
|
+
Ce.canUseDOM ? At(s) : X && (n = X(s)), r(n);
|
|
773
785
|
}
|
|
774
786
|
// componentWillMount will be deprecated
|
|
775
787
|
// for SSR, initialize on first render
|
|
@@ -900,9 +912,9 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
900
912
|
const s = n;
|
|
901
913
|
n = new Z(s.context, !0), delete r.helmetData;
|
|
902
914
|
}
|
|
903
|
-
return n ? /* @__PURE__ */ O.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ O.createElement(
|
|
915
|
+
return n ? /* @__PURE__ */ O.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ O.createElement(Se.Consumer, null, (s) => /* @__PURE__ */ O.createElement(ce, { ...r, context: s }));
|
|
904
916
|
}
|
|
905
|
-
},
|
|
917
|
+
}, C(J, "defaultProps", {
|
|
906
918
|
defer: !0,
|
|
907
919
|
encodeSpecialCharacters: !0,
|
|
908
920
|
prioritizeSeoTags: !1
|
|
@@ -910,17 +922,17 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
910
922
|
const ue = (e, t) => e ? `${e} | ${t}` : t, qt = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
|
|
911
923
|
const [n, s] = x([
|
|
912
924
|
ue(r ?? "", e)
|
|
913
|
-
]), o =
|
|
925
|
+
]), o = p((a) => {
|
|
914
926
|
s((u) => [...u, ue(r ?? "", a)]);
|
|
915
|
-
}, [r]), c =
|
|
927
|
+
}, [r]), c = p(() => {
|
|
916
928
|
s((a) => a.length > 1 ? a.slice(0, -1) : a);
|
|
917
929
|
}, [s]), i = g(() => n.at(-1) ?? "", [n]), l = g(() => ({ addHelmet: o, removeHelmet: c }), [o, c]);
|
|
918
|
-
return /* @__PURE__ */ f.jsx(Re.Provider, { value: l, children: /* @__PURE__ */ f.jsxs(
|
|
930
|
+
return /* @__PURE__ */ f.jsx(Re.Provider, { value: l, children: /* @__PURE__ */ f.jsxs(Ce, { children: [
|
|
919
931
|
/* @__PURE__ */ f.jsx(Et, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: i }) }),
|
|
920
932
|
t
|
|
921
933
|
] }) });
|
|
922
934
|
}, fe = 50, Ot = () => {
|
|
923
|
-
const { texts: { confirm: e } } =
|
|
935
|
+
const { texts: { confirm: e } } = H(z), { onConfirm: t, onCancel: r, text: n, show: s, textSm: o } = Ue(), c = g(() => o === void 0 ? n.length > fe : o, [n, o]), i = g(() => n.length > fe, [n]), l = p((a) => {
|
|
924
936
|
if (s)
|
|
925
937
|
switch (a.key) {
|
|
926
938
|
case "Enter":
|
|
@@ -944,7 +956,7 @@ export {
|
|
|
944
956
|
Nt as AuthProvider,
|
|
945
957
|
pe as DelegationContext,
|
|
946
958
|
Gt as DelegationProvider,
|
|
947
|
-
|
|
959
|
+
Bt as FormDisabledContext,
|
|
948
960
|
Jt as FormDisabledProvider,
|
|
949
961
|
Re as HelmetContext,
|
|
950
962
|
qt as HelmetProvider,
|
|
@@ -952,7 +964,7 @@ export {
|
|
|
952
964
|
Ut as LoadingProvider,
|
|
953
965
|
z as LuminusComponentsContext,
|
|
954
966
|
Rt as LuminusComponentsProvider,
|
|
955
|
-
|
|
967
|
+
He as UserContext,
|
|
956
968
|
Ft as UserProvider,
|
|
957
|
-
|
|
969
|
+
Vt as useFormDisabledContext
|
|
958
970
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar.es-Cz-_XfUi.cjs"),b=require("./useLocalStorageState-CIf5aDoR.cjs"),l=require("react"),p=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const q=t=>{let e="pending",n;const r=t.then(a=>{e="success",n=a},a=>{e="error",n=a});return()=>{switch(e){case"pending":throw r;case"success":return n;case"error":throw n;default:throw new Error("Unknown status")}}};function I(t,e){const n=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[r,a]=l.useState(null);return l.useEffect(()=>{(async()=>{const u=n.get(t).then(c=>c.data);a(q(u))})()},[n,t]),r}const E=(t,e,n)=>{let r="pending",a;const d=t.then(u=>{r="success",a=u},u=>{const c=u==null?void 0:u.response;(c==null?void 0:c.status)===404&&n?(r="error-404",a=u):(r="error",a=u)});return()=>{switch(r){case"pending":throw d;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},S={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},x=(t,{loadOnInit:e=S.loadOnInit,enabled:n=S.enabled,silent:r=S.silent,nullStateBeforeLoad:a=S.nullStateBeforeLoad,nullStateOnFail:d=S.nullStateOnFail,customApiUrl:u,customBearerToken:c,dataTransformer:f,errorBoundaryOn404:o}=S)=>{const i=s.useAxios({silent:r,customToken:c,differentBaseUrl:u,noToastOnStatus:o?[404]:void 0}),{startLoading:g,stopLoading:v}=l.useContext(s.LoadingContext),y=l.useRef(0),{isAuthenticated:C}=s.useAuth(),[k,w]=l.useState(null),D=l.useCallback(async(m,P)=>{if(!C()||n===!1)return;!r&&g(`loadData-${t}-${P}`),a&&w(null);const T=i.get(t,{signal:m}).then(A=>f?f(A.data):A.data).finally(()=>!r&&v(`loadData-${t}-${P}`));w(E(T,d??!1,o??!1))},[C,n,r,g,t,a,i,f,v,d,o]);return l.useEffect(()=>{if(e===!1)return;const m=new AbortController;return D(m.signal,++y.current),()=>{m.abort()}},[D,e]),{data:k,setData:w,reloadData:D}},h={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},B=(t,{storageKey:e=h.storageKey,requiredHeight:n=h.requiredHeight,retryInterval:r=h.retryInterval}=h)=>{const[a,d]=l.useState(!1),u=l.useRef(null),c=l.useCallback(()=>{const o=localStorage.getItem(e);return localStorage.removeItem(e),o===null?null:Number(o)},[e]),f=l.useCallback(o=>{localStorage.setItem(e,o)},[e]);return l.useEffect(()=>{const o=window.setInterval(()=>{if(!a&&t.current!==null&&t.current.getBoundingClientRect().height>n){d(!0);const i=c();i!==null&&t.current.scrollTo({top:i}),window.clearInterval(o)}},r);return()=>{window.clearTimeout(o)}},[a,n,c,r,t]),l.useEffect(()=>{var i;const o=new AbortController;return(i=t.current)==null||i.addEventListener("scrollend",()=>{var g;u.current=((g=t.current)==null?void 0:g.scrollTop)??0,f((u.current??0).toString())},{signal:o.signal}),()=>o.abort()},[f,t]),{saveValue:f,retrieveValue:c}};exports.cancelToken=s.cancelToken;exports.useAuth=s.useAuth;exports.useAxios=s.useAxios;exports.useClickOutside=s.useClickOutside;exports.useClipboard=s.useClipboard;exports.useConfirm=s.useConfirm;exports.useFormControlType=s.useFormControlType;exports.useKeyPress=s.useKeyPress;exports.useNotifications=s.useNotifications;exports.usePermissions=s.usePermissions;exports.usePrompt=s.usePrompt;exports.useWindowSize=s.useWindowSize;exports.useZodSchemaTypes=s.useZodSchemaTypes;exports.useGetApiData=b.useGetApiData;exports.useLocalStorageState=b.useLocalStorageState;exports.useEmployeePhotoPath=p.useEmployeePhotoPath;exports.useRenderDraggableInPortal=p.useRenderDraggableInPortal;exports.useSearchQuery=p.useSearchQuery;exports.useSearchQueryState=p.useSearchQueryState;exports.useGetApiDataBound=x;exports.useGetDataBound=I;exports.useScrollSave=B;
|