react-luminus-components 1.2.5 → 1.2.7

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 (42) hide show
  1. package/dist/.vite/manifest.json +67 -51
  2. package/dist/DataKey-BKjUrLwK.js +33 -0
  3. package/dist/DataKey-Bi3twEA-.cjs +1 -0
  4. package/dist/{SimpleTooltip-qmn_7UT2.js → SimpleTooltip-CrxvDOBl.js} +1 -1
  5. package/dist/{SimpleTooltip-B7uLYPYV.cjs → SimpleTooltip-DVdVP6Q7.cjs} +1 -1
  6. package/dist/{Typography-z6yGwy1k.cjs → Typography-Dy2nkkxH.cjs} +1 -1
  7. package/dist/{Typography-CEiQhQ-u.js → Typography-e-xJ0W5h.js} +1 -1
  8. package/dist/{UserAvatarToggle--4sSvh4e.js → UserAvatarToggle-B3sPIYPV.js} +17 -18
  9. package/dist/{UserAvatarToggle-DVtkEr7E.cjs → UserAvatarToggle-BHyn5qmy.cjs} +42 -42
  10. package/dist/components/NewTabs/Tab/Tab.d.ts +9 -0
  11. package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +10 -0
  12. package/dist/components/NewTabs/Tabs/Tabs.d.ts +9 -0
  13. package/dist/components/NewTabs/index.d.ts +3 -0
  14. package/dist/contexts.cjs.js +1 -1
  15. package/dist/contexts.es.js +4 -4
  16. package/dist/hooks/index.d.ts +2 -0
  17. package/dist/hooks/useKeyPress/useKeyPress.d.ts +2 -0
  18. package/dist/hooks/usePermissions/usePermissions.d.ts +4 -0
  19. package/dist/hooks.cjs.js +1 -1
  20. package/dist/hooks.es.js +45 -42
  21. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +2 -2
  22. package/dist/layout/SideMenu/SideMenu.d.ts +1 -1
  23. package/dist/layout.cjs.js +1 -1
  24. package/dist/layout.es.js +112 -89
  25. package/dist/main.cjs.js +1 -1
  26. package/dist/main.d.ts +1 -1
  27. package/dist/main.es.js +1601 -2166
  28. package/dist/models/index.d.ts +1 -0
  29. package/dist/models/types/MenuItemType.d.ts +2 -0
  30. package/dist/models/types/MenuItemTypeExtended.d.ts +6 -0
  31. package/dist/style.css +1 -1
  32. package/dist/{useConfirm-BXglMff3.js → useConfirm-Dl4SoYM1.js} +1 -1
  33. package/dist/{useConfirm-8L-hW_Lc.cjs → useConfirm-JWnS5nMR.cjs} +1 -1
  34. package/dist/useKeyPress-BGQt3G6e.cjs +1 -0
  35. package/dist/useKeyPress-Chkukevp.js +19 -0
  36. package/dist/usePermissions-Dh8dRtOL.js +12 -0
  37. package/dist/usePermissions-DvUaQzJ1.cjs +1 -0
  38. package/package.json +1 -1
  39. package/dist/DataKey-BNQs8-2u.js +0 -37
  40. package/dist/DataKey-BllxlutQ.cjs +0 -1
  41. package/dist/useClickOutside-BjJyGTec.js +0 -14
  42. package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
package/dist/hooks.es.js CHANGED
@@ -1,10 +1,11 @@
1
- import { L as We } from "./UserAvatarToggle--4sSvh4e.js";
2
- import { d as ar, u as ir, b as or, a as dr } from "./UserAvatarToggle--4sSvh4e.js";
3
- import { u as ur, a as lr } from "./useConfirm-BXglMff3.js";
1
+ import { L as We } from "./UserAvatarToggle-B3sPIYPV.js";
2
+ import { d as ar, u as ir, b as or, a as dr } from "./UserAvatarToggle-B3sPIYPV.js";
3
+ import { u as ur, a as lr } from "./useConfirm-Dl4SoYM1.js";
4
4
  import { useContext as Ye } from "react";
5
5
  import { f as Je } from "./textUtils-BLtD0zaS.js";
6
6
  import { isISODate as He } from "./utils.es.js";
7
- import { u as hr } from "./useClickOutside-BjJyGTec.js";
7
+ import { u as hr, a as mr } from "./useKeyPress-Chkukevp.js";
8
+ import { u as yr } from "./usePermissions-Dh8dRtOL.js";
8
9
  var x;
