react-luminus-components 1.2.79 → 1.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Q as He, ab as Ae, an as Qe } from "./UserAvatarToggle-ByG1NTlM.js";
2
- import { aF as pr, af as yr, aE as _r } from "./UserAvatarToggle-ByG1NTlM.js";
3
- import { a as gr, u as xr } from "./useConfirm-C2tLxO-b.js";
1
+ import { Q as He, a4 as Ae, an as Qe } from "./NoInputContainer-D_sgAiux.js";
2
+ import { aF as pr, a9 as yr, aE as _r } from "./NoInputContainer-D_sgAiux.js";
3
+ import { a as gr, u as xr } from "./useConfirm-BgDxf_xi.js";
4
4
  import { useContext as $e, useRef as Xe, useState as Me, useCallback as Ke, useEffect as ze } from "react";
5
5
  import { f as Fe } from "./textUtils-BbxuIsKq.js";
6
6
  import { i as et } from "./dateUtils-Crak7ii9.js";
7
7
  import "react-hook-form";
8
- import { b as kr, u as wr, a as Tr } from "./useFormControlType-oJGqgThz.js";
9
- import { u as Cr } from "./usePermissions-CPbQAr2_.js";
8
+ import { a as br, b as wr, u as Tr } from "./useFormControlType-BAFqxupC.js";
9
+ import { u as Cr } from "./usePermissions-cOpmP15X.js";
10
10
  var x;
