react-luminus-components 1.3.15 → 1.3.18
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/README.md +355 -355
- package/dist/.vite/manifest.json +52 -52
- package/dist/{PrimaryButton-B9eaaCaE.js → PrimaryButton-DslNAB-3.js} +1 -1
- package/dist/{PrimaryButton-CsedWqh2.cjs → PrimaryButton-I6y4OCxs.cjs} +1 -1
- package/dist/SimpleTooltip-B5VccvE5.cjs +1 -0
- package/dist/SimpleTooltip-D98Qd8ok.js +5 -0
- package/dist/{NoInputContainer-D_uCtgcq.cjs → UserAvatarToggle-BkBi1Auu.cjs} +1 -1
- package/dist/{NoInputContainer-DPjgKLR8.js → UserAvatarToggle-D2Jm1R51.js} +61 -60
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +45 -45
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +45 -45
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +13 -13
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1265 -1265
- package/dist/style.css +1 -1
- package/dist/{useConfirm-Dv-I8Odc.js → useConfirm-BhEDUE32.js} +1 -1
- package/dist/useConfirm-C8_Cwa9N.cjs +1 -0
- package/dist/{useFormControlType-BAFqxupC.js → useFormControlType-oJGqgThz.js} +3 -3
- package/dist/{usePermissions-C6VQVWtc.js → usePermissions-BgwZ65fl.js} +1 -1
- package/dist/usePermissions-DQP6LdI3.cjs +1 -0
- package/package.json +105 -105
- package/dist/SimpleTooltip-Dkn3uxZY.js +0 -5
- package/dist/SimpleTooltip-cWWpVW4n.cjs +0 -1
- package/dist/useConfirm-DHh1dicX.cjs +0 -1
- package/dist/usePermissions-CBFsynG2.cjs +0 -1
package/dist/hooks.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Q as Xe,
|
|
2
|
-
import { aH as yr,
|
|
3
|
-
import { a as xr, u as
|
|
1
|
+
import { Q as Xe, ab as Me, ap as Ke } from "./UserAvatarToggle-D2Jm1R51.js";
|
|
2
|
+
import { aH as yr, af as _r, aG as vr } from "./UserAvatarToggle-D2Jm1R51.js";
|
|
3
|
+
import { a as xr, u as br } from "./useConfirm-BhEDUE32.js";
|
|
4
4
|
import { useContext as ze, useRef as Fe, useState as Pe, useCallback as et, useEffect as De } from "react";
|
|
5
5
|
import { f as tt } from "./latinize-BQrinury.js";
|
|
6
6
|
import { i as rt } from "./dateUtils-7nL2BXlo.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
|
-
import {
|
|
9
|
-
import { u as Sr } from "./usePermissions-
|
|
8
|
+
import { b as wr, u as Tr, a as Zr } from "./useFormControlType-oJGqgThz.js";
|
|
9
|
+
import { u as Sr } from "./usePermissions-BgwZ65fl.js";
|
|
10
10
|
var x;
|
|
11
11
|
(function(r) {
|
|
12
12
|
r.assertEqual = (s) => s;
|
|
@@ -314,7 +314,7 @@ class Z {
|
|
|
314
314
|
const y = Object.freeze({
|
|
315
315
|
status: "aborted"
|
|
316
316
|
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ne = (r) => r.status === "aborted", Ee = (r) => r.status === "dirty", se = (r) => r.status === "valid", ae = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
317
|
-
function
|
|
317
|
+
function be(r, e, t, n) {
|
|
318
318
|
if (typeof e == "function" ? r !== e || !n : !e.has(r))
|
|
319
319
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
320
320
|
return e.get(r);
|
|
@@ -1324,7 +1324,7 @@ Y.create = (r) => new Y({
|
|
|
1324
1324
|
typeName: p.ZodDate,
|
|
1325
1325
|
...v(r)
|
|
1326
1326
|
});
|
|
1327
|
-
class
|
|
1327
|
+
class ke extends g {
|
|
1328
1328
|
_parse(e) {
|
|
1329
1329
|
if (this._getType(e) !== f.symbol) {
|
|
1330
1330
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1337,7 +1337,7 @@ class be extends g {
|
|
|
1337
1337
|
return S(e.data);
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
|
|
1340
|
+
ke.create = (r) => new ke({
|
|
1341
1341
|
typeName: p.ZodSymbol,
|
|
1342
1342
|
...v(r)
|
|
1343
1343
|
});
|
|
@@ -1504,13 +1504,13 @@ R.create = (r, e) => new R({
|
|
|
1504
1504
|
...v(e)
|
|
1505
1505
|
});
|
|
1506
1506
|
function H(r) {
|
|
1507
|
-
if (r instanceof
|
|
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(H(n));
|
|
1512
1512
|
}
|
|
1513
|
-
return new
|
|
1513
|
+
return new k({
|
|
1514
1514
|
...r._def,
|
|
1515
1515
|
shape: () => e
|
|
1516
1516
|
});
|
|
@@ -1520,7 +1520,7 @@ function H(r) {
|
|
|
1520
1520
|
type: H(r.element)
|
|
1521
1521
|
}) : r instanceof j ? j.create(H(r.unwrap())) : r instanceof U ? U.create(H(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => H(e))) : r;
|
|
1522
1522
|
}
|
|
1523
|
-
class
|
|
1523
|
+
class k extends g {
|
|
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 g {
|
|
|
1598
1598
|
return this._def.shape();
|
|
1599
1599
|
}
|
|
1600
1600
|
strict(e) {
|
|
1601
|
-
return h.errToObj, new
|
|
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 g {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
}
|
|
1617
1617
|
strip() {
|
|
1618
|
-
return new
|
|
1618
|
+
return new k({
|
|
1619
1619
|
...this._def,
|
|
1620
1620
|
unknownKeys: "strip"
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
passthrough() {
|
|
1624
|
-
return new
|
|
1624
|
+
return new k({
|
|
1625
1625
|
...this._def,
|
|
1626
1626
|
unknownKeys: "passthrough"
|
|
1627
1627
|
});
|
|
@@ -1644,7 +1644,7 @@ class b extends g {
|
|
|
1644
1644
|
// }) as any;
|
|
1645
1645
|
// };
|
|
1646
1646
|
extend(e) {
|
|
1647
|
-
return new
|
|
1647
|
+
return new k({
|
|
1648
1648
|
...this._def,
|
|
1649
1649
|
shape: () => ({
|
|
1650
1650
|
...this._def.shape(),
|
|
@@ -1658,7 +1658,7 @@ class b extends g {
|
|
|
1658
1658
|
* upgrade if you are experiencing issues.
|
|
1659
1659
|
*/
|
|
1660
1660
|
merge(e) {
|
|
1661
|
-
return new
|
|
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 g {
|
|
|
1728
1728
|
// return merged;
|
|
1729
1729
|
// }
|
|
1730
1730
|
catchall(e) {
|
|
1731
|
-
return new
|
|
1731
|
+
return new k({
|
|
1732
1732
|
...this._def,
|
|
1733
1733
|
catchall: e
|
|
1734
1734
|
});
|
|
@@ -1737,7 +1737,7 @@ class b extends g {
|
|
|
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
|
|
1740
|
+
}), new k({
|
|
1741
1741
|
...this._def,
|
|
1742
1742
|
shape: () => t
|
|
1743
1743
|
});
|
|
@@ -1746,7 +1746,7 @@ class b extends g {
|
|
|
1746
1746
|
const t = {};
|
|
1747
1747
|
return x.objectKeys(this.shape).forEach((n) => {
|
|
1748
1748
|
e[n] || (t[n] = this.shape[n]);
|
|
1749
|
-
}), new
|
|
1749
|
+
}), new k({
|
|
1750
1750
|
...this._def,
|
|
1751
1751
|
shape: () => t
|
|
1752
1752
|
});
|
|
@@ -1762,7 +1762,7 @@ class b extends g {
|
|
|
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
|
|
1765
|
+
}), new k({
|
|
1766
1766
|
...this._def,
|
|
1767
1767
|
shape: () => t
|
|
1768
1768
|
});
|
|
@@ -1778,7 +1778,7 @@ class b extends g {
|
|
|
1778
1778
|
a = a._def.innerType;
|
|
1779
1779
|
t[n] = a;
|
|
1780
1780
|
}
|
|
1781
|
-
}), new
|
|
1781
|
+
}), new k({
|
|
1782
1782
|
...this._def,
|
|
1783
1783
|
shape: () => t
|
|
1784
1784
|
});
|
|
@@ -1787,21 +1787,21 @@ class b extends g {
|
|
|
1787
1787
|
return We(x.objectKeys(this.shape));
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
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
|
...v(e)
|
|
1796
1796
|
});
|
|
1797
|
-
|
|
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
|
...v(e)
|
|
1803
1803
|
});
|
|
1804
|
-
|
|
1804
|
+
k.lazycreate = (r, e) => new k({
|
|
1805
1805
|
shape: r,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
1807
|
catchall: z.create(),
|
|
@@ -2368,7 +2368,7 @@ class q extends g {
|
|
|
2368
2368
|
code: d.invalid_type
|
|
2369
2369
|
}), y;
|
|
2370
2370
|
}
|
|
2371
|
-
if (
|
|
2371
|
+
if (be(this, re) || Le(this, re, new Set(this._def.values)), !be(this, re).has(e.data)) {
|
|
2372
2372
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2373
2373
|
return l(t, {
|
|
2374
2374
|
received: t.data,
|
|
@@ -2428,7 +2428,7 @@ class me extends g {
|
|
|
2428
2428
|
code: d.invalid_type
|
|
2429
2429
|
}), y;
|
|
2430
2430
|
}
|
|
2431
|
-
if (
|
|
2431
|
+
if (be(this, ne) || Le(this, ne, new Set(x.getValidEnumValues(this._def.values))), !be(this, ne).has(e.data)) {
|
|
2432
2432
|
const s = x.objectValues(t);
|
|
2433
2433
|
return l(n, {
|
|
2434
2434
|
received: n.data,
|
|
@@ -2667,7 +2667,7 @@ Ze.create = (r) => new Ze({
|
|
|
2667
2667
|
typeName: p.ZodNaN,
|
|
2668
2668
|
...v(r)
|
|
2669
2669
|
});
|
|
2670
|
-
const
|
|
2670
|
+
const bt = Symbol("zod_brand");
|
|
2671
2671
|
class Ie extends g {
|
|
2672
2672
|
_parse(e) {
|
|
2673
2673
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
@@ -2744,8 +2744,8 @@ function Ye(r, e = {}, t) {
|
|
|
2744
2744
|
}
|
|
2745
2745
|
}) : K.create();
|
|
2746
2746
|
}
|
|
2747
|
-
const
|
|
2748
|
-
object:
|
|
2747
|
+
const kt = {
|
|
2748
|
+
object: k.lazycreate
|
|
2749
2749
|
};
|
|
2750
2750
|
var p;
|
|
2751
2751
|
(function(r) {
|
|
@@ -2753,7 +2753,7 @@ var p;
|
|
|
2753
2753
|
})(p || (p = {}));
|
|
2754
2754
|
const wt = (r, e = {
|
|
2755
2755
|
message: `Input not instance of ${r.name}`
|
|
2756
|
-
}) => Ye((t) => t instanceof r, e), Ge = E.create, He = V.create, Tt = Ze.create, Zt = L.create, Je = ie.create, Ct = Y.create, St =
|
|
2756
|
+
}) => Ye((t) => t instanceof r, e), Ge = E.create, He = V.create, Tt = Ze.create, Zt = L.create, Je = ie.create, Ct = Y.create, St = ke.create, Ot = oe.create, Nt = de.create, Et = K.create, Rt = W.create, It = z.create, jt = we.create, At = R.create, $t = k.create, Mt = k.strictCreate, zt = ce.create, Pt = Ce.create, Dt = ue.create, Vt = $.create, Lt = le.create, qt = Te.create, Ut = G.create, Bt = Q.create, Wt = fe.create, Yt = he.create, Gt = q.create, Ht = me.create, Jt = F.create, $e = I.create, Qt = j.create, Xt = U.create, Kt = I.createWithPreprocess, Ft = ve.create, er = () => Ge().optional(), tr = () => He().optional(), rr = () => Je().optional(), nr = {
|
|
2757
2757
|
string: (r) => E.create({ ...r, coerce: !0 }),
|
|
2758
2758
|
number: (r) => V.create({ ...r, coerce: !0 }),
|
|
2759
2759
|
boolean: (r) => ie.create({
|
|
@@ -2794,7 +2794,7 @@ var O = /* @__PURE__ */ Object.freeze({
|
|
|
2794
2794
|
ZodBigInt: L,
|
|
2795
2795
|
ZodBoolean: ie,
|
|
2796
2796
|
ZodDate: Y,
|
|
2797
|
-
ZodSymbol:
|
|
2797
|
+
ZodSymbol: ke,
|
|
2798
2798
|
ZodUndefined: oe,
|
|
2799
2799
|
ZodNull: de,
|
|
2800
2800
|
ZodAny: K,
|
|
@@ -2802,7 +2802,7 @@ var O = /* @__PURE__ */ Object.freeze({
|
|
|
2802
2802
|
ZodNever: z,
|
|
2803
2803
|
ZodVoid: we,
|
|
2804
2804
|
ZodArray: R,
|
|
2805
|
-
ZodObject:
|
|
2805
|
+
ZodObject: k,
|
|
2806
2806
|
ZodUnion: ce,
|
|
2807
2807
|
ZodDiscriminatedUnion: Ce,
|
|
2808
2808
|
ZodIntersection: ue,
|
|
@@ -2823,14 +2823,14 @@ var O = /* @__PURE__ */ Object.freeze({
|
|
|
2823
2823
|
ZodDefault: pe,
|
|
2824
2824
|
ZodCatch: ye,
|
|
2825
2825
|
ZodNaN: Ze,
|
|
2826
|
-
BRAND:
|
|
2826
|
+
BRAND: bt,
|
|
2827
2827
|
ZodBranded: Ie,
|
|
2828
2828
|
ZodPipeline: ve,
|
|
2829
2829
|
ZodReadonly: _e,
|
|
2830
2830
|
custom: Ye,
|
|
2831
2831
|
Schema: g,
|
|
2832
2832
|
ZodSchema: g,
|
|
2833
|
-
late:
|
|
2833
|
+
late: kt,
|
|
2834
2834
|
get ZodFirstPartyTypeKind() {
|
|
2835
2835
|
return p;
|
|
2836
2836
|
},
|
|
@@ -2883,19 +2883,19 @@ const lr = () => {
|
|
|
2883
2883
|
const { formValidationTexts: r } = ze(Xe), e = (_) => (_ != null && _.useCoerce ? O.coerce : O).string({
|
|
2884
2884
|
invalid_type_error: r.required,
|
|
2885
2885
|
required_error: r.required
|
|
2886
|
-
}).transform((w) => w ?? null), t = (_) => e(_).nullable().optional().transform((
|
|
2887
|
-
const
|
|
2886
|
+
}).transform((w) => w ?? null), t = (_) => e(_).nullable().optional().transform((b) => b ?? null), n = (_) => {
|
|
2887
|
+
const b = (_ != null && _.useCoerce ? O.coerce : O).number({
|
|
2888
2888
|
invalid_type_error: r.required,
|
|
2889
2889
|
required_error: r.required
|
|
2890
2890
|
});
|
|
2891
|
-
return (_ == null ? void 0 : _.min) !== void 0 &&
|
|
2892
|
-
}, s = (_) => n(_).nullable().optional().transform((
|
|
2891
|
+
return (_ == null ? void 0 : _.min) !== void 0 && b.min(_.min), (_ == null ? void 0 : _.max) !== void 0 && b.max(_.max), b.transform((w) => w ?? null);
|
|
2892
|
+
}, s = (_) => n(_).nullable().optional().transform((b) => b ?? null), a = (_) => (_ != null && _.useCoerce ? O.coerce : O).boolean({
|
|
2893
2893
|
invalid_type_error: r.required,
|
|
2894
2894
|
required_error: r.required
|
|
2895
|
-
}).transform((
|
|
2895
|
+
}).transform((b) => b ?? null), i = (_) => (_ != null && _.useCoerce ? O.coerce : O).string({
|
|
2896
2896
|
invalid_type_error: r.required,
|
|
2897
2897
|
required_error: r.required
|
|
2898
|
-
}).refine(rt, { message: r.invalidDate }).transform((w) => w ?? null), o = (_) => i(_).nullable().transform((
|
|
2898
|
+
}).refine(rt, { message: r.invalidDate }).transform((w) => w ?? null), o = (_) => i(_).nullable().transform((b) => b ?? null), u = (_, b) => O.enum(_, {
|
|
2899
2899
|
invalid_type_error: r.required,
|
|
2900
2900
|
required_error: r.required
|
|
2901
2901
|
}).transform((je) => je ?? null);
|
|
@@ -2907,13 +2907,13 @@ const lr = () => {
|
|
|
2907
2907
|
zBool: a,
|
|
2908
2908
|
zDate: o,
|
|
2909
2909
|
zDateRequired: i,
|
|
2910
|
-
zEnum: (_,
|
|
2910
|
+
zEnum: (_, b) => u(_).nullable().transform((w) => w ?? null),
|
|
2911
2911
|
zEnumRequired: u,
|
|
2912
2912
|
zObjectIdInt: (_) => O.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2913
2913
|
zObjectIdIntRequired: (_) => O.object({ id: n() }).transform((w) => w ?? null),
|
|
2914
2914
|
zObjectIdStr: (_) => O.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2915
2915
|
zObjectIdStrRequired: (_) => O.object({ id: e() }).transform((w) => w ?? null),
|
|
2916
|
-
zFile: ({ required: _, multiple:
|
|
2916
|
+
zFile: ({ required: _, multiple: b, maxFileSize: w }) => O.any().transform((T) => Array.from(T ?? [])).refine((T) => !_ || (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((Qe) => Qe.size <= w), `Maximum file size is ${tt(w)}.`).transform((T) => (b ? T : T == null ? void 0 : T[0]) ?? null)
|
|
2917
2917
|
};
|
|
2918
2918
|
}, te = {
|
|
2919
2919
|
loadOnInit: !0,
|
|
@@ -2925,10 +2925,10 @@ const lr = () => {
|
|
|
2925
2925
|
if (t !== !1) {
|
|
2926
2926
|
!n && u(`loadData-${r}-${_}`), s && B(null);
|
|
2927
2927
|
try {
|
|
2928
|
-
const
|
|
2928
|
+
const b = await o.get(r, {
|
|
2929
2929
|
signal: ee
|
|
2930
2930
|
});
|
|
2931
|
-
B(
|
|
2931
|
+
B(b.data);
|
|
2932
2932
|
} finally {
|
|
2933
2933
|
!n && c(`loadData-${r}-${_}`);
|
|
2934
2934
|
}
|
|
@@ -2983,6 +2983,6 @@ export {
|
|
|
2983
2983
|
Zr as useKeyPress,
|
|
2984
2984
|
vr as useNotifications,
|
|
2985
2985
|
Sr as usePermissions,
|
|
2986
|
-
|
|
2986
|
+
br as usePrompt,
|
|
2987
2987
|
lr as useZodSchemaTypes
|
|
2988
2988
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./UserAvatarToggle-BkBi1Auu.cjs"),u=require("react");require("react-hook-form");require("./latinize-DaqzUOla.cjs");const w=require("./usePermissions-DQP6LdI3.cjs"),C=require("./SimpleTooltip-B5VccvE5.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",q="_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:q},H=({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(H,{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))})})]})},L="_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:L,"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,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,9 +1,9 @@
|
|
|
1
|
-
import { Q as B, j as e, c as o, X as I,
|
|
1
|
+
import { Q as B, j as e, c as o, X as I, _ as P } from "./UserAvatarToggle-D2Jm1R51.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
4
|
import "./latinize-BQrinury.js";
|
|
5
|
-
import { u as y } from "./usePermissions-
|
|
6
|
-
import { S } from "./SimpleTooltip-
|
|
5
|
+
import { u as y } from "./usePermissions-BgwZ65fl.js";
|
|
6
|
+
import { S } from "./SimpleTooltip-D98Qd8ok.js";
|
|
7
7
|
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 = {
|
|
8
8
|
"side-menu-item": "_side-menu-item_6vbwa_1",
|
|
9
9
|
sideMenuItem: T,
|
|
@@ -21,13 +21,13 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
21
21
|
childrenContainer: Q,
|
|
22
22
|
visible: U,
|
|
23
23
|
children: X
|
|
24
|
-
},
|
|
24
|
+
}, 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 }) => {
|
|
25
25
|
var b, v;
|
|
26
26
|
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 === _));
|
|
27
27
|
return /* @__PURE__ */ e.jsxs("li", { className: o("luminus-side-menu-item", i.sideMenuItem, {
|
|
28
28
|
[i.expanded]: t
|
|
29
29
|
}, { 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: [
|
|
30
|
-
/* @__PURE__ */ e.jsx(
|
|
30
|
+
/* @__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: [
|
|
31
31
|
/* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
|
|
32
32
|
t && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title }),
|
|
33
33
|
t && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", i.collapseIcon, {
|
|
@@ -41,15 +41,15 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
41
41
|
[i.visible]: a
|
|
42
42
|
}), 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)) }) })
|
|
43
43
|
] });
|
|
44
|
-
},
|
|
44
|
+
}, 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 = {
|
|
45
45
|
"side-menu": "_side-menu_n1hvm_1",
|
|
46
|
-
sideMenu:
|
|
46
|
+
sideMenu: z,
|
|
47
47
|
"sidebar-header": "_sidebar-header_n1hvm_13",
|
|
48
|
-
sidebarHeader:
|
|
48
|
+
sidebarHeader: D,
|
|
49
49
|
"side-menu-content": "_side-menu-content_n1hvm_18",
|
|
50
|
-
sideMenuContent:
|
|
51
|
-
expand:
|
|
52
|
-
divider:
|
|
50
|
+
sideMenuContent: G,
|
|
51
|
+
expand: J,
|
|
52
|
+
divider: V
|
|
53
53
|
}, le = ({ headerItem: n, mainItems: t, secondaryItems: a, expanded: r, setExpanded: d, currentPath: c }) => {
|
|
54
54
|
const [p, u] = M(-1), { checkUserHasPermissions: _ } = y(), x = j(() => t.map((s) => {
|
|
55
55
|
var l;
|
|
@@ -87,9 +87,9 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
87
87
|
b.map((s, l) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: r, collapsed: l === p, onCollapse: () => v(l), currentPath: c }, s.title))
|
|
88
88
|
] })
|
|
89
89
|
] });
|
|
90
|
-
},
|
|
90
|
+
}, Y = "_top-bar_1lk80_1", Z = "_top-bar-brand_1lk80_14", N = {
|
|
91
91
|
"top-bar": "_top-bar_1lk80_1",
|
|
92
|
-
topBar:
|
|
92
|
+
topBar: Y,
|
|
93
93
|
"top-bar-brand": "_top-bar-brand_1lk80_14",
|
|
94
94
|
topBarBrand: Z
|
|
95
95
|
}, de = ({ appName: n, leftOffset: t, centerContent: a, rightContent: r }) => {
|