9
10
  (function(r) {
10
11
  r.assertEqual = (s) => s;
@@ -70,7 +71,7 @@ const f = x.arrayToEnum([
70
71
  "never",
71
72
  "map",
72
73
  "set"
73
- ]), P = (r) => {
74
+ ]), z = (r) => {
74
75
  switch (typeof r) {
75
76
  case "undefined":
76
77
  return f.undefined;
@@ -252,7 +253,7 @@ const _e = (r) => {
252
253
  path: a,
253
254
  message: o
254
255
  };
255
- }, Qe = [];
256
+ }, Ke = [];
256
257
  function l(r, e) {
257
258
  const t = ye(), n = _e({
258
259
  issueData: e,
@@ -326,7 +327,7 @@ var h;
326
327
  (function(r) {
327
328
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
328
329
  })(h || (h = {}));
329
- var K, F;
330
+ var Q, F;
330
331
  class A {
331
332
  constructor(e, t, n, s) {
332
333
  this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
@@ -370,13 +371,13 @@ class v {
370
371
  return this._def.description;
371
372
  }
372
373
  _getType(e) {
373
- return P(e.data);
374
+ return z(e.data);
374
375
  }
375
376
  _getOrReturnCtx(e, t) {
376
377
  return t || {
377
378
  common: e.parent.common,
378
379
  data: e.data,
379
- parsedType: P(e.data),
380
+ parsedType: z(e.data),
380
381
  schemaErrorMap: this._def.errorMap,
381
382
  path: e.path,
382
383
  parent: e.parent
@@ -388,7 +389,7 @@ class v {
388
389
  ctx: {
389
390
  common: e.parent.common,
390
391
  data: e.data,
391
- parsedType: P(e.data),
392
+ parsedType: z(e.data),
392
393
  schemaErrorMap: this._def.errorMap,
393
394
  path: e.path,
394
395
  parent: e.parent
@@ -423,7 +424,7 @@ class v {
423
424
  schemaErrorMap: this._def.errorMap,
424
425
  parent: null,
425
426
  data: e,
426
- parsedType: P(e)
427
+ parsedType: z(e)
427
428
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
428
429
  return Re(s, a);
429
430
  }
@@ -444,7 +445,7 @@ class v {
444
445
  schemaErrorMap: this._def.errorMap,
445
446
  parent: null,
446
447
  data: e,
447
- parsedType: P(e)
448
+ parsedType: z(e)
448
449
  }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (te(s) ? s : Promise.resolve(s));
449
450
  return Re(n, a);
450
451
  }
@@ -484,7 +485,7 @@ class v {
484
485
  return I.create(this, this._def);
485
486
  }
486
487
  promise() {
487
- return Q.create(this, this._def);
488
+ return K.create(this, this._def);
488
489
  }
489
490
  or(e) {
490
491
  return ae.create([this, e], this._def);
@@ -545,18 +546,18 @@ class v {
545
546
  return this.safeParse(null).success;
546
547
  }
547
548
  }
548
- const Ke = /^c[^\s-]{8,}$/i, Fe = /^[0-9a-z]+$/, et = /^[0-9A-HJKMNP-TV-Z]{26}$/, tt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, rt = /^[a-z0-9_-]{21}$/i, nt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, st = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, at = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
549
+ const Qe = /^c[^\s-]{8,}$/i, Fe = /^[0-9a-z]+$/, et = /^[0-9A-HJKMNP-TV-Z]{26}$/, tt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, rt = /^[a-z0-9_-]{21}$/i, nt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, st = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, at = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
549
550
  let Ze;
550
551
  const it = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ot = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, dt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $e = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ct = new RegExp(`^${$e}$`);
551
- function ze(r) {
552
+ function Pe(r) {
552
553
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
553
554
  return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
554
555
  }
555
556
  function ut(r) {
556
- return new RegExp(`^${ze(r)}$`);
557
+ return new RegExp(`^${Pe(r)}$`);
557
558
  }
558
- function Pe(r) {
559
- let e = `${$e}T${ze(r)}`;
559
+ function ze(r) {
560
+ let e = `${$e}T${Pe(r)}`;
560
561
  const t = [];
561
562
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
562
563
  }
@@ -636,7 +637,7 @@ class E extends v {
636
637
  message: a.message
637
638
  }), n.dirty());
638
639
  else if (a.kind === "cuid")
639
- Ke.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
640
+ Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
640
641
  validation: "cuid",
641
642
  code: d.invalid_string,
642
643
  message: a.message
@@ -680,7 +681,7 @@ class E extends v {
680
681
  code: d.invalid_string,
681
682
  validation: { endsWith: a.value },
682
683
  message: a.message
683
- }), n.dirty()) : a.kind === "datetime" ? Pe(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
684
+ }), n.dirty()) : a.kind === "datetime" ? ze(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
684
685
  code: d.invalid_string,
685
686
  validation: "datetime",
686
687
  message: a.message
@@ -1397,7 +1398,7 @@ B.create = (r) => new B({
1397
1398
  typeName: m.ZodUnknown,
1398
1399
  ..._(r)
1399
1400
  });
1400
- class z extends v {
1401
+ class P extends v {
1401
1402
  _parse(e) {
1402
1403
  const t = this._getOrReturnCtx(e);
1403
1404
  return l(t, {
@@ -1407,7 +1408,7 @@ class z extends v {
1407
1408
  }), p;
1408
1409
  }
1409
1410
  }
1410
- z.create = (r) => new z({
1411
+ P.create = (r) => new P({
1411
1412
  typeName: m.ZodNever,
1412
1413
  ..._(r)
1413
1414
  });
@@ -1538,7 +1539,7 @@ class k extends v {
1538
1539
  }), p;
1539
1540
  }
1540
1541
  const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1541
- if (!(this._def.catchall instanceof z && this._def.unknownKeys === "strip"))
1542
+ if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
1542
1543
  for (const c in s.data)
1543
1544
  i.includes(c) || o.push(c);
1544
1545
  const u = [];
@@ -1550,7 +1551,7 @@ class k extends v {
1550
1551
  alwaysSet: c in s.data
1551
1552
  });
1552
1553
  }
1553
- if (this._def.catchall instanceof z) {
1554
+ if (this._def.catchall instanceof P) {
1554
1555
  const c = this._def.unknownKeys;
1555
1556
  if (c === "passthrough")
1556
1557
  for (const y of o)
@@ -1788,21 +1789,21 @@ class k extends v {
1788
1789
  k.create = (r, e) => new k({
1789
1790
  shape: () => r,
1790
1791
  unknownKeys: "strip",
1791
- catchall: z.create(),
1792
+ catchall: P.create(),
1792
1793
  typeName: m.ZodObject,
1793
1794
  ..._(e)
1794
1795
  });
1795
1796
  k.strictCreate = (r, e) => new k({
1796
1797
  shape: () => r,
1797
1798
  unknownKeys: "strict",
1798
- catchall: z.create(),
1799
+ catchall: P.create(),
1799
1800
  typeName: m.ZodObject,
1800
1801
  ..._(e)
1801
1802
  });
1802
1803
  k.lazycreate = (r, e) => new k({
1803
1804
  shape: r,
1804
1805
  unknownKeys: "strip",
1805
- catchall: z.create(),
1806
+ catchall: P.create(),
1806
1807
  typeName: m.ZodObject,
1807
1808
  ..._(e)
1808
1809
  });
@@ -1943,7 +1944,7 @@ class we extends v {
1943
1944
  }
1944
1945
  }
1945
1946
  function Oe(r, e) {
1946
- const t = P(r), n = P(e);
1947
+ const t = z(r), n = z(e);
1947
1948
  if (r === e)
1948
1949
  return { valid: !0, data: r };
1949
1950
  if (t === f.object && n === f.object) {
@@ -2255,7 +2256,7 @@ class H extends v {
2255
2256
  });
2256
2257
  }
2257
2258
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2258
- if (this._def.returns instanceof Q) {
2259
+ if (this._def.returns instanceof K) {
2259
2260
  const o = this;
2260
2261
  return S(async function(...u) {
2261
2262
  const c = new O([]), y = await o._def.args.parseAsync(u, a).catch((pe) => {
@@ -2355,7 +2356,7 @@ function Ve(r, e) {
2355
2356
  }
2356
2357
  class L extends v {
2357
2358
  constructor() {
2358
- super(...arguments), K.set(this, void 0);
2359
+ super(...arguments), Q.set(this, void 0);
2359
2360
  }
2360
2361
  _parse(e) {
2361
2362
  if (typeof e.data != "string") {
@@ -2366,7 +2367,7 @@ class L extends v {
2366
2367
  code: d.invalid_type
2367
2368
  }), p;
2368
2369
  }
2369
- if (ve(this, K) || Me(this, K, new Set(this._def.values)), !ve(this, K).has(e.data)) {
2370
+ if (ve(this, Q) || Me(this, Q, new Set(this._def.values)), !ve(this, Q).has(e.data)) {
2370
2371
  const t = this._getOrReturnCtx(e), n = this._def.values;
2371
2372
  return l(t, {
2372
2373
  received: t.data,
@@ -2410,7 +2411,7 @@ class L extends v {
2410
2411
  });
2411
2412
  }
2412
2413
  }
2413
- K = /* @__PURE__ */ new WeakMap();
2414
+ Q = /* @__PURE__ */ new WeakMap();
2414
2415
  L.create = Ve;
2415
2416
  class ue extends v {
2416
2417
  constructor() {
@@ -2446,7 +2447,7 @@ ue.create = (r, e) => new ue({
2446
2447
  typeName: m.ZodNativeEnum,
2447
2448
  ..._(e)
2448
2449
  });
2449
- class Q extends v {
2450
+ class K extends v {
2450
2451
  unwrap() {
2451
2452
  return this._def.type;
2452
2453
  }
@@ -2465,7 +2466,7 @@ class Q extends v {
2465
2466
  })));
2466
2467
  }
2467
2468
  }
2468
- Q.create = (r, e) => new Q({
2469
+ K.create = (r, e) => new K({
2469
2470
  type: r,
2470
2471
  typeName: m.ZodPromise,
2471
2472
  ..._(e)
@@ -2751,7 +2752,7 @@ var m;
2751
2752
  })(m || (m = {}));
2752
2753
  const pt = (r, e = {
2753
2754
  message: `Input not instance of ${r.name}`
2754
- }) => De((t) => t instanceof r, e), Le = E.create, Ue = V.create, yt = be.create, _t = D.create, Be = re.create, vt = q.create, gt = ge.create, xt = ne.create, kt = se.create, bt = X.create, wt = B.create, Tt = z.create, Zt = xe.create, St = I.create, Ct = k.create, Nt = k.strictCreate, Ot = ae.create, Et = we.create, It = ie.create, Rt = M.create, jt = oe.create, At = ke.create, Mt = W.create, $t = H.create, zt = de.create, Pt = ce.create, Vt = L.create, Dt = ue.create, Lt = Q.create, je = R.create, Ut = j.create, Bt = U.create, qt = R.createWithPreprocess, Wt = me.create, Yt = () => Le().optional(), Jt = () => Ue().optional(), Ht = () => Be().optional(), Gt = {
2755
+ }) => De((t) => t instanceof r, e), Le = E.create, Ue = V.create, yt = be.create, _t = D.create, Be = re.create, vt = q.create, gt = ge.create, xt = ne.create, kt = se.create, bt = X.create, wt = B.create, Tt = P.create, Zt = xe.create, St = I.create, Ct = k.create, Nt = k.strictCreate, Ot = ae.create, Et = we.create, It = ie.create, Rt = M.create, jt = oe.create, At = ke.create, Mt = W.create, $t = H.create, Pt = de.create, zt = ce.create, Vt = L.create, Dt = ue.create, Lt = K.create, je = R.create, Ut = j.create, Bt = U.create, qt = R.createWithPreprocess, Wt = me.create, Yt = () => Le().optional(), Jt = () => Ue().optional(), Ht = () => Be().optional(), Gt = {
2755
2756
  string: (r) => E.create({ ...r, coerce: !0 }),
2756
2757
  number: (r) => V.create({ ...r, coerce: !0 }),
2757
2758
  boolean: (r) => re.create({
@@ -2767,7 +2768,7 @@ var C = /* @__PURE__ */ Object.freeze({
2767
2768
  setErrorMap: Xe,
2768
2769
  getErrorMap: ye,
2769
2770
  makeIssue: _e,
2770
- EMPTY_PATH: Qe,
2771
+ EMPTY_PATH: Ke,
2771
2772
  addIssueToContext: l,
2772
2773
  ParseStatus: Z,
2773
2774
  INVALID: p,
@@ -2784,9 +2785,9 @@ var C = /* @__PURE__ */ Object.freeze({
2784
2785
  return Se;
2785
2786
  },
2786
2787
  ZodParsedType: f,
2787
- getParsedType: P,
2788
+ getParsedType: z,
2788
2789
  ZodType: v,
2789
- datetimeRegex: Pe,
2790
+ datetimeRegex: ze,
2790
2791
  ZodString: E,
2791
2792
  ZodNumber: V,
2792
2793
  ZodBigInt: D,
@@ -2797,7 +2798,7 @@ var C = /* @__PURE__ */ Object.freeze({
2797
2798
  ZodNull: se,
2798
2799
  ZodAny: X,
2799
2800
  ZodUnknown: B,
2800
- ZodNever: z,
2801
+ ZodNever: P,
2801
2802
  ZodVoid: xe,
2802
2803
  ZodArray: I,
2803
2804
  ZodObject: k,
@@ -2813,7 +2814,7 @@ var C = /* @__PURE__ */ Object.freeze({
2813
2814
  ZodLiteral: ce,
2814
2815
  ZodEnum: L,
2815
2816
  ZodNativeEnum: ue,
2816
- ZodPromise: Q,
2817
+ ZodPromise: K,
2817
2818
  ZodEffects: R,
2818
2819
  ZodTransformer: R,
2819
2820
  ZodOptional: j,
@@ -2844,8 +2845,8 @@ var C = /* @__PURE__ */ Object.freeze({
2844
2845
  function: $t,
2845
2846
  instanceof: pt,
2846
2847
  intersection: It,
2847
- lazy: zt,
2848
- literal: Pt,
2848
+ lazy: Pt,
2849
+ literal: zt,
2849
2850
  map: At,
2850
2851
  nan: yt,
2851
2852
  nativeEnum: Dt,
@@ -2908,7 +2909,9 @@ export {
2908
2909
  or as useAxios,
2909
2910
  hr as useClickOutside,
2910
2911
  ur as useConfirm,
2912
+ mr as useKeyPress,
2911
2913
  dr as useNotifications,
2914
+ yr as usePermissions,
2912
2915
  lr as usePrompt,
2913
2916
  rr as useZodSchemaTypes
2914
2917
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import MenuItemType from '@models/types/MenuItemType';
2
+ import { MenuItemTypeExtended } from '@models/index';
3
3
  type Props = {
4
- item: MenuItemType;
4
+ item: MenuItemTypeExtended;
5
5
  menuExpanded: boolean;
6
6
  collapsed: boolean;
7
7
  onCollapse: () => void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import MenuItemType from '@models/types/MenuItemType';
2
+ import { MenuItemType } from '@models/index';
3
3
  type Props = {
4
4
  headerItem: React.ReactNode;
5
5
  mainItems: MenuItemType[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-DVtkEr7E.cjs"),_=require("react"),E=require("./SimpleTooltip-B7uLYPYV.cjs"),b=require("./Typography-z6yGwy1k.cjs"),w="_side-menu-item_ra7qw_1",C="_nav-button_ra7qw_5",B="_child_ra7qw_13",M="_text_ra7qw_17",q="_icon_ra7qw_20",k="_collapse-icon_ra7qw_26",g="_collapsed_ra7qw_36",S="_expanded_ra7qw_43",f="_children-container_ra7qw_49",y="_visible_ra7qw_57",T="_children_ra7qw_49",i={"side-menu-item":"_side-menu-item_ra7qw_1",sideMenuItem:w,"nav-button":"_nav-button_ra7qw_5",navButton:C,child:B,text:M,icon:q,"collapse-icon":"_collapse-icon_ra7qw_26",collapseIcon:k,collapsed:g,expanded:S,"children-container":"_children-container_ra7qw_49",childrenContainer:f,visible:y,children:T},I=({item:e,menuExpanded:n,children:t})=>e.tooltip&&!n?s.jsxRuntimeExports.jsx(E.SimpleTooltip,{text:e.tooltip,placement:"right",children:t}):t,v=({item:e,menuExpanded:n,collapsed:t,onCollapse:o,currentPath:c})=>{var a,h;const{LinkComponent:d}=_.useContext(s.LuminusComponentsContext),[x,l]=_.useState(!1),[u]=c.split("?"),r=e.linkTo===u||((a=e.children)==null?void 0:a.some(m=>m.linkTo===u));return s.jsxRuntimeExports.jsxs("li",{className:s.classNames("luminus-side-menu-item",i.sideMenuItem,{[i.expanded]:n},{active:x||r},{open:t&&e.children}),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxRuntimeExports.jsx(I,{item:e,menuExpanded:n,children:e.children?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",i.navButton),onClick:()=>o(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",i.icon),children:e.icon}),n&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",i.text,"text-nowrap"),children:e.title}),n&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",i.collapseIcon,{[i.collapsed]:t}),children:s.jsxRuntimeExports.jsx(s.MdOutlineKeyboardArrowRight,{})})]})}):s.jsxRuntimeExports.jsxs(d,{to:e.linkTo??"/",className:s.classNames("nav-link",i.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",i.icon),children:e.icon}),n&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",i.text,"text-nowrap"),children:e.title})]})}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("children-container",i.childrenContainer,{[i.visible]:t}),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("shadow rounded children",i.children),children:(h=e.children)==null?void 0:h.map(m=>s.jsxRuntimeExports.jsx(d,{to:m.linkTo??"/",className:s.classNames("nav-link child rounded",i.navButton,i.child),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",i.text,"text-nowrap"),children:m.title})},m.linkTo))})})]})},$="_side-menu_n1hvm_1",L="_sidebar-header_n1hvm_13",H="_side-menu-content_n1hvm_18",F="_expand_n1hvm_22",A="_divider_n1hvm_26",p={"side-menu":"_side-menu_n1hvm_1",sideMenu:$,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:L,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:H,expand:F,divider:A},K=({headerItem:e,mainItems:n,secondaryItems:t,expanded:o,setExpanded:c,currentPath:d})=>{const[x,l]=_.useState(-1),u=r=>{l(r===x?-1:r)};return _.useEffect(()=>{o||l(-1)},[o]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu",p.sideMenu,{[p.expand]:o},{expand:o}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",p.sidebarHeader),children:e}),s.jsxRuntimeExports.jsxs("ul",{className:p.sideMenuContent,children:[n.map((r,a)=>s.jsxRuntimeExports.jsx(v,{item:r,menuExpanded:o,collapsed:a===x,onCollapse:()=>u(a),currentPath:d},r.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",p.divider)}),t.map((r,a)=>s.jsxRuntimeExports.jsx(v,{item:r,menuExpanded:o,collapsed:a===x,onCollapse:()=>u(a),currentPath:d},r.title))]})]})},P="_top-bar_1lk80_1",U="_top-bar-brand_1lk80_14",N={"top-bar":"_top-bar_1lk80_1",topBar:P,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:U},z=({appName:e,leftOffset:n,centerContent:t,rightContent:o})=>{const{LinkComponent:c}=_.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("luminus-top-bar",N.topBar),style:{width:n?`calc(100% - ${n}px)`:void 0,left:n?`${n}px`:void 0},children:[s.jsxRuntimeExports.jsx(c,{to:"/",className:s.classNames("luminus-top-bar-brand",N.topBarBrand),children:e}),t&&s.jsxRuntimeExports.jsx("div",{children:t}),s.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:o??null})]})},D="_side-content-bar_17kwd_1",G={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:D},j=({width:e,children:n})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar",G.sideContentBar),style:{width:`${e}px`},children:n}),R=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(b.Typography,{variant:"h3",children:e}):e}),J=({title:e,children:n,sideContent:t})=>s.jsxRuntimeExports.jsxs("div",{className:"container-fluid p-3",children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:t?"250px":void 0},children:[e?s.jsxRuntimeExports.jsx(R,{title:e}):null,n]}),t&&s.jsxRuntimeExports.jsx(j,{width:250,children:t})]}),O="_full-screen-container_1rm4r_1",Q={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:O},V=({title:e,children:n,sideContent:t})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container",Q.fullScreenContainer),style:{width:t?"calc(100% - 250px)":"100%"},children:[e?s.jsxRuntimeExports.jsx(R,{title:e}):null,n]}),t&&s.jsxRuntimeExports.jsx(j,{width:250,children:t})]});exports.FullScreenContainer=V;exports.MainContainer=J;exports.SideContentBar=j;exports.SideMenu=K;exports.TopBar=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-BHyn5qmy.cjs"),c=require("react"),w=require("./usePermissions-DvUaQzJ1.cjs"),C=require("./SimpleTooltip-DVdVP6Q7.cjs"),M=require("./Typography-Dy2nkkxH.cjs"),B="_side-menu-item_6vbwa_1",k="_disabled_6vbwa_5",g="_nav-button_6vbwa_9",S="_child_6vbwa_17",f="_text_6vbwa_21",y="_icon_6vbwa_28",P="_collapse-icon_6vbwa_34",T="_collapsed_6vbwa_44",I="_expanded_6vbwa_51",$="_children-container_6vbwa_57",H="_visible_6vbwa_65",L="_children_6vbwa_57",o={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:B,disabled:k,"nav-button":"_nav-button_6vbwa_9",navButton:g,child:S,text:f,icon:y,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:P,collapsed:T,expanded:I,"children-container":"_children-container_6vbwa_57",childrenContainer:$,visible:H,children:L},q=({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:r,currentPath:d})=>{var v,_;const{LinkComponent:m}=c.useContext(s.LuminusComponentsContext),[p,u]=c.useState(!1),[l]=d.split("?"),h=e.linkTo===l||((v=e.children)==null?void 0:v.some(n=>n.linkTo===l));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(q,{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:()=>r(),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(m,{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(m,{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))})})]})},F="_side-menu_n1hvm_1",A="_sidebar-header_n1hvm_13",U="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",z="_divider_n1hvm_26",j={"side-menu":"_side-menu_n1hvm_1",sideMenu:F,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:A,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:U,expand:K,divider:z},D=({headerItem:e,mainItems:t,secondaryItems:i,expanded:r,setExpanded:d,currentPath:m})=>{const[p,u]=c.useState(-1),{checkUserHasPermissions:l}=w.usePermissions(),h=c.useMemo(()=>t.map(n=>{var a;return{...n,notPermitted:!l(n.permissions??[]),children:(a=n.children)==null?void 0:a.map(x=>({...x,notPermitted:!l(x.permissions??[]),disabled:n.disabled||x.disabled}))}}),[t,l]),v=c.useMemo(()=>i.map(n=>{var a;return{...n,notPermitted:!l(n.permissions??[]),children:(a=n.children)==null?void 0:a.map(x=>({...x,notPermitted:!l(x.permissions??[])}))}}),[i,l]),_=n=>{u(n===p?-1:n)};return c.useEffect(()=>{r||u(-1)},[r]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu shadow",j.sideMenu,{[j.expand]:r},{expand:r}),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!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,a)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:r,collapsed:a===p,onCollapse:()=>_(a),currentPath:m},n.title)),s.jsxRuntimeExports.jsx("hr",{className:s.classNames("divider",j.divider)}),v.map((n,a)=>s.jsxRuntimeExports.jsx(N,{item:n,menuExpanded:r,collapsed:a===p,onCollapse:()=>_(a),currentPath:m},n.title))]})]})},G="_top-bar_1lk80_1",J="_top-bar-brand_1lk80_14",R={"top-bar":"_top-bar_1lk80_1",topBar:G,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:J},O=({appName:e,leftOffset:t,centerContent:i,rightContent:r})=>{const{LinkComponent:d}=c.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(d,{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:r??null})]})},Q="_side-content-bar_17kwd_1",V={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:Q},b=({width:e,children:t})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("luminus-side-content-bar",V.sideContentBar),style:{width:`${e}px`},children:t}),E=({title:e})=>s.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof e=="string"?s.jsxRuntimeExports.jsx(M.Typography,{variant:"h3",children:e}):e}),W=({title:e,children:t,sideContent:i})=>s.jsxRuntimeExports.jsxs("div",{className:"container-fluid p-3",children:[s.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?"250px":void 0},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:250,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})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container",Y.fullScreenContainer),style:{width:i?"calc(100% - 250px)":"100%"},children:[e?s.jsxRuntimeExports.jsx(E,{title:e}):null,t]}),i&&s.jsxRuntimeExports.jsx(b,{width:250,children:i})]});exports.FullScreenContainer=Z;exports.MainContainer=W;exports.SideContentBar=b;exports.SideMenu=D;exports.TopBar=O;
