react-luminus-components 1.3.149 → 1.3.151

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/dist/.vite/manifest.json +58 -75
  2. package/dist/{FullScreenContainer-DYBgh54H.js → FullScreenContainer-Ahxfk-Xk.js} +1 -1
  3. package/dist/{FullScreenContainer-wS-hROzA.cjs → FullScreenContainer-BWYwSExf.cjs} +1 -1
  4. package/dist/{Loading-DVzR10eX.cjs → Loading-C-Dsxusq.cjs} +1 -1
  5. package/dist/{Loading-fF23C88q.js → Loading-DiC4Np7v.js} +1 -1
  6. package/dist/components/Form/CheckInput/CheckInput.d.ts +1 -1
  7. package/dist/components/Form/CustomSelectInput/CustomSelectInput.d.ts +1 -1
  8. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +1 -1
  9. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +1 -1
  10. package/dist/components/Form/NumericTextInput/NumericTextInput.d.ts +1 -1
  11. package/dist/components/Form/SelectInput/SelectInput.d.ts +1 -1
  12. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +1 -1
  13. package/dist/components/Form/TextInput/TextInput.d.ts +1 -1
  14. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +1 -1
  15. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +1 -1
  16. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +1 -1
  17. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +1 -1
  18. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +1 -1
  19. package/dist/components/HookForm/NumericTextInput/HookFormNumericTextInput.d.ts +1 -1
  20. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +1 -1
  21. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +1 -1
  22. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +1 -1
  23. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +6 -2
  24. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +2 -0
  25. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +2 -0
  26. package/dist/contexts.cjs.js +1 -1
  27. package/dist/contexts.es.js +35 -35
  28. package/dist/hooks.cjs.js +1 -1
  29. package/dist/hooks.es.js +9 -9
  30. package/dist/layout.cjs.js +1 -1
  31. package/dist/layout.es.js +36 -37
  32. package/dist/main.cjs.js +2 -2
  33. package/dist/main.es.js +1124 -1124
  34. package/dist/models/prop-types/InputContainerProps.d.ts +1 -0
  35. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +1 -0
  36. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +1 -0
  37. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +1 -0
  38. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +1 -0
  39. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +1 -0
  40. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +1 -0
  41. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +1 -0
  42. package/dist/{nivo-bar.es-GeqH-wP6.js → nivo-bar.es-B2GqU-tV.js} +5362 -5350
  43. package/dist/nivo-bar.es-C8-VCzr1.cjs +279 -0
  44. package/dist/{searchUtils-rKGYKo3G.cjs → searchUtils-BSGjuykO.cjs} +1 -1
  45. package/dist/{searchUtils-C-B9CjZk.js → searchUtils-BhpLdWdC.js} +1 -1
  46. package/dist/{useClipboard-DryTYSx9.cjs → useClipboard-D6esVLqf.cjs} +1 -1
  47. package/dist/{useClipboard-B_wtiBC7.js → useClipboard-DegAIBUd.js} +1 -1
  48. package/dist/{useGetApiData-DRl4eniT.js → useGetApiData-CTK8sM2X.js} +4 -4
  49. package/dist/{useGetApiData-C6zACwiC.cjs → useGetApiData-D4Xo7Loy.cjs} +1 -1
  50. package/dist/{usePermissions-Dn1zXYZT.js → usePermissions-BKn9Opdd.js} +1 -1
  51. package/dist/{usePermissions-DihYt5eO.cjs → usePermissions-DMDGiPC1.cjs} +1 -1
  52. package/dist/utils.cjs.js +1 -1
  53. package/dist/utils.es.js +59 -60
  54. package/package.json +1 -1
  55. package/dist/SimpleTooltip-B20SNN2b.cjs +0 -1
  56. package/dist/SimpleTooltip-BJ1Ja0Rd.js +0 -5
  57. package/dist/nivo-bar.es-CRYH7xvU.cjs +0 -279
@@ -1,15 +1,15 @@
1
- var be = Object.defineProperty;
2
- var Se = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var b = (e, t, r) => Se(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as N, bf as Oe, j as f, bg as Ee, a2 as z, ap as we, bh as ue, av as S, am as Ie, a3 as G, bi as je, at as Pe, ar as De, aQ as fe, bj as de, aR as ke, aS as D, as as Le, bk as He, aE as se, bl as _e, bm as me, bn as oe, bb as $e, aq as Me } from "./nivo-bar.es-GeqH-wP6.js";
1
+ var Se = Object.defineProperty;
2
+ var be = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var S = (e, t, r) => be(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { t as N, bg as Oe, j as f, bh as Ee, a2 as z, ap as we, bi as ue, av as b, am as Ie, a3 as G, bj as je, at as Pe, ar as De, aR as fe, bk as de, aS as ke, aT as D, as as Le, bl as He, aE as se, bm as _e, bn as me, bo as oe, bc as $e, aq as Me } from "./nivo-bar.es-B2GqU-tV.js";
5
5
  import E, { useState as C, useCallback as p, useMemo as A, useContext as _, useEffect as P, useRef as pe, Component as te } from "react";
6
- import { EventType as Q } from "@azure/msal-browser";
6
+ import { EventType as W } from "@azure/msal-browser";
7
7
  import { MsalProvider as Re } 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 Ue } from "./Loading-fF23C88q.js";
