react-luminus-components 1.2.36 → 1.2.37
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 +46 -46
- package/dist/{EventType-SEEDuisM.js → EventType--bYeqoGO.js} +1 -1
- package/dist/{EventType-Dodj1wMo.cjs → EventType-DXVXbODv.cjs} +1 -1
- package/dist/{UserAvatarToggle-rzyVxLmG.cjs → NoInputContainer-BkFSaMQy.cjs} +1 -1
- package/dist/{UserAvatarToggle-CH7OqxNp.js → NoInputContainer-LdJeEMWI.js} +57 -58
- package/dist/SimpleTooltip-C_iRq-Q0.cjs +1 -0
- package/dist/SimpleTooltip-mxX4RNUy.js +5 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +28 -28
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +6 -6
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +63 -63
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +15 -15
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +729 -729
- package/dist/style.css +1 -1
- package/dist/useConfirm-BK_yKNWQ.cjs +1 -0
- package/dist/{useConfirm-B3BI8PzR.js → useConfirm-ee4Czv-n.js} +1 -1
- package/dist/{usePermissions-DVO-znuB.js → usePermissions-CHfDy8Yx.js} +1 -1
- package/dist/usePermissions-yA39pMjm.cjs +1 -0
- package/package.json +100 -100
- package/dist/SimpleTooltip-MhGCEWts.js +0 -5
- package/dist/SimpleTooltip-OE_cbcNU.cjs +0 -1
- package/dist/useConfirm-9zGqmWEb.cjs +0 -1
- package/dist/usePermissions-CO93mmCn.cjs +0 -1
package/dist/hooks.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { N as We } from "./
|
|
2
|
-
import { aF as ir,
|
|
3
|
-
import { a as lr, u as fr } from "./useConfirm-
|
|
1
|
+
import { N as We } from "./NoInputContainer-LdJeEMWI.js";
|
|
2
|
+
import { aF as ir, a9 as or, a5 as dr, aE as cr } from "./NoInputContainer-LdJeEMWI.js";
|
|
3
|
+
import { a as lr, u as fr } from "./useConfirm-ee4Czv-n.js";
|
|
4
4
|
import { useContext as Ye } from "react";
|
|
5
5
|
import { f as Je } from "./textUtils-BbxuIsKq.js";
|
|
6
6
|
import { i as He } from "./dateUtils-Crak7ii9.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import { a as mr, u as pr } from "./useKeyPress-CwWcvmEW.js";
|
|
9
|
-
import { u as _r } from "./usePermissions-
|
|
9
|
+
import { u as _r } from "./usePermissions-CHfDy8Yx.js";
|
|
10
10
|
var x;
|
|
11
11
|
(function(r) {
|
|
12
12
|
r.assertEqual = (s) => s;
|
|
@@ -111,7 +111,7 @@ const f = x.arrayToEnum([
|
|
|
111
111
|
"not_multiple_of",
|
|
112
112
|
"not_finite"
|
|
113
113
|
]), Ge = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
114
|
-
class
|
|
114
|
+
class O extends Error {
|
|
115
115
|
constructor(e) {
|
|
116
116
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
117
117
|
this.issues = [...this.issues, n];
|
|
@@ -148,7 +148,7 @@ class N extends Error {
|
|
|
148
148
|
return s(this), n;
|
|
149
149
|
}
|
|
150
150
|
static assert(e) {
|
|
151
|
-
if (!(e instanceof
|
|
151
|
+
if (!(e instanceof O))
|
|
152
152
|
throw new Error(`Not a ZodError: ${e}`);
|
|
153
153
|
}
|
|
154
154
|
toString() {
|
|
@@ -170,7 +170,7 @@ class N extends Error {
|
|
|
170
170
|
return this.flatten();
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
O.create = (r) => new O(r);
|
|
174
174
|
const G = (r, e) => {
|
|
175
175
|
let t;
|
|
176
176
|
switch (r.code) {
|
|
@@ -313,7 +313,7 @@ class Z {
|
|
|
313
313
|
}
|
|
314
314
|
const p = Object.freeze({
|
|
315
315
|
status: "aborted"
|
|
316
|
-
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ce = (r) => r.status === "aborted",
|
|
316
|
+
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ce = (r) => r.status === "aborted", Ne = (r) => r.status === "dirty", ee = (r) => r.status === "valid", te = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
317
317
|
function ve(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");
|
|
@@ -347,7 +347,7 @@ const Ie = (r, e) => {
|
|
|
347
347
|
get error() {
|
|
348
348
|
if (this._error)
|
|
349
349
|
return this._error;
|
|
350
|
-
const t = new
|
|
350
|
+
const t = new O(r.common.issues);
|
|
351
351
|
return this._error = t, this._error;
|
|
352
352
|
}
|
|
353
353
|
};
|
|
@@ -1504,13 +1504,13 @@ R.create = (r, e) => new R({
|
|
|
1504
1504
|
..._(e)
|
|
1505
1505
|
});
|
|
1506
1506
|
function Y(r) {
|
|
1507
|
-
if (r instanceof
|
|
1507
|
+
if (r instanceof b) {
|
|
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
|
|
1513
|
+
return new b({
|
|
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 U ? U.create(Y(r.unwrap())) : r instanceof M ? M.create(r.items.map((e) => Y(e))) : r;
|
|
1522
1522
|
}
|
|
1523
|
-
class
|
|
1523
|
+
class b extends v {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1526
1526
|
}
|
|
@@ -1545,10 +1545,10 @@ class k extends v {
|
|
|
1545
1545
|
i.includes(c) || o.push(c);
|
|
1546
1546
|
const u = [];
|
|
1547
1547
|
for (const c of i) {
|
|
1548
|
-
const y = a[c],
|
|
1548
|
+
const y = a[c], N = s.data[c];
|
|
1549
1549
|
u.push({
|
|
1550
1550
|
key: { status: "valid", value: c },
|
|
1551
|
-
value: y._parse(new A(s,
|
|
1551
|
+
value: y._parse(new A(s, N, s.path, c)),
|
|
1552
1552
|
alwaysSet: c in s.data
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
@@ -1570,11 +1570,11 @@ class k extends v {
|
|
|
1570
1570
|
} else {
|
|
1571
1571
|
const c = this._def.catchall;
|
|
1572
1572
|
for (const y of o) {
|
|
1573
|
-
const
|
|
1573
|
+
const N = s.data[y];
|
|
1574
1574
|
u.push({
|
|
1575
1575
|
key: { status: "valid", value: y },
|
|
1576
1576
|
value: c._parse(
|
|
1577
|
-
new A(s,
|
|
1577
|
+
new A(s, N, s.path, y)
|
|
1578
1578
|
//, ctx.child(key), value, getParsedType(value)
|
|
1579
1579
|
),
|
|
1580
1580
|
alwaysSet: y in s.data
|
|
@@ -1584,9 +1584,9 @@ class k extends v {
|
|
|
1584
1584
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1585
1585
|
const c = [];
|
|
1586
1586
|
for (const y of u) {
|
|
1587
|
-
const
|
|
1587
|
+
const N = await y.key, Te = await y.value;
|
|
1588
1588
|
c.push({
|
|
1589
|
-
key:
|
|
1589
|
+
key: N,
|
|
1590
1590
|
value: Te,
|
|
1591
1591
|
alwaysSet: y.alwaysSet
|
|
1592
1592
|
});
|
|
@@ -1598,7 +1598,7 @@ class k extends v {
|
|
|
1598
1598
|
return this._def.shape();
|
|
1599
1599
|
}
|
|
1600
1600
|
strict(e) {
|
|
1601
|
-
return h.errToObj, new
|
|
1601
|
+
return h.errToObj, new b({
|
|
1602
1602
|
...this._def,
|
|
1603
1603
|
unknownKeys: "strict",
|
|
1604
1604
|
...e !== void 0 ? {
|
|
@@ -1615,13 +1615,13 @@ class k extends v {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
}
|
|
1617
1617
|
strip() {
|
|
1618
|
-
return new
|
|
1618
|
+
return new b({
|
|
1619
1619
|
...this._def,
|
|
1620
1620
|
unknownKeys: "strip"
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
passthrough() {
|
|
1624
|
-
return new
|
|
1624
|
+
return new b({
|
|
1625
1625
|
...this._def,
|
|
1626
1626
|
unknownKeys: "passthrough"
|
|
1627
1627
|
});
|
|
@@ -1644,7 +1644,7 @@ class k extends v {
|
|
|
1644
1644
|
// }) as any;
|
|
1645
1645
|
// };
|
|
1646
1646
|
extend(e) {
|
|
1647
|
-
return new
|
|
1647
|
+
return new b({
|
|
1648
1648
|
...this._def,
|
|
1649
1649
|
shape: () => ({
|
|
1650
1650
|
...this._def.shape(),
|
|
@@ -1658,7 +1658,7 @@ class k extends v {
|
|
|
1658
1658
|
* upgrade if you are experiencing issues.
|
|
1659
1659
|
*/
|
|
1660
1660
|
merge(e) {
|
|
1661
|
-
return new
|
|
1661
|
+
return new b({
|
|
1662
1662
|
unknownKeys: e._def.unknownKeys,
|
|
1663
1663
|
catchall: e._def.catchall,
|
|
1664
1664
|
shape: () => ({
|
|
@@ -1728,7 +1728,7 @@ class k extends v {
|
|
|
1728
1728
|
// return merged;
|
|
1729
1729
|
// }
|
|
1730
1730
|
catchall(e) {
|
|
1731
|
-
return new
|
|
1731
|
+
return new b({
|
|
1732
1732
|
...this._def,
|
|
1733
1733
|
catchall: e
|
|
1734
1734
|
});
|
|
@@ -1737,7 +1737,7 @@ class k 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
|
|
1740
|
+
}), new b({
|
|
1741
1741
|
...this._def,
|
|
1742
1742
|
shape: () => t
|
|
1743
1743
|
});
|
|
@@ -1746,7 +1746,7 @@ class k 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
|
|
1749
|
+
}), new b({
|
|
1750
1750
|
...this._def,
|
|
1751
1751
|
shape: () => t
|
|
1752
1752
|
});
|
|
@@ -1762,7 +1762,7 @@ class k 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
|
|
1765
|
+
}), new b({
|
|
1766
1766
|
...this._def,
|
|
1767
1767
|
shape: () => t
|
|
1768
1768
|
});
|
|
@@ -1778,7 +1778,7 @@ class k extends v {
|
|
|
1778
1778
|
a = a._def.innerType;
|
|
1779
1779
|
t[n] = a;
|
|
1780
1780
|
}
|
|
1781
|
-
}), new
|
|
1781
|
+
}), new b({
|
|
1782
1782
|
...this._def,
|
|
1783
1783
|
shape: () => t
|
|
1784
1784
|
});
|
|
@@ -1787,21 +1787,21 @@ class k extends v {
|
|
|
1787
1787
|
return Ve(x.objectKeys(this.shape));
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1790
|
+
b.create = (r, e) => new b({
|
|
1791
1791
|
shape: () => r,
|
|
1792
1792
|
unknownKeys: "strip",
|
|
1793
1793
|
catchall: z.create(),
|
|
1794
1794
|
typeName: m.ZodObject,
|
|
1795
1795
|
..._(e)
|
|
1796
1796
|
});
|
|
1797
|
-
|
|
1797
|
+
b.strictCreate = (r, e) => new b({
|
|
1798
1798
|
shape: () => r,
|
|
1799
1799
|
unknownKeys: "strict",
|
|
1800
1800
|
catchall: z.create(),
|
|
1801
1801
|
typeName: m.ZodObject,
|
|
1802
1802
|
..._(e)
|
|
1803
1803
|
});
|
|
1804
|
-
|
|
1804
|
+
b.lazycreate = (r, e) => new b({
|
|
1805
1805
|
shape: r,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
1807
|
catchall: z.create(),
|
|
@@ -1818,7 +1818,7 @@ class ae extends v {
|
|
|
1818
1818
|
for (const o of a)
|
|
1819
1819
|
if (o.result.status === "dirty")
|
|
1820
1820
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1821
|
-
const i = a.map((o) => new
|
|
1821
|
+
const i = a.map((o) => new O(o.ctx.common.issues));
|
|
1822
1822
|
return l(t, {
|
|
1823
1823
|
code: d.invalid_union,
|
|
1824
1824
|
unionErrors: i
|
|
@@ -1865,7 +1865,7 @@ class ae extends v {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
if (a)
|
|
1867
1867
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1868
|
-
const o = i.map((u) => new
|
|
1868
|
+
const o = i.map((u) => new O(u));
|
|
1869
1869
|
return l(t, {
|
|
1870
1870
|
code: d.invalid_union,
|
|
1871
1871
|
unionErrors: o
|
|
@@ -1944,14 +1944,14 @@ class we extends v {
|
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function Oe(r, e) {
|
|
1948
1948
|
const t = P(r), n = P(e);
|
|
1949
1949
|
if (r === e)
|
|
1950
1950
|
return { valid: !0, data: r };
|
|
1951
1951
|
if (t === f.object && n === f.object) {
|
|
1952
1952
|
const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1953
1953
|
for (const o of a) {
|
|
1954
|
-
const u =
|
|
1954
|
+
const u = Oe(r[o], e[o]);
|
|
1955
1955
|
if (!u.valid)
|
|
1956
1956
|
return { valid: !1 };
|
|
1957
1957
|
i[o] = u.data;
|
|
@@ -1962,7 +1962,7 @@ function Ne(r, e) {
|
|
|
1962
1962
|
return { valid: !1 };
|
|
1963
1963
|
const s = [];
|
|
1964
1964
|
for (let a = 0; a < r.length; a++) {
|
|
1965
|
-
const i = r[a], o = e[a], u =
|
|
1965
|
+
const i = r[a], o = e[a], u = Oe(i, o);
|
|
1966
1966
|
if (!u.valid)
|
|
1967
1967
|
return { valid: !1 };
|
|
1968
1968
|
s.push(u.data);
|
|
@@ -1976,8 +1976,8 @@ class ie extends v {
|
|
|
1976
1976
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
1977
1977
|
if (Ce(a) || Ce(i))
|
|
1978
1978
|
return p;
|
|
1979
|
-
const o =
|
|
1980
|
-
return o.valid ? ((
|
|
1979
|
+
const o = Oe(a.value, i.value);
|
|
1980
|
+
return o.valid ? ((Ne(a) || Ne(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
1981
1981
|
code: d.invalid_intersection_types
|
|
1982
1982
|
}), p);
|
|
1983
1983
|
};
|
|
@@ -2260,11 +2260,11 @@ class H extends v {
|
|
|
2260
2260
|
if (this._def.returns instanceof K) {
|
|
2261
2261
|
const o = this;
|
|
2262
2262
|
return S(async function(...u) {
|
|
2263
|
-
const c = new
|
|
2263
|
+
const c = new O([]), y = await o._def.args.parseAsync(u, a).catch((pe) => {
|
|
2264
2264
|
throw c.addIssue(n(u, pe)), c;
|
|
2265
|
-
}),
|
|
2266
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2267
|
-
throw c.addIssue(s(
|
|
2265
|
+
}), N = await Reflect.apply(i, this, y);
|
|
2266
|
+
return await o._def.returns._def.type.parseAsync(N, a).catch((pe) => {
|
|
2267
|
+
throw c.addIssue(s(N, pe)), c;
|
|
2268
2268
|
});
|
|
2269
2269
|
});
|
|
2270
2270
|
} else {
|
|
@@ -2272,11 +2272,11 @@ class H extends v {
|
|
|
2272
2272
|
return S(function(...u) {
|
|
2273
2273
|
const c = o._def.args.safeParse(u, a);
|
|
2274
2274
|
if (!c.success)
|
|
2275
|
-
throw new
|
|
2276
|
-
const y = Reflect.apply(i, this, c.data),
|
|
2277
|
-
if (!
|
|
2278
|
-
throw new
|
|
2279
|
-
return
|
|
2275
|
+
throw new O([n(u, c.error)]);
|
|
2276
|
+
const y = Reflect.apply(i, this, c.data), N = o._def.returns.safeParse(y, a);
|
|
2277
|
+
if (!N.success)
|
|
2278
|
+
throw new O([s(y, N.error)]);
|
|
2279
|
+
return N.data;
|
|
2280
2280
|
});
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
@@ -2626,7 +2626,7 @@ class fe extends v {
|
|
|
2626
2626
|
status: "valid",
|
|
2627
2627
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2628
2628
|
get error() {
|
|
2629
|
-
return new
|
|
2629
|
+
return new O(n.common.issues);
|
|
2630
2630
|
},
|
|
2631
2631
|
input: n.data
|
|
2632
2632
|
})
|
|
@@ -2634,7 +2634,7 @@ class fe extends v {
|
|
|
2634
2634
|
status: "valid",
|
|
2635
2635
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2636
2636
|
get error() {
|
|
2637
|
-
return new
|
|
2637
|
+
return new O(n.common.issues);
|
|
2638
2638
|
},
|
|
2639
2639
|
input: n.data
|
|
2640
2640
|
})
|
|
@@ -2745,7 +2745,7 @@ function De(r, e = {}, t) {
|
|
|
2745
2745
|
}) : X.create();
|
|
2746
2746
|
}
|
|
2747
2747
|
const mt = {
|
|
2748
|
-
object:
|
|
2748
|
+
object: b.lazycreate
|
|
2749
2749
|
};
|
|
2750
2750
|
var m;
|
|
2751
2751
|
(function(r) {
|
|
@@ -2753,7 +2753,7 @@ var m;
|
|
|
2753
2753
|
})(m || (m = {}));
|
|
2754
2754
|
const pt = (r, e = {
|
|
2755
2755
|
message: `Input not instance of ${r.name}`
|
|
2756
|
-
}) => 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 = R.create, Ct =
|
|
2756
|
+
}) => 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 = R.create, Ct = b.create, Nt = b.strictCreate, Ot = ae.create, Et = we.create, Rt = ie.create, It = 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 = K.create, je = I.create, Ut = j.create, Bt = U.create, qt = I.createWithPreprocess, Wt = me.create, Yt = () => Le().optional(), Jt = () => Ue().optional(), Ht = () => Be().optional(), Gt = {
|
|
2757
2757
|
string: (r) => E.create({ ...r, coerce: !0 }),
|
|
2758
2758
|
number: (r) => V.create({ ...r, coerce: !0 }),
|
|
2759
2759
|
boolean: (r) => re.create({
|
|
@@ -2776,7 +2776,7 @@ var C = /* @__PURE__ */ Object.freeze({
|
|
|
2776
2776
|
DIRTY: J,
|
|
2777
2777
|
OK: S,
|
|
2778
2778
|
isAborted: Ce,
|
|
2779
|
-
isDirty:
|
|
2779
|
+
isDirty: Ne,
|
|
2780
2780
|
isValid: ee,
|
|
2781
2781
|
isAsync: te,
|
|
2782
2782
|
get util() {
|
|
@@ -2802,7 +2802,7 @@ var C = /* @__PURE__ */ Object.freeze({
|
|
|
2802
2802
|
ZodNever: z,
|
|
2803
2803
|
ZodVoid: xe,
|
|
2804
2804
|
ZodArray: R,
|
|
2805
|
-
ZodObject:
|
|
2805
|
+
ZodObject: b,
|
|
2806
2806
|
ZodUnion: ae,
|
|
2807
2807
|
ZodDiscriminatedUnion: we,
|
|
2808
2808
|
ZodIntersection: ie,
|
|
@@ -2865,31 +2865,31 @@ var C = /* @__PURE__ */ Object.freeze({
|
|
|
2865
2865
|
promise: Lt,
|
|
2866
2866
|
record: jt,
|
|
2867
2867
|
set: Mt,
|
|
2868
|
-
strictObject:
|
|
2868
|
+
strictObject: Nt,
|
|
2869
2869
|
string: Le,
|
|
2870
2870
|
symbol: gt,
|
|
2871
2871
|
transformer: je,
|
|
2872
2872
|
tuple: It,
|
|
2873
2873
|
undefined: xt,
|
|
2874
|
-
union:
|
|
2874
|
+
union: Ot,
|
|
2875
2875
|
unknown: wt,
|
|
2876
2876
|
void: Zt,
|
|
2877
2877
|
NEVER: Xt,
|
|
2878
2878
|
ZodIssueCode: d,
|
|
2879
2879
|
quotelessJson: Ge,
|
|
2880
|
-
ZodError:
|
|
2880
|
+
ZodError: O
|
|
2881
2881
|
});
|
|
2882
2882
|
const nr = () => {
|
|
2883
2883
|
const { formValidationTexts: r } = Ye(We), e = (g) => (g != null && g.useCoerce ? C.coerce : C).string({
|
|
2884
2884
|
invalid_type_error: r.required
|
|
2885
|
-
}).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((
|
|
2886
|
-
const
|
|
2885
|
+
}).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((k) => k ?? null), n = (g) => {
|
|
2886
|
+
const k = (g != null && g.useCoerce ? C.coerce : C).number({
|
|
2887
2887
|
invalid_type_error: r.required
|
|
2888
2888
|
});
|
|
2889
|
-
return (g == null ? void 0 : g.min) !== void 0 &&
|
|
2890
|
-
}, s = (g) => n(g).nullable().optional().transform((
|
|
2889
|
+
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) => Number.isNaN(w) ? null : w ?? null);
|
|
2890
|
+
}, s = (g) => n(g).nullable().optional().transform((k) => Number.isNaN(k) ? null : k ?? null), a = (g) => (g != null && g.useCoerce ? C.coerce : C).boolean({
|
|
2891
2891
|
invalid_type_error: r.required
|
|
2892
|
-
}).transform((
|
|
2892
|
+
}).transform((k) => k ?? null), i = (g) => (g != null && g.useCoerce ? C.coerce : C).string({ invalid_type_error: r.required }).refine(He, { message: r.invalidDate }).transform((w) => w ?? null), o = (g) => i(g).nullable().transform((k) => k ?? null), u = (g, k) => C.enum(g, { invalid_type_error: r.required }).transform((Re) => Re ?? null);
|
|
2893
2893
|
return {
|
|
2894
2894
|
zString: t,
|
|
2895
2895
|
zStringRequired: e,
|
|
@@ -2898,13 +2898,13 @@ const nr = () => {
|
|
|
2898
2898
|
zBool: a,
|
|
2899
2899
|
zDate: o,
|
|
2900
2900
|
zDateRequired: i,
|
|
2901
|
-
zEnum: (g,
|
|
2901
|
+
zEnum: (g, k) => u(g).nullable().transform((w) => w ?? null),
|
|
2902
2902
|
zEnumRequired: u,
|
|
2903
2903
|
zObjectIdInt: (g) => C.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2904
2904
|
zObjectIdIntRequired: (g) => C.object({ id: n() }).transform((w) => w ?? null),
|
|
2905
2905
|
zObjectIdStr: (g) => C.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2906
2906
|
zObjectIdStrRequired: (g) => C.object({ id: e() }).transform((w) => w ?? null),
|
|
2907
|
-
zFile: ({ required: g, multiple:
|
|
2907
|
+
zFile: ({ required: g, multiple: k, maxFileSize: w }) => C.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((qe) => qe.size <= w), `Maximum file size is ${Je(w)}.`).transform((T) => (k ? T : T == null ? void 0 : T[0]) ?? null)
|
|
2908
2908
|
};
|
|
2909
2909
|
};
|
|
2910
2910
|
export {
|
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("./NoInputContainer-BkFSaMQy.cjs"),d=require("react");require("react-hook-form");const w=require("./usePermissions-yA39pMjm.cjs"),C=require("./SimpleTooltip-C_iRq-Q0.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:m}=d.useContext(s.LuminusComponentsContext),[p,u]=d.useState(!1),[c]=l.split("?"),h=e.linkTo===c||((v=e.children)==null?void 0:v.some(n=>n.linkTo===c));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(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))})})]})},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:m})=>{const[p,u]=d.useState(-1),{checkUserHasPermissions:c}=w.usePermissions(),h=d.useMemo(()=>t.map(n=>{var r;return{...n,notPermitted:!c(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(x=>({...x,notPermitted:!c(x.permissions??[]),disabled:n.disabled||x.disabled}))}}),[t,c]),v=d.useMemo(()=>i.map(n=>{var r;return{...n,notPermitted:!c(n.permissions??[]),children:(r=n.children)==null?void 0:r.map(x=>({...x,notPermitted:!c(x.permissions??[])}))}}),[i,c]),_=n=>{u(n===p?-1:n)};return d.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:m},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:m},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}=d.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,noPadding:a,className:l})=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("container-fluid",a?"p-0":"p-3",l),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})]}),W="_full-screen-container_1rm4r_1",X={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:W},Y=({title:e,children:t,sideContent:i,noPadding:a,className:l})=>s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:s.classNames("overflow-hidden luminus-full-screen-container",a?"p-0":"p-3",l,X.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=Y;exports.MainContainer=V;exports.SideContentBar=b;exports.SideMenu=z;exports.TopBar=J;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as C, j as e, b as i, W as I,
|
|
1
|
+
import { N as C, j as e, b as i, W as I, X as P } from "./NoInputContainer-LdJeEMWI.js";
|
|
2
2
|
import { useContext as B, useState as M, useMemo as j, useEffect as g } from "react";
|
|
3
3
|
import "react-hook-form";
|
|
4
|
-
import { u as y } from "./usePermissions-
|
|
5
|
-
import { S } from "./SimpleTooltip-
|
|
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", U = "_children-container_6vbwa_57", W = "_visible_6vbwa_65",
|
|
4
|
+
import { u as y } from "./usePermissions-CHfDy8Yx.js";
|
|
5
|
+
import { S } from "./SimpleTooltip-mxX4RNUy.js";
|
|
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", U = "_children-container_6vbwa_57", W = "_visible_6vbwa_65", X = "_children_6vbwa_57", o = {
|
|
7
7
|
"side-menu-item": "_side-menu-item_6vbwa_1",
|
|
8
8
|
sideMenuItem: T,
|
|
9
9
|
disabled: $,
|
|
@@ -19,14 +19,14 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
19
19
|
"children-container": "_children-container_6vbwa_57",
|
|
20
20
|
childrenContainer: U,
|
|
21
21
|
visible: W,
|
|
22
|
-
children:
|
|
23
|
-
},
|
|
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: l }) => {
|
|
24
24
|
var b, h;
|
|
25
25
|
const { LinkComponent: m } = B(C), [p, _] = M(!1), [c] = l.split("?"), x = n.linkTo === c || ((b = n.children) == null ? void 0 : b.some((s) => s.linkTo === c));
|
|
26
26
|
return /* @__PURE__ */ e.jsxs("li", { className: i("luminus-side-menu-item", o.sideMenuItem, {
|
|
27
27
|
[o.expanded]: t
|
|
28
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(
|
|
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: i("nav-link", o.navButton), onClick: () => r(), children: [
|
|
30
30
|
/* @__PURE__ */ e.jsx("div", { className: i("icon", o.icon), children: n.icon }),
|
|
31
31
|
t && /* @__PURE__ */ e.jsx("div", { className: i("text", o.text, "text-nowrap"), children: n.title }),
|
|
32
32
|
t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", o.collapseIcon, {
|
|
@@ -40,15 +40,15 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
40
40
|
[o.visible]: a
|
|
41
41
|
}), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", o.children), children: (h = n.children) == null ? void 0 : h.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)) }) })
|
|
42
42
|
] });
|
|
43
|
-
},
|
|
43
|
+
}, z = "_side-menu_n1hvm_1", D = "_sidebar-header_n1hvm_13", G = "_side-menu-content_n1hvm_18", J = "_expand_n1hvm_22", Q = "_divider_n1hvm_26", v = {
|
|
44
44
|
"side-menu": "_side-menu_n1hvm_1",
|
|
45
|
-
sideMenu:
|
|
45
|
+
sideMenu: z,
|
|
46
46
|
"sidebar-header": "_sidebar-header_n1hvm_13",
|
|
47
|
-
sidebarHeader:
|
|
47
|
+
sidebarHeader: D,
|
|
48
48
|
"side-menu-content": "_side-menu-content_n1hvm_18",
|
|
49
|
-
sideMenuContent:
|
|
50
|
-
expand:
|
|
51
|
-
divider:
|
|
49
|
+
sideMenuContent: G,
|
|
50
|
+
expand: J,
|
|
51
|
+
divider: Q
|
|
52
52
|
}, re = ({ headerItem: n, mainItems: t, secondaryItems: a, expanded: r, setExpanded: l, currentPath: m }) => {
|
|
53
53
|
const [p, _] = M(-1), { checkUserHasPermissions: c } = y(), x = j(() => t.map((s) => {
|
|
54
54
|
var d;
|
|
@@ -86,9 +86,9 @@ const T = "_side-menu-item_6vbwa_1", $ = "_disabled_6vbwa_5", H = "_nav-button_6
|
|
|
86
86
|
b.map((s, d) => /* @__PURE__ */ e.jsx(w, { item: s, menuExpanded: r, collapsed: d === p, onCollapse: () => h(d), currentPath: m }, s.title))
|
|
87
87
|
] })
|
|
88
88
|
] });
|
|
89
|
-
},
|
|
89
|
+
}, V = "_top-bar_1lk80_1", Y = "_top-bar-brand_1lk80_14", N = {
|
|
90
90
|
"top-bar": "_top-bar_1lk80_1",
|
|
91
|
-
topBar:
|
|
91
|
+
topBar: V,
|
|
92
92
|
"top-bar-brand": "_top-bar-brand_1lk80_14",
|
|
93
93
|
topBarBrand: Y
|
|
94
94
|
}, de = ({ appName: n, leftOffset: t, centerContent: a, rightContent: r }) => {
|