react-luminus-components 1.4.27 → 1.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +28 -38
- package/dist/{FormDisabledProvider-BqRrJ0Kq.js → FormDisabledProvider-C4BJtnSl.js} +1 -1
- package/dist/{FormDisabledProvider-jEUon85O.cjs → FormDisabledProvider-D7ohrf6I.cjs} +1 -1
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +14 -0
- package/dist/components/NotifCenter/Actions/components/ActionTemplates/ActionTemplates.d.ts +14 -0
- package/dist/components/NotifCenter/Actions/components/ActionTemplates/comps/Recipients/NotificationRecipients.d.ts +8 -0
- package/dist/components/NotifCenter/Actions/components/ActionTemplates/comps/index.d.ts +2 -0
- package/dist/components/NotifCenter/Actions/components/ActionTemplates/comps/modals/NotificationTargetModal.d.ts +12 -0
- package/dist/components/NotifCenter/Actions/components/HistoryTable/NotificationHistoryTable.d.ts +9 -0
- package/dist/components/NotifCenter/Actions/components/index.d.ts +2 -0
- package/dist/components/NotifCenter/Users/NotificationUsers.d.ts +9 -0
- package/dist/components/NotifCenter/Users/components/EmployeeNotifTable/EmployeeNotifHistoryTable.d.ts +9 -0
- package/dist/components/NotifCenter/Users/components/index.d.ts +1 -0
- package/dist/components/NotifCenter/index.d.ts +2 -0
- package/dist/components/common/StateToggle/StateToggle.d.ts +8 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +44 -45
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +22 -23
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +2 -2
- package/dist/main.cjs.js +53 -53
- package/dist/main.d.ts +3 -0
- package/dist/main.es.js +4844 -4593
- package/dist/models/index.d.ts +8 -0
- package/dist/models/texts/ComponentsContextTexts.d.ts +2 -0
- package/dist/models/texts/NotifCentrumTexts.d.ts +14 -0
- package/dist/models/types/notifCenter/NotifTargetModel.d.ts +7 -0
- package/dist/models/types/notifCenter/NotificationHistoryModel.d.ts +11 -0
- package/dist/models/types/notifCenter/NotificationHistoryPersonModel.d.ts +6 -0
- package/dist/models/types/notifCenter/NotificationHistoryUserDto.d.ts +13 -0
- package/dist/models/types/notifCenter/NotificationModel.d.ts +9 -0
- package/dist/models/types/notifCenter/NotificationTarget.d.ts +9 -0
- package/dist/models/types/notifCenter/NotificationTemplate.d.ts +14 -0
- package/dist/{nivo-bar.es-DCweuhLT.cjs → nivo-bar.es-C2UfrfEW.cjs} +40 -40
- package/dist/{nivo-bar.es-BdEuFoWH.js → nivo-bar.es-CAK_sBtK.js} +39 -36
- package/dist/style.css +1 -1
- package/dist/useLocalStorageState-DgnSxAxT.cjs +1 -0
- package/dist/useLocalStorageState-zVazoLpV.js +74 -0
- package/dist/utils/constants/CommonLuminusIconsArray.d.ts +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +46 -42
- package/package.json +1 -1
- package/dist/useGetApiData-8CkqvCJ7.cjs +0 -1
- package/dist/useGetApiData-EWN8nbww.js +0 -61
- package/dist/useLocalStorageState-BFc8Gc8H.cjs +0 -1
- package/dist/useLocalStorageState-Bt99kkCr.js +0 -17
package/dist/contexts.es.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
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
3
|
var S = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { t as F, bC as we, j as f, bD as Ie, P as z, ak as De, bE as de, a1 as A, ag as Pe, Q as q, bF as je, ao as ke, am as Le,
|
|
5
|
-
import { bK as
|
|
4
|
+
import { t as F, bC as we, j as f, bD as Ie, P as z, ak as De, 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 He, b6 as j, an as _e, bG as $e, aB as se, bH as Me, aT as he, bI as oe, bJ as Re, al as Ue, aX as Fe, a2 as Ne } from "./nivo-bar.es-CAK_sBtK.js";
|
|
5
|
+
import { bK as Bt, ad as Vt } from "./nivo-bar.es-CAK_sBtK.js";
|
|
6
6
|
import O, { useState as x, useCallback as m, useMemo as g, useContext as _, useEffect as P, useRef as ye, Component as te } from "react";
|
|
7
|
-
import { EventType as
|
|
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 {
|
|
16
|
-
import { u as Ke } from "./useLocalStorageState-Bt99kkCr.js";
|
|
13
|
+
import { L as qe } from "./FormDisabledProvider-C4BJtnSl.js";
|
|
14
|
+
import { F as Jt } from "./FormDisabledProvider-C4BJtnSl.js";
|
|
15
|
+
import { a as ze, u as Ke } from "./useLocalStorageState-zVazoLpV.js";
|
|
17
16
|
function Be(e) {
|
|
18
17
|
const t = F(e);
|
|
19
18
|
return t.setHours(23, 59, 59, 999), t;
|
|
@@ -21,17 +20,17 @@ function Be(e) {
|
|
|
21
20
|
function Ve() {
|
|
22
21
|
return Be(Date.now());
|
|
23
22
|
}
|
|
24
|
-
function
|
|
23
|
+
function Ye(e, t) {
|
|
25
24
|
const r = +F(e), [n, s] = [
|
|
26
25
|
+F(t.start),
|
|
27
26
|
+F(t.end)
|
|
28
27
|
].sort((o, c) => o - c);
|
|
29
28
|
return r >= n && r <= s;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function Je() {
|
|
32
31
|
return we(Date.now());
|
|
33
32
|
}
|
|
34
|
-
const
|
|
33
|
+
const We = ({ children: e }) => {
|
|
35
34
|
const [t, r] = x(!1), [n, s] = x(""), [o, c] = x(void 0), i = m((u, d) => {
|
|
36
35
|
r(!0), s(u), c(d);
|
|
37
36
|
}, []), l = m(() => {
|
|
@@ -70,7 +69,7 @@ const Je = ({ children: e }) => {
|
|
|
70
69
|
] })
|
|
71
70
|
] })
|
|
72
71
|
] });
|
|
73
|
-
},
|
|
72
|
+
}, Xe = ({ children: e }) => {
|
|
74
73
|
const [t, r] = x(!1), [n, s] = x(""), [o, c] = x({ input: "textarea", type: "text" }), i = ye(() => {
|
|
75
74
|
}), l = m((d) => {
|
|
76
75
|
s(d), r(!0);
|
|
@@ -89,7 +88,7 @@ const Je = ({ children: e }) => {
|
|
|
89
88
|
e,
|
|
90
89
|
/* @__PURE__ */ f.jsx(Qe, {})
|
|
91
90
|
] });
|
|
92
|
-
},
|
|
91
|
+
}, Rt = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: c, children: i }) => {
|
|
93
92
|
const l = g(() => ({
|
|
94
93
|
axiosOptions: t,
|
|
95
94
|
cookieDomain: e,
|
|
@@ -107,11 +106,11 @@ const Je = ({ children: e }) => {
|
|
|
107
106
|
n,
|
|
108
107
|
c
|
|
109
108
|
]);
|
|
110
|
-
return /* @__PURE__ */ f.jsx(z.Provider, { value: l, children: /* @__PURE__ */ f.jsx(
|
|
109
|
+
return /* @__PURE__ */ f.jsx(z.Provider, { value: l, children: /* @__PURE__ */ f.jsx(We, { children: /* @__PURE__ */ f.jsxs(Xe, { children: [
|
|
111
110
|
/* @__PURE__ */ f.jsx(je, {}),
|
|
112
111
|
i
|
|
113
112
|
] }) }) });
|
|
114
|
-
},
|
|
113
|
+
}, Ut = ({ children: e }) => {
|
|
115
114
|
const [t, r] = x(!1), [n] = x(/* @__PURE__ */ new Set()), s = m((i) => {
|
|
116
115
|
n.add(i), r(!0);
|
|
117
116
|
}, [n]), o = m((i) => {
|
|
@@ -121,7 +120,7 @@ const Je = ({ children: e }) => {
|
|
|
121
120
|
t && /* @__PURE__ */ f.jsx(qe, {}),
|
|
122
121
|
e
|
|
123
122
|
] });
|
|
124
|
-
},
|
|
123
|
+
}, Ft = ({ children: e }) => {
|
|
125
124
|
const t = Le(), { msalInstance: r } = _(me), { delegation: n, setDelegation: s, setAvailableDelegations: o, refreshAvailableDelegations: c } = _(pe), { getToken: i } = He(), [l, a] = x(null), u = m(async () => {
|
|
126
125
|
const y = await i();
|
|
127
126
|
y && a(y.token);
|
|
@@ -166,7 +165,7 @@ const Je = ({ children: e }) => {
|
|
|
166
165
|
P(() => {
|
|
167
166
|
if (r) {
|
|
168
167
|
const y = r.addEventCallback((b) => {
|
|
169
|
-
if (b.eventType ===
|
|
168
|
+
if (b.eventType === W.LOGIN_SUCCESS && b.payload) {
|
|
170
169
|
const K = b.payload;
|
|
171
170
|
a(K.accessToken);
|
|
172
171
|
}
|
|
@@ -193,7 +192,7 @@ const Je = ({ children: e }) => {
|
|
|
193
192
|
logoutUser: I
|
|
194
193
|
}), [p, E, I]);
|
|
195
194
|
return /* @__PURE__ */ f.jsx(_e.Provider, { value: Ae, children: e });
|
|
196
|
-
},
|
|
195
|
+
}, Nt = ({ ...e }) => {
|
|
197
196
|
const { cookieDomain: t } = _(z), [, r] = $e(["Authorization"]), n = g(() => ({
|
|
198
197
|
useMsal: e.useMsal ?? !1,
|
|
199
198
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
@@ -203,7 +202,7 @@ const Je = ({ children: e }) => {
|
|
|
203
202
|
return P(() => {
|
|
204
203
|
if (e.useMsal) {
|
|
205
204
|
const s = e.msalInstance.addEventCallback((o) => {
|
|
206
|
-
if (o.eventType ===
|
|
205
|
+
if (o.eventType === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
207
206
|
const c = o.payload, i = c.account;
|
|
208
207
|
e.msalInstance.setActiveAccount(i);
|
|
209
208
|
const l = c.accessToken, a = c.expiresOn;
|
|
@@ -224,13 +223,13 @@ const Je = ({ children: e }) => {
|
|
|
224
223
|
return () => {
|
|
225
224
|
};
|
|
226
225
|
}, [e, r, t]), /* @__PURE__ */ f.jsx(me.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ge, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
227
|
-
},
|
|
228
|
-
const [r, n, s] =
|
|
226
|
+
}, Gt = ({ children: e, relativeEndpoint: t }) => {
|
|
227
|
+
const [r, n, s] = ze("user-delegation", null), o = g(() => {
|
|
229
228
|
if (!r)
|
|
230
229
|
return null;
|
|
231
|
-
const d = r.from ? se(r.from) :
|
|
232
|
-
return
|
|
233
|
-
}, [r, n]), { data: c, setData: i, reloadData: l } =
|
|
230
|
+
const d = r.from ? se(r.from) : Je(), h = r.to ? se(r.to) : Ve();
|
|
231
|
+
return Ye(new Date(Date.now()), { start: d, end: h }) ? r : (n(null), null);
|
|
232
|
+
}, [r, n]), { data: c, setData: i, reloadData: l } = Ke(t, {
|
|
234
233
|
nullStateBeforeLoad: !1,
|
|
235
234
|
nullStateOnFail: !0
|
|
236
235
|
}), a = ye(null);
|
|
@@ -264,7 +263,7 @@ const Je = ({ children: e }) => {
|
|
|
264
263
|
]);
|
|
265
264
|
return /* @__PURE__ */ f.jsx(pe.Provider, { value: u, children: e });
|
|
266
265
|
};
|
|
267
|
-
var
|
|
266
|
+
var Ze = typeof Element < "u", et = typeof Map == "function", tt = typeof Set == "function", rt = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
268
267
|
function N(e, t) {
|
|
269
268
|
if (e === t) return !0;
|
|
270
269
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -303,7 +302,7 @@ function N(e, t) {
|
|
|
303
302
|
if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
|
|
304
303
|
for (n = r; n-- !== 0; )
|
|
305
304
|
if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
|
|
306
|
-
if (
|
|
305
|
+
if (Ze && e instanceof Element) return !1;
|
|
307
306
|
for (n = r; n-- !== 0; )
|
|
308
307
|
if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !N(e[s[n]], t[s[n]]))
|
|
309
308
|
return !1;
|
|
@@ -505,7 +504,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
505
504
|
if (t[r[n]] && t[r[n]].includes(e[r[n]]))
|
|
506
505
|
return !0;
|
|
507
506
|
return !1;
|
|
508
|
-
},
|
|
507
|
+
}, Y = (e, t) => Array.isArray(e) ? e.reduce(
|
|
509
508
|
(r, n) => (pt(n, t) ? r.priority.push(n) : r.default.push(n), r),
|
|
510
509
|
{ priority: [], default: [] }
|
|
511
510
|
) : { default: e, priority: [] }, ie = (e, t) => ({
|
|
@@ -578,7 +577,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
578
577
|
};
|
|
579
578
|
}
|
|
580
579
|
}, vt = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
|
|
581
|
-
const s =
|
|
580
|
+
const s = Y(e, B.meta), o = Y(t, B.link), c = Y(r, B.script);
|
|
582
581
|
return {
|
|
583
582
|
priorityMethods: {
|
|
584
583
|
toComponent: () => [
|
|
@@ -628,7 +627,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
628
627
|
style: v("style", c, n),
|
|
629
628
|
title: v("title", { title: i, titleAttributes: l }, n)
|
|
630
629
|
};
|
|
631
|
-
},
|
|
630
|
+
}, X = xt, U = [], be = !!(typeof window < "u" && window.document && window.document.createElement), Z = class {
|
|
632
631
|
constructor(e, t) {
|
|
633
632
|
S(this, "instances", []);
|
|
634
633
|
S(this, "canUseDOM", be);
|
|
@@ -648,7 +647,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
648
647
|
}
|
|
649
648
|
}
|
|
650
649
|
});
|
|
651
|
-
this.context = e, this.canUseDOM = t || !1, t || (e.helmet =
|
|
650
|
+
this.context = e, this.canUseDOM = t || !1, t || (e.helmet = X({
|
|
652
651
|
baseTag: [],
|
|
653
652
|
bodyAttributes: {},
|
|
654
653
|
encodeSpecialCharacters: !0,
|
|
@@ -666,7 +665,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
666
665
|
constructor(r) {
|
|
667
666
|
super(r);
|
|
668
667
|
S(this, "helmetData");
|
|
669
|
-
this.helmetData = new
|
|
668
|
+
this.helmetData = new Z(this.props.context || {}, D.canUseDOM);
|
|
670
669
|
}
|
|
671
670
|
render() {
|
|
672
671
|
return /* @__PURE__ */ O.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
|
|
@@ -770,7 +769,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
770
769
|
return delete c.context, c;
|
|
771
770
|
})
|
|
772
771
|
);
|
|
773
|
-
Se.canUseDOM ? At(s) :
|
|
772
|
+
Se.canUseDOM ? At(s) : X && (n = X(s)), r(n);
|
|
774
773
|
}
|
|
775
774
|
// componentWillMount will be deprecated
|
|
776
775
|
// for SSR, initialize on first render
|
|
@@ -785,7 +784,7 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
785
784
|
render() {
|
|
786
785
|
return this.init(), null;
|
|
787
786
|
}
|
|
788
|
-
},
|
|
787
|
+
}, J, Et = (J = class extends te {
|
|
789
788
|
shouldComponentUpdate(e) {
|
|
790
789
|
return !st(ie(this.props, "helmetData"), ie(e, "helmetData"));
|
|
791
790
|
}
|
|
@@ -897,18 +896,18 @@ var ge = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
897
896
|
render() {
|
|
898
897
|
const { children: e, ...t } = this.props;
|
|
899
898
|
let r = { ...t }, { helmetData: n } = t;
|
|
900
|
-
if (e && (r = this.mapChildrenToProps(e, r)), n && !(n instanceof
|
|
899
|
+
if (e && (r = this.mapChildrenToProps(e, r)), n && !(n instanceof Z)) {
|
|
901
900
|
const s = n;
|
|
902
|
-
n = new
|
|
901
|
+
n = new Z(s.context, !0), delete r.helmetData;
|
|
903
902
|
}
|
|
904
903
|
return n ? /* @__PURE__ */ O.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ O.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ O.createElement(ce, { ...r, context: s }));
|
|
905
904
|
}
|
|
906
|
-
}, S(
|
|
905
|
+
}, S(J, "defaultProps", {
|
|
907
906
|
defer: !0,
|
|
908
907
|
encodeSpecialCharacters: !0,
|
|
909
908
|
prioritizeSeoTags: !1
|
|
910
|
-
}),
|
|
911
|
-
const ue = (e, t) => e ? `${e} | ${t}` : t,
|
|
909
|
+
}), J);
|
|
910
|
+
const ue = (e, t) => e ? `${e} | ${t}` : t, qt = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
|
|
912
911
|
const [n, s] = x([
|
|
913
912
|
ue(r ?? "", e)
|
|
914
913
|
]), o = m((a) => {
|
|
@@ -942,18 +941,18 @@ const ue = (e, t) => e ? `${e} | ${t}` : t, zt = ({ defaultHelmet: e, children:
|
|
|
942
941
|
};
|
|
943
942
|
export {
|
|
944
943
|
me as AuthContext,
|
|
945
|
-
|
|
944
|
+
Nt as AuthProvider,
|
|
946
945
|
pe as DelegationContext,
|
|
947
|
-
|
|
948
|
-
|
|
946
|
+
Gt as DelegationProvider,
|
|
947
|
+
Bt as FormDisabledContext,
|
|
949
948
|
Jt as FormDisabledProvider,
|
|
950
949
|
Re as HelmetContext,
|
|
951
|
-
|
|
950
|
+
qt as HelmetProvider,
|
|
952
951
|
ke as LoadingContext,
|
|
953
|
-
|
|
952
|
+
Ut as LoadingProvider,
|
|
954
953
|
z as LuminusComponentsContext,
|
|
955
|
-
|
|
954
|
+
Rt as LuminusComponentsProvider,
|
|
956
955
|
_e as UserContext,
|
|
957
|
-
|
|
958
|
-
|
|
956
|
+
Ft as UserProvider,
|
|
957
|
+
Vt as useFormDisabledContext
|
|
959
958
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useKeyPress: (handleKeyPress: (e: KeyboardEvent) => void) => void;
|
|
1
|
+
declare const useKeyPress: (handleKeyPress: (e: KeyboardEvent) => void, handleKeyUp?: (e: KeyboardEvent) => void) => void;
|
|
2
2
|
export default useKeyPress;
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar.es-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar.es-C2UfrfEW.cjs"),b=require("./useLocalStorageState-DgnSxAxT.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;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { am as
|
|
2
|
-
import { bL as
|
|
3
|
-
import { u as ot } from "./
|
|
1
|
+
import { am as x, ao as P, b5 as E } from "./nivo-bar.es-CAK_sBtK.js";
|
|
2
|
+
import { bL as Z, aN as j, bN as J, al as Y, bM as _, aX as K, ap as tt, bo as et, ak as at, aE as st, bq as rt } from "./nivo-bar.es-CAK_sBtK.js";
|
|
3
|
+
import { u as ot, a as ut } from "./useLocalStorageState-zVazoLpV.js";
|
|
4
4
|
import { useState as v, useEffect as g, useContext as $, useRef as I, useCallback as S } from "react";
|
|
5
|
-
import { u as
|
|
6
|
-
import { c as it, u as dt, a as mt, b as ft } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
5
|
+
import { c as ct, u as it, a as dt, b as mt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
7
6
|
import "react-router-dom";
|
|
8
7
|
import "react-dom";
|
|
9
8
|
import "react-hook-form";
|
|
@@ -30,8 +29,8 @@ const y = (e) => {
|
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
|
-
function
|
|
34
|
-
const r =
|
|
32
|
+
function z(e, t) {
|
|
33
|
+
const r = x({
|
|
35
34
|
silent: !0,
|
|
36
35
|
differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
|
|
37
36
|
customToken: t == null ? void 0 : t.customToken
|
|
@@ -71,8 +70,8 @@ const B = (e, t, r) => {
|
|
|
71
70
|
enabled: !0,
|
|
72
71
|
nullStateBeforeLoad: !0,
|
|
73
72
|
nullStateOnFail: !1
|
|
74
|
-
},
|
|
75
|
-
const l =
|
|
73
|
+
}, H = (e, { loadOnInit: t = d.loadOnInit, enabled: r = d.enabled, silent: a = d.silent, nullStateBeforeLoad: s = d.nullStateBeforeLoad, nullStateOnFail: c = d.nullStateOnFail, customApiUrl: n, customBearerToken: u, dataTransformer: i, errorBoundaryOn404: o } = d) => {
|
|
74
|
+
const l = x({
|
|
76
75
|
silent: a,
|
|
77
76
|
customToken: u,
|
|
78
77
|
differentBaseUrl: n,
|
|
@@ -83,7 +82,7 @@ const B = (e, t, r) => {
|
|
|
83
82
|
!a && m(`loadData-${e}-${C}`), s && h(null);
|
|
84
83
|
const L = l.get(e, {
|
|
85
84
|
signal: f
|
|
86
|
-
}).then((
|
|
85
|
+
}).then((k) => i ? i(k.data) : k.data).finally(() => !a && D(`loadData-${e}-${C}`));
|
|
87
86
|
h(B(L, c ?? !1, o ?? !1));
|
|
88
87
|
}, [
|
|
89
88
|
b,
|
|
@@ -110,7 +109,7 @@ const B = (e, t, r) => {
|
|
|
110
109
|
storageKey: "--tmp-scroll-save--",
|
|
111
110
|
requiredHeight: 100,
|
|
112
111
|
retryInterval: 50
|
|
113
|
-
},
|
|
112
|
+
}, M = (e, { storageKey: t = p.storageKey, requiredHeight: r = p.requiredHeight, retryInterval: a = p.retryInterval } = p) => {
|
|
114
113
|
const [s, c] = v(!1), n = I(null), u = S(() => {
|
|
115
114
|
const o = localStorage.getItem(t);
|
|
116
115
|
return localStorage.removeItem(t), o === null ? null : Number(o);
|
|
@@ -138,26 +137,26 @@ const B = (e, t, r) => {
|
|
|
138
137
|
}, [i, e]), { saveValue: i, retrieveValue: u };
|
|
139
138
|
};
|
|
140
139
|
export {
|
|
141
|
-
|
|
140
|
+
Z as cancelToken,
|
|
142
141
|
E as useAuth,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
x as useAxios,
|
|
143
|
+
j as useClickOutside,
|
|
144
|
+
J as useClipboard,
|
|
146
145
|
Y as useConfirm,
|
|
147
|
-
|
|
146
|
+
ct as useEmployeePhotoPath,
|
|
148
147
|
_ as useFormControlType,
|
|
149
148
|
ot as useGetApiData,
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
H as useGetApiDataBound,
|
|
150
|
+
z as useGetDataBound,
|
|
152
151
|
K as useKeyPress,
|
|
153
|
-
|
|
152
|
+
ut as useLocalStorageState,
|
|
154
153
|
tt as useNotifications,
|
|
155
154
|
et as usePermissions,
|
|
156
155
|
at as usePrompt,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
it as useRenderDraggableInPortal,
|
|
157
|
+
M as useScrollSave,
|
|
158
|
+
dt as useSearchQuery,
|
|
159
|
+
mt as useSearchQueryState,
|
|
161
160
|
st as useWindowSize,
|
|
162
161
|
rt as useZodSchemaTypes
|
|
163
162
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-C2UfrfEW.cjs"),x=require("react"),g=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const k="_side-menu-item_o72rm_1",P="_disabled_o72rm_6",f="_hidden_o72rm_10",w="_nav-button_o72rm_13",I="_child_o72rm_21",S="_text_o72rm_26",L="_icon_o72rm_36",T="_collapse-icon_o72rm_42",O="_collapsed_o72rm_52",$="_collapse-icon-mini_o72rm_55",A="_expanded_o72rm_86",K="_children-container_o72rm_92",D="_visible_o72rm_100",F="_children_o72rm_92",z="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:k,disabled:P,hidden:f,"nav-button":"_nav-button_o72rm_13",navButton:w,child:I,text:S,icon:L,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:T,collapsed:O,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:$,expanded:A,"children-container":"_children-container_o72rm_92",childrenContainer:K,visible:D,children:F,mobile:z},U=({item:s,menuExpanded:i,useTooltips:l,children:c})=>s.tooltip&&!i&&l?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:c})}):c,B=({item:s,menuExpanded:i,collapsed:l,onCollapse:c,currentPath:_,useHover:r,useTooltips:p,isMobile:E,disableMode:a})=>{var q,y,v,N;const[M,b]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((q=s.children)==null?void 0:q.some(o=>o.linkTo===j)),m=x.useRef(null);return e.useClickOutside([m],()=>l&&c()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:E},{[n.expanded]:i},{active:M||R},{open:l&&s.children},{[a==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((y=s.children)==null?void 0:y.every(o=>o.notPermitted||o.disabled))},{[a==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(o=>o.notPermitted||o.disabled))}),onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[e.jsxRuntimeExports.jsx(U,{item:s,menuExpanded:i,useTooltips:p,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",n.navButton),onClick:()=>{c()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),!r&&!i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",n.collapseIconMini,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",n.collapseIcon,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(g.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",n.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",n.childrenContainer,{[n.visible]:l}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",n.children),children:(N=s.children)==null?void 0:N.map(o=>e.jsxRuntimeExports.jsx(g.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",n.navButton,n.child,{[a==="disable"?n.disabled:n.hidden]:o.disabled||o.notPermitted},{[a==="disable"?"disabled":"hidden"]:o.disabled||o.notPermitted}),onClick:c,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},W="_side-menu_1q9oh_1",G="_sidebar-header_1q9oh_15",J="_side-menu-content_1q9oh_22",Q="_expand_1q9oh_27",V="_only-logo_1q9oh_31",X="_mobile_1q9oh_34",Y="_divider_1q9oh_49",u={"side-menu":"_side-menu_1q9oh_1",sideMenu:W,"sidebar-header":"_sidebar-header_1q9oh_15",sidebarHeader:G,"side-menu-content":"_side-menu-content_1q9oh_22",sideMenuContent:J,expand:Q,"only-logo":"_only-logo_1q9oh_31",onlyLogo:V,mobile:X,divider:Y},Z=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:c,secondaryItems:_,expanded:r,setExpanded:p,currentPath:E,useHover:a,useTooltips:M,disableMode:b="disable"})=>{const[j,R]=x.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),q=x.useMemo(()=>c.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(h=>({...h,notPermitted:!m(h.permissions??[],"any"),disabled:t.disabled||h.disabled}))}}),[c,m]),y=x.useMemo(()=>_.map(t=>{var d;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(d=t.children)==null?void 0:d.map(h=>({...h,notPermitted:!m(h.permissions??[],"any")}))}}),[_,m]),v=t=>{R(t===j?-1:t)};x.useEffect(()=>{r||R(-1)},[r]);const N=x.useRef(null);e.useClickOutside([N],()=>p(!1));const{isMobile:o}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",u.sideMenu,{[u.mobile]:o},{[u.expand]:r},{expand:r}),onMouseEnter:()=>a&&p(!0),onMouseLeave:()=>a&&p(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",u.sidebarHeader,{[u.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>p(!r),children:a?s:r?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),r&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&r?l:null,i&&r?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:u.sideMenuContent,children:[q.map((t,d)=>e.jsxRuntimeExports.jsx(B,{item:t,menuExpanded:r,collapsed:d===j,onCollapse:()=>v(d),currentPath:E,useHover:a,useTooltips:M,isMobile:o,disableMode:b},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),y.map((t,d)=>e.jsxRuntimeExports.jsx(B,{item:t,menuExpanded:r,collapsed:d===j,onCollapse:()=>v(d),currentPath:E,useHover:a,useTooltips:M,isMobile:o,disableMode:b},t.title))]})]})},H="_top-bar_lnmq0_1",ee="_top-bar-brand_lnmq0_12",C={"top-bar":"_top-bar_lnmq0_1",topBar:H,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ee},se=({appName:s,leftOffset:i,leftContent:l,centerContent:c,rightContent:_})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",C.topBar),style:{width:i?`calc(100% - ${i}px)`:void 0,left:i?`${i}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:c??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:_??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Z;exports.TopBar=se;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { as as fe, bB as Be } from "./nivo-bar.es-
|
|
1
|
+
import { aN as I, j as e, c as i, Z as q, aC as R, bo as S, aE as $, bz as A, bA as z } from "./nivo-bar.es-CAK_sBtK.js";
|
|
2
|
+
import { as as fe, bB as Be } from "./nivo-bar.es-CAK_sBtK.js";
|
|
3
3
|
import { useState as L, useRef as T, useMemo as k, useEffect as F } from "react";
|
|
4
4
|
import { Link as C } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|