@realtek/core-theme 0.0.183 → 0.0.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/Breadcrumb-Bt70pMBf.cjs +3 -0
- package/dist-lib/Breadcrumb-Bt70pMBf.cjs.map +1 -0
- package/dist-lib/{Breadcrumb-BIyKKBRX.js → Breadcrumb-C_ybG8rI.js} +336 -328
- package/dist-lib/Breadcrumb-C_ybG8rI.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +6299 -6228
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/Breadcrumb-BIyKKBRX.js.map +0 -1
- package/dist-lib/Breadcrumb-DvB78zph.cjs +0 -3
- package/dist-lib/Breadcrumb-DvB78zph.cjs.map +0 -1
|
@@ -1239,7 +1239,7 @@ async function Mt(e, { gateway: n, strategies: r }) {
|
|
|
1239
1239
|
async function Nt() {
|
|
1240
1240
|
let e = [];
|
|
1241
1241
|
try {
|
|
1242
|
-
e = await
|
|
1242
|
+
e = await Kn();
|
|
1243
1243
|
} catch {
|
|
1244
1244
|
e = [];
|
|
1245
1245
|
}
|
|
@@ -1401,10 +1401,18 @@ async function cn(e) {
|
|
|
1401
1401
|
return t(i, `${I}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1402
1402
|
}
|
|
1403
1403
|
async function ln(e) {
|
|
1404
|
+
let n = await t(i, `${I}/test`, {
|
|
1405
|
+
method: "POST",
|
|
1406
|
+
headers: { "Content-Type": "application/json" },
|
|
1407
|
+
body: JSON.stringify(e)
|
|
1408
|
+
});
|
|
1409
|
+
return n?.data ?? n;
|
|
1410
|
+
}
|
|
1411
|
+
async function un(e) {
|
|
1404
1412
|
let n = await t(i, `/integration-config/${encodeURIComponent(e)}/summary`);
|
|
1405
1413
|
return n?.data ?? n;
|
|
1406
1414
|
}
|
|
1407
|
-
async function
|
|
1415
|
+
async function dn(e, n, r) {
|
|
1408
1416
|
let a = await t(i, `/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(n)}`, {
|
|
1409
1417
|
method: "POST",
|
|
1410
1418
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1412,11 +1420,11 @@ async function un(e, n, r) {
|
|
|
1412
1420
|
});
|
|
1413
1421
|
return a?.data ?? a;
|
|
1414
1422
|
}
|
|
1415
|
-
async function
|
|
1423
|
+
async function fn(e, n) {
|
|
1416
1424
|
let r = await t(i, `${F}?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}&view=detail`), a = r?.data ?? r;
|
|
1417
1425
|
return Array.isArray(a) ? a : [];
|
|
1418
1426
|
}
|
|
1419
|
-
function
|
|
1427
|
+
function pn(e) {
|
|
1420
1428
|
return {
|
|
1421
1429
|
key: e.role_id ?? e.id,
|
|
1422
1430
|
roleId: e.role_id ?? e.id,
|
|
@@ -1430,14 +1438,14 @@ function fn(e) {
|
|
|
1430
1438
|
function L(e) {
|
|
1431
1439
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
1432
1440
|
}
|
|
1433
|
-
async function
|
|
1434
|
-
let e = await t(i, "/get-roles"), n = e.data ?? e, r = N(n?.zinnext_default).map(
|
|
1441
|
+
async function mn() {
|
|
1442
|
+
let e = await t(i, "/get-roles"), n = e.data ?? e, r = N(n?.zinnext_default).map(pn), a = N(n?.custom_roles).map(pn), o = [...r, ...a];
|
|
1435
1443
|
return {
|
|
1436
1444
|
roles: o,
|
|
1437
1445
|
total: o.length
|
|
1438
1446
|
};
|
|
1439
1447
|
}
|
|
1440
|
-
function
|
|
1448
|
+
function hn(e) {
|
|
1441
1449
|
return {
|
|
1442
1450
|
key: e.teamId,
|
|
1443
1451
|
teamId: e.teamId,
|
|
@@ -1450,10 +1458,10 @@ function mn(e) {
|
|
|
1450
1458
|
raw: e
|
|
1451
1459
|
};
|
|
1452
1460
|
}
|
|
1453
|
-
function
|
|
1461
|
+
function gn(e) {
|
|
1454
1462
|
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
1455
1463
|
}
|
|
1456
|
-
async function
|
|
1464
|
+
async function _n({ offset: e = 0, limit: n = 10, sortBy: r = "new", search: a = "" } = {}) {
|
|
1457
1465
|
let o = await t(i, `/get-teams?${new URLSearchParams({
|
|
1458
1466
|
searchquery: a,
|
|
1459
1467
|
sortBy: r,
|
|
@@ -1461,12 +1469,12 @@ async function gn({ offset: e = 0, limit: n = 10, sortBy: r = "new", search: a =
|
|
|
1461
1469
|
offset: String(e)
|
|
1462
1470
|
})}`), s = o.data ?? o, c = N(s?.teams, s, o?.teams), l = s?.totalCount ?? s?.total ?? c.length;
|
|
1463
1471
|
return {
|
|
1464
|
-
teams: c.map(
|
|
1472
|
+
teams: c.map(hn),
|
|
1465
1473
|
total: l
|
|
1466
1474
|
};
|
|
1467
1475
|
}
|
|
1468
|
-
async function
|
|
1469
|
-
return t(i, `/team/edit?teamId=${
|
|
1476
|
+
async function vn(e, { teamName: n, managerId: r, memberIds: a = [] }) {
|
|
1477
|
+
return t(i, `/team/edit?teamId=${gn(e)}`, {
|
|
1470
1478
|
method: "PUT",
|
|
1471
1479
|
body: JSON.stringify({
|
|
1472
1480
|
team_name: n,
|
|
@@ -1476,7 +1484,7 @@ async function _n(e, { teamName: n, managerId: r, memberIds: a = [] }) {
|
|
|
1476
1484
|
})
|
|
1477
1485
|
});
|
|
1478
1486
|
}
|
|
1479
|
-
async function
|
|
1487
|
+
async function yn(e, n, r, a = "listView") {
|
|
1480
1488
|
let o = await t(i, `${j}?${new URLSearchParams({
|
|
1481
1489
|
module: e,
|
|
1482
1490
|
userId: "0",
|
|
@@ -1485,8 +1493,8 @@ async function vn(e, n, r, a = "listView") {
|
|
|
1485
1493
|
})}`), s = o.data ?? o;
|
|
1486
1494
|
return N(s, s?.visibleFields, o?.visibleFields);
|
|
1487
1495
|
}
|
|
1488
|
-
async function
|
|
1489
|
-
let r = L(e), i = Tt(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await
|
|
1496
|
+
async function bn(e, t = "listView", n = M) {
|
|
1497
|
+
let r = L(e), i = Tt(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await yn(n, "roleId", r, t)).map((t, i) => ({
|
|
1490
1498
|
...Ct(t, i),
|
|
1491
1499
|
module: e,
|
|
1492
1500
|
apiModule: n,
|
|
@@ -1494,8 +1502,8 @@ async function yn(e, t = "listView", n = M) {
|
|
|
1494
1502
|
}))]));
|
|
1495
1503
|
return Object.fromEntries(a);
|
|
1496
1504
|
}
|
|
1497
|
-
async function
|
|
1498
|
-
let n =
|
|
1505
|
+
async function xn(e, t = "listView") {
|
|
1506
|
+
let n = gn(e), r = await Promise.all(M.map(async ({ key: e, apiModule: r }) => [e, (await yn(r, "teamId", n, t)).map((t, i) => ({
|
|
1499
1507
|
...Ct(t, i),
|
|
1500
1508
|
module: e,
|
|
1501
1509
|
apiModule: r,
|
|
@@ -1503,7 +1511,7 @@ async function bn(e, t = "listView") {
|
|
|
1503
1511
|
}))]));
|
|
1504
1512
|
return Object.fromEntries(r);
|
|
1505
1513
|
}
|
|
1506
|
-
function
|
|
1514
|
+
function Sn(e, t) {
|
|
1507
1515
|
let n = !t || t === "listView";
|
|
1508
1516
|
return e.map((e, r) => {
|
|
1509
1517
|
let i = {
|
|
@@ -1539,7 +1547,7 @@ function xn(e, t) {
|
|
|
1539
1547
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
1540
1548
|
});
|
|
1541
1549
|
}
|
|
1542
|
-
async function
|
|
1550
|
+
async function Cn(e, n, r, a = "listView", o = M) {
|
|
1543
1551
|
let s = L(e), c = Tt(o).find((e) => e.key === n)?.apiModule ?? n;
|
|
1544
1552
|
return t(i, `${j}/role`, {
|
|
1545
1553
|
method: "PUT",
|
|
@@ -1547,29 +1555,29 @@ async function Sn(e, n, r, a = "listView", o = M) {
|
|
|
1547
1555
|
module: c,
|
|
1548
1556
|
roleId: s,
|
|
1549
1557
|
configType: a,
|
|
1550
|
-
visibleFields:
|
|
1558
|
+
visibleFields: Sn(r, a)
|
|
1551
1559
|
})
|
|
1552
1560
|
});
|
|
1553
1561
|
}
|
|
1554
|
-
var
|
|
1555
|
-
function
|
|
1562
|
+
var wn = "/admin/role-form-permissions";
|
|
1563
|
+
function Tn(e) {
|
|
1556
1564
|
return `__group__:${e}`;
|
|
1557
1565
|
}
|
|
1558
|
-
async function
|
|
1566
|
+
async function En(e, n, r = {}) {
|
|
1559
1567
|
let a = L(e), o = new URLSearchParams({
|
|
1560
1568
|
module: n,
|
|
1561
1569
|
roleId: String(a ?? "")
|
|
1562
1570
|
});
|
|
1563
1571
|
r.clientId && o.set("clientId", r.clientId), r.region && o.set("region", r.region);
|
|
1564
|
-
let s = await t(i, `${
|
|
1572
|
+
let s = await t(i, `${wn}?${o}`), c = s?.data ?? s;
|
|
1565
1573
|
return Array.isArray(c) ? c : [];
|
|
1566
1574
|
}
|
|
1567
|
-
async function
|
|
1575
|
+
async function Dn(e, n, r) {
|
|
1568
1576
|
let a = L(e), o = [], s = 0;
|
|
1569
1577
|
for (let e of r) {
|
|
1570
1578
|
e.locked || o.push({
|
|
1571
1579
|
label: e.label,
|
|
1572
|
-
field:
|
|
1580
|
+
field: Tn(e.name),
|
|
1573
1581
|
isVisible: e.enabled,
|
|
1574
1582
|
isEditable: e.editable !== !1,
|
|
1575
1583
|
order: s++
|
|
@@ -1592,19 +1600,19 @@ async function En(e, n, r) {
|
|
|
1592
1600
|
})
|
|
1593
1601
|
});
|
|
1594
1602
|
}
|
|
1595
|
-
async function
|
|
1596
|
-
let o =
|
|
1603
|
+
async function On(e, n, r, a = "listView") {
|
|
1604
|
+
let o = gn(e), s = M.find((e) => e.key === n)?.apiModule ?? n;
|
|
1597
1605
|
return t(i, `${j}/team`, {
|
|
1598
1606
|
method: "PUT",
|
|
1599
1607
|
body: JSON.stringify({
|
|
1600
1608
|
module: s,
|
|
1601
1609
|
teamId: o,
|
|
1602
1610
|
configType: a,
|
|
1603
|
-
visibleFields:
|
|
1611
|
+
visibleFields: Sn(r, a)
|
|
1604
1612
|
})
|
|
1605
1613
|
});
|
|
1606
1614
|
}
|
|
1607
|
-
async function
|
|
1615
|
+
async function kn({ offset: e = 0, limit: n = 10, sortBy: r = "new", searchQuery: a = "" } = {}) {
|
|
1608
1616
|
let o = new URLSearchParams({
|
|
1609
1617
|
offset: String(e),
|
|
1610
1618
|
limit: String(n),
|
|
@@ -1620,21 +1628,21 @@ async function On({ offset: e = 0, limit: n = 10, sortBy: r = "new", searchQuery
|
|
|
1620
1628
|
}, l)
|
|
1621
1629
|
};
|
|
1622
1630
|
}
|
|
1623
|
-
async function
|
|
1631
|
+
async function An(e = []) {
|
|
1624
1632
|
return t(i, `${j}/seed`, {
|
|
1625
1633
|
method: "POST",
|
|
1626
1634
|
headers: { "Content-Type": "application/json" },
|
|
1627
1635
|
body: JSON.stringify({ collections: e })
|
|
1628
1636
|
});
|
|
1629
1637
|
}
|
|
1630
|
-
async function
|
|
1638
|
+
async function jn() {
|
|
1631
1639
|
let e = await t(i, `${j}/seed-status`), n = e?.data ?? e ?? {};
|
|
1632
1640
|
return {
|
|
1633
1641
|
modules: Array.isArray(n.modules) ? n.modules : [],
|
|
1634
1642
|
seededModules: n.seededModules ?? {}
|
|
1635
1643
|
};
|
|
1636
1644
|
}
|
|
1637
|
-
async function
|
|
1645
|
+
async function Mn(e) {
|
|
1638
1646
|
let t = localStorage.getItem("authToken"), n = new FormData();
|
|
1639
1647
|
n.append("icon", e);
|
|
1640
1648
|
let r = await fetch(`${i}/admin/field-config/action-icon`, {
|
|
@@ -1649,15 +1657,15 @@ async function jn(e) {
|
|
|
1649
1657
|
let a = await r.json();
|
|
1650
1658
|
return a.data ?? a;
|
|
1651
1659
|
}
|
|
1652
|
-
async function
|
|
1653
|
-
let [e, t] = await Promise.all([Nt().catch(() => []),
|
|
1660
|
+
async function Nn() {
|
|
1661
|
+
let [e, t] = await Promise.all([Nt().catch(() => []), Un().catch(() => [])]), n = Array.isArray(e) ? e : [], r = n.map((e) => typeof e == "string" ? e : e?.menuKey ?? e?.module ?? e?.key ?? e?.value ?? e?.name).filter(Boolean).map((e) => `${String(e).toLowerCase()}detail`);
|
|
1654
1662
|
return [
|
|
1655
1663
|
...n,
|
|
1656
1664
|
...Array.isArray(t) ? t : [],
|
|
1657
1665
|
...r
|
|
1658
1666
|
];
|
|
1659
1667
|
}
|
|
1660
|
-
async function
|
|
1668
|
+
async function Pn(e, { page: n = 1, limit: r = 100 } = {}) {
|
|
1661
1669
|
let a = await t(i, `/module/list?${new URLSearchParams({
|
|
1662
1670
|
module: e,
|
|
1663
1671
|
page: String(n),
|
|
@@ -1668,24 +1676,24 @@ async function Nn(e, { page: n = 1, limit: r = 100 } = {}) {
|
|
|
1668
1676
|
total: o.pagination?.total ?? 0
|
|
1669
1677
|
};
|
|
1670
1678
|
}
|
|
1671
|
-
async function
|
|
1679
|
+
async function Fn(e, n) {
|
|
1672
1680
|
return t(i, `/module/create?module=${encodeURIComponent(e)}`, {
|
|
1673
1681
|
method: "POST",
|
|
1674
1682
|
headers: { "Content-Type": "application/json" },
|
|
1675
1683
|
body: JSON.stringify(n)
|
|
1676
1684
|
});
|
|
1677
1685
|
}
|
|
1678
|
-
async function
|
|
1686
|
+
async function In(e, n, r) {
|
|
1679
1687
|
return t(i, `/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`, {
|
|
1680
1688
|
method: "PUT",
|
|
1681
1689
|
headers: { "Content-Type": "application/json" },
|
|
1682
1690
|
body: JSON.stringify(r)
|
|
1683
1691
|
});
|
|
1684
1692
|
}
|
|
1685
|
-
async function
|
|
1693
|
+
async function Ln(e, n) {
|
|
1686
1694
|
return t(i, `/module/delete/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1687
1695
|
}
|
|
1688
|
-
async function
|
|
1696
|
+
async function Rn(e = "", n = 50) {
|
|
1689
1697
|
let r = await t(i, `/admin/location-dropdown-values?${new URLSearchParams({
|
|
1690
1698
|
search: e,
|
|
1691
1699
|
limit: String(n),
|
|
@@ -1699,7 +1707,7 @@ async function Ln(e = "", n = 50) {
|
|
|
1699
1707
|
};
|
|
1700
1708
|
}).filter((e) => e.label);
|
|
1701
1709
|
}
|
|
1702
|
-
async function
|
|
1710
|
+
async function zn(e, n, r = "_id") {
|
|
1703
1711
|
let a = await t(i, `/admin/lookup-dropdown-values?${new URLSearchParams({
|
|
1704
1712
|
collection: String(e),
|
|
1705
1713
|
displayField: String(n),
|
|
@@ -1710,11 +1718,11 @@ async function Rn(e, n, r = "_id") {
|
|
|
1710
1718
|
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
1711
1719
|
})).filter((e) => e.value && e.label);
|
|
1712
1720
|
}
|
|
1713
|
-
async function
|
|
1721
|
+
async function Bn(e) {
|
|
1714
1722
|
let n = await t(i, `/admin/default-fields?module=${encodeURIComponent(e)}`), r = n?.data ?? n ?? {};
|
|
1715
1723
|
return Array.isArray(r.fields) ? r.fields : [];
|
|
1716
1724
|
}
|
|
1717
|
-
async function
|
|
1725
|
+
async function Vn(e, n, r) {
|
|
1718
1726
|
return t(i, "/admin/default-fields", {
|
|
1719
1727
|
method: "PUT",
|
|
1720
1728
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1725,7 +1733,7 @@ async function Bn(e, n, r) {
|
|
|
1725
1733
|
})
|
|
1726
1734
|
});
|
|
1727
1735
|
}
|
|
1728
|
-
async function
|
|
1736
|
+
async function Hn(e) {
|
|
1729
1737
|
let n = await t(i, "/email-verify", {
|
|
1730
1738
|
method: "POST",
|
|
1731
1739
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1743,23 +1751,23 @@ async function Vn(e) {
|
|
|
1743
1751
|
checks: Array.isArray(r.checks) ? r.checks : []
|
|
1744
1752
|
};
|
|
1745
1753
|
}
|
|
1746
|
-
async function
|
|
1754
|
+
async function Un() {
|
|
1747
1755
|
let e = await t(i, "/admin/lookup/collections"), n = e.data ?? e;
|
|
1748
1756
|
return Array.isArray(n) ? n : [];
|
|
1749
1757
|
}
|
|
1750
|
-
async function
|
|
1758
|
+
async function Wn(e) {
|
|
1751
1759
|
let n = await t(i, `/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`), r = n.data ?? n;
|
|
1752
1760
|
return Array.isArray(r) ? r : [];
|
|
1753
1761
|
}
|
|
1754
|
-
async function
|
|
1762
|
+
async function Gn(e, n) {
|
|
1755
1763
|
let r = await t(i, `/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(n)}`), a = r.data ?? r;
|
|
1756
1764
|
return Array.isArray(a?.fields) ? a.fields : [];
|
|
1757
1765
|
}
|
|
1758
|
-
async function
|
|
1766
|
+
async function Kn() {
|
|
1759
1767
|
let e = await t(i, "/admin/menu-modules");
|
|
1760
1768
|
return N(e.data, e);
|
|
1761
1769
|
}
|
|
1762
|
-
async function
|
|
1770
|
+
async function qn({ menuName: e, apiUrl: n = "", menuType: r = "menu", parentMenuId: a = 0, displayOrder: o = 0 }) {
|
|
1763
1771
|
let s = await t(i, "/admin/menu-modules", {
|
|
1764
1772
|
method: "POST",
|
|
1765
1773
|
body: JSON.stringify({
|
|
@@ -1772,22 +1780,22 @@ async function Kn({ menuName: e, apiUrl: n = "", menuType: r = "menu", parentMen
|
|
|
1772
1780
|
});
|
|
1773
1781
|
return s.data ?? s;
|
|
1774
1782
|
}
|
|
1775
|
-
async function
|
|
1783
|
+
async function Jn(e, { menuName: n }) {
|
|
1776
1784
|
let r = await t(i, `/admin/menu-modules/${e}`, {
|
|
1777
1785
|
method: "PUT",
|
|
1778
1786
|
body: JSON.stringify({ menuName: n })
|
|
1779
1787
|
});
|
|
1780
1788
|
return r.data ?? r;
|
|
1781
1789
|
}
|
|
1782
|
-
async function
|
|
1790
|
+
async function Yn(e) {
|
|
1783
1791
|
let n = await t(i, `/admin/menu-modules/${e}`, { method: "DELETE" });
|
|
1784
1792
|
return n.data ?? n;
|
|
1785
1793
|
}
|
|
1786
|
-
async function
|
|
1794
|
+
async function Xn() {
|
|
1787
1795
|
let e = await t(i, "/admin/menu-actions");
|
|
1788
1796
|
return N(e.data, e);
|
|
1789
1797
|
}
|
|
1790
|
-
async function
|
|
1798
|
+
async function Zn({ permissionName: e, permissionKey: n }) {
|
|
1791
1799
|
let r = await t(i, "/admin/menu-actions", {
|
|
1792
1800
|
method: "POST",
|
|
1793
1801
|
body: JSON.stringify({
|
|
@@ -1797,22 +1805,22 @@ async function Xn({ permissionName: e, permissionKey: n }) {
|
|
|
1797
1805
|
});
|
|
1798
1806
|
return r.data ?? r;
|
|
1799
1807
|
}
|
|
1800
|
-
async function
|
|
1808
|
+
async function Qn(e, { permissionName: n }) {
|
|
1801
1809
|
let r = await t(i, `/admin/menu-actions/${e}`, {
|
|
1802
1810
|
method: "PUT",
|
|
1803
1811
|
body: JSON.stringify({ permissionName: n })
|
|
1804
1812
|
});
|
|
1805
1813
|
return r.data ?? r;
|
|
1806
1814
|
}
|
|
1807
|
-
async function
|
|
1815
|
+
async function $n(e) {
|
|
1808
1816
|
let n = await t(i, `/admin/menu-actions/${e}`, { method: "DELETE" });
|
|
1809
1817
|
return n.data ?? n;
|
|
1810
1818
|
}
|
|
1811
|
-
async function
|
|
1819
|
+
async function er(e) {
|
|
1812
1820
|
let n = await t(i, `/get-role-details?roleid=${e}`);
|
|
1813
1821
|
return n?.data ?? n ?? {};
|
|
1814
1822
|
}
|
|
1815
|
-
async function
|
|
1823
|
+
async function tr(e, n) {
|
|
1816
1824
|
return t(i, "/edit-role-details", {
|
|
1817
1825
|
method: "PUT",
|
|
1818
1826
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1823,39 +1831,39 @@ async function er(e, n) {
|
|
|
1823
1831
|
});
|
|
1824
1832
|
}
|
|
1825
1833
|
var R = "/admin/custom-forms";
|
|
1826
|
-
async function
|
|
1834
|
+
async function nr(e = "", n = "", r = "") {
|
|
1827
1835
|
let a = new URLSearchParams();
|
|
1828
1836
|
e && a.append("module", e), n && a.append("formType", n), r && a.append("action", r);
|
|
1829
1837
|
let o = await t(i, `${R}?${a.toString()}`), s = o?.data;
|
|
1830
1838
|
return Array.isArray(s) ? s : Array.isArray(o) ? o : [];
|
|
1831
1839
|
}
|
|
1832
|
-
async function
|
|
1840
|
+
async function rr(e) {
|
|
1833
1841
|
return t(i, R, {
|
|
1834
1842
|
method: "POST",
|
|
1835
1843
|
headers: { "Content-Type": "application/json" },
|
|
1836
1844
|
body: JSON.stringify(e)
|
|
1837
1845
|
});
|
|
1838
1846
|
}
|
|
1839
|
-
async function
|
|
1847
|
+
async function ir(e, n) {
|
|
1840
1848
|
return t(i, `${R}/${e}`, {
|
|
1841
1849
|
method: "PUT",
|
|
1842
1850
|
headers: { "Content-Type": "application/json" },
|
|
1843
1851
|
body: JSON.stringify(n)
|
|
1844
1852
|
});
|
|
1845
1853
|
}
|
|
1846
|
-
async function
|
|
1854
|
+
async function ar(e) {
|
|
1847
1855
|
return t(i, `${R}/${e}`, { method: "DELETE" });
|
|
1848
1856
|
}
|
|
1849
1857
|
var z = "/admin/row-action-config";
|
|
1850
|
-
function
|
|
1858
|
+
function or(e) {
|
|
1851
1859
|
return String(e ?? "").trim().toLowerCase();
|
|
1852
1860
|
}
|
|
1853
|
-
async function
|
|
1854
|
-
let n =
|
|
1861
|
+
async function sr(e = "") {
|
|
1862
|
+
let n = or(e), r = await t(i, n ? `${z}?module=${encodeURIComponent(n)}` : z), a = r?.data;
|
|
1855
1863
|
return Array.isArray(a) ? a : Array.isArray(r) ? r : [];
|
|
1856
1864
|
}
|
|
1857
|
-
async function
|
|
1858
|
-
let a =
|
|
1865
|
+
async function cr({ module: e, roleId: n = 0, rowActions: r = [] }) {
|
|
1866
|
+
let a = or(e);
|
|
1859
1867
|
return t(i, z, {
|
|
1860
1868
|
method: "POST",
|
|
1861
1869
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1866,22 +1874,22 @@ async function sr({ module: e, roleId: n = 0, rowActions: r = [] }) {
|
|
|
1866
1874
|
})
|
|
1867
1875
|
});
|
|
1868
1876
|
}
|
|
1869
|
-
async function
|
|
1877
|
+
async function lr(e, n = []) {
|
|
1870
1878
|
return t(i, `${z}/${e}`, {
|
|
1871
1879
|
method: "PUT",
|
|
1872
1880
|
headers: { "Content-Type": "application/json" },
|
|
1873
1881
|
body: JSON.stringify({ rowActions: n })
|
|
1874
1882
|
});
|
|
1875
1883
|
}
|
|
1876
|
-
async function
|
|
1884
|
+
async function ur(e) {
|
|
1877
1885
|
return t(i, `${z}/${e}`, { method: "DELETE" });
|
|
1878
1886
|
}
|
|
1879
1887
|
var B = "/admin/module-action-rules";
|
|
1880
|
-
async function
|
|
1888
|
+
async function dr(e) {
|
|
1881
1889
|
let n = await t(i, `${B}?module=${encodeURIComponent(e)}`), r = n?.data;
|
|
1882
1890
|
return Array.isArray(r) ? r : Array.isArray(n) ? n : [];
|
|
1883
1891
|
}
|
|
1884
|
-
async function
|
|
1892
|
+
async function fr({ module: e, name: n, description: r = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1885
1893
|
return t(i, B, {
|
|
1886
1894
|
method: "POST",
|
|
1887
1895
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1896,7 +1904,7 @@ async function dr({ module: e, name: n, description: r = "", conditions: a = [],
|
|
|
1896
1904
|
})
|
|
1897
1905
|
});
|
|
1898
1906
|
}
|
|
1899
|
-
async function
|
|
1907
|
+
async function pr(e, { name: n, description: r = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1900
1908
|
return t(i, `${B}/${e}`, {
|
|
1901
1909
|
method: "PUT",
|
|
1902
1910
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1910,17 +1918,17 @@ async function fr(e, { name: n, description: r = "", conditions: a = [], blocked
|
|
|
1910
1918
|
})
|
|
1911
1919
|
});
|
|
1912
1920
|
}
|
|
1913
|
-
async function
|
|
1921
|
+
async function mr(e) {
|
|
1914
1922
|
return t(i, `${B}/${e}`, { method: "DELETE" });
|
|
1915
1923
|
}
|
|
1916
1924
|
//#endregion
|
|
1917
1925
|
//#region src/services/detailedViewApi.js
|
|
1918
|
-
var
|
|
1926
|
+
var hr = {
|
|
1919
1927
|
job: { fetchUrl: (t) => `${e}/edit/detailed-view/${encodeURIComponent(t)}` },
|
|
1920
1928
|
candidates: { fetchUrl: (e) => `${o}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
1921
1929
|
submission: { fetchUrl: (e) => `${a}/edit/detailed-view?_id=${encodeURIComponent(e)}` }
|
|
1922
1930
|
};
|
|
1923
|
-
async function
|
|
1931
|
+
async function gr(e, n) {
|
|
1924
1932
|
let r = String(e ?? "").trim().toLowerCase();
|
|
1925
1933
|
if (r === "job" || r === "jobs") {
|
|
1926
1934
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
@@ -1931,17 +1939,17 @@ async function hr(e, n) {
|
|
|
1931
1939
|
id: String(n)
|
|
1932
1940
|
}).toString()}`);
|
|
1933
1941
|
}
|
|
1934
|
-
async function
|
|
1942
|
+
async function _r(e) {
|
|
1935
1943
|
let n = await t(i, `/module-actions?module=${encodeURIComponent(e)}`), r = n?.data ?? n ?? {};
|
|
1936
1944
|
return {
|
|
1937
1945
|
actions: Array.isArray(r.actions) ? r.actions : [],
|
|
1938
1946
|
actionRules: Array.isArray(r.actionRules) ? r.actionRules : []
|
|
1939
1947
|
};
|
|
1940
1948
|
}
|
|
1941
|
-
async function
|
|
1949
|
+
async function vr(e, t) {
|
|
1942
1950
|
if (!e) throw Error("module is required");
|
|
1943
1951
|
if (!t) throw Error("id is required");
|
|
1944
|
-
let r =
|
|
1952
|
+
let r = hr[e];
|
|
1945
1953
|
if (!r) throw Error(`No edit config for module: ${e}`);
|
|
1946
1954
|
let i = await n(), a = await fetch(r.fetchUrl(t), {
|
|
1947
1955
|
method: "GET",
|
|
@@ -1954,7 +1962,7 @@ async function _r(e, t) {
|
|
|
1954
1962
|
let o = await a.json();
|
|
1955
1963
|
return o.data ?? o;
|
|
1956
1964
|
}
|
|
1957
|
-
async function
|
|
1965
|
+
async function yr(e, t, r, a = []) {
|
|
1958
1966
|
if (!e) throw Error("module is required");
|
|
1959
1967
|
if (!t) throw Error("id is required");
|
|
1960
1968
|
let o = await n(), s = new FormData();
|
|
@@ -1971,22 +1979,22 @@ async function vr(e, t, r, a = []) {
|
|
|
1971
1979
|
let l = await c.json();
|
|
1972
1980
|
return l.data ?? l;
|
|
1973
1981
|
}
|
|
1974
|
-
var
|
|
1975
|
-
async function
|
|
1982
|
+
var br = (e) => e?.data ?? e;
|
|
1983
|
+
async function xr(e, n) {
|
|
1976
1984
|
if (!e || !n) return [];
|
|
1977
|
-
let r =
|
|
1985
|
+
let r = br(await t(i, `/module-activity?${new URLSearchParams({
|
|
1978
1986
|
module: e,
|
|
1979
1987
|
id: String(n)
|
|
1980
1988
|
}).toString()}`));
|
|
1981
1989
|
return Array.isArray(r) ? r : [];
|
|
1982
1990
|
}
|
|
1983
|
-
async function
|
|
1991
|
+
async function Sr(e) {
|
|
1984
1992
|
if (!e) return [];
|
|
1985
|
-
let n =
|
|
1993
|
+
let n = br(await t(i, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
1986
1994
|
return Array.isArray(n) ? n : [];
|
|
1987
1995
|
}
|
|
1988
|
-
async function
|
|
1989
|
-
return
|
|
1996
|
+
async function Cr({ relatedId: e, notes: n, title: r, notesFor: a }) {
|
|
1997
|
+
return br(await t(i, "/notes", {
|
|
1990
1998
|
method: "POST",
|
|
1991
1999
|
body: JSON.stringify({
|
|
1992
2000
|
relatedId: e,
|
|
@@ -1998,7 +2006,7 @@ async function Sr({ relatedId: e, notes: n, title: r, notesFor: a }) {
|
|
|
1998
2006
|
}
|
|
1999
2007
|
//#endregion
|
|
2000
2008
|
//#region src/services/detailDefaults.js
|
|
2001
|
-
var
|
|
2009
|
+
var wr = Object.freeze({
|
|
2002
2010
|
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
2003
2011
|
dateFormat: "DD MMM YYYY",
|
|
2004
2012
|
booleanTrueLabel: "Yes",
|
|
@@ -2013,16 +2021,16 @@ var Cr = Object.freeze({
|
|
|
2013
2021
|
"uniqueName"
|
|
2014
2022
|
],
|
|
2015
2023
|
phoneFormat: "3-3-4"
|
|
2016
|
-
}), V = { ...
|
|
2017
|
-
function
|
|
2024
|
+
}), V = { ...wr }, Tr = null;
|
|
2025
|
+
function Er() {
|
|
2018
2026
|
return V;
|
|
2019
2027
|
}
|
|
2020
|
-
function
|
|
2028
|
+
function Dr(e) {
|
|
2021
2029
|
if (!e || typeof e != "object") return {};
|
|
2022
2030
|
let t = {};
|
|
2023
2031
|
return e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), typeof e.separator == "string" && e.separator !== "" && (t.separator = e.separator), typeof e.phoneFormat == "string" && e.phoneFormat.trim() !== "" && (t.phoneFormat = e.phoneFormat.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), t;
|
|
2024
2032
|
}
|
|
2025
|
-
function
|
|
2033
|
+
function Or(e = kr()) {
|
|
2026
2034
|
let t = (String(e).match(/\d+/g) ?? [
|
|
2027
2035
|
"3",
|
|
2028
2036
|
"3",
|
|
@@ -2038,15 +2046,15 @@ function Dr(e = Or()) {
|
|
|
2038
2046
|
total: r.reduce((e, t) => e + t, 0)
|
|
2039
2047
|
};
|
|
2040
2048
|
}
|
|
2041
|
-
function
|
|
2042
|
-
return V.phoneFormat ||
|
|
2049
|
+
function kr() {
|
|
2050
|
+
return V.phoneFormat || wr.phoneFormat;
|
|
2043
2051
|
}
|
|
2044
|
-
function
|
|
2045
|
-
let { total: n } =
|
|
2052
|
+
function Ar(e, t = kr()) {
|
|
2053
|
+
let { total: n } = Or(t);
|
|
2046
2054
|
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
2047
2055
|
}
|
|
2048
|
-
function
|
|
2049
|
-
let { groups: n, sep: r } =
|
|
2056
|
+
function jr(e, t = kr()) {
|
|
2057
|
+
let { groups: n, sep: r } = Or(t), i = Ar(e, t);
|
|
2050
2058
|
if (!i) return "";
|
|
2051
2059
|
let a = [], o = 0;
|
|
2052
2060
|
for (let e of n) {
|
|
@@ -2055,30 +2063,30 @@ function Ar(e, t = Or()) {
|
|
|
2055
2063
|
}
|
|
2056
2064
|
return a.join(r);
|
|
2057
2065
|
}
|
|
2058
|
-
function
|
|
2066
|
+
function Mr(e) {
|
|
2059
2067
|
return V = {
|
|
2060
2068
|
...V,
|
|
2061
|
-
...
|
|
2069
|
+
...Dr(e)
|
|
2062
2070
|
}, V;
|
|
2063
2071
|
}
|
|
2064
|
-
function
|
|
2065
|
-
return
|
|
2072
|
+
function Nr(e = !1) {
|
|
2073
|
+
return Tr && !e || (Tr = Jt().then((e) => Mr(e)).catch(() => V)), Tr;
|
|
2066
2074
|
}
|
|
2067
2075
|
//#endregion
|
|
2068
2076
|
//#region src/utils/roleFormPermissionGate.js
|
|
2069
|
-
function
|
|
2077
|
+
function Pr(e, t) {
|
|
2070
2078
|
if (!e) return !0;
|
|
2071
2079
|
let n = e.find((e) => e.name === t);
|
|
2072
2080
|
return n ? n.enabled !== !1 : !0;
|
|
2073
2081
|
}
|
|
2074
|
-
function
|
|
2082
|
+
function Fr(e, t, n) {
|
|
2075
2083
|
if (!e) return !0;
|
|
2076
2084
|
let r = e.find((e) => e.name === t);
|
|
2077
2085
|
if (!r) return !0;
|
|
2078
2086
|
let i = r.fields?.find((e) => e.field === n);
|
|
2079
2087
|
return i ? i.enabled !== !1 : !0;
|
|
2080
2088
|
}
|
|
2081
|
-
function
|
|
2089
|
+
function Ir(e, t, n) {
|
|
2082
2090
|
if (!e) return !0;
|
|
2083
2091
|
let r = e.find((e) => e.name === t);
|
|
2084
2092
|
if (!r) return !0;
|
|
@@ -2088,7 +2096,7 @@ function Fr(e, t, n) {
|
|
|
2088
2096
|
}
|
|
2089
2097
|
//#endregion
|
|
2090
2098
|
//#region src/components/form/inputSecurity.js
|
|
2091
|
-
var
|
|
2099
|
+
var Lr = [
|
|
2092
2100
|
"p",
|
|
2093
2101
|
"br",
|
|
2094
2102
|
"strong",
|
|
@@ -2110,12 +2118,12 @@ var Ir = [
|
|
|
2110
2118
|
"a",
|
|
2111
2119
|
"code",
|
|
2112
2120
|
"pre"
|
|
2113
|
-
],
|
|
2121
|
+
], Rr = [
|
|
2114
2122
|
"href",
|
|
2115
2123
|
"title",
|
|
2116
2124
|
"target",
|
|
2117
2125
|
"rel"
|
|
2118
|
-
],
|
|
2126
|
+
], zr = /[\u200B-\u200D\u2060\uFEFF]/g, Br = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, Vr = /^[\p{L}\p{M}\p{N} .'-]+$/u, Hr = /^\+?[0-9 ()-]+$/, Ur = /^-?(?:\d+|\d*\.\d+)$/, Wr = [
|
|
2119
2127
|
{
|
|
2120
2128
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta)\b/i,
|
|
2121
2129
|
message: "HTML/script content is not allowed"
|
|
@@ -2149,12 +2157,12 @@ var Ir = [
|
|
|
2149
2157
|
message: "Command execution patterns are not allowed"
|
|
2150
2158
|
}
|
|
2151
2159
|
];
|
|
2152
|
-
function
|
|
2160
|
+
function Gr(e) {
|
|
2153
2161
|
if (typeof document > "u") return e;
|
|
2154
2162
|
let t = document.createElement("textarea");
|
|
2155
2163
|
return t.innerHTML = e, t.value;
|
|
2156
2164
|
}
|
|
2157
|
-
function
|
|
2165
|
+
function Kr(e) {
|
|
2158
2166
|
let t = String(e ?? "");
|
|
2159
2167
|
for (let e = 0; e < 2; e += 1) try {
|
|
2160
2168
|
let e = decodeURIComponent(t);
|
|
@@ -2163,12 +2171,12 @@ function Gr(e) {
|
|
|
2163
2171
|
} catch {
|
|
2164
2172
|
break;
|
|
2165
2173
|
}
|
|
2166
|
-
return t =
|
|
2174
|
+
return t = Gr(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2167
2175
|
}
|
|
2168
|
-
function
|
|
2176
|
+
function qr(e) {
|
|
2169
2177
|
return Ce.sanitize(String(e ?? ""), {
|
|
2170
|
-
ALLOWED_TAGS:
|
|
2171
|
-
ALLOWED_ATTR:
|
|
2178
|
+
ALLOWED_TAGS: Lr,
|
|
2179
|
+
ALLOWED_ATTR: Rr,
|
|
2172
2180
|
ALLOW_DATA_ATTR: !1,
|
|
2173
2181
|
FORBID_TAGS: [
|
|
2174
2182
|
"script",
|
|
@@ -2188,40 +2196,40 @@ function Kr(e) {
|
|
|
2188
2196
|
]
|
|
2189
2197
|
});
|
|
2190
2198
|
}
|
|
2191
|
-
function
|
|
2199
|
+
function Jr(e) {
|
|
2192
2200
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2193
2201
|
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
2194
2202
|
}
|
|
2195
|
-
function
|
|
2203
|
+
function Yr(e) {
|
|
2196
2204
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2197
2205
|
}
|
|
2198
|
-
function
|
|
2206
|
+
function Xr(e, t = {}) {
|
|
2199
2207
|
if (typeof e != "string") return e;
|
|
2200
|
-
if (t.type === "text-editor") return
|
|
2201
|
-
let n = e.normalize("NFC").replace(
|
|
2202
|
-
return n =
|
|
2208
|
+
if (t.type === "text-editor") return qr(e.normalize("NFC"));
|
|
2209
|
+
let n = e.normalize("NFC").replace(zr, "").replace(/\u00A0/g, " ").replace(Br, "");
|
|
2210
|
+
return n = Yr(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2203
2211
|
}
|
|
2204
|
-
function
|
|
2212
|
+
function Zr(e, t = {}) {
|
|
2205
2213
|
if (typeof e != "string" || e === "") return null;
|
|
2206
|
-
let n = t.label || t.field || "Field", r =
|
|
2214
|
+
let n = t.label || t.field || "Field", r = Kr(e);
|
|
2207
2215
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2208
2216
|
if (t.type !== "text-editor") {
|
|
2209
|
-
let e =
|
|
2217
|
+
let e = Wr.find(({ re: e }) => e.test(r));
|
|
2210
2218
|
if (e) return `${n}: ${e.message}`;
|
|
2211
2219
|
} else {
|
|
2212
|
-
let e =
|
|
2220
|
+
let e = Wr.slice(0, 3).find(({ re: e }) => e.test(r));
|
|
2213
2221
|
if (e) return `${n}: ${e.message}`;
|
|
2214
2222
|
}
|
|
2215
|
-
let i =
|
|
2216
|
-
return [...i].length >
|
|
2223
|
+
let i = Xr(e, t);
|
|
2224
|
+
return [...i].length > Jr(t) ? `${n} is too long` : t.formatter === "name" && i && !Vr.test(i) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && i && !Hr.test(i) ? `${n} contains invalid phone characters` : t.type === "number" && i && !Ur.test(i) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && i && !/^https?:\/\//i.test(i) ? `${n} must use http:// or https://` : null;
|
|
2217
2225
|
}
|
|
2218
|
-
function
|
|
2226
|
+
function Qr(e) {
|
|
2219
2227
|
return { validator: (t, n) => {
|
|
2220
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2228
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Zr(t, e)).find(Boolean);
|
|
2221
2229
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2222
2230
|
} };
|
|
2223
2231
|
}
|
|
2224
|
-
function
|
|
2232
|
+
function $r(e = []) {
|
|
2225
2233
|
let t = /* @__PURE__ */ new Map();
|
|
2226
2234
|
return e.forEach((e) => {
|
|
2227
2235
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2233,12 +2241,12 @@ function Qr(e = []) {
|
|
|
2233
2241
|
});
|
|
2234
2242
|
}), t;
|
|
2235
2243
|
}
|
|
2236
|
-
function
|
|
2237
|
-
let n =
|
|
2244
|
+
function ei(e, t = []) {
|
|
2245
|
+
let n = $r(t), r = (e, t = "") => {
|
|
2238
2246
|
if (typeof e == "string") {
|
|
2239
|
-
let r = n.get(t) ?? {}, i =
|
|
2247
|
+
let r = n.get(t) ?? {}, i = Zr(e, r);
|
|
2240
2248
|
if (i) throw Error(i);
|
|
2241
|
-
return
|
|
2249
|
+
return Xr(e, r);
|
|
2242
2250
|
}
|
|
2243
2251
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2244
2252
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2249,15 +2257,15 @@ function $r(e, t = []) {
|
|
|
2249
2257
|
}
|
|
2250
2258
|
//#endregion
|
|
2251
2259
|
//#region src/components/form/payloadTransformer.js
|
|
2252
|
-
var H = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2253
|
-
function ti(e) {
|
|
2254
|
-
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2255
|
-
}
|
|
2260
|
+
var H = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, ti = (e) => e === !0 || e === 1 || e === "1", U = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !ni(e);
|
|
2256
2261
|
function ni(e) {
|
|
2257
|
-
return
|
|
2262
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2258
2263
|
}
|
|
2259
2264
|
function ri(e) {
|
|
2260
|
-
return
|
|
2265
|
+
return ni(e) || e instanceof Date;
|
|
2266
|
+
}
|
|
2267
|
+
function ii(e) {
|
|
2268
|
+
return e instanceof Date ? e.toISOString() : ni(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2261
2269
|
}
|
|
2262
2270
|
function W(e, t) {
|
|
2263
2271
|
if (!t) return;
|
|
@@ -2282,18 +2290,18 @@ function q(e, t, n) {
|
|
|
2282
2290
|
}
|
|
2283
2291
|
return i[r[r.length - 1]] = n, e;
|
|
2284
2292
|
}
|
|
2285
|
-
function
|
|
2293
|
+
function ai(e, t) {
|
|
2286
2294
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2287
|
-
U(n) && U(e[t]) ?
|
|
2295
|
+
U(n) && U(e[t]) ? ai(e[t], n) : e[t] = n;
|
|
2288
2296
|
}), e;
|
|
2289
2297
|
}
|
|
2290
|
-
function
|
|
2298
|
+
function oi(e, t) {
|
|
2291
2299
|
let n = e.options ?? e.values ?? [];
|
|
2292
2300
|
for (let e of n) if (typeof e == "string") {
|
|
2293
2301
|
if (e === t) return e;
|
|
2294
2302
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2295
2303
|
}
|
|
2296
|
-
function
|
|
2304
|
+
function si(e, t) {
|
|
2297
2305
|
if (U(e)) {
|
|
2298
2306
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2299
2307
|
return {
|
|
@@ -2303,10 +2311,10 @@ function oi(e, t) {
|
|
|
2303
2311
|
}
|
|
2304
2312
|
return {
|
|
2305
2313
|
value: e,
|
|
2306
|
-
label:
|
|
2314
|
+
label: oi(t, e) ?? e
|
|
2307
2315
|
};
|
|
2308
2316
|
}
|
|
2309
|
-
function
|
|
2317
|
+
function ci(e = {}) {
|
|
2310
2318
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2311
2319
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2312
2320
|
switch (e.type) {
|
|
@@ -2317,13 +2325,13 @@ function si(e = {}) {
|
|
|
2317
2325
|
}
|
|
2318
2326
|
}
|
|
2319
2327
|
function J(e, t, n = {}) {
|
|
2320
|
-
if (
|
|
2321
|
-
if (t === "string") return
|
|
2328
|
+
if (ri(e)) {
|
|
2329
|
+
if (t === "string") return ii(e);
|
|
2322
2330
|
if (t === "number") {
|
|
2323
|
-
let t =
|
|
2331
|
+
let t = ni(e) ? e.valueOf() : e.getTime();
|
|
2324
2332
|
return Number.isNaN(t) ? null : t;
|
|
2325
2333
|
}
|
|
2326
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2334
|
+
if (t === "date" || t === "auto" || !t) return ii(e);
|
|
2327
2335
|
}
|
|
2328
2336
|
switch (t) {
|
|
2329
2337
|
case "string": return e == null ? "" : String(e);
|
|
@@ -2338,14 +2346,14 @@ function J(e, t, n = {}) {
|
|
|
2338
2346
|
return t = Array.isArray(e) ? e : H(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => J(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2339
2347
|
}
|
|
2340
2348
|
case "object": return U(e), e;
|
|
2341
|
-
case "date": return
|
|
2349
|
+
case "date": return ii(e);
|
|
2342
2350
|
case "custom":
|
|
2343
2351
|
case "auto":
|
|
2344
2352
|
case void 0:
|
|
2345
2353
|
default: return e;
|
|
2346
2354
|
}
|
|
2347
2355
|
}
|
|
2348
|
-
var
|
|
2356
|
+
var li = {
|
|
2349
2357
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2350
2358
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2351
2359
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2353,11 +2361,11 @@ var ci = {
|
|
|
2353
2361
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2354
2362
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2355
2363
|
};
|
|
2356
|
-
function
|
|
2364
|
+
function ui(e, t) {
|
|
2357
2365
|
if (!t) return e;
|
|
2358
2366
|
let n = t;
|
|
2359
2367
|
if (typeof n == "string") {
|
|
2360
|
-
if (
|
|
2368
|
+
if (li[n]) return li[n](e);
|
|
2361
2369
|
try {
|
|
2362
2370
|
n = JSON.parse(n);
|
|
2363
2371
|
} catch {
|
|
@@ -2365,14 +2373,14 @@ function li(e, t) {
|
|
|
2365
2373
|
}
|
|
2366
2374
|
}
|
|
2367
2375
|
let r = e;
|
|
2368
|
-
if (n.name &&
|
|
2376
|
+
if (n.name && li[n.name] && (r = li[n.name](r)), n.map && typeof n.map == "object") {
|
|
2369
2377
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2370
2378
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2371
2379
|
}
|
|
2372
2380
|
return r;
|
|
2373
2381
|
}
|
|
2374
|
-
var
|
|
2375
|
-
function
|
|
2382
|
+
var di = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2383
|
+
function fi(e, t) {
|
|
2376
2384
|
let [n, ...r] = e.split("."), i;
|
|
2377
2385
|
if (n === "value") i = t.value;
|
|
2378
2386
|
else if (n === "label") i = t.label;
|
|
@@ -2380,24 +2388,24 @@ function di(e, t) {
|
|
|
2380
2388
|
else return;
|
|
2381
2389
|
return r.length ? W(i, r.join(".")) : i;
|
|
2382
2390
|
}
|
|
2383
|
-
function
|
|
2391
|
+
function pi(e, t) {
|
|
2384
2392
|
if (typeof e == "string") {
|
|
2385
2393
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2386
|
-
return n ?
|
|
2387
|
-
let r =
|
|
2394
|
+
return n ? fi(n[1], t) : e.replace(di, (e, n) => {
|
|
2395
|
+
let r = fi(n, t);
|
|
2388
2396
|
return r == null ? "" : String(r);
|
|
2389
2397
|
});
|
|
2390
2398
|
}
|
|
2391
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2399
|
+
if (Array.isArray(e)) return e.map((e) => pi(e, t));
|
|
2392
2400
|
if (U(e)) {
|
|
2393
2401
|
let n = {};
|
|
2394
2402
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2395
|
-
n[e] =
|
|
2403
|
+
n[e] = pi(r, t);
|
|
2396
2404
|
}), n;
|
|
2397
2405
|
}
|
|
2398
2406
|
return e;
|
|
2399
2407
|
}
|
|
2400
|
-
function
|
|
2408
|
+
function mi(e) {
|
|
2401
2409
|
if (!e) return null;
|
|
2402
2410
|
if (typeof e == "string") try {
|
|
2403
2411
|
return JSON.parse(e);
|
|
@@ -2406,8 +2414,8 @@ function pi(e) {
|
|
|
2406
2414
|
}
|
|
2407
2415
|
return e;
|
|
2408
2416
|
}
|
|
2409
|
-
function
|
|
2410
|
-
let n = e.payloadMode || "auto", r =
|
|
2417
|
+
function hi(e, t) {
|
|
2418
|
+
let n = e.payloadMode || "auto", r = ci(e), { value: i, label: a } = si(t, e);
|
|
2411
2419
|
switch (n) {
|
|
2412
2420
|
case "value": return {
|
|
2413
2421
|
kind: "scalar",
|
|
@@ -2429,12 +2437,12 @@ function mi(e, t) {
|
|
|
2429
2437
|
}
|
|
2430
2438
|
case "custom":
|
|
2431
2439
|
case "template": {
|
|
2432
|
-
let n =
|
|
2440
|
+
let n = mi(e.payloadTemplate);
|
|
2433
2441
|
if (!n) return {
|
|
2434
2442
|
kind: "scalar",
|
|
2435
2443
|
out: J(i, r, e)
|
|
2436
2444
|
};
|
|
2437
|
-
let o =
|
|
2445
|
+
let o = pi(n, {
|
|
2438
2446
|
value: J(i, e.elementType || "auto", {}),
|
|
2439
2447
|
label: a,
|
|
2440
2448
|
raw: t
|
|
@@ -2450,15 +2458,15 @@ function mi(e, t) {
|
|
|
2450
2458
|
};
|
|
2451
2459
|
}
|
|
2452
2460
|
}
|
|
2453
|
-
function
|
|
2461
|
+
function gi(e, t) {
|
|
2454
2462
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2455
2463
|
let n = t;
|
|
2456
|
-
return H(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n =
|
|
2464
|
+
return H(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = ui(n, e.transformRule), H(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (ci(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2457
2465
|
kind: "scalar",
|
|
2458
|
-
out: n.map((t) =>
|
|
2459
|
-
} :
|
|
2466
|
+
out: n.map((t) => hi(e, t).out)
|
|
2467
|
+
} : hi(e, n);
|
|
2460
2468
|
}
|
|
2461
|
-
function
|
|
2469
|
+
function _i(e = {}) {
|
|
2462
2470
|
return !!e.richValue || [
|
|
2463
2471
|
"label",
|
|
2464
2472
|
"object",
|
|
@@ -2466,8 +2474,8 @@ function gi(e = {}) {
|
|
|
2466
2474
|
"template"
|
|
2467
2475
|
].includes(e.payloadMode);
|
|
2468
2476
|
}
|
|
2469
|
-
function
|
|
2470
|
-
if (!
|
|
2477
|
+
function vi(e, t, n = []) {
|
|
2478
|
+
if (!_i(e) || t == null) return t;
|
|
2471
2479
|
let r = (e) => {
|
|
2472
2480
|
if (U(e) && e.value !== void 0) return e;
|
|
2473
2481
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2478,7 +2486,7 @@ function _i(e, t, n = []) {
|
|
|
2478
2486
|
};
|
|
2479
2487
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2480
2488
|
}
|
|
2481
|
-
function
|
|
2489
|
+
function yi(e, t, n) {
|
|
2482
2490
|
if (!e?.field) return !0;
|
|
2483
2491
|
let r = K(t, e.field) ? G(t, e.field) : G(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2484
2492
|
switch (e.operator) {
|
|
@@ -2492,25 +2500,25 @@ function vi(e, t, n) {
|
|
|
2492
2500
|
default: return !0;
|
|
2493
2501
|
}
|
|
2494
2502
|
}
|
|
2495
|
-
function
|
|
2503
|
+
function bi(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2496
2504
|
if (!e?.showIf?.field || i.has(e.field)) return !0;
|
|
2497
|
-
if (i.add(e.field), !
|
|
2505
|
+
if (i.add(e.field), !yi(e.showIf, t, n)) return !1;
|
|
2498
2506
|
let a = r?.get?.(e.showIf.field);
|
|
2499
|
-
return a ?
|
|
2507
|
+
return a ? bi(a, t, n, r, i) : !0;
|
|
2500
2508
|
}
|
|
2501
|
-
function
|
|
2509
|
+
function xi(e = []) {
|
|
2502
2510
|
let t = /* @__PURE__ */ new Map();
|
|
2503
2511
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2504
2512
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2505
2513
|
})), t;
|
|
2506
2514
|
}
|
|
2507
|
-
function
|
|
2515
|
+
function Si(e = {}, { editing: t = !1 } = {}) {
|
|
2508
2516
|
let n = {};
|
|
2509
2517
|
return (e.fields ?? []).forEach((e) => {
|
|
2510
2518
|
!e.field || e.type === "file" || t && !e.defaultOnEdit || e.defaultValue === void 0 || e.defaultValue === "" || (n[e.field] = e.defaultValue);
|
|
2511
2519
|
}), n;
|
|
2512
2520
|
}
|
|
2513
|
-
function
|
|
2521
|
+
function Ci(e = []) {
|
|
2514
2522
|
let t = [];
|
|
2515
2523
|
return e.forEach((e) => {
|
|
2516
2524
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2521,17 +2529,17 @@ function Si(e = []) {
|
|
|
2521
2529
|
});
|
|
2522
2530
|
}), t;
|
|
2523
2531
|
}
|
|
2524
|
-
function
|
|
2525
|
-
return
|
|
2532
|
+
function wi(e = []) {
|
|
2533
|
+
return Ci(e).map(({ field: e }) => e).filter((e) => e.type === "file");
|
|
2526
2534
|
}
|
|
2527
|
-
function
|
|
2535
|
+
function Ti(e) {
|
|
2528
2536
|
return String(e ?? "").trim().toLowerCase();
|
|
2529
2537
|
}
|
|
2530
|
-
function
|
|
2531
|
-
return !!t &&
|
|
2538
|
+
function Ei(e, t) {
|
|
2539
|
+
return !!t && Ti(e.moduleName) === t;
|
|
2532
2540
|
}
|
|
2533
|
-
function
|
|
2534
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2541
|
+
function Di(e, t = [], n = {}) {
|
|
2542
|
+
let r = [], i = n.scope ?? "all", a = Ti(n.module), o = (e, t) => {
|
|
2535
2543
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2536
2544
|
let n = t?.originFileObj || t;
|
|
2537
2545
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2543,7 +2551,7 @@ function Ei(e, t = [], n = {}) {
|
|
|
2543
2551
|
return (t ?? []).forEach((t) => {
|
|
2544
2552
|
let r = (t.fields ?? []).filter((e) => e.type === "file");
|
|
2545
2553
|
if (!r.length) return;
|
|
2546
|
-
let s = t.moduleName && !
|
|
2554
|
+
let s = t.moduleName && !Ei(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2547
2555
|
if (t.addRow) {
|
|
2548
2556
|
if (i === "flat") return;
|
|
2549
2557
|
let a = e[t.name];
|
|
@@ -2561,12 +2569,12 @@ function Ei(e, t = [], n = {}) {
|
|
|
2561
2569
|
});
|
|
2562
2570
|
}), r;
|
|
2563
2571
|
}
|
|
2564
|
-
function
|
|
2572
|
+
function Oi(e, t, n = {}) {
|
|
2565
2573
|
let r = U(n.base) ? structuredClone(n.base) : {};
|
|
2566
|
-
|
|
2567
|
-
(e.payloadKey || e.field) && (
|
|
2574
|
+
wi(t).forEach((e) => {
|
|
2575
|
+
(e.payloadKey || e.field) && (ji(r, e.payloadKey || e.field), ji(r, e.field));
|
|
2568
2576
|
});
|
|
2569
|
-
let i =
|
|
2577
|
+
let i = Ti(n.module), a = xi(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Ei(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2570
2578
|
return (t ?? []).forEach((t) => {
|
|
2571
2579
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && K(e, t.toggleField) ? !!G(e, t.toggleField) : !1;
|
|
2572
2580
|
if (t.toggleEnabled && t.toggleField && K(e, t.toggleField) && (q(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2576,18 +2584,18 @@ function Di(e, t, n = {}) {
|
|
|
2576
2584
|
if (t.addRow) {
|
|
2577
2585
|
let i = e[t.name];
|
|
2578
2586
|
if (!Array.isArray(i)) return;
|
|
2579
|
-
q(n, t.payloadKey || t.name, i.map((t) =>
|
|
2587
|
+
q(n, t.payloadKey || t.name, i.map((t) => Ai(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2580
2588
|
return;
|
|
2581
2589
|
}
|
|
2582
|
-
r.forEach((t) =>
|
|
2590
|
+
r.forEach((t) => ki(t, e, n, e, a));
|
|
2583
2591
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2584
2592
|
moduleName: e,
|
|
2585
2593
|
data: t
|
|
2586
|
-
}))),
|
|
2594
|
+
}))), ei(r, t);
|
|
2587
2595
|
}
|
|
2588
|
-
function
|
|
2596
|
+
function ki(e, t, n, r, i) {
|
|
2589
2597
|
if (e.type === "file") return;
|
|
2590
|
-
if (e.showIf?.field && !
|
|
2598
|
+
if (e.showIf?.field && !bi(e, t, r, i)) {
|
|
2591
2599
|
(r === void 0 || r === t) && K(t, e.field) && q(n, e.payloadKey || e.field, null);
|
|
2592
2600
|
return;
|
|
2593
2601
|
}
|
|
@@ -2595,30 +2603,30 @@ function Oi(e, t, n, r, i) {
|
|
|
2595
2603
|
if (!K(t, e.field)) return;
|
|
2596
2604
|
let a = G(t, e.field);
|
|
2597
2605
|
if (!Array.isArray(a)) return;
|
|
2598
|
-
let o = a.map((t) =>
|
|
2606
|
+
let o = a.map((t) => Ai(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2599
2607
|
q(n, e.payloadKey || e.field, o);
|
|
2600
2608
|
return;
|
|
2601
2609
|
}
|
|
2602
2610
|
if (!K(t, e.field)) return;
|
|
2603
|
-
if (
|
|
2604
|
-
let r = G(t, e.field), i = Array.isArray(r) ? r : H(r) ? [] : [r], a =
|
|
2611
|
+
if (ti(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2612
|
+
let r = G(t, e.field), i = Array.isArray(r) ? r : H(r) ? [] : [r], a = Mi(e), o = i.map((e) => gi(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2605
2613
|
q(n, e.payloadKey || e.field, o);
|
|
2606
2614
|
return;
|
|
2607
2615
|
}
|
|
2608
|
-
let a =
|
|
2616
|
+
let a = gi(e, G(t, e.field));
|
|
2609
2617
|
if (a.kind !== "skip") {
|
|
2610
2618
|
if (a.kind === "spread" && U(a.out)) {
|
|
2611
|
-
|
|
2619
|
+
ai(n, a.out);
|
|
2612
2620
|
return;
|
|
2613
2621
|
}
|
|
2614
2622
|
q(n, e.payloadKey || e.field, a.out);
|
|
2615
2623
|
}
|
|
2616
2624
|
}
|
|
2617
|
-
function
|
|
2625
|
+
function Ai(e, t, n, r) {
|
|
2618
2626
|
let i = {};
|
|
2619
|
-
return e.forEach((e) =>
|
|
2627
|
+
return e.forEach((e) => ki(e, t, i, n ?? t, r)), i;
|
|
2620
2628
|
}
|
|
2621
|
-
function
|
|
2629
|
+
function ji(e, t) {
|
|
2622
2630
|
let n = String(t).split("."), r = e;
|
|
2623
2631
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2624
2632
|
if (!U(r[n[e]])) return;
|
|
@@ -2636,7 +2644,7 @@ function Y(e, t) {
|
|
|
2636
2644
|
let e = pe(t);
|
|
2637
2645
|
return e.isValid() ? e : null;
|
|
2638
2646
|
}
|
|
2639
|
-
let i = (t) => U(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type === "radio" ? !1 :
|
|
2647
|
+
let i = (t) => U(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type === "radio" ? !1 : ci(e) === "array", o = (t) => {
|
|
2640
2648
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2641
2649
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2642
2650
|
return n ? n.value : t;
|
|
@@ -2648,7 +2656,7 @@ function Y(e, t) {
|
|
|
2648
2656
|
}
|
|
2649
2657
|
return t;
|
|
2650
2658
|
}
|
|
2651
|
-
function
|
|
2659
|
+
function Mi(e = {}) {
|
|
2652
2660
|
return {
|
|
2653
2661
|
...e,
|
|
2654
2662
|
addRow: !1,
|
|
@@ -2657,7 +2665,7 @@ function ji(e = {}) {
|
|
|
2657
2665
|
dataType: void 0
|
|
2658
2666
|
};
|
|
2659
2667
|
}
|
|
2660
|
-
function
|
|
2668
|
+
function Ni(e, t) {
|
|
2661
2669
|
let n = Math.max(0, Number(e.minRows ?? 0) || 0), r = e.initialRows !== void 0 && e.initialRows !== "" ? Math.max(n, Math.max(0, Number(e.initialRows) || 0)) : n;
|
|
2662
2670
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2663
2671
|
let i = [];
|
|
@@ -2673,7 +2681,7 @@ function Mi(e, t) {
|
|
|
2673
2681
|
for (; i.length < a;) i.push({});
|
|
2674
2682
|
return i;
|
|
2675
2683
|
}
|
|
2676
|
-
let i =
|
|
2684
|
+
let i = Mi(e), a = [];
|
|
2677
2685
|
if (Array.isArray(t)) a = t.map((e) => Y(i, e)).filter((e) => e != null && e !== "");
|
|
2678
2686
|
else if (t != null && t !== "") {
|
|
2679
2687
|
let e = Y(i, t);
|
|
@@ -2685,12 +2693,12 @@ function Mi(e, t) {
|
|
|
2685
2693
|
}
|
|
2686
2694
|
//#endregion
|
|
2687
2695
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2688
|
-
var
|
|
2689
|
-
function
|
|
2696
|
+
var Pi = (e) => e === !0 || e === 1 || e === "1";
|
|
2697
|
+
function Fi(e = []) {
|
|
2690
2698
|
let t = /* @__PURE__ */ new Map();
|
|
2691
2699
|
e.forEach((e) => {
|
|
2692
2700
|
let n = e?.linkGroup;
|
|
2693
|
-
!
|
|
2701
|
+
!Pi(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2694
2702
|
});
|
|
2695
2703
|
let n = /* @__PURE__ */ new Map();
|
|
2696
2704
|
return t.forEach((e, t) => {
|
|
@@ -2700,11 +2708,11 @@ function Pi(e = []) {
|
|
|
2700
2708
|
});
|
|
2701
2709
|
}), n;
|
|
2702
2710
|
}
|
|
2703
|
-
function
|
|
2711
|
+
function Ii(e, t) {
|
|
2704
2712
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
2705
2713
|
return null;
|
|
2706
2714
|
}
|
|
2707
|
-
function
|
|
2715
|
+
function Li(e, t = {}) {
|
|
2708
2716
|
let n = { ...t };
|
|
2709
2717
|
return e.forEach(({ memberNames: e }) => {
|
|
2710
2718
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -2716,7 +2724,7 @@ function Ii(e, t = {}) {
|
|
|
2716
2724
|
}
|
|
2717
2725
|
//#endregion
|
|
2718
2726
|
//#region src/services/aiActionApi.js
|
|
2719
|
-
async function
|
|
2727
|
+
async function Ri({ module: e, group: t, field: r, actionKey: a, inputs: o = {}, files: s = {} }) {
|
|
2720
2728
|
if (!e || !t || !r || !a) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
2721
2729
|
let c = await n(), l = new FormData();
|
|
2722
2730
|
l.append("json", JSON.stringify({ inputs: o })), Object.entries(s).forEach(([e, t]) => {
|
|
@@ -2742,7 +2750,7 @@ async function Li({ module: e, group: t, field: r, actionKey: a, inputs: o = {},
|
|
|
2742
2750
|
}
|
|
2743
2751
|
//#endregion
|
|
2744
2752
|
//#region src/components/detail/renderConfig.js
|
|
2745
|
-
var
|
|
2753
|
+
var zi = [
|
|
2746
2754
|
{
|
|
2747
2755
|
value: "auto",
|
|
2748
2756
|
label: "Default (auto)"
|
|
@@ -2799,7 +2807,7 @@ var Ri = [
|
|
|
2799
2807
|
value: "html",
|
|
2800
2808
|
label: "HTML"
|
|
2801
2809
|
}
|
|
2802
|
-
],
|
|
2810
|
+
], Bi = [
|
|
2803
2811
|
{
|
|
2804
2812
|
value: "preview",
|
|
2805
2813
|
label: "Preview (viewer)"
|
|
@@ -2820,7 +2828,7 @@ var Ri = [
|
|
|
2820
2828
|
value: "text",
|
|
2821
2829
|
label: "Text (filename)"
|
|
2822
2830
|
}
|
|
2823
|
-
],
|
|
2831
|
+
], Vi = [
|
|
2824
2832
|
{
|
|
2825
2833
|
value: "none",
|
|
2826
2834
|
label: "None"
|
|
@@ -2837,37 +2845,37 @@ var Ri = [
|
|
|
2837
2845
|
value: "title",
|
|
2838
2846
|
label: "Title Case"
|
|
2839
2847
|
}
|
|
2840
|
-
],
|
|
2848
|
+
], Hi = [
|
|
2841
2849
|
"location",
|
|
2842
2850
|
"path",
|
|
2843
2851
|
"url",
|
|
2844
2852
|
"key"
|
|
2845
|
-
],
|
|
2853
|
+
], Ui = [
|
|
2846
2854
|
"location",
|
|
2847
2855
|
"filepath",
|
|
2848
2856
|
"path",
|
|
2849
2857
|
"url",
|
|
2850
2858
|
"key"
|
|
2851
|
-
],
|
|
2859
|
+
], Wi = [
|
|
2852
2860
|
"uploadedfilename",
|
|
2853
2861
|
"uploadname",
|
|
2854
2862
|
"originalname",
|
|
2855
2863
|
"displayname",
|
|
2856
2864
|
"documentname",
|
|
2857
2865
|
"filename"
|
|
2858
|
-
],
|
|
2859
|
-
function
|
|
2866
|
+
], Gi = ["name"], Ki = (e) => String(e).toLowerCase(), qi = (e) => e == null || e === "";
|
|
2867
|
+
function Ji(e, t) {
|
|
2860
2868
|
for (let n of t) {
|
|
2861
2869
|
let t = e[n];
|
|
2862
2870
|
if (typeof t == "string" && t) return t;
|
|
2863
2871
|
}
|
|
2864
2872
|
return "";
|
|
2865
2873
|
}
|
|
2866
|
-
function
|
|
2867
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
2874
|
+
function Yi(e, t) {
|
|
2875
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Ki(t).endsWith(n)) return r;
|
|
2868
2876
|
return "";
|
|
2869
2877
|
}
|
|
2870
|
-
function
|
|
2878
|
+
function Xi(e) {
|
|
2871
2879
|
if (!e) return "";
|
|
2872
2880
|
let t = String(e).split("?")[0].split("#")[0];
|
|
2873
2881
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
@@ -2876,31 +2884,31 @@ function X(e) {
|
|
|
2876
2884
|
if (!e) return "";
|
|
2877
2885
|
let t = String(e);
|
|
2878
2886
|
if (/^https?:\/\//i.test(t)) return t;
|
|
2879
|
-
let n =
|
|
2887
|
+
let n = Er().s3BaseUrl || "";
|
|
2880
2888
|
return n ? `${n}/${t.replace(/^\/+/, "")}` : "";
|
|
2881
2889
|
}
|
|
2882
|
-
function Xi(e) {
|
|
2883
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : qi(e, Vi) || Ji(e, Hi);
|
|
2884
|
-
}
|
|
2885
2890
|
function Zi(e) {
|
|
2886
|
-
return
|
|
2891
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Ji(e, Hi) || Yi(e, Ui);
|
|
2887
2892
|
}
|
|
2888
2893
|
function Qi(e) {
|
|
2889
|
-
|
|
2894
|
+
return e ? typeof e == "string" ? Xi(e) || e : typeof e == "object" && (Ji(e, Er().documentNameOrder ?? []) || Yi(e, Wi) || Xi(Zi(e)) || Yi(e, Gi)) || "Document" : "Document";
|
|
2895
|
+
}
|
|
2896
|
+
function $i(e) {
|
|
2897
|
+
if (qi(e)) return [];
|
|
2890
2898
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
2891
|
-
for (let e of t) if (!
|
|
2899
|
+
for (let e of t) if (!qi(e)) {
|
|
2892
2900
|
if (typeof e == "string") {
|
|
2893
2901
|
let t = e.includes("/") ? e : "";
|
|
2894
2902
|
n.push({
|
|
2895
2903
|
location: t,
|
|
2896
|
-
name:
|
|
2904
|
+
name: Xi(e) || e,
|
|
2897
2905
|
url: X(t)
|
|
2898
2906
|
});
|
|
2899
2907
|
} else if (typeof e == "object") {
|
|
2900
|
-
let t =
|
|
2908
|
+
let t = Zi(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
2901
2909
|
n.push({
|
|
2902
2910
|
location: t,
|
|
2903
|
-
name:
|
|
2911
|
+
name: Qi(e),
|
|
2904
2912
|
url: r || X(t)
|
|
2905
2913
|
});
|
|
2906
2914
|
}
|
|
@@ -2909,12 +2917,12 @@ function Qi(e) {
|
|
|
2909
2917
|
}
|
|
2910
2918
|
//#endregion
|
|
2911
2919
|
//#region src/components/form/applyGroupValues.js
|
|
2912
|
-
var
|
|
2913
|
-
function
|
|
2920
|
+
var ea = (e) => e === !0 || e === 1 || e === "1", ta = (e) => e == null || e === "";
|
|
2921
|
+
function na(e) {
|
|
2914
2922
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
2915
2923
|
}
|
|
2916
2924
|
function Z(e, t, n) {
|
|
2917
|
-
let r = Array.isArray(t) ? t :
|
|
2925
|
+
let r = Array.isArray(t) ? t : na(t);
|
|
2918
2926
|
if (!r.length) return e;
|
|
2919
2927
|
let i = e;
|
|
2920
2928
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -2923,23 +2931,23 @@ function Z(e, t, n) {
|
|
|
2923
2931
|
}
|
|
2924
2932
|
return i[r[r.length - 1]] = n, e;
|
|
2925
2933
|
}
|
|
2926
|
-
function
|
|
2934
|
+
function ra(e, t = []) {
|
|
2927
2935
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
2928
2936
|
if (!n) continue;
|
|
2929
2937
|
let t = W(e, n);
|
|
2930
|
-
if (!
|
|
2938
|
+
if (!ta(t)) return t;
|
|
2931
2939
|
}
|
|
2932
2940
|
}
|
|
2933
2941
|
function Q(e, t) {
|
|
2934
2942
|
if (!e || typeof e != "object") return;
|
|
2935
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
2943
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !ta(n));
|
|
2936
2944
|
if (r) return r[1];
|
|
2937
2945
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
2938
2946
|
let n = Q(e, t);
|
|
2939
|
-
if (!
|
|
2947
|
+
if (!ta(n)) return n;
|
|
2940
2948
|
}
|
|
2941
2949
|
}
|
|
2942
|
-
function
|
|
2950
|
+
function ia(e, t) {
|
|
2943
2951
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
2944
2952
|
if (!n.length) return;
|
|
2945
2953
|
let r = n.map((e, n) => {
|
|
@@ -2949,7 +2957,7 @@ function ra(e, t) {
|
|
|
2949
2957
|
status: "done"
|
|
2950
2958
|
};
|
|
2951
2959
|
if (!e || typeof e != "object") return null;
|
|
2952
|
-
let r =
|
|
2960
|
+
let r = ra(e, [t.fileUrlKey, t.locationKey]) ?? Q(e, /(location|url|path)$/i) ?? "", i = ra(e, [t.fileNameKey]) ?? Q(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
2953
2961
|
if (!r && !i) return null;
|
|
2954
2962
|
let a = r && !String(r).startsWith("http") ? X(r) : r;
|
|
2955
2963
|
return {
|
|
@@ -2962,9 +2970,9 @@ function ra(e, t) {
|
|
|
2962
2970
|
}).filter(Boolean);
|
|
2963
2971
|
return r.length ? r : void 0;
|
|
2964
2972
|
}
|
|
2965
|
-
function
|
|
2973
|
+
function aa(e, t) {
|
|
2966
2974
|
if (!e || typeof e != "object") return;
|
|
2967
|
-
let n =
|
|
2975
|
+
let n = ra(e, [t.fileNameKey, t.field]) ?? Q(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = ra(e, [t.fileUrlKey, t.locationKey]) ?? Q(e, /(location|url|path)$/i) ?? "";
|
|
2968
2976
|
if (!n && !r) return;
|
|
2969
2977
|
let i = r && !String(r).startsWith("http") ? X(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
2970
2978
|
return [{
|
|
@@ -2975,7 +2983,7 @@ function ia(e, t) {
|
|
|
2975
2983
|
url: i || void 0
|
|
2976
2984
|
}];
|
|
2977
2985
|
}
|
|
2978
|
-
function
|
|
2986
|
+
function oa(e) {
|
|
2979
2987
|
let t = Array.isArray(e.rows) ? e.rows : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
2980
2988
|
let i = {};
|
|
2981
2989
|
return (e.fields ?? []).forEach((e) => {
|
|
@@ -2990,26 +2998,26 @@ function aa(e) {
|
|
|
2990
2998
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Z(i, e.field, e.defaultValue);
|
|
2991
2999
|
return;
|
|
2992
3000
|
}
|
|
2993
|
-
Z(i, e.field,
|
|
3001
|
+
Z(i, e.field, ea(e.addRow) ? Ni(e, a) : Y(e, a));
|
|
2994
3002
|
}), i;
|
|
2995
|
-
}, i =
|
|
3003
|
+
}, i = Si(e, { editing: !0 });
|
|
2996
3004
|
if (t && t.length > 0) {
|
|
2997
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3005
|
+
let e = t.map((e) => r(e, (e, t) => aa(e, t), (e, t) => W(e, t.field)));
|
|
2998
3006
|
for (; e.length < n;) e.push({ ...i });
|
|
2999
3007
|
return e;
|
|
3000
3008
|
}
|
|
3001
|
-
let a = r(e, (e, t) =>
|
|
3009
|
+
let a = r(e, (e, t) => ia(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3002
3010
|
for (; o.length < n;) o.push({ ...i });
|
|
3003
3011
|
return o;
|
|
3004
3012
|
}
|
|
3005
|
-
function
|
|
3013
|
+
function sa(e, t = []) {
|
|
3006
3014
|
let n = {};
|
|
3007
3015
|
return t.forEach((e) => {
|
|
3008
3016
|
e.toggleEnabled && e.toggleField && Z(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3009
3017
|
if (!e.field || e.addRow) return;
|
|
3010
3018
|
let t = e.value, r = e.field;
|
|
3011
3019
|
if (e.type === "file") {
|
|
3012
|
-
let i =
|
|
3020
|
+
let i = ia(t, e);
|
|
3013
3021
|
i && Z(n, r, i);
|
|
3014
3022
|
return;
|
|
3015
3023
|
}
|
|
@@ -3029,27 +3037,27 @@ function oa(e, t = []) {
|
|
|
3029
3037
|
}
|
|
3030
3038
|
//#endregion
|
|
3031
3039
|
//#region src/components/form/useAiActions.js
|
|
3032
|
-
function
|
|
3040
|
+
function ca(e) {
|
|
3033
3041
|
let t = document.createElement("div");
|
|
3034
3042
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3035
3043
|
}
|
|
3036
|
-
function
|
|
3037
|
-
return t && t === "stripHtml" ?
|
|
3044
|
+
function la(e, t) {
|
|
3045
|
+
return t && t === "stripHtml" ? ca(e) : e;
|
|
3038
3046
|
}
|
|
3039
|
-
function
|
|
3047
|
+
function ua(e) {
|
|
3040
3048
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3041
3049
|
}
|
|
3042
|
-
function
|
|
3050
|
+
function da(e) {
|
|
3043
3051
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3044
3052
|
}
|
|
3045
|
-
function
|
|
3053
|
+
function fa(e, t) {
|
|
3046
3054
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3047
|
-
let n =
|
|
3055
|
+
let n = la(t, e.transform), r = String(n ?? "").trim();
|
|
3048
3056
|
if (!r) return !1;
|
|
3049
3057
|
let i = Number(e.minWords) || 0;
|
|
3050
|
-
return i > 0 ?
|
|
3058
|
+
return i > 0 ? ua(r) >= i : !0;
|
|
3051
3059
|
}
|
|
3052
|
-
function
|
|
3060
|
+
function pa(e, t) {
|
|
3053
3061
|
let n = e.inputs || [];
|
|
3054
3062
|
if (n.length === 0) return !0;
|
|
3055
3063
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3057,35 +3065,35 @@ function fa(e, t) {
|
|
|
3057
3065
|
let n = e.group || `__solo_${t}`;
|
|
3058
3066
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3059
3067
|
});
|
|
3060
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3068
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => fa(e, t(e.sourceField)))) return !1;
|
|
3061
3069
|
return !0;
|
|
3062
3070
|
}
|
|
3063
|
-
var
|
|
3071
|
+
var ma = [
|
|
3064
3072
|
"top-left",
|
|
3065
3073
|
"top-center",
|
|
3066
3074
|
"top-right",
|
|
3067
3075
|
"bottom-left",
|
|
3068
3076
|
"bottom-center",
|
|
3069
3077
|
"bottom-right"
|
|
3070
|
-
],
|
|
3071
|
-
function
|
|
3078
|
+
], ha = "bottom-left";
|
|
3079
|
+
function ga(e = []) {
|
|
3072
3080
|
let t = {};
|
|
3073
3081
|
return e.forEach((e) => {
|
|
3074
|
-
let n =
|
|
3082
|
+
let n = ma.includes(e.position) ? e.position : ha;
|
|
3075
3083
|
(t[n] ??= []).push(e);
|
|
3076
3084
|
}), t;
|
|
3077
3085
|
}
|
|
3078
|
-
function
|
|
3079
|
-
let [r, i] = h(null), a = v.useWatch((e) => e, e), o = d((e) =>
|
|
3086
|
+
function _a({ form: e, groups: t, module: n }) {
|
|
3087
|
+
let [r, i] = h(null), a = v.useWatch((e) => e, e), o = d((e) => pa(e, (e) => (a || {})[e]), [a]), s = d((t) => {
|
|
3080
3088
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3081
|
-
let n =
|
|
3089
|
+
let n = sa(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3082
3090
|
return t.forEach((t) => {
|
|
3083
3091
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3084
|
-
let n =
|
|
3092
|
+
let n = oa(t);
|
|
3085
3093
|
if (n.length === 0) return;
|
|
3086
3094
|
r = !0;
|
|
3087
3095
|
let i = () => e.setFieldsValue({ [t.name]: n }), a = e.getFieldValue(t.name) || [];
|
|
3088
|
-
a.some(
|
|
3096
|
+
a.some(da) ? y.confirm({
|
|
3089
3097
|
title: "Replace existing rows?",
|
|
3090
3098
|
content: `This will replace ${a.length} existing row(s) in "${t.label || t.name}".`,
|
|
3091
3099
|
okText: "Replace",
|
|
@@ -3105,12 +3113,12 @@ function ga({ form: e, groups: t, module: n }) {
|
|
|
3105
3113
|
r && (c[t.param] = r);
|
|
3106
3114
|
} else {
|
|
3107
3115
|
let n = e.getFieldValue(t.sourceField);
|
|
3108
|
-
n != null && n !== "" && (i[t.param] =
|
|
3116
|
+
n != null && n !== "" && (i[t.param] = la(n, t.transform));
|
|
3109
3117
|
}
|
|
3110
3118
|
}), (a.inputs || []).forEach((e) => {
|
|
3111
3119
|
!e.group || e.kind !== "text" || (a.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete i[e.param];
|
|
3112
3120
|
});
|
|
3113
|
-
let l = await
|
|
3121
|
+
let l = await Ri({
|
|
3114
3122
|
module: n,
|
|
3115
3123
|
group: t,
|
|
3116
3124
|
field: r.field,
|
|
@@ -3137,7 +3145,7 @@ function ga({ form: e, groups: t, module: n }) {
|
|
|
3137
3145
|
}
|
|
3138
3146
|
//#endregion
|
|
3139
3147
|
//#region src/components/form/AiActionButtons.jsx
|
|
3140
|
-
function
|
|
3148
|
+
function va({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3141
3149
|
return !t || t.length === 0 ? null : /* @__PURE__ */ C(ee, {
|
|
3142
3150
|
size: 8,
|
|
3143
3151
|
className: "v1-ai-action-buttons",
|
|
@@ -3156,18 +3164,18 @@ function _a({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3156
3164
|
}
|
|
3157
3165
|
//#endregion
|
|
3158
3166
|
//#region src/components/form/emailValidator.js
|
|
3159
|
-
function
|
|
3167
|
+
function ya(e) {
|
|
3160
3168
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3161
3169
|
if (!n) return !1;
|
|
3162
3170
|
let [, r, i] = n;
|
|
3163
3171
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3164
3172
|
}
|
|
3165
|
-
function
|
|
3166
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3173
|
+
function ba(e = "Email", t) {
|
|
3174
|
+
return { validator: (n, r) => r == null || r === "" || ya(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3167
3175
|
}
|
|
3168
3176
|
//#endregion
|
|
3169
3177
|
//#region src/components/form/inputValidator.js
|
|
3170
|
-
var
|
|
3178
|
+
var xa = [
|
|
3171
3179
|
{
|
|
3172
3180
|
label: "Only Numbers",
|
|
3173
3181
|
value: "onlyNumber"
|
|
@@ -3236,7 +3244,7 @@ var ba = [
|
|
|
3236
3244
|
label: "Website URL",
|
|
3237
3245
|
value: "websiteUrl"
|
|
3238
3246
|
}
|
|
3239
|
-
],
|
|
3247
|
+
], Sa = {
|
|
3240
3248
|
onlyNumber: /^[0-9]$/,
|
|
3241
3249
|
experience: /^[0-9]$/,
|
|
3242
3250
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3251,10 +3259,10 @@ var ba = [
|
|
|
3251
3259
|
decimalRange: /^[0-9.]$/,
|
|
3252
3260
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3253
3261
|
};
|
|
3254
|
-
function
|
|
3255
|
-
return
|
|
3262
|
+
function Ca(e) {
|
|
3263
|
+
return Sa[e] ?? null;
|
|
3256
3264
|
}
|
|
3257
|
-
function
|
|
3265
|
+
function wa(e, t = {}, n = "change") {
|
|
3258
3266
|
if (!t?.type || e == null) return {
|
|
3259
3267
|
cleaned: e ?? "",
|
|
3260
3268
|
error: null
|
|
@@ -3332,7 +3340,7 @@ function Ca(e, t = {}, n = "change") {
|
|
|
3332
3340
|
break;
|
|
3333
3341
|
}
|
|
3334
3342
|
case "email":
|
|
3335
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
3343
|
+
c = n === "blur" ? r.trim() : r, c && !ya(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3336
3344
|
break;
|
|
3337
3345
|
case "websiteUrl":
|
|
3338
3346
|
c = n === "blur" ? r.trim() : r, c && !/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c) && (l = `${s} must be a valid URL.`);
|
|
@@ -3346,7 +3354,7 @@ function Ca(e, t = {}, n = "change") {
|
|
|
3346
3354
|
}
|
|
3347
3355
|
//#endregion
|
|
3348
3356
|
//#region src/components/form/uploadAccept.js
|
|
3349
|
-
var
|
|
3357
|
+
var Ta = [
|
|
3350
3358
|
"jpg",
|
|
3351
3359
|
"jpeg",
|
|
3352
3360
|
"png",
|
|
@@ -3355,18 +3363,18 @@ var wa = [
|
|
|
3355
3363
|
"bmp",
|
|
3356
3364
|
"svg",
|
|
3357
3365
|
"avif"
|
|
3358
|
-
],
|
|
3366
|
+
], Ea = [
|
|
3359
3367
|
"mp4",
|
|
3360
3368
|
"webm",
|
|
3361
3369
|
"ogg",
|
|
3362
3370
|
"ogv",
|
|
3363
3371
|
"mov",
|
|
3364
3372
|
"m4v"
|
|
3365
|
-
],
|
|
3373
|
+
], Da = [
|
|
3366
3374
|
"pdf",
|
|
3367
3375
|
"doc",
|
|
3368
3376
|
"docx"
|
|
3369
|
-
],
|
|
3377
|
+
], Oa = [
|
|
3370
3378
|
{
|
|
3371
3379
|
label: "Any file",
|
|
3372
3380
|
value: "any"
|
|
@@ -3387,44 +3395,44 @@ var wa = [
|
|
|
3387
3395
|
label: "Images & Videos",
|
|
3388
3396
|
value: "imagesAndVideos"
|
|
3389
3397
|
}
|
|
3390
|
-
],
|
|
3398
|
+
], ka = {
|
|
3391
3399
|
documents: {
|
|
3392
|
-
exts: [...
|
|
3400
|
+
exts: [...Da, ...Ta],
|
|
3393
3401
|
hint: "PDF, DOC or image files",
|
|
3394
3402
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
3395
3403
|
},
|
|
3396
3404
|
images: {
|
|
3397
|
-
exts:
|
|
3405
|
+
exts: Ta,
|
|
3398
3406
|
hint: "Image files",
|
|
3399
3407
|
error: "Only image files are allowed"
|
|
3400
3408
|
},
|
|
3401
3409
|
videos: {
|
|
3402
|
-
exts:
|
|
3410
|
+
exts: Ea,
|
|
3403
3411
|
hint: "Video files",
|
|
3404
3412
|
error: "Only video files are allowed"
|
|
3405
3413
|
},
|
|
3406
3414
|
imagesAndVideos: {
|
|
3407
|
-
exts: [...
|
|
3415
|
+
exts: [...Ta, ...Ea],
|
|
3408
3416
|
hint: "Image or video files",
|
|
3409
3417
|
error: "Only image or video files are allowed"
|
|
3410
3418
|
}
|
|
3411
3419
|
};
|
|
3412
|
-
function
|
|
3413
|
-
return
|
|
3420
|
+
function Aa(e) {
|
|
3421
|
+
return ka[String(e?.accept ?? "").trim()] ?? null;
|
|
3414
3422
|
}
|
|
3415
3423
|
//#endregion
|
|
3416
3424
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
3417
|
-
var
|
|
3418
|
-
function
|
|
3425
|
+
var ja = u(() => import("./index.js").then((e) => e.i)), Ma = u(() => import("./index.js").then((e) => e.n)), Na = (e) => e == null || e === "", Pa = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
3426
|
+
function Fa(e, t, n, r, i) {
|
|
3419
3427
|
let a = e.quickEditIdFrom;
|
|
3420
3428
|
if (a) {
|
|
3421
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
3422
|
-
return
|
|
3429
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Pa(a)] : Pa(a), i = t?.getFieldValue?.(e);
|
|
3430
|
+
return Na(i) && (i = r?.[a]), Na(i) ? null : i;
|
|
3423
3431
|
}
|
|
3424
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
3432
|
+
return i && typeof i == "object" ? i.value ?? null : Na(i) ? null : i;
|
|
3425
3433
|
}
|
|
3426
|
-
function
|
|
3427
|
-
let [s, c] = h(null), u = !!e?.quickCreate, d = !!e?.quickEdit, f = e?.quickCreateModule || e?.lookupCollection || "", m = e?.quickEditModule || e?.lookupCollection || "", g = p(() => d ?
|
|
3434
|
+
function Ia({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
3435
|
+
let [s, c] = h(null), u = !!e?.quickCreate, d = !!e?.quickEdit, f = e?.quickCreateModule || e?.lookupCollection || "", m = e?.quickEditModule || e?.lookupCollection || "", g = p(() => d ? Fa(e, t, n, i, a) : null, [
|
|
3428
3436
|
d,
|
|
3429
3437
|
e,
|
|
3430
3438
|
t,
|
|
@@ -3495,7 +3503,7 @@ function Fa({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3495
3503
|
},
|
|
3496
3504
|
children: /* @__PURE__ */ C(b, {})
|
|
3497
3505
|
}),
|
|
3498
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
3506
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(ja, {
|
|
3499
3507
|
moduleName: s.module,
|
|
3500
3508
|
embedded: !0,
|
|
3501
3509
|
breadcrumbItems: [],
|
|
@@ -3503,7 +3511,7 @@ function Fa({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3503
3511
|
onSuccess: (e) => {
|
|
3504
3512
|
v(), o?.("create", e);
|
|
3505
3513
|
}
|
|
3506
|
-
}) : /* @__PURE__ */ C(
|
|
3514
|
+
}) : /* @__PURE__ */ C(Ma, {
|
|
3507
3515
|
moduleName: s.module,
|
|
3508
3516
|
recordId: s.recordId,
|
|
3509
3517
|
embedded: !0,
|
|
@@ -3519,24 +3527,24 @@ function Fa({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3519
3527
|
}
|
|
3520
3528
|
//#endregion
|
|
3521
3529
|
//#region src/utils/roleAllowsAction.js
|
|
3522
|
-
function
|
|
3523
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
3530
|
+
function La(e) {
|
|
3531
|
+
return e == null ? !0 : typeof e == "object" ? La(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
3524
3532
|
}
|
|
3525
|
-
function
|
|
3533
|
+
function Ra(e, t) {
|
|
3526
3534
|
if (!e) return !0;
|
|
3527
3535
|
try {
|
|
3528
3536
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
3529
|
-
return
|
|
3537
|
+
return La((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
3530
3538
|
} catch {
|
|
3531
3539
|
return !0;
|
|
3532
3540
|
}
|
|
3533
3541
|
}
|
|
3534
3542
|
//#endregion
|
|
3535
3543
|
//#region src/utils/afterSubmitNav.js
|
|
3536
|
-
function
|
|
3544
|
+
function za(e) {
|
|
3537
3545
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
3538
3546
|
}
|
|
3539
|
-
function
|
|
3547
|
+
function Ba(e, t, n) {
|
|
3540
3548
|
let r = String(e ?? "").trim();
|
|
3541
3549
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
3542
3550
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -3545,29 +3553,29 @@ function za(e, t, n) {
|
|
|
3545
3553
|
}
|
|
3546
3554
|
//#endregion
|
|
3547
3555
|
//#region src/utils/submitMessages.js
|
|
3548
|
-
function
|
|
3556
|
+
function Va(e) {
|
|
3549
3557
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
3550
3558
|
}
|
|
3551
3559
|
function $(e) {
|
|
3552
3560
|
let t = String(e ?? "").trim();
|
|
3553
3561
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
3554
3562
|
}
|
|
3555
|
-
function
|
|
3563
|
+
function Ha(e, t) {
|
|
3556
3564
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
3557
3565
|
}
|
|
3558
|
-
function
|
|
3559
|
-
let r =
|
|
3566
|
+
function Ua(e, t, n) {
|
|
3567
|
+
let r = Va(e);
|
|
3560
3568
|
if (r?.suppress) return null;
|
|
3561
3569
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
3562
|
-
return i && String(i).trim() ?
|
|
3570
|
+
return i && String(i).trim() ? Ha(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
3563
3571
|
}
|
|
3564
|
-
function
|
|
3565
|
-
let i =
|
|
3566
|
-
return a && String(a).trim() ?
|
|
3572
|
+
function Wa(e, t, n, r) {
|
|
3573
|
+
let i = Va(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
3574
|
+
return a && String(a).trim() ? Ha(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
3567
3575
|
}
|
|
3568
3576
|
//#endregion
|
|
3569
3577
|
//#region src/utils/scrollToFirstFormError.js
|
|
3570
|
-
function
|
|
3578
|
+
function Ga({ errorFields: e } = {}, t) {
|
|
3571
3579
|
if (!e?.length) return;
|
|
3572
3580
|
let n = e[0]?.name;
|
|
3573
3581
|
setTimeout(() => {
|
|
@@ -3592,10 +3600,10 @@ function Wa({ errorFields: e } = {}, t) {
|
|
|
3592
3600
|
}
|
|
3593
3601
|
//#endregion
|
|
3594
3602
|
//#region src/components/form/conditionalFieldLabel.js
|
|
3595
|
-
function
|
|
3603
|
+
function Ka(e) {
|
|
3596
3604
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
3597
3605
|
}
|
|
3598
|
-
function
|
|
3606
|
+
function qa(e, t) {
|
|
3599
3607
|
if (!e?.field) return !1;
|
|
3600
3608
|
switch (e.operator ?? "eq") {
|
|
3601
3609
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -3603,21 +3611,21 @@ function Ka(e, t) {
|
|
|
3603
3611
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
3604
3612
|
case "falsy": return t == null || t === "" || t === !1;
|
|
3605
3613
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3606
|
-
case "in": return
|
|
3607
|
-
case "notIn": return !
|
|
3614
|
+
case "in": return Ka(e.value).includes(String(t ?? ""));
|
|
3615
|
+
case "notIn": return !Ka(e.value).includes(String(t ?? ""));
|
|
3608
3616
|
default: return !1;
|
|
3609
3617
|
}
|
|
3610
3618
|
}
|
|
3611
|
-
function
|
|
3619
|
+
function Ja(e, t, n = !1) {
|
|
3612
3620
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
3613
|
-
return
|
|
3621
|
+
return qa(i, t) && i?.label ? i.label : r;
|
|
3614
3622
|
}
|
|
3615
|
-
function
|
|
3623
|
+
function Ya(e, t) {
|
|
3616
3624
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
3617
3625
|
}
|
|
3618
3626
|
//#endregion
|
|
3619
3627
|
//#region src/components/Breadcrumb.jsx
|
|
3620
|
-
function
|
|
3628
|
+
function Xa({ items: e = [] }) {
|
|
3621
3629
|
return /* @__PURE__ */ C(g, { items: e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Le, {
|
|
3622
3630
|
variant: "body",
|
|
3623
3631
|
weight: "medium",
|
|
@@ -3633,6 +3641,6 @@ function Ya({ items: e = [] }) {
|
|
|
3633
3641
|
}) })) });
|
|
3634
3642
|
}
|
|
3635
3643
|
//#endregion
|
|
3636
|
-
export {
|
|
3644
|
+
export { Ar as $, fn as $t, Fi as A, lr as An, mn as At, Mi as B, A as Bn, Gt as Bt, oa as C, ir as Cn, Ln as Ct, Vi as D, In as Dn, Lt as Dt, zi as E, pr as En, Nn as Et, Ni as F, xt as Fn, Nt as Ft, Ir as G, D as Gn, un as Gt, _i as H, at as Hn, jn as Ht, Di as I, bt as In, tn as It, Mr as J, Xn as Jt, Pr as K, E as Kn, Rn as Kt, ci as L, pt as Ln, rn as Lt, Li as M, On as Mn, kn as Mt, Y as N, Mn as Nn, Gn as Nt, X as O, Cn as On, It as Ot, Oi as P, Hn as Pn, Un as Pt, Or as Q, Bn as Qt, W as R, mt as Rn, Wn as Rt, sa as S, Bt as Sn, mr as St, Bi as T, Jn as Tn, ur as Tt, Qr as U, ze as Un, on as Ut, vi as V, ot as Vn, Jt as Vt, Fr as W, Le as Wn, an as Wt, Er as X, dr as Xt, jr as Y, Kn as Yt, Nr as Z, Ot as Zt, Ca as _, Vn as _n, $t as _t, Ga as a, er as an, vr as at, ga as b, An as bn, $n as bt, za as c, Pn as cn, dn as ct, Ra as d, Qt as dn, Zn as dt, Rt as en, Cr as et, Ia as f, nn as fn, qn as ft, wa as g, Mt as gn, Vt as gt, xa as h, sn as hn, cr as ht, Ja as i, bn as in, Sr as it, Ii as j, vn as jn, _n as jt, $i as k, tr as kn, Zt as kt, Ba as l, kt as ln, zt as lt, Aa as m, Yt as mn, Fn as mt, Ya as n, En as nn, _r as nt, Wa as o, sr as on, yr as ot, Oa as p, Kt as pn, fr as pt, wr as q, zn as qt, qa as r, L as rn, gr as rt, Ua as s, xn as sn, Ut as st, Xa as t, Dt as tn, xr as tt, La as u, Ht as un, rr as ut, ba as v, At as vn, ar as vt, na as w, Qn as wn, jt as wt, _a as x, ln as xn, Yn as xt, va as y, Dn as yn, cn as yt, Si as z, ht as zn, nr as zt };
|
|
3637
3645
|
|
|
3638
|
-
//# sourceMappingURL=Breadcrumb-
|
|
3646
|
+
//# sourceMappingURL=Breadcrumb-C_ybG8rI.js.map
|