package/dist/layout.es.js CHANGED
@@ -1,108 +1,131 @@
1
- import { L as b, j as n, c as a, M } from "./UserAvatarToggle--4sSvh4e.js";
2
- import { useContext as w, useState as N, useEffect as f } from "react";
3
- import { S as k } from "./SimpleTooltip-qmn_7UT2.js";
4
- import { T as q } from "./Typography-CEiQhQ-u.js";
5
- const I = "_side-menu-item_ra7qw_1", g = "_nav-button_ra7qw_5", y = "_child_ra7qw_13", T = "_text_ra7qw_17", S = "_icon_ra7qw_20", $ = "_collapse-icon_ra7qw_26", L = "_collapsed_ra7qw_36", H = "_expanded_ra7qw_43", F = "_children-container_ra7qw_49", R = "_visible_ra7qw_57", A = "_children_ra7qw_49", i = {
6
- "side-menu-item": "_side-menu-item_ra7qw_1",
7
- sideMenuItem: I,
8
- "nav-button": "_nav-button_ra7qw_5",
9
- navButton: g,
10
- child: y,
11
- text: T,
12
- icon: S,
13
- "collapse-icon": "_collapse-icon_ra7qw_26",
14
- collapseIcon: $,
15
- collapsed: L,
16
- expanded: H,
17
- "children-container": "_children-container_ra7qw_49",
18
- childrenContainer: F,
19
- visible: R,
20
- children: A
21
- }, E = ({ item: e, menuExpanded: s, children: t }) => e.tooltip && !s ? /* @__PURE__ */ n.jsx(k, { text: e.tooltip, placement: "right", children: t }) : t, v = ({ item: e, menuExpanded: s, collapsed: t, onCollapse: o, currentPath: l }) => {
22
- var c, x;
23
- const { LinkComponent: _ } = w(b), [u, d] = N(!1), [h] = l.split("?"), r = e.linkTo === h || ((c = e.children) == null ? void 0 : c.some((m) => m.linkTo === h));
24
- return /* @__PURE__ */ n.jsxs("li", { className: a("luminus-side-menu-item", i.sideMenuItem, {
25
- [i.expanded]: s
26
- }, { active: u || r }, { open: t && e.children }), onMouseEnter: () => d(!0), onMouseLeave: () => d(!1), children: [
27
- /* @__PURE__ */ n.jsx(E, { item: e, menuExpanded: s, children: e.children ? /* @__PURE__ */ n.jsx(n.Fragment, { children: /* @__PURE__ */ n.jsxs("button", { type: "button", className: a("nav-link", i.navButton), onClick: () => o(), children: [
28
- /* @__PURE__ */ n.jsx("div", { className: a("icon", i.icon), children: e.icon }),
29
- s && /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: e.title }),
30
- s && /* @__PURE__ */ n.jsx("div", { className: a("collapse-icon", i.collapseIcon, {
31
- [i.collapsed]: t
32
- }), children: /* @__PURE__ */ n.jsx(M, {}) })
33
- ] }) }) : /* @__PURE__ */ n.jsxs(_, { to: e.linkTo ?? "/", className: a("nav-link", i.navButton), children: [
34
- /* @__PURE__ */ n.jsx("div", { className: a("icon", i.icon), children: e.icon }),
35
- s && /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: e.title })
1
+ import { L as C, j as e, c as i, M as I } from "./UserAvatarToggle-B3sPIYPV.js";
2
+ import { useContext as M, useState as B, useMemo as j, useEffect as P } from "react";
3
+ import { u as g } from "./usePermissions-Dh8dRtOL.js";
4
+ import { S as y } from "./SimpleTooltip-CrxvDOBl.js";
5
+ import { T } from "./Typography-e-xJ0W5h.js";
6
+ const S = "_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", U = "_children-container_6vbwa_57", q = "_visible_6vbwa_65", z = "_children_6vbwa_57", o = {
7
+ "side-menu-item": "_side-menu-item_6vbwa_1",
8
+ sideMenuItem: S,
9
+ disabled: $,
10
+ "nav-button": "_nav-button_6vbwa_9",
11
+ navButton: H,
12
+ child: L,
13
+ text: E,
14
+ icon: F,
15
+ "collapse-icon": "_collapse-icon_6vbwa_34",
16
+ collapseIcon: R,
17
+ collapsed: A,
18
+ expanded: K,
19
+ "children-container": "_children-container_6vbwa_57",
20
+ childrenContainer: U,
21
+ visible: q,
22
+ children: z
23
+ }, D = ({ item: n, menuExpanded: t, children: a }) => n.tooltip && !t ? /* @__PURE__ */ e.jsx(y, { text: n.tooltip, placement: "right", children: a }) : a, w = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: d, currentPath: c }) => {
24
+ var b, v;
25
+ const { LinkComponent: m } = M(C), [p, _] = B(!1), [l] = c.split("?"), x = n.linkTo === l || ((b = n.children) == null ? void 0 : b.some((s) => s.linkTo === l));
26
+ return /* @__PURE__ */ e.jsxs("li", { className: i("luminus-side-menu-item", o.sideMenuItem, {
27
+ [o.expanded]: t
28
+ }, { active: p || x }, { open: a && n.children }, { [o.disabled]: n.disabled || n.notPermitted }, { disabled: n.disabled || n.notPermitted }), onMouseEnter: () => _(!0), onMouseLeave: () => _(!1), children: [
29
+ /* @__PURE__ */ e.jsx(D, { item: n, menuExpanded: t, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", o.navButton), onClick: () => d(), children: [
30
+ /* @__PURE__ */ e.jsx("div", { className: i("icon", o.icon), children: n.icon }),
31
+ t && /* @__PURE__ */ e.jsx("div", { className: i("text", o.text, "text-nowrap"), children: n.title }),
32
+ t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", o.collapseIcon, {
33
+ [o.collapsed]: a
34
+ }), children: /* @__PURE__ */ e.jsx(I, {}) })
35
+ ] }) }) : /* @__PURE__ */ e.jsxs(m, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: i("nav-link", o.navButton), children: [
36
+ /* @__PURE__ */ e.jsx("div", { className: i("icon", o.icon), children: n.icon }),
37
+ t && /* @__PURE__ */ e.jsx("div", { className: i("text", o.text, "text-nowrap"), children: n.title })
36
38
  ] }) }),
