react-luminus-components 1.3.174 → 1.3.175
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 +54 -64
- package/dist/{Loading-BNbddGfQ.js → Loading-C_Obnmtl.js} +1 -1
- package/dist/Loading-D6V3KNi5.cjs +1 -0
- package/dist/components/IconPicker/IconPicker.d.ts +12 -0
- package/dist/components/ShortcutLinks/ShortcutLinks/ShortcutLinks.d.ts +7 -0
- package/dist/components/ShortcutLinks/ShortcutLinks/comps/ShortcutLink/ShortcutLink.d.ts +10 -0
- package/dist/components/ShortcutLinks/ShortcutLinks/comps/index.d.ts +1 -0
- package/dist/components/ShortcutLinks/ShortcutLinksContext/ShortcutLinksContext.d.ts +9 -0
- package/dist/components/ShortcutLinks/ShortcutLinksContext/ShortcutLinksProvider.d.ts +7 -0
- package/dist/components/ShortcutLinks/ShortcutLinksContext/useShortcutLinksContext.d.ts +2 -0
- package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/ShortcutLinksSetupModal.d.ts +10 -0
- package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/ShortcutLinkSetupItem.d.ts +12 -0
- package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/comps/ShortcutLinkItemEdit/ShortcutLinkItemEdit.d.ts +12 -0
- package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/comps/index.d.ts +1 -0
- package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/index.d.ts +1 -0
- package/dist/components/ShortcutLinks/common/SHORTCUT_LINK_SETTINGS.d.ts +1 -0
- package/dist/components/ShortcutLinks/common/types/ShortcutLinkObject.d.ts +7 -0
- package/dist/components/ShortcutLinks/index.d.ts +4 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +61 -62
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +35 -36
- package/dist/layout/TopBar/TopBar.d.ts +2 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +68 -65
- package/dist/main.cjs.js +2 -2
- package/dist/main.d.ts +5 -0
- package/dist/main.es.js +3466 -3350
- package/dist/models/luminus-context-types/CommonLuminusIcons.d.ts +3 -1
- package/dist/models/texts/ComponentsContextTexts.d.ts +2 -0
- package/dist/models/texts/ShortcutLinkTexts.d.ts +4 -0
- package/dist/{ResponsiveContextDropdown-86w_MfdQ.cjs → nivo-bar.es-BJen_dSO.cjs} +5 -5
- package/dist/{ResponsiveContextDropdown-CW7ZqSAm.js → nivo-bar.es-DVe_3U7Q.js} +10029 -10029
- package/dist/{searchUtils-7dexyjD8.js → searchUtils-Da3ZqNhn.js} +1 -1
- package/dist/searchUtils-DhTauQFe.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/{useClipboard-D-ryUcDP.js → useClipboard-ClYXMKiq.js} +1 -1
- package/dist/useClipboard-Cs_XUgmm.cjs +1 -0
- package/dist/useLocalStorageState-Bq8ZhpGM.js +65 -0
- package/dist/useLocalStorageState-dLgBb482.cjs +1 -0
- package/dist/usePermissions-BQ-ARPG5.cjs +1 -0
- package/dist/{usePermissions-KbW2vB5D.js → usePermissions-Eu0uaFgI.js} +3 -3
- package/dist/utils/constants/CommonLuminusIconsArray.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +64 -43
- package/dist/variables.scss +165 -165
- package/package.json +116 -116
- package/dist/Loading-CZc1CMdv.cjs +0 -1
- package/dist/searchUtils-B4Bf1m3p.cjs +0 -1
- package/dist/useClipboard-CCVCJIrq.cjs +0 -1
- package/dist/useGetApiData-BZiEPMRQ.js +0 -52
- package/dist/useGetApiData-LorHvE1b.cjs +0 -1
- package/dist/useLocalStorageState-BFc8Gc8H.cjs +0 -1
- package/dist/useLocalStorageState-Bt99kkCr.js +0 -17
- package/dist/usePermissions-CMupzyaq.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Oe = (e, t, r) => t in e ?
|
|
3
|
-
var
|
|
4
|
-
import { t as N,
|
|
5
|
-
import E, { useState as C, useCallback as p, useMemo as
|
|
6
|
-
import { EventType as
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var Oe = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var S = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { t as N, bj as Ee, j as f, bk as we, $ as z, an as Ie, bl as fe, at as b, ak as je, a0 as G, bm as De, ar as Pe, ap as ke, aV as de, bn as me, aW as Le, aX as P, aq as He, bo as $e, aD as se, bp as _e, bq as pe, br as oe, bs as Me, ao as Re } from "./nivo-bar.es-DVe_3U7Q.js";
|
|
5
|
+
import E, { useState as C, useCallback as p, useMemo as A, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
|
|
6
|
+
import { EventType as J } from "@azure/msal-browser";
|
|
7
7
|
import { MsalProvider as Ue } from "@azure/msal-react";
|
|
8
8
|
import "react-router-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as Ne } from "./Loading-
|
|
12
|
-
import {
|
|
13
|
-
import { u as qe } from "./useLocalStorageState-Bt99kkCr.js";
|
|
11
|
+
import { L as Ne } from "./Loading-C_Obnmtl.js";
|
|
12
|
+
import { a as Fe, u as qe } from "./useLocalStorageState-Bq8ZhpGM.js";
|
|
14
13
|
function Ge(e) {
|
|
15
14
|
const t = N(e);
|
|
16
15
|
return t.setHours(23, 59, 59, 999), t;
|
|
@@ -33,9 +32,9 @@ const Be = ({ children: e }) => {
|
|
|
33
32
|
r(!0), s(c);
|
|
34
33
|
}, []), l = p(() => {
|
|
35
34
|
r(!1);
|
|
36
|
-
}, []), a =
|
|
35
|
+
}, []), a = A(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
|
|
37
36
|
return /* @__PURE__ */ f.jsxs(we.Provider, { value: a, children: [
|
|
38
|
-
/* @__PURE__ */ f.jsx(
|
|
37
|
+
/* @__PURE__ */ f.jsx(St, {}),
|
|
39
38
|
e
|
|
40
39
|
] });
|
|
41
40
|
}, Ye = () => {
|
|
@@ -47,33 +46,33 @@ const Be = ({ children: e }) => {
|
|
|
47
46
|
D(() => {
|
|
48
47
|
t === !0 && l(s.defaultValue ?? "");
|
|
49
48
|
}, [t, s.defaultValue]);
|
|
50
|
-
const i =
|
|
49
|
+
const i = A(() => ({
|
|
51
50
|
value: o,
|
|
52
51
|
onChange: (u) => l(u.currentTarget.value),
|
|
53
52
|
className: "w-100",
|
|
54
53
|
autoFocus: !0,
|
|
55
54
|
tabIndex: 0
|
|
56
55
|
}), [o]);
|
|
57
|
-
return /* @__PURE__ */ f.jsxs(
|
|
58
|
-
/* @__PURE__ */ f.jsx(
|
|
56
|
+
return /* @__PURE__ */ f.jsxs(b, { show: t, size: "sm", centered: !0, onHide: a, children: [
|
|
57
|
+
/* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: r }) }),
|
|
59
58
|
/* @__PURE__ */ f.jsxs("form", { onSubmit: c, children: [
|
|
60
|
-
/* @__PURE__ */ f.jsxs(
|
|
59
|
+
/* @__PURE__ */ f.jsxs(b.Body, { children: [
|
|
61
60
|
s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...i, rows: 5 }) : void 0,
|
|
62
61
|
s.input === "input" ? /* @__PURE__ */ f.jsx(je, { ...i, type: s.type }) : void 0
|
|
63
62
|
] }),
|
|
64
|
-
/* @__PURE__ */ f.jsxs(
|
|
63
|
+
/* @__PURE__ */ f.jsxs(b.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
65
64
|
/* @__PURE__ */ f.jsx(G, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
|
|
66
65
|
/* @__PURE__ */ f.jsx(G, { color: "primary", disabled: s.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
67
66
|
] })
|
|
68
67
|
] })
|
|
69
68
|
] });
|
|
70
|
-
},
|
|
69
|
+
}, We = ({ children: e }) => {
|
|
71
70
|
const [t, r] = C(!1), [n, s] = C(""), [o, l] = C({ input: "textarea", type: "text" }), a = he(() => {
|
|
72
71
|
}), c = p((d) => {
|
|
73
72
|
s(d), r(!0);
|
|
74
73
|
}, []), i = p(() => {
|
|
75
74
|
r(!1);
|
|
76
|
-
}, []), u =
|
|
75
|
+
}, []), u = A(() => ({
|
|
77
76
|
isShown: t,
|
|
78
77
|
text: n,
|
|
79
78
|
showPrompt: c,
|
|
@@ -86,8 +85,8 @@ const Be = ({ children: e }) => {
|
|
|
86
85
|
e,
|
|
87
86
|
/* @__PURE__ */ f.jsx(Ye, {})
|
|
88
87
|
] });
|
|
89
|
-
},
|
|
90
|
-
const c =
|
|
88
|
+
}, Ht = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
|
|
89
|
+
const c = A(() => ({
|
|
91
90
|
axiosOptions: t,
|
|
92
91
|
cookieDomain: e,
|
|
93
92
|
language: r,
|
|
@@ -104,21 +103,21 @@ const Be = ({ children: e }) => {
|
|
|
104
103
|
n,
|
|
105
104
|
l
|
|
106
105
|
]);
|
|
107
|
-
return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(
|
|
106
|
+
return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(We, { children: [
|
|
108
107
|
/* @__PURE__ */ f.jsx(De, {}),
|
|
109
108
|
a
|
|
110
109
|
] }) }) });
|
|
111
|
-
},
|
|
110
|
+
}, $t = ({ children: e }) => {
|
|
112
111
|
const [t, r] = C(!1), [n] = C(/* @__PURE__ */ new Set()), s = p((a) => {
|
|
113
112
|
n.add(a), r(!0);
|
|
114
113
|
}, [n]), o = p((a) => {
|
|
115
114
|
n.delete(a), n.size === 0 && r(!1);
|
|
116
|
-
}, [n]), l =
|
|
115
|
+
}, [n]), l = A(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
|
|
117
116
|
return /* @__PURE__ */ f.jsxs(Pe.Provider, { value: l, children: [
|
|
118
117
|
t && /* @__PURE__ */ f.jsx(Ne, {}),
|
|
119
118
|
e
|
|
120
119
|
] });
|
|
121
|
-
},
|
|
120
|
+
}, _t = ({ children: e }) => {
|
|
122
121
|
const t = ke(), { msalInstance: r } = $(de), { delegation: n, setDelegation: s, setAvailableDelegations: o, refreshAvailableDelegations: l } = $(me), { getToken: a } = Le(), [c, i] = C(null), u = p(async () => {
|
|
123
122
|
const y = await a();
|
|
124
123
|
y && i(y);
|
|
@@ -163,7 +162,7 @@ const Be = ({ children: e }) => {
|
|
|
163
162
|
D(() => {
|
|
164
163
|
if (r) {
|
|
165
164
|
const y = r.addEventCallback((v) => {
|
|
166
|
-
if (v.eventType ===
|
|
165
|
+
if (v.eventType === J.LOGIN_SUCCESS && v.payload) {
|
|
167
166
|
const K = v.payload;
|
|
168
167
|
i(K.accessToken);
|
|
169
168
|
}
|
|
@@ -183,15 +182,15 @@ const Be = ({ children: e }) => {
|
|
|
183
182
|
D(() => {
|
|
184
183
|
ne(c);
|
|
185
184
|
}, [c, n == null ? void 0 : n.id, ne]);
|
|
186
|
-
const
|
|
185
|
+
const Se = A(() => ({
|
|
187
186
|
user: m.user,
|
|
188
187
|
userLoginState: m,
|
|
189
188
|
loginUser: O,
|
|
190
189
|
logoutUser: I
|
|
191
190
|
}), [m, O, I]);
|
|
192
|
-
return /* @__PURE__ */ f.jsx(He.Provider, { value:
|
|
193
|
-
},
|
|
194
|
-
const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n =
|
|
191
|
+
return /* @__PURE__ */ f.jsx(He.Provider, { value: Se, children: e });
|
|
192
|
+
}, Mt = ({ ...e }) => {
|
|
193
|
+
const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = A(() => ({
|
|
195
194
|
useMsal: e.useMsal ?? !1,
|
|
196
195
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
197
196
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : [],
|
|
@@ -200,7 +199,7 @@ const Be = ({ children: e }) => {
|
|
|
200
199
|
return D(() => {
|
|
201
200
|
if (e.useMsal) {
|
|
202
201
|
const s = e.msalInstance.addEventCallback((o) => {
|
|
203
|
-
if (o.eventType ===
|
|
202
|
+
if (o.eventType === J.LOGIN_SUCCESS || o.eventType === J.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
204
203
|
const l = o.payload, a = l.account;
|
|
205
204
|
e.msalInstance.setActiveAccount(a);
|
|
206
205
|
const c = l.accessToken, i = l.expiresOn;
|
|
@@ -221,13 +220,13 @@ const Be = ({ children: e }) => {
|
|
|
221
220
|
return () => {
|
|
222
221
|
};
|
|
223
222
|
}, [e, r, t]), /* @__PURE__ */ f.jsx(de.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ue, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
224
|
-
},
|
|
225
|
-
const [r, n, s] =
|
|
223
|
+
}, Rt = ({ children: e, relativeEndpoint: t }) => {
|
|
224
|
+
const [r, n, s] = Fe("user-delegation", null), o = A(() => {
|
|
226
225
|
if (!r)
|
|
227
226
|
return null;
|
|
228
227
|
const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) : ze();
|
|
229
228
|
return Ke(new Date(Date.now()), { start: d, end: h }) ? r : (n(null), null);
|
|
230
|
-
}, [r, n]), { data: l, setData: a, reloadData: c } =
|
|
229
|
+
}, [r, n]), { data: l, setData: a, reloadData: c } = qe(t, {
|
|
231
230
|
nullStateBeforeLoad: !1,
|
|
232
231
|
nullStateOnFail: !0
|
|
233
232
|
}), i = he(null);
|
|
@@ -246,7 +245,7 @@ const Be = ({ children: e }) => {
|
|
|
246
245
|
window.removeEventListener("focus", d);
|
|
247
246
|
};
|
|
248
247
|
}, [s, c]);
|
|
249
|
-
const u =
|
|
248
|
+
const u = A(() => ({
|
|
250
249
|
delegation: o,
|
|
251
250
|
setDelegation: n,
|
|
252
251
|
availableDelegations: l,
|
|
@@ -261,7 +260,7 @@ const Be = ({ children: e }) => {
|
|
|
261
260
|
]);
|
|
262
261
|
return /* @__PURE__ */ f.jsx(me.Provider, { value: u, children: e });
|
|
263
262
|
};
|
|
264
|
-
var
|
|
263
|
+
var Je = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
265
264
|
function F(e, t) {
|
|
266
265
|
if (e === t) return !0;
|
|
267
266
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -300,7 +299,7 @@ function F(e, t) {
|
|
|
300
299
|
if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
|
|
301
300
|
for (n = r; n-- !== 0; )
|
|
302
301
|
if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
|
|
303
|
-
if (
|
|
302
|
+
if (Je && e instanceof Element) return !1;
|
|
304
303
|
for (n = r; n-- !== 0; )
|
|
305
304
|
if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !F(e[s[n]], t[s[n]]))
|
|
306
305
|
return !1;
|
|
@@ -627,10 +626,10 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
627
626
|
};
|
|
628
627
|
}, Q = gt, U = [], xe = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
|
|
629
628
|
constructor(e, t) {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
629
|
+
S(this, "instances", []);
|
|
630
|
+
S(this, "canUseDOM", xe);
|
|
631
|
+
S(this, "context");
|
|
632
|
+
S(this, "value", {
|
|
634
633
|
setHelmet: (e) => {
|
|
635
634
|
this.context.helmet = e;
|
|
636
635
|
},
|
|
@@ -659,16 +658,16 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
659
658
|
titleAttributes: {}
|
|
660
659
|
}));
|
|
661
660
|
}
|
|
662
|
-
}, Tt = {}, Ce = E.createContext(Tt), j,
|
|
661
|
+
}, Tt = {}, Ce = E.createContext(Tt), j, Ae = (j = class extends te {
|
|
663
662
|
constructor(r) {
|
|
664
663
|
super(r);
|
|
665
|
-
|
|
664
|
+
S(this, "helmetData");
|
|
666
665
|
this.helmetData = new X(this.props.context || {}, j.canUseDOM);
|
|
667
666
|
}
|
|
668
667
|
render() {
|
|
669
668
|
return /* @__PURE__ */ E.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
|
|
670
669
|
}
|
|
671
|
-
},
|
|
670
|
+
}, S(j, "canUseDOM", xe), j), k = (e, t) => {
|
|
672
671
|
const r = document.head || document.querySelector(
|
|
673
672
|
"head"
|
|
674
673
|
/* HEAD */
|
|
@@ -746,7 +745,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
746
745
|
}, Ct = xt, ce = class extends te {
|
|
747
746
|
constructor() {
|
|
748
747
|
super(...arguments);
|
|
749
|
-
|
|
748
|
+
S(this, "rendered", !1);
|
|
750
749
|
}
|
|
751
750
|
shouldComponentUpdate(t) {
|
|
752
751
|
return !nt(t, this.props);
|
|
@@ -767,7 +766,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
767
766
|
return delete l.context, l;
|
|
768
767
|
})
|
|
769
768
|
);
|
|
770
|
-
|
|
769
|
+
Ae.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
|
|
771
770
|
}
|
|
772
771
|
// componentWillMount will be deprecated
|
|
773
772
|
// for SSR, initialize on first render
|
|
@@ -782,7 +781,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
782
781
|
render() {
|
|
783
782
|
return this.init(), null;
|
|
784
783
|
}
|
|
785
|
-
},
|
|
784
|
+
}, W, At = (W = class extends te {
|
|
786
785
|
shouldComponentUpdate(e) {
|
|
787
786
|
return !tt(ie(this.props, "helmetData"), ie(e, "helmetData"));
|
|
788
787
|
}
|
|
@@ -900,28 +899,28 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
900
899
|
}
|
|
901
900
|
return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ E.createElement(ce, { ...r, context: s }));
|
|
902
901
|
}
|
|
903
|
-
},
|
|
902
|
+
}, S(W, "defaultProps", {
|
|
904
903
|
defer: !0,
|
|
905
904
|
encodeSpecialCharacters: !0,
|
|
906
905
|
prioritizeSeoTags: !1
|
|
907
|
-
}),
|
|
908
|
-
const ue = (e, t) => e ? `${e} | ${t}` : t,
|
|
906
|
+
}), W);
|
|
907
|
+
const ue = (e, t) => e ? `${e} | ${t}` : t, Ut = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
|
|
909
908
|
const [n, s] = C([
|
|
910
909
|
ue(r ?? "", e)
|
|
911
910
|
]), o = p((i) => {
|
|
912
911
|
s((u) => [...u, ue(r ?? "", i)]);
|
|
913
912
|
}, [r]), l = p(() => {
|
|
914
913
|
s((i) => i.length > 1 ? i.slice(0, -1) : i);
|
|
915
|
-
}, [s]), a =
|
|
916
|
-
return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(
|
|
917
|
-
/* @__PURE__ */ f.jsx(
|
|
914
|
+
}, [s]), a = A(() => n.at(-1) ?? "", [n]), c = A(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
|
|
915
|
+
return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(Ae, { children: [
|
|
916
|
+
/* @__PURE__ */ f.jsx(At, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
|
|
918
917
|
t
|
|
919
918
|
] }) });
|
|
920
|
-
},
|
|
919
|
+
}, St = () => {
|
|
921
920
|
const { texts: { confirm: e } } = $(z), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
|
|
922
|
-
return /* @__PURE__ */ f.jsxs(
|
|
923
|
-
/* @__PURE__ */ f.jsx(
|
|
924
|
-
/* @__PURE__ */ f.jsx(
|
|
921
|
+
return /* @__PURE__ */ f.jsxs(b, { show: s, size: "sm", centered: !0, onHide: r, children: [
|
|
922
|
+
/* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: n }) }),
|
|
923
|
+
/* @__PURE__ */ f.jsx(b.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
925
924
|
/* @__PURE__ */ f.jsx(G, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: r, children: e.no }),
|
|
926
925
|
/* @__PURE__ */ f.jsx(G, { type: "button", color: "primary", onClick: t, className: "w-100 ml", children: e.yes })
|
|
927
926
|
] }) })
|
|
@@ -929,15 +928,15 @@ const ue = (e, t) => e ? `${e} | ${t}` : t, Nt = ({ defaultHelmet: e, children:
|
|
|
929
928
|
};
|
|
930
929
|
export {
|
|
931
930
|
de as AuthContext,
|
|
932
|
-
|
|
931
|
+
Mt as AuthProvider,
|
|
933
932
|
me as DelegationContext,
|
|
934
|
-
|
|
933
|
+
Rt as DelegationProvider,
|
|
935
934
|
Me as HelmetContext,
|
|
936
|
-
|
|
935
|
+
Ut as HelmetProvider,
|
|
937
936
|
Pe as LoadingContext,
|
|
938
|
-
|
|
937
|
+
$t as LoadingProvider,
|
|
939
938
|
z as LuminusComponentsContext,
|
|
940
|
-
|
|
939
|
+
Ht as LuminusComponentsProvider,
|
|
941
940
|
He as UserContext,
|
|
942
|
-
|
|
941
|
+
_t as UserProvider
|
|
943
942
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar.es-BJen_dSO.cjs"),P=require("./useWindowSize-CE6DJWzn.cjs"),x=require("./usePermissions-BQ-ARPG5.cjs"),d=require("./useClipboard-Cs_XUgmm.cjs"),q=require("./useLocalStorageState-dLgBb482.cjs"),c=require("react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const B=r=>{let e="pending",a;const t=r.then(s=>{e="success",a=s},s=>{e="error",a=s});return()=>{switch(e){case"pending":throw t;case"success":return a;case"error":throw a;default:throw new Error("Unknown status")}}};function L(r,e){const a=u.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[t,s]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=a.get(r).then(o=>o.data);s(B(n))})()},[a,r]),t}const E=(r,e,a)=>{let t="pending",s;const l=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&a?(t="error-404",s=n):(t="error",s=n)});return()=>{switch(t){case"pending":throw l;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},i={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},G=(r,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const g=u.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:w,stopLoading:D}=c.useContext(u.LoadingContext),b=c.useRef(0),{isAuthenticated:y}=u.useAuth(),[k,m]=c.useState(null),p=c.useCallback(async(f,C)=>{if(!y()||a===!1)return;!t&&w(`loadData-${r}-${C}`),s&&m(null);const T=g.get(r,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&D(`loadData-${r}-${C}`));m(E(T,l??!1,S??!1))},[y,a,t,w,r,s,g,h,D,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return p(f.signal,++b.current),()=>{f.abort()}},[p,e]),{data:k,setData:m,reloadData:p}};exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useNotifications=u.useNotifications;exports.usePrompt=u.usePrompt;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useClickOutside=P.useClickOutside;exports.useWindowSize=P.useWindowSize;exports.usePermissions=x.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=q.useGetApiData;exports.useLocalStorageState=q.useLocalStorageState;exports.useGetApiDataBound=G;exports.useGetDataBound=L;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ap as x, ar as L, aW as P } from "./nivo-bar.es-DVe_3U7Q.js";
|
|
2
|
+
import { bt as j, ao as q, ac as H, as as J, an as M, bu as V } from "./nivo-bar.es-DVe_3U7Q.js";
|
|
3
3
|
import { a as Y, u as _ } from "./useWindowSize-OLYtjFv_.js";
|
|
4
|
-
import { u as et } from "./usePermissions-
|
|
5
|
-
import { u as at, d as ot, a as
|
|
6
|
-
import { u as lt } from "./
|
|
7
|
-
import { useState as b, useEffect as C, useContext as
|
|
8
|
-
import { u as ft } from "./useLocalStorageState-Bt99kkCr.js";
|
|
4
|
+
import { u as et } from "./usePermissions-Eu0uaFgI.js";
|
|
5
|
+
import { u as at, d as ot, a as nt, b as rt, c as ut } from "./useClipboard-ClYXMKiq.js";
|
|
6
|
+
import { u as lt, a as it } from "./useLocalStorageState-Bq8ZhpGM.js";
|
|
7
|
+
import { useState as b, useEffect as C, useContext as T, useRef as U, useCallback as $ } from "react";
|
|
9
8
|
import "react-router-dom";
|
|
10
9
|
import "react-hook-form";
|
|
11
10
|
import "react-flexmonster";
|
|
12
11
|
import "@azure/msal-browser";
|
|
13
12
|
import "@azure/msal-react";
|
|
14
|
-
const
|
|
13
|
+
const B = (o) => {
|
|
15
14
|
let t = "pending", a;
|
|
16
15
|
const e = o.then((s) => {
|
|
17
16
|
t = "success", a = s;
|
|
@@ -31,26 +30,26 @@ const $ = (o) => {
|
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
|
-
function
|
|
35
|
-
const a =
|
|
33
|
+
function I(o, t) {
|
|
34
|
+
const a = x({
|
|
36
35
|
silent: !0,
|
|
37
36
|
differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
|
|
38
37
|
customToken: t == null ? void 0 : t.customToken
|
|
39
38
|
}), [e, s] = b(null);
|
|
40
39
|
return C(() => {
|
|
41
40
|
(async () => {
|
|
42
|
-
const
|
|
43
|
-
s(
|
|
41
|
+
const n = a.get(o).then((r) => r.data);
|
|
42
|
+
s(B(n));
|
|
44
43
|
})();
|
|
45
44
|
}, [a, o]), e;
|
|
46
45
|
}
|
|
47
46
|
const E = (o, t, a) => {
|
|
48
47
|
let e = "pending", s;
|
|
49
|
-
const c = o.then((
|
|
50
|
-
e = "success", s =
|
|
51
|
-
}, (
|
|
52
|
-
const
|
|
53
|
-
(
|
|
48
|
+
const c = o.then((n) => {
|
|
49
|
+
e = "success", s = n;
|
|
50
|
+
}, (n) => {
|
|
51
|
+
const r = n == null ? void 0 : n.response;
|
|
52
|
+
(r == null ? void 0 : r.status) === 404 && a ? (e = "error-404", s = n) : (e = "error", s = n);
|
|
54
53
|
});
|
|
55
54
|
return () => {
|
|
56
55
|
switch (e) {
|
|
@@ -72,19 +71,19 @@ const E = (o, t, a) => {
|
|
|
72
71
|
enabled: !0,
|
|
73
72
|
nullStateBeforeLoad: !0,
|
|
74
73
|
nullStateOnFail: !1
|
|
75
|
-
},
|
|
76
|
-
const p =
|
|
74
|
+
}, K = (o, { loadOnInit: t = u.loadOnInit, enabled: a = u.enabled, silent: e = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: c = u.nullStateOnFail, customApiUrl: n, customBearerToken: r, dataTransformer: i, errorBoundaryOn404: f } = u) => {
|
|
75
|
+
const p = x({
|
|
77
76
|
silent: e,
|
|
78
|
-
customToken:
|
|
79
|
-
differentBaseUrl:
|
|
77
|
+
customToken: r,
|
|
78
|
+
differentBaseUrl: n,
|
|
80
79
|
noToastOnStatus: f ? [404] : void 0
|
|
81
|
-
}), { startLoading: h, stopLoading: w } =
|
|
80
|
+
}), { startLoading: h, stopLoading: w } = T(L), k = U(0), { isAuthenticated: g } = P(), [y, d] = b(null), m = $(async (l, D) => {
|
|
82
81
|
if (!g() || a === !1)
|
|
83
82
|
return;
|
|
84
83
|
!e && h(`loadData-${o}-${D}`), s && d(null);
|
|
85
84
|
const A = p.get(o, {
|
|
86
85
|
signal: l
|
|
87
|
-
}).then((
|
|
86
|
+
}).then((S) => i ? i(S.data) : S.data).finally(() => !e && w(`loadData-${o}-${D}`));
|
|
88
87
|
d(E(A, c ?? !1, f ?? !1));
|
|
89
88
|
}, [
|
|
90
89
|
g,
|
|
@@ -109,24 +108,24 @@ const E = (o, t, a) => {
|
|
|
109
108
|
}, [m, t]), { data: y, setData: d, reloadData: m };
|
|
110
109
|
};
|
|
111
110
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
j as cancelToken,
|
|
112
|
+
P as useAuth,
|
|
113
|
+
x as useAxios,
|
|
115
114
|
Y as useClickOutside,
|
|
116
115
|
at as useClipboard,
|
|
117
|
-
|
|
116
|
+
q as useConfirm,
|
|
118
117
|
ot as useEmployeePhotoPath,
|
|
119
|
-
|
|
118
|
+
H as useFormControlType,
|
|
120
119
|
lt as useGetApiData,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
K as useGetApiDataBound,
|
|
121
|
+
I as useGetDataBound,
|
|
122
|
+
nt as useKeyPress,
|
|
123
|
+
it as useLocalStorageState,
|
|
124
|
+
J as useNotifications,
|
|
126
125
|
et as usePermissions,
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
M as usePrompt,
|
|
127
|
+
rt as useSearchQuery,
|
|
129
128
|
ut as useSearchQueryState,
|
|
130
129
|
_ as useWindowSize,
|
|
131
|
-
|
|
130
|
+
V as useZodSchemaTypes
|
|
132
131
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
appName: string;
|
|
3
3
|
leftOffset?: number;
|
|
4
|
+
leftContent?: React.ReactNode;
|
|
4
5
|
centerContent?: React.ReactNode;
|
|
5
6
|
rightContent?: React.ReactNode;
|
|
6
7
|
};
|
|
7
|
-
declare const TopBar: ({ appName, leftOffset, centerContent, rightContent }: Props) => import("react").JSX.Element;
|
|
8
|
+
declare const TopBar: ({ appName, leftOffset, leftContent, centerContent, rightContent }: Props) => import("react").JSX.Element;
|
|
8
9
|
export default TopBar;
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-BJen_dSO.cjs"),m=require("react"),y=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const g=require("./useWindowSize-CE6DJWzn.cjs"),C=require("./usePermissions-BQ-ARPG5.cjs"),P="_side-menu-item_1o1uo_1",w="_disabled_1o1uo_6",z="_nav-button_1o1uo_10",I="_child_1o1uo_18",f="_text_1o1uo_23",S="_icon_1o1uo_30",q="_collapse-icon_1o1uo_36",L="_collapsed_1o1uo_46",T="_collapse-icon-mini_1o1uo_49",O="_expanded_1o1uo_80",$="_children-container_1o1uo_86",A="_visible_1o1uo_94",K="_children_1o1uo_86",D="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:P,disabled:w,"nav-button":"_nav-button_1o1uo_10",navButton:z,child:I,text:f,icon:S,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:q,collapsed:L,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:T,expanded:O,"children-container":"_children-container_1o1uo_86",childrenContainer:$,visible:A,children:K,mobile:D},F=({item:n,menuExpanded:t,useTooltips:i,children:a})=>n.tooltip&&!t&&i?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:n.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:a})}):a,B=({item:n,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l,useHover:x,useTooltips:v,isMobile:c})=>{var M,h,R,j;const[N,_]=m.useState(!1),[p]=l.split("?"),d=n.linkTo===p||((M=n.children)==null?void 0:M.some(s=>s.linkTo===p)),E=m.useRef(null);return g.useClickOutside([E],()=>i&&a()),e.jsxRuntimeExports.jsxs("li",{ref:E,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:c},{[o.expanded]:t},{active:N||d},{open:i&&n.children},{[o.disabled]:n.disabled||n.notPermitted||((h=n.children)==null?void 0:h.every(s=>s.notPermitted||s.disabled))},{disabled:n.disabled||n.notPermitted||((R=n.children)==null?void 0:R.every(s=>s.notPermitted||s.disabled))}),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[e.jsxRuntimeExports.jsx(F,{item:n,menuExpanded:t,useTooltips:v,children:n.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{a()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),!x&&!t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(y.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(j=n.children)==null?void 0:j.map(s=>e.jsxRuntimeExports.jsx(y.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:s.disabled||s.notPermitted},{disabled:s.disabled||s.notPermitted}),onClick:a,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})},s.linkTo))})})]})},W="_side-menu_15z3o_1",U="_sidebar-header_15z3o_13",G="_side-menu-content_15z3o_20",J="_expand_15z3o_24",Q="_only-logo_15z3o_28",V="_mobile_15z3o_31",X="_divider_15z3o_45",u={"side-menu":"_side-menu_15z3o_1",sideMenu:W,"sidebar-header":"_sidebar-header_15z3o_13",sidebarHeader:U,"side-menu-content":"_side-menu-content_15z3o_20",sideMenuContent:G,expand:J,"only-logo":"_only-logo_15z3o_28",onlyLogo:Q,mobile:V,divider:X},Y=({headerItem:n,searchItem:t,mainItems:i,secondaryItems:a,expanded:l,setExpanded:x,currentPath:v,useHover:c,useTooltips:N})=>{const[_,p]=m.useState(-1),{checkUserHasPermissions:d}=C.usePermissions(),E=m.useMemo(()=>i.map(s=>{var r;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(r=s.children)==null?void 0:r.map(b=>({...b,notPermitted:!d(b.permissions??[],"any"),disabled:s.disabled||b.disabled}))}}),[i,d]),M=m.useMemo(()=>a.map(s=>{var r;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(r=s.children)==null?void 0:r.map(b=>({...b,notPermitted:!d(b.permissions??[],"any")}))}}),[a,d]),h=s=>{p(s===_?-1:s)};m.useEffect(()=>{l||p(-1)},[l]);const R=m.useRef(null);g.useClickOutside([R],()=>x(!1));const{isMobile:j}=g.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:R,className:e.classNames("luminus-side-menu shadow",u.sideMenu,{[u.mobile]:j},{[u.expand]:l},{expand:l}),onMouseEnter:()=>c&&x(!0),onMouseLeave:()=>c&&x(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",u.sidebarHeader,{[u.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>x(!l),children:c?n:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),n]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),e.jsxRuntimeExports.jsxs("ul",{className:u.sideMenuContent,children:[t?e.jsxRuntimeExports.jsx("div",{className:"p-3",children:t}):null,E.map((s,r)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:l,collapsed:r===_,onCollapse:()=>h(r),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),M.map((s,r)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:l,collapsed:r===_,onCollapse:()=>h(r),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title))]})]})},Z="_top-bar_1usoa_1",H="_top-bar-brand_1usoa_13",k={"top-bar":"_top-bar_1usoa_1",topBar:Z,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:H},ee=({appName:n,leftOffset:t,leftContent:i,centerContent:a,rightContent:l})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",k.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-4 align-items-center",children:[e.jsxRuntimeExports.jsx(y.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",k.topBarBrand),children:n}),i]}),a&&e.jsxRuntimeExports.jsx("div",{children:a}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:l??null})]});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Y;exports.TopBar=ee;
|