11
11
  (function(r) {
12
12
  r.assertEqual = (s) => s;
@@ -1504,13 +1504,13 @@ R.create = (r, e) => new R({
1504
1504
  ..._(e)
1505
1505
  });
1506
1506
  function Y(r) {
1507
- if (r instanceof b) {
1507
+ if (r instanceof k) {
1508
1508
  const e = {};
1509
1509
  for (const t in r.shape) {
1510
1510
  const n = r.shape[t];
1511
1511
  e[t] = j.create(Y(n));
1512
1512
  }
1513
- return new b({
1513
+ return new k({
1514
1514
  ...r._def,
1515
1515
  shape: () => e
1516
1516
  });
@@ -1520,7 +1520,7 @@ function Y(r) {
1520
1520
  type: Y(r.element)
1521
1521
  }) : r instanceof j ? j.create(Y(r.unwrap())) : r instanceof q ? q.create(Y(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => Y(e))) : r;
1522
1522
  }
1523
- class b extends v {
1523
+ class k extends v {
1524
1524
  constructor() {
1525
1525
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1526
1526
  }
@@ -1598,7 +1598,7 @@ class b extends v {
1598
1598
  return this._def.shape();
1599
1599
  }
1600
1600
  strict(e) {
1601
- return h.errToObj, new b({
1601
+ return h.errToObj, new k({
1602
1602
  ...this._def,
1603
1603
  unknownKeys: "strict",
1604
1604
  ...e !== void 0 ? {
@@ -1615,13 +1615,13 @@ class b extends v {
1615
1615
  });
1616
1616
  }
1617
1617
  strip() {
1618
- return new b({
1618
+ return new k({
1619
1619
  ...this._def,
1620
1620
  unknownKeys: "strip"
1621
1621
  });
1622
1622
  }
1623
1623
  passthrough() {
1624
- return new b({
1624
+ return new k({
1625
1625
  ...this._def,
1626
1626
  unknownKeys: "passthrough"
1627
1627
  });
@@ -1644,7 +1644,7 @@ class b extends v {
1644
1644
  // }) as any;
1645
1645
  // };
1646
1646
  extend(e) {
1647
- return new b({
1647
+ return new k({
1648
1648
  ...this._def,
1649
1649
  shape: () => ({
1650
1650
  ...this._def.shape(),
@@ -1658,7 +1658,7 @@ class b extends v {
1658
1658
  * upgrade if you are experiencing issues.
1659
1659
  */
1660
1660
  merge(e) {
1661
- return new b({
1661
+ return new k({
1662
1662
  unknownKeys: e._def.unknownKeys,
1663
1663
  catchall: e._def.catchall,
1664
1664
  shape: () => ({
@@ -1728,7 +1728,7 @@ class b extends v {
1728
1728
  // return merged;
1729
1729
  // }
1730
1730
  catchall(e) {
1731
- return new b({
1731
+ return new k({
1732
1732
  ...this._def,
1733
1733
  catchall: e
1734
1734
  });
@@ -1737,7 +1737,7 @@ class b extends v {
1737
1737
  const t = {};
1738
1738
  return x.objectKeys(e).forEach((n) => {
1739
1739
  e[n] && this.shape[n] && (t[n] = this.shape[n]);
1740
- }), new b({
1740
+ }), new k({
1741
1741
  ...this._def,
1742
1742
  shape: () => t
1743
1743
  });
@@ -1746,7 +1746,7 @@ class b extends v {
1746
1746
  const t = {};
1747
1747
  return x.objectKeys(this.shape).forEach((n) => {
1748
1748
  e[n] || (t[n] = this.shape[n]);
1749
- }), new b({
1749
+ }), new k({
1750
1750
  ...this._def,
1751
1751
  shape: () => t
1752
1752
  });
@@ -1762,7 +1762,7 @@ class b extends v {
1762
1762
  return x.objectKeys(this.shape).forEach((n) => {
1763
1763
  const s = this.shape[n];
1764
1764
  e && !e[n] ? t[n] = s : t[n] = s.optional();
1765
- }), new b({
1765
+ }), new k({
1766
1766
  ...this._def,
1767
1767
  shape: () => t
1768
1768
  });
@@ -1778,7 +1778,7 @@ class b extends v {
1778
1778
  a = a._def.innerType;
1779
1779
  t[n] = a;
1780
1780
  }
1781
- }), new b({
1781
+ }), new k({
1782
1782
  ...this._def,
1783
1783
  shape: () => t
1784
1784
  });
@@ -1787,21 +1787,21 @@ class b extends v {
1787
1787
  return Ue(x.objectKeys(this.shape));
1788
1788
  }
1789
1789
  }
1790
- b.create = (r, e) => new b({
1790
+ k.create = (r, e) => new k({
1791
1791
  shape: () => r,
1792
1792
  unknownKeys: "strip",
1793
1793
  catchall: z.create(),
1794
1794
  typeName: p.ZodObject,
1795
1795
  ..._(e)
1796
1796
  });
1797
- b.strictCreate = (r, e) => new b({
1797
+ k.strictCreate = (r, e) => new k({
1798
1798
  shape: () => r,
1799
1799
  unknownKeys: "strict",
1800
1800
  catchall: z.create(),
1801
1801
  typeName: p.ZodObject,
1802
1802
  ..._(e)
1803
1803
  });
1804
- b.lazycreate = (r, e) => new b({
1804
+ k.lazycreate = (r, e) => new k({
1805
1805
  shape: r,
1806
1806
  unknownKeys: "strip",
1807
1807
  catchall: z.create(),
@@ -2100,7 +2100,7 @@ class oe extends v {
2100
2100
  });
2101
2101
  }
2102
2102
  }
2103
- class be extends v {
2103
+ class ke extends v {
2104
2104
  get keySchema() {
2105
2105
  return this._def.keyType;
2106
2106
  }
@@ -2142,7 +2142,7 @@ class be extends v {
2142
2142
  }
2143
2143
  }
2144
2144
  }
2145
- be.create = (r, e, t) => new be({
2145
+ ke.create = (r, e, t) => new ke({
2146
2146
  valueType: e,
2147
2147
  keyType: r,
2148
2148
  typeName: p.ZodMap,
@@ -2650,7 +2650,7 @@ fe.create = (r, e) => new fe({
2650
2650
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2651
2651
  ..._(e)
2652
2652
  });
2653
- class ke extends v {
2653
+ class be extends v {
2654
2654
  _parse(e) {
2655
2655
  if (this._getType(e) !== f.nan) {
2656
2656
  const n = this._getOrReturnCtx(e);
@@ -2663,7 +2663,7 @@ class ke extends v {
2663
2663
  return { status: "valid", value: e.data };
2664
2664
  }
2665
2665
  }
2666
- ke.create = (r) => new ke({
2666
+ be.create = (r) => new be({
2667
2667
  typeName: p.ZodNaN,
2668
2668
  ..._(r)
2669
2669
  });
@@ -2745,15 +2745,15 @@ function Be(r, e = {}, t) {
2745
2745
  }) : Q.create();
2746
2746
  }
2747
2747
  const xt = {
2748
- object: b.lazycreate
2748
+ object: k.lazycreate
2749
2749
  };
2750
2750
  var p;
2751
2751
  (function(r) {
2752
2752
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2753
2753
  })(p || (p = {}));
2754
- const bt = (r, e = {
2754
+ const kt = (r, e = {
2755
2755
  message: `Input not instance of ${r.name}`
2756
- }) => Be((t) => t instanceof r, e), We = E.create, Ye = D.create, kt = ke.create, wt = V.create, Je = re.create, Tt = B.create, Zt = ge.create, Ct = ne.create, St = se.create, Ot = Q.create, Nt = U.create, Et = z.create, Rt = xe.create, It = R.create, jt = b.create, At = b.strictCreate, $t = ae.create, Mt = we.create, zt = ie.create, Pt = $.create, Dt = oe.create, Vt = be.create, Lt = W.create, qt = G.create, Ut = de.create, Bt = ce.create, Wt = L.create, Yt = ue.create, Jt = X.create, je = I.create, Gt = j.create, Ht = q.create, Qt = I.createWithPreprocess, Xt = me.create, Kt = () => We().optional(), Ft = () => Ye().optional(), er = () => Je().optional(), tr = {
2756
+ }) => Be((t) => t instanceof r, e), We = E.create, Ye = D.create, bt = be.create, wt = V.create, Je = re.create, Tt = B.create, Zt = ge.create, Ct = ne.create, St = se.create, Ot = Q.create, Nt = U.create, Et = z.create, Rt = xe.create, It = R.create, jt = k.create, At = k.strictCreate, $t = ae.create, Mt = we.create, zt = ie.create, Pt = $.create, Dt = oe.create, Vt = ke.create, Lt = W.create, qt = G.create, Ut = de.create, Bt = ce.create, Wt = L.create, Yt = ue.create, Jt = X.create, je = I.create, Gt = j.create, Ht = q.create, Qt = I.createWithPreprocess, Xt = me.create, Kt = () => We().optional(), Ft = () => Ye().optional(), er = () => Je().optional(), tr = {
2757
2757
  string: (r) => E.create({ ...r, coerce: !0 }),
2758
2758
  number: (r) => D.create({ ...r, coerce: !0 }),
2759
2759
  boolean: (r) => re.create({
@@ -2802,13 +2802,13 @@ var O = /* @__PURE__ */ Object.freeze({
2802
2802
  ZodNever: z,
2803
2803
  ZodVoid: xe,
2804
2804
  ZodArray: R,
2805
- ZodObject: b,
2805
+ ZodObject: k,
2806
2806
  ZodUnion: ae,
2807
2807
  ZodDiscriminatedUnion: we,
2808
2808
  ZodIntersection: ie,
2809
2809
  ZodTuple: $,
2810
2810
  ZodRecord: oe,
2811
- ZodMap: be,
2811
+ ZodMap: ke,
2812
2812
  ZodSet: W,
2813
2813
  ZodFunction: G,
2814
2814
  ZodLazy: de,
@@ -2822,7 +2822,7 @@ var O = /* @__PURE__ */ Object.freeze({
2822
2822
  ZodNullable: q,
2823
2823
  ZodDefault: le,
2824
2824
  ZodCatch: fe,
2825
- ZodNaN: ke,
2825
+ ZodNaN: be,
2826
2826
  BRAND: gt,
2827
2827
  ZodBranded: Ee,
2828
2828
  ZodPipeline: me,
@@ -2844,12 +2844,12 @@ var O = /* @__PURE__ */ Object.freeze({
2844
2844
  effect: je,
2845
2845
  enum: Wt,
2846
2846
  function: qt,
2847
- instanceof: bt,
2847
+ instanceof: kt,
2848
2848
  intersection: zt,
2849
2849
  lazy: Ut,
2850
2850
  literal: Bt,
2851
2851
  map: Vt,
2852
- nan: kt,
2852
+ nan: bt,
2853
2853
  nativeEnum: Yt,
2854
2854
  never: Et,
2855
2855
  null: St,
@@ -2883,19 +2883,19 @@ const ur = () => {
2883
2883
  const { formValidationTexts: r } = $e(He), e = (g) => (g != null && g.useCoerce ? O.coerce : O).string({
2884
2884
  invalid_type_error: r.required,
2885
2885
  required_error: r.required
2886
- }).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((k) => k ?? null), n = (g) => {
2887
- const k = (g != null && g.useCoerce ? O.coerce : O).number({
2886
+ }).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((b) => b ?? null), n = (g) => {
2887
+ const b = (g != null && g.useCoerce ? O.coerce : O).number({
2888
2888
  invalid_type_error: r.required,
2889
2889
  required_error: r.required
2890
2890
  });
2891
- return (g == null ? void 0 : g.min) !== void 0 && k.min(g.min), (g == null ? void 0 : g.max) !== void 0 && k.max(g.max), k.transform((w) => w ?? null);
2892
- }, s = (g) => n(g).nullable().optional().transform((k) => k ?? null), a = (g) => (g != null && g.useCoerce ? O.coerce : O).boolean({
2891
+ return (g == null ? void 0 : g.min) !== void 0 && b.min(g.min), (g == null ? void 0 : g.max) !== void 0 && b.max(g.max), b.transform((w) => w ?? null);
2892
+ }, s = (g) => n(g).nullable().optional().transform((b) => b ?? null), a = (g) => (g != null && g.useCoerce ? O.coerce : O).boolean({
2893
2893
  invalid_type_error: r.required,
2894
2894
  required_error: r.required
2895
- }).transform((k) => k ?? null), i = (g) => (g != null && g.useCoerce ? O.coerce : O).string({
2895
+ }).transform((b) => b ?? null), i = (g) => (g != null && g.useCoerce ? O.coerce : O).string({
2896
2896
  invalid_type_error: r.required,
2897
2897
  required_error: r.required
2898
- }).refine(et, { message: r.invalidDate }).transform((w) => w ?? null), o = (g) => i(g).nullable().transform((k) => k ?? null), u = (g, k) => O.enum(g, {
2898
+ }).refine(et, { message: r.invalidDate }).transform((w) => w ?? null), o = (g) => i(g).nullable().transform((b) => b ?? null), u = (g, b) => O.enum(g, {
2899
2899
  invalid_type_error: r.required,
2900
2900
  required_error: r.required
2901
2901
  }).transform((Re) => Re ?? null);
@@ -2907,13 +2907,13 @@ const ur = () => {
2907
2907
  zBool: a,
2908
2908
  zDate: o,
2909
2909
  zDateRequired: i,
2910
- zEnum: (g, k) => u(g).nullable().transform((w) => w ?? null),
2910
+ zEnum: (g, b) => u(g).nullable().transform((w) => w ?? null),
2911
2911
  zEnumRequired: u,
2912
2912
  zObjectIdInt: (g) => O.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2913
2913
  zObjectIdIntRequired: (g) => O.object({ id: n() }).transform((w) => w ?? null),
2914
2914
  zObjectIdStr: (g) => O.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2915
2915
  zObjectIdStrRequired: (g) => O.object({ id: e() }).transform((w) => w ?? null),
2916
- zFile: ({ required: g, multiple: k, maxFileSize: w }) => O.any().transform((T) => Array.from(T ?? [])).refine((T) => !g || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => k || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Ge) => Ge.size <= w), `Maximum file size is ${Fe(w)}.`).transform((T) => (k ? T : T == null ? void 0 : T[0]) ?? null)
2916
+ zFile: ({ required: g, multiple: b, maxFileSize: w }) => O.any().transform((T) => Array.from(T ?? [])).refine((T) => !g || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => b || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Ge) => Ge.size <= w), `Maximum file size is ${Fe(w)}.`).transform((T) => (b ? T : T == null ? void 0 : T[0]) ?? null)
2917
2917
  };
2918
2918
  }, lr = (r, e = !1) => {
2919
2919
  const t = Ae({ silent: e }), { startLoading: n, stopLoading: s } = $e(Qe), a = Xe(0), [i, o] = Me(null), u = Ke(async (c, m) => {
@@ -2966,7 +2966,7 @@ export {
2966
2966
  pr as cancelToken,
2967
2967
  yr as useAuth,
2968
2968
  Ae as useAxios,
2969
- kr as useClickOutside,
2969
+ br as useClickOutside,
2970
2970
  gr as useConfirm,
2971
2971
  wr as useFormControlType,
2972
2972
  lr as useGetApiData,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-cJKNvqKT.cjs"),x=require("react");require("react-hook-form");const w=require("./usePermissions-BlYpl_RP.cjs"),C=require("./SimpleTooltip-CWolhOb-.cjs"),M="_side-menu-item_6vbwa_1",B="_disabled_6vbwa_5",k="_nav-button_6vbwa_9",g="_child_6vbwa_17",S="_text_6vbwa_21",P="_icon_6vbwa_28",f="_collapse-icon_6vbwa_34",T="_collapsed_6vbwa_44",y="_expanded_6vbwa_51",I="_children-container_6vbwa_57",$="_visible_6vbwa_65",H="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:M,disabled:B,"nav-button":"_nav-button_6vbwa_9",navButton:k,child:g,text:S,icon:P,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:f,collapsed:T,expanded:y,"children-container":"_children-container_6vbwa_57",childrenContainer:I,visible:$,children:H},L=({item:e,menuExpanded:t,children:i})=>e.tooltip&&!t?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:e.tooltip,placement:"right",children:i}):i,N=({item:e,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l})=>{var v,_;const{LinkComponent:c}=x.useContext(s.LuminusComponentsContext),[p,u]=x.useState(!1),[d]=l.split("?"),h=e.linkTo===d||((v=e.children)==null?void 0:v.some(n=>n.linkTo===d));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:t},{active:p||h},{open:i&&e.children},{[o.disabled]:e.disabled||e.notPermitted},{disabled:e.disabled||e.notPermitted}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[s.jsxRuntimeExports.jsx(L,{item:e,menuExpanded:t,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",o.navButton),onClick:()=>a(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(c,{to:e.disabled||e.notPermitted?"/":e.linkTo??"/",className:s.classNames("nav-link",o.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",o.children),children:(_=e.children)==null?void 0:_.map(n=>s.jsxRuntimeExports.jsx(c,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:s.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},q="_side-menu_n1hvm_1",F="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",U="_expand_n1hvm_22",K="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:q,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:F,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:U,divider:K},z=({headerItem:e,mainItems:t,secondaryItems:i,expanded:a,setExpanded:l,currentPath:c})=>{const[p,u]=x.useState(-1),{checkUserHasPermissions:d}=w.usePermissions(),h=x.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[]),disabled:n.disabled||m.disabled}))}}),[t,d]),v=x.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[])}))}}),[i,d]),_=n=>{u(n===p?-1:n)};return x.useEffect(()=>{a||u(-1)},[a]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:a},{expand:a}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",j.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[h.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title))]})]})},D="_top-bar_1lk80_1",G="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:D,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:G},J=({appName:e,leftOffset:t,centerContent:i,rightContent:a})=>{const{LinkComponent:l}=x.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar shadow",R.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[s.jsxRuntimeExports.jsx(l,{to:"/",className:s.classNames("luminus-top-bar-brand",R.topBarBrand),children:e}),i&&s.jsxRuntimeExports.jsx("div",{children:i}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:a??null})]})},O="_side-content-bar_17kwd_1",Q={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:O},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar shadow",Q.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(s.Typography,{variant:"h3",children:e}):e}),V=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",l?"p-0":"p-3",c),children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${a}px`:void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]}),X="_full-screen-container_1rm4r_1",Y={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:X},Z=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",l?"p-0":"p-3",c,Y.fullScreenContainer),style:{width:i?`calc(100% - ${a}px)`:"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=V;exports.SideContentBar=b;exports.SideMenu=z;exports.TopBar=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./NoInputContainer-QV9JLbnE.cjs"),u=require("react");require("react-hook-form");const w=require("./usePermissions-DQNoOuU8.cjs"),C=require("./SimpleTooltip-BKmgu79J.cjs"),M="_side-menu-item_6vbwa_1",B="_disabled_6vbwa_5",k="_nav-button_6vbwa_9",S="_child_6vbwa_17",P="_text_6vbwa_21",f="_icon_6vbwa_28",g="_collapse-icon_6vbwa_34",I="_collapsed_6vbwa_44",y="_expanded_6vbwa_51",T="_children-container_6vbwa_57",$="_visible_6vbwa_65",H="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:M,disabled:B,"nav-button":"_nav-button_6vbwa_9",navButton:k,child:S,text:P,icon:f,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:g,collapsed:I,expanded:y,"children-container":"_children-container_6vbwa_57",childrenContainer:T,visible:$,children:H},L=({item:e,menuExpanded:t,children:i})=>e.tooltip&&!t?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:e.tooltip,placement:"right",children:i}):i,N=({item:e,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:l})=>{var v,_;const{LinkComponent:c}=u.useContext(s.LuminusComponentsContext),[p,x]=u.useState(!1),[d]=l.split("?"),h=e.linkTo===d||((v=e.children)==null?void 0:v.some(n=>n.linkTo===d));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.expanded]:t},{active:p||h},{open:i&&e.children},{[o.disabled]:e.disabled||e.notPermitted},{disabled:e.disabled||e.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[s.jsxRuntimeExports.jsx(L,{item:e,menuExpanded:t,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",o.navButton),onClick:()=>a(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(c,{to:e.disabled||e.notPermitted?"/":e.linkTo??"/",className:s.classNames("nav-link",o.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",o.icon),children:e.icon}),t&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",o.children),children:(_=e.children)==null?void 0:_.map(n=>s.jsxRuntimeExports.jsx(c,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:s.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},q="_side-menu_n1hvm_1",F="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:q,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:F,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:K,divider:U},z=({headerItem:e,mainItems:t,secondaryItems:i,expanded:a,setExpanded:l,currentPath:c})=>{const[p,x]=u.useState(-1),{checkUserHasPermissions:d}=w.usePermissions(),h=u.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[]),disabled:n.disabled||m.disabled}))}}),[t,d]),v=u.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!d(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(m=>({...m,notPermitted:!d(m.permissions??[])}))}}),[i,d]),_=n=>{x(n===p?-1:n)};return u.useEffect(()=>{a||x(-1)},[a]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:a},{expand:a}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",j.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[h.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,r)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:a,collapsed:r===p,onCollapse:()=>_(r),currentPath:c},n.title))]})]})},D="_top-bar_1lk80_1",G="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:D,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:G},J=({appName:e,leftOffset:t,centerContent:i,rightContent:a})=>{const{LinkComponent:l}=u.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar shadow",R.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[s.jsxRuntimeExports.jsx(l,{to:"/",className:s.classNames("luminus-top-bar-brand",R.topBarBrand),children:e}),i&&s.jsxRuntimeExports.jsx("div",{children:i}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:a??null})]})},O="_side-content-bar_17kwd_1",Q={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:O},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar shadow",Q.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(s.Typography,{variant:"h3",children:e}):e}),V=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",l?"p-0":"p-3",c),children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${a}px`:void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]}),X="_full-screen-container_1rm4r_1",Y={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:X},Z=({title:e,children:t,sideContent:i,sideContentWidth:a=250,noPadding:l,className:c})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",l?"p-0":"p-3",c,Y.fullScreenContainer),style:{width:i?`calc(100% - ${a}px)`:"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:a,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=V;exports.SideContentBar=b;exports.SideMenu=z;exports.TopBar=J;
package/dist/layout.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { Q as B, j as e, c as o, X as I, _ as P } from "./UserAvatarToggle-ByG1NTlM.js";
1
+ import { Q as B, j as e, c as o, X as I, Y as P } from "./NoInputContainer-D_sgAiux.js";
2
2
  import { useContext as C, useState as M, useMemo as j, useEffect as g } from "react";
3
3
  import "react-hook-form";
4
- import { u as y } from "./usePermissions-CPbQAr2_.js";
5
- import { S } from "./SimpleTooltip-Dlu42YM6.js";
4
+ import { u as y } from "./usePermissions-cOpmP15X.js";
5
+ import { S } from "./SimpleTooltip-CXeUwU65.js";
6
6
  const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6vbwa_9", L = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", R = "_collapse-icon_6vbwa_34", A = "_collapsed_6vbwa_44", K = "_expanded_6vbwa_51", Q = "_children-container_6vbwa_57", U = "_visible_6vbwa_65", X = "_children_6vbwa_57", i = {
7
7
  "side-menu-item": "_side-menu-item_6vbwa_1",
8
8
  sideMenuItem: T,
@@ -20,13 +20,13 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
20
20
  childrenContainer: Q,
21
21
  visible: U,
22
22
  children: X
23
- }, q = ({ item: n, menuExpanded: t, children: a }) => n.tooltip && !t ? /* @__PURE__ */ e.jsx(S, { text: n.tooltip, placement: "right", children: a }) : a, w = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: r, currentPath: d }) => {
23
+ }, Y = ({ item: n, menuExpanded: t, children: a }) => n.tooltip && !t ? /* @__PURE__ */ e.jsx(S, { text: n.tooltip, placement: "right", children: a }) : a, w = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: r, currentPath: d }) => {
24
24
  var b, v;
25
25
  const { LinkComponent: c } = C(B), [p, u] = M(!1), [_] = d.split("?"), x = n.linkTo === _ || ((b = n.children) == null ? void 0 : b.some((s) => s.linkTo === _));
26
26
  return /* @__PURE__ */ e.jsxs("li", { className: o("luminus-side-menu-item", i.sideMenuItem, {
27
27
  [i.expanded]: t
28
28
  }, { active: p || x }, { open: a && n.children }, { [i.disabled]: n.disabled || n.notPermitted }, { disabled: n.disabled || n.notPermitted }), onMouseEnter: () => u(!0), onMouseLeave: () => u(!1), children: [
29
- /* @__PURE__ */ e.jsx(q, { item: n, menuExpanded: t, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", i.navButton), onClick: () => r(), children: [
29
+ /* @__PURE__ */ e.jsx(Y, { item: n, menuExpanded: t, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", i.navButton), onClick: () => r(), children: [
30
30
  /* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
31
31
  t && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title }),
32
32
  t && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", i.collapseIcon, {
@@ -40,15 +40,15 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
40
40
  [i.visible]: a
41
41
  }), children: /* @__PURE__ */ e.jsx("div", { className: o("shadow rounded children", i.children), children: (v = n.children) == null ? void 0 : v.map((s) => /* @__PURE__ */ e.jsx(c, { to: s.disabled || s.notPermitted ? "/" : s.linkTo ?? "/", className: o("nav-link child rounded", i.navButton, i.child, { [i.disabled]: s.disabled || s.notPermitted }, { disabled: s.disabled || s.notPermitted }), children: /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: s.title }) }, s.linkTo)) }) })
42
42
  ] });
43
- }, z = "_side-menu_n1hvm_1", D = "_sidebar-header_n1hvm_13", G = "_side-menu-content_n1hvm_18", J = "_expand_n1hvm_22", V = "_divider_n1hvm_26", h = {
43
+ }, q = "_side-menu_n1hvm_1", z = "_sidebar-header_n1hvm_13", D = "_side-menu-content_n1hvm_18", G = "_expand_n1hvm_22", J = "_divider_n1hvm_26", h = {
44
44
  "side-menu": "_side-menu_n1hvm_1",
45
- sideMenu: z,
45
+ sideMenu: q,
46
46
  "sidebar-header": "_sidebar-header_n1hvm_13",
47
- sidebarHeader: D,
47
+ sidebarHeader: z,
48
48
  "side-menu-content": "_side-menu-content_n1hvm_18",
49
- sideMenuContent: G,
50
- expand: J,
51
- divider: V
49
+ sideMenuContent: D,
50
+ expand: G,
51
+ divider: J
52
52
  }, re = ({ headerItem: n, mainItems: t, secondaryItems: a, expanded: r, setExpanded: d, currentPath: c }) => {
53
53
  const [p, u] = M(-1), { checkUserHasPermissions: _ } = y(), x = j(() => t.map((s) => {
54
54
  var l;
@@ -86,9 +86,9 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
86
86
  b.map((s, l) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: r, collapsed: l === p, onCollapse: () => v(l), currentPath: c }, s.title))
87
87
  ] })
88
88
  ] });
89
- }, Y = "_top-bar_1lk80_1", Z = "_top-bar-brand_1lk80_14", N = {
89
+ }, V = "_top-bar_1lk80_1", Z = "_top-bar-brand_1lk80_14", N = {
90
90
  "top-bar": "_top-bar_1lk80_1",
91
- topBar: Y,
91
+ topBar: V,
92
92
  "top-bar-brand": "_top-bar-brand_1lk80_14",
93
93
  topBarBrand: Z
94
94
  }, le = ({ appName: n, leftOffset: t, centerContent: a, rightContent: r }) => {