@realtek/core-theme 0.0.257 → 0.0.259
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-BV5DtmmO.cjs +3 -0
- package/dist-lib/Breadcrumb-BV5DtmmO.cjs.map +1 -0
- package/dist-lib/{Breadcrumb-Cpb7Ouex.js → Breadcrumb-Db_WFy70.js} +727 -455
- package/dist-lib/Breadcrumb-Db_WFy70.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +7480 -7063
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/Breadcrumb-Bzebpgpq.cjs +0 -3
- package/dist-lib/Breadcrumb-Bzebpgpq.cjs.map +0 -1
- package/dist-lib/Breadcrumb-Cpb7Ouex.js.map +0 -1
|
@@ -1240,26 +1240,47 @@ async function It(e, { gateway: t, strategies: i }) {
|
|
|
1240
1240
|
async function Lt() {
|
|
1241
1241
|
let e = [];
|
|
1242
1242
|
try {
|
|
1243
|
-
e = await
|
|
1243
|
+
e = await $n();
|
|
1244
1244
|
} catch {
|
|
1245
1245
|
e = [];
|
|
1246
1246
|
}
|
|
1247
1247
|
let t = (Array.isArray(e) ? e : []).filter((e) => e?.isDeleted !== !0 && String(e?.status ?? "active").toLowerCase() !== "inactive" && String(e?.status ?? "active").toLowerCase() !== "disabled");
|
|
1248
1248
|
return t.length > 0 ? t : jt();
|
|
1249
1249
|
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1250
|
+
async function Rt() {
|
|
1251
|
+
let e;
|
|
1252
|
+
try {
|
|
1253
|
+
e = await jt();
|
|
1254
|
+
} catch {
|
|
1255
|
+
return {};
|
|
1256
|
+
}
|
|
1257
|
+
let t = {}, n = (e, n, r) => {
|
|
1258
|
+
let i = String(e ?? "").trim().toLowerCase();
|
|
1259
|
+
!i || !n || (r || t[i] === void 0) && (t[i] = n);
|
|
1260
|
+
};
|
|
1261
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
1262
|
+
let e = String(t?.collectionName ?? "").trim();
|
|
1263
|
+
e && n(t?.key, e, !0);
|
|
1264
|
+
}
|
|
1265
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
1266
|
+
let e = String(t?.collectionName ?? "").trim(), r = String(t?.key ?? "").trim().toLowerCase();
|
|
1267
|
+
!e || !r || (r.endsWith("s") ? n(r.slice(0, -1), e, !1) : n(`${r}s`, e, !1));
|
|
1268
|
+
}
|
|
1269
|
+
return t;
|
|
1270
|
+
}
|
|
1271
|
+
var P = "/admin/form-groups", zt = "/admin/config-defaults", Bt = "000000000000000000000000";
|
|
1272
|
+
function Vt(e) {
|
|
1252
1273
|
let t = String(e ?? "").trim();
|
|
1253
|
-
return t === "" || t ===
|
|
1274
|
+
return t === "" || t === Bt;
|
|
1254
1275
|
}
|
|
1255
|
-
function
|
|
1276
|
+
function F(e = {}) {
|
|
1256
1277
|
let t = new URLSearchParams();
|
|
1257
1278
|
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
1258
1279
|
let n = t.toString();
|
|
1259
1280
|
return n ? `?${n}` : "";
|
|
1260
1281
|
}
|
|
1261
1282
|
async function Ht(e = "", t = {}) {
|
|
1262
|
-
let i = await n(r, `${P}${
|
|
1283
|
+
let i = await n(r, `${P}${F({
|
|
1263
1284
|
...t,
|
|
1264
1285
|
module: e || t.module || ""
|
|
1265
1286
|
})}`), a = i?.data;
|
|
@@ -1281,24 +1302,24 @@ async function Wt(e) {
|
|
|
1281
1302
|
return Array.isArray(i) ? i : [];
|
|
1282
1303
|
}
|
|
1283
1304
|
async function Gt(e, t = {}) {
|
|
1284
|
-
return n(r, `${P}${
|
|
1305
|
+
return n(r, `${P}${F(t)}`, {
|
|
1285
1306
|
method: "POST",
|
|
1286
1307
|
headers: { "Content-Type": "application/json" },
|
|
1287
1308
|
body: JSON.stringify(e)
|
|
1288
1309
|
});
|
|
1289
1310
|
}
|
|
1290
1311
|
async function Kt(e, t, i = {}) {
|
|
1291
|
-
return n(r, `${P}/${e}${
|
|
1312
|
+
return n(r, `${P}/${e}${F(i)}`, {
|
|
1292
1313
|
method: "PUT",
|
|
1293
1314
|
headers: { "Content-Type": "application/json" },
|
|
1294
1315
|
body: JSON.stringify(t)
|
|
1295
1316
|
});
|
|
1296
1317
|
}
|
|
1297
1318
|
async function qt(e, t = {}) {
|
|
1298
|
-
return n(r, `${P}/${e}${
|
|
1319
|
+
return n(r, `${P}/${e}${F(t)}`, { method: "DELETE" });
|
|
1299
1320
|
}
|
|
1300
1321
|
async function Jt(e, t) {
|
|
1301
|
-
return n(r, `${
|
|
1322
|
+
return n(r, `${zt}/request-otp`, {
|
|
1302
1323
|
method: "POST",
|
|
1303
1324
|
body: JSON.stringify({
|
|
1304
1325
|
scope: e,
|
|
@@ -1307,7 +1328,7 @@ async function Jt(e, t) {
|
|
|
1307
1328
|
});
|
|
1308
1329
|
}
|
|
1309
1330
|
async function Yt(e, t, i) {
|
|
1310
|
-
return n(r, `${
|
|
1331
|
+
return n(r, `${zt}/apply`, {
|
|
1311
1332
|
method: "POST",
|
|
1312
1333
|
body: JSON.stringify({
|
|
1313
1334
|
scope: e,
|
|
@@ -1318,13 +1339,13 @@ async function Yt(e, t, i) {
|
|
|
1318
1339
|
}
|
|
1319
1340
|
var Xt = "/admin/detail-config";
|
|
1320
1341
|
async function Zt(e, t = {}) {
|
|
1321
|
-
let i = await n(r, `${Xt}${
|
|
1342
|
+
let i = await n(r, `${Xt}${F({
|
|
1322
1343
|
module: e,
|
|
1323
1344
|
clientId: t.clientId
|
|
1324
1345
|
})}`), a = i?.data ?? i ?? {};
|
|
1325
1346
|
return {
|
|
1326
1347
|
module: a.module ?? e,
|
|
1327
|
-
clientId:
|
|
1348
|
+
clientId: Vt(a.clientId) ? "" : String(a.clientId),
|
|
1328
1349
|
fields: Array.isArray(a.fields) ? a.fields : [],
|
|
1329
1350
|
merges: Array.isArray(a.merges) ? a.merges : []
|
|
1330
1351
|
};
|
|
@@ -1390,28 +1411,28 @@ async function un() {
|
|
|
1390
1411
|
enabled: !0
|
|
1391
1412
|
};
|
|
1392
1413
|
}
|
|
1393
|
-
var
|
|
1414
|
+
var I = "/admin/integration-config";
|
|
1394
1415
|
async function dn() {
|
|
1395
|
-
let e = await n(r,
|
|
1416
|
+
let e = await n(r, I);
|
|
1396
1417
|
return e?.data ?? e ?? [];
|
|
1397
1418
|
}
|
|
1398
1419
|
async function fn(e) {
|
|
1399
|
-
let t = await n(r, `${
|
|
1420
|
+
let t = await n(r, `${I}/${encodeURIComponent(e)}`);
|
|
1400
1421
|
return t?.data ?? t;
|
|
1401
1422
|
}
|
|
1402
1423
|
async function pn(e) {
|
|
1403
1424
|
let t = e?.integrationKey;
|
|
1404
|
-
return n(r, t ? `${
|
|
1425
|
+
return n(r, t ? `${I}/${encodeURIComponent(t)}` : I, {
|
|
1405
1426
|
method: t ? "PUT" : "POST",
|
|
1406
1427
|
headers: { "Content-Type": "application/json" },
|
|
1407
1428
|
body: JSON.stringify(e)
|
|
1408
1429
|
});
|
|
1409
1430
|
}
|
|
1410
1431
|
async function mn(e) {
|
|
1411
|
-
return n(r, `${
|
|
1432
|
+
return n(r, `${I}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1412
1433
|
}
|
|
1413
1434
|
async function hn(e) {
|
|
1414
|
-
let t = await n(r, `${
|
|
1435
|
+
let t = await n(r, `${I}/test`, {
|
|
1415
1436
|
method: "POST",
|
|
1416
1437
|
headers: { "Content-Type": "application/json" },
|
|
1417
1438
|
body: JSON.stringify(e)
|
|
@@ -1445,17 +1466,17 @@ function yn(e) {
|
|
|
1445
1466
|
raw: e
|
|
1446
1467
|
};
|
|
1447
1468
|
}
|
|
1448
|
-
function
|
|
1469
|
+
function bn(e) {
|
|
1449
1470
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
1450
1471
|
}
|
|
1451
|
-
async function
|
|
1472
|
+
async function xn() {
|
|
1452
1473
|
let e = await n(r, "/get-roles"), t = e.data ?? e, i = M(t?.zinnext_default).map(yn), a = M(t?.custom_roles).map(yn), o = [...i, ...a];
|
|
1453
1474
|
return {
|
|
1454
1475
|
roles: o,
|
|
1455
1476
|
total: o.length
|
|
1456
1477
|
};
|
|
1457
1478
|
}
|
|
1458
|
-
function
|
|
1479
|
+
function Sn(e) {
|
|
1459
1480
|
return {
|
|
1460
1481
|
key: e.teamId,
|
|
1461
1482
|
teamId: e.teamId,
|
|
@@ -1468,10 +1489,10 @@ function xn(e) {
|
|
|
1468
1489
|
raw: e
|
|
1469
1490
|
};
|
|
1470
1491
|
}
|
|
1471
|
-
function
|
|
1492
|
+
function Cn(e) {
|
|
1472
1493
|
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
1473
1494
|
}
|
|
1474
|
-
async function
|
|
1495
|
+
async function wn({ offset: e = 0, limit: t = 10, sortBy: i = "new", search: a = "" } = {}) {
|
|
1475
1496
|
let o = await n(r, `/get-teams?${new URLSearchParams({
|
|
1476
1497
|
searchquery: a,
|
|
1477
1498
|
sortBy: i,
|
|
@@ -1479,12 +1500,12 @@ async function Cn({ offset: e = 0, limit: t = 10, sortBy: i = "new", search: a =
|
|
|
1479
1500
|
offset: String(e)
|
|
1480
1501
|
})}`), s = o.data ?? o, c = M(s?.teams, s, o?.teams), l = s?.totalCount ?? s?.total ?? c.length;
|
|
1481
1502
|
return {
|
|
1482
|
-
teams: c.map(
|
|
1503
|
+
teams: c.map(Sn),
|
|
1483
1504
|
total: l
|
|
1484
1505
|
};
|
|
1485
1506
|
}
|
|
1486
|
-
async function
|
|
1487
|
-
return n(r, `/team/edit?teamId=${
|
|
1507
|
+
async function Tn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
1508
|
+
return n(r, `/team/edit?teamId=${Cn(e)}`, {
|
|
1488
1509
|
method: "PUT",
|
|
1489
1510
|
body: JSON.stringify({
|
|
1490
1511
|
team_name: t,
|
|
@@ -1494,7 +1515,7 @@ async function wn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
|
1494
1515
|
})
|
|
1495
1516
|
});
|
|
1496
1517
|
}
|
|
1497
|
-
async function
|
|
1518
|
+
async function En(e, t, i, a = "listView") {
|
|
1498
1519
|
let o = await n(r, `${A}?${new URLSearchParams({
|
|
1499
1520
|
module: e,
|
|
1500
1521
|
userId: "0",
|
|
@@ -1503,8 +1524,8 @@ async function Tn(e, t, i, a = "listView") {
|
|
|
1503
1524
|
})}`), s = o.data ?? o;
|
|
1504
1525
|
return M(s, s?.visibleFields, o?.visibleFields);
|
|
1505
1526
|
}
|
|
1506
|
-
async function
|
|
1507
|
-
let r =
|
|
1527
|
+
async function Dn(e, t = "listView", n = j) {
|
|
1528
|
+
let r = bn(e), i = kt(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await En(n, "roleId", r, t)).map((t, i) => ({
|
|
1508
1529
|
...Dt(t, i),
|
|
1509
1530
|
module: e,
|
|
1510
1531
|
apiModule: n,
|
|
@@ -1512,8 +1533,8 @@ async function En(e, t = "listView", n = j) {
|
|
|
1512
1533
|
}))]));
|
|
1513
1534
|
return Object.fromEntries(a);
|
|
1514
1535
|
}
|
|
1515
|
-
async function
|
|
1516
|
-
let n =
|
|
1536
|
+
async function On(e, t = "listView") {
|
|
1537
|
+
let n = Cn(e), r = await Promise.all(j.map(async ({ key: e, apiModule: r }) => [e, (await En(r, "teamId", n, t)).map((t, i) => ({
|
|
1517
1538
|
...Dt(t, i),
|
|
1518
1539
|
module: e,
|
|
1519
1540
|
apiModule: r,
|
|
@@ -1521,7 +1542,7 @@ async function Dn(e, t = "listView") {
|
|
|
1521
1542
|
}))]));
|
|
1522
1543
|
return Object.fromEntries(r);
|
|
1523
1544
|
}
|
|
1524
|
-
function
|
|
1545
|
+
function kn(e, t) {
|
|
1525
1546
|
let n = !t || t === "listView";
|
|
1526
1547
|
return e.map((e, r) => {
|
|
1527
1548
|
let i = {
|
|
@@ -1557,37 +1578,37 @@ function On(e, t) {
|
|
|
1557
1578
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
1558
1579
|
});
|
|
1559
1580
|
}
|
|
1560
|
-
async function
|
|
1561
|
-
let s =
|
|
1581
|
+
async function An(e, t, i, a = "listView", o = j) {
|
|
1582
|
+
let s = bn(e), c = kt(o).find((e) => e.key === t)?.apiModule ?? t;
|
|
1562
1583
|
return n(r, `${A}/role`, {
|
|
1563
1584
|
method: "PUT",
|
|
1564
1585
|
body: JSON.stringify({
|
|
1565
1586
|
module: c,
|
|
1566
1587
|
roleId: s,
|
|
1567
1588
|
configType: a,
|
|
1568
|
-
visibleFields:
|
|
1589
|
+
visibleFields: kn(i, a)
|
|
1569
1590
|
})
|
|
1570
1591
|
});
|
|
1571
1592
|
}
|
|
1572
|
-
var
|
|
1573
|
-
function
|
|
1593
|
+
var jn = "/admin/role-form-permissions";
|
|
1594
|
+
function Mn(e) {
|
|
1574
1595
|
return `__group__:${e}`;
|
|
1575
1596
|
}
|
|
1576
|
-
async function
|
|
1577
|
-
let a =
|
|
1597
|
+
async function Nn(e, t, i = {}) {
|
|
1598
|
+
let a = bn(e), o = new URLSearchParams({
|
|
1578
1599
|
module: t,
|
|
1579
1600
|
roleId: String(a ?? "")
|
|
1580
1601
|
});
|
|
1581
1602
|
i.clientId && o.set("clientId", i.clientId), i.region && o.set("region", i.region);
|
|
1582
|
-
let s = await n(r, `${
|
|
1603
|
+
let s = await n(r, `${jn}?${o}`), c = s?.data ?? s;
|
|
1583
1604
|
return Array.isArray(c) ? c : [];
|
|
1584
1605
|
}
|
|
1585
|
-
async function
|
|
1586
|
-
let a =
|
|
1606
|
+
async function Pn(e, t, i) {
|
|
1607
|
+
let a = bn(e), o = [], s = 0;
|
|
1587
1608
|
for (let e of i) {
|
|
1588
1609
|
e.locked || o.push({
|
|
1589
1610
|
label: e.label,
|
|
1590
|
-
field:
|
|
1611
|
+
field: Mn(e.name),
|
|
1591
1612
|
isVisible: e.enabled,
|
|
1592
1613
|
isEditable: e.editable !== !1,
|
|
1593
1614
|
order: s++
|
|
@@ -1610,19 +1631,19 @@ async function Nn(e, t, i) {
|
|
|
1610
1631
|
})
|
|
1611
1632
|
});
|
|
1612
1633
|
}
|
|
1613
|
-
async function
|
|
1614
|
-
let o =
|
|
1634
|
+
async function Fn(e, t, i, a = "listView") {
|
|
1635
|
+
let o = Cn(e), s = j.find((e) => e.key === t)?.apiModule ?? t;
|
|
1615
1636
|
return n(r, `${A}/team`, {
|
|
1616
1637
|
method: "PUT",
|
|
1617
1638
|
body: JSON.stringify({
|
|
1618
1639
|
module: s,
|
|
1619
1640
|
teamId: o,
|
|
1620
1641
|
configType: a,
|
|
1621
|
-
visibleFields:
|
|
1642
|
+
visibleFields: kn(i, a)
|
|
1622
1643
|
})
|
|
1623
1644
|
});
|
|
1624
1645
|
}
|
|
1625
|
-
async function
|
|
1646
|
+
async function In({ offset: e = 0, limit: t = 10, sortBy: i = "new", searchQuery: a = "" } = {}) {
|
|
1626
1647
|
let o = new URLSearchParams({
|
|
1627
1648
|
offset: String(e),
|
|
1628
1649
|
limit: String(t),
|
|
@@ -1638,21 +1659,21 @@ async function Fn({ offset: e = 0, limit: t = 10, sortBy: i = "new", searchQuery
|
|
|
1638
1659
|
}, l)
|
|
1639
1660
|
};
|
|
1640
1661
|
}
|
|
1641
|
-
async function
|
|
1662
|
+
async function Ln(e = []) {
|
|
1642
1663
|
return n(r, `${A}/seed`, {
|
|
1643
1664
|
method: "POST",
|
|
1644
1665
|
headers: { "Content-Type": "application/json" },
|
|
1645
1666
|
body: JSON.stringify({ collections: e })
|
|
1646
1667
|
});
|
|
1647
1668
|
}
|
|
1648
|
-
async function
|
|
1669
|
+
async function Rn() {
|
|
1649
1670
|
let e = await n(r, `${A}/seed-status`), t = e?.data ?? e ?? {};
|
|
1650
1671
|
return {
|
|
1651
1672
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
1652
1673
|
seededModules: t.seededModules ?? {}
|
|
1653
1674
|
};
|
|
1654
1675
|
}
|
|
1655
|
-
async function
|
|
1676
|
+
async function zn(e) {
|
|
1656
1677
|
let t = localStorage.getItem("authToken"), n = new FormData();
|
|
1657
1678
|
n.append("icon", e);
|
|
1658
1679
|
let i = await fetch(`${r}/admin/field-config/action-icon`, {
|
|
@@ -1667,11 +1688,11 @@ async function Rn(e) {
|
|
|
1667
1688
|
let a = await i.json();
|
|
1668
1689
|
return a.data ?? a;
|
|
1669
1690
|
}
|
|
1670
|
-
async function
|
|
1691
|
+
async function Bn() {
|
|
1671
1692
|
let [e, t, n] = await Promise.all([
|
|
1672
1693
|
Lt().catch(() => []),
|
|
1673
|
-
|
|
1674
|
-
|
|
1694
|
+
Xn().catch(() => []),
|
|
1695
|
+
hr().catch(() => [])
|
|
1675
1696
|
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
1676
1697
|
return [
|
|
1677
1698
|
...r,
|
|
@@ -1679,7 +1700,7 @@ async function zn() {
|
|
|
1679
1700
|
...i
|
|
1680
1701
|
];
|
|
1681
1702
|
}
|
|
1682
|
-
async function
|
|
1703
|
+
async function Vn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
1683
1704
|
let a = await n(r, `/module/list?${new URLSearchParams({
|
|
1684
1705
|
module: e,
|
|
1685
1706
|
page: String(t),
|
|
@@ -1690,24 +1711,24 @@ async function Bn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
|
1690
1711
|
total: o.pagination?.total ?? 0
|
|
1691
1712
|
};
|
|
1692
1713
|
}
|
|
1693
|
-
async function
|
|
1714
|
+
async function Hn(e, t) {
|
|
1694
1715
|
return n(r, `/module/create?module=${encodeURIComponent(e)}`, {
|
|
1695
1716
|
method: "POST",
|
|
1696
1717
|
headers: { "Content-Type": "application/json" },
|
|
1697
1718
|
body: JSON.stringify(t)
|
|
1698
1719
|
});
|
|
1699
1720
|
}
|
|
1700
|
-
async function
|
|
1721
|
+
async function Un(e, t, i) {
|
|
1701
1722
|
return n(r, `/module/update/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, {
|
|
1702
1723
|
method: "PUT",
|
|
1703
1724
|
headers: { "Content-Type": "application/json" },
|
|
1704
1725
|
body: JSON.stringify(i)
|
|
1705
1726
|
});
|
|
1706
1727
|
}
|
|
1707
|
-
async function
|
|
1728
|
+
async function Wn(e, t) {
|
|
1708
1729
|
return n(r, `/module/delete/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1709
1730
|
}
|
|
1710
|
-
async function
|
|
1731
|
+
async function Gn(e = "", t = 50) {
|
|
1711
1732
|
let i = await n(r, `/admin/location-dropdown-values?${new URLSearchParams({
|
|
1712
1733
|
search: e,
|
|
1713
1734
|
limit: String(t),
|
|
@@ -1721,7 +1742,7 @@ async function Wn(e = "", t = 50) {
|
|
|
1721
1742
|
};
|
|
1722
1743
|
}).filter((e) => e.label);
|
|
1723
1744
|
}
|
|
1724
|
-
async function
|
|
1745
|
+
async function Kn(e, t, i = "_id") {
|
|
1725
1746
|
let a = await n(r, `/admin/lookup-dropdown-values?${new URLSearchParams({
|
|
1726
1747
|
collection: String(e),
|
|
1727
1748
|
displayField: String(t),
|
|
@@ -1732,11 +1753,11 @@ async function Gn(e, t, i = "_id") {
|
|
|
1732
1753
|
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
1733
1754
|
})).filter((e) => e.value && e.label);
|
|
1734
1755
|
}
|
|
1735
|
-
async function
|
|
1756
|
+
async function qn(e) {
|
|
1736
1757
|
let t = await n(r, `/admin/default-fields?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
1737
1758
|
return Array.isArray(i.fields) ? i.fields : [];
|
|
1738
1759
|
}
|
|
1739
|
-
async function
|
|
1760
|
+
async function Jn(e, t, i) {
|
|
1740
1761
|
return n(r, "/admin/default-fields", {
|
|
1741
1762
|
method: "PUT",
|
|
1742
1763
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1747,7 +1768,7 @@ async function qn(e, t, i) {
|
|
|
1747
1768
|
})
|
|
1748
1769
|
});
|
|
1749
1770
|
}
|
|
1750
|
-
async function
|
|
1771
|
+
async function Yn(e) {
|
|
1751
1772
|
let t = await n(r, "/email-verify", {
|
|
1752
1773
|
method: "POST",
|
|
1753
1774
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1765,23 +1786,23 @@ async function Jn(e) {
|
|
|
1765
1786
|
checks: Array.isArray(i.checks) ? i.checks : []
|
|
1766
1787
|
};
|
|
1767
1788
|
}
|
|
1768
|
-
async function
|
|
1789
|
+
async function Xn() {
|
|
1769
1790
|
let e = await n(r, "/admin/lookup/collections"), t = e.data ?? e;
|
|
1770
1791
|
return Array.isArray(t) ? t : [];
|
|
1771
1792
|
}
|
|
1772
|
-
async function
|
|
1793
|
+
async function Zn(e) {
|
|
1773
1794
|
let t = await n(r, `/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`), i = t.data ?? t;
|
|
1774
1795
|
return Array.isArray(i) ? i : [];
|
|
1775
1796
|
}
|
|
1776
|
-
async function
|
|
1797
|
+
async function Qn(e, t) {
|
|
1777
1798
|
let i = await n(r, `/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(t)}`), a = i.data ?? i;
|
|
1778
1799
|
return Array.isArray(a?.fields) ? a.fields : [];
|
|
1779
1800
|
}
|
|
1780
|
-
async function
|
|
1801
|
+
async function $n() {
|
|
1781
1802
|
let e = await n(r, "/admin/menu-modules");
|
|
1782
1803
|
return M(e.data, e);
|
|
1783
1804
|
}
|
|
1784
|
-
async function
|
|
1805
|
+
async function er({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMenuId: a = 0, displayOrder: o = 0 }) {
|
|
1785
1806
|
let s = await n(r, "/admin/menu-modules", {
|
|
1786
1807
|
method: "POST",
|
|
1787
1808
|
body: JSON.stringify({
|
|
@@ -1794,22 +1815,22 @@ async function $n({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMen
|
|
|
1794
1815
|
});
|
|
1795
1816
|
return s.data ?? s;
|
|
1796
1817
|
}
|
|
1797
|
-
async function
|
|
1818
|
+
async function tr(e, { menuName: t }) {
|
|
1798
1819
|
let i = await n(r, `/admin/menu-modules/${e}`, {
|
|
1799
1820
|
method: "PUT",
|
|
1800
1821
|
body: JSON.stringify({ menuName: t })
|
|
1801
1822
|
});
|
|
1802
1823
|
return i.data ?? i;
|
|
1803
1824
|
}
|
|
1804
|
-
async function
|
|
1825
|
+
async function nr(e) {
|
|
1805
1826
|
let t = await n(r, `/admin/menu-modules/${e}`, { method: "DELETE" });
|
|
1806
1827
|
return t.data ?? t;
|
|
1807
1828
|
}
|
|
1808
|
-
async function
|
|
1829
|
+
async function rr() {
|
|
1809
1830
|
let e = await n(r, "/admin/menu-actions");
|
|
1810
1831
|
return M(e.data, e);
|
|
1811
1832
|
}
|
|
1812
|
-
async function
|
|
1833
|
+
async function ir({ permissionName: e, permissionKey: t }) {
|
|
1813
1834
|
let i = await n(r, "/admin/menu-actions", {
|
|
1814
1835
|
method: "POST",
|
|
1815
1836
|
body: JSON.stringify({
|
|
@@ -1819,22 +1840,22 @@ async function rr({ permissionName: e, permissionKey: t }) {
|
|
|
1819
1840
|
});
|
|
1820
1841
|
return i.data ?? i;
|
|
1821
1842
|
}
|
|
1822
|
-
async function
|
|
1843
|
+
async function ar(e, { permissionName: t }) {
|
|
1823
1844
|
let i = await n(r, `/admin/menu-actions/${e}`, {
|
|
1824
1845
|
method: "PUT",
|
|
1825
1846
|
body: JSON.stringify({ permissionName: t })
|
|
1826
1847
|
});
|
|
1827
1848
|
return i.data ?? i;
|
|
1828
1849
|
}
|
|
1829
|
-
async function
|
|
1850
|
+
async function or(e) {
|
|
1830
1851
|
let t = await n(r, `/admin/menu-actions/${e}`, { method: "DELETE" });
|
|
1831
1852
|
return t.data ?? t;
|
|
1832
1853
|
}
|
|
1833
|
-
async function
|
|
1854
|
+
async function sr(e) {
|
|
1834
1855
|
let t = await n(r, `/get-role-details?roleid=${e}`);
|
|
1835
1856
|
return t?.data ?? t ?? {};
|
|
1836
1857
|
}
|
|
1837
|
-
async function
|
|
1858
|
+
async function cr(e, t) {
|
|
1838
1859
|
return n(r, "/edit-role-details", {
|
|
1839
1860
|
method: "PUT",
|
|
1840
1861
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1844,40 +1865,40 @@ async function sr(e, t) {
|
|
|
1844
1865
|
})
|
|
1845
1866
|
});
|
|
1846
1867
|
}
|
|
1847
|
-
var
|
|
1848
|
-
async function
|
|
1868
|
+
var lr = "/admin/custom-forms";
|
|
1869
|
+
async function ur(e = "", t = "", i = "") {
|
|
1849
1870
|
let a = new URLSearchParams();
|
|
1850
1871
|
e && a.append("module", e), t && a.append("formType", t), i && a.append("action", i);
|
|
1851
|
-
let o = await n(r, `${
|
|
1872
|
+
let o = await n(r, `${lr}?${a.toString()}`), s = o?.data;
|
|
1852
1873
|
return Array.isArray(s) ? s : Array.isArray(o) ? o : [];
|
|
1853
1874
|
}
|
|
1854
|
-
async function
|
|
1855
|
-
return n(r,
|
|
1875
|
+
async function dr(e) {
|
|
1876
|
+
return n(r, lr, {
|
|
1856
1877
|
method: "POST",
|
|
1857
1878
|
headers: { "Content-Type": "application/json" },
|
|
1858
1879
|
body: JSON.stringify(e)
|
|
1859
1880
|
});
|
|
1860
1881
|
}
|
|
1861
|
-
async function
|
|
1862
|
-
return n(r, `${
|
|
1882
|
+
async function fr(e, t) {
|
|
1883
|
+
return n(r, `${lr}/${e}`, {
|
|
1863
1884
|
method: "PUT",
|
|
1864
1885
|
headers: { "Content-Type": "application/json" },
|
|
1865
1886
|
body: JSON.stringify(t)
|
|
1866
1887
|
});
|
|
1867
1888
|
}
|
|
1868
|
-
async function
|
|
1869
|
-
return n(r, `${
|
|
1889
|
+
async function pr(e) {
|
|
1890
|
+
return n(r, `${lr}/${e}`, { method: "DELETE" });
|
|
1870
1891
|
}
|
|
1871
1892
|
var L = "/admin/row-action-config";
|
|
1872
|
-
function
|
|
1893
|
+
function mr(e) {
|
|
1873
1894
|
return String(e ?? "").trim().toLowerCase();
|
|
1874
1895
|
}
|
|
1875
|
-
async function
|
|
1876
|
-
let t =
|
|
1896
|
+
async function hr(e = "") {
|
|
1897
|
+
let t = mr(e), i = await n(r, t ? `${L}?module=${encodeURIComponent(t)}` : L), a = i?.data;
|
|
1877
1898
|
return Array.isArray(a) ? a : Array.isArray(i) ? i : [];
|
|
1878
1899
|
}
|
|
1879
|
-
async function
|
|
1880
|
-
let a =
|
|
1900
|
+
async function gr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
1901
|
+
let a = mr(e);
|
|
1881
1902
|
return n(r, L, {
|
|
1882
1903
|
method: "POST",
|
|
1883
1904
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1888,23 +1909,23 @@ async function hr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
|
1888
1909
|
})
|
|
1889
1910
|
});
|
|
1890
1911
|
}
|
|
1891
|
-
async function
|
|
1912
|
+
async function _r(e, t = []) {
|
|
1892
1913
|
return n(r, `${L}/${e}`, {
|
|
1893
1914
|
method: "PUT",
|
|
1894
1915
|
headers: { "Content-Type": "application/json" },
|
|
1895
1916
|
body: JSON.stringify({ rowActions: t })
|
|
1896
1917
|
});
|
|
1897
1918
|
}
|
|
1898
|
-
async function
|
|
1919
|
+
async function vr(e) {
|
|
1899
1920
|
return n(r, `${L}/${e}`, { method: "DELETE" });
|
|
1900
1921
|
}
|
|
1901
|
-
var
|
|
1902
|
-
async function
|
|
1903
|
-
let t = await n(r, `${
|
|
1922
|
+
var yr = "/admin/module-action-rules";
|
|
1923
|
+
async function br(e) {
|
|
1924
|
+
let t = await n(r, `${yr}?module=${encodeURIComponent(e)}`), i = t?.data;
|
|
1904
1925
|
return Array.isArray(i) ? i : Array.isArray(t) ? t : [];
|
|
1905
1926
|
}
|
|
1906
|
-
async function
|
|
1907
|
-
return n(r,
|
|
1927
|
+
async function xr({ module: e, name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1928
|
+
return n(r, yr, {
|
|
1908
1929
|
method: "POST",
|
|
1909
1930
|
headers: { "Content-Type": "application/json" },
|
|
1910
1931
|
body: JSON.stringify({
|
|
@@ -1918,8 +1939,8 @@ async function br({ module: e, name: t, description: i = "", conditions: a = [],
|
|
|
1918
1939
|
})
|
|
1919
1940
|
});
|
|
1920
1941
|
}
|
|
1921
|
-
async function
|
|
1922
|
-
return n(r, `${
|
|
1942
|
+
async function Sr(e, { name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1943
|
+
return n(r, `${yr}/${e}`, {
|
|
1923
1944
|
method: "PUT",
|
|
1924
1945
|
headers: { "Content-Type": "application/json" },
|
|
1925
1946
|
body: JSON.stringify({
|
|
@@ -1932,15 +1953,15 @@ async function xr(e, { name: t, description: i = "", conditions: a = [], blocked
|
|
|
1932
1953
|
})
|
|
1933
1954
|
});
|
|
1934
1955
|
}
|
|
1935
|
-
async function
|
|
1936
|
-
return n(r, `${
|
|
1956
|
+
async function Cr(e) {
|
|
1957
|
+
return n(r, `${yr}/${e}`, { method: "DELETE" });
|
|
1937
1958
|
}
|
|
1938
1959
|
//#endregion
|
|
1939
1960
|
//#region src/services/documentApi.js
|
|
1940
|
-
function
|
|
1961
|
+
function wr(e) {
|
|
1941
1962
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1942
1963
|
}
|
|
1943
|
-
async function
|
|
1964
|
+
async function Tr(e, t, n = [], a = {}) {
|
|
1944
1965
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
1945
1966
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
1946
1967
|
if (!n.length) return {
|
|
@@ -1950,7 +1971,7 @@ async function wr(e, t, n = [], a = {}) {
|
|
|
1950
1971
|
let o = await i(), s = new FormData();
|
|
1951
1972
|
n.forEach(({ formKey: e, file: t }) => {
|
|
1952
1973
|
let n = t?.name ?? void 0;
|
|
1953
|
-
s.append(
|
|
1974
|
+
s.append(wr(e), t, n);
|
|
1954
1975
|
}), a && Object.keys(a).length > 0 && s.append("metadata", JSON.stringify(a));
|
|
1955
1976
|
let c = new URLSearchParams({
|
|
1956
1977
|
module: e,
|
|
@@ -1966,7 +1987,7 @@ async function wr(e, t, n = [], a = {}) {
|
|
|
1966
1987
|
}
|
|
1967
1988
|
return u?.data ?? u;
|
|
1968
1989
|
}
|
|
1969
|
-
async function
|
|
1990
|
+
async function Er(e, t, i = "") {
|
|
1970
1991
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
1971
1992
|
if (!t) throw Error("refId is required to fetch documents");
|
|
1972
1993
|
let a = new URLSearchParams({
|
|
@@ -1982,12 +2003,12 @@ async function Tr(e, t, i = "") {
|
|
|
1982
2003
|
}
|
|
1983
2004
|
//#endregion
|
|
1984
2005
|
//#region src/services/detailedViewApi.js
|
|
1985
|
-
var
|
|
2006
|
+
var Dr = {
|
|
1986
2007
|
job: { fetchUrl: (e) => `${t}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
1987
2008
|
candidates: { fetchUrl: (e) => `${s}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
1988
2009
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
1989
2010
|
};
|
|
1990
|
-
async function
|
|
2011
|
+
async function Or(e, t) {
|
|
1991
2012
|
let i = String(e ?? "").trim().toLowerCase();
|
|
1992
2013
|
if (i === "job" || i === "jobs") {
|
|
1993
2014
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
@@ -1998,17 +2019,17 @@ async function Dr(e, t) {
|
|
|
1998
2019
|
id: String(t)
|
|
1999
2020
|
}).toString()}`);
|
|
2000
2021
|
}
|
|
2001
|
-
async function
|
|
2022
|
+
async function kr(e) {
|
|
2002
2023
|
let t = await n(r, `/module-actions?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
2003
2024
|
return {
|
|
2004
2025
|
actions: Array.isArray(i.actions) ? i.actions : [],
|
|
2005
2026
|
actionRules: Array.isArray(i.actionRules) ? i.actionRules : []
|
|
2006
2027
|
};
|
|
2007
2028
|
}
|
|
2008
|
-
async function
|
|
2029
|
+
async function Ar(e, t) {
|
|
2009
2030
|
if (!e) throw Error("module is required");
|
|
2010
2031
|
if (!t) throw Error("id is required");
|
|
2011
|
-
let n =
|
|
2032
|
+
let n = Dr[e];
|
|
2012
2033
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2013
2034
|
let r = await i(), a = await fetch(n.fetchUrl(t), {
|
|
2014
2035
|
method: "GET",
|
|
@@ -2021,7 +2042,7 @@ async function kr(e, t) {
|
|
|
2021
2042
|
let o = await a.json();
|
|
2022
2043
|
return o.data ?? o;
|
|
2023
2044
|
}
|
|
2024
|
-
async function
|
|
2045
|
+
async function jr(e, t, n, a = []) {
|
|
2025
2046
|
if (!e) throw Error("module is required");
|
|
2026
2047
|
if (!t) throw Error("id is required");
|
|
2027
2048
|
let o = await i(), s = new FormData();
|
|
@@ -2033,12 +2054,12 @@ async function Ar(e, t, n, a = []) {
|
|
|
2033
2054
|
});
|
|
2034
2055
|
if (!c.ok) {
|
|
2035
2056
|
let e = await c.text();
|
|
2036
|
-
throw console.error("[updateRecord] Error response:", e), Error(
|
|
2057
|
+
throw console.error("[updateRecord] Error response:", e), Error(Mr(e) || `API ${c.status}: ${c.statusText}`);
|
|
2037
2058
|
}
|
|
2038
2059
|
let l = await c.json();
|
|
2039
2060
|
return l.data ?? l;
|
|
2040
2061
|
}
|
|
2041
|
-
function
|
|
2062
|
+
function Mr(e) {
|
|
2042
2063
|
let t = String(e ?? "").trim();
|
|
2043
2064
|
if (!t.startsWith("{")) return t;
|
|
2044
2065
|
try {
|
|
@@ -2048,22 +2069,22 @@ function jr(e) {
|
|
|
2048
2069
|
return t;
|
|
2049
2070
|
}
|
|
2050
2071
|
}
|
|
2051
|
-
var
|
|
2052
|
-
async function
|
|
2072
|
+
var Nr = (e) => e?.data ?? e;
|
|
2073
|
+
async function Pr(e, t) {
|
|
2053
2074
|
if (!e || !t) return [];
|
|
2054
|
-
let i =
|
|
2075
|
+
let i = Nr(await n(r, `/module-activity?${new URLSearchParams({
|
|
2055
2076
|
module: e,
|
|
2056
2077
|
id: String(t)
|
|
2057
2078
|
}).toString()}`));
|
|
2058
2079
|
return Array.isArray(i) ? i : [];
|
|
2059
2080
|
}
|
|
2060
|
-
async function
|
|
2081
|
+
async function Fr(e) {
|
|
2061
2082
|
if (!e) return [];
|
|
2062
|
-
let t =
|
|
2083
|
+
let t = Nr(await n(r, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2063
2084
|
return Array.isArray(t) ? t : [];
|
|
2064
2085
|
}
|
|
2065
|
-
async function
|
|
2066
|
-
return
|
|
2086
|
+
async function Ir({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
2087
|
+
return Nr(await n(r, "/notes", {
|
|
2067
2088
|
method: "POST",
|
|
2068
2089
|
body: JSON.stringify({
|
|
2069
2090
|
relatedId: e,
|
|
@@ -2075,7 +2096,7 @@ async function Fr({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
|
2075
2096
|
}
|
|
2076
2097
|
//#endregion
|
|
2077
2098
|
//#region src/services/detailDefaults.js
|
|
2078
|
-
var
|
|
2099
|
+
var Lr = Object.freeze({
|
|
2079
2100
|
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
2080
2101
|
dateFormat: "DD MMM YYYY",
|
|
2081
2102
|
booleanTrueLabel: "Yes",
|
|
@@ -2091,16 +2112,16 @@ var Ir = Object.freeze({
|
|
|
2091
2112
|
],
|
|
2092
2113
|
phoneFormat: "3-3-4",
|
|
2093
2114
|
phoneCountryCode: ""
|
|
2094
|
-
}), R = { ...
|
|
2095
|
-
function
|
|
2115
|
+
}), R = { ...Lr }, Rr = null;
|
|
2116
|
+
function zr() {
|
|
2096
2117
|
return R;
|
|
2097
2118
|
}
|
|
2098
|
-
function
|
|
2119
|
+
function Br(e) {
|
|
2099
2120
|
if (!e || typeof e != "object") return {};
|
|
2100
2121
|
let t = {};
|
|
2101
2122
|
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()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), t;
|
|
2102
2123
|
}
|
|
2103
|
-
function
|
|
2124
|
+
function Vr(e = Hr()) {
|
|
2104
2125
|
let t = (String(e).match(/\d+/g) ?? [
|
|
2105
2126
|
"3",
|
|
2106
2127
|
"3",
|
|
@@ -2116,18 +2137,18 @@ function Br(e = Vr()) {
|
|
|
2116
2137
|
total: r.reduce((e, t) => e + t, 0)
|
|
2117
2138
|
};
|
|
2118
2139
|
}
|
|
2119
|
-
function Vr() {
|
|
2120
|
-
return R.phoneFormat || Ir.phoneFormat;
|
|
2121
|
-
}
|
|
2122
2140
|
function Hr() {
|
|
2123
|
-
return R.
|
|
2141
|
+
return R.phoneFormat || Lr.phoneFormat;
|
|
2142
|
+
}
|
|
2143
|
+
function Ur() {
|
|
2144
|
+
return R.phoneCountryCode ?? Lr.phoneCountryCode;
|
|
2124
2145
|
}
|
|
2125
|
-
function
|
|
2126
|
-
let { total: n } =
|
|
2146
|
+
function Wr(e, t = Hr()) {
|
|
2147
|
+
let { total: n } = Vr(t);
|
|
2127
2148
|
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
2128
2149
|
}
|
|
2129
|
-
function
|
|
2130
|
-
let { groups: n, sep: r } =
|
|
2150
|
+
function Gr(e, t = Hr()) {
|
|
2151
|
+
let { groups: n, sep: r } = Vr(t), i = Wr(e, t);
|
|
2131
2152
|
if (!i) return "";
|
|
2132
2153
|
let a = [], o = 0;
|
|
2133
2154
|
for (let e of n) {
|
|
@@ -2136,30 +2157,30 @@ function Wr(e, t = Vr()) {
|
|
|
2136
2157
|
}
|
|
2137
2158
|
return a.join(r);
|
|
2138
2159
|
}
|
|
2139
|
-
function
|
|
2160
|
+
function Kr(e) {
|
|
2140
2161
|
return R = {
|
|
2141
2162
|
...R,
|
|
2142
|
-
...
|
|
2163
|
+
...Br(e)
|
|
2143
2164
|
}, R;
|
|
2144
2165
|
}
|
|
2145
|
-
function
|
|
2146
|
-
return
|
|
2166
|
+
function qr(e = !1) {
|
|
2167
|
+
return Rr && !e || (Rr = en().then((e) => Kr(e)).catch(() => R)), Rr;
|
|
2147
2168
|
}
|
|
2148
2169
|
//#endregion
|
|
2149
2170
|
//#region src/utils/roleFormPermissionGate.js
|
|
2150
|
-
function
|
|
2171
|
+
function Jr(e, t) {
|
|
2151
2172
|
if (!e) return !0;
|
|
2152
2173
|
let n = e.find((e) => e.name === t);
|
|
2153
2174
|
return n ? n.enabled !== !1 : !0;
|
|
2154
2175
|
}
|
|
2155
|
-
function
|
|
2176
|
+
function Yr(e, t, n) {
|
|
2156
2177
|
if (!e) return !0;
|
|
2157
2178
|
let r = e.find((e) => e.name === t);
|
|
2158
2179
|
if (!r) return !0;
|
|
2159
2180
|
let i = r.fields?.find((e) => e.field === n);
|
|
2160
2181
|
return i ? i.enabled !== !1 : !0;
|
|
2161
2182
|
}
|
|
2162
|
-
function
|
|
2183
|
+
function Xr(e, t, n) {
|
|
2163
2184
|
if (!e) return !0;
|
|
2164
2185
|
let r = e.find((e) => e.name === t);
|
|
2165
2186
|
if (!r) return !0;
|
|
@@ -2169,7 +2190,7 @@ function Yr(e, t, n) {
|
|
|
2169
2190
|
}
|
|
2170
2191
|
//#endregion
|
|
2171
2192
|
//#region src/components/form/inputSecurity.js
|
|
2172
|
-
var
|
|
2193
|
+
var Zr = [
|
|
2173
2194
|
"p",
|
|
2174
2195
|
"br",
|
|
2175
2196
|
"strong",
|
|
@@ -2191,12 +2212,12 @@ var Xr = [
|
|
|
2191
2212
|
"a",
|
|
2192
2213
|
"code",
|
|
2193
2214
|
"pre"
|
|
2194
|
-
],
|
|
2215
|
+
], Qr = [
|
|
2195
2216
|
"href",
|
|
2196
2217
|
"title",
|
|
2197
2218
|
"target",
|
|
2198
2219
|
"rel"
|
|
2199
|
-
],
|
|
2220
|
+
], $r = /[\u200B-\u200D\u2060\uFEFF]/g, ei = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, ti = /^[\p{L}\p{M}\p{N} .'-]+$/u, ni = /^\+?[0-9 ()-]+$/, ri = /^-?(?:\d+|\d*\.\d+)$/, ii = [
|
|
2200
2221
|
{
|
|
2201
2222
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta)\b/i,
|
|
2202
2223
|
message: "HTML/script content is not allowed"
|
|
@@ -2230,12 +2251,12 @@ var Xr = [
|
|
|
2230
2251
|
message: "Command execution patterns are not allowed"
|
|
2231
2252
|
}
|
|
2232
2253
|
];
|
|
2233
|
-
function
|
|
2254
|
+
function ai(e) {
|
|
2234
2255
|
if (typeof document > "u") return e;
|
|
2235
2256
|
let t = document.createElement("textarea");
|
|
2236
2257
|
return t.innerHTML = e, t.value;
|
|
2237
2258
|
}
|
|
2238
|
-
function
|
|
2259
|
+
function oi(e) {
|
|
2239
2260
|
let t = String(e ?? "");
|
|
2240
2261
|
for (let e = 0; e < 2; e += 1) try {
|
|
2241
2262
|
let e = decodeURIComponent(t);
|
|
@@ -2244,12 +2265,12 @@ function ai(e) {
|
|
|
2244
2265
|
} catch {
|
|
2245
2266
|
break;
|
|
2246
2267
|
}
|
|
2247
|
-
return t =
|
|
2268
|
+
return t = ai(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");
|
|
2248
2269
|
}
|
|
2249
|
-
function
|
|
2270
|
+
function si(e) {
|
|
2250
2271
|
return Ee.sanitize(String(e ?? ""), {
|
|
2251
|
-
ALLOWED_TAGS:
|
|
2252
|
-
ALLOWED_ATTR:
|
|
2272
|
+
ALLOWED_TAGS: Zr,
|
|
2273
|
+
ALLOWED_ATTR: Qr,
|
|
2253
2274
|
ALLOW_DATA_ATTR: !1,
|
|
2254
2275
|
FORBID_TAGS: [
|
|
2255
2276
|
"script",
|
|
@@ -2269,40 +2290,40 @@ function oi(e) {
|
|
|
2269
2290
|
]
|
|
2270
2291
|
});
|
|
2271
2292
|
}
|
|
2272
|
-
function
|
|
2293
|
+
function ci(e) {
|
|
2273
2294
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2274
2295
|
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);
|
|
2275
2296
|
}
|
|
2276
|
-
function
|
|
2297
|
+
function li(e) {
|
|
2277
2298
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2278
2299
|
}
|
|
2279
|
-
function
|
|
2300
|
+
function ui(e, t = {}) {
|
|
2280
2301
|
if (typeof e != "string") return e;
|
|
2281
|
-
if (t.type === "text-editor") return
|
|
2282
|
-
let n = e.normalize("NFC").replace(
|
|
2283
|
-
return n =
|
|
2302
|
+
if (t.type === "text-editor") return si(e.normalize("NFC"));
|
|
2303
|
+
let n = e.normalize("NFC").replace($r, "").replace(/\u00A0/g, " ").replace(ei, "");
|
|
2304
|
+
return n = li(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2284
2305
|
}
|
|
2285
|
-
function
|
|
2306
|
+
function di(e, t = {}) {
|
|
2286
2307
|
if (typeof e != "string" || e === "") return null;
|
|
2287
|
-
let n = t.label || t.field || "Field", r =
|
|
2308
|
+
let n = t.label || t.field || "Field", r = oi(e);
|
|
2288
2309
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2289
2310
|
if (t.type !== "text-editor") {
|
|
2290
|
-
let e =
|
|
2311
|
+
let e = ii.find(({ re: e }) => e.test(r));
|
|
2291
2312
|
if (e) return `${n}: ${e.message}`;
|
|
2292
2313
|
} else {
|
|
2293
|
-
let e =
|
|
2314
|
+
let e = ii.slice(0, 3).find(({ re: e }) => e.test(r));
|
|
2294
2315
|
if (e) return `${n}: ${e.message}`;
|
|
2295
2316
|
}
|
|
2296
|
-
let i =
|
|
2297
|
-
return [...i].length >
|
|
2317
|
+
let i = ui(e, t);
|
|
2318
|
+
return [...i].length > ci(t) ? `${n} is too long` : t.formatter === "name" && i && !ti.test(i) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && i && !ni.test(i) ? `${n} contains invalid phone characters` : t.type === "number" && i && !ri.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;
|
|
2298
2319
|
}
|
|
2299
|
-
function
|
|
2320
|
+
function fi(e) {
|
|
2300
2321
|
return { validator: (t, n) => {
|
|
2301
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2322
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => di(t, e)).find(Boolean);
|
|
2302
2323
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2303
2324
|
} };
|
|
2304
2325
|
}
|
|
2305
|
-
function
|
|
2326
|
+
function pi(e = []) {
|
|
2306
2327
|
let t = /* @__PURE__ */ new Map();
|
|
2307
2328
|
return e.forEach((e) => {
|
|
2308
2329
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2314,12 +2335,12 @@ function fi(e = []) {
|
|
|
2314
2335
|
});
|
|
2315
2336
|
}), t;
|
|
2316
2337
|
}
|
|
2317
|
-
function
|
|
2318
|
-
let n =
|
|
2338
|
+
function mi(e, t = []) {
|
|
2339
|
+
let n = pi(t), r = (e, t = "") => {
|
|
2319
2340
|
if (typeof e == "string") {
|
|
2320
|
-
let r = n.get(t) ?? {}, i =
|
|
2341
|
+
let r = n.get(t) ?? {}, i = di(e, r);
|
|
2321
2342
|
if (i) throw Error(i);
|
|
2322
|
-
return
|
|
2343
|
+
return ui(e, r);
|
|
2323
2344
|
}
|
|
2324
2345
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2325
2346
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2330,12 +2351,12 @@ function pi(e, t = []) {
|
|
|
2330
2351
|
}
|
|
2331
2352
|
//#endregion
|
|
2332
2353
|
//#region src/components/form/optionMatching.js
|
|
2333
|
-
function
|
|
2354
|
+
function hi(e) {
|
|
2334
2355
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2335
2356
|
}
|
|
2336
|
-
function
|
|
2357
|
+
function gi(e) {
|
|
2337
2358
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2338
|
-
let r =
|
|
2359
|
+
let r = hi(e);
|
|
2339
2360
|
r && !t.has(r) && t.set(r, n);
|
|
2340
2361
|
};
|
|
2341
2362
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2343,32 +2364,32 @@ function hi(e) {
|
|
|
2343
2364
|
let t = typeof e == "object" ? e.value : e;
|
|
2344
2365
|
t == null || t === "" || (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2345
2366
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2346
|
-
let i = t.get(
|
|
2367
|
+
let i = t.get(hi(r));
|
|
2347
2368
|
i !== void 0 && n(e, i);
|
|
2348
2369
|
}), t;
|
|
2349
2370
|
}
|
|
2350
|
-
var
|
|
2351
|
-
function
|
|
2371
|
+
var _i = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2372
|
+
function vi(e, t) {
|
|
2352
2373
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2353
|
-
let n = e.get(
|
|
2374
|
+
let n = e.get(hi(t));
|
|
2354
2375
|
return n === void 0 ? t : n;
|
|
2355
2376
|
}
|
|
2356
|
-
function
|
|
2357
|
-
if (!
|
|
2358
|
-
let n =
|
|
2359
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2377
|
+
function yi(e, t) {
|
|
2378
|
+
if (!_i(e)) return t;
|
|
2379
|
+
let n = gi(e);
|
|
2380
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => vi(n, e)) : vi(n, t);
|
|
2360
2381
|
}
|
|
2361
2382
|
//#endregion
|
|
2362
2383
|
//#region src/components/form/payloadTransformer.js
|
|
2363
|
-
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2364
|
-
function bi(e) {
|
|
2365
|
-
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2366
|
-
}
|
|
2384
|
+
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, bi = (e) => e === !0 || e === 1 || e === "1", B = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !xi(e);
|
|
2367
2385
|
function xi(e) {
|
|
2368
|
-
return
|
|
2386
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2369
2387
|
}
|
|
2370
2388
|
function Si(e) {
|
|
2371
|
-
return
|
|
2389
|
+
return xi(e) || e instanceof Date;
|
|
2390
|
+
}
|
|
2391
|
+
function Ci(e) {
|
|
2392
|
+
return e instanceof Date ? e.toISOString() : xi(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2372
2393
|
}
|
|
2373
2394
|
function V(e, t) {
|
|
2374
2395
|
if (!t) return;
|
|
@@ -2393,7 +2414,7 @@ function W(e, t, n) {
|
|
|
2393
2414
|
}
|
|
2394
2415
|
return i[r[r.length - 1]] = n, e;
|
|
2395
2416
|
}
|
|
2396
|
-
function
|
|
2417
|
+
function wi(e, t, n) {
|
|
2397
2418
|
let r = String(t).split("."), i = e;
|
|
2398
2419
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2399
2420
|
let t = r[e];
|
|
@@ -2405,24 +2426,24 @@ function Ci(e, t, n) {
|
|
|
2405
2426
|
...i[a]
|
|
2406
2427
|
} : n, e;
|
|
2407
2428
|
}
|
|
2408
|
-
function
|
|
2429
|
+
function Ti(e) {
|
|
2409
2430
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2410
2431
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2411
2432
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2412
2433
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2413
2434
|
}
|
|
2414
|
-
function
|
|
2435
|
+
function Ei(e, t) {
|
|
2415
2436
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2416
|
-
B(n) && B(e[t]) ?
|
|
2437
|
+
B(n) && B(e[t]) ? Ei(e[t], n) : e[t] = n;
|
|
2417
2438
|
}), e;
|
|
2418
2439
|
}
|
|
2419
|
-
function
|
|
2440
|
+
function Di(e, t) {
|
|
2420
2441
|
let n = e.options ?? e.values ?? [];
|
|
2421
2442
|
for (let e of n) if (typeof e == "string") {
|
|
2422
2443
|
if (e === t) return e;
|
|
2423
2444
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2424
2445
|
}
|
|
2425
|
-
function
|
|
2446
|
+
function Oi(e, t) {
|
|
2426
2447
|
if (B(e)) {
|
|
2427
2448
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2428
2449
|
return {
|
|
@@ -2432,10 +2453,10 @@ function Di(e, t) {
|
|
|
2432
2453
|
}
|
|
2433
2454
|
return {
|
|
2434
2455
|
value: e,
|
|
2435
|
-
label:
|
|
2456
|
+
label: Di(t, e) ?? e
|
|
2436
2457
|
};
|
|
2437
2458
|
}
|
|
2438
|
-
function
|
|
2459
|
+
function ki(e = {}) {
|
|
2439
2460
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2440
2461
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2441
2462
|
switch (e.type) {
|
|
@@ -2446,13 +2467,13 @@ function Oi(e = {}) {
|
|
|
2446
2467
|
}
|
|
2447
2468
|
}
|
|
2448
2469
|
function G(e, t, n = {}) {
|
|
2449
|
-
if (
|
|
2450
|
-
if (t === "string") return
|
|
2470
|
+
if (Si(e)) {
|
|
2471
|
+
if (t === "string") return Ci(e);
|
|
2451
2472
|
if (t === "number") {
|
|
2452
|
-
let t =
|
|
2473
|
+
let t = xi(e) ? e.valueOf() : e.getTime();
|
|
2453
2474
|
return Number.isNaN(t) ? null : t;
|
|
2454
2475
|
}
|
|
2455
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2476
|
+
if (t === "date" || t === "auto" || !t) return Ci(e);
|
|
2456
2477
|
}
|
|
2457
2478
|
switch (t) {
|
|
2458
2479
|
case "string": return e == null ? "" : String(e);
|
|
@@ -2467,14 +2488,14 @@ function G(e, t, n = {}) {
|
|
|
2467
2488
|
return t = Array.isArray(e) ? e : z(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => G(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2468
2489
|
}
|
|
2469
2490
|
case "object": return B(e), e;
|
|
2470
|
-
case "date": return
|
|
2491
|
+
case "date": return Ci(e);
|
|
2471
2492
|
case "custom":
|
|
2472
2493
|
case "auto":
|
|
2473
2494
|
case void 0:
|
|
2474
2495
|
default: return e;
|
|
2475
2496
|
}
|
|
2476
2497
|
}
|
|
2477
|
-
var
|
|
2498
|
+
var Ai = {
|
|
2478
2499
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2479
2500
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2480
2501
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2482,11 +2503,11 @@ var ki = {
|
|
|
2482
2503
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2483
2504
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2484
2505
|
};
|
|
2485
|
-
function
|
|
2506
|
+
function ji(e, t) {
|
|
2486
2507
|
if (!t) return e;
|
|
2487
2508
|
let n = t;
|
|
2488
2509
|
if (typeof n == "string") {
|
|
2489
|
-
if (
|
|
2510
|
+
if (Ai[n]) return Ai[n](e);
|
|
2490
2511
|
try {
|
|
2491
2512
|
n = JSON.parse(n);
|
|
2492
2513
|
} catch {
|
|
@@ -2494,14 +2515,14 @@ function Ai(e, t) {
|
|
|
2494
2515
|
}
|
|
2495
2516
|
}
|
|
2496
2517
|
let r = e;
|
|
2497
|
-
if (n.name &&
|
|
2518
|
+
if (n.name && Ai[n.name] && (r = Ai[n.name](r)), n.map && typeof n.map == "object") {
|
|
2498
2519
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2499
2520
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2500
2521
|
}
|
|
2501
2522
|
return r;
|
|
2502
2523
|
}
|
|
2503
|
-
var
|
|
2504
|
-
function
|
|
2524
|
+
var Mi = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2525
|
+
function Ni(e, t) {
|
|
2505
2526
|
let [n, ...r] = e.split("."), i;
|
|
2506
2527
|
if (n === "value") i = t.value;
|
|
2507
2528
|
else if (n === "label") i = t.label;
|
|
@@ -2509,24 +2530,24 @@ function Mi(e, t) {
|
|
|
2509
2530
|
else return;
|
|
2510
2531
|
return r.length ? V(i, r.join(".")) : i;
|
|
2511
2532
|
}
|
|
2512
|
-
function
|
|
2533
|
+
function Pi(e, t) {
|
|
2513
2534
|
if (typeof e == "string") {
|
|
2514
2535
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2515
|
-
return n ?
|
|
2516
|
-
let r =
|
|
2536
|
+
return n ? Ni(n[1], t) : e.replace(Mi, (e, n) => {
|
|
2537
|
+
let r = Ni(n, t);
|
|
2517
2538
|
return r == null ? "" : String(r);
|
|
2518
2539
|
});
|
|
2519
2540
|
}
|
|
2520
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2541
|
+
if (Array.isArray(e)) return e.map((e) => Pi(e, t));
|
|
2521
2542
|
if (B(e)) {
|
|
2522
2543
|
let n = {};
|
|
2523
2544
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2524
|
-
n[e] =
|
|
2545
|
+
n[e] = Pi(r, t);
|
|
2525
2546
|
}), n;
|
|
2526
2547
|
}
|
|
2527
2548
|
return e;
|
|
2528
2549
|
}
|
|
2529
|
-
function
|
|
2550
|
+
function Fi(e) {
|
|
2530
2551
|
if (!e) return null;
|
|
2531
2552
|
if (typeof e == "string") try {
|
|
2532
2553
|
return JSON.parse(e);
|
|
@@ -2535,8 +2556,8 @@ function Pi(e) {
|
|
|
2535
2556
|
}
|
|
2536
2557
|
return e;
|
|
2537
2558
|
}
|
|
2538
|
-
function
|
|
2539
|
-
let n = e.payloadMode || "auto", r =
|
|
2559
|
+
function Ii(e, t) {
|
|
2560
|
+
let n = e.payloadMode || "auto", r = ki(e), { value: i, label: a } = Oi(t, e);
|
|
2540
2561
|
switch (n) {
|
|
2541
2562
|
case "value": return {
|
|
2542
2563
|
kind: "scalar",
|
|
@@ -2558,12 +2579,12 @@ function Fi(e, t) {
|
|
|
2558
2579
|
}
|
|
2559
2580
|
case "custom":
|
|
2560
2581
|
case "template": {
|
|
2561
|
-
let n =
|
|
2582
|
+
let n = Fi(e.payloadTemplate);
|
|
2562
2583
|
if (!n) return {
|
|
2563
2584
|
kind: "scalar",
|
|
2564
2585
|
out: G(i, r, e)
|
|
2565
2586
|
};
|
|
2566
|
-
let o =
|
|
2587
|
+
let o = Pi(n, {
|
|
2567
2588
|
value: G(i, e.elementType || "auto", {}),
|
|
2568
2589
|
label: a,
|
|
2569
2590
|
raw: t
|
|
@@ -2579,15 +2600,15 @@ function Fi(e, t) {
|
|
|
2579
2600
|
};
|
|
2580
2601
|
}
|
|
2581
2602
|
}
|
|
2582
|
-
function
|
|
2603
|
+
function Li(e, t) {
|
|
2583
2604
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2584
2605
|
let n = t;
|
|
2585
|
-
return z(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n =
|
|
2606
|
+
return z(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = ji(n, e.transformRule), z(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (ki(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2586
2607
|
kind: "scalar",
|
|
2587
|
-
out: n.map((t) =>
|
|
2588
|
-
} :
|
|
2608
|
+
out: n.map((t) => Ii(e, t).out)
|
|
2609
|
+
} : Ii(e, n);
|
|
2589
2610
|
}
|
|
2590
|
-
function
|
|
2611
|
+
function Ri(e = {}) {
|
|
2591
2612
|
return !!e.richValue || [
|
|
2592
2613
|
"label",
|
|
2593
2614
|
"object",
|
|
@@ -2595,8 +2616,8 @@ function Li(e = {}) {
|
|
|
2595
2616
|
"template"
|
|
2596
2617
|
].includes(e.payloadMode);
|
|
2597
2618
|
}
|
|
2598
|
-
function
|
|
2599
|
-
if (!
|
|
2619
|
+
function zi(e, t, n = []) {
|
|
2620
|
+
if (!Ri(e) || t == null) return t;
|
|
2600
2621
|
let r = (e) => {
|
|
2601
2622
|
if (B(e) && e.value !== void 0) return e;
|
|
2602
2623
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2607,7 +2628,7 @@ function Ri(e, t, n = []) {
|
|
|
2607
2628
|
};
|
|
2608
2629
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2609
2630
|
}
|
|
2610
|
-
function
|
|
2631
|
+
function Bi(e, t, n) {
|
|
2611
2632
|
if (!e?.field) return !0;
|
|
2612
2633
|
let r = U(t, e.field) ? H(t, e.field) : H(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2613
2634
|
switch (e.operator) {
|
|
@@ -2621,45 +2642,45 @@ function zi(e, t, n) {
|
|
|
2621
2642
|
default: return !0;
|
|
2622
2643
|
}
|
|
2623
2644
|
}
|
|
2624
|
-
function
|
|
2645
|
+
function Vi(e) {
|
|
2625
2646
|
let t = [];
|
|
2626
2647
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2627
2648
|
e?.field && t.push(e.field);
|
|
2628
2649
|
}), t;
|
|
2629
2650
|
}
|
|
2630
|
-
function
|
|
2651
|
+
function Hi(e, t, n) {
|
|
2631
2652
|
if (!e) return !0;
|
|
2632
2653
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2633
2654
|
if (r.length) {
|
|
2634
|
-
let i = r.map((e) =>
|
|
2655
|
+
let i = r.map((e) => Bi(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2635
2656
|
if (e.field) {
|
|
2636
|
-
let r =
|
|
2657
|
+
let r = Bi(e, t, n);
|
|
2637
2658
|
o = a ? o || r : o && r;
|
|
2638
2659
|
}
|
|
2639
2660
|
return o;
|
|
2640
2661
|
}
|
|
2641
|
-
return
|
|
2662
|
+
return Bi(e, t, n);
|
|
2642
2663
|
}
|
|
2643
|
-
function
|
|
2644
|
-
let a =
|
|
2645
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2664
|
+
function Ui(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2665
|
+
let a = Vi(e?.showIf);
|
|
2666
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Hi(e.showIf, t, n) ? a.every((e) => {
|
|
2646
2667
|
let a = r?.get?.(e);
|
|
2647
|
-
return a ?
|
|
2668
|
+
return a ? Ui(a, t, n, r, i) : !0;
|
|
2648
2669
|
}) : !1);
|
|
2649
2670
|
}
|
|
2650
|
-
function
|
|
2671
|
+
function Wi(e = []) {
|
|
2651
2672
|
let t = /* @__PURE__ */ new Map();
|
|
2652
2673
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2653
2674
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2654
2675
|
})), t;
|
|
2655
2676
|
}
|
|
2656
|
-
function
|
|
2677
|
+
function Gi(e = {}, { editing: t = !1 } = {}) {
|
|
2657
2678
|
let n = {};
|
|
2658
2679
|
return (e.fields ?? []).forEach((e) => {
|
|
2659
2680
|
!e.field || K(e) || t && !e.defaultOnEdit || e.defaultValue === void 0 || e.defaultValue === "" || (n[e.field] = e.defaultValue);
|
|
2660
2681
|
}), n;
|
|
2661
2682
|
}
|
|
2662
|
-
function
|
|
2683
|
+
function Ki(e = []) {
|
|
2663
2684
|
let t = [];
|
|
2664
2685
|
return e.forEach((e) => {
|
|
2665
2686
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2670,7 +2691,7 @@ function Gi(e = []) {
|
|
|
2670
2691
|
});
|
|
2671
2692
|
}), t;
|
|
2672
2693
|
}
|
|
2673
|
-
var
|
|
2694
|
+
var qi = [
|
|
2674
2695
|
"file",
|
|
2675
2696
|
"document",
|
|
2676
2697
|
"image",
|
|
@@ -2678,19 +2699,19 @@ var Ki = [
|
|
|
2678
2699
|
"attachment"
|
|
2679
2700
|
];
|
|
2680
2701
|
function K(e) {
|
|
2681
|
-
return
|
|
2702
|
+
return qi.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2682
2703
|
}
|
|
2683
|
-
function
|
|
2684
|
-
return
|
|
2704
|
+
function Ji(e = []) {
|
|
2705
|
+
return Ki(e).map(({ field: e }) => e).filter(K);
|
|
2685
2706
|
}
|
|
2686
|
-
function
|
|
2707
|
+
function Yi(e) {
|
|
2687
2708
|
return String(e ?? "").trim().toLowerCase();
|
|
2688
2709
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return !!t &&
|
|
2710
|
+
function Xi(e, t) {
|
|
2711
|
+
return !!t && Yi(e.moduleName) === t;
|
|
2691
2712
|
}
|
|
2692
|
-
function
|
|
2693
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2713
|
+
function Zi(e, t = [], n = {}) {
|
|
2714
|
+
let r = [], i = n.scope ?? "all", a = Yi(n.module), o = (e, t) => {
|
|
2694
2715
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2695
2716
|
let n = t?.originFileObj || t;
|
|
2696
2717
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2702,7 +2723,7 @@ function Xi(e, t = [], n = {}) {
|
|
|
2702
2723
|
return (t ?? []).forEach((t) => {
|
|
2703
2724
|
let r = (t.fields ?? []).filter(K);
|
|
2704
2725
|
if (!r.length) return;
|
|
2705
|
-
let s = t.moduleName && !
|
|
2726
|
+
let s = t.moduleName && !Xi(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2706
2727
|
if (t.addRow) {
|
|
2707
2728
|
if (i === "flat") return;
|
|
2708
2729
|
let a = e[t.name];
|
|
@@ -2720,12 +2741,12 @@ function Xi(e, t = [], n = {}) {
|
|
|
2720
2741
|
});
|
|
2721
2742
|
}), r;
|
|
2722
2743
|
}
|
|
2723
|
-
function
|
|
2744
|
+
function Qi(e, t, n = {}) {
|
|
2724
2745
|
let r = B(n.base) ? structuredClone(n.base) : {};
|
|
2725
|
-
|
|
2726
|
-
(e.payloadKey || e.field) && (
|
|
2746
|
+
Ji(t).forEach((e) => {
|
|
2747
|
+
(e.payloadKey || e.field) && (ta(r, e.payloadKey || e.field), ta(r, e.field));
|
|
2727
2748
|
});
|
|
2728
|
-
let i =
|
|
2749
|
+
let i = Yi(n.module), a = Wi(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Xi(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2729
2750
|
return (t ?? []).forEach((t) => {
|
|
2730
2751
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && U(e, t.toggleField) ? !!H(e, t.toggleField) : !1;
|
|
2731
2752
|
if (t.toggleEnabled && t.toggleField && U(e, t.toggleField) && (W(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2735,25 +2756,25 @@ function Zi(e, t, n = {}) {
|
|
|
2735
2756
|
if (t.addRow) {
|
|
2736
2757
|
let i = e[t.name];
|
|
2737
2758
|
if (!Array.isArray(i)) return;
|
|
2738
|
-
W(n, t.payloadKey || t.name, i.map((t) =>
|
|
2759
|
+
W(n, t.payloadKey || t.name, i.map((t) => ea(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2739
2760
|
return;
|
|
2740
2761
|
}
|
|
2741
|
-
r.forEach((t) =>
|
|
2762
|
+
r.forEach((t) => $i(t, e, n, e, a));
|
|
2742
2763
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2743
2764
|
moduleName: e,
|
|
2744
2765
|
data: t
|
|
2745
|
-
}))),
|
|
2766
|
+
}))), mi(r, t);
|
|
2746
2767
|
}
|
|
2747
|
-
function
|
|
2768
|
+
function $i(e, t, n, r, i) {
|
|
2748
2769
|
if (K(e)) {
|
|
2749
|
-
let i =
|
|
2770
|
+
let i = Ti(H(t, e.field));
|
|
2750
2771
|
if (i !== void 0) {
|
|
2751
2772
|
let a = r !== void 0 && r !== t;
|
|
2752
|
-
|
|
2773
|
+
wi(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2753
2774
|
}
|
|
2754
2775
|
return;
|
|
2755
2776
|
}
|
|
2756
|
-
if (
|
|
2777
|
+
if (Vi(e.showIf).length && !Ui(e, t, r, i)) {
|
|
2757
2778
|
(r === void 0 || r === t) && U(t, e.field) && W(n, e.payloadKey || e.field, null);
|
|
2758
2779
|
return;
|
|
2759
2780
|
}
|
|
@@ -2761,30 +2782,30 @@ function Qi(e, t, n, r, i) {
|
|
|
2761
2782
|
if (!U(t, e.field)) return;
|
|
2762
2783
|
let a = H(t, e.field);
|
|
2763
2784
|
if (!Array.isArray(a)) return;
|
|
2764
|
-
let o = a.map((t) =>
|
|
2785
|
+
let o = a.map((t) => ea(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2765
2786
|
W(n, e.payloadKey || e.field, o);
|
|
2766
2787
|
return;
|
|
2767
2788
|
}
|
|
2768
2789
|
if (!U(t, e.field)) return;
|
|
2769
|
-
if (
|
|
2770
|
-
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a =
|
|
2790
|
+
if (bi(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2791
|
+
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a = ra(e), o = i.map((e) => Li(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2771
2792
|
W(n, e.payloadKey || e.field, o);
|
|
2772
2793
|
return;
|
|
2773
2794
|
}
|
|
2774
|
-
let a =
|
|
2795
|
+
let a = Li(e, H(t, e.field));
|
|
2775
2796
|
if (a.kind !== "skip") {
|
|
2776
2797
|
if (a.kind === "spread" && B(a.out)) {
|
|
2777
|
-
|
|
2798
|
+
Ei(n, a.out);
|
|
2778
2799
|
return;
|
|
2779
2800
|
}
|
|
2780
2801
|
W(n, e.payloadKey || e.field, a.out);
|
|
2781
2802
|
}
|
|
2782
2803
|
}
|
|
2783
|
-
function
|
|
2804
|
+
function ea(e, t, n, r) {
|
|
2784
2805
|
let i = {};
|
|
2785
|
-
return e.forEach((e) =>
|
|
2806
|
+
return e.forEach((e) => $i(e, t, i, n ?? t, r)), i;
|
|
2786
2807
|
}
|
|
2787
|
-
function
|
|
2808
|
+
function ta(e, t) {
|
|
2788
2809
|
let n = String(t).split("."), r = e;
|
|
2789
2810
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2790
2811
|
if (!B(r[n[e]])) return;
|
|
@@ -2792,7 +2813,7 @@ function ea(e, t) {
|
|
|
2792
2813
|
}
|
|
2793
2814
|
delete r[n[n.length - 1]];
|
|
2794
2815
|
}
|
|
2795
|
-
var
|
|
2816
|
+
var na = new Set([
|
|
2796
2817
|
"text",
|
|
2797
2818
|
"textarea",
|
|
2798
2819
|
"email",
|
|
@@ -2809,7 +2830,7 @@ function q(e, t) {
|
|
|
2809
2830
|
if (t == null) return r() ?? t;
|
|
2810
2831
|
if (n(t)) return r();
|
|
2811
2832
|
if (z(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
2812
|
-
if (
|
|
2833
|
+
if (na.has(e.type) && B(t)) {
|
|
2813
2834
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2814
2835
|
if (r === void 0 || B(r)) return;
|
|
2815
2836
|
t = r;
|
|
@@ -2819,8 +2840,8 @@ function q(e, t) {
|
|
|
2819
2840
|
let e = ge(t);
|
|
2820
2841
|
return e.isValid() ? e : null;
|
|
2821
2842
|
}
|
|
2822
|
-
t =
|
|
2823
|
-
let i = (t) => B(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type === "radio" ? !1 :
|
|
2843
|
+
t = yi(e, t);
|
|
2844
|
+
let i = (t) => B(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type === "radio" ? !1 : ki(e) === "array", o = (t) => {
|
|
2824
2845
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2825
2846
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2826
2847
|
return n ? n.value : t;
|
|
@@ -2832,7 +2853,7 @@ function q(e, t) {
|
|
|
2832
2853
|
}
|
|
2833
2854
|
return t;
|
|
2834
2855
|
}
|
|
2835
|
-
function
|
|
2856
|
+
function ra(e = {}) {
|
|
2836
2857
|
return {
|
|
2837
2858
|
...e,
|
|
2838
2859
|
addRow: !1,
|
|
@@ -2841,7 +2862,7 @@ function na(e = {}) {
|
|
|
2841
2862
|
dataType: void 0
|
|
2842
2863
|
};
|
|
2843
2864
|
}
|
|
2844
|
-
function
|
|
2865
|
+
function ia(e, t) {
|
|
2845
2866
|
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;
|
|
2846
2867
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2847
2868
|
let i = [];
|
|
@@ -2857,7 +2878,7 @@ function ra(e, t) {
|
|
|
2857
2878
|
for (; i.length < a;) i.push({});
|
|
2858
2879
|
return i;
|
|
2859
2880
|
}
|
|
2860
|
-
let i =
|
|
2881
|
+
let i = ra(e), a = [];
|
|
2861
2882
|
if (Array.isArray(t)) a = t.map((e) => q(i, e)).filter((e) => e != null && e !== "");
|
|
2862
2883
|
else if (t != null && t !== "") {
|
|
2863
2884
|
let e = q(i, t);
|
|
@@ -2869,12 +2890,12 @@ function ra(e, t) {
|
|
|
2869
2890
|
}
|
|
2870
2891
|
//#endregion
|
|
2871
2892
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2872
|
-
var
|
|
2873
|
-
function
|
|
2893
|
+
var aa = (e) => e === !0 || e === 1 || e === "1";
|
|
2894
|
+
function oa(e = []) {
|
|
2874
2895
|
let t = /* @__PURE__ */ new Map();
|
|
2875
2896
|
e.forEach((e) => {
|
|
2876
2897
|
let n = e?.linkGroup;
|
|
2877
|
-
!
|
|
2898
|
+
!aa(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2878
2899
|
});
|
|
2879
2900
|
let n = /* @__PURE__ */ new Map();
|
|
2880
2901
|
return t.forEach((e, t) => {
|
|
@@ -2884,11 +2905,11 @@ function aa(e = []) {
|
|
|
2884
2905
|
});
|
|
2885
2906
|
}), n;
|
|
2886
2907
|
}
|
|
2887
|
-
function
|
|
2908
|
+
function sa(e, t) {
|
|
2888
2909
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
2889
2910
|
return null;
|
|
2890
2911
|
}
|
|
2891
|
-
function
|
|
2912
|
+
function ca(e, t = {}) {
|
|
2892
2913
|
let n = { ...t };
|
|
2893
2914
|
return e.forEach(({ memberNames: e }) => {
|
|
2894
2915
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -2900,7 +2921,7 @@ function sa(e, t = {}) {
|
|
|
2900
2921
|
}
|
|
2901
2922
|
//#endregion
|
|
2902
2923
|
//#region src/services/aiActionApi.js
|
|
2903
|
-
async function
|
|
2924
|
+
async function la({ module: e, group: t, field: n, actionKey: a, inputs: o = {}, files: s = {} }) {
|
|
2904
2925
|
if (!e || !t || !n || !a) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
2905
2926
|
let c = await i(), l = new FormData();
|
|
2906
2927
|
l.append("json", JSON.stringify({ inputs: o })), Object.entries(s).forEach(([e, t]) => {
|
|
@@ -2926,7 +2947,7 @@ async function ca({ module: e, group: t, field: n, actionKey: a, inputs: o = {},
|
|
|
2926
2947
|
}
|
|
2927
2948
|
//#endregion
|
|
2928
2949
|
//#region src/components/detail/renderConfig.js
|
|
2929
|
-
var
|
|
2950
|
+
var ua = [
|
|
2930
2951
|
{
|
|
2931
2952
|
value: "auto",
|
|
2932
2953
|
label: "Default (auto)"
|
|
@@ -2983,7 +3004,7 @@ var la = [
|
|
|
2983
3004
|
value: "html",
|
|
2984
3005
|
label: "HTML"
|
|
2985
3006
|
}
|
|
2986
|
-
],
|
|
3007
|
+
], da = [
|
|
2987
3008
|
{
|
|
2988
3009
|
value: "preview",
|
|
2989
3010
|
label: "Preview (viewer)"
|
|
@@ -3004,7 +3025,7 @@ var la = [
|
|
|
3004
3025
|
value: "text",
|
|
3005
3026
|
label: "Text (filename)"
|
|
3006
3027
|
}
|
|
3007
|
-
],
|
|
3028
|
+
], fa = [
|
|
3008
3029
|
{
|
|
3009
3030
|
value: "none",
|
|
3010
3031
|
label: "None"
|
|
@@ -3021,37 +3042,37 @@ var la = [
|
|
|
3021
3042
|
value: "title",
|
|
3022
3043
|
label: "Title Case"
|
|
3023
3044
|
}
|
|
3024
|
-
],
|
|
3045
|
+
], pa = [
|
|
3025
3046
|
"location",
|
|
3026
3047
|
"path",
|
|
3027
3048
|
"url",
|
|
3028
3049
|
"key"
|
|
3029
|
-
],
|
|
3050
|
+
], ma = [
|
|
3030
3051
|
"location",
|
|
3031
3052
|
"filepath",
|
|
3032
3053
|
"path",
|
|
3033
3054
|
"url",
|
|
3034
3055
|
"key"
|
|
3035
|
-
],
|
|
3056
|
+
], ha = [
|
|
3036
3057
|
"uploadedfilename",
|
|
3037
3058
|
"uploadname",
|
|
3038
3059
|
"originalname",
|
|
3039
3060
|
"displayname",
|
|
3040
3061
|
"documentname",
|
|
3041
3062
|
"filename"
|
|
3042
|
-
],
|
|
3043
|
-
function
|
|
3063
|
+
], ga = ["name"], _a = (e) => String(e).toLowerCase(), va = (e) => e == null || e === "";
|
|
3064
|
+
function ya(e, t) {
|
|
3044
3065
|
for (let n of t) {
|
|
3045
3066
|
let t = e[n];
|
|
3046
3067
|
if (typeof t == "string" && t) return t;
|
|
3047
3068
|
}
|
|
3048
3069
|
return "";
|
|
3049
3070
|
}
|
|
3050
|
-
function
|
|
3051
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3071
|
+
function ba(e, t) {
|
|
3072
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && _a(t).endsWith(n)) return r;
|
|
3052
3073
|
return "";
|
|
3053
3074
|
}
|
|
3054
|
-
function
|
|
3075
|
+
function xa(e) {
|
|
3055
3076
|
if (!e) return "";
|
|
3056
3077
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3057
3078
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
@@ -3060,31 +3081,31 @@ function J(e) {
|
|
|
3060
3081
|
if (!e) return "";
|
|
3061
3082
|
let t = String(e);
|
|
3062
3083
|
if (/^https?:\/\//i.test(t)) return t;
|
|
3063
|
-
let n =
|
|
3084
|
+
let n = zr().s3BaseUrl || "";
|
|
3064
3085
|
return n ? `${n}/${t.replace(/^\/+/, "")}` : "";
|
|
3065
3086
|
}
|
|
3066
|
-
function xa(e) {
|
|
3067
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : va(e, fa) || ya(e, pa);
|
|
3068
|
-
}
|
|
3069
3087
|
function Sa(e) {
|
|
3070
|
-
return
|
|
3088
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : ya(e, pa) || ba(e, ma);
|
|
3071
3089
|
}
|
|
3072
3090
|
function Ca(e) {
|
|
3073
|
-
|
|
3091
|
+
return e ? typeof e == "string" ? xa(e) || e : typeof e == "object" && (ya(e, zr().documentNameOrder ?? []) || ba(e, ha) || xa(Sa(e)) || ba(e, ga)) || "Document" : "Document";
|
|
3092
|
+
}
|
|
3093
|
+
function wa(e) {
|
|
3094
|
+
if (va(e)) return [];
|
|
3074
3095
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3075
|
-
for (let e of t) if (!
|
|
3096
|
+
for (let e of t) if (!va(e)) {
|
|
3076
3097
|
if (typeof e == "string") {
|
|
3077
3098
|
let t = e.includes("/") ? e : "";
|
|
3078
3099
|
n.push({
|
|
3079
3100
|
location: t,
|
|
3080
|
-
name:
|
|
3101
|
+
name: xa(e) || e,
|
|
3081
3102
|
url: J(t)
|
|
3082
3103
|
});
|
|
3083
3104
|
} else if (typeof e == "object") {
|
|
3084
|
-
let t =
|
|
3105
|
+
let t = Sa(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3085
3106
|
n.push({
|
|
3086
3107
|
location: t,
|
|
3087
|
-
name:
|
|
3108
|
+
name: Ca(e),
|
|
3088
3109
|
url: r || J(t)
|
|
3089
3110
|
});
|
|
3090
3111
|
}
|
|
@@ -3093,12 +3114,12 @@ function Ca(e) {
|
|
|
3093
3114
|
}
|
|
3094
3115
|
//#endregion
|
|
3095
3116
|
//#region src/components/form/applyGroupValues.js
|
|
3096
|
-
var
|
|
3097
|
-
function
|
|
3117
|
+
var Ta = (e) => e === !0 || e === 1 || e === "1", Ea = (e) => e == null || e === "";
|
|
3118
|
+
function Da(e) {
|
|
3098
3119
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3099
3120
|
}
|
|
3100
3121
|
function Y(e, t, n) {
|
|
3101
|
-
let r = Array.isArray(t) ? t :
|
|
3122
|
+
let r = Array.isArray(t) ? t : Da(t);
|
|
3102
3123
|
if (!r.length) return e;
|
|
3103
3124
|
let i = e;
|
|
3104
3125
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3107,23 +3128,23 @@ function Y(e, t, n) {
|
|
|
3107
3128
|
}
|
|
3108
3129
|
return i[r[r.length - 1]] = n, e;
|
|
3109
3130
|
}
|
|
3110
|
-
function
|
|
3131
|
+
function Oa(e, t = []) {
|
|
3111
3132
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3112
3133
|
if (!n) continue;
|
|
3113
3134
|
let t = V(e, n);
|
|
3114
|
-
if (!
|
|
3135
|
+
if (!Ea(t)) return t;
|
|
3115
3136
|
}
|
|
3116
3137
|
}
|
|
3117
3138
|
function X(e, t) {
|
|
3118
3139
|
if (!e || typeof e != "object") return;
|
|
3119
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3140
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Ea(n));
|
|
3120
3141
|
if (r) return r[1];
|
|
3121
3142
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3122
3143
|
let n = X(e, t);
|
|
3123
|
-
if (!
|
|
3144
|
+
if (!Ea(n)) return n;
|
|
3124
3145
|
}
|
|
3125
3146
|
}
|
|
3126
|
-
function
|
|
3147
|
+
function ka(e, t) {
|
|
3127
3148
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3128
3149
|
if (!n.length) return;
|
|
3129
3150
|
let r = n.map((e, n) => {
|
|
@@ -3133,7 +3154,7 @@ function Oa(e, t) {
|
|
|
3133
3154
|
status: "done"
|
|
3134
3155
|
};
|
|
3135
3156
|
if (!e || typeof e != "object") return null;
|
|
3136
|
-
let r =
|
|
3157
|
+
let r = Oa(e, [t.fileUrlKey, t.locationKey]) ?? X(e, /(location|url|path)$/i) ?? "", i = Oa(e, [t.fileNameKey]) ?? X(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3137
3158
|
if (!r && !i) return null;
|
|
3138
3159
|
let a = r && !String(r).startsWith("http") ? J(r) : r;
|
|
3139
3160
|
return {
|
|
@@ -3147,9 +3168,9 @@ function Oa(e, t) {
|
|
|
3147
3168
|
}).filter(Boolean);
|
|
3148
3169
|
return r.length ? r : void 0;
|
|
3149
3170
|
}
|
|
3150
|
-
function
|
|
3171
|
+
function Aa(e, t) {
|
|
3151
3172
|
if (!e || typeof e != "object") return;
|
|
3152
|
-
let n =
|
|
3173
|
+
let n = Oa(e, [t.fileNameKey, t.field]) ?? X(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Oa(e, [t.fileUrlKey, t.locationKey]) ?? X(e, /(location|url|path)$/i) ?? "";
|
|
3153
3174
|
if (!n && !r) return;
|
|
3154
3175
|
let i = r && !String(r).startsWith("http") ? J(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3155
3176
|
return [{
|
|
@@ -3160,7 +3181,7 @@ function ka(e, t) {
|
|
|
3160
3181
|
url: i || void 0
|
|
3161
3182
|
}];
|
|
3162
3183
|
}
|
|
3163
|
-
function
|
|
3184
|
+
function ja(e) {
|
|
3164
3185
|
let t = Array.isArray(e.rows) ? e.rows : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3165
3186
|
let i = {};
|
|
3166
3187
|
return (e.fields ?? []).forEach((e) => {
|
|
@@ -3175,26 +3196,26 @@ function Aa(e) {
|
|
|
3175
3196
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Y(i, e.field, e.defaultValue);
|
|
3176
3197
|
return;
|
|
3177
3198
|
}
|
|
3178
|
-
Y(i, e.field,
|
|
3199
|
+
Y(i, e.field, Ta(e.addRow) ? ia(e, a) : q(e, a));
|
|
3179
3200
|
}), i;
|
|
3180
|
-
}, i =
|
|
3201
|
+
}, i = Gi(e, { editing: !0 });
|
|
3181
3202
|
if (t && t.length > 0) {
|
|
3182
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3203
|
+
let e = t.map((e) => r(e, (e, t) => Aa(e, t), (e, t) => V(e, t.field)));
|
|
3183
3204
|
for (; e.length < n;) e.push({ ...i });
|
|
3184
3205
|
return e;
|
|
3185
3206
|
}
|
|
3186
|
-
let a = r(e, (e, t) =>
|
|
3207
|
+
let a = r(e, (e, t) => ka(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3187
3208
|
for (; o.length < n;) o.push({ ...i });
|
|
3188
3209
|
return o;
|
|
3189
3210
|
}
|
|
3190
|
-
function
|
|
3211
|
+
function Ma(e, t = []) {
|
|
3191
3212
|
let n = {};
|
|
3192
3213
|
return t.forEach((e) => {
|
|
3193
3214
|
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3194
3215
|
if (!e.field || e.addRow) return;
|
|
3195
3216
|
let t = e.value, r = e.field;
|
|
3196
3217
|
if (e.type === "file") {
|
|
3197
|
-
let i =
|
|
3218
|
+
let i = ka(t, e);
|
|
3198
3219
|
i && Y(n, r, i);
|
|
3199
3220
|
return;
|
|
3200
3221
|
}
|
|
@@ -3204,7 +3225,7 @@ function ja(e, t = []) {
|
|
|
3204
3225
|
if (i) {
|
|
3205
3226
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3206
3227
|
Y(n, r, e ? [e[0]] : []);
|
|
3207
|
-
} else Y(n, r,
|
|
3228
|
+
} else Y(n, r, yi(e, Array.isArray(t) ? t : [t]));
|
|
3208
3229
|
return;
|
|
3209
3230
|
}
|
|
3210
3231
|
Y(n, r, q(e, t));
|
|
@@ -3214,27 +3235,27 @@ function ja(e, t = []) {
|
|
|
3214
3235
|
}
|
|
3215
3236
|
//#endregion
|
|
3216
3237
|
//#region src/components/form/useAiActions.js
|
|
3217
|
-
function
|
|
3238
|
+
function Na(e) {
|
|
3218
3239
|
let t = document.createElement("div");
|
|
3219
3240
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3220
3241
|
}
|
|
3221
|
-
function
|
|
3222
|
-
return t && t === "stripHtml" ?
|
|
3242
|
+
function Pa(e, t) {
|
|
3243
|
+
return t && t === "stripHtml" ? Na(e) : e;
|
|
3223
3244
|
}
|
|
3224
|
-
function
|
|
3245
|
+
function Fa(e) {
|
|
3225
3246
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3226
3247
|
}
|
|
3227
|
-
function
|
|
3248
|
+
function Ia(e) {
|
|
3228
3249
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3229
3250
|
}
|
|
3230
|
-
function
|
|
3251
|
+
function La(e, t) {
|
|
3231
3252
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3232
|
-
let n =
|
|
3253
|
+
let n = Pa(t, e.transform), r = String(n ?? "").trim();
|
|
3233
3254
|
if (!r) return !1;
|
|
3234
3255
|
let i = Number(e.minWords) || 0;
|
|
3235
|
-
return i > 0 ?
|
|
3256
|
+
return i > 0 ? Fa(r) >= i : !0;
|
|
3236
3257
|
}
|
|
3237
|
-
function
|
|
3258
|
+
function Ra(e, t) {
|
|
3238
3259
|
let n = e.inputs || [];
|
|
3239
3260
|
if (n.length === 0) return !0;
|
|
3240
3261
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3242,35 +3263,35 @@ function La(e, t) {
|
|
|
3242
3263
|
let n = e.group || `__solo_${t}`;
|
|
3243
3264
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3244
3265
|
});
|
|
3245
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3266
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => La(e, t(e.sourceField)))) return !1;
|
|
3246
3267
|
return !0;
|
|
3247
3268
|
}
|
|
3248
|
-
var
|
|
3269
|
+
var za = [
|
|
3249
3270
|
"top-left",
|
|
3250
3271
|
"top-center",
|
|
3251
3272
|
"top-right",
|
|
3252
3273
|
"bottom-left",
|
|
3253
3274
|
"bottom-center",
|
|
3254
3275
|
"bottom-right"
|
|
3255
|
-
],
|
|
3256
|
-
function
|
|
3276
|
+
], Ba = "bottom-left";
|
|
3277
|
+
function Va(e = []) {
|
|
3257
3278
|
let t = {};
|
|
3258
3279
|
return e.forEach((e) => {
|
|
3259
|
-
let n =
|
|
3280
|
+
let n = za.includes(e.position) ? e.position : Ba;
|
|
3260
3281
|
(t[n] ??= []).push(e);
|
|
3261
3282
|
}), t;
|
|
3262
3283
|
}
|
|
3263
|
-
function
|
|
3264
|
-
let [r, i] = g(null), a = y.useWatch((e) => e, e), o = f((e) =>
|
|
3284
|
+
function Ha({ form: e, groups: t, module: n }) {
|
|
3285
|
+
let [r, i] = g(null), a = y.useWatch((e) => e, e), o = f((e) => Ra(e, (e) => (a || {})[e]), [a]), s = f((t) => {
|
|
3265
3286
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3266
|
-
let n =
|
|
3287
|
+
let n = Ma(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3267
3288
|
return t.forEach((t) => {
|
|
3268
3289
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3269
|
-
let n =
|
|
3290
|
+
let n = ja(t);
|
|
3270
3291
|
if (n.length === 0) return;
|
|
3271
3292
|
r = !0;
|
|
3272
3293
|
let i = () => e.setFieldsValue({ [t.name]: n }), a = e.getFieldValue(t.name) || [];
|
|
3273
|
-
a.some(
|
|
3294
|
+
a.some(Ia) ? b.confirm({
|
|
3274
3295
|
title: "Replace existing rows?",
|
|
3275
3296
|
content: `This will replace ${a.length} existing row(s) in "${t.label || t.name}".`,
|
|
3276
3297
|
okText: "Replace",
|
|
@@ -3290,12 +3311,12 @@ function Va({ form: e, groups: t, module: n }) {
|
|
|
3290
3311
|
r && (c[t.param] = r);
|
|
3291
3312
|
} else {
|
|
3292
3313
|
let n = e.getFieldValue(t.sourceField);
|
|
3293
|
-
n != null && n !== "" && (i[t.param] =
|
|
3314
|
+
n != null && n !== "" && (i[t.param] = Pa(n, t.transform));
|
|
3294
3315
|
}
|
|
3295
3316
|
}), (a.inputs || []).forEach((e) => {
|
|
3296
3317
|
!e.group || e.kind !== "text" || (a.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete i[e.param];
|
|
3297
3318
|
});
|
|
3298
|
-
let l = await
|
|
3319
|
+
let l = await la({
|
|
3299
3320
|
module: n,
|
|
3300
3321
|
group: t,
|
|
3301
3322
|
field: r.field,
|
|
@@ -3322,7 +3343,7 @@ function Va({ form: e, groups: t, module: n }) {
|
|
|
3322
3343
|
}
|
|
3323
3344
|
//#endregion
|
|
3324
3345
|
//#region src/components/form/AiActionButtons.jsx
|
|
3325
|
-
function
|
|
3346
|
+
function Ua({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3326
3347
|
return !t || t.length === 0 ? null : /* @__PURE__ */ C(ee, {
|
|
3327
3348
|
size: 8,
|
|
3328
3349
|
className: "v1-ai-action-buttons",
|
|
@@ -3341,18 +3362,18 @@ function Ha({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3341
3362
|
}
|
|
3342
3363
|
//#endregion
|
|
3343
3364
|
//#region src/components/form/emailValidator.js
|
|
3344
|
-
function
|
|
3365
|
+
function Wa(e) {
|
|
3345
3366
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3346
3367
|
if (!n) return !1;
|
|
3347
3368
|
let [, r, i] = n;
|
|
3348
3369
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3349
3370
|
}
|
|
3350
|
-
function
|
|
3351
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3371
|
+
function Ga(e = "Email", t) {
|
|
3372
|
+
return { validator: (n, r) => r == null || r === "" || Wa(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3352
3373
|
}
|
|
3353
3374
|
//#endregion
|
|
3354
3375
|
//#region src/components/form/inputValidator.js
|
|
3355
|
-
var
|
|
3376
|
+
var Ka = [
|
|
3356
3377
|
{
|
|
3357
3378
|
label: "Only Numbers",
|
|
3358
3379
|
value: "onlyNumber"
|
|
@@ -3421,7 +3442,7 @@ var Ga = [
|
|
|
3421
3442
|
label: "Website URL",
|
|
3422
3443
|
value: "websiteUrl"
|
|
3423
3444
|
}
|
|
3424
|
-
],
|
|
3445
|
+
], qa = {
|
|
3425
3446
|
onlyNumber: /^[0-9]$/,
|
|
3426
3447
|
experience: /^[0-9]$/,
|
|
3427
3448
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3436,10 +3457,10 @@ var Ga = [
|
|
|
3436
3457
|
decimalRange: /^[0-9.]$/,
|
|
3437
3458
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3438
3459
|
};
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3460
|
+
function Ja(e) {
|
|
3461
|
+
return qa[e] ?? null;
|
|
3441
3462
|
}
|
|
3442
|
-
function
|
|
3463
|
+
function Ya(e, t = {}, n = "change") {
|
|
3443
3464
|
if (!t?.type || e == null) return {
|
|
3444
3465
|
cleaned: e ?? "",
|
|
3445
3466
|
error: null
|
|
@@ -3517,7 +3538,7 @@ function Ja(e, t = {}, n = "change") {
|
|
|
3517
3538
|
break;
|
|
3518
3539
|
}
|
|
3519
3540
|
case "email":
|
|
3520
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
3541
|
+
c = n === "blur" ? r.trim() : r, c && !Wa(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3521
3542
|
break;
|
|
3522
3543
|
case "websiteUrl":
|
|
3523
3544
|
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.`);
|
|
@@ -3529,9 +3550,260 @@ function Ja(e, t = {}, n = "change") {
|
|
|
3529
3550
|
error: l
|
|
3530
3551
|
};
|
|
3531
3552
|
}
|
|
3553
|
+
var Xa = "This value is already present";
|
|
3554
|
+
function Za(e) {
|
|
3555
|
+
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
3556
|
+
}
|
|
3557
|
+
function Qa(e) {
|
|
3558
|
+
if (Za(e) !== "unique") return null;
|
|
3559
|
+
if (typeof e == "string") return {
|
|
3560
|
+
message: Xa,
|
|
3561
|
+
normalizer: "trim",
|
|
3562
|
+
skipBlank: !0,
|
|
3563
|
+
validateOn: "blur"
|
|
3564
|
+
};
|
|
3565
|
+
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
3566
|
+
return {
|
|
3567
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : Xa,
|
|
3568
|
+
collectionField: t.collectionField ?? "",
|
|
3569
|
+
normalizer: String(t.normalizer ?? "trim"),
|
|
3570
|
+
skipBlank: t.skipBlank !== !1,
|
|
3571
|
+
validateOn: [
|
|
3572
|
+
"blur",
|
|
3573
|
+
"change",
|
|
3574
|
+
"submit"
|
|
3575
|
+
].includes(n) ? n : "blur"
|
|
3576
|
+
};
|
|
3577
|
+
}
|
|
3578
|
+
function $a(e) {
|
|
3579
|
+
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
3580
|
+
if (!Array.isArray(t)) return null;
|
|
3581
|
+
for (let e of t) {
|
|
3582
|
+
let t = Qa(e);
|
|
3583
|
+
if (t) return t;
|
|
3584
|
+
}
|
|
3585
|
+
return null;
|
|
3586
|
+
}
|
|
3587
|
+
function eo(e = []) {
|
|
3588
|
+
let t = [];
|
|
3589
|
+
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3590
|
+
(e?.fields ?? []).forEach((e) => {
|
|
3591
|
+
let n = $a(e);
|
|
3592
|
+
!n || !e?.field || t.push({
|
|
3593
|
+
field: e.field,
|
|
3594
|
+
label: e.label ?? e.field,
|
|
3595
|
+
rule: n
|
|
3596
|
+
});
|
|
3597
|
+
});
|
|
3598
|
+
}), t;
|
|
3599
|
+
}
|
|
3600
|
+
function to(e) {
|
|
3601
|
+
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
3602
|
+
}
|
|
3603
|
+
function no(e, t = "trim") {
|
|
3604
|
+
if (e == null) return "";
|
|
3605
|
+
let n = String(e);
|
|
3606
|
+
switch (String(t)) {
|
|
3607
|
+
case "exact": return n;
|
|
3608
|
+
case "lower":
|
|
3609
|
+
case "trimLower":
|
|
3610
|
+
case "email": return n.trim().toLowerCase();
|
|
3611
|
+
case "digitsOnly": return n.replace(/\D+/g, "");
|
|
3612
|
+
default: return n.trim();
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
function ro(e, t) {
|
|
3616
|
+
return !(!e || e.skipBlank !== !1 && to(t));
|
|
3617
|
+
}
|
|
3618
|
+
function io(e) {
|
|
3619
|
+
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
3620
|
+
}
|
|
3621
|
+
var Z = {
|
|
3622
|
+
SKIPPED: "skipped",
|
|
3623
|
+
AVAILABLE: "available",
|
|
3624
|
+
DUPLICATE: "duplicate",
|
|
3625
|
+
STALE: "stale",
|
|
3626
|
+
ERROR: "error"
|
|
3627
|
+
};
|
|
3628
|
+
function ao({ module: e, field: t, recordId: n, normalized: r }) {
|
|
3629
|
+
return `${e}${t}${n ?? ""}${r}`;
|
|
3630
|
+
}
|
|
3631
|
+
function oo({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
3632
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
3633
|
+
function o(e) {
|
|
3634
|
+
a = e, typeof t == "function" && t(a);
|
|
3635
|
+
}
|
|
3636
|
+
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
3637
|
+
if (!c || !t || !s || typeof e != "function" || !ro(c, l)) return { status: Z.SKIPPED };
|
|
3638
|
+
let p = ao({
|
|
3639
|
+
module: t,
|
|
3640
|
+
field: s,
|
|
3641
|
+
recordId: u,
|
|
3642
|
+
normalized: no(l, c.normalizer)
|
|
3643
|
+
});
|
|
3644
|
+
if (n.has(p)) return n.get(p);
|
|
3645
|
+
i += 1;
|
|
3646
|
+
let m = i;
|
|
3647
|
+
r.set(s, m), o(a + 1);
|
|
3648
|
+
try {
|
|
3649
|
+
let i = await e({
|
|
3650
|
+
module: t,
|
|
3651
|
+
field: s,
|
|
3652
|
+
value: l,
|
|
3653
|
+
recordId: u,
|
|
3654
|
+
clientId: d,
|
|
3655
|
+
region: f
|
|
3656
|
+
});
|
|
3657
|
+
if (r.get(s) !== m) return { status: Z.STALE };
|
|
3658
|
+
let a = i?.available === !1 ? {
|
|
3659
|
+
status: Z.DUPLICATE,
|
|
3660
|
+
message: so(i) || c.message || Xa
|
|
3661
|
+
} : { status: Z.AVAILABLE };
|
|
3662
|
+
return n.set(p, a), a;
|
|
3663
|
+
} catch (e) {
|
|
3664
|
+
return r.get(s) === m ? {
|
|
3665
|
+
status: Z.ERROR,
|
|
3666
|
+
error: e
|
|
3667
|
+
} : { status: Z.STALE };
|
|
3668
|
+
} finally {
|
|
3669
|
+
o(Math.max(0, a - 1));
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
return {
|
|
3673
|
+
check: s,
|
|
3674
|
+
isPending: () => a > 0,
|
|
3675
|
+
pendingCount: () => a,
|
|
3676
|
+
reset: () => {
|
|
3677
|
+
n.clear(), r.clear();
|
|
3678
|
+
}
|
|
3679
|
+
};
|
|
3680
|
+
}
|
|
3681
|
+
function so(e) {
|
|
3682
|
+
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
3683
|
+
}
|
|
3684
|
+
var co = "__uniqueRule";
|
|
3685
|
+
function lo({ field: e, validation: t, context: n }) {
|
|
3686
|
+
let r = Qa(t);
|
|
3687
|
+
if (!r) return { validator: () => Promise.resolve() };
|
|
3688
|
+
let i = e?.field ?? "";
|
|
3689
|
+
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
3690
|
+
[co]: r,
|
|
3691
|
+
validateTrigger: io(r),
|
|
3692
|
+
validator: async (e, t) => {
|
|
3693
|
+
let a = await n.checker.check({
|
|
3694
|
+
module: n.module,
|
|
3695
|
+
field: i,
|
|
3696
|
+
rule: r,
|
|
3697
|
+
value: t,
|
|
3698
|
+
recordId: n.recordId,
|
|
3699
|
+
clientId: n.clientId,
|
|
3700
|
+
region: n.region
|
|
3701
|
+
});
|
|
3702
|
+
return a.status === Z.DUPLICATE ? Promise.reject(Error(a.message || r.message)) : Promise.resolve();
|
|
3703
|
+
}
|
|
3704
|
+
};
|
|
3705
|
+
}
|
|
3706
|
+
function uo(e = []) {
|
|
3707
|
+
let t = Array.isArray(e) ? e : [];
|
|
3708
|
+
if (!t.some((e) => e && e[co])) return t;
|
|
3709
|
+
let n = t.filter((e) => e && !e[co]);
|
|
3710
|
+
return t.map((e) => {
|
|
3711
|
+
if (!e || !e[co]) return e;
|
|
3712
|
+
let t = e.validator;
|
|
3713
|
+
return {
|
|
3714
|
+
...e,
|
|
3715
|
+
validator: async (e, r) => await fo(n, r, e) ? Promise.resolve() : t(e, r)
|
|
3716
|
+
};
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
async function fo(e = [], t, n = {}) {
|
|
3720
|
+
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
3721
|
+
if (r.required && to(t) || !to(t) && (r.pattern instanceof RegExp && !new RegExp(r.pattern.source, r.pattern.flags).test(String(t)) || r.len != null && String(t).length !== Number(r.len))) return !0;
|
|
3722
|
+
if (typeof r.validator == "function") try {
|
|
3723
|
+
await r.validator(n, t);
|
|
3724
|
+
} catch {
|
|
3725
|
+
return !0;
|
|
3726
|
+
}
|
|
3727
|
+
}
|
|
3728
|
+
return !1;
|
|
3729
|
+
}
|
|
3730
|
+
function po(e) {
|
|
3731
|
+
let t = String(e ?? "").trim();
|
|
3732
|
+
if (!t.startsWith("{")) return null;
|
|
3733
|
+
try {
|
|
3734
|
+
return JSON.parse(t);
|
|
3735
|
+
} catch {
|
|
3736
|
+
return null;
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
function mo(e) {
|
|
3740
|
+
if (!e) return null;
|
|
3741
|
+
if (typeof e == "string") return po(e);
|
|
3742
|
+
let t = [
|
|
3743
|
+
e.data,
|
|
3744
|
+
e.response,
|
|
3745
|
+
e,
|
|
3746
|
+
po(e.message)
|
|
3747
|
+
];
|
|
3748
|
+
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
3749
|
+
return null;
|
|
3750
|
+
}
|
|
3751
|
+
function ho(e, { uniqueRules: t = [] } = {}) {
|
|
3752
|
+
let n = mo(e);
|
|
3753
|
+
if (n) {
|
|
3754
|
+
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => ({
|
|
3755
|
+
field: e.field,
|
|
3756
|
+
message: e.message || n.message || Xa
|
|
3757
|
+
}));
|
|
3758
|
+
if (e.length) return e;
|
|
3759
|
+
}
|
|
3760
|
+
let r = String((n && (n.message || n.error)) ?? (typeof e == "string" ? e : e?.message) ?? "").trim();
|
|
3761
|
+
if (!r) return [];
|
|
3762
|
+
let i = e?.status === 409 || n?.code === "DUPLICATE_VALUE", a = t.filter((e) => String(e?.rule?.message ?? "").trim().toLowerCase() === r.toLowerCase());
|
|
3763
|
+
return a.length && (i || a.length === 1) ? a.map((e) => ({
|
|
3764
|
+
field: e.field,
|
|
3765
|
+
message: r
|
|
3766
|
+
})) : [];
|
|
3767
|
+
}
|
|
3768
|
+
//#endregion
|
|
3769
|
+
//#region src/services/uniqueValidationApi.js
|
|
3770
|
+
async function go({ module: e, field: t, value: i, recordId: a, clientId: o, region: s } = {}) {
|
|
3771
|
+
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
3772
|
+
let c = {
|
|
3773
|
+
field: t,
|
|
3774
|
+
value: i ?? ""
|
|
3775
|
+
};
|
|
3776
|
+
a && (c.recordId = String(a)), o && (c.clientId = String(o)), s && (c.region = String(s));
|
|
3777
|
+
try {
|
|
3778
|
+
let t = await n(r, `/module/validate-unique?module=${encodeURIComponent(e)}`, {
|
|
3779
|
+
method: "POST",
|
|
3780
|
+
headers: { "Content-Type": "application/json" },
|
|
3781
|
+
body: JSON.stringify(c)
|
|
3782
|
+
}), i = t?.available !== !1;
|
|
3783
|
+
return {
|
|
3784
|
+
available: i,
|
|
3785
|
+
duplicate: !i,
|
|
3786
|
+
message: t?.message ?? "",
|
|
3787
|
+
errors: Array.isArray(t?.errors) ? t.errors : [],
|
|
3788
|
+
response: t
|
|
3789
|
+
};
|
|
3790
|
+
} catch (e) {
|
|
3791
|
+
if (e?.status === 409) {
|
|
3792
|
+
let t = e.response ?? e.data ?? {};
|
|
3793
|
+
return {
|
|
3794
|
+
available: !1,
|
|
3795
|
+
duplicate: !0,
|
|
3796
|
+
message: t?.message ?? e.message ?? "",
|
|
3797
|
+
errors: Array.isArray(t?.errors) ? t.errors : [],
|
|
3798
|
+
response: t
|
|
3799
|
+
};
|
|
3800
|
+
}
|
|
3801
|
+
throw e;
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3532
3804
|
//#endregion
|
|
3533
3805
|
//#region src/components/form/uploadAccept.js
|
|
3534
|
-
var
|
|
3806
|
+
var _o = [
|
|
3535
3807
|
"jpg",
|
|
3536
3808
|
"jpeg",
|
|
3537
3809
|
"png",
|
|
@@ -3540,18 +3812,18 @@ var Ya = [
|
|
|
3540
3812
|
"bmp",
|
|
3541
3813
|
"svg",
|
|
3542
3814
|
"avif"
|
|
3543
|
-
],
|
|
3815
|
+
], vo = [
|
|
3544
3816
|
"mp4",
|
|
3545
3817
|
"webm",
|
|
3546
3818
|
"ogg",
|
|
3547
3819
|
"ogv",
|
|
3548
3820
|
"mov",
|
|
3549
3821
|
"m4v"
|
|
3550
|
-
],
|
|
3822
|
+
], yo = [
|
|
3551
3823
|
"pdf",
|
|
3552
3824
|
"doc",
|
|
3553
3825
|
"docx"
|
|
3554
|
-
],
|
|
3826
|
+
], bo = [
|
|
3555
3827
|
{
|
|
3556
3828
|
label: "Any file",
|
|
3557
3829
|
value: "any"
|
|
@@ -3572,34 +3844,34 @@ var Ya = [
|
|
|
3572
3844
|
label: "Images & Videos",
|
|
3573
3845
|
value: "imagesAndVideos"
|
|
3574
3846
|
}
|
|
3575
|
-
],
|
|
3847
|
+
], xo = {
|
|
3576
3848
|
documents: {
|
|
3577
|
-
exts: [...
|
|
3849
|
+
exts: [...yo, ..._o],
|
|
3578
3850
|
hint: "PDF, DOC or image files",
|
|
3579
3851
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
3580
3852
|
},
|
|
3581
3853
|
images: {
|
|
3582
|
-
exts:
|
|
3854
|
+
exts: _o,
|
|
3583
3855
|
hint: "Image files",
|
|
3584
3856
|
error: "Only image files are allowed"
|
|
3585
3857
|
},
|
|
3586
3858
|
videos: {
|
|
3587
|
-
exts:
|
|
3859
|
+
exts: vo,
|
|
3588
3860
|
hint: "Video files",
|
|
3589
3861
|
error: "Only video files are allowed"
|
|
3590
3862
|
},
|
|
3591
3863
|
imagesAndVideos: {
|
|
3592
|
-
exts: [...
|
|
3864
|
+
exts: [..._o, ...vo],
|
|
3593
3865
|
hint: "Image or video files",
|
|
3594
3866
|
error: "Only image or video files are allowed"
|
|
3595
3867
|
}
|
|
3596
3868
|
};
|
|
3597
|
-
function
|
|
3598
|
-
return
|
|
3869
|
+
function So(e) {
|
|
3870
|
+
return xo[String(e?.accept ?? "").trim()] ?? null;
|
|
3599
3871
|
}
|
|
3600
3872
|
//#endregion
|
|
3601
3873
|
//#region src/components/AppButton.jsx
|
|
3602
|
-
function
|
|
3874
|
+
function Co({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
3603
3875
|
let o = /* @__PURE__ */ C(v, {
|
|
3604
3876
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
3605
3877
|
icon: n,
|
|
@@ -3614,13 +3886,13 @@ function to({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
3614
3886
|
}
|
|
3615
3887
|
//#endregion
|
|
3616
3888
|
//#region src/components/detail/userNames.js
|
|
3617
|
-
function
|
|
3889
|
+
function wo(e) {
|
|
3618
3890
|
return !e || typeof e != "object" ? "" : [e.first_name ?? e.firstName ?? e.FIRST_NAME, e.last_name ?? e.lastName ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.user_name || e.userName || e.username || e.email || "";
|
|
3619
3891
|
}
|
|
3620
|
-
function
|
|
3892
|
+
function To(e) {
|
|
3621
3893
|
let t = {};
|
|
3622
3894
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3623
|
-
let n =
|
|
3895
|
+
let n = wo(e);
|
|
3624
3896
|
n && [
|
|
3625
3897
|
e.legacyUserId,
|
|
3626
3898
|
e.userId,
|
|
@@ -3634,29 +3906,29 @@ function ro(e) {
|
|
|
3634
3906
|
});
|
|
3635
3907
|
}), t;
|
|
3636
3908
|
}
|
|
3637
|
-
var
|
|
3638
|
-
function
|
|
3909
|
+
var Eo = /* @__PURE__ */ new Map();
|
|
3910
|
+
function Do(e) {
|
|
3639
3911
|
let t = String(e ?? "").trim();
|
|
3640
3912
|
if (!t) return Promise.resolve("");
|
|
3641
|
-
if (
|
|
3642
|
-
let i = n(r, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
3643
|
-
return
|
|
3913
|
+
if (Eo.has(t)) return Eo.get(t);
|
|
3914
|
+
let i = n(r, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => wo(e?.data ?? e ?? null)).catch(() => "");
|
|
3915
|
+
return Eo.set(t, i), i;
|
|
3644
3916
|
}
|
|
3645
|
-
var
|
|
3646
|
-
function
|
|
3917
|
+
var Q = (e) => e == null ? "" : String(e).trim();
|
|
3918
|
+
function Oo(e) {
|
|
3647
3919
|
let t = e?.quickCreateNotice;
|
|
3648
3920
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
3649
3921
|
enabled: !0,
|
|
3650
|
-
title:
|
|
3651
|
-
message:
|
|
3922
|
+
title: Q(t.title) || "New record created",
|
|
3923
|
+
message: Q(t.message) || "A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.",
|
|
3652
3924
|
showCreator: t.showCreator !== !1,
|
|
3653
3925
|
showRecordName: t.showRecordName !== !1,
|
|
3654
|
-
recordNameField:
|
|
3655
|
-
recordLabel:
|
|
3656
|
-
creatorLabel:
|
|
3926
|
+
recordNameField: Q(t.recordNameField),
|
|
3927
|
+
recordLabel: Q(t.recordLabel) || "Record name",
|
|
3928
|
+
creatorLabel: Q(t.creatorLabel) || "Created by"
|
|
3657
3929
|
};
|
|
3658
3930
|
}
|
|
3659
|
-
var
|
|
3931
|
+
var ko = [
|
|
3660
3932
|
"clientName",
|
|
3661
3933
|
"companyName",
|
|
3662
3934
|
"name",
|
|
@@ -3666,24 +3938,24 @@ var so = [
|
|
|
3666
3938
|
"label",
|
|
3667
3939
|
"employerName",
|
|
3668
3940
|
"vendorName"
|
|
3669
|
-
],
|
|
3941
|
+
], Ao = (e, t) => {
|
|
3670
3942
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
3671
|
-
},
|
|
3672
|
-
function
|
|
3943
|
+
}, jo = (e) => typeof e == "string" || typeof e == "number" ? Q(e) : e && typeof e == "object" ? Q(e.label ?? e.name ?? e.title ?? "") : "";
|
|
3944
|
+
function Mo(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
3673
3945
|
if (!e || typeof e != "object") return "";
|
|
3674
3946
|
for (let r of [
|
|
3675
3947
|
t,
|
|
3676
3948
|
n,
|
|
3677
|
-
...
|
|
3949
|
+
...ko
|
|
3678
3950
|
]) {
|
|
3679
3951
|
if (!r) continue;
|
|
3680
|
-
let t =
|
|
3952
|
+
let t = jo(Ao(e, r));
|
|
3681
3953
|
if (t) return t;
|
|
3682
3954
|
}
|
|
3683
3955
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
3684
|
-
return r ?
|
|
3956
|
+
return r ? Q(e[r]) : "";
|
|
3685
3957
|
}
|
|
3686
|
-
function
|
|
3958
|
+
function No(e) {
|
|
3687
3959
|
if (!e || typeof e != "object") return "";
|
|
3688
3960
|
let t = [
|
|
3689
3961
|
e.createdBy,
|
|
@@ -3696,45 +3968,45 @@ function fo(e) {
|
|
|
3696
3968
|
for (let e of t) {
|
|
3697
3969
|
if (e == null || e === "") continue;
|
|
3698
3970
|
if (typeof e == "object") {
|
|
3699
|
-
let t =
|
|
3971
|
+
let t = Q(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
3700
3972
|
if (t) return t;
|
|
3701
3973
|
continue;
|
|
3702
3974
|
}
|
|
3703
|
-
let t =
|
|
3975
|
+
let t = Q(e);
|
|
3704
3976
|
if (t) return t;
|
|
3705
3977
|
}
|
|
3706
3978
|
return "";
|
|
3707
3979
|
}
|
|
3708
|
-
function
|
|
3980
|
+
function Po(e = o) {
|
|
3709
3981
|
try {
|
|
3710
|
-
return
|
|
3982
|
+
return wo(e()) || "";
|
|
3711
3983
|
} catch {
|
|
3712
3984
|
return "";
|
|
3713
3985
|
}
|
|
3714
3986
|
}
|
|
3715
|
-
var
|
|
3987
|
+
var Fo = (e, t) => n(r, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
3716
3988
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
3717
3989
|
return Array.isArray(t) ? t[0] : t;
|
|
3718
3990
|
});
|
|
3719
|
-
async function
|
|
3720
|
-
let { fetchRecord: a =
|
|
3991
|
+
async function Io({ module: e, recordId: t, notice: n, displayField: r = "", deps: i = {} } = {}) {
|
|
3992
|
+
let { fetchRecord: a = Fo, fetchUserNameFn: s = Do, getUser: c = o } = i, l = null;
|
|
3721
3993
|
if (e && t) try {
|
|
3722
3994
|
l = await a(e, t);
|
|
3723
3995
|
} catch {
|
|
3724
3996
|
l = null;
|
|
3725
3997
|
}
|
|
3726
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
3998
|
+
let u = n?.showRecordName === !1 ? "" : Mo(l, {
|
|
3727
3999
|
recordNameField: n?.recordNameField,
|
|
3728
4000
|
displayField: r
|
|
3729
4001
|
}), d = "";
|
|
3730
4002
|
if (n?.showCreator !== !1) {
|
|
3731
|
-
let e =
|
|
4003
|
+
let e = No(l);
|
|
3732
4004
|
if (e) try {
|
|
3733
|
-
d =
|
|
4005
|
+
d = Q(await s(e));
|
|
3734
4006
|
} catch {
|
|
3735
4007
|
d = "";
|
|
3736
4008
|
}
|
|
3737
|
-
d ||=
|
|
4009
|
+
d ||= Po(c);
|
|
3738
4010
|
}
|
|
3739
4011
|
return {
|
|
3740
4012
|
recordName: u,
|
|
@@ -3743,17 +4015,17 @@ async function ho({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
3743
4015
|
}
|
|
3744
4016
|
//#endregion
|
|
3745
4017
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
3746
|
-
var
|
|
3747
|
-
function
|
|
4018
|
+
var Lo = d(() => import("./index.js").then((e) => e.i)), Ro = d(() => import("./index.js").then((e) => e.n)), zo = (e) => e == null || e === "", Bo = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4019
|
+
function Vo(e, t, n, r, i) {
|
|
3748
4020
|
let a = e.quickEditIdFrom;
|
|
3749
4021
|
if (a) {
|
|
3750
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
3751
|
-
return
|
|
4022
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Bo(a)] : Bo(a), i = t?.getFieldValue?.(e);
|
|
4023
|
+
return zo(i) && (i = r?.[a]), zo(i) ? null : i;
|
|
3752
4024
|
}
|
|
3753
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4025
|
+
return i && typeof i == "object" ? i.value ?? null : zo(i) ? null : i;
|
|
3754
4026
|
}
|
|
3755
|
-
function
|
|
3756
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ?
|
|
4027
|
+
function Ho({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4028
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ? Vo(e, t, n, i, a) : null, [
|
|
3757
4029
|
p,
|
|
3758
4030
|
e,
|
|
3759
4031
|
t,
|
|
@@ -3779,12 +4051,12 @@ function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3779
4051
|
module: _,
|
|
3780
4052
|
recordId: String(y)
|
|
3781
4053
|
}), re = (t) => {
|
|
3782
|
-
let n =
|
|
4054
|
+
let n = Oo(e);
|
|
3783
4055
|
n && (d({
|
|
3784
4056
|
...n,
|
|
3785
4057
|
recordName: "",
|
|
3786
4058
|
creatorName: ""
|
|
3787
|
-
}),
|
|
4059
|
+
}), Io({
|
|
3788
4060
|
module: h,
|
|
3789
4061
|
recordId: t,
|
|
3790
4062
|
notice: n,
|
|
@@ -3845,7 +4117,7 @@ function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3845
4117
|
},
|
|
3846
4118
|
children: /* @__PURE__ */ C(te, {})
|
|
3847
4119
|
}),
|
|
3848
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4120
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(Lo, {
|
|
3849
4121
|
moduleName: s.module,
|
|
3850
4122
|
embedded: !0,
|
|
3851
4123
|
breadcrumbItems: [],
|
|
@@ -3853,7 +4125,7 @@ function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3853
4125
|
onSuccess: (e) => {
|
|
3854
4126
|
x(), re(e), o?.("create", e);
|
|
3855
4127
|
}
|
|
3856
|
-
}) : /* @__PURE__ */ C(
|
|
4128
|
+
}) : /* @__PURE__ */ C(Ro, {
|
|
3857
4129
|
moduleName: s.module,
|
|
3858
4130
|
recordId: s.recordId,
|
|
3859
4131
|
embedded: !0,
|
|
@@ -3877,7 +4149,7 @@ function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3877
4149
|
width: "min(520px, 94vw)",
|
|
3878
4150
|
maskClosable: !1,
|
|
3879
4151
|
onCancel: () => d(null),
|
|
3880
|
-
footer: /* @__PURE__ */ C(
|
|
4152
|
+
footer: /* @__PURE__ */ C(Co, {
|
|
3881
4153
|
variant: "primary",
|
|
3882
4154
|
type: "primary",
|
|
3883
4155
|
onClick: () => d(null),
|
|
@@ -3914,8 +4186,8 @@ function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
3914
4186
|
}
|
|
3915
4187
|
//#endregion
|
|
3916
4188
|
//#region src/components/form/crossFieldRules.js
|
|
3917
|
-
var
|
|
3918
|
-
function
|
|
4189
|
+
var Uo = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4190
|
+
function Wo(e, t, n) {
|
|
3919
4191
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
3920
4192
|
if (typeof n == "function") {
|
|
3921
4193
|
let e = n(t);
|
|
@@ -3923,24 +4195,24 @@ function Co(e, t, n) {
|
|
|
3923
4195
|
}
|
|
3924
4196
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
3925
4197
|
}
|
|
3926
|
-
function
|
|
4198
|
+
function Go({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
3927
4199
|
let s = n.field ?? n.compareField ?? r;
|
|
3928
4200
|
return { validator: async (n, r) => {
|
|
3929
|
-
if (!s ||
|
|
3930
|
-
let c = i?.getFieldValue?.(
|
|
3931
|
-
if (
|
|
4201
|
+
if (!s || Uo(r)) return Promise.resolve();
|
|
4202
|
+
let c = i?.getFieldValue?.(Wo(a, s, o));
|
|
4203
|
+
if (Uo(c)) return Promise.resolve();
|
|
3932
4204
|
let l = Number(c), u = Number(r);
|
|
3933
4205
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
3934
4206
|
} };
|
|
3935
4207
|
}
|
|
3936
|
-
function
|
|
4208
|
+
function Ko(e = {}, t, n) {
|
|
3937
4209
|
let r = e.field ?? e.compareField ?? e.value;
|
|
3938
|
-
return r ?
|
|
4210
|
+
return r ? Wo(t, r, n) : null;
|
|
3939
4211
|
}
|
|
3940
4212
|
//#endregion
|
|
3941
4213
|
//#region src/components/form/optionConstraints.js
|
|
3942
|
-
var
|
|
3943
|
-
function
|
|
4214
|
+
var qo = (e) => String(e ?? "").trim().toLowerCase();
|
|
4215
|
+
function Jo(e) {
|
|
3944
4216
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3945
4217
|
return t.forEach((e) => {
|
|
3946
4218
|
if (!(e == null || e === "")) {
|
|
@@ -3952,46 +4224,46 @@ function Eo(e) {
|
|
|
3952
4224
|
e.label,
|
|
3953
4225
|
e.name
|
|
3954
4226
|
].forEach((e) => {
|
|
3955
|
-
e != null && e !== "" && n.push(
|
|
4227
|
+
e != null && e !== "" && n.push(qo(e));
|
|
3956
4228
|
});
|
|
3957
4229
|
return;
|
|
3958
4230
|
}
|
|
3959
|
-
n.push(
|
|
4231
|
+
n.push(qo(e));
|
|
3960
4232
|
}
|
|
3961
4233
|
}), n;
|
|
3962
4234
|
}
|
|
3963
|
-
function
|
|
3964
|
-
let n =
|
|
4235
|
+
function Yo(e = [], t) {
|
|
4236
|
+
let n = Jo(t);
|
|
3965
4237
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
3966
|
-
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(
|
|
4238
|
+
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(qo(e.value)) || r.has(qo(e.label)) : r.has(qo(e)));
|
|
3967
4239
|
return i.length > 0 ? i : e;
|
|
3968
4240
|
}
|
|
3969
4241
|
//#endregion
|
|
3970
4242
|
//#region src/components/form/fieldTooltip.js
|
|
3971
|
-
var
|
|
3972
|
-
function
|
|
3973
|
-
return
|
|
4243
|
+
var Xo = (e) => e == null || String(e).trim() === "", Zo = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
4244
|
+
function Qo(e) {
|
|
4245
|
+
return Xo(e?.tooltip) ? Zo(e?.infoEnabled) && !Xo(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
3974
4246
|
}
|
|
3975
4247
|
//#endregion
|
|
3976
4248
|
//#region src/utils/roleAllowsAction.js
|
|
3977
|
-
function
|
|
3978
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
4249
|
+
function $o(e) {
|
|
4250
|
+
return e == null ? !0 : typeof e == "object" ? $o(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
3979
4251
|
}
|
|
3980
|
-
function
|
|
4252
|
+
function es(e, t) {
|
|
3981
4253
|
if (!e) return !0;
|
|
3982
4254
|
try {
|
|
3983
4255
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
3984
|
-
return
|
|
4256
|
+
return $o((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
3985
4257
|
} catch {
|
|
3986
4258
|
return !0;
|
|
3987
4259
|
}
|
|
3988
4260
|
}
|
|
3989
4261
|
//#endregion
|
|
3990
4262
|
//#region src/utils/afterSubmitNav.js
|
|
3991
|
-
function
|
|
4263
|
+
function ts(e) {
|
|
3992
4264
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
3993
4265
|
}
|
|
3994
|
-
function
|
|
4266
|
+
function ns(e, t, n) {
|
|
3995
4267
|
let r = String(e ?? "").trim();
|
|
3996
4268
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
3997
4269
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -4000,29 +4272,29 @@ function Po(e, t, n) {
|
|
|
4000
4272
|
}
|
|
4001
4273
|
//#endregion
|
|
4002
4274
|
//#region src/utils/submitMessages.js
|
|
4003
|
-
function
|
|
4275
|
+
function rs(e) {
|
|
4004
4276
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
4005
4277
|
}
|
|
4006
4278
|
function $(e) {
|
|
4007
4279
|
let t = String(e ?? "").trim();
|
|
4008
4280
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
4009
4281
|
}
|
|
4010
|
-
function
|
|
4282
|
+
function is(e, t) {
|
|
4011
4283
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
4012
4284
|
}
|
|
4013
|
-
function
|
|
4014
|
-
let r =
|
|
4285
|
+
function as(e, t, n) {
|
|
4286
|
+
let r = rs(e);
|
|
4015
4287
|
if (r?.suppress) return null;
|
|
4016
4288
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
4017
|
-
return i && String(i).trim() ?
|
|
4289
|
+
return i && String(i).trim() ? is(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
4018
4290
|
}
|
|
4019
|
-
function
|
|
4020
|
-
let i =
|
|
4021
|
-
return a && String(a).trim() ?
|
|
4291
|
+
function os(e, t, n, r) {
|
|
4292
|
+
let i = rs(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
4293
|
+
return a && String(a).trim() ? is(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
4022
4294
|
}
|
|
4023
4295
|
//#endregion
|
|
4024
4296
|
//#region src/utils/scrollToFirstFormError.js
|
|
4025
|
-
function
|
|
4297
|
+
function ss({ errorFields: e } = {}, t) {
|
|
4026
4298
|
if (!e?.length) return;
|
|
4027
4299
|
let n = e[0]?.name;
|
|
4028
4300
|
setTimeout(() => {
|
|
@@ -4047,10 +4319,10 @@ function zo({ errorFields: e } = {}, t) {
|
|
|
4047
4319
|
}
|
|
4048
4320
|
//#endregion
|
|
4049
4321
|
//#region src/components/form/conditionalFieldLabel.js
|
|
4050
|
-
function
|
|
4322
|
+
function cs(e) {
|
|
4051
4323
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
4052
4324
|
}
|
|
4053
|
-
function
|
|
4325
|
+
function ls(e, t) {
|
|
4054
4326
|
if (!e?.field) return !1;
|
|
4055
4327
|
switch (e.operator ?? "eq") {
|
|
4056
4328
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -4058,38 +4330,38 @@ function Vo(e, t) {
|
|
|
4058
4330
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
4059
4331
|
case "falsy": return t == null || t === "" || t === !1;
|
|
4060
4332
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
4061
|
-
case "in": return
|
|
4062
|
-
case "notIn": return !
|
|
4333
|
+
case "in": return cs(e.value).includes(String(t ?? ""));
|
|
4334
|
+
case "notIn": return !cs(e.value).includes(String(t ?? ""));
|
|
4063
4335
|
default: return !1;
|
|
4064
4336
|
}
|
|
4065
4337
|
}
|
|
4066
|
-
function
|
|
4338
|
+
function us(e, t, n = !1) {
|
|
4067
4339
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
4068
|
-
return
|
|
4340
|
+
return ls(i, t) && i?.label ? i.label : r;
|
|
4069
4341
|
}
|
|
4070
|
-
function
|
|
4342
|
+
function ds(e) {
|
|
4071
4343
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
4072
4344
|
}
|
|
4073
|
-
function
|
|
4074
|
-
let n =
|
|
4345
|
+
function fs(e, t) {
|
|
4346
|
+
let n = ds(e);
|
|
4075
4347
|
if (!n.length) return !0;
|
|
4076
|
-
let r = n.map((e) =>
|
|
4348
|
+
let r = n.map((e) => ls(e, t(e.field)));
|
|
4077
4349
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
4078
4350
|
}
|
|
4079
|
-
function
|
|
4351
|
+
function ps(e) {
|
|
4080
4352
|
let t = e?.colWhen;
|
|
4081
4353
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
4082
4354
|
}
|
|
4083
|
-
function
|
|
4084
|
-
for (let t of
|
|
4355
|
+
function ms(e, t, n) {
|
|
4356
|
+
for (let t of ps(e)) if (ls(t, n(t))) return Number(t.col);
|
|
4085
4357
|
return t;
|
|
4086
4358
|
}
|
|
4087
|
-
function
|
|
4359
|
+
function hs(e, t) {
|
|
4088
4360
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
4089
4361
|
}
|
|
4090
4362
|
//#endregion
|
|
4091
4363
|
//#region src/components/Breadcrumb.jsx
|
|
4092
|
-
function
|
|
4364
|
+
function gs({ items: e = [] }) {
|
|
4093
4365
|
return /* @__PURE__ */ C(_, { items: e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Be, {
|
|
4094
4366
|
variant: "body",
|
|
4095
4367
|
weight: "medium",
|
|
@@ -4105,6 +4377,6 @@ function Jo({ items: e = [] }) {
|
|
|
4105
4377
|
}) })) });
|
|
4106
4378
|
}
|
|
4107
4379
|
//#endregion
|
|
4108
|
-
export {
|
|
4380
|
+
export { Zi as $, Tn as $n, In as $t, oo as A, Vn as An, Gt as At, ja as B, Pt as Bn, mn as Bt, Co as C, jt as Cn, Fr as Ct, uo as D, sr as Dn, Tr as Dt, go as E, Dn as En, Er as Et, Ga as F, Qt as Fn, Hn as Ft, J as G, fr as Gn, Ft as Gt, da as H, Ln as Hn, nr as Ht, Ua as I, tn as In, gr as It, sa as J, Sr as Jn, Ut as Jt, wa as K, ar as Kn, vr as Kt, Va as L, pn as Ln, qt as Lt, Ka as M, Jt as Mn, ir as Mt, Ya as N, an as Nn, er as Nt, lo as O, hr as On, Yt as Ot, Ja as P, ln as Pn, xr as Pt, ia as Q, _r as Qn, wn as Qt, Ha as R, It as Rn, on as Rt, To as S, Wt as Sn, Or as St, So as T, bn as Tn, jr as Tt, ua as U, hn as Un, Cr as Ut, Da as V, Pn as Vn, or as Vt, fa as W, Kt as Wn, Wn as Wt, q as X, An as Xn, rn as Xt, ca as Y, Un as Yn, Ht as Yt, Qi as Z, cr as Zn, xn as Zt, Yo as _, br as _n, Vr as _t, us as a, Zn as an, _t as ar, zi as at, Ho as b, qn as bn, Pr as bt, ds as c, en as cn, ut as cr, Yr as ct, as as d, dn, He as dr, Lr as dt, Qn as en, Fn as er, ki as et, ts as f, gn as fn, Be as fr, Kr as ft, Qo as g, $n as gn, qr as gt, es as h, rr as hn, Ur as ht, ls as i, un as in, wt as ir, ra as it, ho as j, Nt as jn, dr as jt, eo as k, On as kn, _n as kt, ss as l, Rn as ln, lt as lr, Xr as lt, $o as m, Kn as mn, E as mr, zr as mt, ps as n, Lt as nn, Yn as nr, K as nt, fs as o, ur as on, vt as or, Ri as ot, ns as p, Gn as pn, D as pr, Gr as pt, oa as q, tr as qn, Bn as qt, hs as r, cn as rn, Tt as rr, Gi as rt, ms as s, Zt as sn, yt as sr, fi as st, gs as t, Xn as tn, zn as tr, V as tt, os as u, fn as un, ct as ur, Jr as ut, Ko as v, Mt as vn, Wr as vt, bo as w, Nn as wn, Ar as wt, Do as x, vn as xn, kr as xt, Go as y, Rt as yn, Ir as yt, Ma as z, Jn as zn, pr as zt };
|
|
4109
4381
|
|
|
4110
|
-
//# sourceMappingURL=Breadcrumb-
|
|
4382
|
+
//# sourceMappingURL=Breadcrumb-Db_WFy70.js.map
|