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.
Files changed (57) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +54 -64
  3. package/dist/{Loading-BNbddGfQ.js → Loading-C_Obnmtl.js} +1 -1
  4. package/dist/Loading-D6V3KNi5.cjs +1 -0
  5. package/dist/components/IconPicker/IconPicker.d.ts +12 -0
  6. package/dist/components/ShortcutLinks/ShortcutLinks/ShortcutLinks.d.ts +7 -0
  7. package/dist/components/ShortcutLinks/ShortcutLinks/comps/ShortcutLink/ShortcutLink.d.ts +10 -0
  8. package/dist/components/ShortcutLinks/ShortcutLinks/comps/index.d.ts +1 -0
  9. package/dist/components/ShortcutLinks/ShortcutLinksContext/ShortcutLinksContext.d.ts +9 -0
  10. package/dist/components/ShortcutLinks/ShortcutLinksContext/ShortcutLinksProvider.d.ts +7 -0
  11. package/dist/components/ShortcutLinks/ShortcutLinksContext/useShortcutLinksContext.d.ts +2 -0
  12. package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/ShortcutLinksSetupModal.d.ts +10 -0
  13. package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/ShortcutLinkSetupItem.d.ts +12 -0
  14. package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/comps/ShortcutLinkItemEdit/ShortcutLinkItemEdit.d.ts +12 -0
  15. package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/ShortcutLinkSetupItem/comps/index.d.ts +1 -0
  16. package/dist/components/ShortcutLinks/ShortcutLinksSetupModal/comps/index.d.ts +1 -0
  17. package/dist/components/ShortcutLinks/common/SHORTCUT_LINK_SETTINGS.d.ts +1 -0
  18. package/dist/components/ShortcutLinks/common/types/ShortcutLinkObject.d.ts +7 -0
  19. package/dist/components/ShortcutLinks/index.d.ts +4 -0
  20. package/dist/contexts.cjs.js +1 -1
  21. package/dist/contexts.es.js +61 -62
  22. package/dist/hooks.cjs.js +1 -1
  23. package/dist/hooks.es.js +35 -36
  24. package/dist/layout/TopBar/TopBar.d.ts +2 -1
  25. package/dist/layout.cjs.js +1 -1
  26. package/dist/layout.es.js +68 -65
  27. package/dist/main.cjs.js +2 -2
  28. package/dist/main.d.ts +5 -0
  29. package/dist/main.es.js +3466 -3350
  30. package/dist/models/luminus-context-types/CommonLuminusIcons.d.ts +3 -1
  31. package/dist/models/texts/ComponentsContextTexts.d.ts +2 -0
  32. package/dist/models/texts/ShortcutLinkTexts.d.ts +4 -0
  33. package/dist/{ResponsiveContextDropdown-86w_MfdQ.cjs → nivo-bar.es-BJen_dSO.cjs} +5 -5
  34. package/dist/{ResponsiveContextDropdown-CW7ZqSAm.js → nivo-bar.es-DVe_3U7Q.js} +10029 -10029
  35. package/dist/{searchUtils-7dexyjD8.js → searchUtils-Da3ZqNhn.js} +1 -1
  36. package/dist/searchUtils-DhTauQFe.cjs +1 -0
  37. package/dist/style.css +1 -1
  38. package/dist/{useClipboard-D-ryUcDP.js → useClipboard-ClYXMKiq.js} +1 -1
  39. package/dist/useClipboard-Cs_XUgmm.cjs +1 -0
  40. package/dist/useLocalStorageState-Bq8ZhpGM.js +65 -0
  41. package/dist/useLocalStorageState-dLgBb482.cjs +1 -0
  42. package/dist/usePermissions-BQ-ARPG5.cjs +1 -0
  43. package/dist/{usePermissions-KbW2vB5D.js → usePermissions-Eu0uaFgI.js} +3 -3
  44. package/dist/utils/constants/CommonLuminusIconsArray.d.ts +2 -0
  45. package/dist/utils/index.d.ts +1 -0
  46. package/dist/utils.cjs.js +1 -1
  47. package/dist/utils.es.js +64 -43
  48. package/dist/variables.scss +165 -165
  49. package/package.json +116 -116
  50. package/dist/Loading-CZc1CMdv.cjs +0 -1
  51. package/dist/searchUtils-B4Bf1m3p.cjs +0 -1
  52. package/dist/useClipboard-CCVCJIrq.cjs +0 -1
  53. package/dist/useGetApiData-BZiEPMRQ.js +0 -52
  54. package/dist/useGetApiData-LorHvE1b.cjs +0 -1
  55. package/dist/useLocalStorageState-BFc8Gc8H.cjs +0 -1
  56. package/dist/useLocalStorageState-Bt99kkCr.js +0 -17
  57. package/dist/usePermissions-CMupzyaq.cjs +0 -1