37
- /* @__PURE__ */ n.jsx("div", { className: a("children-container", i.childrenContainer, {
38
- [i.visible]: t
39
- }), children: /* @__PURE__ */ n.jsx("div", { className: a("shadow rounded children", i.children), children: (x = e.children) == null ? void 0 : x.map((m) => /* @__PURE__ */ n.jsx(_, { to: m.linkTo ?? "/", className: a("nav-link child rounded", i.navButton, i.child), children: /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: m.title }) }, m.linkTo)) }) })
39
+ /* @__PURE__ */ e.jsx("div", { className: i("children-container", o.childrenContainer, {
40
+ [o.visible]: a
41
+ }), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", o.children), children: (v = n.children) == null ? void 0 : v.map((s) => /* @__PURE__ */ e.jsx(m, { to: s.disabled || s.notPermitted ? "/" : s.linkTo ?? "/", className: i("nav-link child rounded", o.navButton, o.child, { [o.disabled]: s.disabled || s.notPermitted }, { disabled: s.disabled || s.notPermitted }), children: /* @__PURE__ */ e.jsx("div", { className: i("text", o.text, "text-nowrap"), children: s.title }) }, s.linkTo)) }) })
40
42
  ] });
41
- }, K = "_side-menu_n1hvm_1", z = "_sidebar-header_n1hvm_13", D = "_side-menu-content_n1hvm_18", G = "_expand_n1hvm_22", J = "_divider_n1hvm_26", p = {
43
+ }, G = "_side-menu_n1hvm_1", J = "_sidebar-header_n1hvm_13", Q = "_side-menu-content_n1hvm_18", V = "_expand_n1hvm_22", W = "_divider_n1hvm_26", h = {
42
44
  "side-menu": "_side-menu_n1hvm_1",
43
- sideMenu: K,
45
+ sideMenu: G,
44
46
  "sidebar-header": "_sidebar-header_n1hvm_13",
45
- sidebarHeader: z,
47
+ sidebarHeader: J,
46
48
  "side-menu-content": "_side-menu-content_n1hvm_18",
47
- sideMenuContent: D,
48
- expand: G,
49
- divider: J
50
- }, en = ({ headerItem: e, mainItems: s, secondaryItems: t, expanded: o, setExpanded: l, currentPath: _ }) => {
51
- const [u, d] = N(-1), h = (r) => {
52
- d(r === u ? -1 : r);
49
+ sideMenuContent: Q,
50
+ expand: V,
51
+ divider: W
52
+ }, re = ({ headerItem: n, mainItems: t, secondaryItems: a, expanded: d, setExpanded: c, currentPath: m }) => {
53
+ const [p, _] = B(-1), { checkUserHasPermissions: l } = g(), x = j(() => t.map((s) => {
54
+ var r;
55
+ return {
56
+ ...s,
57
+ notPermitted: !l(s.permissions ?? []),
58
+ children: (r = s.children) == null ? void 0 : r.map((u) => ({
59
+ ...u,
60
+ notPermitted: !l(u.permissions ?? []),
61
+ disabled: s.disabled || u.disabled
62
+ }))
63
+ };
64
+ }), [t, l]), b = j(() => a.map((s) => {
65
+ var r;
66
+ return {
67
+ ...s,
68
+ notPermitted: !l(s.permissions ?? []),
69
+ children: (r = s.children) == null ? void 0 : r.map((u) => ({
70
+ ...u,
71
+ notPermitted: !l(u.permissions ?? [])
72
+ }))
73
+ };
74
+ }), [a, l]), v = (s) => {
75
+ _(s === p ? -1 : s);
53
76
  };
54
- return f(() => {
55
- o || d(-1);
56
- }, [o]), /* @__PURE__ */ n.jsxs("section", { className: a("luminus-side-menu", p.sideMenu, {
57
- [p.expand]: o
58
- }, { expand: o }), onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
59
- /* @__PURE__ */ n.jsx("div", { className: a("sidebar-header", p.sidebarHeader), children: e }),
60
- /* @__PURE__ */ n.jsxs("ul", { className: p.sideMenuContent, children: [
61
- s.map((r, c) => /* @__PURE__ */ n.jsx(v, { item: r, menuExpanded: o, collapsed: c === u, onCollapse: () => h(c), currentPath: _ }, r.title)),
62
- /* @__PURE__ */ n.jsx("hr", { className: a("divider", p.divider) }),
63
- t.map((r, c) => /* @__PURE__ */ n.jsx(v, { item: r, menuExpanded: o, collapsed: c === u, onCollapse: () => h(c), currentPath: _ }, r.title))
77
+ return P(() => {
78
+ d || _(-1);
79
+ }, [d]), /* @__PURE__ */ e.jsxs("section", { className: i("luminus-side-menu shadow", h.sideMenu, {
80
+ [h.expand]: d
81
+ }, { expand: d }), onMouseEnter: () => c(!0), onMouseLeave: () => c(!1), children: [
82
+ /* @__PURE__ */ e.jsx("div", { className: i("sidebar-header", h.sidebarHeader), children: n }),
83
+ /* @__PURE__ */ e.jsxs("ul", { className: h.sideMenuContent, children: [
84
+ x.map((s, r) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: d, collapsed: r === p, onCollapse: () => v(r), currentPath: m }, s.title)),
85
+ /* @__PURE__ */ e.jsx("hr", { className: i("divider", h.divider) }),
86
+ b.map((s, r) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: d, collapsed: r === p, onCollapse: () => v(r), currentPath: m }, s.title))
64
87
  ] })
65
88
  ] });
66
- }, P = "_top-bar_1lk80_1", Q = "_top-bar-brand_1lk80_14", j = {
89
+ }, X = "_top-bar_1lk80_1", Y = "_top-bar-brand_1lk80_14", N = {
67
90
  "top-bar": "_top-bar_1lk80_1",
68
- topBar: P,
91
+ topBar: X,
69
92
  "top-bar-brand": "_top-bar-brand_1lk80_14",
70
- topBarBrand: Q
71
- }, sn = ({ appName: e, leftOffset: s, centerContent: t, rightContent: o }) => {
72
- const { LinkComponent: l } = w(b);
73
- return /* @__PURE__ */ n.jsxs("nav", { className: a("luminus-top-bar", j.topBar), style: {
74
- width: s ? `calc(100% - ${s}px)` : void 0,
75
- left: s ? `${s}px` : void 0
93
+ topBarBrand: Y
94
+ }, de = ({ appName: n, leftOffset: t, centerContent: a, rightContent: d }) => {
95
+ const { LinkComponent: c } = M(C);
96
+ return /* @__PURE__ */ e.jsxs("nav", { className: i("luminus-top-bar shadow", N.topBar), style: {
97
+ width: t ? `calc(100% - ${t}px)` : void 0,
98
+ left: t ? `${t}px` : void 0
76
99
  }, children: [
77
- /* @__PURE__ */ n.jsx(l, { to: "/", className: a("luminus-top-bar-brand", j.topBarBrand), children: e }),
78
- t && /* @__PURE__ */ n.jsx("div", { children: t }),
79
- /* @__PURE__ */ n.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: o ?? null })
100
+ /* @__PURE__ */ e.jsx(c, { to: "/", className: i("luminus-top-bar-brand", N.topBarBrand), children: n }),
101
+ a && /* @__PURE__ */ e.jsx("div", { children: a }),
102
+ /* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: d ?? null })
80
103
  ] });
81
- }, U = "_side-content-bar_17kwd_1", V = {
104
+ }, Z = "_side-content-bar_17kwd_1", O = {
82
105
  "side-content-bar": "_side-content-bar_17kwd_1",
83
- sideContentBar: U
84
- }, C = ({ width: e, children: s }) => /* @__PURE__ */ n.jsx("section", { className: a("luminus-side-content-bar", V.sideContentBar), style: {
85
- width: `${e}px`
86
- }, children: s }), B = ({ title: e }) => /* @__PURE__ */ n.jsx("div", { className: "mb-3", children: typeof e == "string" ? /* @__PURE__ */ n.jsx(q, { variant: "h3", children: e }) : e }), tn = ({ title: e, children: s, sideContent: t }) => /* @__PURE__ */ n.jsxs("div", { className: "container-fluid p-3", children: [
87
- /* @__PURE__ */ n.jsxs("div", { style: { paddingRight: t ? "250px" : void 0 }, children: [
88
- e ? /* @__PURE__ */ n.jsx(B, { title: e }) : null,
89
- s
106
+ sideContentBar: Z
107
+ }, f = ({ width: n, children: t }) => /* @__PURE__ */ e.jsx("section", { className: i("luminus-side-content-bar", O.sideContentBar), style: {
108
+ width: `${n}px`
109
+ }, children: t }), k = ({ title: n }) => /* @__PURE__ */ e.jsx("div", { className: "mb-3", children: typeof n == "string" ? /* @__PURE__ */ e.jsx(T, { variant: "h3", children: n }) : n }), le = ({ title: n, children: t, sideContent: a }) => /* @__PURE__ */ e.jsxs("div", { className: "container-fluid p-3", children: [
110
+ /* @__PURE__ */ e.jsxs("div", { style: { paddingRight: a ? "250px" : void 0 }, children: [
111
+ n ? /* @__PURE__ */ e.jsx(k, { title: n }) : null,
112
+ t
90
113
  ] }),
91
- t && /* @__PURE__ */ n.jsx(C, { width: 250, children: t })
92
- ] }), W = "_full-screen-container_1rm4r_1", X = {
114
+ a && /* @__PURE__ */ e.jsx(f, { width: 250, children: a })
115
+ ] }), ee = "_full-screen-container_1rm4r_1", ne = {
93
116
  "full-screen-container": "_full-screen-container_1rm4r_1",
94
- fullScreenContainer: W
95
- }, an = ({ title: e, children: s, sideContent: t }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
96
- /* @__PURE__ */ n.jsxs("div", { className: a("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container", X.fullScreenContainer), style: { width: t ? "calc(100% - 250px)" : "100%" }, children: [
97
- e ? /* @__PURE__ */ n.jsx(B, { title: e }) : null,
98
- s
117
+ fullScreenContainer: ee
118
+ }, ce = ({ title: n, children: t, sideContent: a }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
119
+ /* @__PURE__ */ e.jsxs("div", { className: i("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container", ne.fullScreenContainer), style: { width: a ? "calc(100% - 250px)" : "100%" }, children: [
120
+ n ? /* @__PURE__ */ e.jsx(k, { title: n }) : null,
121
+ t
99
122
  ] }),
100
- t && /* @__PURE__ */ n.jsx(C, { width: 250, children: t })
123
+ a && /* @__PURE__ */ e.jsx(f, { width: 250, children: a })
101
124
  ] });
102
125
  export {
103
- an as FullScreenContainer,
104
- tn as MainContainer,
105
- C as SideContentBar,
106
- en as SideMenu,
107
- sn as TopBar
126
+ ce as FullScreenContainer,
127
+ le as MainContainer,
128
+ f as SideContentBar,
129
+ re as SideMenu,
130
+ de as TopBar
108
131
  };