12
- import { u as Ne } from "./useGetApiData-DRl4eniT.js";
11
+ import { L as Ue } from "./Loading-DiC4Np7v.js";
12
+ import { u as Ne } from "./useGetApiData-CTK8sM2X.js";
13
13
  import { u as Fe } from "./useLocalStorageState-Bt99kkCr.js";
14
14
  function qe(e) {
15
15
  const t = N(e);
@@ -54,14 +54,14 @@ const Ve = ({ children: e }) => {
54
54
  autoFocus: !0,
55
55
  tabIndex: 0
56
56
  }), [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 }) }),
57
+ return /* @__PURE__ */ f.jsxs(b, { show: t, size: "sm", centered: !0, onHide: a, children: [
58
+ /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: r }) }),
59
59
  /* @__PURE__ */ f.jsxs("form", { onSubmit: i, children: [
60
- /* @__PURE__ */ f.jsxs(S.Body, { children: [
60
+ /* @__PURE__ */ f.jsxs(b.Body, { children: [
61
61
  s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...l, rows: 5 }) : void 0,
62
62
  s.input === "input" ? /* @__PURE__ */ f.jsx(Ie, { ...l, type: s.type }) : void 0
63
63
  ] }),
64
- /* @__PURE__ */ f.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
64
+ /* @__PURE__ */ f.jsxs(b.Footer, { className: "w-100 d-flex gap-5", children: [
65
65
  /* @__PURE__ */ f.jsx(G, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
66
66
  /* @__PURE__ */ f.jsx(G, { color: "primary", disabled: s.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
67
67
  ] })
@@ -163,7 +163,7 @@ const Ve = ({ children: e }) => {
163
163
  P(() => {
164
164
  if (r) {
165
165
  const y = r.addEventCallback((v) => {
166
- if (v.eventType === Q.LOGIN_SUCCESS && v.payload) {
166
+ if (v.eventType === W.LOGIN_SUCCESS && v.payload) {
167
167
  const K = v.payload;
168
168
  l(K.accessToken);
169
169
  }
@@ -199,7 +199,7 @@ const Ve = ({ children: e }) => {
199
199
  return P(() => {
200
200
  if (e.useMsal) {
201
201
  const s = e.msalInstance.addEventCallback((o) => {
202
- if (o.eventType === Q.LOGIN_SUCCESS || o.eventType === Q.ACQUIRE_TOKEN_SUCCESS && o.payload) {
202
+ if (o.eventType === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
203
203
  const c = o.payload, a = c.account;
204
204
  e.msalInstance.setActiveAccount(a);
205
205
  const i = c.accessToken, l = c.expiresOn;
@@ -260,7 +260,7 @@ const Ve = ({ children: e }) => {
260
260
  ]);
261
261
  return /* @__PURE__ */ f.jsx(de.Provider, { value: u, children: e });
262
262
  };
263
- var Je = typeof Element < "u", Qe = typeof Map == "function", We = typeof Set == "function", Ze = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
263
+ var Je = typeof Element < "u", We = typeof Map == "function", Ze = typeof Set == "function", Qe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
264
264
  function F(e, t) {
265
265
  if (e === t) return !0;
266
266
  if (e && t && typeof e == "object" && typeof t == "object") {
@@ -273,7 +273,7 @@ function F(e, t) {
273
273
  return !0;
274
274
  }
275
275
  var o;
276
- if (Qe && e instanceof Map && t instanceof Map) {
276
+ if (We && e instanceof Map && t instanceof Map) {
277
277
  if (e.size !== t.size) return !1;
278
278
  for (o = e.entries(); !(n = o.next()).done; )
279
279
  if (!t.has(n.value[0])) return !1;
@@ -281,13 +281,13 @@ function F(e, t) {
281
281
  if (!F(n.value[1], t.get(n.value[0]))) return !1;
282
282
  return !0;
283
283
  }
284
- if (We && e instanceof Set && t instanceof Set) {
284
+ if (Ze && e instanceof Set && t instanceof Set) {
285
285
  if (e.size !== t.size) return !1;
286
286
  for (o = e.entries(); !(n = o.next()).done; )
287
287
  if (!t.has(n.value[0])) return !1;
288
288
  return !0;
289
289
  }
290
- if (Ze && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
290
+ if (Qe && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
291
291
  if (r = e.length, r != t.length) return !1;
292
292
  for (n = r; n-- !== 0; )
293
293
  if (e[n] !== t[n]) return !1;
@@ -512,15 +512,15 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
512
512
  "script",
513
513
  "style"
514
514
  /* STYLE */
515
- ], W = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), ge = (e) => Object.keys(e).reduce((t, r) => {
515
+ ], Z = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), ge = (e) => Object.keys(e).reduce((t, r) => {
516
516
  const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
517
517
  return t ? `${t} ${n}` : n;
518
518
  }, ""), dt = (e, t, r, n) => {
519
519
  const s = ge(r), o = ye(t);
520
- return s ? `<${e} ${x}="true" ${s}>${W(
520
+ return s ? `<${e} ${x}="true" ${s}>${Z(
521
521
  o,
522
522
  n
523
- )}</${e}>` : `<${e} ${x}="true">${W(
523
+ )}</${e}>` : `<${e} ${x}="true">${Z(
524
524
  o,
525
525
  n
526
526
  )}</${e}>`;
@@ -528,7 +528,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
528
528
  const o = s, c = Object.keys(o).filter(
529
529
  (l) => !(l === "innerHTML" || l === "cssText")
530
530
  ).reduce((l, u) => {
531
- const d = typeof o[u] > "u" ? u : `${u}="${W(o[u], r)}"`;
531
+ const d = typeof o[u] > "u" ? u : `${u}="${Z(o[u], r)}"`;
532
532
  return l ? `${l} ${d}` : d;
533
533
  }, ""), a = o.innerHTML || o.cssText || "", i = ft.indexOf(e) === -1;
534
534
  return `${n}<${e} ${x}="true" ${c}${i ? "/>" : `>${a}</${e}>`}`;
@@ -624,12 +624,12 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
624
624
  style: T("style", c, n),
625
625
  title: T("title", { title: a, titleAttributes: i }, n)
626
626
  };
627
- }, Z = yt, U = [], ve = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
627
+ }, Q = yt, U = [], ve = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
628
628
  constructor(e, t) {
629
- b(this, "instances", []);
630
- b(this, "canUseDOM", ve);
631
- b(this, "context");
632
- b(this, "value", {
629
+ S(this, "instances", []);
630
+ S(this, "canUseDOM", ve);
631
+ S(this, "context");
632
+ S(this, "value", {
633
633
  setHelmet: (e) => {
634
634
  this.context.helmet = e;
635
635
  },
@@ -644,7 +644,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
644
644
  }
645
645
  }
646
646
  });
647
- this.context = e, this.canUseDOM = t || !1, t || (e.helmet = Z({
647
+ this.context = e, this.canUseDOM = t || !1, t || (e.helmet = Q({
648
648
  baseTag: [],
649
649
  bodyAttributes: {},
650
650
  encodeSpecialCharacters: !0,
@@ -661,13 +661,13 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
661
661
  }, gt = {}, xe = E.createContext(gt), j, Ce = (j = class extends te {
662
662
  constructor(r) {
663
663
  super(r);
664
- b(this, "helmetData");
664
+ S(this, "helmetData");
665
665
  this.helmetData = new X(this.props.context || {}, j.canUseDOM);
666
666
  }
667
667
  render() {
668
668
  return /* @__PURE__ */ E.createElement(xe.Provider, { value: this.helmetData.value }, this.props.children);
669
669
  }
670
- }, b(j, "canUseDOM", ve), j), k = (e, t) => {
670
+ }, S(j, "canUseDOM", ve), j), k = (e, t) => {
671
671
  const r = document.head || document.querySelector(
672
672
  "head"
673
673
  /* HEAD */
@@ -745,7 +745,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
745
745
  }, xt = vt, ce = class extends te {
746
746
  constructor() {
747
747
  super(...arguments);
748
- b(this, "rendered", !1);
748
+ S(this, "rendered", !1);
749
749
  }
750
750
  shouldComponentUpdate(t) {
751
751
  return !rt(t, this.props);
@@ -766,7 +766,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
766
766
  return delete c.context, c;
767
767
  })
768
768
  );
769
- Ce.canUseDOM ? xt(s) : Z && (n = Z(s)), r(n);
769
+ Ce.canUseDOM ? xt(s) : Q && (n = Q(s)), r(n);
770
770
  }
771
771
  // componentWillMount will be deprecated
772
772
  // for SSR, initialize on first render
@@ -899,7 +899,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
899
899
  }
900
900
  return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(xe.Consumer, null, (s) => /* @__PURE__ */ E.createElement(ce, { ...r, context: s }));
901
901
  }
902
- }, b(J, "defaultProps", {
902
+ }, S(J, "defaultProps", {
903
903
  defer: !0,
904
904
  encodeSpecialCharacters: !0,
905
905
  prioritizeSeoTags: !1
@@ -916,9 +916,9 @@ const Ut = ({ defaultHelmet: e, children: t }) => {
916
916
  ] }) });
917
917
  }, At = () => {
918
918
  const { texts: { confirm: e } } = _(z), { onConfirm: t, onCancel: r, text: n, show: s } = Me();
919
- return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
920
- /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
921
- /* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
919
+ return /* @__PURE__ */ f.jsxs(b, { show: s, size: "sm", centered: !0, onHide: r, children: [
920
+ /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: n }) }),
921
+ /* @__PURE__ */ f.jsx(b.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
922
922
  /* @__PURE__ */ f.jsx(G, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: r, children: e.no }),
923
923
  /* @__PURE__ */ f.jsx(G, { type: "button", color: "primary", onClick: t, className: "w-100 ml", children: e.yes })
924
924
  ] }) })
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar.es-CRYH7xvU.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),T=require("./usePermissions-DihYt5eO.cjs"),d=require("./useClipboard-DryTYSx9.cjs"),x=require("./useGetApiData-C6zACwiC.cjs"),c=require("react"),B=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const G=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(G(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},O=(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),P=c.useRef(0),{isAuthenticated:y}=u.useAuth(),[b,m]=c.useState(null),p=c.useCallback(async(f,A)=>{if(!y()||a===!1)return;!t&&w(`loadData-${r}-${A}`),s&&m(null);const k=g.get(r,{signal:f}).then(C=>h?h(C.data):C.data).finally(()=>!t&&D(`loadData-${r}-${A}`));m(E(k,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,++P.current),()=>{f.abort()}},[p,e]),{data:b,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=q.useClickOutside;exports.useWindowSize=q.useWindowSize;exports.usePermissions=T.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=x.useGetApiData;exports.useLocalStorageState=B.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar.es-C8-VCzr1.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),T=require("./usePermissions-DMDGiPC1.cjs"),d=require("./useClipboard-D6esVLqf.cjs"),x=require("./useGetApiData-D4Xo7Loy.cjs"),c=require("react"),B=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const G=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(G(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},O=(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),P=c.useRef(0),{isAuthenticated:y}=u.useAuth(),[b,m]=c.useState(null),p=c.useCallback(async(f,A)=>{if(!y()||a===!1)return;!t&&w(`loadData-${r}-${A}`),s&&m(null);const k=g.get(r,{signal:f}).then(C=>h?h(C.data):C.data).finally(()=>!t&&D(`loadData-${r}-${A}`));m(E(k,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,++P.current),()=>{f.abort()}},[p,e]),{data:b,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=q.useClickOutside;exports.useWindowSize=q.useWindowSize;exports.usePermissions=T.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=x.useGetApiData;exports.useLocalStorageState=B.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=L;
package/dist/hooks.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { ar as S, at as L, aR as P } from "./nivo-bar.es-GeqH-wP6.js";
2
- import { bo as Z, aq as j, af as H, au as J, ap as M, bp as V } from "./nivo-bar.es-GeqH-wP6.js";
1
+ import { ar as x, at as L, aS as P } from "./nivo-bar.es-B2GqU-tV.js";
2
+ import { bp as Z, aq as j, af as H, au as J, ap as M, bq as V } from "./nivo-bar.es-B2GqU-tV.js";
3
3
  import { a as Y, u as _ } from "./useWindowSize-OLYtjFv_.js";
4
- import { u as et } from "./usePermissions-Dn1zXYZT.js";
5
- import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-B_wtiBC7.js";
6
- import { u as lt } from "./useGetApiData-DRl4eniT.js";
4
+ import { u as et } from "./usePermissions-BKn9Opdd.js";
5
+ import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-DegAIBUd.js";
6
+ import { u as lt } from "./useGetApiData-CTK8sM2X.js";
7
7
  import { useState as b, useEffect as C, useContext as T, useRef as U, useCallback as $ } from "react";
8
8
  import { u as ft } from "./useLocalStorageState-Bt99kkCr.js";
9
9
  import "react-router-dom";
@@ -32,7 +32,7 @@ const B = (o) => {
32
32
  };
33
33
  };
34
34
  function z(o, t) {
35
- const a = S({
35
+ const a = x({
36
36
  silent: !0,
37
37
  differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
38
38
  customToken: t == null ? void 0 : t.customToken
@@ -73,7 +73,7 @@ const E = (o, t, a) => {
73
73
  nullStateBeforeLoad: !0,
74
74
  nullStateOnFail: !1
75
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({
76
+ const p = x({
77
77
  silent: e,
78
78
  customToken: n,
79
79
  differentBaseUrl: r,
@@ -84,7 +84,7 @@ const E = (o, t, a) => {
84
84
  !e && h(`loadData-${o}-${D}`), s && d(null);
85
85
  const A = p.get(o, {
86
86
  signal: l
87
- }).then((x) => i ? i(x.data) : x.data).finally(() => !e && w(`loadData-${o}-${D}`));
87
+ }).then((S) => i ? i(S.data) : S.data).finally(() => !e && w(`loadData-${o}-${D}`));
88
88
  d(E(A, c ?? !1, f ?? !1));
89
89
  }, [
90
90
  g,
@@ -111,7 +111,7 @@ const E = (o, t, a) => {
111
111
  export {
112
112
  Z as cancelToken,
113
113
  P as useAuth,
114
- S as useAxios,
114
+ x as useAxios,
115
115
  Y as useClickOutside,
116
116
  at as useClipboard,
117
117
  j as useConfirm,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-CRYH7xvU.cjs"),d=require("react"),g=require("react-router-dom");require("react-hook-form");require("react-flexmonster");const P=require("./SimpleTooltip-B20SNN2b.cjs");require("@azure/msal-browser");require("@azure/msal-react");const y=require("./useWindowSize-CE6DJWzn.cjs"),S=require("./usePermissions-DihYt5eO.cjs"),f=require("./FullScreenContainer-wS-hROzA.cjs"),k="_side-menu-item_1o1uo_1",I="_disabled_1o1uo_6",w="_nav-button_1o1uo_10",z="_child_1o1uo_18",q="_text_1o1uo_23",T="_icon_1o1uo_30",L="_collapse-icon_1o1uo_36",$="_collapsed_1o1uo_46",F="_collapse-icon-mini_1o1uo_49",O="_expanded_1o1uo_80",A="_children-container_1o1uo_86",K="_visible_1o1uo_94",D="_children_1o1uo_86",H="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:k,disabled:I,"nav-button":"_nav-button_1o1uo_10",navButton:w,child:z,text:q,icon:T,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:L,collapsed:$,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:F,expanded:O,"children-container":"_children-container_1o1uo_86",childrenContainer:A,visible:K,children:D,mobile:H},U=({item:n,menuExpanded:t,useTooltips:i,children:r})=>n.tooltip&&!t&&i?e.jsxRuntimeExports.jsx(P.SimpleTooltip,{text:n.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:r})}):r,C=({item:n,menuExpanded:t,collapsed:i,onCollapse:r,currentPath:l,useHover:u,useTooltips:x,isMobile:a})=>{var M,v,N,h;const[p,_]=d.useState(!1),[b]=l.split("?"),m=n.linkTo===b||((M=n.children)==null?void 0:M.some(s=>s.linkTo===b)),E=d.useRef(null);return y.useClickOutside([E],()=>i&&r()),e.jsxRuntimeExports.jsxs("li",{ref:E,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:a},{[o.expanded]:t},{active:p||m},{open:i&&n.children},{[o.disabled]:n.disabled||n.notPermitted||((v=n.children)==null?void 0:v.every(s=>s.notPermitted||s.disabled))},{disabled:n.disabled||n.notPermitted||((N=n.children)==null?void 0:N.every(s=>s.notPermitted||s.disabled))}),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[e.jsxRuntimeExports.jsx(U,{item:n,menuExpanded:t,useTooltips:x,children:n.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{r()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),!u&&!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(g.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:(h=n.children)==null?void 0:h.map(s=>e.jsxRuntimeExports.jsx(g.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:r,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})},s.linkTo))})})]})},W="_side-menu_15z3o_1",G="_sidebar-header_15z3o_13",J="_side-menu-content_15z3o_20",Q="_expand_15z3o_24",V="_only-logo_15z3o_28",X="_mobile_15z3o_31",Y="_divider_15z3o_45",j={"side-menu":"_side-menu_15z3o_1",sideMenu:W,"sidebar-header":"_sidebar-header_15z3o_13",sidebarHeader:G,"side-menu-content":"_side-menu-content_15z3o_20",sideMenuContent:J,expand:Q,"only-logo":"_only-logo_15z3o_28",onlyLogo:V,mobile:X,divider:Y},Z=({headerItem:n,searchItem:t,mainItems:i,secondaryItems:r,expanded:l,setExpanded:u,currentPath:x,useHover:a,useTooltips:p})=>{const[_,b]=d.useState(-1),{checkUserHasPermissions:m}=S.usePermissions(),E=d.useMemo(()=>i.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any"),disabled:s.disabled||R.disabled}))}}),[i,m]),M=d.useMemo(()=>r.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any")}))}}),[r,m]),v=s=>{b(s===_?-1:s)};d.useEffect(()=>{l||b(-1)},[l]);const N=d.useRef(null);y.useClickOutside([N],()=>u(!1));const{isMobile:h}=y.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",j.sideMenu,{[j.mobile]:h},{[j.expand]:l},{expand:l}),onMouseEnter:()=>a&&u(!0),onMouseLeave:()=>a&&u(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",j.sidebarHeader,{[j.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>u(!l),children:a?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:j.sideMenuContent,children:[t?e.jsxRuntimeExports.jsx("div",{className:"p-3",children:t}):null,E.map((s,c)=>e.jsxRuntimeExports.jsx(C,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",j.divider)}),M.map((s,c)=>e.jsxRuntimeExports.jsx(C,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title))]})]})},ee="_top-bar_1usoa_1",se="_top-bar-brand_1usoa_13",B={"top-bar":"_top-bar_1usoa_1",topBar:ee,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:se},ne=({appName:n,leftOffset:t,centerContent:i,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",B.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.topBarBrand),children:n}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:r??null})]}),oe=({title:n,children:t,sideContent:i,sideContentWidth:r=250,noPadding:l,className:u,helmet:x})=>{const{addHelmet:a,removeHelmet:p}=d.useContext(e.HelmetContext);return d.useEffect(()=>(x?a(x):typeof n=="string"&&n&&a(n),()=>p()),[x,a,p,n]),e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",l?"p-0":"p-3",u),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${r}px`:void 0},children:[n?e.jsxRuntimeExports.jsx(e.PageTitle,{title:n}):null,t]}),i&&e.jsxRuntimeExports.jsx(e.SideContentBar,{width:r,children:i})]})};exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.FullScreenContainer=f.FullScreenContainer;exports.MainContainer=oe;exports.SideMenu=Z;exports.TopBar=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-C8-VCzr1.cjs"),d=require("react"),g=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const y=require("./useWindowSize-CE6DJWzn.cjs"),P=require("./usePermissions-DMDGiPC1.cjs"),f=require("./FullScreenContainer-BWYwSExf.cjs"),k="_side-menu-item_1o1uo_1",S="_disabled_1o1uo_6",I="_nav-button_1o1uo_10",w="_child_1o1uo_18",z="_text_1o1uo_23",q="_icon_1o1uo_30",L="_collapse-icon_1o1uo_36",T="_collapsed_1o1uo_46",$="_collapse-icon-mini_1o1uo_49",F="_expanded_1o1uo_80",O="_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:k,disabled:S,"nav-button":"_nav-button_1o1uo_10",navButton:I,child:w,text:z,icon:q,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:L,collapsed:T,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:$,expanded:F,"children-container":"_children-container_1o1uo_86",childrenContainer:O,visible:A,children:K,mobile:D},H=({item:n,menuExpanded:t,useTooltips:i,children:r})=>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:r})}):r,C=({item:n,menuExpanded:t,collapsed:i,onCollapse:r,currentPath:l,useHover:u,useTooltips:x,isMobile:a})=>{var M,v,N,h;const[p,_]=d.useState(!1),[b]=l.split("?"),m=n.linkTo===b||((M=n.children)==null?void 0:M.some(s=>s.linkTo===b)),E=d.useRef(null);return y.useClickOutside([E],()=>i&&r()),e.jsxRuntimeExports.jsxs("li",{ref:E,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:a},{[o.expanded]:t},{active:p||m},{open:i&&n.children},{[o.disabled]:n.disabled||n.notPermitted||((v=n.children)==null?void 0:v.every(s=>s.notPermitted||s.disabled))},{disabled:n.disabled||n.notPermitted||((N=n.children)==null?void 0:N.every(s=>s.notPermitted||s.disabled))}),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[e.jsxRuntimeExports.jsx(H,{item:n,menuExpanded:t,useTooltips:x,children:n.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{r()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),!u&&!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(g.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:(h=n.children)==null?void 0:h.map(s=>e.jsxRuntimeExports.jsx(g.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:r,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})},s.linkTo))})})]})},U="_side-menu_15z3o_1",W="_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",j={"side-menu":"_side-menu_15z3o_1",sideMenu:U,"sidebar-header":"_sidebar-header_15z3o_13",sidebarHeader:W,"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:r,expanded:l,setExpanded:u,currentPath:x,useHover:a,useTooltips:p})=>{const[_,b]=d.useState(-1),{checkUserHasPermissions:m}=P.usePermissions(),E=d.useMemo(()=>i.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any"),disabled:s.disabled||R.disabled}))}}),[i,m]),M=d.useMemo(()=>r.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any")}))}}),[r,m]),v=s=>{b(s===_?-1:s)};d.useEffect(()=>{l||b(-1)},[l]);const N=d.useRef(null);y.useClickOutside([N],()=>u(!1));const{isMobile:h}=y.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",j.sideMenu,{[j.mobile]:h},{[j.expand]:l},{expand:l}),onMouseEnter:()=>a&&u(!0),onMouseLeave:()=>a&&u(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",j.sidebarHeader,{[j.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>u(!l),children:a?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:j.sideMenuContent,children:[t?e.jsxRuntimeExports.jsx("div",{className:"p-3",children:t}):null,E.map((s,c)=>e.jsxRuntimeExports.jsx(C,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",j.divider)}),M.map((s,c)=>e.jsxRuntimeExports.jsx(C,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title))]})]})},Z="_top-bar_1usoa_1",ee="_top-bar-brand_1usoa_13",B={"top-bar":"_top-bar_1usoa_1",topBar:Z,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:ee},se=({appName:n,leftOffset:t,centerContent:i,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",B.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.topBarBrand),children:n}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:r??null})]}),ne=({title:n,children:t,sideContent:i,sideContentWidth:r=250,noPadding:l,className:u,helmet:x})=>{const{addHelmet:a,removeHelmet:p}=d.useContext(e.HelmetContext);return d.useEffect(()=>(x?a(x):typeof n=="string"&&n&&a(n),()=>p()),[x,a,p,n]),e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",l?"p-0":"p-3",u),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${r}px`:void 0},children:[n?e.jsxRuntimeExports.jsx(e.PageTitle,{title:n}):null,t]}),i&&e.jsxRuntimeExports.jsx(e.SideContentBar,{width:r,children:i})]})};exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.FullScreenContainer=f.FullScreenContainer;exports.MainContainer=ne;exports.SideMenu=Y;exports.TopBar=se;
package/dist/layout.es.js CHANGED
@@ -1,15 +1,14 @@
1
- import { j as e, c as i, ac as B, b9 as L, ba as T, bb as R, bc as $, bd as F } from "./nivo-bar.es-GeqH-wP6.js";
2
- import { be as Ie } from "./nivo-bar.es-GeqH-wP6.js";
3
- import { useState as k, useRef as w, useMemo as C, useEffect as z, useContext as A } from "react";
1
+ import { j as e, c as i, ac as B, aF as L, ba as T, bb as R, bc as $, bd as F, be as A } from "./nivo-bar.es-B2GqU-tV.js";
2
+ import { bf as Ce } from "./nivo-bar.es-B2GqU-tV.js";
3
+ import { useState as k, useRef as w, useMemo as C, useEffect as z, useContext as H } from "react";
4
4
  import { Link as y } from "react-router-dom";
5
5
  import "react-hook-form";
6
6
  import "react-flexmonster";
7
- import { S as H } from "./SimpleTooltip-BJ1Ja0Rd.js";
8
7
  import "@azure/msal-browser";
9
8
  import "@azure/msal-react";
10
9
  import { a as S, u as K } from "./useWindowSize-OLYtjFv_.js";
11
- import { u as O } from "./usePermissions-Dn1zXYZT.js";
12
- import { F as ke } from "./FullScreenContainer-DYBgh54H.js";
10
+ import { u as O } from "./usePermissions-BKn9Opdd.js";
11
+ import { F as Pe } from "./FullScreenContainer-Ahxfk-Xk.js";
13
12
  const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1o1uo_10", E = "_child_1o1uo_18", G = "_text_1o1uo_23", J = "_icon_1o1uo_30", Q = "_collapse-icon_1o1uo_36", V = "_collapsed_1o1uo_46", W = "_collapse-icon-mini_1o1uo_49", X = "_expanded_1o1uo_80", Y = "_children-container_1o1uo_86", Z = "_visible_1o1uo_94", ee = "_children_1o1uo_86", oe = "_mobile_1o1uo_106", s = {
14
13
  "side-menu-item": "_side-menu-item_1o1uo_1",
15
14
  sideMenuItem: D,
@@ -30,49 +29,49 @@ const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1
30
29
  visible: Z,
31
30
  children: ee,
32
31
  mobile: oe
33
- }, ne = ({ item: n, menuExpanded: t, useTooltips: l, children: a }) => n.tooltip && !t && l ? /* @__PURE__ */ e.jsx(H, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: a }) }) : a, I = ({ item: n, menuExpanded: t, collapsed: l, onCollapse: a, currentPath: r, useHover: _, useTooltips: u, isMobile: d }) => {
32
+ }, ne = ({ item: n, menuExpanded: t, useTooltips: a, children: l }) => n.tooltip && !t && a ? /* @__PURE__ */ e.jsx(L, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: l }) }) : l, I = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: l, currentPath: r, useHover: _, useTooltips: u, isMobile: d }) => {
34
33
  var g, M, N, v;
35
34
  const [p, b] = k(!1), [h] = r.split("?"), m = n.linkTo === h || ((g = n.children) == null ? void 0 : g.some((o) => o.linkTo === h)), f = w(null);
36
- return S([f], () => l && a()), /* @__PURE__ */ e.jsxs("li", { ref: f, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: d }, {
35
+ return S([f], () => a && l()), /* @__PURE__ */ e.jsxs("li", { ref: f, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: d }, {
37
36
  [s.expanded]: t
38
- }, { active: p || m }, { open: l && n.children }, {
37
+ }, { active: p || m }, { open: a && n.children }, {
39
38
  [s.disabled]: n.disabled || n.notPermitted || ((M = n.children) == null ? void 0 : M.every((o) => o.notPermitted || o.disabled))
40
39
  }, {
41
40
  disabled: n.disabled || n.notPermitted || ((N = n.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
42
41
  }), onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), children: [
43
42
  /* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: t, useTooltips: u, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
44
- a();
43
+ l();
45
44
  }, children: [
46
45
  /* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
47
46
  !_ && !t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon-mini rounded", s.collapseIconMini, {
48
- [s.collapsed]: l
47
+ [s.collapsed]: a
49
48
  }), children: /* @__PURE__ */ e.jsx(B, {}) }),
50
49
  t && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title }),
51
50
  t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
52
- [s.collapsed]: l
51
+ [s.collapsed]: a
53
52
  }), children: /* @__PURE__ */ e.jsx(B, {}) })
54
53
  ] }) }) : /* @__PURE__ */ e.jsxs(y, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: i("nav-link", s.navButton), children: [
55
54
  /* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
56
55
  t && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title })
57
56
  ] }) }),
58
57
  /* @__PURE__ */ e.jsx("div", { className: i("children-container", s.childrenContainer, {
59
- [s.visible]: l
60
- }), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (v = n.children) == null ? void 0 : v.map((o) => /* @__PURE__ */ e.jsx(y, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, { [s.disabled]: o.disabled || o.notPermitted }, { disabled: o.disabled || o.notPermitted }), onClick: a, children: /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: o.title }) }, o.linkTo)) }) })
58
+ [s.visible]: a
59
+ }), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (v = n.children) == null ? void 0 : v.map((o) => /* @__PURE__ */ e.jsx(y, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, { [s.disabled]: o.disabled || o.notPermitted }, { disabled: o.disabled || o.notPermitted }), onClick: l, children: /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: o.title }) }, o.linkTo)) }) })
61
60
  ] });
62
- }, se = "_side-menu_15z3o_1", ie = "_sidebar-header_15z3o_13", te = "_side-menu-content_15z3o_20", le = "_expand_15z3o_24", ae = "_only-logo_15z3o_28", de = "_mobile_15z3o_31", re = "_divider_15z3o_45", x = {
61
+ }, se = "_side-menu_15z3o_1", ie = "_sidebar-header_15z3o_13", te = "_side-menu-content_15z3o_20", ae = "_expand_15z3o_24", le = "_only-logo_15z3o_28", de = "_mobile_15z3o_31", re = "_divider_15z3o_45", x = {
63
62
  "side-menu": "_side-menu_15z3o_1",
64
63
  sideMenu: se,
65
64
  "sidebar-header": "_sidebar-header_15z3o_13",
66
65
  sidebarHeader: ie,
67
66
  "side-menu-content": "_side-menu-content_15z3o_20",
68
67
  sideMenuContent: te,
69
- expand: le,
68
+ expand: ae,
70
69
  "only-logo": "_only-logo_15z3o_28",
71
- onlyLogo: ae,
70
+ onlyLogo: le,
72
71
  mobile: de,
73
72
  divider: re
74
- }, fe = ({ headerItem: n, searchItem: t, mainItems: l, secondaryItems: a, expanded: r, setExpanded: _, currentPath: u, useHover: d, useTooltips: p }) => {
75
- const [b, h] = k(-1), { checkUserHasPermissions: m } = O(), f = C(() => l.map((o) => {
73
+ }, Ne = ({ headerItem: n, searchItem: t, mainItems: a, secondaryItems: l, expanded: r, setExpanded: _, currentPath: u, useHover: d, useTooltips: p }) => {
74
+ const [b, h] = k(-1), { checkUserHasPermissions: m } = O(), f = C(() => a.map((o) => {
76
75
  var c;
77
76
  return {
78
77
  ...o,
@@ -83,7 +82,7 @@ const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1
83
82
  disabled: o.disabled || j.disabled
84
83
  }))
85
84
  };
86
- }), [l, m]), g = C(() => a.map((o) => {
85
+ }), [a, m]), g = C(() => l.map((o) => {
87
86
  var c;
88
87
  return {
89
88
  ...o,
@@ -93,7 +92,7 @@ const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1
93
92
  notPermitted: !m(j.permissions ?? [], "any")
94
93
  }))
95
94
  };
96
- }), [a, m]), M = (o) => {
95
+ }), [l, m]), M = (o) => {
97
96
  h(o === b ? -1 : o);
98
97
  };
99
98
  z(() => {
@@ -108,9 +107,9 @@ const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1
108
107
  /* @__PURE__ */ e.jsx("div", { className: i("sidebar-header", x.sidebarHeader, {
109
108
  [x.onlyLogo]: d
110
109
  }), role: d ? void 0 : "button", onClick: d ? void 0 : () => _(!r), children: d ? n : r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
111
- /* @__PURE__ */ e.jsx(L, {}),
110
+ /* @__PURE__ */ e.jsx(T, {}),
112
111
  n
113
- ] }) : /* @__PURE__ */ e.jsx(T, {}) }),
112
+ ] }) : /* @__PURE__ */ e.jsx(R, {}) }),
114
113
  /* @__PURE__ */ e.jsxs("ul", { className: x.sideMenuContent, children: [
115
114
  t ? /* @__PURE__ */ e.jsx("div", { className: "p-3", children: t }) : null,
116
115
  f.map((o, c) => /* @__PURE__ */ e.jsx(I, { item: o, menuExpanded: r, collapsed: c === b, onCollapse: () => M(c), currentPath: u, useHover: d, useTooltips: p, isMobile: v }, o.title)),
@@ -123,28 +122,28 @@ const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1
123
122
  topBar: ce,
124
123
  "top-bar-brand": "_top-bar-brand_1usoa_13",
125
124
  topBarBrand: _e
126
- }, ge = ({ appName: n, leftOffset: t, centerContent: l, rightContent: a }) => /* @__PURE__ */ e.jsxs("nav", { className: i("luminus-top-bar shadow gap-1 gap-lg-3", P.topBar), style: {
125
+ }, fe = ({ appName: n, leftOffset: t, centerContent: a, rightContent: l }) => /* @__PURE__ */ e.jsxs("nav", { className: i("luminus-top-bar shadow gap-1 gap-lg-3", P.topBar), style: {
127
126
  width: t ? `calc(100% - ${t}px)` : void 0,
128
127
  left: t ? `${t}px` : void 0
129
128
  }, children: [
130
129
  /* @__PURE__ */ e.jsx(y, { to: "/", className: i("luminus-top-bar-brand", P.topBarBrand), children: n }),
131
- l && /* @__PURE__ */ e.jsx("div", { children: l }),
132
- /* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center", children: a ?? null })
133
- ] }), ye = ({ title: n, children: t, sideContent: l, sideContentWidth: a = 250, noPadding: r, className: _, helmet: u }) => {
134
- const { addHelmet: d, removeHelmet: p } = A(R);
130
+ a && /* @__PURE__ */ e.jsx("div", { children: a }),
131
+ /* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center", children: l ?? null })
132
+ ] }), ge = ({ title: n, children: t, sideContent: a, sideContentWidth: l = 250, noPadding: r, className: _, helmet: u }) => {
133
+ const { addHelmet: d, removeHelmet: p } = H($);
135
134
  return z(() => (u ? d(u) : typeof n == "string" && n && d(n), () => p()), [u, d, p, n]), /* @__PURE__ */ e.jsxs("div", { className: i("container-fluid", r ? "p-0" : "p-3", _), children: [
136
- /* @__PURE__ */ e.jsxs("div", { style: { paddingRight: l ? `${a}px` : void 0 }, children: [
137
- n ? /* @__PURE__ */ e.jsx($, { title: n }) : null,
135
+ /* @__PURE__ */ e.jsxs("div", { style: { paddingRight: a ? `${l}px` : void 0 }, children: [
136
+ n ? /* @__PURE__ */ e.jsx(F, { title: n }) : null,
138
137
  t
139
138
  ] }),
140
- l && /* @__PURE__ */ e.jsx(F, { width: a, children: l })
139
+ a && /* @__PURE__ */ e.jsx(A, { width: l, children: a })
141
140
  ] });
142
141
  };
143
142
  export {
144
- ke as FullScreenContainer,
145
- ye as MainContainer,
146
- Ie as PageContainer,
147
- F as SideContentBar,
148
- fe as SideMenu,
149
- ge as TopBar
143
+ Pe as FullScreenContainer,
144
+ ge as MainContainer,
145
+ Ce as PageContainer,
146
+ A as SideContentBar,
147
+ Ne as SideMenu,
148
+ fe as TopBar
150
149
  };