@@ -1,16 +1,15 @@
1
- var Se = Object.defineProperty;
2
- var Oe = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var A = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as N, bi as Ee, j as f, bj as we, $ as z, b3 as Ie, bk as fe, ab as S, b2 as je, a0 as G, bl as De, aT as Pe, as as ke, aA as de, bm as me, aB as Le, aD as P, aC as He, bn as $e, aR as se, bo as _e, bp as pe, bq as oe, br as Me, aV as Re } from "./ResponsiveContextDropdown-CW7ZqSAm.js";
5
- import E, { useState as C, useCallback as p, useMemo as b, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
6
- import { EventType as W } from "@azure/msal-browser";
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-BNbddGfQ.js";
12
- import { u as Fe } from "./useGetApiData-BZiEPMRQ.js";
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 = b(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
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(At, {}),
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 = b(() => ({
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(S, { show: t, size: "sm", centered: !0, onHide: a, children: [
58
- /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: r }) }),
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(S.Body, { children: [
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(S.Footer, { className: "w-100 d-flex gap-5", children: [
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
- }, Je = ({ children: e }) => {
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 = b(() => ({
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
- }, $t = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
90
- const c = b(() => ({
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(Je, { children: [
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
- }, _t = ({ children: e }) => {
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 = b(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
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
- }, Mt = ({ children: e }) => {
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 === W.LOGIN_SUCCESS && v.payload) {
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 Ae = b(() => ({
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: Ae, children: e });
193
- }, Rt = ({ ...e }) => {
194
- const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = b(() => ({
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 === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
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
- }, Ut = ({ children: e, relativeEndpoint: t }) => {
225
- const [r, n, s] = qe("user-delegation", null), o = b(() => {
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 } = Fe(t, {
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 = b(() => ({
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 We = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
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 (We && e instanceof Element) return !1;
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
- A(this, "instances", []);
631
- A(this, "canUseDOM", xe);
632
- A(this, "context");
633
- A(this, "value", {
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, be = (j = class extends te {
661
+ }, Tt = {}, Ce = E.createContext(Tt), j, Ae = (j = class extends te {
663
662
  constructor(r) {
664
663
  super(r);
665
- A(this, "helmetData");
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
- }, A(j, "canUseDOM", xe), j), k = (e, t) => {
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
- A(this, "rendered", !1);
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
- be.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
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
- }, J, bt = (J = class extends te {
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
- }, A(J, "defaultProps", {
902
+ }, S(W, "defaultProps", {
904
903
  defer: !0,
905
904
  encodeSpecialCharacters: !0,
906
905
  prioritizeSeoTags: !1
907
- }), J);
908
- const ue = (e, t) => e ? `${e} | ${t}` : t, Nt = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
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 = b(() => n.at(-1) ?? "", [n]), c = b(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
916
- return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(be, { children: [
917
- /* @__PURE__ */ f.jsx(bt, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
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
- }, At = () => {
919
+ }, St = () => {
921
920
  const { texts: { confirm: e } } = $(z), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
922
- return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
923
- /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
924
- /* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
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
- Rt as AuthProvider,
931
+ Mt as AuthProvider,
933
932
  me as DelegationContext,
934
- Ut as DelegationProvider,
933
+ Rt as DelegationProvider,
935
934
  Me as HelmetContext,
936
- Nt as HelmetProvider,
935
+ Ut as HelmetProvider,
937
936
  Pe as LoadingContext,
938
- _t as LoadingProvider,
937
+ $t as LoadingProvider,
939
938
  z as LuminusComponentsContext,
940
- $t as LuminusComponentsProvider,
939
+ Ht as LuminusComponentsProvider,
941
940
  He as UserContext,
942
- Mt as UserProvider
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("./ResponsiveContextDropdown-86w_MfdQ.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),x=require("./usePermissions-CMupzyaq.cjs"),d=require("./useClipboard-CCVCJIrq.cjs"),T=require("./useGetApiData-LorHvE1b.cjs"),c=require("react"),G=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const L=o=>{let e="pending",a;const t=o.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 B(o,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 r=a.get(o).then(n=>n.data);s(L(r))})()},[a,o]),t}const E=(o,e,a)=>{let t="pending",s;const l=o.then(r=>{t="success",s=r},r=>{const n=r==null?void 0:r.response;(n==null?void 0:n.status)===404&&a?(t="error-404",s=r):(t="error",s=r)});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},O=(o,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:r,customBearerToken:n,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const w=u.useAxios({silent:t,customToken:n,differentBaseUrl:r,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:g}=c.useContext(u.LoadingContext),P=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[b,p]=c.useState(null),m=c.useCallback(async(f,y)=>{if(!C()||a===!1)return;!t&&D(`loadData-${o}-${y}`),s&&p(null);const k=w.get(o,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&g(`loadData-${o}-${y}`));p(E(k,l??!1,S??!1))},[C,a,t,D,o,s,w,h,g,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return m(f.signal,++P.current),()=>{f.abort()}},[m,e]),{data:b,setData:p,reloadData:m}};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=q.useClickOutside;exports.useWindowSize=q.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=T.useGetApiData;exports.useLocalStorageState=G.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=B;
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 { as as S, aT as T, aB as U } from "./ResponsiveContextDropdown-CW7ZqSAm.js";
2
- import { bs as V, aV as Z, aH as j, aU as q, b3 as J, bt as M } from "./ResponsiveContextDropdown-CW7ZqSAm.js";
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-KbW2vB5D.js";
5
- import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-D-ryUcDP.js";
6
- import { u as lt } from "./useGetApiData-BZiEPMRQ.js";
7
- import { useState as b, useEffect as C, useContext as B, useRef as L, useCallback as P } from "react";
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 $ = (o) => {
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 H(o, t) {
35
- const a = S({
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 r = a.get(o).then((n) => n.data);
43
- s($(r));
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((r) => {
50
- e = "success", s = r;
51
- }, (r) => {
52
- const n = r == null ? void 0 : r.response;
53
- (n == null ? void 0 : n.status) === 404 && a ? (e = "error-404", s = r) : (e = "error", s = r);
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
- }, I = (o, { loadOnInit: t = u.loadOnInit, enabled: a = u.enabled, silent: e = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: c = u.nullStateOnFail, customApiUrl: r, customBearerToken: n, dataTransformer: i, errorBoundaryOn404: f } = u) => {
76
- const p = S({
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: n,
79
- differentBaseUrl: r,
77
+ customToken: r,
78
+ differentBaseUrl: n,
80
79
  noToastOnStatus: f ? [404] : void 0
81
- }), { startLoading: h, stopLoading: w } = B(T), k = L(0), { isAuthenticated: g } = U(), [y, d] = b(null), m = P(async (l, D) => {
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((x) => i ? i(x.data) : x.data).finally(() => !e && w(`loadData-${o}-${D}`));
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
- V as cancelToken,
113
- U as useAuth,
114
- S as useAxios,
111
+ j as cancelToken,
112
+ P as useAuth,
113
+ x as useAxios,
115
114
  Y as useClickOutside,
116
115
  at as useClipboard,
117
- Z as useConfirm,
116
+ q as useConfirm,
118
117
  ot as useEmployeePhotoPath,
119
- j as useFormControlType,
118
+ H as useFormControlType,
120
119
  lt as useGetApiData,
121
- I as useGetApiDataBound,
122
- H as useGetDataBound,
123
- rt as useKeyPress,
124
- ft as useLocalStorageState,
125
- q as useNotifications,
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
- J as usePrompt,
128
- nt as useSearchQuery,
126
+ M as usePrompt,
127
+ rt as useSearchQuery,
129
128
  ut as useSearchQueryState,
130
129
  _ as useWindowSize,
131
- M as useZodSchemaTypes
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;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-86w_MfdQ.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"),k=require("./usePermissions-CMupzyaq.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",D="_children_1o1uo_86",K="_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:D,mobile:K},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:r,useHover:x,useTooltips:v,isMobile:c})=>{var M,h,R,j;const[N,_]=m.useState(!1),[p]=r.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:r,setExpanded:x,currentPath:v,useHover:c,useTooltips:N})=>{const[_,p]=m.useState(-1),{checkUserHasPermissions:d}=k.usePermissions(),E=m.useMemo(()=>i.map(s=>{var l;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(l=s.children)==null?void 0:l.map(b=>({...b,notPermitted:!d(b.permissions??[],"any"),disabled:s.disabled||b.disabled}))}}),[i,d]),M=m.useMemo(()=>a.map(s=>{var l;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(l=s.children)==null?void 0:l.map(b=>({...b,notPermitted:!d(b.permissions??[],"any")}))}}),[a,d]),h=s=>{p(s===_?-1:s)};m.useEffect(()=>{r||p(-1)},[r]);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]:r},{expand:r}),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(!r),children:c?n:r?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,l)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:r,collapsed:l===_,onCollapse:()=>h(l),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),M.map((s,l)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:r,collapsed:l===_,onCollapse:()=>h(l),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title))]})]})},Z="_top-bar_1usoa_1",H="_top-bar-brand_1usoa_13",C={"top-bar":"_top-bar_1usoa_1",topBar:Z,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:H},ee=({appName:n,leftOffset:t,centerContent:i,rightContent:a})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",C.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(y.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:n}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:a??null})]});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Y;exports.TopBar=ee;
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;