@realtek/core-theme-live 0.0.421 → 0.0.422
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/{LinkedRecordFileField-DxI_baJL.js → LinkedRecordFileField-BXslVJhz.js} +856 -827
- package/dist-lib/LinkedRecordFileField-BXslVJhz.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-Dd-xxTqa.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-Dd-xxTqa.cjs.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +3802 -3271
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-Bn_PtxML.cjs +0 -5
- package/dist-lib/LinkedRecordFileField-Bn_PtxML.cjs.map +0 -1
- package/dist-lib/LinkedRecordFileField-DxI_baJL.js.map +0 -1
|
@@ -1133,7 +1133,13 @@ function qn(e) {
|
|
|
1133
1133
|
...n
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1136
|
+
if (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), Vn.includes(e.candidateDetailViewMode) && (t.candidateDetailViewMode = e.candidateDetailViewMode), e.formDateFormats && typeof e.formDateFormats == "object" && !Array.isArray(e.formDateFormats)) {
|
|
1137
|
+
let n = {};
|
|
1138
|
+
Object.entries(e.formDateFormats).forEach(([e, t]) => {
|
|
1139
|
+
typeof t == "string" && t.trim() !== "" && (n[e] = t.trim());
|
|
1140
|
+
}), t.formDateFormats = n;
|
|
1141
|
+
}
|
|
1142
|
+
return t;
|
|
1137
1143
|
}
|
|
1138
1144
|
function Jn(e = Yn()) {
|
|
1139
1145
|
let t = (String(e).match(/\d+/g) ?? [
|
|
@@ -1182,20 +1188,29 @@ var er = /* @__PURE__ */ new Set();
|
|
|
1182
1188
|
function tr() {
|
|
1183
1189
|
return er.has("dateFormat") ? M.dateFormat : void 0;
|
|
1184
1190
|
}
|
|
1185
|
-
function nr(e
|
|
1191
|
+
function nr(e) {
|
|
1192
|
+
let t = M.formDateFormats, n = String(e ?? "").trim().toLowerCase();
|
|
1193
|
+
if (!t || !n) return;
|
|
1194
|
+
let r = n.endsWith("s") ? n.slice(0, -1) : n, i = Object.keys(t).find((e) => {
|
|
1195
|
+
let t = e.trim().toLowerCase();
|
|
1196
|
+
return t === n || t === r || t === `${r}s`;
|
|
1197
|
+
});
|
|
1198
|
+
return i ? t[i] : void 0;
|
|
1199
|
+
}
|
|
1200
|
+
function rr(e = !1) {
|
|
1186
1201
|
return Kn && !e || (Kn = Promise.resolve().then(() => lt()).then((e) => $n(e)).catch(() => M)), Kn;
|
|
1187
1202
|
}
|
|
1188
1203
|
T.extend(ye), T.extend(be);
|
|
1189
|
-
var
|
|
1190
|
-
function
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
1204
|
+
var ir = null;
|
|
1205
|
+
function ar() {
|
|
1206
|
+
if (ir === null) try {
|
|
1207
|
+
ir = T.tz.guess() || "UTC";
|
|
1193
1208
|
} catch {
|
|
1194
|
-
|
|
1209
|
+
ir = "UTC";
|
|
1195
1210
|
}
|
|
1196
|
-
return
|
|
1211
|
+
return ir;
|
|
1197
1212
|
}
|
|
1198
|
-
function
|
|
1213
|
+
function or(e) {
|
|
1199
1214
|
let t = String(e ?? "").trim();
|
|
1200
1215
|
if (!t || t !== "UTC" && !t.includes("/")) return !1;
|
|
1201
1216
|
try {
|
|
@@ -1206,28 +1221,28 @@ function ar(e) {
|
|
|
1206
1221
|
}
|
|
1207
1222
|
function P(e = N()) {
|
|
1208
1223
|
let t = String(e?.timeZone ?? "").trim();
|
|
1209
|
-
return
|
|
1224
|
+
return or(t) ? t : ar();
|
|
1210
1225
|
}
|
|
1211
|
-
function
|
|
1226
|
+
function sr(e) {
|
|
1212
1227
|
return T().tz(P(e));
|
|
1213
1228
|
}
|
|
1214
|
-
function
|
|
1229
|
+
function cr(e, t) {
|
|
1215
1230
|
let n = T(e?.$date ?? e);
|
|
1216
1231
|
return n.isValid() ? n.tz(P(t)) : n;
|
|
1217
1232
|
}
|
|
1218
|
-
function
|
|
1219
|
-
let r =
|
|
1233
|
+
function lr(e, t, n = N()) {
|
|
1234
|
+
let r = cr(e, n);
|
|
1220
1235
|
return r.isValid() ? r.format(t || n?.dateFormat || "DD MMM YYYY") : "";
|
|
1221
1236
|
}
|
|
1222
|
-
function
|
|
1223
|
-
let n = P(e), r =
|
|
1237
|
+
function ur(e = N(), t) {
|
|
1238
|
+
let n = P(e), r = vr(n, e);
|
|
1224
1239
|
if (r && r.includes("/")) {
|
|
1225
|
-
let e =
|
|
1240
|
+
let e = dr(n, t);
|
|
1226
1241
|
if (e) return r.split("/").map((e) => e.trim()).find((t) => t.toUpperCase() === e.toUpperCase()) || e;
|
|
1227
1242
|
}
|
|
1228
|
-
return r ||
|
|
1243
|
+
return r || dr(n, t) || n;
|
|
1229
1244
|
}
|
|
1230
|
-
function
|
|
1245
|
+
function dr(e, t) {
|
|
1231
1246
|
try {
|
|
1232
1247
|
let n = t === void 0 ? /* @__PURE__ */ new Date() : new Date(T(t?.$date ?? t).valueOf());
|
|
1233
1248
|
if (Number.isNaN(n.valueOf())) return "";
|
|
@@ -1240,28 +1255,28 @@ function ur(e, t) {
|
|
|
1240
1255
|
return "";
|
|
1241
1256
|
}
|
|
1242
1257
|
}
|
|
1243
|
-
function
|
|
1244
|
-
let n =
|
|
1258
|
+
function fr(e, t = N()) {
|
|
1259
|
+
let n = lr(e, t?.dateTimeFormat || "MMM DD, YYYY | hh:mm A", t);
|
|
1245
1260
|
if (!n) return "";
|
|
1246
1261
|
if (t?.showTimeZoneLabel === !1) return n;
|
|
1247
|
-
let r =
|
|
1262
|
+
let r = ur(t, e);
|
|
1248
1263
|
return r ? `${n} ${r}` : n;
|
|
1249
1264
|
}
|
|
1250
|
-
function
|
|
1265
|
+
function pr(e) {
|
|
1251
1266
|
if (!e) return !1;
|
|
1252
1267
|
if (e.tzAware === !0) return !0;
|
|
1253
1268
|
if (e.tzAware === !1) return !1;
|
|
1254
1269
|
let t = String(e.type ?? "").toLowerCase();
|
|
1255
1270
|
return t === "datetime" || t === "time" || t === "datetime-local";
|
|
1256
1271
|
}
|
|
1257
|
-
function
|
|
1272
|
+
function mr(e, t) {
|
|
1258
1273
|
if (e == null || e === "") return null;
|
|
1259
1274
|
let n = T(e);
|
|
1260
1275
|
if (!n.isValid()) return null;
|
|
1261
1276
|
let r = P(t);
|
|
1262
1277
|
return T.tz(n.format("YYYY-MM-DDTHH:mm:ss"), r);
|
|
1263
1278
|
}
|
|
1264
|
-
function
|
|
1279
|
+
function hr(e = P()) {
|
|
1265
1280
|
try {
|
|
1266
1281
|
let t = T().tz(e).utcOffset(), n = t < 0 ? "-" : "+", r = Math.abs(t);
|
|
1267
1282
|
return `UTC${n}${String(Math.floor(r / 60)).padStart(2, "0")}:${String(r % 60).padStart(2, "0")}`;
|
|
@@ -1269,11 +1284,11 @@ function mr(e = P()) {
|
|
|
1269
1284
|
return "";
|
|
1270
1285
|
}
|
|
1271
1286
|
}
|
|
1272
|
-
function
|
|
1287
|
+
function gr(e = N()) {
|
|
1273
1288
|
let t = P(e);
|
|
1274
|
-
return `${
|
|
1289
|
+
return `${vr(t, e) || t} (${hr(t)})`;
|
|
1275
1290
|
}
|
|
1276
|
-
var
|
|
1291
|
+
var _r = Object.freeze({
|
|
1277
1292
|
UTC: "UTC",
|
|
1278
1293
|
"Asia/Kolkata": "IST",
|
|
1279
1294
|
"Asia/Calcutta": "IST",
|
|
@@ -1288,10 +1303,10 @@ var gr = Object.freeze({
|
|
|
1288
1303
|
"Asia/Tokyo": "JST",
|
|
1289
1304
|
"Australia/Sydney": "AEST/AEDT"
|
|
1290
1305
|
});
|
|
1291
|
-
function
|
|
1292
|
-
return (t?.timeZoneAliases ?? {})[e] ??
|
|
1306
|
+
function vr(e, t = N()) {
|
|
1307
|
+
return (t?.timeZoneAliases ?? {})[e] ?? _r[e] ?? "";
|
|
1293
1308
|
}
|
|
1294
|
-
function
|
|
1309
|
+
function yr(e = N()) {
|
|
1295
1310
|
let t = [];
|
|
1296
1311
|
try {
|
|
1297
1312
|
t = Intl.supportedValuesOf("timeZone") ?? [];
|
|
@@ -1300,17 +1315,17 @@ function vr(e = N()) {
|
|
|
1300
1315
|
}
|
|
1301
1316
|
let n = [
|
|
1302
1317
|
"UTC",
|
|
1303
|
-
...Object.keys(
|
|
1318
|
+
...Object.keys(_r),
|
|
1304
1319
|
...Object.keys(e?.timeZoneAliases ?? {})
|
|
1305
1320
|
];
|
|
1306
|
-
return [.../* @__PURE__ */ new Set([...n, ...t])].filter(
|
|
1321
|
+
return [.../* @__PURE__ */ new Set([...n, ...t])].filter(or).map((t) => {
|
|
1307
1322
|
let n = 0;
|
|
1308
1323
|
try {
|
|
1309
1324
|
n = T().tz(t).utcOffset();
|
|
1310
1325
|
} catch {
|
|
1311
1326
|
return null;
|
|
1312
1327
|
}
|
|
1313
|
-
let r =
|
|
1328
|
+
let r = vr(t, e), i = hr(t);
|
|
1314
1329
|
return {
|
|
1315
1330
|
value: t,
|
|
1316
1331
|
alias: r,
|
|
@@ -1468,7 +1483,7 @@ var I = {
|
|
|
1468
1483
|
avatarPurpleBg: "var(--color-avatar-purple-bg)",
|
|
1469
1484
|
avatarMoreBg: "var(--color-avatar-more-bg)",
|
|
1470
1485
|
avatarMoreText: "var(--color-avatar-more-text)"
|
|
1471
|
-
}, { Text:
|
|
1486
|
+
}, { Text: br, Title: xr, Paragraph: Sr, Link: Cr } = oe, wr = {
|
|
1472
1487
|
display: "h1",
|
|
1473
1488
|
h1: "h1",
|
|
1474
1489
|
h2: "h2",
|
|
@@ -1486,7 +1501,7 @@ var I = {
|
|
|
1486
1501
|
metric: "span",
|
|
1487
1502
|
helper: "span",
|
|
1488
1503
|
link: "a"
|
|
1489
|
-
},
|
|
1504
|
+
}, Tr = {
|
|
1490
1505
|
xs: "var(--font-size-xs)",
|
|
1491
1506
|
sm: "var(--font-size-sm)",
|
|
1492
1507
|
md: "var(--font-size-md)",
|
|
@@ -1495,18 +1510,18 @@ var I = {
|
|
|
1495
1510
|
"2xl": "var(--font-size-2xl)",
|
|
1496
1511
|
"3xl": "var(--font-size-3xl)",
|
|
1497
1512
|
"4xl": "var(--font-size-4xl)"
|
|
1498
|
-
},
|
|
1513
|
+
}, Er = {
|
|
1499
1514
|
regular: "var(--font-weight-regular)",
|
|
1500
1515
|
medium: "var(--font-weight-medium)",
|
|
1501
1516
|
semibold: "var(--font-weight-semibold)",
|
|
1502
1517
|
bold: "var(--font-weight-bold)",
|
|
1503
1518
|
extrabold: "var(--font-weight-extrabold)"
|
|
1504
|
-
},
|
|
1519
|
+
}, Dr = {
|
|
1505
1520
|
tight: "var(--line-height-tight)",
|
|
1506
1521
|
snug: "var(--line-height-snug)",
|
|
1507
1522
|
normal: "var(--line-height-normal)",
|
|
1508
1523
|
relaxed: "var(--line-height-relaxed)"
|
|
1509
|
-
},
|
|
1524
|
+
}, Or = {
|
|
1510
1525
|
primary: I.textPrimary,
|
|
1511
1526
|
secondary: I.textSecondary,
|
|
1512
1527
|
muted: I.textMuted,
|
|
@@ -1516,37 +1531,37 @@ var I = {
|
|
|
1516
1531
|
danger: I.danger,
|
|
1517
1532
|
success: I.success
|
|
1518
1533
|
};
|
|
1519
|
-
function
|
|
1534
|
+
function kr(...e) {
|
|
1520
1535
|
return e.filter(Boolean).join(" ");
|
|
1521
1536
|
}
|
|
1522
|
-
function
|
|
1537
|
+
function Ar(e, t) {
|
|
1523
1538
|
if (e != null) return t[e] || e;
|
|
1524
1539
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return t === "link" || e === "a" ?
|
|
1540
|
+
function jr(e, t) {
|
|
1541
|
+
return t === "link" || e === "a" ? Cr : e === "p" ? Sr : [
|
|
1527
1542
|
"h1",
|
|
1528
1543
|
"h2",
|
|
1529
1544
|
"h3",
|
|
1530
1545
|
"h4",
|
|
1531
1546
|
"h5"
|
|
1532
|
-
].includes(e) ?
|
|
1547
|
+
].includes(e) ? xr : br;
|
|
1533
1548
|
}
|
|
1534
|
-
function
|
|
1535
|
-
let n = e ||
|
|
1549
|
+
function Mr(e, t) {
|
|
1550
|
+
let n = e || wr[t];
|
|
1536
1551
|
if (n?.startsWith("h")) return Number(n.slice(1));
|
|
1537
1552
|
}
|
|
1538
|
-
function
|
|
1539
|
-
let m = t || e ||
|
|
1540
|
-
color:
|
|
1541
|
-
fontSize:
|
|
1542
|
-
fontWeight:
|
|
1543
|
-
lineHeight:
|
|
1553
|
+
function Nr({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a, lineHeight: o, align: s, truncate: c = !1, display: l, className: u, style: d, children: f, ...p }) {
|
|
1554
|
+
let m = t || e || wr[n] || "span", h = jr(m, n), g = Mr(m, n), _ = {
|
|
1555
|
+
color: Ar(r, Or),
|
|
1556
|
+
fontSize: Ar(i, Tr),
|
|
1557
|
+
fontWeight: Ar(a, Er),
|
|
1558
|
+
lineHeight: Ar(o, Dr),
|
|
1544
1559
|
display: l,
|
|
1545
1560
|
...d
|
|
1546
1561
|
};
|
|
1547
1562
|
return /* @__PURE__ */ C(h, {
|
|
1548
1563
|
...g ? { level: g } : {},
|
|
1549
|
-
className:
|
|
1564
|
+
className: kr("app-typography", `app-typography--${n}`, r && Or[r] && `app-typography--${r}`, s && `app-typography--${s}`, c && "app-typography--truncate", u),
|
|
1550
1565
|
style: _,
|
|
1551
1566
|
...p,
|
|
1552
1567
|
children: f
|
|
@@ -1554,13 +1569,13 @@ function Mr({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a,
|
|
|
1554
1569
|
}
|
|
1555
1570
|
//#endregion
|
|
1556
1571
|
//#region src/components/TipTapEditor.jsx
|
|
1557
|
-
var
|
|
1572
|
+
var Pr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?)__$/s, "$1"), Fr = (e = []) => e.length > 0 && e.every((e) => /^:?-{3,}:?$/.test(String(e).trim())), Ir = (e = "") => {
|
|
1558
1573
|
let t = String(e || "").replace(/\r\n?/g, "\n").trim();
|
|
1559
1574
|
if (!t) return null;
|
|
1560
1575
|
let n = t.split("\n").filter((e) => e.trim().length > 0);
|
|
1561
1576
|
if (n.length < 2) return null;
|
|
1562
1577
|
if (n.some((e) => e.includes(" "))) {
|
|
1563
|
-
let e = n.map((e) => e.split(" ").map(
|
|
1578
|
+
let e = n.map((e) => e.split(" ").map(Pr)), t = Math.max(...e.map((e) => e.length));
|
|
1564
1579
|
return t < 2 ? null : {
|
|
1565
1580
|
rows: e.map((e) => [...e, ...Array(t - e.length).fill("")]),
|
|
1566
1581
|
hasHeaderRow: !0
|
|
@@ -1568,15 +1583,15 @@ var Nr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?
|
|
|
1568
1583
|
}
|
|
1569
1584
|
let r = n.filter((e) => e.includes("|")).map((e) => {
|
|
1570
1585
|
let t = e.trim();
|
|
1571
|
-
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(
|
|
1586
|
+
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(Pr);
|
|
1572
1587
|
});
|
|
1573
1588
|
if (r.length < 2) return null;
|
|
1574
|
-
let i = r.findIndex(
|
|
1589
|
+
let i = r.findIndex(Fr), a = r.filter((e, t) => t !== i), o = Math.max(...a.map((e) => e.length));
|
|
1575
1590
|
return a.length < 2 || o < 2 ? null : {
|
|
1576
1591
|
rows: a.map((e) => [...e, ...Array(o - e.length).fill("")]),
|
|
1577
1592
|
hasHeaderRow: i === 1
|
|
1578
1593
|
};
|
|
1579
|
-
},
|
|
1594
|
+
}, Lr = (e, t, n) => {
|
|
1580
1595
|
let { table: r, tableRow: i, tableHeader: a, tableCell: o, paragraph: s } = e.nodes;
|
|
1581
1596
|
if (!r || !i || !o || !s) return null;
|
|
1582
1597
|
let c = t.map((t, r) => {
|
|
@@ -1600,7 +1615,7 @@ function L({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
|
1600
1615
|
children: i
|
|
1601
1616
|
});
|
|
1602
1617
|
}
|
|
1603
|
-
function
|
|
1618
|
+
function Rr({ editor: e, disabled: t }) {
|
|
1604
1619
|
return e ? /* @__PURE__ */ w("div", {
|
|
1605
1620
|
className: `tte-toolbar${t ? " tte-toolbar--disabled" : ""}`,
|
|
1606
1621
|
children: [
|
|
@@ -1740,7 +1755,7 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1740
1755
|
]
|
|
1741
1756
|
}) : null;
|
|
1742
1757
|
}
|
|
1743
|
-
function
|
|
1758
|
+
function zr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = "" }) {
|
|
1744
1759
|
let i = _(e ?? ""), a = Ce({
|
|
1745
1760
|
extensions: [
|
|
1746
1761
|
we,
|
|
@@ -1762,9 +1777,9 @@ function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1762
1777
|
editorProps: {
|
|
1763
1778
|
attributes: { class: "tte-content" },
|
|
1764
1779
|
handlePaste: (e, t) => {
|
|
1765
|
-
let n =
|
|
1780
|
+
let n = Ir(t.clipboardData?.getData("text/plain") || "");
|
|
1766
1781
|
if (!n) return !1;
|
|
1767
|
-
let r =
|
|
1782
|
+
let r = Lr(e.state.schema, n.rows, n.hasHeaderRow);
|
|
1768
1783
|
if (!r) return !1;
|
|
1769
1784
|
t.preventDefault();
|
|
1770
1785
|
let i = e.state.tr.replaceSelectionWith(r, !1).scrollIntoView();
|
|
@@ -1785,7 +1800,7 @@ function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1785
1800
|
}, [n, a]), /* @__PURE__ */ w("div", {
|
|
1786
1801
|
className: `tte-wrapper${n ? " tte-wrapper--disabled" : ""}`,
|
|
1787
1802
|
children: [
|
|
1788
|
-
/* @__PURE__ */ C(
|
|
1803
|
+
/* @__PURE__ */ C(Rr, {
|
|
1789
1804
|
editor: a,
|
|
1790
1805
|
disabled: n
|
|
1791
1806
|
}),
|
|
@@ -1799,7 +1814,7 @@ function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1799
1814
|
}
|
|
1800
1815
|
//#endregion
|
|
1801
1816
|
//#region src/utils/modulePath.js
|
|
1802
|
-
function
|
|
1817
|
+
function Br(e) {
|
|
1803
1818
|
let t = String(e ?? "").trim();
|
|
1804
1819
|
if (!t) return {
|
|
1805
1820
|
baseModule: "",
|
|
@@ -1811,35 +1826,35 @@ function zr(e) {
|
|
|
1811
1826
|
nestedPath: r.map((e) => e.trim()).filter(Boolean).join(".")
|
|
1812
1827
|
};
|
|
1813
1828
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return
|
|
1829
|
+
function Vr(e) {
|
|
1830
|
+
return Br(e).baseModule;
|
|
1816
1831
|
}
|
|
1817
1832
|
//#endregion
|
|
1818
1833
|
//#region src/services/moduleDataApi.js
|
|
1819
|
-
var
|
|
1820
|
-
function
|
|
1834
|
+
var Hr = "test-flows", Ur = "lms-flows";
|
|
1835
|
+
function Wr(e) {
|
|
1821
1836
|
let t = (Array.isArray(e) ? e : [e]).flat().map((e) => e && typeof e == "object" ? e.value ?? e.label ?? e.name ?? "" : e).map((e) => String(e ?? "").trim().toLowerCase()).filter(Boolean);
|
|
1822
1837
|
return t.includes("dice") ? "dice" : t.includes("internal") ? "internal" : t[0] || "";
|
|
1823
1838
|
}
|
|
1824
|
-
function
|
|
1839
|
+
function Gr(...e) {
|
|
1825
1840
|
for (let t of e) {
|
|
1826
1841
|
let e = Number(t);
|
|
1827
1842
|
if (Number.isFinite(e)) return e;
|
|
1828
1843
|
}
|
|
1829
1844
|
}
|
|
1830
|
-
function
|
|
1845
|
+
function Kr(e, t, n, r = "") {
|
|
1831
1846
|
let i = e?.count, a = t?.count, o = String(r ?? "").trim().toLowerCase();
|
|
1832
1847
|
if (i && typeof i == "object") {
|
|
1833
|
-
let e =
|
|
1848
|
+
let e = Gr(o ? i[o] : void 0, i.total, i.searchCount, i.count);
|
|
1834
1849
|
if (e !== void 0) return e;
|
|
1835
1850
|
}
|
|
1836
1851
|
if (a && typeof a == "object") {
|
|
1837
|
-
let e =
|
|
1852
|
+
let e = Gr(o ? a[o] : void 0, a.total, a.searchCount, a.count);
|
|
1838
1853
|
if (e !== void 0) return e;
|
|
1839
1854
|
}
|
|
1840
|
-
return
|
|
1855
|
+
return Gr(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, t?.total, typeof a == "object" ? void 0 : a, t?.totalCount, n.length) ?? 0;
|
|
1841
1856
|
}
|
|
1842
|
-
function
|
|
1857
|
+
function qr(e, t) {
|
|
1843
1858
|
let n = {};
|
|
1844
1859
|
return [e?.count, t?.count].forEach((e) => {
|
|
1845
1860
|
!e || typeof e != "object" || Object.entries(e).forEach(([e, t]) => {
|
|
@@ -1848,9 +1863,9 @@ function Kr(e, t) {
|
|
|
1848
1863
|
});
|
|
1849
1864
|
}), n;
|
|
1850
1865
|
}
|
|
1851
|
-
async function
|
|
1866
|
+
async function Jr(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
1852
1867
|
let c = new URLSearchParams({
|
|
1853
|
-
module:
|
|
1868
|
+
module: Vr(e),
|
|
1854
1869
|
field: t,
|
|
1855
1870
|
value: n,
|
|
1856
1871
|
limit: String(r),
|
|
@@ -1858,9 +1873,9 @@ async function qr(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
|
1858
1873
|
});
|
|
1859
1874
|
return a.dataSource && c.set("dataSource", a.dataSource), a.masterName && c.set("masterName", a.masterName), a.groupName && c.set("groupName", a.groupName), a.scope && c.set("scope", a.scope), a.arrayLabelField && c.set("arrayLabelField", a.arrayLabelField), a.arrayValueField && c.set("arrayValueField", a.arrayValueField), o(s, `/filter-dropdown-values?${c}`);
|
|
1860
1875
|
}
|
|
1861
|
-
async function
|
|
1876
|
+
async function Yr(e, t = 10, n = 0, r = {}) {
|
|
1862
1877
|
let { scope: i = "", sort: o = "", sortDir: c = "", filters: l = [] } = r;
|
|
1863
|
-
if (e ===
|
|
1878
|
+
if (e === Hr) {
|
|
1864
1879
|
let { getTestFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1865
1880
|
limit: t,
|
|
1866
1881
|
offset: n
|
|
@@ -1877,7 +1892,7 @@ async function Jr(e, t = 10, n = 0, r = {}) {
|
|
|
1877
1892
|
}]
|
|
1878
1893
|
};
|
|
1879
1894
|
}
|
|
1880
|
-
if (e ===
|
|
1895
|
+
if (e === Ur) {
|
|
1881
1896
|
let { getLmsFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1882
1897
|
limit: t,
|
|
1883
1898
|
offset: n
|
|
@@ -1895,13 +1910,13 @@ async function Jr(e, t = 10, n = 0, r = {}) {
|
|
|
1895
1910
|
};
|
|
1896
1911
|
}
|
|
1897
1912
|
let u = new URLSearchParams({
|
|
1898
|
-
module:
|
|
1913
|
+
module: Vr(e),
|
|
1899
1914
|
limit: String(t),
|
|
1900
1915
|
offset: String(n)
|
|
1901
1916
|
}), d = String(i ?? "").trim();
|
|
1902
1917
|
return d && u.set("scope", d), o && u.set("sort", o), c && u.set("sortDir", c), Array.isArray(l) && l.some((e) => e?.field) && u.set("filters", JSON.stringify(l)), a(s, `/module-data-list?${u.toString()}`);
|
|
1903
1918
|
}
|
|
1904
|
-
async function
|
|
1919
|
+
async function Xr(e, t) {
|
|
1905
1920
|
if (!e || !t) return null;
|
|
1906
1921
|
try {
|
|
1907
1922
|
let n = await a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`), r = n?.data?.data ?? n?.data ?? n, i = Array.isArray(r) ? r[0] : r;
|
|
@@ -1910,14 +1925,14 @@ async function Yr(e, t) {
|
|
|
1910
1925
|
return null;
|
|
1911
1926
|
}
|
|
1912
1927
|
}
|
|
1913
|
-
async function
|
|
1914
|
-
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f =
|
|
1915
|
-
p.append("module",
|
|
1928
|
+
async function Zr(e, t = {}, n = {}, r = {}) {
|
|
1929
|
+
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f = Wr(u || String(t.selectedSource ?? "").split(",")), p = new URLSearchParams();
|
|
1930
|
+
p.append("module", Vr(e)), p.append("limit", String(i)), p.append("offset", String(o)), f && (p.set("scope", f), console.log("[searchModuleData] Adding scope to query:", f)), c && p.set("sort", c), l && p.set("sortDir", l), Array.isArray(d) && d.some((e) => e?.field) && p.set("filters", JSON.stringify(d)), console.log("[searchModuleData] Final query string:", p.toString()), Object.entries(t).forEach(([e, t]) => {
|
|
1916
1931
|
if (t == null || t === "") return;
|
|
1917
1932
|
let n = t;
|
|
1918
1933
|
n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), p.append(e, n);
|
|
1919
1934
|
});
|
|
1920
|
-
let m = await a(s, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ =
|
|
1935
|
+
let m = await a(s, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ = Kr(m, h, g, f), v = qr(m, h);
|
|
1921
1936
|
f && v[f] === void 0 && Number.isFinite(_) && (v[f] = _);
|
|
1922
1937
|
let ee = g.some((e) => [
|
|
1923
1938
|
e?.sourceType,
|
|
@@ -1930,9 +1945,9 @@ async function Xr(e, t = {}, n = {}, r = {}) {
|
|
|
1930
1945
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
1931
1946
|
y = e(m, m)?.data?.data ?? g;
|
|
1932
1947
|
} catch (e) {
|
|
1933
|
-
console.error("[searchModuleData] Dice transformation failed:", e), y = g.map(
|
|
1948
|
+
console.error("[searchModuleData] Dice transformation failed:", e), y = g.map(ei);
|
|
1934
1949
|
}
|
|
1935
|
-
else y = Array.isArray(g) ? g.map(
|
|
1950
|
+
else y = Array.isArray(g) ? g.map(ei) : [];
|
|
1936
1951
|
return {
|
|
1937
1952
|
rows: y,
|
|
1938
1953
|
total: Number(_) || 0,
|
|
@@ -1945,10 +1960,10 @@ async function Xr(e, t = {}, n = {}, r = {}) {
|
|
|
1945
1960
|
columnActions: h?.columnActions ?? []
|
|
1946
1961
|
};
|
|
1947
1962
|
}
|
|
1948
|
-
function
|
|
1963
|
+
function Qr(e, t) {
|
|
1949
1964
|
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
1950
1965
|
}
|
|
1951
|
-
function
|
|
1966
|
+
function $r(e, t, n) {
|
|
1952
1967
|
let r = String(t).split(".").filter(Boolean);
|
|
1953
1968
|
if (!r.length) return e;
|
|
1954
1969
|
let i = { ...e }, a = i, o = e;
|
|
@@ -1957,7 +1972,7 @@ function Qr(e, t, n) {
|
|
|
1957
1972
|
a[e] = n, a = n, o = t;
|
|
1958
1973
|
}), a[r[r.length - 1]] = n, i;
|
|
1959
1974
|
}
|
|
1960
|
-
function
|
|
1975
|
+
function ei(e) {
|
|
1961
1976
|
if (!e || typeof e != "object") return e;
|
|
1962
1977
|
let t = [
|
|
1963
1978
|
"skills",
|
|
@@ -1967,11 +1982,11 @@ function $r(e) {
|
|
|
1967
1982
|
"customFields.diceProfileData.skills"
|
|
1968
1983
|
], n = e, r = null;
|
|
1969
1984
|
if (t.forEach((e) => {
|
|
1970
|
-
let t =
|
|
1985
|
+
let t = Qr(n, e);
|
|
1971
1986
|
if (t == null) return;
|
|
1972
1987
|
let i = c(t);
|
|
1973
|
-
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n =
|
|
1974
|
-
}), r &&
|
|
1988
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = $r(n, e, i));
|
|
1989
|
+
}), r && Qr(n, "skills") === void 0 && (n = $r(n, "skills", r)), [
|
|
1975
1990
|
n?.sourceType,
|
|
1976
1991
|
n?.profileSource,
|
|
1977
1992
|
n?.selectedSource,
|
|
@@ -1990,10 +2005,10 @@ function $r(e) {
|
|
|
1990
2005
|
}
|
|
1991
2006
|
//#endregion
|
|
1992
2007
|
//#region src/services/documentApi.js
|
|
1993
|
-
function
|
|
2008
|
+
function ti(e) {
|
|
1994
2009
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1995
2010
|
}
|
|
1996
|
-
async function
|
|
2011
|
+
async function ni(e, t, n = [], i = {}) {
|
|
1997
2012
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
1998
2013
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
1999
2014
|
if (!n.length) return {
|
|
@@ -2003,7 +2018,7 @@ async function ti(e, t, n = [], i = {}) {
|
|
|
2003
2018
|
let a = await r(), o = new FormData();
|
|
2004
2019
|
n.forEach(({ formKey: e, file: t }) => {
|
|
2005
2020
|
let n = t?.name ?? void 0;
|
|
2006
|
-
o.append(
|
|
2021
|
+
o.append(ti(e), t, n);
|
|
2007
2022
|
}), i && Object.keys(i).length > 0 && o.append("metadata", JSON.stringify(i));
|
|
2008
2023
|
let c = new URLSearchParams({
|
|
2009
2024
|
module: e,
|
|
@@ -2019,7 +2034,7 @@ async function ti(e, t, n = [], i = {}) {
|
|
|
2019
2034
|
}
|
|
2020
2035
|
return u?.data ?? u;
|
|
2021
2036
|
}
|
|
2022
|
-
async function
|
|
2037
|
+
async function ri(e, t, n = "") {
|
|
2023
2038
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
2024
2039
|
if (!t) throw Error("refId is required to fetch documents");
|
|
2025
2040
|
let r = new URLSearchParams({
|
|
@@ -2033,7 +2048,7 @@ async function ni(e, t, n = "") {
|
|
|
2033
2048
|
total: o?.total ?? 0
|
|
2034
2049
|
};
|
|
2035
2050
|
}
|
|
2036
|
-
async function
|
|
2051
|
+
async function ii(e) {
|
|
2037
2052
|
if (!e) return !1;
|
|
2038
2053
|
try {
|
|
2039
2054
|
return await a(s, `/documents/${encodeURIComponent(String(e))}`, { method: "DELETE" }), !0;
|
|
@@ -2043,36 +2058,36 @@ async function ri(e) {
|
|
|
2043
2058
|
}
|
|
2044
2059
|
//#endregion
|
|
2045
2060
|
//#region src/services/detailedViewApi.js
|
|
2046
|
-
var
|
|
2061
|
+
var ai = {
|
|
2047
2062
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2048
2063
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2049
2064
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2050
2065
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2051
2066
|
};
|
|
2052
|
-
async function
|
|
2067
|
+
async function oi(e, t) {
|
|
2053
2068
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2054
2069
|
if (n === "job" || n === "jobs") {
|
|
2055
2070
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2056
2071
|
return e(t);
|
|
2057
2072
|
}
|
|
2058
|
-
if (n === "candidate" || n === "candidates") return
|
|
2073
|
+
if (n === "candidate" || n === "candidates") return ci(n === "candidate" ? "candidate" : "candidates", t);
|
|
2059
2074
|
let r = new URLSearchParams({
|
|
2060
2075
|
module: String(e ?? ""),
|
|
2061
2076
|
id: String(t)
|
|
2062
2077
|
});
|
|
2063
2078
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2064
2079
|
}
|
|
2065
|
-
async function
|
|
2080
|
+
async function si(e) {
|
|
2066
2081
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2067
2082
|
return {
|
|
2068
2083
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2069
2084
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2070
2085
|
};
|
|
2071
2086
|
}
|
|
2072
|
-
async function
|
|
2087
|
+
async function ci(e, t) {
|
|
2073
2088
|
if (!e) throw Error("module is required");
|
|
2074
2089
|
if (!t) throw Error("id is required");
|
|
2075
|
-
let n =
|
|
2090
|
+
let n = ai[e];
|
|
2076
2091
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2077
2092
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2078
2093
|
method: "GET",
|
|
@@ -2085,7 +2100,7 @@ async function si(e, t) {
|
|
|
2085
2100
|
let o = await a.json();
|
|
2086
2101
|
return o.data ?? o;
|
|
2087
2102
|
}
|
|
2088
|
-
async function
|
|
2103
|
+
async function li(e, t, n, i = []) {
|
|
2089
2104
|
if (!e) throw Error("module is required");
|
|
2090
2105
|
if (!t) throw Error("id is required");
|
|
2091
2106
|
let a = await r(), o = new FormData();
|
|
@@ -2098,15 +2113,15 @@ async function ci(e, t, n, i = []) {
|
|
|
2098
2113
|
if (!c.ok) {
|
|
2099
2114
|
let e = await c.text();
|
|
2100
2115
|
console.error("[updateRecord] Error response:", e);
|
|
2101
|
-
let t = Error(
|
|
2102
|
-
throw t.status = c.status, t.response =
|
|
2116
|
+
let t = Error(di(e) || `API ${c.status}: ${c.statusText}`);
|
|
2117
|
+
throw t.status = c.status, t.response = ui(e), t;
|
|
2103
2118
|
}
|
|
2104
2119
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2105
2120
|
l();
|
|
2106
2121
|
let u = await c.json();
|
|
2107
2122
|
return u.data ?? u;
|
|
2108
2123
|
}
|
|
2109
|
-
function
|
|
2124
|
+
function ui(e) {
|
|
2110
2125
|
let t = String(e ?? "").trim();
|
|
2111
2126
|
if (!t.startsWith("{")) return null;
|
|
2112
2127
|
try {
|
|
@@ -2115,7 +2130,7 @@ function li(e) {
|
|
|
2115
2130
|
return null;
|
|
2116
2131
|
}
|
|
2117
2132
|
}
|
|
2118
|
-
function
|
|
2133
|
+
function di(e) {
|
|
2119
2134
|
let t = String(e ?? "").trim();
|
|
2120
2135
|
if (!t.startsWith("{")) return t;
|
|
2121
2136
|
try {
|
|
@@ -2125,22 +2140,22 @@ function ui(e) {
|
|
|
2125
2140
|
return t;
|
|
2126
2141
|
}
|
|
2127
2142
|
}
|
|
2128
|
-
var
|
|
2129
|
-
async function
|
|
2143
|
+
var fi = (e) => e?.data ?? e;
|
|
2144
|
+
async function pi(e, t) {
|
|
2130
2145
|
if (!e || !t) return [];
|
|
2131
2146
|
let n = new URLSearchParams({
|
|
2132
2147
|
module: e,
|
|
2133
2148
|
id: String(t)
|
|
2134
|
-
}), r =
|
|
2149
|
+
}), r = fi(await a(s, `/module-activity?${n.toString()}`));
|
|
2135
2150
|
return Array.isArray(r) ? r : [];
|
|
2136
2151
|
}
|
|
2137
|
-
async function
|
|
2152
|
+
async function mi(e) {
|
|
2138
2153
|
if (!e) return [];
|
|
2139
|
-
let t =
|
|
2154
|
+
let t = fi(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2140
2155
|
return Array.isArray(t) ? t : [];
|
|
2141
2156
|
}
|
|
2142
|
-
async function
|
|
2143
|
-
return
|
|
2157
|
+
async function hi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2158
|
+
return fi(await a(s, "/notes", {
|
|
2144
2159
|
method: "POST",
|
|
2145
2160
|
body: JSON.stringify({
|
|
2146
2161
|
relatedId: e,
|
|
@@ -2152,28 +2167,29 @@ async function mi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2152
2167
|
}
|
|
2153
2168
|
//#endregion
|
|
2154
2169
|
//#region src/components/form/formDateInputFormat.js
|
|
2155
|
-
var
|
|
2156
|
-
function
|
|
2157
|
-
return (typeof e == "string" ? e.trim() : "") || tr();
|
|
2170
|
+
var gi = d(void 0);
|
|
2171
|
+
function _i(e, t) {
|
|
2172
|
+
return (typeof e == "string" ? e.trim() : "") || nr(t) || tr();
|
|
2158
2173
|
}
|
|
2159
|
-
function
|
|
2160
|
-
|
|
2174
|
+
function vi() {
|
|
2175
|
+
let e = m(gi);
|
|
2176
|
+
return _i(e?.override, e?.moduleName);
|
|
2161
2177
|
}
|
|
2162
2178
|
//#endregion
|
|
2163
2179
|
//#region src/utils/roleFormPermissionGate.js
|
|
2164
|
-
function
|
|
2180
|
+
function yi(e, t) {
|
|
2165
2181
|
if (!e) return !0;
|
|
2166
2182
|
let n = e.find((e) => e.name === t);
|
|
2167
2183
|
return !n || n.enabled !== !1;
|
|
2168
2184
|
}
|
|
2169
|
-
function
|
|
2185
|
+
function bi(e, t, n) {
|
|
2170
2186
|
if (!e) return !0;
|
|
2171
2187
|
let r = e.find((e) => e.name === t);
|
|
2172
2188
|
if (!r) return !0;
|
|
2173
2189
|
let i = r.fields?.find((e) => e.field === n);
|
|
2174
2190
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2175
2191
|
}
|
|
2176
|
-
function
|
|
2192
|
+
function xi(e, t, n) {
|
|
2177
2193
|
if (!e) return !0;
|
|
2178
2194
|
let r = e.find((e) => e.name === t);
|
|
2179
2195
|
if (!r) return !0;
|
|
@@ -2183,7 +2199,7 @@ function bi(e, t, n) {
|
|
|
2183
2199
|
}
|
|
2184
2200
|
//#endregion
|
|
2185
2201
|
//#region src/components/form/inputSecurity.js
|
|
2186
|
-
var
|
|
2202
|
+
var Si = [
|
|
2187
2203
|
"p",
|
|
2188
2204
|
"br",
|
|
2189
2205
|
"strong",
|
|
@@ -2205,12 +2221,12 @@ var xi = [
|
|
|
2205
2221
|
"a",
|
|
2206
2222
|
"code",
|
|
2207
2223
|
"pre"
|
|
2208
|
-
],
|
|
2224
|
+
], Ci = [
|
|
2209
2225
|
"href",
|
|
2210
2226
|
"title",
|
|
2211
2227
|
"target",
|
|
2212
2228
|
"rel"
|
|
2213
|
-
],
|
|
2229
|
+
], wi = /[\u200B-\u200D\u2060\uFEFF]/g, Ti = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, Ei = /^[\p{L}\p{M}\p{N} .'-]+$/u, Di = /^\+?[0-9 ()-]+$/, Oi = /^-?(?:\d+|\d*\.\d+)$/, ki = [
|
|
2214
2230
|
{
|
|
2215
2231
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2216
2232
|
message: "HTML/script content is not allowed"
|
|
@@ -2237,12 +2253,12 @@ var xi = [
|
|
|
2237
2253
|
plainOnly: !0
|
|
2238
2254
|
}
|
|
2239
2255
|
];
|
|
2240
|
-
function
|
|
2256
|
+
function Ai(e) {
|
|
2241
2257
|
if (typeof document > "u") return e;
|
|
2242
2258
|
let t = document.createElement("textarea");
|
|
2243
2259
|
return t.innerHTML = e, t.value;
|
|
2244
2260
|
}
|
|
2245
|
-
function
|
|
2261
|
+
function ji(e) {
|
|
2246
2262
|
let t = String(e ?? "");
|
|
2247
2263
|
for (let e = 0; e < 2; e += 1) try {
|
|
2248
2264
|
let e = decodeURIComponent(t);
|
|
@@ -2251,12 +2267,12 @@ function Ai(e) {
|
|
|
2251
2267
|
} catch {
|
|
2252
2268
|
break;
|
|
2253
2269
|
}
|
|
2254
|
-
return t =
|
|
2270
|
+
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");
|
|
2255
2271
|
}
|
|
2256
|
-
function
|
|
2272
|
+
function Mi(e) {
|
|
2257
2273
|
return je.sanitize(String(e ?? ""), {
|
|
2258
|
-
ALLOWED_TAGS:
|
|
2259
|
-
ALLOWED_ATTR:
|
|
2274
|
+
ALLOWED_TAGS: Si,
|
|
2275
|
+
ALLOWED_ATTR: Ci,
|
|
2260
2276
|
ALLOW_DATA_ATTR: !1,
|
|
2261
2277
|
FORBID_TAGS: [
|
|
2262
2278
|
"script",
|
|
@@ -2276,35 +2292,35 @@ function ji(e) {
|
|
|
2276
2292
|
]
|
|
2277
2293
|
});
|
|
2278
2294
|
}
|
|
2279
|
-
function
|
|
2295
|
+
function Ni(e) {
|
|
2280
2296
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2281
2297
|
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);
|
|
2282
2298
|
}
|
|
2283
|
-
function
|
|
2299
|
+
function Pi(e) {
|
|
2284
2300
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2285
2301
|
}
|
|
2286
|
-
function
|
|
2302
|
+
function Fi(e, t = {}) {
|
|
2287
2303
|
if (typeof e != "string") return e;
|
|
2288
|
-
if (t.type === "text-editor") return
|
|
2289
|
-
let n = e.normalize("NFC").replace(
|
|
2290
|
-
return n =
|
|
2304
|
+
if (t.type === "text-editor") return Mi(e.normalize("NFC"));
|
|
2305
|
+
let n = e.normalize("NFC").replace(wi, "").replace(/\u00A0/g, " ").replace(Ti, "");
|
|
2306
|
+
return n = Pi(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2291
2307
|
}
|
|
2292
|
-
function
|
|
2308
|
+
function Ii(e, t = {}) {
|
|
2293
2309
|
if (typeof e != "string" || e === "") return null;
|
|
2294
|
-
let n = t.label || t.field || "Field", r =
|
|
2310
|
+
let n = t.label || t.field || "Field", r = ji(e);
|
|
2295
2311
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2296
|
-
let i = t.type === "text-editor", a =
|
|
2312
|
+
let i = t.type === "text-editor", a = ki.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2297
2313
|
if (a) return `${n}: ${a.message}`;
|
|
2298
|
-
let o =
|
|
2299
|
-
return [...o].length >
|
|
2314
|
+
let o = Fi(e, t);
|
|
2315
|
+
return [...o].length > Ni(t) ? `${n} is too long` : t.formatter === "name" && o && !Ei.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !Di.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !Oi.test(o) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && o && !/^https?:\/\//i.test(o) ? `${n} must use http:// or https://` : null;
|
|
2300
2316
|
}
|
|
2301
|
-
function
|
|
2317
|
+
function Li(e) {
|
|
2302
2318
|
return { validator: (t, n) => {
|
|
2303
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2319
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Ii(t, e)).find(Boolean);
|
|
2304
2320
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2305
2321
|
} };
|
|
2306
2322
|
}
|
|
2307
|
-
function
|
|
2323
|
+
function Ri(e = []) {
|
|
2308
2324
|
let t = /* @__PURE__ */ new Map();
|
|
2309
2325
|
return e.forEach((e) => {
|
|
2310
2326
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2316,12 +2332,12 @@ function Li(e = []) {
|
|
|
2316
2332
|
});
|
|
2317
2333
|
}), t;
|
|
2318
2334
|
}
|
|
2319
|
-
function
|
|
2320
|
-
let n =
|
|
2335
|
+
function zi(e, t = []) {
|
|
2336
|
+
let n = Ri(t), r = (e, t = "") => {
|
|
2321
2337
|
if (typeof e == "string") {
|
|
2322
|
-
let r = n.get(t) ?? {}, i =
|
|
2338
|
+
let r = n.get(t) ?? {}, i = Ii(e, r);
|
|
2323
2339
|
if (i) throw Error(i);
|
|
2324
|
-
return
|
|
2340
|
+
return Fi(e, r);
|
|
2325
2341
|
}
|
|
2326
2342
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2327
2343
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2333,23 +2349,23 @@ function Ri(e, t = []) {
|
|
|
2333
2349
|
}
|
|
2334
2350
|
//#endregion
|
|
2335
2351
|
//#region src/components/form/validationOverride.js
|
|
2336
|
-
var
|
|
2337
|
-
function
|
|
2352
|
+
var Bi = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2353
|
+
function Vi(e) {
|
|
2338
2354
|
let t = e?.overrideCheckbox;
|
|
2339
|
-
return !t || typeof t != "object" ? null :
|
|
2355
|
+
return !t || typeof t != "object" ? null : Ui(e).size > 0 ? t : null;
|
|
2340
2356
|
}
|
|
2341
|
-
function
|
|
2357
|
+
function Hi(e) {
|
|
2342
2358
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2343
2359
|
}
|
|
2344
|
-
function
|
|
2360
|
+
function Ui(e) {
|
|
2345
2361
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2346
2362
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2347
2363
|
}
|
|
2348
|
-
function
|
|
2364
|
+
function Wi(e) {
|
|
2349
2365
|
return e?.overrideCheckbox?.store !== !1;
|
|
2350
2366
|
}
|
|
2351
|
-
function
|
|
2352
|
-
let r =
|
|
2367
|
+
function Gi(e, t, n) {
|
|
2368
|
+
let r = Hi(e);
|
|
2353
2369
|
if (typeof n == "function") {
|
|
2354
2370
|
let e = n(r);
|
|
2355
2371
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2360,27 +2376,27 @@ function Wi(e, t, n) {
|
|
|
2360
2376
|
r
|
|
2361
2377
|
] : [r];
|
|
2362
2378
|
}
|
|
2363
|
-
function
|
|
2379
|
+
function Ki(e, t) {
|
|
2364
2380
|
return (n) => {
|
|
2365
2381
|
let r = !1;
|
|
2366
2382
|
try {
|
|
2367
|
-
r =
|
|
2383
|
+
r = Bi(n?.getFieldValue?.(t));
|
|
2368
2384
|
} catch {
|
|
2369
2385
|
r = !1;
|
|
2370
2386
|
}
|
|
2371
2387
|
return r ? {} : e;
|
|
2372
2388
|
};
|
|
2373
2389
|
}
|
|
2374
|
-
function
|
|
2375
|
-
if (!
|
|
2376
|
-
let i =
|
|
2390
|
+
function qi(e, t, n, r) {
|
|
2391
|
+
if (!Vi(e)) return r;
|
|
2392
|
+
let i = Ui(e), a = Gi(e, t, n);
|
|
2377
2393
|
return (e) => {
|
|
2378
2394
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2379
|
-
return i.has(n) ?
|
|
2395
|
+
return i.has(n) ? Ki(t, a) : t;
|
|
2380
2396
|
};
|
|
2381
2397
|
}
|
|
2382
|
-
function
|
|
2383
|
-
let t =
|
|
2398
|
+
function Ji(e) {
|
|
2399
|
+
let t = Vi(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2384
2400
|
return {
|
|
2385
2401
|
tone: t.tone ?? "overwrite",
|
|
2386
2402
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2391,12 +2407,12 @@ function qi(e) {
|
|
|
2391
2407
|
}
|
|
2392
2408
|
//#endregion
|
|
2393
2409
|
//#region src/components/form/optionMatching.js
|
|
2394
|
-
function
|
|
2410
|
+
function Yi(e) {
|
|
2395
2411
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2396
2412
|
}
|
|
2397
|
-
function
|
|
2413
|
+
function Xi(e) {
|
|
2398
2414
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2399
|
-
let r =
|
|
2415
|
+
let r = Yi(e);
|
|
2400
2416
|
r && !t.has(r) && t.set(r, n);
|
|
2401
2417
|
};
|
|
2402
2418
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2404,39 +2420,39 @@ function Yi(e) {
|
|
|
2404
2420
|
let t = typeof e == "object" ? e.value : e;
|
|
2405
2421
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2406
2422
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2407
|
-
let i = t.get(
|
|
2423
|
+
let i = t.get(Yi(r));
|
|
2408
2424
|
i !== void 0 && n(e, i);
|
|
2409
2425
|
}), t;
|
|
2410
2426
|
}
|
|
2411
|
-
var
|
|
2412
|
-
function
|
|
2427
|
+
var Zi = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2428
|
+
function Qi(e, t) {
|
|
2413
2429
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2414
|
-
let n = e.get(
|
|
2430
|
+
let n = e.get(Yi(t));
|
|
2415
2431
|
return n === void 0 ? t : n;
|
|
2416
2432
|
}
|
|
2417
|
-
function
|
|
2418
|
-
if (!
|
|
2419
|
-
let n =
|
|
2420
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2433
|
+
function $i(e, t) {
|
|
2434
|
+
if (!Zi(e)) return t;
|
|
2435
|
+
let n = Xi(e);
|
|
2436
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => Qi(n, e)) : Qi(n, t);
|
|
2421
2437
|
}
|
|
2422
2438
|
//#endregion
|
|
2423
2439
|
//#region src/components/form/mountDefaultValue.js
|
|
2424
|
-
function
|
|
2440
|
+
function ea(e = {}) {
|
|
2425
2441
|
let t = e?.defaultValue;
|
|
2426
2442
|
if (t === void 0 || t === "") return;
|
|
2427
|
-
if (e?.type === "time") return
|
|
2443
|
+
if (e?.type === "time") return ra(t);
|
|
2428
2444
|
if (e?.type !== "checkbox") return t;
|
|
2429
2445
|
let n = Array.isArray(e.options) ? e.options : [];
|
|
2430
2446
|
if (!n.length) return t;
|
|
2431
2447
|
let r = n.map((e) => String(e && typeof e == "object" ? e.value : e));
|
|
2432
2448
|
return (Array.isArray(t) ? t : [t]).some((e) => r.includes(String(e))) ? t : void 0;
|
|
2433
2449
|
}
|
|
2434
|
-
var
|
|
2435
|
-
function
|
|
2450
|
+
var ta = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i, na = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
2451
|
+
function ra(e) {
|
|
2436
2452
|
if (e == null || e === "") return;
|
|
2437
2453
|
if (T.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2438
2454
|
if (typeof e != "string") return;
|
|
2439
|
-
let t = e.trim(), n = t.match(
|
|
2455
|
+
let t = e.trim(), n = t.match(ta);
|
|
2440
2456
|
if (n) {
|
|
2441
2457
|
let e = Number(n[1]), t = Number(n[2]), r = Number(n[3] ?? 0), i = n[4]?.replace(/[.\s]/g, "").toLowerCase();
|
|
2442
2458
|
if (i) {
|
|
@@ -2445,27 +2461,27 @@ function na(e) {
|
|
|
2445
2461
|
}
|
|
2446
2462
|
return e > 23 || t > 59 || r > 59 ? void 0 : T().hour(e).minute(t).second(r).millisecond(0);
|
|
2447
2463
|
}
|
|
2448
|
-
if (
|
|
2464
|
+
if (na.test(t)) {
|
|
2449
2465
|
let e = T(t);
|
|
2450
2466
|
return e.isValid() ? e : void 0;
|
|
2451
2467
|
}
|
|
2452
2468
|
}
|
|
2453
2469
|
//#endregion
|
|
2454
2470
|
//#region src/components/form/payloadTransformer.js
|
|
2455
|
-
var R = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2456
|
-
function ia(e) {
|
|
2457
|
-
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2458
|
-
}
|
|
2471
|
+
var R = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, ia = (e) => e === !0 || e === 1 || e === "1", z = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !aa(e);
|
|
2459
2472
|
function aa(e) {
|
|
2460
|
-
return
|
|
2473
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2461
2474
|
}
|
|
2462
2475
|
function oa(e) {
|
|
2463
|
-
return
|
|
2476
|
+
return aa(e) || e instanceof Date;
|
|
2477
|
+
}
|
|
2478
|
+
function sa(e) {
|
|
2479
|
+
return e instanceof Date ? e.toISOString() : aa(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2464
2480
|
}
|
|
2465
|
-
function
|
|
2466
|
-
if (!
|
|
2467
|
-
let n =
|
|
2468
|
-
return n ? n.toISOString() :
|
|
2481
|
+
function ca(e, t) {
|
|
2482
|
+
if (!pr(t)) return sa(e);
|
|
2483
|
+
let n = mr(e);
|
|
2484
|
+
return n ? n.toISOString() : sa(e);
|
|
2469
2485
|
}
|
|
2470
2486
|
function B(e, t) {
|
|
2471
2487
|
if (!t) return;
|
|
@@ -2490,7 +2506,7 @@ function U(e, t, n) {
|
|
|
2490
2506
|
}
|
|
2491
2507
|
return i[r[r.length - 1]] = n, e;
|
|
2492
2508
|
}
|
|
2493
|
-
function
|
|
2509
|
+
function la(e, t, n) {
|
|
2494
2510
|
let r = String(t).split("."), i = e;
|
|
2495
2511
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2496
2512
|
let t = r[e];
|
|
@@ -2502,24 +2518,24 @@ function ca(e, t, n) {
|
|
|
2502
2518
|
...i[a]
|
|
2503
2519
|
} : n, e;
|
|
2504
2520
|
}
|
|
2505
|
-
function
|
|
2521
|
+
function ua(e) {
|
|
2506
2522
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2507
2523
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2508
2524
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2509
2525
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2510
2526
|
}
|
|
2511
|
-
function
|
|
2527
|
+
function da(e, t) {
|
|
2512
2528
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2513
|
-
z(n) && z(e[t]) ?
|
|
2529
|
+
z(n) && z(e[t]) ? da(e[t], n) : e[t] = n;
|
|
2514
2530
|
}), e;
|
|
2515
2531
|
}
|
|
2516
|
-
function
|
|
2532
|
+
function fa(e, t) {
|
|
2517
2533
|
let n = e.options ?? e.values ?? [];
|
|
2518
2534
|
for (let e of n) if (typeof e == "string") {
|
|
2519
2535
|
if (e === t) return e;
|
|
2520
2536
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2521
2537
|
}
|
|
2522
|
-
function
|
|
2538
|
+
function pa(e, t) {
|
|
2523
2539
|
if (z(e)) {
|
|
2524
2540
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2525
2541
|
return {
|
|
@@ -2529,10 +2545,10 @@ function fa(e, t) {
|
|
|
2529
2545
|
}
|
|
2530
2546
|
return {
|
|
2531
2547
|
value: e,
|
|
2532
|
-
label:
|
|
2548
|
+
label: fa(t, e) ?? e
|
|
2533
2549
|
};
|
|
2534
2550
|
}
|
|
2535
|
-
function
|
|
2551
|
+
function ma(e = {}) {
|
|
2536
2552
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2537
2553
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2538
2554
|
switch (e.type) {
|
|
@@ -2543,13 +2559,13 @@ function pa(e = {}) {
|
|
|
2543
2559
|
}
|
|
2544
2560
|
}
|
|
2545
2561
|
function W(e, t, n = {}) {
|
|
2546
|
-
if (
|
|
2547
|
-
if (t === "string") return
|
|
2562
|
+
if (oa(e)) {
|
|
2563
|
+
if (t === "string") return ca(e, n);
|
|
2548
2564
|
if (t === "number") {
|
|
2549
|
-
let t =
|
|
2565
|
+
let t = aa(e) ? e.valueOf() : e.getTime();
|
|
2550
2566
|
return Number.isNaN(t) ? null : t;
|
|
2551
2567
|
}
|
|
2552
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2568
|
+
if (t === "date" || t === "auto" || !t) return ca(e, n);
|
|
2553
2569
|
}
|
|
2554
2570
|
switch (t) {
|
|
2555
2571
|
case "string": return e == null ? "" : String(e);
|
|
@@ -2564,14 +2580,14 @@ function W(e, t, n = {}) {
|
|
|
2564
2580
|
return t = Array.isArray(e) ? e : R(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => W(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2565
2581
|
}
|
|
2566
2582
|
case "object": return z(e), e;
|
|
2567
|
-
case "date": return
|
|
2583
|
+
case "date": return ca(e, n);
|
|
2568
2584
|
case "custom":
|
|
2569
2585
|
case "auto":
|
|
2570
2586
|
case void 0:
|
|
2571
2587
|
default: return e;
|
|
2572
2588
|
}
|
|
2573
2589
|
}
|
|
2574
|
-
var
|
|
2590
|
+
var ha = {
|
|
2575
2591
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2576
2592
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2577
2593
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2579,11 +2595,11 @@ var ma = {
|
|
|
2579
2595
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2580
2596
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2581
2597
|
};
|
|
2582
|
-
function
|
|
2598
|
+
function ga(e, t) {
|
|
2583
2599
|
if (!t) return e;
|
|
2584
2600
|
let n = t;
|
|
2585
2601
|
if (typeof n == "string") {
|
|
2586
|
-
if (
|
|
2602
|
+
if (ha[n]) return ha[n](e);
|
|
2587
2603
|
try {
|
|
2588
2604
|
n = JSON.parse(n);
|
|
2589
2605
|
} catch {
|
|
@@ -2591,14 +2607,14 @@ function ha(e, t) {
|
|
|
2591
2607
|
}
|
|
2592
2608
|
}
|
|
2593
2609
|
let r = e;
|
|
2594
|
-
if (n.name &&
|
|
2610
|
+
if (n.name && ha[n.name] && (r = ha[n.name](r)), n.map && typeof n.map == "object") {
|
|
2595
2611
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2596
2612
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2597
2613
|
}
|
|
2598
2614
|
return r;
|
|
2599
2615
|
}
|
|
2600
|
-
var
|
|
2601
|
-
function
|
|
2616
|
+
var _a = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2617
|
+
function va(e, t) {
|
|
2602
2618
|
let [n, ...r] = e.split("."), i;
|
|
2603
2619
|
if (n === "value") i = t.value;
|
|
2604
2620
|
else if (n === "label") i = t.label;
|
|
@@ -2606,24 +2622,24 @@ function _a(e, t) {
|
|
|
2606
2622
|
else return;
|
|
2607
2623
|
return r.length ? B(i, r.join(".")) : i;
|
|
2608
2624
|
}
|
|
2609
|
-
function
|
|
2625
|
+
function ya(e, t) {
|
|
2610
2626
|
if (typeof e == "string") {
|
|
2611
2627
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2612
|
-
return n ?
|
|
2613
|
-
let r =
|
|
2628
|
+
return n ? va(n[1], t) : e.replace(_a, (e, n) => {
|
|
2629
|
+
let r = va(n, t);
|
|
2614
2630
|
return r == null ? "" : String(r);
|
|
2615
2631
|
});
|
|
2616
2632
|
}
|
|
2617
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2633
|
+
if (Array.isArray(e)) return e.map((e) => ya(e, t));
|
|
2618
2634
|
if (z(e)) {
|
|
2619
2635
|
let n = {};
|
|
2620
2636
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2621
|
-
n[e] =
|
|
2637
|
+
n[e] = ya(r, t);
|
|
2622
2638
|
}), n;
|
|
2623
2639
|
}
|
|
2624
2640
|
return e;
|
|
2625
2641
|
}
|
|
2626
|
-
function
|
|
2642
|
+
function ba(e) {
|
|
2627
2643
|
if (!e) return null;
|
|
2628
2644
|
if (typeof e == "string") try {
|
|
2629
2645
|
return JSON.parse(e);
|
|
@@ -2632,8 +2648,8 @@ function ya(e) {
|
|
|
2632
2648
|
}
|
|
2633
2649
|
return e;
|
|
2634
2650
|
}
|
|
2635
|
-
function
|
|
2636
|
-
let n = e.payloadMode || "auto", r =
|
|
2651
|
+
function xa(e, t) {
|
|
2652
|
+
let n = e.payloadMode || "auto", r = ma(e), { value: i, label: a } = pa(t, e);
|
|
2637
2653
|
switch (n) {
|
|
2638
2654
|
case "value": return {
|
|
2639
2655
|
kind: "scalar",
|
|
@@ -2655,12 +2671,12 @@ function ba(e, t) {
|
|
|
2655
2671
|
}
|
|
2656
2672
|
case "custom":
|
|
2657
2673
|
case "template": {
|
|
2658
|
-
let n =
|
|
2674
|
+
let n = ba(e.payloadTemplate);
|
|
2659
2675
|
if (!n) return {
|
|
2660
2676
|
kind: "scalar",
|
|
2661
2677
|
out: W(i, r, e)
|
|
2662
2678
|
};
|
|
2663
|
-
let o =
|
|
2679
|
+
let o = ya(n, {
|
|
2664
2680
|
value: W(i, e.elementType || "auto", {}),
|
|
2665
2681
|
label: a,
|
|
2666
2682
|
raw: t
|
|
@@ -2676,23 +2692,23 @@ function ba(e, t) {
|
|
|
2676
2692
|
};
|
|
2677
2693
|
}
|
|
2678
2694
|
}
|
|
2679
|
-
function
|
|
2695
|
+
function Sa(e = {}) {
|
|
2680
2696
|
let t = e.defaultValue;
|
|
2681
|
-
if (t !== void 0 && t !== "") return e.type === "time" ?
|
|
2697
|
+
if (t !== void 0 && t !== "") return e.type === "time" ? ra(t) : t;
|
|
2682
2698
|
}
|
|
2683
|
-
function
|
|
2699
|
+
function Ca(e, t) {
|
|
2684
2700
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2685
2701
|
let n = t;
|
|
2686
2702
|
if (R(n)) {
|
|
2687
|
-
let t =
|
|
2703
|
+
let t = Sa(e);
|
|
2688
2704
|
t !== void 0 && (n = t);
|
|
2689
2705
|
}
|
|
2690
|
-
return n =
|
|
2706
|
+
return n = ga(n, e.transformRule), R(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (ma(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2691
2707
|
kind: "scalar",
|
|
2692
|
-
out: n.map((t) =>
|
|
2693
|
-
} :
|
|
2708
|
+
out: n.map((t) => xa(e, t).out)
|
|
2709
|
+
} : xa(e, n);
|
|
2694
2710
|
}
|
|
2695
|
-
function
|
|
2711
|
+
function wa(e = {}) {
|
|
2696
2712
|
return !!e.richValue || [
|
|
2697
2713
|
"label",
|
|
2698
2714
|
"object",
|
|
@@ -2700,8 +2716,8 @@ function Ca(e = {}) {
|
|
|
2700
2716
|
"template"
|
|
2701
2717
|
].includes(e.payloadMode);
|
|
2702
2718
|
}
|
|
2703
|
-
function
|
|
2704
|
-
if (!
|
|
2719
|
+
function Ta(e, t, n = []) {
|
|
2720
|
+
if (!wa(e) || t == null) return t;
|
|
2705
2721
|
let r = (e) => {
|
|
2706
2722
|
if (z(e) && e.value !== void 0) return e;
|
|
2707
2723
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2712,7 +2728,7 @@ function wa(e, t, n = []) {
|
|
|
2712
2728
|
};
|
|
2713
2729
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2714
2730
|
}
|
|
2715
|
-
function
|
|
2731
|
+
function Ea(e, t, n) {
|
|
2716
2732
|
if (!e?.field) return !0;
|
|
2717
2733
|
let r = H(t, e.field) ? V(t, e.field) : V(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2718
2734
|
switch (e.operator) {
|
|
@@ -2726,44 +2742,44 @@ function Ta(e, t, n) {
|
|
|
2726
2742
|
default: return !0;
|
|
2727
2743
|
}
|
|
2728
2744
|
}
|
|
2729
|
-
function
|
|
2745
|
+
function Da(e) {
|
|
2730
2746
|
let t = [];
|
|
2731
2747
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2732
2748
|
e?.field && t.push(e.field);
|
|
2733
2749
|
}), t;
|
|
2734
2750
|
}
|
|
2735
|
-
function
|
|
2751
|
+
function Oa(e, t, n) {
|
|
2736
2752
|
if (!e) return !0;
|
|
2737
2753
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2738
2754
|
if (r.length) {
|
|
2739
|
-
let i = r.map((e) =>
|
|
2755
|
+
let i = r.map((e) => Ea(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2740
2756
|
if (e.field) {
|
|
2741
|
-
let r =
|
|
2757
|
+
let r = Ea(e, t, n);
|
|
2742
2758
|
o = a ? o || r : o && r;
|
|
2743
2759
|
}
|
|
2744
2760
|
return o;
|
|
2745
2761
|
}
|
|
2746
|
-
return
|
|
2762
|
+
return Ea(e, t, n);
|
|
2747
2763
|
}
|
|
2748
|
-
function
|
|
2749
|
-
let a =
|
|
2750
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2764
|
+
function ka(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2765
|
+
let a = Da(e?.showIf);
|
|
2766
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Oa(e.showIf, t, n) ? a.every((e) => {
|
|
2751
2767
|
let a = r?.get?.(e);
|
|
2752
|
-
return !a ||
|
|
2768
|
+
return !a || ka(a, t, n, r, i);
|
|
2753
2769
|
}) : !1);
|
|
2754
2770
|
}
|
|
2755
|
-
function
|
|
2771
|
+
function Aa(e = []) {
|
|
2756
2772
|
let t = /* @__PURE__ */ new Map();
|
|
2757
2773
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2758
2774
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2759
2775
|
})), t;
|
|
2760
2776
|
}
|
|
2761
|
-
function
|
|
2777
|
+
function ja(e = {}, { editing: t = !1 } = {}) {
|
|
2762
2778
|
let n = {};
|
|
2763
2779
|
return (e.fields ?? []).forEach((e) => {
|
|
2764
2780
|
if (!(!e.field || G(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2765
2781
|
if (e.type === "time") {
|
|
2766
|
-
let t =
|
|
2782
|
+
let t = ra(e.defaultValue);
|
|
2767
2783
|
t !== void 0 && (n[e.field] = t);
|
|
2768
2784
|
return;
|
|
2769
2785
|
}
|
|
@@ -2771,7 +2787,7 @@ function Aa(e = {}, { editing: t = !1 } = {}) {
|
|
|
2771
2787
|
}
|
|
2772
2788
|
}), n;
|
|
2773
2789
|
}
|
|
2774
|
-
function
|
|
2790
|
+
function Ma(e = []) {
|
|
2775
2791
|
let t = [];
|
|
2776
2792
|
return e.forEach((e) => {
|
|
2777
2793
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2782,7 +2798,7 @@ function ja(e = []) {
|
|
|
2782
2798
|
});
|
|
2783
2799
|
}), t;
|
|
2784
2800
|
}
|
|
2785
|
-
var
|
|
2801
|
+
var Na = [
|
|
2786
2802
|
"file",
|
|
2787
2803
|
"document",
|
|
2788
2804
|
"image",
|
|
@@ -2790,19 +2806,19 @@ var Ma = [
|
|
|
2790
2806
|
"attachment"
|
|
2791
2807
|
];
|
|
2792
2808
|
function G(e) {
|
|
2793
|
-
return
|
|
2809
|
+
return Na.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2794
2810
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2811
|
+
function Pa(e = []) {
|
|
2812
|
+
return Ma(e).map(({ field: e }) => e).filter(G);
|
|
2797
2813
|
}
|
|
2798
|
-
function
|
|
2814
|
+
function Fa(e) {
|
|
2799
2815
|
return String(e ?? "").trim().toLowerCase();
|
|
2800
2816
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return !!t &&
|
|
2817
|
+
function Ia(e, t) {
|
|
2818
|
+
return !!t && Fa(e.moduleName) === t;
|
|
2803
2819
|
}
|
|
2804
|
-
function
|
|
2805
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2820
|
+
function La(e, t = [], n = {}) {
|
|
2821
|
+
let r = [], i = n.scope ?? "all", a = Fa(n.module), o = (e, t) => {
|
|
2806
2822
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2807
2823
|
let n = t?.originFileObj || t;
|
|
2808
2824
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2814,7 +2830,7 @@ function Ia(e, t = [], n = {}) {
|
|
|
2814
2830
|
return (t ?? []).forEach((t) => {
|
|
2815
2831
|
let r = (t.fields ?? []).filter(G);
|
|
2816
2832
|
if (!r.length) return;
|
|
2817
|
-
let s = t.moduleName && !
|
|
2833
|
+
let s = t.moduleName && !Ia(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2818
2834
|
if (t.addRow) {
|
|
2819
2835
|
if (i === "flat") return;
|
|
2820
2836
|
let a = e[t.name];
|
|
@@ -2834,12 +2850,12 @@ function Ia(e, t = [], n = {}) {
|
|
|
2834
2850
|
});
|
|
2835
2851
|
}), r;
|
|
2836
2852
|
}
|
|
2837
|
-
function
|
|
2853
|
+
function Ra(e, t, n = {}) {
|
|
2838
2854
|
let r = z(n.base) ? structuredClone(n.base) : {};
|
|
2839
|
-
|
|
2840
|
-
(e.payloadKey || e.field) && (
|
|
2855
|
+
Pa(t).forEach((e) => {
|
|
2856
|
+
(e.payloadKey || e.field) && (Va(r, e.payloadKey || e.field), Va(r, e.field));
|
|
2841
2857
|
});
|
|
2842
|
-
let i =
|
|
2858
|
+
let i = Fa(n.module), a = Aa(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Ia(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2843
2859
|
return (t ?? []).forEach((t) => {
|
|
2844
2860
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && H(e, t.toggleField) ? !!V(e, t.toggleField) : !1;
|
|
2845
2861
|
if (t.toggleEnabled && t.toggleField && H(e, t.toggleField) && (U(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2849,29 +2865,29 @@ function La(e, t, n = {}) {
|
|
|
2849
2865
|
if (t.addRow) {
|
|
2850
2866
|
let i = e[t.name];
|
|
2851
2867
|
if (!Array.isArray(i)) return;
|
|
2852
|
-
U(n, t.payloadKey || t.name, i.map((t) =>
|
|
2868
|
+
U(n, t.payloadKey || t.name, i.map((t) => Ba(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2853
2869
|
return;
|
|
2854
2870
|
}
|
|
2855
|
-
r.forEach((t) =>
|
|
2871
|
+
r.forEach((t) => za(t, e, n, e, a));
|
|
2856
2872
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2857
2873
|
moduleName: e,
|
|
2858
2874
|
data: t
|
|
2859
|
-
}))),
|
|
2875
|
+
}))), zi(r, t);
|
|
2860
2876
|
}
|
|
2861
|
-
function
|
|
2862
|
-
if (
|
|
2863
|
-
let r =
|
|
2877
|
+
function za(e, t, n, r, i) {
|
|
2878
|
+
if (Vi(e) && Wi(e)) {
|
|
2879
|
+
let r = Hi(e);
|
|
2864
2880
|
H(t, r) && U(n, r, !!V(t, r));
|
|
2865
2881
|
}
|
|
2866
2882
|
if (G(e)) {
|
|
2867
|
-
let i =
|
|
2883
|
+
let i = ua(V(t, e.field));
|
|
2868
2884
|
if (i !== void 0) {
|
|
2869
2885
|
let a = r !== void 0 && r !== t;
|
|
2870
|
-
|
|
2886
|
+
la(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2871
2887
|
}
|
|
2872
2888
|
return;
|
|
2873
2889
|
}
|
|
2874
|
-
if (
|
|
2890
|
+
if (Da(e.showIf).length && !ka(e, t, r, i)) {
|
|
2875
2891
|
(r === void 0 || r === t) && H(t, e.field) && U(n, e.payloadKey || e.field, null);
|
|
2876
2892
|
return;
|
|
2877
2893
|
}
|
|
@@ -2879,30 +2895,30 @@ function Ra(e, t, n, r, i) {
|
|
|
2879
2895
|
if (!H(t, e.field)) return;
|
|
2880
2896
|
let a = V(t, e.field);
|
|
2881
2897
|
if (!Array.isArray(a)) return;
|
|
2882
|
-
let o = a.map((t) =>
|
|
2898
|
+
let o = a.map((t) => Ba(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2883
2899
|
U(n, e.payloadKey || e.field, o);
|
|
2884
2900
|
return;
|
|
2885
2901
|
}
|
|
2886
2902
|
if (!H(t, e.field)) return;
|
|
2887
|
-
if (
|
|
2888
|
-
let r = V(t, e.field), i = Array.isArray(r) ? r : R(r) ? [] : [r], a =
|
|
2903
|
+
if (ia(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2904
|
+
let r = V(t, e.field), i = Array.isArray(r) ? r : R(r) ? [] : [r], a = Ua(e), o = i.map((e) => Ca(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2889
2905
|
U(n, e.payloadKey || e.field, o);
|
|
2890
2906
|
return;
|
|
2891
2907
|
}
|
|
2892
|
-
let a =
|
|
2908
|
+
let a = Ca(e, V(t, e.field));
|
|
2893
2909
|
if (a.kind !== "skip") {
|
|
2894
2910
|
if (a.kind === "spread" && z(a.out)) {
|
|
2895
|
-
|
|
2911
|
+
da(n, a.out);
|
|
2896
2912
|
return;
|
|
2897
2913
|
}
|
|
2898
2914
|
U(n, e.payloadKey || e.field, a.out);
|
|
2899
2915
|
}
|
|
2900
2916
|
}
|
|
2901
|
-
function
|
|
2917
|
+
function Ba(e, t, n, r) {
|
|
2902
2918
|
let i = {};
|
|
2903
|
-
return e.forEach((e) =>
|
|
2919
|
+
return e.forEach((e) => za(e, t, i, n ?? t, r)), i;
|
|
2904
2920
|
}
|
|
2905
|
-
function
|
|
2921
|
+
function Va(e, t) {
|
|
2906
2922
|
let n = String(t).split("."), r = e;
|
|
2907
2923
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2908
2924
|
if (!z(r[n[e]])) return;
|
|
@@ -2910,7 +2926,7 @@ function Ba(e, t) {
|
|
|
2910
2926
|
}
|
|
2911
2927
|
delete r[n[n.length - 1]];
|
|
2912
2928
|
}
|
|
2913
|
-
var
|
|
2929
|
+
var Ha = /* @__PURE__ */ new Set([
|
|
2914
2930
|
"text",
|
|
2915
2931
|
"textarea",
|
|
2916
2932
|
"email",
|
|
@@ -2923,10 +2939,10 @@ var Va = /* @__PURE__ */ new Set([
|
|
|
2923
2939
|
"password"
|
|
2924
2940
|
]);
|
|
2925
2941
|
function K(e, t) {
|
|
2926
|
-
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ?
|
|
2942
|
+
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ? Sa(e) : void 0;
|
|
2927
2943
|
if (t == null) return r() ?? t;
|
|
2928
2944
|
if (n(t) || R(t) && r() !== void 0) return r();
|
|
2929
|
-
if (
|
|
2945
|
+
if (Ha.has(e.type) && z(t)) {
|
|
2930
2946
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2931
2947
|
if (r === void 0 || z(r)) return;
|
|
2932
2948
|
t = r;
|
|
@@ -2936,8 +2952,8 @@ function K(e, t) {
|
|
|
2936
2952
|
let e = T(t);
|
|
2937
2953
|
return e.isValid() ? e : null;
|
|
2938
2954
|
}
|
|
2939
|
-
t =
|
|
2940
|
-
let i = (t) => z(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
2955
|
+
t = $i(e, t);
|
|
2956
|
+
let i = (t) => z(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && ma(e) === "array", o = (t) => {
|
|
2941
2957
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2942
2958
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2943
2959
|
return n ? n.value : t;
|
|
@@ -2949,7 +2965,7 @@ function K(e, t) {
|
|
|
2949
2965
|
}
|
|
2950
2966
|
return t;
|
|
2951
2967
|
}
|
|
2952
|
-
function
|
|
2968
|
+
function Ua(e = {}) {
|
|
2953
2969
|
return {
|
|
2954
2970
|
...e,
|
|
2955
2971
|
addRow: !1,
|
|
@@ -2958,7 +2974,7 @@ function Ha(e = {}) {
|
|
|
2958
2974
|
dataType: void 0
|
|
2959
2975
|
};
|
|
2960
2976
|
}
|
|
2961
|
-
function
|
|
2977
|
+
function Wa(e, t) {
|
|
2962
2978
|
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;
|
|
2963
2979
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2964
2980
|
let i = [];
|
|
@@ -2974,7 +2990,7 @@ function Ua(e, t) {
|
|
|
2974
2990
|
for (; i.length < a;) i.push({});
|
|
2975
2991
|
return i;
|
|
2976
2992
|
}
|
|
2977
|
-
let i =
|
|
2993
|
+
let i = Ua(e), a = [];
|
|
2978
2994
|
if (Array.isArray(t)) a = t.map((e) => K(i, e)).filter((e) => e != null && e !== "");
|
|
2979
2995
|
else if (t != null && t !== "") {
|
|
2980
2996
|
let e = K(i, t);
|
|
@@ -2986,12 +3002,12 @@ function Ua(e, t) {
|
|
|
2986
3002
|
}
|
|
2987
3003
|
//#endregion
|
|
2988
3004
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2989
|
-
var
|
|
2990
|
-
function
|
|
3005
|
+
var Ga = (e) => e === !0 || e === 1 || e === "1";
|
|
3006
|
+
function Ka(e = []) {
|
|
2991
3007
|
let t = /* @__PURE__ */ new Map();
|
|
2992
3008
|
e.forEach((e) => {
|
|
2993
3009
|
let n = e?.linkGroup;
|
|
2994
|
-
!
|
|
3010
|
+
!Ga(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2995
3011
|
});
|
|
2996
3012
|
let n = /* @__PURE__ */ new Map();
|
|
2997
3013
|
return t.forEach((e, t) => {
|
|
@@ -3001,11 +3017,11 @@ function Ga(e = []) {
|
|
|
3001
3017
|
});
|
|
3002
3018
|
}), n;
|
|
3003
3019
|
}
|
|
3004
|
-
function
|
|
3020
|
+
function qa(e, t) {
|
|
3005
3021
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3006
3022
|
return null;
|
|
3007
3023
|
}
|
|
3008
|
-
function
|
|
3024
|
+
function Ja(e, t = {}) {
|
|
3009
3025
|
let n = { ...t };
|
|
3010
3026
|
return e.forEach(({ memberNames: e }) => {
|
|
3011
3027
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3017,7 +3033,7 @@ function qa(e, t = {}) {
|
|
|
3017
3033
|
}
|
|
3018
3034
|
//#endregion
|
|
3019
3035
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3020
|
-
var
|
|
3036
|
+
var Ya = {
|
|
3021
3037
|
duplicate: {
|
|
3022
3038
|
className: "fdd-tone-amber",
|
|
3023
3039
|
Icon: _e
|
|
@@ -3035,14 +3051,27 @@ var Ja = {
|
|
|
3035
3051
|
Icon: pe
|
|
3036
3052
|
}
|
|
3037
3053
|
};
|
|
3038
|
-
function
|
|
3039
|
-
let { className:
|
|
3054
|
+
function Xa({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c } = {}) {
|
|
3055
|
+
let { className: l, Icon: u } = Ya[e] ?? Ya.suggestion, d = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3040
3056
|
return new Promise((e) => {
|
|
3041
|
-
|
|
3057
|
+
let r = !1, f = (t) => {
|
|
3058
|
+
r || (r = !0, e(t));
|
|
3059
|
+
}, p = ne.confirm({
|
|
3060
|
+
...c ? { footer: (e, { OkBtn: t, CancelBtn: n }) => /* @__PURE__ */ w(ve, { children: [
|
|
3061
|
+
/* @__PURE__ */ C(b, {
|
|
3062
|
+
size: "large",
|
|
3063
|
+
onClick: () => {
|
|
3064
|
+
f("alt"), p.destroy();
|
|
3065
|
+
},
|
|
3066
|
+
children: c
|
|
3067
|
+
}),
|
|
3068
|
+
/* @__PURE__ */ C(n, {}),
|
|
3069
|
+
/* @__PURE__ */ C(t, {})
|
|
3070
|
+
] }) } : {},
|
|
3042
3071
|
icon: null,
|
|
3043
3072
|
centered: !0,
|
|
3044
3073
|
width: 480,
|
|
3045
|
-
className: `fdd-modal ${
|
|
3074
|
+
className: `fdd-modal ${l}`,
|
|
3046
3075
|
okText: i,
|
|
3047
3076
|
cancelText: a,
|
|
3048
3077
|
okButtonProps: {
|
|
@@ -3058,15 +3087,15 @@ function Ya({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3058
3087
|
children: [/* @__PURE__ */ C("span", {
|
|
3059
3088
|
className: "fdd-icon",
|
|
3060
3089
|
"aria-hidden": "true",
|
|
3061
|
-
children: /* @__PURE__ */ C(
|
|
3090
|
+
children: /* @__PURE__ */ C(u, {})
|
|
3062
3091
|
}), /* @__PURE__ */ C("h3", {
|
|
3063
3092
|
className: "fdd-title",
|
|
3064
3093
|
children: t
|
|
3065
3094
|
})]
|
|
3066
3095
|
}),
|
|
3067
|
-
|
|
3096
|
+
d.length > 0 && /* @__PURE__ */ C("dl", {
|
|
3068
3097
|
className: "fdd-facts",
|
|
3069
|
-
children:
|
|
3098
|
+
children: d.map((e) => /* @__PURE__ */ w("div", {
|
|
3070
3099
|
className: "fdd-fact",
|
|
3071
3100
|
children: [/* @__PURE__ */ C("dt", { children: e.label }), /* @__PURE__ */ C("dd", { children: e.value })]
|
|
3072
3101
|
}, e.label))
|
|
@@ -3081,13 +3110,13 @@ function Ya({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3081
3110
|
})
|
|
3082
3111
|
]
|
|
3083
3112
|
}),
|
|
3084
|
-
onOk: () =>
|
|
3085
|
-
onCancel: () =>
|
|
3113
|
+
onOk: () => f(!0),
|
|
3114
|
+
onCancel: () => f(!1)
|
|
3086
3115
|
});
|
|
3087
3116
|
});
|
|
3088
3117
|
}
|
|
3089
|
-
function
|
|
3090
|
-
let { className: a, Icon: o } =
|
|
3118
|
+
function Za({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3119
|
+
let { className: a, Icon: o } = Ya[e] ?? Ya.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3091
3120
|
return new Promise((e) => {
|
|
3092
3121
|
ne.warning({
|
|
3093
3122
|
icon: null,
|
|
@@ -3129,7 +3158,7 @@ function Xa({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3129
3158
|
}
|
|
3130
3159
|
//#endregion
|
|
3131
3160
|
//#region src/services/aiActionApi.js
|
|
3132
|
-
async function
|
|
3161
|
+
async function Qa({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3133
3162
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3134
3163
|
let c = await r(), l = new FormData();
|
|
3135
3164
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3155,17 +3184,17 @@ async function Za({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3155
3184
|
}
|
|
3156
3185
|
//#endregion
|
|
3157
3186
|
//#region src/components/detail/phoneDisplay.js
|
|
3158
|
-
var
|
|
3159
|
-
function
|
|
3187
|
+
var $a = (e) => e == null || e === "";
|
|
3188
|
+
function eo(e, t) {
|
|
3160
3189
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3161
3190
|
}
|
|
3162
|
-
function
|
|
3191
|
+
function to(e) {
|
|
3163
3192
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3164
3193
|
if (!t) return "";
|
|
3165
3194
|
let n = t.replace(/^\+/, "");
|
|
3166
3195
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3167
3196
|
}
|
|
3168
|
-
function
|
|
3197
|
+
function no(e) {
|
|
3169
3198
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3170
3199
|
return [
|
|
3171
3200
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3178,15 +3207,15 @@ function to(e) {
|
|
|
3178
3207
|
"isdCode"
|
|
3179
3208
|
];
|
|
3180
3209
|
}
|
|
3181
|
-
function
|
|
3182
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3210
|
+
function ro(e, t, n = "") {
|
|
3211
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...no(e)] : no(e);
|
|
3183
3212
|
for (let e of i) {
|
|
3184
|
-
let n = eo(
|
|
3213
|
+
let n = to(eo(t, e));
|
|
3185
3214
|
if (n) return n;
|
|
3186
3215
|
}
|
|
3187
|
-
return
|
|
3216
|
+
return to(n);
|
|
3188
3217
|
}
|
|
3189
|
-
function
|
|
3218
|
+
function io(e) {
|
|
3190
3219
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3191
3220
|
return n ? {
|
|
3192
3221
|
code: n[1],
|
|
@@ -3196,17 +3225,17 @@ function ro(e) {
|
|
|
3196
3225
|
rest: t
|
|
3197
3226
|
};
|
|
3198
3227
|
}
|
|
3199
|
-
function
|
|
3200
|
-
if (
|
|
3201
|
-
let { code: n, rest: r } =
|
|
3228
|
+
function ao(e, t = "") {
|
|
3229
|
+
if ($a(e)) return "";
|
|
3230
|
+
let { code: n, rest: r } = io(e), i = n || to(t), a = Qn(r) || r;
|
|
3202
3231
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3203
3232
|
}
|
|
3204
|
-
function
|
|
3205
|
-
return
|
|
3233
|
+
function oo(e, t, n) {
|
|
3234
|
+
return ao(t, ro(e, n, Xn()));
|
|
3206
3235
|
}
|
|
3207
3236
|
//#endregion
|
|
3208
3237
|
//#region src/components/detail/renderConfig.js
|
|
3209
|
-
var
|
|
3238
|
+
var so = [
|
|
3210
3239
|
{
|
|
3211
3240
|
value: "auto",
|
|
3212
3241
|
label: "Default (auto)"
|
|
@@ -3263,7 +3292,7 @@ var oo = [
|
|
|
3263
3292
|
value: "html",
|
|
3264
3293
|
label: "HTML"
|
|
3265
3294
|
}
|
|
3266
|
-
],
|
|
3295
|
+
], co = [
|
|
3267
3296
|
{
|
|
3268
3297
|
value: "preview",
|
|
3269
3298
|
label: "Preview (viewer)"
|
|
@@ -3284,7 +3313,7 @@ var oo = [
|
|
|
3284
3313
|
value: "text",
|
|
3285
3314
|
label: "Text (filename)"
|
|
3286
3315
|
}
|
|
3287
|
-
],
|
|
3316
|
+
], lo = [
|
|
3288
3317
|
{
|
|
3289
3318
|
value: "none",
|
|
3290
3319
|
label: "None"
|
|
@@ -3301,76 +3330,76 @@ var oo = [
|
|
|
3301
3330
|
value: "title",
|
|
3302
3331
|
label: "Title Case"
|
|
3303
3332
|
}
|
|
3304
|
-
],
|
|
3333
|
+
], uo = [
|
|
3305
3334
|
"location",
|
|
3306
3335
|
"path",
|
|
3307
3336
|
"url",
|
|
3308
3337
|
"key"
|
|
3309
|
-
],
|
|
3338
|
+
], fo = [
|
|
3310
3339
|
"location",
|
|
3311
3340
|
"filepath",
|
|
3312
3341
|
"path",
|
|
3313
3342
|
"url",
|
|
3314
3343
|
"key"
|
|
3315
|
-
],
|
|
3344
|
+
], po = [
|
|
3316
3345
|
"uploadedfilename",
|
|
3317
3346
|
"uploadname",
|
|
3318
3347
|
"originalname",
|
|
3319
3348
|
"displayname",
|
|
3320
3349
|
"documentname",
|
|
3321
3350
|
"filename"
|
|
3322
|
-
],
|
|
3323
|
-
function
|
|
3351
|
+
], mo = ["name"], ho = (e) => String(e).toLowerCase(), go = (e) => e == null || e === "";
|
|
3352
|
+
function _o(e, t) {
|
|
3324
3353
|
for (let n of t) {
|
|
3325
3354
|
let t = e[n];
|
|
3326
3355
|
if (typeof t == "string" && t) return t;
|
|
3327
3356
|
}
|
|
3328
3357
|
return "";
|
|
3329
3358
|
}
|
|
3330
|
-
function
|
|
3331
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3359
|
+
function vo(e, t) {
|
|
3360
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && ho(t).endsWith(n)) return r;
|
|
3332
3361
|
return "";
|
|
3333
3362
|
}
|
|
3334
|
-
function
|
|
3363
|
+
function yo(e) {
|
|
3335
3364
|
if (!e) return "";
|
|
3336
3365
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3337
3366
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3338
3367
|
}
|
|
3339
|
-
function
|
|
3368
|
+
function bo(e) {
|
|
3340
3369
|
if (!e) return "";
|
|
3341
3370
|
let t = String(e);
|
|
3342
3371
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3343
3372
|
}
|
|
3344
|
-
function
|
|
3373
|
+
function xo(e) {
|
|
3345
3374
|
let t = String(e ?? "").trim();
|
|
3346
3375
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3347
3376
|
}
|
|
3348
|
-
function xo(e) {
|
|
3349
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : go(e, lo) || _o(e, uo);
|
|
3350
|
-
}
|
|
3351
3377
|
function So(e) {
|
|
3352
|
-
return
|
|
3378
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : _o(e, uo) || vo(e, fo);
|
|
3353
3379
|
}
|
|
3354
3380
|
function Co(e) {
|
|
3355
|
-
|
|
3381
|
+
return e ? typeof e == "string" ? yo(e) || e : typeof e == "object" && (_o(e, N().documentNameOrder ?? []) || vo(e, po) || yo(So(e)) || vo(e, mo)) || "Document" : "Document";
|
|
3382
|
+
}
|
|
3383
|
+
function wo(e) {
|
|
3384
|
+
if (go(e)) return [];
|
|
3356
3385
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3357
|
-
for (let e of t) if (!
|
|
3386
|
+
for (let e of t) if (!go(e)) {
|
|
3358
3387
|
if (typeof e == "string") {
|
|
3359
3388
|
let t = e.includes("/") ? e : "";
|
|
3360
3389
|
n.push({
|
|
3361
3390
|
location: t,
|
|
3362
|
-
name:
|
|
3363
|
-
url:
|
|
3364
|
-
needsAuthFetch:
|
|
3391
|
+
name: yo(e) || e,
|
|
3392
|
+
url: bo(t),
|
|
3393
|
+
needsAuthFetch: xo(t)
|
|
3365
3394
|
});
|
|
3366
3395
|
} else if (typeof e == "object") {
|
|
3367
|
-
let t =
|
|
3396
|
+
let t = So(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3368
3397
|
n.push({
|
|
3369
3398
|
location: t,
|
|
3370
|
-
name:
|
|
3371
|
-
url: r ||
|
|
3399
|
+
name: Co(e),
|
|
3400
|
+
url: r || bo(t),
|
|
3372
3401
|
documentId: e.id || e._id || e.documentId || "",
|
|
3373
|
-
needsAuthFetch: !r &&
|
|
3402
|
+
needsAuthFetch: !r && xo(t)
|
|
3374
3403
|
});
|
|
3375
3404
|
}
|
|
3376
3405
|
}
|
|
@@ -3378,24 +3407,24 @@ function Co(e) {
|
|
|
3378
3407
|
}
|
|
3379
3408
|
//#endregion
|
|
3380
3409
|
//#region src/components/form/repeatableRowShape.js
|
|
3381
|
-
function
|
|
3410
|
+
function To(e) {
|
|
3382
3411
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3383
3412
|
}
|
|
3384
|
-
function
|
|
3413
|
+
function Eo(e, t) {
|
|
3385
3414
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3386
|
-
let n =
|
|
3415
|
+
let n = To(e);
|
|
3387
3416
|
if (!n) return t;
|
|
3388
3417
|
let r = !1, i = t.map((e) => typeof e == "object" && e && !Array.isArray(e) ? e : e == null || String(e).trim() === "" ? (r = !0, {}) : (r = !0, { [n]: e }));
|
|
3389
3418
|
return r ? i : t;
|
|
3390
3419
|
}
|
|
3391
3420
|
//#endregion
|
|
3392
3421
|
//#region src/components/form/applyGroupValues.js
|
|
3393
|
-
var
|
|
3394
|
-
function
|
|
3422
|
+
var Do = (e) => e === !0 || e === 1 || e === "1", Oo = (e) => e == null || e === "";
|
|
3423
|
+
function ko(e) {
|
|
3395
3424
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3396
3425
|
}
|
|
3397
3426
|
function q(e, t, n) {
|
|
3398
|
-
let r = Array.isArray(t) ? t :
|
|
3427
|
+
let r = Array.isArray(t) ? t : ko(t);
|
|
3399
3428
|
if (!r.length) return e;
|
|
3400
3429
|
let i = e;
|
|
3401
3430
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3404,23 +3433,23 @@ function q(e, t, n) {
|
|
|
3404
3433
|
}
|
|
3405
3434
|
return i[r[r.length - 1]] = n, e;
|
|
3406
3435
|
}
|
|
3407
|
-
function
|
|
3436
|
+
function Ao(e, t = []) {
|
|
3408
3437
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3409
3438
|
if (!n) continue;
|
|
3410
3439
|
let t = B(e, n);
|
|
3411
|
-
if (!
|
|
3440
|
+
if (!Oo(t)) return t;
|
|
3412
3441
|
}
|
|
3413
3442
|
}
|
|
3414
|
-
function
|
|
3443
|
+
function jo(e, t) {
|
|
3415
3444
|
if (!e || typeof e != "object") return;
|
|
3416
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3445
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Oo(n));
|
|
3417
3446
|
if (r) return r[1];
|
|
3418
3447
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3419
|
-
let n =
|
|
3420
|
-
if (!
|
|
3448
|
+
let n = jo(e, t);
|
|
3449
|
+
if (!Oo(n)) return n;
|
|
3421
3450
|
}
|
|
3422
3451
|
}
|
|
3423
|
-
function
|
|
3452
|
+
function Mo(e, t) {
|
|
3424
3453
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3425
3454
|
if (!n.length) return;
|
|
3426
3455
|
let r = n.map((e, n) => {
|
|
@@ -3430,9 +3459,9 @@ function jo(e, t) {
|
|
|
3430
3459
|
status: "done"
|
|
3431
3460
|
};
|
|
3432
3461
|
if (!e || typeof e != "object") return null;
|
|
3433
|
-
let r =
|
|
3462
|
+
let r = Ao(e, [t.fileUrlKey, t.locationKey]) ?? jo(e, /(location|url|path)$/i) ?? "", i = Ao(e, [t.fileNameKey]) ?? jo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3434
3463
|
if (!r && !i) return null;
|
|
3435
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3464
|
+
let a = r && !String(r).startsWith("http") ? bo(r) : r;
|
|
3436
3465
|
return {
|
|
3437
3466
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3438
3467
|
name: i || "file",
|
|
@@ -3444,11 +3473,11 @@ function jo(e, t) {
|
|
|
3444
3473
|
}).filter(Boolean);
|
|
3445
3474
|
return r.length ? r : void 0;
|
|
3446
3475
|
}
|
|
3447
|
-
function
|
|
3476
|
+
function No(e, t) {
|
|
3448
3477
|
if (!e || typeof e != "object") return;
|
|
3449
|
-
let n =
|
|
3478
|
+
let n = Ao(e, [t.fileNameKey, t.field]) ?? jo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Ao(e, [t.fileUrlKey, t.locationKey]) ?? jo(e, /(location|url|path)$/i) ?? "";
|
|
3450
3479
|
if (!n && !r) return;
|
|
3451
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3480
|
+
let i = r && !String(r).startsWith("http") ? bo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3452
3481
|
return [{
|
|
3453
3482
|
uid: String(a),
|
|
3454
3483
|
name: n ?? "file",
|
|
@@ -3457,7 +3486,7 @@ function Mo(e, t) {
|
|
|
3457
3486
|
url: i || void 0
|
|
3458
3487
|
}];
|
|
3459
3488
|
}
|
|
3460
|
-
function
|
|
3489
|
+
function Po(e, t, n, r) {
|
|
3461
3490
|
(e.fields ?? []).forEach((e) => {
|
|
3462
3491
|
e?.verifyAction && [
|
|
3463
3492
|
e.verifyResultField,
|
|
@@ -3470,8 +3499,8 @@ function No(e, t, n, r) {
|
|
|
3470
3499
|
});
|
|
3471
3500
|
});
|
|
3472
3501
|
}
|
|
3473
|
-
function
|
|
3474
|
-
let t = Array.isArray(e.rows) ?
|
|
3502
|
+
function Fo(e) {
|
|
3503
|
+
let t = Array.isArray(e.rows) ? Eo(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3475
3504
|
let i = {};
|
|
3476
3505
|
return (e.fields ?? []).forEach((e) => {
|
|
3477
3506
|
if (!e.field) return;
|
|
@@ -3482,30 +3511,30 @@ function Po(e) {
|
|
|
3482
3511
|
}
|
|
3483
3512
|
let a = r(t, e);
|
|
3484
3513
|
if (a == null) {
|
|
3485
|
-
let t = e.defaultOnEdit ?
|
|
3514
|
+
let t = e.defaultOnEdit ? Sa(e) : void 0;
|
|
3486
3515
|
t !== void 0 && q(i, e.field, t);
|
|
3487
3516
|
return;
|
|
3488
3517
|
}
|
|
3489
|
-
q(i, e.field,
|
|
3490
|
-
}),
|
|
3491
|
-
}, i =
|
|
3518
|
+
q(i, e.field, Do(e.addRow) ? Wa(e, a) : K(e, a));
|
|
3519
|
+
}), Po(e, t, i, r), i;
|
|
3520
|
+
}, i = ja(e, { editing: !0 });
|
|
3492
3521
|
if (t && t.length > 0) {
|
|
3493
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3522
|
+
let e = t.map((e) => r(e, (e, t) => No(e, t), (e, t) => B(e, t.field)));
|
|
3494
3523
|
for (; e.length < n;) e.push({ ...i });
|
|
3495
3524
|
return e;
|
|
3496
3525
|
}
|
|
3497
|
-
let a = r(e, (e, t) =>
|
|
3526
|
+
let a = r(e, (e, t) => Mo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3498
3527
|
for (; o.length < n;) o.push({ ...i });
|
|
3499
3528
|
return o;
|
|
3500
3529
|
}
|
|
3501
|
-
function
|
|
3530
|
+
function Io(e, t = []) {
|
|
3502
3531
|
let n = {};
|
|
3503
3532
|
return t.forEach((e) => {
|
|
3504
3533
|
e.toggleEnabled && e.toggleField && q(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3505
3534
|
if (!e.field || e.addRow) return;
|
|
3506
3535
|
let t = e.value, r = e.field;
|
|
3507
3536
|
if (e.type === "file") {
|
|
3508
|
-
let i =
|
|
3537
|
+
let i = Mo(t, e);
|
|
3509
3538
|
i && q(n, r, i);
|
|
3510
3539
|
return;
|
|
3511
3540
|
}
|
|
@@ -3515,12 +3544,12 @@ function Fo(e, t = []) {
|
|
|
3515
3544
|
if (i) {
|
|
3516
3545
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3517
3546
|
q(n, r, e ? [e[0]] : []);
|
|
3518
|
-
} else q(n, r,
|
|
3547
|
+
} else q(n, r, $i(e, Array.isArray(t) ? t : [t]));
|
|
3519
3548
|
return;
|
|
3520
3549
|
}
|
|
3521
3550
|
let i = e.splitDialCodeInto;
|
|
3522
3551
|
if (i && typeof t == "string") {
|
|
3523
|
-
let { code: a, rest: o } =
|
|
3552
|
+
let { code: a, rest: o } = io(t), s = to(a);
|
|
3524
3553
|
s && q(n, i, s), q(n, r, K(e, o || t));
|
|
3525
3554
|
return;
|
|
3526
3555
|
}
|
|
@@ -3530,27 +3559,27 @@ function Fo(e, t = []) {
|
|
|
3530
3559
|
}
|
|
3531
3560
|
//#endregion
|
|
3532
3561
|
//#region src/components/form/useAiActions.js
|
|
3533
|
-
function
|
|
3562
|
+
function Lo(e) {
|
|
3534
3563
|
let t = document.createElement("div");
|
|
3535
3564
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3536
3565
|
}
|
|
3537
|
-
function
|
|
3538
|
-
return t && t === "stripHtml" ?
|
|
3566
|
+
function Ro(e, t) {
|
|
3567
|
+
return t && t === "stripHtml" ? Lo(e) : e;
|
|
3539
3568
|
}
|
|
3540
|
-
function
|
|
3569
|
+
function zo(e) {
|
|
3541
3570
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3542
3571
|
}
|
|
3543
|
-
function
|
|
3572
|
+
function Bo(e) {
|
|
3544
3573
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3545
3574
|
}
|
|
3546
|
-
function
|
|
3575
|
+
function Vo(e, t) {
|
|
3547
3576
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3548
|
-
let n =
|
|
3577
|
+
let n = Ro(t, e.transform), r = String(n ?? "").trim();
|
|
3549
3578
|
if (!r) return !1;
|
|
3550
3579
|
let i = Number(e.minWords) || 0;
|
|
3551
|
-
return i > 0 ?
|
|
3580
|
+
return i > 0 ? zo(r) >= i : !0;
|
|
3552
3581
|
}
|
|
3553
|
-
function
|
|
3582
|
+
function Ho(e, t) {
|
|
3554
3583
|
let n = e.inputs || [];
|
|
3555
3584
|
if (n.length === 0) return !0;
|
|
3556
3585
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3558,10 +3587,10 @@ function Vo(e, t) {
|
|
|
3558
3587
|
let n = e.group || `__solo_${t}`;
|
|
3559
3588
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3560
3589
|
});
|
|
3561
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3590
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => Vo(e, t(e.sourceField)))) return !1;
|
|
3562
3591
|
return !0;
|
|
3563
3592
|
}
|
|
3564
|
-
function
|
|
3593
|
+
function Uo(e = []) {
|
|
3565
3594
|
let t = [];
|
|
3566
3595
|
return e.forEach((e) => {
|
|
3567
3596
|
if (e?.addRow) {
|
|
@@ -3574,32 +3603,32 @@ function Ho(e = []) {
|
|
|
3574
3603
|
});
|
|
3575
3604
|
}), t;
|
|
3576
3605
|
}
|
|
3577
|
-
function
|
|
3578
|
-
return
|
|
3606
|
+
function Wo(e, t) {
|
|
3607
|
+
return Uo(t).some((t) => {
|
|
3579
3608
|
let n = e.getFieldValue(t);
|
|
3580
|
-
return Array.isArray(n) ? n.some(
|
|
3609
|
+
return Array.isArray(n) ? n.some(Bo) : n != null && n !== "";
|
|
3581
3610
|
});
|
|
3582
3611
|
}
|
|
3583
|
-
function
|
|
3612
|
+
function Go(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3584
3613
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = n || typeof e.isFieldTouched != "function" ? () => !0 : (t) => e.isFieldTouched(t), o = 0;
|
|
3585
3614
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3586
|
-
if (!(i.has(e) || !a(e) || !
|
|
3615
|
+
if (!(i.has(e) || !a(e) || !Ko(t))) {
|
|
3587
3616
|
if (Array.isArray(t)) {
|
|
3588
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3617
|
+
o += t.filter((e) => e && typeof e == "object" ? Bo(e) : !!e).length;
|
|
3589
3618
|
return;
|
|
3590
3619
|
}
|
|
3591
3620
|
o += 1;
|
|
3592
3621
|
}
|
|
3593
3622
|
}), o;
|
|
3594
3623
|
}
|
|
3595
|
-
function
|
|
3596
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3624
|
+
function Ko(e) {
|
|
3625
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? Bo(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
3597
3626
|
}
|
|
3598
|
-
function
|
|
3627
|
+
function qo(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3599
3628
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
3600
|
-
return n ? a.some((e) =>
|
|
3629
|
+
return n ? a.some((e) => Ko(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && Ko(r[t])) : a.some((e) => Ko(r[e]));
|
|
3601
3630
|
}
|
|
3602
|
-
function
|
|
3631
|
+
function Jo(e = []) {
|
|
3603
3632
|
let t = {};
|
|
3604
3633
|
return (e ?? []).forEach((e) => {
|
|
3605
3634
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3610,38 +3639,38 @@ function qo(e = []) {
|
|
|
3610
3639
|
});
|
|
3611
3640
|
}), t;
|
|
3612
3641
|
}
|
|
3613
|
-
function
|
|
3642
|
+
function Yo(e, t, n) {
|
|
3614
3643
|
let r = e?.confirmWhen ?? "never";
|
|
3615
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3644
|
+
return r === "never" ? !1 : r === "always" || Wo(t, n);
|
|
3616
3645
|
}
|
|
3617
|
-
var
|
|
3646
|
+
var Xo = [
|
|
3618
3647
|
"top-left",
|
|
3619
3648
|
"top-center",
|
|
3620
3649
|
"top-right",
|
|
3621
3650
|
"bottom-left",
|
|
3622
3651
|
"bottom-center",
|
|
3623
3652
|
"bottom-right"
|
|
3624
|
-
],
|
|
3625
|
-
function
|
|
3653
|
+
], Zo = "bottom-left";
|
|
3654
|
+
function Qo(e = []) {
|
|
3626
3655
|
let t = {};
|
|
3627
3656
|
return e.forEach((e) => {
|
|
3628
|
-
let n =
|
|
3657
|
+
let n = Xo.includes(e.position) ? e.position : Zo;
|
|
3629
3658
|
(t[n] ??= []).push(e);
|
|
3630
3659
|
}), t;
|
|
3631
3660
|
}
|
|
3632
|
-
function
|
|
3633
|
-
let [o, s] = v(null), [c, l] = v(""), u = x.useWatch((e) => e, e), d = p((e) =>
|
|
3661
|
+
function $o({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3662
|
+
let [o, s] = v(null), [c, l] = v(""), u = x.useWatch((e) => e, e), d = p((e) => Ho(e, (e) => (u || {})[e]), [u]), f = p((t) => {
|
|
3634
3663
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3635
|
-
let n =
|
|
3664
|
+
let n = Io(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3636
3665
|
return t.forEach((t) => {
|
|
3637
3666
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3638
|
-
let n =
|
|
3667
|
+
let n = Fo(t);
|
|
3639
3668
|
if (n.length === 0) return;
|
|
3640
3669
|
r = !0;
|
|
3641
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3670
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Bo);
|
|
3642
3671
|
if (a.length) {
|
|
3643
3672
|
let e = t.label || t.name;
|
|
3644
|
-
|
|
3673
|
+
Xa({
|
|
3645
3674
|
tone: "overwrite",
|
|
3646
3675
|
title: `Replace what's in ${e}?`,
|
|
3647
3676
|
facts: [
|
|
@@ -3671,9 +3700,9 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3671
3700
|
return {
|
|
3672
3701
|
runAction: p(async (t, o, c, u) => {
|
|
3673
3702
|
let d = c?.confirmWhen ?? "never";
|
|
3674
|
-
if (c?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
3675
|
-
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
3676
|
-
if (!await
|
|
3703
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || qo(e, [o?.field], { includeUntouched: a }))) {
|
|
3704
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = Go(e, [o?.field], { includeUntouched: a });
|
|
3705
|
+
if (!await Xa({
|
|
3677
3706
|
tone: "overwrite",
|
|
3678
3707
|
title: t.title || "Read this file and fill the form in?",
|
|
3679
3708
|
facts: [{
|
|
@@ -3697,12 +3726,12 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3697
3726
|
r && (s[t.param] = r);
|
|
3698
3727
|
} else {
|
|
3699
3728
|
let n = e.getFieldValue(t.sourceField);
|
|
3700
|
-
n != null && n !== "" && (a[t.param] =
|
|
3729
|
+
n != null && n !== "" && (a[t.param] = Ro(n, t.transform));
|
|
3701
3730
|
}
|
|
3702
3731
|
}), (c.inputs || []).forEach((e) => {
|
|
3703
3732
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3704
3733
|
});
|
|
3705
|
-
let l = await
|
|
3734
|
+
let l = await Qa({
|
|
3706
3735
|
module: n,
|
|
3707
3736
|
group: t,
|
|
3708
3737
|
field: o.field,
|
|
@@ -3710,9 +3739,9 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3710
3739
|
inputs: a,
|
|
3711
3740
|
files: s
|
|
3712
3741
|
}), d = c.label || "AI action", p = l?.groups;
|
|
3713
|
-
if (c?.trigger !== "upload" &&
|
|
3714
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3715
|
-
if (!await
|
|
3742
|
+
if (c?.trigger !== "upload" && Yo(c, e, p)) {
|
|
3743
|
+
let e = c.confirmMessages ?? {}, t = Uo(p).length;
|
|
3744
|
+
if (!await Xa({
|
|
3716
3745
|
tone: "overwrite",
|
|
3717
3746
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3718
3747
|
facts: [{
|
|
@@ -3733,7 +3762,7 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3733
3762
|
field: o,
|
|
3734
3763
|
groupName: t,
|
|
3735
3764
|
responseGroups: p,
|
|
3736
|
-
payload:
|
|
3765
|
+
payload: Jo(p)
|
|
3737
3766
|
});
|
|
3738
3767
|
if (e === !1 || e === "abort") return l;
|
|
3739
3768
|
}
|
|
@@ -3765,7 +3794,7 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3765
3794
|
}
|
|
3766
3795
|
//#endregion
|
|
3767
3796
|
//#region src/components/form/AiActionButtons.jsx
|
|
3768
|
-
function
|
|
3797
|
+
function es({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3769
3798
|
if (!t || t.length === 0) return null;
|
|
3770
3799
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3771
3800
|
return /* @__PURE__ */ C(re, {
|
|
@@ -3786,18 +3815,18 @@ function $o({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3786
3815
|
}
|
|
3787
3816
|
//#endregion
|
|
3788
3817
|
//#region src/components/form/emailValidator.js
|
|
3789
|
-
function
|
|
3818
|
+
function ts(e) {
|
|
3790
3819
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3791
3820
|
if (!n) return !1;
|
|
3792
3821
|
let [, r, i] = n;
|
|
3793
3822
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3794
3823
|
}
|
|
3795
|
-
function
|
|
3796
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3824
|
+
function ns(e = "Email", t) {
|
|
3825
|
+
return { validator: (n, r) => r == null || r === "" || ts(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3797
3826
|
}
|
|
3798
3827
|
//#endregion
|
|
3799
3828
|
//#region src/components/form/inputValidator.js
|
|
3800
|
-
var
|
|
3829
|
+
var rs = [
|
|
3801
3830
|
{
|
|
3802
3831
|
label: "Only Numbers",
|
|
3803
3832
|
value: "onlyNumber"
|
|
@@ -3870,7 +3899,7 @@ var ns = [
|
|
|
3870
3899
|
label: "Website URL",
|
|
3871
3900
|
value: "websiteUrl"
|
|
3872
3901
|
}
|
|
3873
|
-
],
|
|
3902
|
+
], is = {
|
|
3874
3903
|
onlyNumber: /^[0-9]$/,
|
|
3875
3904
|
experience: /^[0-9]$/,
|
|
3876
3905
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3886,10 +3915,10 @@ var ns = [
|
|
|
3886
3915
|
decimalRange: /^[0-9.]$/,
|
|
3887
3916
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3888
3917
|
};
|
|
3889
|
-
function
|
|
3890
|
-
return
|
|
3918
|
+
function as(e) {
|
|
3919
|
+
return is[e] ?? null;
|
|
3891
3920
|
}
|
|
3892
|
-
function
|
|
3921
|
+
function os(e, t = {}, n = "change") {
|
|
3893
3922
|
if (!t?.type || e == null) return {
|
|
3894
3923
|
cleaned: e ?? "",
|
|
3895
3924
|
error: null
|
|
@@ -3972,7 +4001,7 @@ function as(e, t = {}, n = "change") {
|
|
|
3972
4001
|
break;
|
|
3973
4002
|
}
|
|
3974
4003
|
case "email":
|
|
3975
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4004
|
+
c = n === "blur" ? r.trim() : r, c && !ts(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3976
4005
|
break;
|
|
3977
4006
|
case "websiteUrl":
|
|
3978
4007
|
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.`);
|
|
@@ -3984,21 +4013,21 @@ function as(e, t = {}, n = "change") {
|
|
|
3984
4013
|
error: l
|
|
3985
4014
|
};
|
|
3986
4015
|
}
|
|
3987
|
-
var
|
|
3988
|
-
function
|
|
4016
|
+
var ss = "This value is already present";
|
|
4017
|
+
function cs(e) {
|
|
3989
4018
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
3990
4019
|
}
|
|
3991
|
-
function
|
|
3992
|
-
if (
|
|
4020
|
+
function ls(e) {
|
|
4021
|
+
if (cs(e) !== "unique") return null;
|
|
3993
4022
|
if (typeof e == "string") return {
|
|
3994
|
-
message:
|
|
4023
|
+
message: ss,
|
|
3995
4024
|
normalizer: "trim",
|
|
3996
4025
|
skipBlank: !0,
|
|
3997
4026
|
validateOn: "blur"
|
|
3998
4027
|
};
|
|
3999
4028
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4000
4029
|
return {
|
|
4001
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4030
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ss,
|
|
4002
4031
|
collectionField: t.collectionField ?? "",
|
|
4003
4032
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4004
4033
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4009,20 +4038,20 @@ function cs(e) {
|
|
|
4009
4038
|
].includes(n) ? n : "blur"
|
|
4010
4039
|
};
|
|
4011
4040
|
}
|
|
4012
|
-
function
|
|
4041
|
+
function us(e) {
|
|
4013
4042
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4014
4043
|
if (!Array.isArray(t)) return null;
|
|
4015
4044
|
for (let e of t) {
|
|
4016
|
-
let t =
|
|
4045
|
+
let t = ls(e);
|
|
4017
4046
|
if (t) return t;
|
|
4018
4047
|
}
|
|
4019
4048
|
return null;
|
|
4020
4049
|
}
|
|
4021
|
-
function
|
|
4050
|
+
function ds(e = []) {
|
|
4022
4051
|
let t = [];
|
|
4023
4052
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4024
4053
|
(e?.fields ?? []).forEach((e) => {
|
|
4025
|
-
let n =
|
|
4054
|
+
let n = us(e);
|
|
4026
4055
|
!n || !e?.field || t.push({
|
|
4027
4056
|
field: e.field,
|
|
4028
4057
|
label: e.label ?? e.field,
|
|
@@ -4031,10 +4060,10 @@ function us(e = []) {
|
|
|
4031
4060
|
});
|
|
4032
4061
|
}), t;
|
|
4033
4062
|
}
|
|
4034
|
-
function
|
|
4063
|
+
function fs(e) {
|
|
4035
4064
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4036
4065
|
}
|
|
4037
|
-
function
|
|
4066
|
+
function ps(e, t = "trim") {
|
|
4038
4067
|
if (e == null) return "";
|
|
4039
4068
|
let n = String(e);
|
|
4040
4069
|
switch (String(t)) {
|
|
@@ -4046,10 +4075,10 @@ function fs(e, t = "trim") {
|
|
|
4046
4075
|
default: return n.trim();
|
|
4047
4076
|
}
|
|
4048
4077
|
}
|
|
4049
|
-
function
|
|
4050
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4078
|
+
function ms(e, t) {
|
|
4079
|
+
return !(!e || e.skipBlank !== !1 && fs(t));
|
|
4051
4080
|
}
|
|
4052
|
-
function
|
|
4081
|
+
function hs(e) {
|
|
4053
4082
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4054
4083
|
}
|
|
4055
4084
|
var J = {
|
|
@@ -4059,21 +4088,21 @@ var J = {
|
|
|
4059
4088
|
STALE: "stale",
|
|
4060
4089
|
ERROR: "error"
|
|
4061
4090
|
};
|
|
4062
|
-
function
|
|
4091
|
+
function gs({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4063
4092
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4064
4093
|
}
|
|
4065
|
-
function
|
|
4094
|
+
function _s({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4066
4095
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4067
4096
|
function o(e) {
|
|
4068
4097
|
a = e, typeof t == "function" && t(a);
|
|
4069
4098
|
}
|
|
4070
4099
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4071
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4072
|
-
let p =
|
|
4100
|
+
if (!c || !t || !s || typeof e != "function" || !ms(c, l)) return { status: J.SKIPPED };
|
|
4101
|
+
let p = gs({
|
|
4073
4102
|
module: t,
|
|
4074
4103
|
field: s,
|
|
4075
4104
|
recordId: u,
|
|
4076
|
-
normalized:
|
|
4105
|
+
normalized: ps(l, c.normalizer)
|
|
4077
4106
|
});
|
|
4078
4107
|
if (n.has(p)) return n.get(p);
|
|
4079
4108
|
i += 1;
|
|
@@ -4091,7 +4120,7 @@ function gs({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4091
4120
|
if (r.get(s) !== m) return { status: J.STALE };
|
|
4092
4121
|
let a = i?.available === !1 ? {
|
|
4093
4122
|
status: J.DUPLICATE,
|
|
4094
|
-
message:
|
|
4123
|
+
message: vs(i) || c.message || ss
|
|
4095
4124
|
} : { status: J.AVAILABLE };
|
|
4096
4125
|
return n.set(p, a), a;
|
|
4097
4126
|
} catch (e) {
|
|
@@ -4112,17 +4141,17 @@ function gs({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4112
4141
|
}
|
|
4113
4142
|
};
|
|
4114
4143
|
}
|
|
4115
|
-
function
|
|
4144
|
+
function vs(e) {
|
|
4116
4145
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4117
4146
|
}
|
|
4118
|
-
var
|
|
4119
|
-
function
|
|
4120
|
-
let r =
|
|
4147
|
+
var ys = "__uniqueRule";
|
|
4148
|
+
function bs({ field: e, validation: t, context: n }) {
|
|
4149
|
+
let r = ls(t);
|
|
4121
4150
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4122
4151
|
let i = e?.field ?? "";
|
|
4123
4152
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4124
|
-
[
|
|
4125
|
-
validateTrigger:
|
|
4153
|
+
[ys]: r,
|
|
4154
|
+
validateTrigger: hs(r),
|
|
4126
4155
|
validator: async (e, t) => {
|
|
4127
4156
|
let a = await n.checker.check({
|
|
4128
4157
|
module: n.module,
|
|
@@ -4137,22 +4166,22 @@ function ys({ field: e, validation: t, context: n }) {
|
|
|
4137
4166
|
}
|
|
4138
4167
|
};
|
|
4139
4168
|
}
|
|
4140
|
-
function
|
|
4169
|
+
function xs(e = []) {
|
|
4141
4170
|
let t = Array.isArray(e) ? e : [];
|
|
4142
|
-
if (!t.some((e) => e && e[
|
|
4143
|
-
let n = t.filter((e) => e && !e[
|
|
4171
|
+
if (!t.some((e) => e && e[ys])) return t;
|
|
4172
|
+
let n = t.filter((e) => e && !e[ys]);
|
|
4144
4173
|
return t.map((e) => {
|
|
4145
|
-
if (!e || !e[
|
|
4174
|
+
if (!e || !e[ys]) return e;
|
|
4146
4175
|
let t = e.validator;
|
|
4147
4176
|
return {
|
|
4148
4177
|
...e,
|
|
4149
|
-
validator: async (e, r) => await
|
|
4178
|
+
validator: async (e, r) => await Ss(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4150
4179
|
};
|
|
4151
4180
|
});
|
|
4152
4181
|
}
|
|
4153
|
-
async function
|
|
4182
|
+
async function Ss(e = [], t, n = {}) {
|
|
4154
4183
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4155
|
-
if (r.required &&
|
|
4184
|
+
if (r.required && fs(t) || !fs(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;
|
|
4156
4185
|
if (typeof r.validator == "function") try {
|
|
4157
4186
|
await r.validator(n, t);
|
|
4158
4187
|
} catch {
|
|
@@ -4161,7 +4190,7 @@ async function xs(e = [], t, n = {}) {
|
|
|
4161
4190
|
}
|
|
4162
4191
|
return !1;
|
|
4163
4192
|
}
|
|
4164
|
-
function
|
|
4193
|
+
function Cs(e) {
|
|
4165
4194
|
let t = String(e ?? "").trim();
|
|
4166
4195
|
if (!t.startsWith("{")) return null;
|
|
4167
4196
|
try {
|
|
@@ -4170,19 +4199,19 @@ function Ss(e) {
|
|
|
4170
4199
|
return null;
|
|
4171
4200
|
}
|
|
4172
4201
|
}
|
|
4173
|
-
function
|
|
4202
|
+
function ws(e) {
|
|
4174
4203
|
if (!e) return null;
|
|
4175
|
-
if (typeof e == "string") return
|
|
4204
|
+
if (typeof e == "string") return Cs(e);
|
|
4176
4205
|
let t = [
|
|
4177
4206
|
e.data,
|
|
4178
4207
|
e.response,
|
|
4179
4208
|
e,
|
|
4180
|
-
|
|
4209
|
+
Cs(e.message)
|
|
4181
4210
|
];
|
|
4182
4211
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4183
4212
|
return null;
|
|
4184
4213
|
}
|
|
4185
|
-
function
|
|
4214
|
+
function Ts({ field: e, group: t, rowIndex: n }) {
|
|
4186
4215
|
let r = String(e ?? ""), i = Number(n);
|
|
4187
4216
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4188
4217
|
String(t),
|
|
@@ -4190,14 +4219,14 @@ function ws({ field: e, group: t, rowIndex: n }) {
|
|
|
4190
4219
|
...r.split(".")
|
|
4191
4220
|
] : r;
|
|
4192
4221
|
}
|
|
4193
|
-
function
|
|
4194
|
-
let n =
|
|
4222
|
+
function Es(e, { uniqueRules: t = [] } = {}) {
|
|
4223
|
+
let n = ws(e);
|
|
4195
4224
|
if (n) {
|
|
4196
4225
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4197
4226
|
let t = {
|
|
4198
4227
|
field: e.field,
|
|
4199
|
-
name:
|
|
4200
|
-
message: e.message || n.message ||
|
|
4228
|
+
name: Ts(e),
|
|
4229
|
+
message: e.message || n.message || ss
|
|
4201
4230
|
};
|
|
4202
4231
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4203
4232
|
});
|
|
@@ -4214,7 +4243,7 @@ function Ts(e, { uniqueRules: t = [] } = {}) {
|
|
|
4214
4243
|
}
|
|
4215
4244
|
//#endregion
|
|
4216
4245
|
//#region src/services/uniqueValidationApi.js
|
|
4217
|
-
async function
|
|
4246
|
+
async function Ds({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4218
4247
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4219
4248
|
let c = {
|
|
4220
4249
|
field: t,
|
|
@@ -4248,7 +4277,7 @@ async function Es({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4248
4277
|
throw e;
|
|
4249
4278
|
}
|
|
4250
4279
|
}
|
|
4251
|
-
async function
|
|
4280
|
+
async function Os({ module: e, payload: t, excludeId: n } = {}) {
|
|
4252
4281
|
if (!e || !t) return { duplicate: !1 };
|
|
4253
4282
|
try {
|
|
4254
4283
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4266,7 +4295,7 @@ async function Ds({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4266
4295
|
}
|
|
4267
4296
|
//#endregion
|
|
4268
4297
|
//#region src/components/form/uploadAccept.js
|
|
4269
|
-
var
|
|
4298
|
+
var ks = [
|
|
4270
4299
|
"jpg",
|
|
4271
4300
|
"jpeg",
|
|
4272
4301
|
"png",
|
|
@@ -4275,18 +4304,18 @@ var Os = [
|
|
|
4275
4304
|
"bmp",
|
|
4276
4305
|
"svg",
|
|
4277
4306
|
"avif"
|
|
4278
|
-
],
|
|
4307
|
+
], As = [
|
|
4279
4308
|
"mp4",
|
|
4280
4309
|
"webm",
|
|
4281
4310
|
"ogg",
|
|
4282
4311
|
"ogv",
|
|
4283
4312
|
"mov",
|
|
4284
4313
|
"m4v"
|
|
4285
|
-
],
|
|
4314
|
+
], js = [
|
|
4286
4315
|
"pdf",
|
|
4287
4316
|
"doc",
|
|
4288
4317
|
"docx"
|
|
4289
|
-
],
|
|
4318
|
+
], Ms = [
|
|
4290
4319
|
{
|
|
4291
4320
|
label: "Any file",
|
|
4292
4321
|
value: "any"
|
|
@@ -4311,45 +4340,45 @@ var Os = [
|
|
|
4311
4340
|
label: "Images & Videos",
|
|
4312
4341
|
value: "imagesAndVideos"
|
|
4313
4342
|
}
|
|
4314
|
-
],
|
|
4343
|
+
], Ns = {
|
|
4315
4344
|
resume: {
|
|
4316
|
-
exts:
|
|
4345
|
+
exts: js,
|
|
4317
4346
|
maxSizeMB: 2,
|
|
4318
4347
|
hint: "PDF, DOC or DOCX",
|
|
4319
4348
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4320
4349
|
},
|
|
4321
4350
|
documents: {
|
|
4322
|
-
exts: [...
|
|
4351
|
+
exts: [...js, ...ks],
|
|
4323
4352
|
hint: "PDF, DOC or image files",
|
|
4324
4353
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4325
4354
|
},
|
|
4326
4355
|
images: {
|
|
4327
|
-
exts:
|
|
4356
|
+
exts: ks,
|
|
4328
4357
|
hint: "Image files",
|
|
4329
4358
|
error: "Only image files are allowed"
|
|
4330
4359
|
},
|
|
4331
4360
|
videos: {
|
|
4332
|
-
exts:
|
|
4361
|
+
exts: As,
|
|
4333
4362
|
hint: "Video files",
|
|
4334
4363
|
error: "Only video files are allowed"
|
|
4335
4364
|
},
|
|
4336
4365
|
imagesAndVideos: {
|
|
4337
|
-
exts: [...
|
|
4366
|
+
exts: [...ks, ...As],
|
|
4338
4367
|
hint: "Image or video files",
|
|
4339
4368
|
error: "Only image or video files are allowed"
|
|
4340
4369
|
}
|
|
4341
4370
|
};
|
|
4342
|
-
function
|
|
4371
|
+
function Ps(e) {
|
|
4343
4372
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4344
4373
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4345
4374
|
}
|
|
4346
|
-
function
|
|
4375
|
+
function Fs(e) {
|
|
4347
4376
|
let t = String(e?.accept ?? "").trim();
|
|
4348
|
-
return t && t !== "any" ?
|
|
4377
|
+
return t && t !== "any" ? Ns[t] ?? null : !t && Ps(e) ? Ns.resume : Ns[t] ?? null;
|
|
4349
4378
|
}
|
|
4350
4379
|
//#endregion
|
|
4351
4380
|
//#region src/components/form/quickActionLabels.js
|
|
4352
|
-
var
|
|
4381
|
+
var Is = /* @__PURE__ */ new Set([
|
|
4353
4382
|
"of",
|
|
4354
4383
|
"and",
|
|
4355
4384
|
"the",
|
|
@@ -4358,7 +4387,7 @@ var Fs = /* @__PURE__ */ new Set([
|
|
|
4358
4387
|
"in",
|
|
4359
4388
|
"a",
|
|
4360
4389
|
"an"
|
|
4361
|
-
]),
|
|
4390
|
+
]), Ls = {
|
|
4362
4391
|
addresses: "address",
|
|
4363
4392
|
branches: "branch",
|
|
4364
4393
|
batches: "batch",
|
|
@@ -4369,43 +4398,43 @@ var Fs = /* @__PURE__ */ new Set([
|
|
|
4369
4398
|
people: "person",
|
|
4370
4399
|
statuses: "status"
|
|
4371
4400
|
};
|
|
4372
|
-
function
|
|
4401
|
+
function Rs(e) {
|
|
4373
4402
|
let t = String(e ?? "").trim();
|
|
4374
4403
|
if (!t) return "";
|
|
4375
4404
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4376
4405
|
let n = t.toLowerCase();
|
|
4377
|
-
return
|
|
4406
|
+
return Ls[n] ? Ls[n] : /[^aeiou]ies$/i.test(t) ? t.slice(0, -3) + "y" : /(s|x|z|ch|sh)es$/i.test(t) ? t.slice(0, -2) : /[^s]s$/i.test(t) ? t.slice(0, -1) : t;
|
|
4378
4407
|
}
|
|
4379
|
-
function
|
|
4408
|
+
function zs(e) {
|
|
4380
4409
|
let t = String(e ?? "").trim();
|
|
4381
4410
|
if (!t) return "";
|
|
4382
4411
|
let n = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-.]+/g, " ").split(/\s+/).filter(Boolean);
|
|
4383
4412
|
if (!n.length) return "";
|
|
4384
|
-
let r =
|
|
4413
|
+
let r = Rs(n[n.length - 1]);
|
|
4385
4414
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4386
4415
|
let n = e.toLowerCase();
|
|
4387
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4416
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Is.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4388
4417
|
}).join(" ");
|
|
4389
4418
|
}
|
|
4390
|
-
function
|
|
4419
|
+
function Bs(e, t) {
|
|
4391
4420
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4392
4421
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4393
|
-
let r =
|
|
4422
|
+
let r = zs(e?.quickCreateModule || t);
|
|
4394
4423
|
return r ? `Add New ${r}` : "Add New";
|
|
4395
4424
|
}
|
|
4396
|
-
function
|
|
4425
|
+
function Vs(e, t) {
|
|
4397
4426
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4398
4427
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4399
|
-
let r =
|
|
4428
|
+
let r = zs(e?.quickEditModule || t);
|
|
4400
4429
|
return r ? `Edit ${r}` : "Edit";
|
|
4401
4430
|
}
|
|
4402
|
-
function
|
|
4403
|
-
let r =
|
|
4404
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4431
|
+
function Hs(e, t, n) {
|
|
4432
|
+
let r = zs((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4433
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : Bs(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : Vs(t, n));
|
|
4405
4434
|
}
|
|
4406
4435
|
//#endregion
|
|
4407
4436
|
//#region src/components/AppButton.jsx
|
|
4408
|
-
function
|
|
4437
|
+
function Us({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4409
4438
|
let o = /* @__PURE__ */ C(b, {
|
|
4410
4439
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4411
4440
|
icon: n,
|
|
@@ -4420,13 +4449,13 @@ function Vs({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4420
4449
|
}
|
|
4421
4450
|
//#endregion
|
|
4422
4451
|
//#region src/components/detail/userNames.js
|
|
4423
|
-
function
|
|
4452
|
+
function Ws(e) {
|
|
4424
4453
|
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 || "";
|
|
4425
4454
|
}
|
|
4426
|
-
function
|
|
4455
|
+
function Gs(e) {
|
|
4427
4456
|
let t = {};
|
|
4428
4457
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4429
|
-
let n =
|
|
4458
|
+
let n = Ws(e);
|
|
4430
4459
|
n && [
|
|
4431
4460
|
e.legacyUserId,
|
|
4432
4461
|
e.userId,
|
|
@@ -4440,29 +4469,29 @@ function Us(e) {
|
|
|
4440
4469
|
});
|
|
4441
4470
|
}), t;
|
|
4442
4471
|
}
|
|
4443
|
-
var
|
|
4444
|
-
function
|
|
4472
|
+
var Ks = /* @__PURE__ */ new Map();
|
|
4473
|
+
function qs(e) {
|
|
4445
4474
|
let t = String(e ?? "").trim();
|
|
4446
4475
|
if (!t) return Promise.resolve("");
|
|
4447
|
-
if (
|
|
4448
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4449
|
-
return
|
|
4476
|
+
if (Ks.has(t)) return Ks.get(t);
|
|
4477
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => Ws(e?.data ?? e ?? null)).catch(() => "");
|
|
4478
|
+
return Ks.set(t, n), n;
|
|
4450
4479
|
}
|
|
4451
|
-
var
|
|
4452
|
-
function
|
|
4480
|
+
var Y = (e) => e == null ? "" : String(e).trim();
|
|
4481
|
+
function Js(e) {
|
|
4453
4482
|
let t = e?.quickCreateNotice;
|
|
4454
4483
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4455
4484
|
enabled: !0,
|
|
4456
|
-
title:
|
|
4457
|
-
message:
|
|
4485
|
+
title: Y(t.title) || "New record created",
|
|
4486
|
+
message: Y(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.",
|
|
4458
4487
|
showCreator: t.showCreator !== !1,
|
|
4459
4488
|
showRecordName: t.showRecordName !== !1,
|
|
4460
|
-
recordNameField:
|
|
4461
|
-
recordLabel:
|
|
4462
|
-
creatorLabel:
|
|
4489
|
+
recordNameField: Y(t.recordNameField),
|
|
4490
|
+
recordLabel: Y(t.recordLabel) || "Record name",
|
|
4491
|
+
creatorLabel: Y(t.creatorLabel) || "Created by"
|
|
4463
4492
|
};
|
|
4464
4493
|
}
|
|
4465
|
-
var
|
|
4494
|
+
var Ys = [
|
|
4466
4495
|
"clientName",
|
|
4467
4496
|
"companyName",
|
|
4468
4497
|
"name",
|
|
@@ -4472,24 +4501,24 @@ var qs = [
|
|
|
4472
4501
|
"label",
|
|
4473
4502
|
"employerName",
|
|
4474
4503
|
"vendorName"
|
|
4475
|
-
],
|
|
4504
|
+
], Xs = (e, t) => {
|
|
4476
4505
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4477
|
-
},
|
|
4478
|
-
function
|
|
4506
|
+
}, Zs = (e) => typeof e == "string" || typeof e == "number" ? Y(e) : e && typeof e == "object" ? Y(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4507
|
+
function Qs(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4479
4508
|
if (!e || typeof e != "object") return "";
|
|
4480
4509
|
for (let r of [
|
|
4481
4510
|
t,
|
|
4482
4511
|
n,
|
|
4483
|
-
...
|
|
4512
|
+
...Ys
|
|
4484
4513
|
]) {
|
|
4485
4514
|
if (!r) continue;
|
|
4486
|
-
let t =
|
|
4515
|
+
let t = Zs(Xs(e, r));
|
|
4487
4516
|
if (t) return t;
|
|
4488
4517
|
}
|
|
4489
4518
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4490
|
-
return r ?
|
|
4519
|
+
return r ? Y(e[r]) : "";
|
|
4491
4520
|
}
|
|
4492
|
-
function
|
|
4521
|
+
function $s(e) {
|
|
4493
4522
|
if (!e || typeof e != "object") return "";
|
|
4494
4523
|
let t = [
|
|
4495
4524
|
e.createdBy,
|
|
@@ -4502,76 +4531,76 @@ function Zs(e) {
|
|
|
4502
4531
|
for (let e of t) {
|
|
4503
4532
|
if (e == null || e === "") continue;
|
|
4504
4533
|
if (typeof e == "object") {
|
|
4505
|
-
let t =
|
|
4534
|
+
let t = Y(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
4506
4535
|
if (t) return t;
|
|
4507
4536
|
continue;
|
|
4508
4537
|
}
|
|
4509
|
-
let t =
|
|
4538
|
+
let t = Y(e);
|
|
4510
4539
|
if (t) return t;
|
|
4511
4540
|
}
|
|
4512
4541
|
return "";
|
|
4513
4542
|
}
|
|
4514
|
-
function
|
|
4543
|
+
function ec(e = i) {
|
|
4515
4544
|
try {
|
|
4516
|
-
return
|
|
4545
|
+
return Ws(e()) || "";
|
|
4517
4546
|
} catch {
|
|
4518
4547
|
return "";
|
|
4519
4548
|
}
|
|
4520
4549
|
}
|
|
4521
|
-
var
|
|
4550
|
+
var tc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4522
4551
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4523
4552
|
return Array.isArray(t) ? t[0] : t;
|
|
4524
4553
|
});
|
|
4525
|
-
async function
|
|
4526
|
-
let { fetchRecord: o =
|
|
4554
|
+
async function nc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4555
|
+
let { fetchRecord: o = tc, fetchUserNameFn: s = qs, getUser: c = i } = a, l = null;
|
|
4527
4556
|
if (e && t) try {
|
|
4528
4557
|
l = await o(e, t);
|
|
4529
4558
|
} catch {
|
|
4530
4559
|
l = null;
|
|
4531
4560
|
}
|
|
4532
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4561
|
+
let u = n?.showRecordName === !1 ? "" : Qs(l, {
|
|
4533
4562
|
recordNameField: n?.recordNameField,
|
|
4534
4563
|
displayField: r
|
|
4535
4564
|
}), d = "";
|
|
4536
4565
|
if (n?.showCreator !== !1) {
|
|
4537
|
-
let e =
|
|
4566
|
+
let e = $s(l);
|
|
4538
4567
|
if (e) try {
|
|
4539
|
-
d =
|
|
4568
|
+
d = Y(await s(e));
|
|
4540
4569
|
} catch {
|
|
4541
4570
|
d = "";
|
|
4542
4571
|
}
|
|
4543
|
-
d ||=
|
|
4572
|
+
d ||= ec(c);
|
|
4544
4573
|
}
|
|
4545
4574
|
return {
|
|
4546
4575
|
recordName: u,
|
|
4547
4576
|
creatorName: d
|
|
4548
4577
|
};
|
|
4549
4578
|
}
|
|
4550
|
-
var
|
|
4551
|
-
function
|
|
4579
|
+
var rc = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
4580
|
+
function ic(e) {
|
|
4552
4581
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
4553
4582
|
}
|
|
4554
|
-
var
|
|
4555
|
-
function
|
|
4556
|
-
let n =
|
|
4557
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
4583
|
+
var ac = (e) => ic(e).toLowerCase();
|
|
4584
|
+
function oc(e, t) {
|
|
4585
|
+
let n = ac(e);
|
|
4586
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => ac(e?.label) === n) ?? null;
|
|
4558
4587
|
}
|
|
4559
|
-
function
|
|
4560
|
-
return t || n ? !1 :
|
|
4588
|
+
function sc({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
4589
|
+
return t || n ? !1 : ic(e).length >= 3;
|
|
4561
4590
|
}
|
|
4562
4591
|
//#endregion
|
|
4563
4592
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4564
|
-
var
|
|
4565
|
-
function
|
|
4593
|
+
var cc = f(() => import("./index.js").then((e) => e.i)), lc = f(() => import("./index.js").then((e) => e.n)), uc = (e) => e == null || e === "", dc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4594
|
+
function fc(e, t, n, r, i) {
|
|
4566
4595
|
let a = e.quickEditIdFrom;
|
|
4567
4596
|
if (a) {
|
|
4568
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4569
|
-
return
|
|
4597
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...dc(a)] : dc(a), i = t?.getFieldValue?.(e);
|
|
4598
|
+
return uc(i) && (i = r?.[a]), uc(i) ? null : i;
|
|
4570
4599
|
}
|
|
4571
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4600
|
+
return i && typeof i == "object" ? i.value ?? null : uc(i) ? null : i;
|
|
4572
4601
|
}
|
|
4573
|
-
function
|
|
4574
|
-
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ?
|
|
4602
|
+
function pc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4603
|
+
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ? fc(e, t, n, i, a) : null, [
|
|
4575
4604
|
p,
|
|
4576
4605
|
e,
|
|
4577
4606
|
t,
|
|
@@ -4585,7 +4614,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4585
4614
|
openCreateWith: null,
|
|
4586
4615
|
isModalOpen: !1
|
|
4587
4616
|
};
|
|
4588
|
-
let ee =
|
|
4617
|
+
let ee = rc(e, r), y = () => c(null), te = () => {
|
|
4589
4618
|
if (e?.quickCreateOnClick) {
|
|
4590
4619
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
4591
4620
|
return;
|
|
@@ -4609,12 +4638,12 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4609
4638
|
module: h,
|
|
4610
4639
|
recordId: String(_)
|
|
4611
4640
|
}), oe = (t) => {
|
|
4612
|
-
let n =
|
|
4641
|
+
let n = Js(e);
|
|
4613
4642
|
n && (d({
|
|
4614
4643
|
...n,
|
|
4615
4644
|
recordName: "",
|
|
4616
4645
|
creatorName: ""
|
|
4617
|
-
}),
|
|
4646
|
+
}), nc({
|
|
4618
4647
|
module: m,
|
|
4619
4648
|
recordId: t,
|
|
4620
4649
|
notice: n,
|
|
@@ -4644,20 +4673,20 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4644
4673
|
icon: /* @__PURE__ */ C(ge, {}),
|
|
4645
4674
|
onClick: te,
|
|
4646
4675
|
style: { paddingLeft: 0 },
|
|
4647
|
-
children:
|
|
4676
|
+
children: Bs(e, m)
|
|
4648
4677
|
}), p && /* @__PURE__ */ C(b, {
|
|
4649
4678
|
type: "link",
|
|
4650
4679
|
size: "small",
|
|
4651
4680
|
icon: /* @__PURE__ */ C(ce, {}),
|
|
4652
4681
|
onClick: ae,
|
|
4653
4682
|
disabled: !_,
|
|
4654
|
-
title: _ ? void 0 : `Choose a ${
|
|
4655
|
-
children:
|
|
4683
|
+
title: _ ? void 0 : `Choose a ${zs(h) || "record"} above first, then edit it here`,
|
|
4684
|
+
children: Vs(e, h)
|
|
4656
4685
|
})]
|
|
4657
4686
|
})
|
|
4658
4687
|
}), ue = s ? /* @__PURE__ */ C(ne, {
|
|
4659
4688
|
open: !0,
|
|
4660
|
-
title:
|
|
4689
|
+
title: Hs(s.mode, e, s.mode === "create" ? m : h),
|
|
4661
4690
|
width: "min(1080px, 96vw)",
|
|
4662
4691
|
footer: null,
|
|
4663
4692
|
destroyOnClose: !0,
|
|
@@ -4675,7 +4704,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4675
4704
|
},
|
|
4676
4705
|
children: /* @__PURE__ */ C(ie, {})
|
|
4677
4706
|
}),
|
|
4678
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4707
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(cc, {
|
|
4679
4708
|
moduleName: s.module,
|
|
4680
4709
|
embedded: !0,
|
|
4681
4710
|
breadcrumbItems: [],
|
|
@@ -4684,7 +4713,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4684
4713
|
onSuccess: (e) => {
|
|
4685
4714
|
y(), oe(e), o?.("create", e);
|
|
4686
4715
|
}
|
|
4687
|
-
}) : /* @__PURE__ */ C(
|
|
4716
|
+
}) : /* @__PURE__ */ C(lc, {
|
|
4688
4717
|
moduleName: s.module,
|
|
4689
4718
|
recordId: s.recordId,
|
|
4690
4719
|
embedded: !0,
|
|
@@ -4708,7 +4737,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4708
4737
|
width: "min(520px, 94vw)",
|
|
4709
4738
|
maskClosable: !1,
|
|
4710
4739
|
onCancel: () => d(null),
|
|
4711
|
-
footer: /* @__PURE__ */ C(
|
|
4740
|
+
footer: /* @__PURE__ */ C(Us, {
|
|
4712
4741
|
variant: "primary",
|
|
4713
4742
|
type: "primary",
|
|
4714
4743
|
onClick: () => d(null),
|
|
@@ -4747,8 +4776,8 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4747
4776
|
}
|
|
4748
4777
|
//#endregion
|
|
4749
4778
|
//#region src/components/form/crossFieldRules.js
|
|
4750
|
-
var
|
|
4751
|
-
function
|
|
4779
|
+
var mc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4780
|
+
function hc(e, t, n) {
|
|
4752
4781
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4753
4782
|
if (typeof n == "function") {
|
|
4754
4783
|
let e = n(t);
|
|
@@ -4756,23 +4785,23 @@ function pc(e, t, n) {
|
|
|
4756
4785
|
}
|
|
4757
4786
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4758
4787
|
}
|
|
4759
|
-
function
|
|
4788
|
+
function gc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4760
4789
|
let s = n.field ?? n.compareField ?? r;
|
|
4761
4790
|
return { validator: async (n, r) => {
|
|
4762
|
-
if (!s ||
|
|
4763
|
-
let c = i?.getFieldValue?.(
|
|
4764
|
-
if (
|
|
4791
|
+
if (!s || mc(r)) return Promise.resolve();
|
|
4792
|
+
let c = i?.getFieldValue?.(hc(a, s, o));
|
|
4793
|
+
if (mc(c)) return Promise.resolve();
|
|
4765
4794
|
let l = Number(c), u = Number(r);
|
|
4766
4795
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4767
4796
|
} };
|
|
4768
4797
|
}
|
|
4769
|
-
function
|
|
4798
|
+
function _c(e = {}, t, n) {
|
|
4770
4799
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4771
|
-
return r ?
|
|
4800
|
+
return r ? hc(t, r, n) : null;
|
|
4772
4801
|
}
|
|
4773
4802
|
//#endregion
|
|
4774
4803
|
//#region src/components/form/maxCeiling.js
|
|
4775
|
-
function
|
|
4804
|
+
function vc(e, t) {
|
|
4776
4805
|
let n = String(t).split(".").filter(Boolean);
|
|
4777
4806
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4778
4807
|
if (n.length > 1) {
|
|
@@ -4785,14 +4814,14 @@ function gc(e, t) {
|
|
|
4785
4814
|
let r = [...e];
|
|
4786
4815
|
return r[r.length - 1] = n[0], r;
|
|
4787
4816
|
}
|
|
4788
|
-
function
|
|
4789
|
-
let r = e?.getFieldValue?.(
|
|
4817
|
+
function yc(e, t, n) {
|
|
4818
|
+
let r = e?.getFieldValue?.(vc(t, n));
|
|
4790
4819
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4791
4820
|
}
|
|
4792
|
-
function
|
|
4821
|
+
function bc(e) {
|
|
4793
4822
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4794
4823
|
}
|
|
4795
|
-
function
|
|
4824
|
+
function xc(e, t) {
|
|
4796
4825
|
for (let n of e ?? []) {
|
|
4797
4826
|
let e = t(n);
|
|
4798
4827
|
if (e == null || e === "") continue;
|
|
@@ -4804,14 +4833,14 @@ function yc(e, t) {
|
|
|
4804
4833
|
}
|
|
4805
4834
|
return null;
|
|
4806
4835
|
}
|
|
4807
|
-
function
|
|
4836
|
+
function Sc({ input: e, compareFields: t, readValue: n }) {
|
|
4808
4837
|
let r = {
|
|
4809
4838
|
ok: !0,
|
|
4810
4839
|
field: null,
|
|
4811
4840
|
maximum: null
|
|
4812
4841
|
};
|
|
4813
4842
|
if (e == null || e === "") return r;
|
|
4814
|
-
let i =
|
|
4843
|
+
let i = xc(t, n);
|
|
4815
4844
|
if (!i) return r;
|
|
4816
4845
|
let a = Number(e);
|
|
4817
4846
|
return Number.isFinite(a) ? {
|
|
@@ -4822,39 +4851,39 @@ function bc({ input: e, compareFields: t, readValue: n }) {
|
|
|
4822
4851
|
}
|
|
4823
4852
|
//#endregion
|
|
4824
4853
|
//#region src/components/form/contextPrefill.js
|
|
4825
|
-
var
|
|
4826
|
-
function
|
|
4854
|
+
var Cc = { candidates: ["applicantId"] };
|
|
4855
|
+
function wc(e) {
|
|
4827
4856
|
let t = String(e ?? "").trim();
|
|
4828
4857
|
if (!t) return [];
|
|
4829
4858
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4830
4859
|
return [.../* @__PURE__ */ new Set([
|
|
4831
4860
|
`${n}Id`,
|
|
4832
4861
|
`${t}Id`,
|
|
4833
|
-
...
|
|
4862
|
+
...Cc[t] ?? []
|
|
4834
4863
|
])];
|
|
4835
4864
|
}
|
|
4836
|
-
function
|
|
4865
|
+
function Tc(e, t) {
|
|
4837
4866
|
if (!t) return "";
|
|
4838
4867
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4839
|
-
for (let r of
|
|
4868
|
+
for (let r of wc(e)) {
|
|
4840
4869
|
let e = String(n(t[r]) || "");
|
|
4841
4870
|
if (e) return e;
|
|
4842
4871
|
}
|
|
4843
4872
|
return "";
|
|
4844
4873
|
}
|
|
4845
|
-
function
|
|
4874
|
+
function Ec(e, t) {
|
|
4846
4875
|
let n = /* @__PURE__ */ new Set();
|
|
4847
4876
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4848
4877
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4849
4878
|
})), [...n];
|
|
4850
4879
|
}
|
|
4851
|
-
function
|
|
4880
|
+
function Dc(e) {
|
|
4852
4881
|
return e?.payloadMode === "skip";
|
|
4853
4882
|
}
|
|
4854
|
-
function
|
|
4883
|
+
function Oc(e) {
|
|
4855
4884
|
return Array.isArray(e) ? e : Array.isArray(e?.groups) ? e.groups : Array.isArray(e?.data) ? e.data : Array.isArray(e?.data?.groups) ? e.data.groups : [];
|
|
4856
4885
|
}
|
|
4857
|
-
function
|
|
4886
|
+
function kc(e) {
|
|
4858
4887
|
let t = {};
|
|
4859
4888
|
return (e ?? []).forEach((e) => {
|
|
4860
4889
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4862,7 +4891,7 @@ function Dc(e) {
|
|
|
4862
4891
|
});
|
|
4863
4892
|
}), t;
|
|
4864
4893
|
}
|
|
4865
|
-
function
|
|
4894
|
+
function Ac(e, t) {
|
|
4866
4895
|
if (!e || !t) return;
|
|
4867
4896
|
let n = e;
|
|
4868
4897
|
for (let e of String(t).split(".")) {
|
|
@@ -4877,7 +4906,7 @@ function Oc(e, t) {
|
|
|
4877
4906
|
}
|
|
4878
4907
|
return n;
|
|
4879
4908
|
}
|
|
4880
|
-
function
|
|
4909
|
+
function jc(e, t) {
|
|
4881
4910
|
if (!(!e || !t)) for (let n of [
|
|
4882
4911
|
t.prefillFrom,
|
|
4883
4912
|
t.field,
|
|
@@ -4885,13 +4914,13 @@ function kc(e, t) {
|
|
|
4885
4914
|
]) {
|
|
4886
4915
|
if (!n) continue;
|
|
4887
4916
|
let t = e[n];
|
|
4888
|
-
if (t ??= B(e, n), t ??=
|
|
4917
|
+
if (t ??= B(e, n), t ??= Ac(e, n), t != null) return t;
|
|
4889
4918
|
}
|
|
4890
4919
|
}
|
|
4891
4920
|
//#endregion
|
|
4892
4921
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
4893
|
-
function
|
|
4894
|
-
let a =
|
|
4922
|
+
function Mc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
4923
|
+
let a = Vi(t), o = x.useWatch(n, e);
|
|
4895
4924
|
if (!a) return null;
|
|
4896
4925
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
4897
4926
|
setTimeout(() => {
|
|
@@ -4902,7 +4931,7 @@ function Ac({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4902
4931
|
e.setFieldValue(n, !1), c();
|
|
4903
4932
|
return;
|
|
4904
4933
|
}
|
|
4905
|
-
let i = await
|
|
4934
|
+
let i = await Xa(Ji(t));
|
|
4906
4935
|
e.setFieldValue(n, !!i), c();
|
|
4907
4936
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
4908
4937
|
return /* @__PURE__ */ C(ae, {
|
|
@@ -4921,34 +4950,34 @@ function Ac({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4921
4950
|
}
|
|
4922
4951
|
//#endregion
|
|
4923
4952
|
//#region src/components/form/prefillWhenRules.js
|
|
4924
|
-
var
|
|
4925
|
-
function
|
|
4953
|
+
var Nc = (e) => String(e ?? "");
|
|
4954
|
+
function Pc(e) {
|
|
4926
4955
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4927
4956
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4928
4957
|
let r = e?.field;
|
|
4929
4958
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
4930
4959
|
}), n;
|
|
4931
4960
|
}
|
|
4932
|
-
function
|
|
4933
|
-
return
|
|
4961
|
+
function Fc(e, t, n, r) {
|
|
4962
|
+
return Pc(e).map((e) => ({
|
|
4934
4963
|
field: e,
|
|
4935
4964
|
path: n(t, e, r)
|
|
4936
4965
|
}));
|
|
4937
4966
|
}
|
|
4938
|
-
function
|
|
4939
|
-
return !e || !e.field ? !1 :
|
|
4967
|
+
function Ic(e, t = {}) {
|
|
4968
|
+
return !e || !e.field ? !1 : Nc(t[e.field]) === Nc(e.value);
|
|
4940
4969
|
}
|
|
4941
|
-
function
|
|
4942
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
4970
|
+
function Lc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
4971
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Ic(e, t));
|
|
4943
4972
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
4944
4973
|
action: "set",
|
|
4945
4974
|
value: o.setValue
|
|
4946
|
-
} : i && r !== void 0 &&
|
|
4975
|
+
} : i && r !== void 0 && Nc(n) === Nc(r) ? { action: "clear" } : { action: "none" };
|
|
4947
4976
|
}
|
|
4948
4977
|
//#endregion
|
|
4949
4978
|
//#region src/components/form/optionConstraints.js
|
|
4950
|
-
var
|
|
4951
|
-
function
|
|
4979
|
+
var X = (e) => String(e ?? "").trim().toLowerCase();
|
|
4980
|
+
function Rc(e) {
|
|
4952
4981
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
4953
4982
|
return t.forEach((e) => {
|
|
4954
4983
|
if (e != null && e !== "") {
|
|
@@ -4960,50 +4989,50 @@ function Ic(e) {
|
|
|
4960
4989
|
e.label,
|
|
4961
4990
|
e.name
|
|
4962
4991
|
].forEach((e) => {
|
|
4963
|
-
e != null && e !== "" && n.push(
|
|
4992
|
+
e != null && e !== "" && n.push(X(e));
|
|
4964
4993
|
});
|
|
4965
4994
|
return;
|
|
4966
4995
|
}
|
|
4967
|
-
n.push(
|
|
4996
|
+
n.push(X(e));
|
|
4968
4997
|
}
|
|
4969
4998
|
}), n;
|
|
4970
4999
|
}
|
|
4971
|
-
function
|
|
4972
|
-
let n =
|
|
5000
|
+
function zc(e = [], t) {
|
|
5001
|
+
let n = Rc(t);
|
|
4973
5002
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4974
|
-
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(
|
|
5003
|
+
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(X(e.value)) || r.has(X(e.label)) : r.has(X(e)));
|
|
4975
5004
|
return i.length > 0 ? i : e;
|
|
4976
5005
|
}
|
|
4977
|
-
function
|
|
5006
|
+
function Bc(e) {
|
|
4978
5007
|
let t = [];
|
|
4979
5008
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
4980
|
-
e != null && e !== "" && t.push(
|
|
5009
|
+
e != null && e !== "" && t.push(X(e));
|
|
4981
5010
|
}), t;
|
|
4982
5011
|
}
|
|
4983
|
-
function
|
|
5012
|
+
function Vc(e, t = {}) {
|
|
4984
5013
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
4985
5014
|
return n.forEach((e) => {
|
|
4986
5015
|
if (!e || e.clearValue) return;
|
|
4987
|
-
let n =
|
|
5016
|
+
let n = Bc(e);
|
|
4988
5017
|
if (!n.length) return;
|
|
4989
|
-
let a =
|
|
5018
|
+
let a = Ic(e, t) ? i : r;
|
|
4990
5019
|
n.forEach((e) => a.add(e));
|
|
4991
5020
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
4992
5021
|
}
|
|
4993
|
-
function
|
|
4994
|
-
let r =
|
|
5022
|
+
function Hc(e = [], t, n) {
|
|
5023
|
+
let r = Vc(t, n);
|
|
4995
5024
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4996
5025
|
let i = new Set(r);
|
|
4997
|
-
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(
|
|
5026
|
+
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(X(e.value)) || i.has(X(e.label))) : !i.has(X(e)));
|
|
4998
5027
|
}
|
|
4999
|
-
function
|
|
5028
|
+
function Uc(e, t = {}, n) {
|
|
5000
5029
|
let r = Array.isArray(e) ? e : [];
|
|
5001
5030
|
if (n == null || n === "") return [];
|
|
5002
|
-
let i =
|
|
5031
|
+
let i = X(n), a = [], o = /* @__PURE__ */ new Set();
|
|
5003
5032
|
return r.forEach((e) => {
|
|
5004
5033
|
if (!e || e.clearValue) return;
|
|
5005
5034
|
let { setValue: n, setValueLabel: r } = e;
|
|
5006
|
-
n != null && n !== "" && r &&
|
|
5035
|
+
n != null && n !== "" && r && X(n) === i && Ic(e, t) && (o.has(X(n)) || (o.add(X(n)), a.push({
|
|
5007
5036
|
value: n,
|
|
5008
5037
|
label: r
|
|
5009
5038
|
})));
|
|
@@ -5011,8 +5040,8 @@ function Vc(e, t = {}, n) {
|
|
|
5011
5040
|
}
|
|
5012
5041
|
//#endregion
|
|
5013
5042
|
//#region src/components/form/optionRowFilters.js
|
|
5014
|
-
var
|
|
5015
|
-
function
|
|
5043
|
+
var Wc = 64;
|
|
5044
|
+
function Gc(e) {
|
|
5016
5045
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5017
5046
|
try {
|
|
5018
5047
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5020,34 +5049,34 @@ function Uc(e) {
|
|
|
5020
5049
|
return "";
|
|
5021
5050
|
}
|
|
5022
5051
|
}
|
|
5023
|
-
var
|
|
5024
|
-
function
|
|
5052
|
+
var Z = (e) => String(e ?? "").trim().toLowerCase(), Kc = (e) => e != null && String(e).trim() !== "";
|
|
5053
|
+
function qc(e) {
|
|
5025
5054
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5026
|
-
return new Set(t.map(
|
|
5055
|
+
return new Set(t.map(Z).filter((e) => e !== ""));
|
|
5027
5056
|
}
|
|
5028
|
-
function
|
|
5029
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5057
|
+
function Jc(e, t) {
|
|
5058
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => Kc(e?.extraData?.[t]));
|
|
5030
5059
|
}
|
|
5031
|
-
function
|
|
5060
|
+
function Yc(e, t, n) {
|
|
5032
5061
|
let r = e?.extraData?.[t];
|
|
5033
|
-
if (!
|
|
5034
|
-
let i =
|
|
5035
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5062
|
+
if (!Kc(n)) return r === !0;
|
|
5063
|
+
let i = qc(n);
|
|
5064
|
+
return i.size === 0 ? r === !0 : i.has(Z(r));
|
|
5036
5065
|
}
|
|
5037
|
-
function
|
|
5066
|
+
function Xc(e, t) {
|
|
5038
5067
|
let n = /* @__PURE__ */ new Map();
|
|
5039
5068
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5040
|
-
let r =
|
|
5041
|
-
r && n.set(r,
|
|
5069
|
+
let r = Z(e?.value);
|
|
5070
|
+
r && n.set(r, Z(e?.extraData?.[t]));
|
|
5042
5071
|
}), n;
|
|
5043
5072
|
}
|
|
5044
|
-
function
|
|
5045
|
-
let r =
|
|
5073
|
+
function Zc(e, t, n) {
|
|
5074
|
+
let r = Z(n);
|
|
5046
5075
|
if (!r) return !1;
|
|
5047
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5076
|
+
let i = /* @__PURE__ */ new Set(), a = Z(e);
|
|
5048
5077
|
if (!a) return !1;
|
|
5049
5078
|
i.add(a);
|
|
5050
|
-
for (let e = 0; e <
|
|
5079
|
+
for (let e = 0; e < Wc; e += 1) {
|
|
5051
5080
|
let e = t.get(a);
|
|
5052
5081
|
if (!e) return !1;
|
|
5053
5082
|
if (e === r) return !0;
|
|
@@ -5056,74 +5085,74 @@ function Xc(e, t, n) {
|
|
|
5056
5085
|
}
|
|
5057
5086
|
return !1;
|
|
5058
5087
|
}
|
|
5059
|
-
function
|
|
5088
|
+
function Qc(e = {}) {
|
|
5060
5089
|
let t = [], n = (e) => {
|
|
5061
5090
|
let n = String(e ?? "").trim();
|
|
5062
5091
|
n && !t.includes(n) && t.push(n);
|
|
5063
5092
|
};
|
|
5064
5093
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5065
5094
|
}
|
|
5066
|
-
function
|
|
5095
|
+
function $c(e, t = {}, n = {}) {
|
|
5067
5096
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5068
5097
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5069
5098
|
typeof console < "u" && console.warn(e);
|
|
5070
5099
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5071
|
-
s && (
|
|
5100
|
+
s && (Jc(o, s) ? o = o.filter((e) => Yc(e, s, t.optionsRequireExtraValue)) : a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));
|
|
5072
5101
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5073
5102
|
if (c) {
|
|
5074
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5103
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Gc(n);
|
|
5075
5104
|
if (!s) a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);
|
|
5076
|
-
else if (!
|
|
5105
|
+
else if (!Jc(e, c)) a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);
|
|
5077
5106
|
else {
|
|
5078
|
-
let t =
|
|
5079
|
-
o = o.filter((e) =>
|
|
5107
|
+
let t = Xc(e, c);
|
|
5108
|
+
o = o.filter((e) => Zc(e?.value, t, s));
|
|
5080
5109
|
}
|
|
5081
5110
|
}
|
|
5082
5111
|
return o;
|
|
5083
5112
|
}
|
|
5084
5113
|
//#endregion
|
|
5085
5114
|
//#region src/components/form/fieldTooltip.js
|
|
5086
|
-
var
|
|
5087
|
-
function
|
|
5088
|
-
return
|
|
5115
|
+
var el = (e) => e == null || String(e).trim() === "", tl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5116
|
+
function nl(e) {
|
|
5117
|
+
return el(e?.tooltip) ? tl(e?.infoEnabled) && !el(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5089
5118
|
}
|
|
5090
5119
|
//#endregion
|
|
5091
5120
|
//#region src/components/form/autofillValue.js
|
|
5092
|
-
var
|
|
5093
|
-
function
|
|
5121
|
+
var rl = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5122
|
+
function il(e, t = {}, n = () => void 0) {
|
|
5094
5123
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5095
|
-
return
|
|
5124
|
+
return rl(i) && a != null && a !== "" ? a : i;
|
|
5096
5125
|
}
|
|
5097
5126
|
//#endregion
|
|
5098
5127
|
//#region src/components/form/dependentLookupReset.js
|
|
5099
|
-
var
|
|
5100
|
-
function
|
|
5101
|
-
return !(!r || e ===
|
|
5128
|
+
var al = Symbol("parentFilterUnseen"), ol = (e) => e == null || e === "", sl = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5129
|
+
function cl({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5130
|
+
return !(!r || e === al || sl(e, t) || ol(e) || ol(n));
|
|
5102
5131
|
}
|
|
5103
5132
|
//#endregion
|
|
5104
5133
|
//#region src/utils/roleAllowsAction.js
|
|
5105
|
-
function
|
|
5106
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5134
|
+
function ll(e) {
|
|
5135
|
+
return e == null ? !0 : typeof e == "object" ? ll(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5107
5136
|
}
|
|
5108
|
-
function
|
|
5137
|
+
function ul(e, t) {
|
|
5109
5138
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5110
5139
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5111
5140
|
let e = String(t).trim().toLowerCase();
|
|
5112
5141
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5113
5142
|
}
|
|
5114
5143
|
}
|
|
5115
|
-
function
|
|
5144
|
+
function dl(e, t) {
|
|
5116
5145
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5117
5146
|
let n = `${t}Access`;
|
|
5118
5147
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5119
5148
|
}
|
|
5120
|
-
function
|
|
5149
|
+
function fl(e, t) {
|
|
5121
5150
|
if (!e) return !0;
|
|
5122
5151
|
try {
|
|
5123
5152
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5124
5153
|
for (let e of o) {
|
|
5125
|
-
let t =
|
|
5126
|
-
if (t) return
|
|
5154
|
+
let t = ul(n, e);
|
|
5155
|
+
if (t) return ll(dl(t, a));
|
|
5127
5156
|
}
|
|
5128
5157
|
return !0;
|
|
5129
5158
|
} catch {
|
|
@@ -5132,10 +5161,10 @@ function dl(e, t) {
|
|
|
5132
5161
|
}
|
|
5133
5162
|
//#endregion
|
|
5134
5163
|
//#region src/utils/afterSubmitNav.js
|
|
5135
|
-
function
|
|
5164
|
+
function pl(e) {
|
|
5136
5165
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5137
5166
|
}
|
|
5138
|
-
function
|
|
5167
|
+
function ml(e, t, n) {
|
|
5139
5168
|
let r = String(e ?? "").trim();
|
|
5140
5169
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5141
5170
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5144,50 +5173,50 @@ function pl(e, t, n) {
|
|
|
5144
5173
|
}
|
|
5145
5174
|
//#endregion
|
|
5146
5175
|
//#region src/utils/backNav.js
|
|
5147
|
-
function
|
|
5176
|
+
function hl(e = typeof window < "u" ? window : void 0) {
|
|
5148
5177
|
let t = e?.history?.state?.idx;
|
|
5149
5178
|
return typeof t == "number" && t > 0;
|
|
5150
5179
|
}
|
|
5151
|
-
function
|
|
5152
|
-
return t && e ? { path: e } :
|
|
5180
|
+
function gl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5181
|
+
return t && e ? { path: e } : hl(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5153
5182
|
}
|
|
5154
|
-
function
|
|
5155
|
-
let n =
|
|
5183
|
+
function _l(e, t = {}) {
|
|
5184
|
+
let n = gl(t);
|
|
5156
5185
|
return n.back ? e(-1) : e(n.path), n;
|
|
5157
5186
|
}
|
|
5158
5187
|
//#endregion
|
|
5159
5188
|
//#region src/components/form/educationRules.js
|
|
5160
|
-
var
|
|
5161
|
-
function
|
|
5189
|
+
var vl = (e) => e == null ? "" : String(e).trim();
|
|
5190
|
+
function yl(e, t) {
|
|
5162
5191
|
let n = e?.regionRules;
|
|
5163
5192
|
if (!n || typeof n != "object") return e ?? {};
|
|
5164
|
-
let r =
|
|
5193
|
+
let r = vl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5165
5194
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5166
5195
|
...e,
|
|
5167
5196
|
...i
|
|
5168
5197
|
};
|
|
5169
5198
|
}
|
|
5170
|
-
function yl(e) {
|
|
5171
|
-
return e?.allowInProgress !== !1;
|
|
5172
|
-
}
|
|
5173
5199
|
function bl(e) {
|
|
5174
|
-
return
|
|
5200
|
+
return e?.allowInProgress !== !1;
|
|
5175
5201
|
}
|
|
5176
5202
|
function xl(e) {
|
|
5177
|
-
return
|
|
5203
|
+
return bl(e) ? "" : wl(e) ? e?.inProgressWarningMessage || e?.inProgressMessage || "In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted." : e?.inProgressMessage || "This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.";
|
|
5178
5204
|
}
|
|
5179
5205
|
function Sl(e) {
|
|
5180
|
-
return
|
|
5206
|
+
return bl(e) ? "allow" : vl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5181
5207
|
}
|
|
5182
5208
|
function Cl(e) {
|
|
5183
|
-
return
|
|
5209
|
+
return Sl(e) === "block";
|
|
5184
5210
|
}
|
|
5185
5211
|
function wl(e) {
|
|
5186
|
-
|
|
5187
|
-
|
|
5212
|
+
return Sl(e) === "warn";
|
|
5213
|
+
}
|
|
5214
|
+
function Tl(e) {
|
|
5215
|
+
if (!Cl(e)) return null;
|
|
5216
|
+
let t = xl(e);
|
|
5188
5217
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5189
5218
|
}
|
|
5190
|
-
function
|
|
5219
|
+
function El(e, t = {}) {
|
|
5191
5220
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5192
5221
|
for (let t of [n, r]) {
|
|
5193
5222
|
let n = e?.[t];
|
|
@@ -5197,50 +5226,50 @@ function Tl(e, t = {}) {
|
|
|
5197
5226
|
}
|
|
5198
5227
|
return null;
|
|
5199
5228
|
}
|
|
5200
|
-
function
|
|
5229
|
+
function Dl(e, t = {}) {
|
|
5201
5230
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5202
5231
|
return !!e?.[n];
|
|
5203
5232
|
}
|
|
5204
|
-
function
|
|
5233
|
+
function Ol(e = [], t = {}) {
|
|
5205
5234
|
let n = (t.direction ?? "desc") === "desc";
|
|
5206
5235
|
return e.map((e, n) => ({
|
|
5207
5236
|
index: n,
|
|
5208
|
-
key:
|
|
5209
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5237
|
+
key: El(e, t),
|
|
5238
|
+
ongoing: t.inProgressFirst !== !1 && Dl(e, t)
|
|
5210
5239
|
})).slice().sort((e, t) => e.ongoing === t.ongoing ? e.key === null && t.key === null ? e.index - t.index : e.key === null ? 1 : t.key === null ? -1 : e.key === t.key ? e.index - t.index : n ? t.key - e.key : e.key - t.key : e.ongoing ? -1 : 1).map((e) => e.index);
|
|
5211
5240
|
}
|
|
5212
|
-
function
|
|
5241
|
+
function kl(e, t, n = {}) {
|
|
5213
5242
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5214
|
-
let r =
|
|
5243
|
+
let r = Ol(e, n).indexOf(t);
|
|
5215
5244
|
return r === -1 || r === t ? null : {
|
|
5216
5245
|
from: t,
|
|
5217
5246
|
to: r,
|
|
5218
|
-
reason:
|
|
5247
|
+
reason: Dl(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5219
5248
|
};
|
|
5220
5249
|
}
|
|
5221
|
-
var
|
|
5250
|
+
var Al = Object.freeze({
|
|
5222
5251
|
inProgress: "You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.",
|
|
5223
5252
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5224
5253
|
ok: "Yes, move it up",
|
|
5225
5254
|
keep: "No, leave it here"
|
|
5226
5255
|
});
|
|
5227
|
-
function
|
|
5256
|
+
function jl(e, t = {}) {
|
|
5228
5257
|
let n = {
|
|
5229
|
-
...
|
|
5258
|
+
...Al,
|
|
5230
5259
|
...t.messages ?? {}
|
|
5231
5260
|
};
|
|
5232
5261
|
return n[e] ?? n.outOfOrder;
|
|
5233
5262
|
}
|
|
5234
|
-
function
|
|
5235
|
-
let n = t.levelField ?? "qualification", r =
|
|
5263
|
+
function Ml(e, t = {}) {
|
|
5264
|
+
let n = t.levelField ?? "qualification", r = vl(e?.[n]);
|
|
5236
5265
|
if (!r) return null;
|
|
5237
5266
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5238
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5267
|
+
return Number.isFinite(Number(a)) ? Number(a) : Nl(r, t);
|
|
5239
5268
|
}
|
|
5240
|
-
function
|
|
5269
|
+
function Nl(e, t) {
|
|
5241
5270
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5242
5271
|
for (let e of n) {
|
|
5243
|
-
let t =
|
|
5272
|
+
let t = vl(e?.match);
|
|
5244
5273
|
if (!t) continue;
|
|
5245
5274
|
let n;
|
|
5246
5275
|
try {
|
|
@@ -5252,14 +5281,14 @@ function Ml(e, t) {
|
|
|
5252
5281
|
}
|
|
5253
5282
|
return null;
|
|
5254
5283
|
}
|
|
5255
|
-
function
|
|
5256
|
-
return
|
|
5284
|
+
function Pl(e, t = {}) {
|
|
5285
|
+
return vl((t?.levelLabels ?? {})[e]) || vl(e);
|
|
5257
5286
|
}
|
|
5258
|
-
function
|
|
5287
|
+
function Fl(e = [], t = {}) {
|
|
5259
5288
|
if (!t || t.requireBelow === !1) return [];
|
|
5260
5289
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5261
5290
|
if (!r.length) return [];
|
|
5262
|
-
let i = e.map((e) =>
|
|
5291
|
+
let i = e.map((e) => Ml(e, t)).filter((e) => e !== null);
|
|
5263
5292
|
if (!i.length) return [];
|
|
5264
5293
|
let a = Math.max(...i), o = [];
|
|
5265
5294
|
return r.forEach((e) => {
|
|
@@ -5267,43 +5296,43 @@ function Pl(e = [], t = {}) {
|
|
|
5267
5296
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5268
5297
|
}), o;
|
|
5269
5298
|
}
|
|
5270
|
-
function
|
|
5271
|
-
let n =
|
|
5299
|
+
function Il(e, t = {}) {
|
|
5300
|
+
let n = Fl(e, t);
|
|
5272
5301
|
if (!n.length) return "";
|
|
5273
|
-
let r = n.map((e) =>
|
|
5302
|
+
let r = n.map((e) => Pl(e, t)).join(", ");
|
|
5274
5303
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5275
5304
|
}
|
|
5276
|
-
async function
|
|
5305
|
+
async function Ll({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5277
5306
|
let a = e?.orderBy;
|
|
5278
5307
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5279
|
-
let o =
|
|
5308
|
+
let o = kl(t, n, a);
|
|
5280
5309
|
if (!o) return !1;
|
|
5281
5310
|
let s = {
|
|
5282
|
-
...
|
|
5311
|
+
...Al,
|
|
5283
5312
|
...a.messages ?? {}
|
|
5284
5313
|
};
|
|
5285
5314
|
return await i({
|
|
5286
5315
|
reason: o.reason,
|
|
5287
5316
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5288
|
-
body:
|
|
5317
|
+
body: jl(o.reason, a),
|
|
5289
5318
|
okText: s.ok,
|
|
5290
5319
|
cancelText: s.keep,
|
|
5291
5320
|
from: o.from,
|
|
5292
5321
|
to: o.to
|
|
5293
5322
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5294
5323
|
}
|
|
5295
|
-
function
|
|
5296
|
-
let n =
|
|
5324
|
+
function Rl(e, t) {
|
|
5325
|
+
let n = yl(e, t), r = n?.orderBy?.inProgressField;
|
|
5297
5326
|
return r ? {
|
|
5298
5327
|
name: n.name,
|
|
5299
5328
|
label: n.label ?? n.name,
|
|
5300
5329
|
rowsKey: n.payloadKey || n.name,
|
|
5301
5330
|
inProgressField: r,
|
|
5302
|
-
severity:
|
|
5303
|
-
message:
|
|
5331
|
+
severity: Sl(n),
|
|
5332
|
+
message: xl(n)
|
|
5304
5333
|
} : null;
|
|
5305
5334
|
}
|
|
5306
|
-
function
|
|
5335
|
+
function zl(e = [], t, n) {
|
|
5307
5336
|
if (!n) return {
|
|
5308
5337
|
severity: "allow",
|
|
5309
5338
|
message: "",
|
|
@@ -5311,8 +5340,8 @@ function Rl(e = [], t, n) {
|
|
|
5311
5340
|
};
|
|
5312
5341
|
let r = null;
|
|
5313
5342
|
for (let i of e) {
|
|
5314
|
-
let e =
|
|
5315
|
-
if (!(!e || e.severity === "allow") &&
|
|
5343
|
+
let e = Rl(i, t);
|
|
5344
|
+
if (!(!e || e.severity === "allow") && Bl(n, e.rowsKey).some((t) => Dl(t, e))) {
|
|
5316
5345
|
if (e.severity === "block") return {
|
|
5317
5346
|
severity: "block",
|
|
5318
5347
|
message: e.message,
|
|
@@ -5331,23 +5360,23 @@ function Rl(e = [], t, n) {
|
|
|
5331
5360
|
group: null
|
|
5332
5361
|
};
|
|
5333
5362
|
}
|
|
5334
|
-
function
|
|
5363
|
+
function Bl(e, t) {
|
|
5335
5364
|
let n = e?.[t];
|
|
5336
5365
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5337
5366
|
}
|
|
5338
|
-
function
|
|
5367
|
+
function Vl(e) {
|
|
5339
5368
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5340
5369
|
}
|
|
5341
|
-
function
|
|
5370
|
+
function Hl(e = [], t = {}) {
|
|
5342
5371
|
let n = null;
|
|
5343
5372
|
for (let r of e) {
|
|
5344
5373
|
let e = r?.levelRule;
|
|
5345
5374
|
if (!e) continue;
|
|
5346
|
-
let i =
|
|
5375
|
+
let i = Ul(t, r);
|
|
5347
5376
|
if (!i.length) continue;
|
|
5348
|
-
let a =
|
|
5377
|
+
let a = Il(i, e);
|
|
5349
5378
|
if (a) {
|
|
5350
|
-
if (
|
|
5379
|
+
if (Vl(e) === "block") return {
|
|
5351
5380
|
severity: "block",
|
|
5352
5381
|
message: a,
|
|
5353
5382
|
group: r
|
|
@@ -5365,7 +5394,7 @@ function Vl(e = [], t = {}) {
|
|
|
5365
5394
|
group: null
|
|
5366
5395
|
};
|
|
5367
5396
|
}
|
|
5368
|
-
function
|
|
5397
|
+
function Ul(e, t) {
|
|
5369
5398
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5370
5399
|
if (!n) continue;
|
|
5371
5400
|
let t = e?.[n];
|
|
@@ -5375,10 +5404,10 @@ function Hl(e, t) {
|
|
|
5375
5404
|
}
|
|
5376
5405
|
//#endregion
|
|
5377
5406
|
//#region src/components/form/clearGroupOnChange.js
|
|
5378
|
-
function
|
|
5407
|
+
function Wl(e, t) {
|
|
5379
5408
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5380
5409
|
}
|
|
5381
|
-
function
|
|
5410
|
+
function Gl(e, t) {
|
|
5382
5411
|
let n = e?.field, r = [];
|
|
5383
5412
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5384
5413
|
e && e !== n && r.push(e);
|
|
@@ -5388,24 +5417,24 @@ function Wl(e, t) {
|
|
|
5388
5417
|
e && e !== n && r.push(e);
|
|
5389
5418
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5390
5419
|
}
|
|
5391
|
-
function
|
|
5392
|
-
let i =
|
|
5420
|
+
function Kl(e, t, n, r) {
|
|
5421
|
+
let i = Gl(t, r).map((e) => Wl(n, e));
|
|
5393
5422
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5394
5423
|
}
|
|
5395
5424
|
//#endregion
|
|
5396
5425
|
//#region src/components/form/resolveStoredOptions.js
|
|
5397
|
-
function
|
|
5426
|
+
function ql(e) {
|
|
5398
5427
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5399
5428
|
}
|
|
5400
|
-
function
|
|
5429
|
+
function Jl(e, t = []) {
|
|
5401
5430
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5402
|
-
for (let t of
|
|
5431
|
+
for (let t of ql(e)) {
|
|
5403
5432
|
let e = String(t);
|
|
5404
5433
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5405
5434
|
}
|
|
5406
5435
|
return r;
|
|
5407
5436
|
}
|
|
5408
|
-
async function
|
|
5437
|
+
async function Yl(e, t) {
|
|
5409
5438
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5410
5439
|
let n = new URLSearchParams({
|
|
5411
5440
|
collection: e.lookupCollection,
|
|
@@ -5417,7 +5446,7 @@ async function Jl(e, t) {
|
|
|
5417
5446
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5418
5447
|
return Array.isArray(i) ? i : [];
|
|
5419
5448
|
}
|
|
5420
|
-
function
|
|
5449
|
+
function Xl(e = [], t = []) {
|
|
5421
5450
|
if (!t.length) return e;
|
|
5422
5451
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5423
5452
|
...e,
|
|
@@ -5427,25 +5456,25 @@ function Yl(e = [], t = []) {
|
|
|
5427
5456
|
}
|
|
5428
5457
|
//#endregion
|
|
5429
5458
|
//#region src/components/form/requireAnyOf.js
|
|
5430
|
-
var
|
|
5431
|
-
function
|
|
5459
|
+
var Zl = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5460
|
+
function Ql(e) {
|
|
5432
5461
|
let t = e?.requireAnyOf;
|
|
5433
5462
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5434
5463
|
}
|
|
5435
|
-
function
|
|
5436
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5464
|
+
function $l(e) {
|
|
5465
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !Zl(e));
|
|
5437
5466
|
}
|
|
5438
|
-
function
|
|
5439
|
-
let n =
|
|
5467
|
+
function eu({ field: e, getRow: t }) {
|
|
5468
|
+
let n = Ql(e);
|
|
5440
5469
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5441
5470
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5442
5471
|
return { validator: async () => {
|
|
5443
5472
|
let e = t?.() ?? {};
|
|
5444
|
-
return
|
|
5473
|
+
return $l(e) ? n.some((t) => !Zl(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5445
5474
|
} };
|
|
5446
5475
|
}
|
|
5447
|
-
function
|
|
5448
|
-
let n =
|
|
5476
|
+
function tu(e, t = []) {
|
|
5477
|
+
let n = Ql(e);
|
|
5449
5478
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5450
5479
|
...t,
|
|
5451
5480
|
requireAnyOf: n,
|
|
@@ -5454,8 +5483,8 @@ function eu(e, t = []) {
|
|
|
5454
5483
|
}
|
|
5455
5484
|
//#endregion
|
|
5456
5485
|
//#region src/components/form/dateRules.js
|
|
5457
|
-
var
|
|
5458
|
-
function
|
|
5486
|
+
var nu = (e) => e == null || e === "";
|
|
5487
|
+
function ru(e) {
|
|
5459
5488
|
if (!e) return null;
|
|
5460
5489
|
if (typeof e.valueOf == "function") {
|
|
5461
5490
|
let t = e.valueOf();
|
|
@@ -5469,12 +5498,12 @@ function Q(e) {
|
|
|
5469
5498
|
let t = T(e);
|
|
5470
5499
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5471
5500
|
}
|
|
5472
|
-
function
|
|
5501
|
+
function iu(e) {
|
|
5473
5502
|
if (!e) return null;
|
|
5474
5503
|
let t = T(e);
|
|
5475
5504
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5476
5505
|
}
|
|
5477
|
-
var
|
|
5506
|
+
var au = {
|
|
5478
5507
|
d: "day",
|
|
5479
5508
|
day: "day",
|
|
5480
5509
|
days: "day",
|
|
@@ -5490,13 +5519,13 @@ var iu = {
|
|
|
5490
5519
|
year: "year",
|
|
5491
5520
|
years: "year"
|
|
5492
5521
|
};
|
|
5493
|
-
function
|
|
5522
|
+
function ou(e) {
|
|
5494
5523
|
if (e == null || e === "") return null;
|
|
5495
5524
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5496
5525
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5497
5526
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5498
5527
|
value: t,
|
|
5499
|
-
unit:
|
|
5528
|
+
unit: au[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5500
5529
|
};
|
|
5501
5530
|
}
|
|
5502
5531
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5506,49 +5535,49 @@ function au(e) {
|
|
|
5506
5535
|
let r = Number(n[1]);
|
|
5507
5536
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5508
5537
|
value: r,
|
|
5509
|
-
unit:
|
|
5538
|
+
unit: au[n[2]] ?? "month"
|
|
5510
5539
|
};
|
|
5511
5540
|
}
|
|
5512
|
-
function
|
|
5541
|
+
function su(e, t) {
|
|
5513
5542
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5514
5543
|
if (n && typeof t == "function") {
|
|
5515
|
-
let e =
|
|
5544
|
+
let e = ou(t(n));
|
|
5516
5545
|
if (e) return e;
|
|
5517
5546
|
}
|
|
5518
|
-
return
|
|
5547
|
+
return ou(e?.minGap);
|
|
5519
5548
|
}
|
|
5520
|
-
function
|
|
5549
|
+
function cu(e, t, n, r) {
|
|
5521
5550
|
if (t === null) return null;
|
|
5522
|
-
let i =
|
|
5551
|
+
let i = su(n, r), a = T(t);
|
|
5523
5552
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5524
5553
|
}
|
|
5525
|
-
function
|
|
5554
|
+
function lu(e, t, n, r, i) {
|
|
5526
5555
|
if (t === null || n === null) return !1;
|
|
5527
|
-
let a =
|
|
5556
|
+
let a = cu(e, n, r, i);
|
|
5528
5557
|
if (a === null) return !1;
|
|
5529
|
-
let o = !!r?.strict && !
|
|
5558
|
+
let o = !!r?.strict && !su(r, i);
|
|
5530
5559
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5531
5560
|
}
|
|
5532
|
-
function
|
|
5561
|
+
function uu(e, t, n, r) {
|
|
5533
5562
|
if (n?.message) return n.message;
|
|
5534
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5563
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = su(n, r);
|
|
5535
5564
|
if (a) {
|
|
5536
5565
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5537
5566
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5538
5567
|
}
|
|
5539
5568
|
return n?.strict ? e === "dateAfterField" ? `${t} must be after ${i}` : `${t} must be before ${i}` : e === "dateAfterField" ? `${t} must be on or after ${i}` : `${t} must be on or before ${i}`;
|
|
5540
5569
|
}
|
|
5541
|
-
function
|
|
5570
|
+
function du({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5542
5571
|
return { validator: async (i, a) => {
|
|
5543
5572
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5544
|
-
if (!o ||
|
|
5573
|
+
if (!o || nu(a)) return Promise.resolve();
|
|
5545
5574
|
let s = r(o);
|
|
5546
|
-
if (
|
|
5575
|
+
if (nu(s)) return Promise.resolve();
|
|
5547
5576
|
let c = Q(a), l = Q(s);
|
|
5548
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5577
|
+
return c === null || l === null ? Promise.resolve() : lu(e, c, l, n, r) ? Promise.reject(Error(uu(e, t, n, r))) : Promise.resolve();
|
|
5549
5578
|
} };
|
|
5550
5579
|
}
|
|
5551
|
-
function
|
|
5580
|
+
function fu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5552
5581
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5553
5582
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5554
5583
|
if (o) {
|
|
@@ -5562,11 +5591,11 @@ function du(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5562
5591
|
}
|
|
5563
5592
|
return !1;
|
|
5564
5593
|
}
|
|
5565
|
-
function
|
|
5594
|
+
function pu(e, t = "above", n = void 0) {
|
|
5566
5595
|
let r = e?.messages ?? {}, i = t === "below";
|
|
5567
5596
|
return (n === "start" ? i ? r.belowStart : r.aboveStart : n === "end" ? i ? r.belowEnd : r.aboveEnd : void 0) || (i ? r.below || "Start date must be after the end date of the entry below it." : n === "end" ? r.above || "End date must be before the start date of the entry above it." : r.above || "This period overlaps the entry above it. Please adjust the dates.");
|
|
5568
5597
|
}
|
|
5569
|
-
function
|
|
5598
|
+
function mu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = sr }) {
|
|
5570
5599
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5571
5600
|
for (let e of a) {
|
|
5572
5601
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5580,17 +5609,17 @@ function pu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
|
5580
5609
|
o.push((i) => {
|
|
5581
5610
|
if (!i) return !1;
|
|
5582
5611
|
let a = t(e);
|
|
5583
|
-
return !
|
|
5612
|
+
return !nu(a) && lu(r, Q(i), Q(a), n, t);
|
|
5584
5613
|
});
|
|
5585
5614
|
}
|
|
5586
5615
|
}
|
|
5587
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5616
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? fu(Q(t), e.rowHierarchy, {
|
|
5588
5617
|
rows: n,
|
|
5589
5618
|
rowIndex: r
|
|
5590
5619
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5591
5620
|
}
|
|
5592
|
-
function
|
|
5593
|
-
if (!
|
|
5621
|
+
function hu(e, t = sr, n = void 0) {
|
|
5622
|
+
if (!nu(n) && Q(n) !== null) return;
|
|
5594
5623
|
let r = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5595
5624
|
for (let e of r) {
|
|
5596
5625
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5598,7 +5627,7 @@ function mu(e, t = or, n = void 0) {
|
|
|
5598
5627
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5599
5628
|
}
|
|
5600
5629
|
}
|
|
5601
|
-
function
|
|
5630
|
+
function gu({ field: e, name: t, rows: n }) {
|
|
5602
5631
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5603
5632
|
let r = t[t.length - 1], i = t.length >= 3 && typeof t[1] == "number", a = /* @__PURE__ */ new Set(), o = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5604
5633
|
for (let e of o) {
|
|
@@ -5627,44 +5656,44 @@ function hu({ field: e, name: t, rows: n }) {
|
|
|
5627
5656
|
]));
|
|
5628
5657
|
return u;
|
|
5629
5658
|
}
|
|
5630
|
-
function
|
|
5659
|
+
function _u({ field: e, rows: t, rowIndex: n }) {
|
|
5631
5660
|
let r = e?.rowHierarchy;
|
|
5632
5661
|
return { validator: async (i, a) => {
|
|
5633
|
-
if (!r ||
|
|
5662
|
+
if (!r || nu(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5634
5663
|
let o = Q(a);
|
|
5635
|
-
if (o === null || !
|
|
5664
|
+
if (o === null || !fu(o, r, {
|
|
5636
5665
|
rows: t,
|
|
5637
5666
|
rowIndex: n
|
|
5638
5667
|
})) return Promise.resolve();
|
|
5639
5668
|
let s = r.startField ?? "startDate", c = t[n - 1], l = c ? Q(c[s]) : null, u = l !== null && o >= l ? "above" : "below", d = r.endField ?? "endDate", f = e?.field, p = f === s ? "start" : f === d ? "end" : void 0;
|
|
5640
|
-
return Promise.reject(Error(
|
|
5669
|
+
return Promise.reject(Error(pu(r, u, p)));
|
|
5641
5670
|
} };
|
|
5642
5671
|
}
|
|
5643
5672
|
//#endregion
|
|
5644
5673
|
//#region src/utils/submitMessages.js
|
|
5645
|
-
function
|
|
5674
|
+
function vu(e) {
|
|
5646
5675
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5647
5676
|
}
|
|
5648
5677
|
function $(e) {
|
|
5649
5678
|
let t = String(e ?? "").trim();
|
|
5650
5679
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5651
5680
|
}
|
|
5652
|
-
function
|
|
5681
|
+
function yu(e, t) {
|
|
5653
5682
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
5654
5683
|
}
|
|
5655
|
-
function
|
|
5656
|
-
let r =
|
|
5684
|
+
function bu(e, t, n) {
|
|
5685
|
+
let r = vu(e);
|
|
5657
5686
|
if (r?.suppress) return null;
|
|
5658
5687
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5659
|
-
return i && String(i).trim() ?
|
|
5688
|
+
return i && String(i).trim() ? yu(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
5660
5689
|
}
|
|
5661
|
-
function
|
|
5662
|
-
let i =
|
|
5663
|
-
return a && String(a).trim() ?
|
|
5690
|
+
function xu(e, t, n, r) {
|
|
5691
|
+
let i = vu(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5692
|
+
return a && String(a).trim() ? yu(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
5664
5693
|
}
|
|
5665
5694
|
//#endregion
|
|
5666
5695
|
//#region src/utils/scrollToFirstFormError.js
|
|
5667
|
-
function
|
|
5696
|
+
function Su({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5668
5697
|
if (!e?.length) return;
|
|
5669
5698
|
let r = e[0]?.name;
|
|
5670
5699
|
setTimeout(() => {
|
|
@@ -5689,10 +5718,10 @@ function xu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5689
5718
|
}
|
|
5690
5719
|
//#endregion
|
|
5691
5720
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5692
|
-
function
|
|
5721
|
+
function Cu(e) {
|
|
5693
5722
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5694
5723
|
}
|
|
5695
|
-
function
|
|
5724
|
+
function wu(e, t) {
|
|
5696
5725
|
if (!e?.field) return !1;
|
|
5697
5726
|
switch (e.operator ?? "eq") {
|
|
5698
5727
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5700,66 +5729,66 @@ function Cu(e, t) {
|
|
|
5700
5729
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5701
5730
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5702
5731
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5703
|
-
case "in": return
|
|
5704
|
-
case "notIn": return !
|
|
5732
|
+
case "in": return Cu(e.value).includes(String(t ?? ""));
|
|
5733
|
+
case "notIn": return !Cu(e.value).includes(String(t ?? ""));
|
|
5705
5734
|
default: return !1;
|
|
5706
5735
|
}
|
|
5707
5736
|
}
|
|
5708
|
-
function
|
|
5737
|
+
function Tu(e, t, n = !1) {
|
|
5709
5738
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5710
|
-
return
|
|
5739
|
+
return wu(i, t) && i?.label ? i.label : r;
|
|
5711
5740
|
}
|
|
5712
|
-
function
|
|
5741
|
+
function Eu(e) {
|
|
5713
5742
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5714
5743
|
}
|
|
5715
|
-
function
|
|
5716
|
-
let n =
|
|
5744
|
+
function Du(e, t) {
|
|
5745
|
+
let n = Eu(e);
|
|
5717
5746
|
if (!n.length) return !0;
|
|
5718
|
-
let r = n.map((e) =>
|
|
5747
|
+
let r = n.map((e) => wu(e, t(e.field)));
|
|
5719
5748
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5720
5749
|
}
|
|
5721
|
-
function
|
|
5750
|
+
function Ou(e) {
|
|
5722
5751
|
let t = e?.colWhen;
|
|
5723
5752
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5724
5753
|
}
|
|
5725
|
-
function
|
|
5726
|
-
for (let t of
|
|
5754
|
+
function ku(e, t, n) {
|
|
5755
|
+
for (let t of Ou(e)) if (wu(t, n(t))) return Number(t.col);
|
|
5727
5756
|
return t;
|
|
5728
5757
|
}
|
|
5729
|
-
function
|
|
5758
|
+
function Au(e, t) {
|
|
5730
5759
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5731
5760
|
}
|
|
5732
5761
|
//#endregion
|
|
5733
5762
|
//#region src/components/form/conditionalRequired.js
|
|
5734
|
-
function
|
|
5763
|
+
function ju(e, t) {
|
|
5735
5764
|
return (n) => {
|
|
5736
5765
|
if (!e || !n) return;
|
|
5737
5766
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5738
5767
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5739
5768
|
};
|
|
5740
5769
|
}
|
|
5741
|
-
function
|
|
5770
|
+
function Mu(e, t, n) {
|
|
5742
5771
|
let r = e?.requiredWhen;
|
|
5743
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
5772
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Du(r, ju(t, n));
|
|
5744
5773
|
}
|
|
5745
|
-
function
|
|
5774
|
+
function Nu(e, t, n) {
|
|
5746
5775
|
return { validator: (r, i) => {
|
|
5747
|
-
if (!
|
|
5776
|
+
if (!Mu(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5748
5777
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5749
5778
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5750
5779
|
} };
|
|
5751
5780
|
}
|
|
5752
5781
|
//#endregion
|
|
5753
5782
|
//#region src/components/Breadcrumb.jsx
|
|
5754
|
-
function
|
|
5755
|
-
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(
|
|
5783
|
+
function Pu({ items: e = [] }) {
|
|
5784
|
+
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Nr, {
|
|
5756
5785
|
variant: "body",
|
|
5757
5786
|
weight: "medium",
|
|
5758
5787
|
color: "link",
|
|
5759
5788
|
children: t.label
|
|
5760
5789
|
}) : /* @__PURE__ */ w(xe, {
|
|
5761
5790
|
to: t.href,
|
|
5762
|
-
children: [/* @__PURE__ */ C(
|
|
5791
|
+
children: [/* @__PURE__ */ C(Nr, {
|
|
5763
5792
|
variant: "body",
|
|
5764
5793
|
color: "secondary",
|
|
5765
5794
|
children: t.label
|
|
@@ -5769,34 +5798,34 @@ function Nu({ items: e = [] }) {
|
|
|
5769
5798
|
}
|
|
5770
5799
|
//#endregion
|
|
5771
5800
|
//#region src/components/form/canonicalOption.js
|
|
5772
|
-
var
|
|
5773
|
-
function
|
|
5801
|
+
var Fu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
5802
|
+
function Iu(e = []) {
|
|
5774
5803
|
let t = /* @__PURE__ */ new Map();
|
|
5775
5804
|
for (let n of e) {
|
|
5776
5805
|
if (n == null) continue;
|
|
5777
5806
|
let e = typeof n == "object" ? n.value : n;
|
|
5778
5807
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5779
|
-
let n =
|
|
5808
|
+
let n = Fu(r);
|
|
5780
5809
|
n && !t.has(n) && t.set(n, e);
|
|
5781
5810
|
}
|
|
5782
5811
|
}
|
|
5783
5812
|
return t;
|
|
5784
5813
|
}
|
|
5785
|
-
function
|
|
5814
|
+
function Lu(e, t) {
|
|
5786
5815
|
if (!Array.isArray(e)) {
|
|
5787
|
-
let n =
|
|
5816
|
+
let n = Lu([e], t);
|
|
5788
5817
|
return n.length ? n[0] : e;
|
|
5789
5818
|
}
|
|
5790
|
-
let n =
|
|
5819
|
+
let n = Iu(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
5791
5820
|
for (let t of e) {
|
|
5792
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
5821
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Fu(e)) ?? e, o = Fu(a);
|
|
5793
5822
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
5794
5823
|
}
|
|
5795
5824
|
return i;
|
|
5796
5825
|
}
|
|
5797
5826
|
//#endregion
|
|
5798
5827
|
//#region src/components/form/dependencyBusy.js
|
|
5799
|
-
function
|
|
5828
|
+
function Ru(e, t = []) {
|
|
5800
5829
|
if (!e) return [];
|
|
5801
5830
|
let n = /* @__PURE__ */ new Set();
|
|
5802
5831
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -5806,16 +5835,16 @@ function Lu(e, t = []) {
|
|
|
5806
5835
|
}
|
|
5807
5836
|
return n.delete(e), [...n];
|
|
5808
5837
|
}
|
|
5809
|
-
function
|
|
5810
|
-
return e?.blockWhileResolving ?
|
|
5838
|
+
function zu(e, t = []) {
|
|
5839
|
+
return e?.blockWhileResolving ? Ru(e.field, t).length > 0 : !1;
|
|
5811
5840
|
}
|
|
5812
|
-
function
|
|
5841
|
+
function Bu(e) {
|
|
5813
5842
|
let t = String(e?.label ?? "").trim();
|
|
5814
5843
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
5815
5844
|
}
|
|
5816
|
-
function
|
|
5845
|
+
function Vu(e, t = []) {
|
|
5817
5846
|
if (!e?.field) return [];
|
|
5818
|
-
let n = new Set(
|
|
5847
|
+
let n = new Set(Ru(e.field, t));
|
|
5819
5848
|
if (n.size === 0) return [];
|
|
5820
5849
|
let r = [];
|
|
5821
5850
|
for (let e of t) {
|
|
@@ -5824,19 +5853,19 @@ function Bu(e, t = []) {
|
|
|
5824
5853
|
}
|
|
5825
5854
|
return r;
|
|
5826
5855
|
}
|
|
5827
|
-
function
|
|
5856
|
+
function Hu(e) {
|
|
5828
5857
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
5829
5858
|
}
|
|
5830
5859
|
//#endregion
|
|
5831
5860
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
5832
|
-
var
|
|
5833
|
-
function
|
|
5861
|
+
var Uu = f(() => import("./index.js").then((e) => e.n)), Wu = f(() => import("./DocumentViewer-DSxsilzL.js").then((e) => e.n));
|
|
5862
|
+
function Gu(e) {
|
|
5834
5863
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
5835
5864
|
return C(t === "pdf" ? fe : t === "doc" || t === "docx" ? me : de, { className: "v1-file-chip__icon" });
|
|
5836
5865
|
}
|
|
5837
|
-
function
|
|
5866
|
+
function Ku({ field: e, recordMeta: t }) {
|
|
5838
5867
|
let n = e?.linkedModule, r = e?.linkedFileField, i = g(() => {
|
|
5839
|
-
let r =
|
|
5868
|
+
let r = Tc(n, t);
|
|
5840
5869
|
if (r) return r;
|
|
5841
5870
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
5842
5871
|
return a ? String(a) : "";
|
|
@@ -5856,7 +5885,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5856
5885
|
...e,
|
|
5857
5886
|
loading: !0
|
|
5858
5887
|
}));
|
|
5859
|
-
}),
|
|
5888
|
+
}), Xr(n, i).then((t) => {
|
|
5860
5889
|
e || o({
|
|
5861
5890
|
loading: !1,
|
|
5862
5891
|
fileValue: t?.[r] ?? null
|
|
@@ -5870,7 +5899,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5870
5899
|
r,
|
|
5871
5900
|
f
|
|
5872
5901
|
]);
|
|
5873
|
-
let m = g(() =>
|
|
5902
|
+
let m = g(() => wo(a.fileValue), [a.fileValue])[0], _ = !!m, y = e?.label ?? "File", b = zs(n) || "record";
|
|
5874
5903
|
if (!i) return /* @__PURE__ */ C("div", {
|
|
5875
5904
|
className: "v1-linked-file v1-linked-file--empty",
|
|
5876
5905
|
children: /* @__PURE__ */ C("span", { children: e?.unlinkedText ?? `Not available until the ${b} is set.` })
|
|
@@ -5898,7 +5927,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5898
5927
|
onClick: () => _ && c(!0),
|
|
5899
5928
|
title: _ ? `Preview or download ${m.name}` : re,
|
|
5900
5929
|
children: [
|
|
5901
|
-
_ ?
|
|
5930
|
+
_ ? Gu(m.name) : /* @__PURE__ */ C(de, { className: "v1-file-chip__icon" }),
|
|
5902
5931
|
/* @__PURE__ */ C("span", {
|
|
5903
5932
|
className: "v1-file-chip__name",
|
|
5904
5933
|
children: _ ? m.name : re
|
|
@@ -5922,7 +5951,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5922
5951
|
}),
|
|
5923
5952
|
s && te && /* @__PURE__ */ C(u, {
|
|
5924
5953
|
fallback: null,
|
|
5925
|
-
children: /* @__PURE__ */ C(
|
|
5954
|
+
children: /* @__PURE__ */ C(Wu, {
|
|
5926
5955
|
open: s,
|
|
5927
5956
|
onClose: () => c(!1),
|
|
5928
5957
|
documents: [te]
|
|
@@ -5953,7 +5982,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5953
5982
|
},
|
|
5954
5983
|
children: /* @__PURE__ */ C(ie, {})
|
|
5955
5984
|
}),
|
|
5956
|
-
children: /* @__PURE__ */ C(
|
|
5985
|
+
children: /* @__PURE__ */ C(Uu, {
|
|
5957
5986
|
moduleName: n,
|
|
5958
5987
|
recordId: i,
|
|
5959
5988
|
embedded: !0,
|
|
@@ -5967,7 +5996,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5967
5996
|
})
|
|
5968
5997
|
] });
|
|
5969
5998
|
}
|
|
5970
|
-
|
|
5999
|
+
Ku.propTypes = {
|
|
5971
6000
|
field: E.shape({
|
|
5972
6001
|
label: E.string,
|
|
5973
6002
|
linkedModule: E.string,
|
|
@@ -5979,8 +6008,8 @@ Gu.propTypes = {
|
|
|
5979
6008
|
reuploadWarning: E.string
|
|
5980
6009
|
}).isRequired,
|
|
5981
6010
|
recordMeta: E.object
|
|
5982
|
-
},
|
|
6011
|
+
}, Ku.defaultProps = { recordMeta: void 0 };
|
|
5983
6012
|
//#endregion
|
|
5984
|
-
export {
|
|
6013
|
+
export { Qc as $, F as $n, un as $r, Eo as $t, Yl as A, ot as Ai, bi as An, tt as Ar, Bs as At, Hl as B, et as Bi, ci as Bn, st as Br, Es as Bt, hu as C, Zt as Ci, ea as Cn, $e as Cr, oc as Ct, gu as D, nt as Di, Mi as Dn, Ln as Dr, Gs as Dt, nu as E, an as Ei, qi as En, pn as Er, qs as Et, Rl as F, Be as Fi, hi as Fn, hn as Fr, Ds as Ft, ml as G, $t as Gi, Jr as Gn, kt as Gr, ts as Gt, yl as H, vn as Hi, ii as Hn, Ze as Hr, os as Ht, bl as I, Wt as Ii, pi as In, zn as Ir, xs as It, al as J, Nn as Ji, Vr as Jn, dn as Jr, $o as Jt, ll as K, Bt as Ki, Yr as Kn, Mt as Kr, es as Kt, Cl as L, qt as Li, si as Ln, en as Lr, bs as Lt, Jl as M, St as Mi, yi as Mn, On as Mr, Ms as Mt, Kl as N, He as Ni, gi as Nn, Ct as Nr, Fs as Nt, tu as O, pt as Oi, Li as On, Qt as Or, Us as Ot, Tl as P, sn as Pi, vi as Pn, yn as Pr, Os as Pt, $c as Q, cn as Qi, I as Qn, yt as Qr, q as Qt, xl as R, ht as Ri, oi as Rn, Ve as Rr, ds as Rt, _u as S, Lt as Si, wa as Sn, Et as Sr, sc as St, iu as T, rn as Ti, Gi as Tn, _n as Tr, ic as Tt, _l as U, mn as Ui, ri as Un, Xe as Ur, as as Ut, Ll as V, Dn as Vi, li as Vn, Xt as Vr, rs as Vt, pl as W, Rn as Wi, ni as Wn, ft as Wr, ns as Wt, il as X, Gt as Xi, zr as Xn, Ue as Xr, Fo as Xt, cl as Y, Nt as Yi, Br as Yn, ln as Yr, Io as Yt, nl as Z, Yt as Zi, Nr as Zn, _t as Zr, ko as Zt, Su as _, Ot as _i, B as _n, Vn as _r, vc as _t, zu as a, bt as ai, no as an, cr as ar, Lc as at, mu as b, Sn as bi, Ua as bn, Wn as br, hc as bt, Mu as c, nn as ci, Za as cn, Gn as cr, Tc as ct, Au as d, In as di, Ja as dn, tr as dr, Dc as dt, Tn as ei, co as en, sr as er, zc as et, wu as f, Re as fi, K as fn, N as fr, jc as ft, Eu as g, Ut as gi, ma as gn, Bn as gr, yc as gt, ku as h, Qe as hi, La as hn, Zn as hr, bc as ht, Bu as i, xt as ii, wo as in, yr as ir, Fc as it, Xl as j, ut as ji, xi as jn, mt as jr, Vs as jt, eu as k, vt as ki, Ii as kn, Mn as kr, zs as kt, Nu as l, gn as li, Ka as ln, $n as lr, Oc as lt, Du as m, on as mi, Wa as mn, Jn as mr, Sc as mt, Hu as n, lt as ni, lo as nn, fr as nr, Hc as nt, Lu as o, Tt as oi, oo as on, gr as or, Mc as ot, Tu as p, We as pi, Ra as pn, rr as pr, Ac as pt, fl as q, Cn as qi, Zr as qn, Kt as qr, Qo as qt, Vu as r, Jt as ri, bo as rn, P as rr, Pc as rt, Pu as s, tn as si, Xa as sn, ur as sr, Ec as st, Ku as t, at as ti, so as tn, lr as tr, Uc as tt, Ou as u, fn as ui, qa as un, Qn as ur, kc as ut, xu as v, Ft as vi, G as vn, Un as vr, _c as vt, ru as w, ze as wi, Vi as wn, En as wr, rc as wt, du as x, jn as xi, Ta as xn, rt as xr, pc as xt, bu as y, It as yi, ja as yn, Hn as yr, gc as yt, zl as z, wt as zi, mi as zn, Pn as zr, _s as zt };
|
|
5985
6014
|
|
|
5986
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
6015
|
+
//# sourceMappingURL=LinkedRecordFileField-BXslVJhz.js.map
|