@realtek/core-theme-live 0.0.421 → 0.0.423
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-Bz4WkISl.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-Bz4WkISl.cjs.map +1 -0
- package/dist-lib/{LinkedRecordFileField-DxI_baJL.js → LinkedRecordFileField-CYg9t3lw.js} +858 -828
- package/dist-lib/LinkedRecordFileField-CYg9t3lw.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +3808 -3270
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/style.css +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,28 @@ 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
|
+
className: "fdd-alt-btn",
|
|
3064
|
+
onClick: () => {
|
|
3065
|
+
f("alt"), p.destroy();
|
|
3066
|
+
},
|
|
3067
|
+
children: c
|
|
3068
|
+
}),
|
|
3069
|
+
/* @__PURE__ */ C(n, {}),
|
|
3070
|
+
/* @__PURE__ */ C(t, {})
|
|
3071
|
+
] }) } : {},
|
|
3042
3072
|
icon: null,
|
|
3043
3073
|
centered: !0,
|
|
3044
|
-
width: 480,
|
|
3045
|
-
className: `fdd-modal ${c}`,
|
|
3074
|
+
width: c ? 600 : 480,
|
|
3075
|
+
className: `fdd-modal ${l}${c ? " fdd-modal--three" : ""}`,
|
|
3046
3076
|
okText: i,
|
|
3047
3077
|
cancelText: a,
|
|
3048
3078
|
okButtonProps: {
|
|
@@ -3058,15 +3088,15 @@ function Ya({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3058
3088
|
children: [/* @__PURE__ */ C("span", {
|
|
3059
3089
|
className: "fdd-icon",
|
|
3060
3090
|
"aria-hidden": "true",
|
|
3061
|
-
children: /* @__PURE__ */ C(
|
|
3091
|
+
children: /* @__PURE__ */ C(u, {})
|
|
3062
3092
|
}), /* @__PURE__ */ C("h3", {
|
|
3063
3093
|
className: "fdd-title",
|
|
3064
3094
|
children: t
|
|
3065
3095
|
})]
|
|
3066
3096
|
}),
|
|
3067
|
-
|
|
3097
|
+
d.length > 0 && /* @__PURE__ */ C("dl", {
|
|
3068
3098
|
className: "fdd-facts",
|
|
3069
|
-
children:
|
|
3099
|
+
children: d.map((e) => /* @__PURE__ */ w("div", {
|
|
3070
3100
|
className: "fdd-fact",
|
|
3071
3101
|
children: [/* @__PURE__ */ C("dt", { children: e.label }), /* @__PURE__ */ C("dd", { children: e.value })]
|
|
3072
3102
|
}, e.label))
|
|
@@ -3081,13 +3111,13 @@ function Ya({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3081
3111
|
})
|
|
3082
3112
|
]
|
|
3083
3113
|
}),
|
|
3084
|
-
onOk: () =>
|
|
3085
|
-
onCancel: () =>
|
|
3114
|
+
onOk: () => f(!0),
|
|
3115
|
+
onCancel: () => f(!1)
|
|
3086
3116
|
});
|
|
3087
3117
|
});
|
|
3088
3118
|
}
|
|
3089
|
-
function
|
|
3090
|
-
let { className: a, Icon: o } =
|
|
3119
|
+
function Za({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3120
|
+
let { className: a, Icon: o } = Ya[e] ?? Ya.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3091
3121
|
return new Promise((e) => {
|
|
3092
3122
|
ne.warning({
|
|
3093
3123
|
icon: null,
|
|
@@ -3129,7 +3159,7 @@ function Xa({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3129
3159
|
}
|
|
3130
3160
|
//#endregion
|
|
3131
3161
|
//#region src/services/aiActionApi.js
|
|
3132
|
-
async function
|
|
3162
|
+
async function Qa({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3133
3163
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3134
3164
|
let c = await r(), l = new FormData();
|
|
3135
3165
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3155,17 +3185,17 @@ async function Za({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3155
3185
|
}
|
|
3156
3186
|
//#endregion
|
|
3157
3187
|
//#region src/components/detail/phoneDisplay.js
|
|
3158
|
-
var
|
|
3159
|
-
function
|
|
3188
|
+
var $a = (e) => e == null || e === "";
|
|
3189
|
+
function eo(e, t) {
|
|
3160
3190
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3161
3191
|
}
|
|
3162
|
-
function
|
|
3192
|
+
function to(e) {
|
|
3163
3193
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3164
3194
|
if (!t) return "";
|
|
3165
3195
|
let n = t.replace(/^\+/, "");
|
|
3166
3196
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3167
3197
|
}
|
|
3168
|
-
function
|
|
3198
|
+
function no(e) {
|
|
3169
3199
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3170
3200
|
return [
|
|
3171
3201
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3178,15 +3208,15 @@ function to(e) {
|
|
|
3178
3208
|
"isdCode"
|
|
3179
3209
|
];
|
|
3180
3210
|
}
|
|
3181
|
-
function
|
|
3182
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3211
|
+
function ro(e, t, n = "") {
|
|
3212
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...no(e)] : no(e);
|
|
3183
3213
|
for (let e of i) {
|
|
3184
|
-
let n = eo(
|
|
3214
|
+
let n = to(eo(t, e));
|
|
3185
3215
|
if (n) return n;
|
|
3186
3216
|
}
|
|
3187
|
-
return
|
|
3217
|
+
return to(n);
|
|
3188
3218
|
}
|
|
3189
|
-
function
|
|
3219
|
+
function io(e) {
|
|
3190
3220
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3191
3221
|
return n ? {
|
|
3192
3222
|
code: n[1],
|
|
@@ -3196,17 +3226,17 @@ function ro(e) {
|
|
|
3196
3226
|
rest: t
|
|
3197
3227
|
};
|
|
3198
3228
|
}
|
|
3199
|
-
function
|
|
3200
|
-
if (
|
|
3201
|
-
let { code: n, rest: r } =
|
|
3229
|
+
function ao(e, t = "") {
|
|
3230
|
+
if ($a(e)) return "";
|
|
3231
|
+
let { code: n, rest: r } = io(e), i = n || to(t), a = Qn(r) || r;
|
|
3202
3232
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3203
3233
|
}
|
|
3204
|
-
function
|
|
3205
|
-
return
|
|
3234
|
+
function oo(e, t, n) {
|
|
3235
|
+
return ao(t, ro(e, n, Xn()));
|
|
3206
3236
|
}
|
|
3207
3237
|
//#endregion
|
|
3208
3238
|
//#region src/components/detail/renderConfig.js
|
|
3209
|
-
var
|
|
3239
|
+
var so = [
|
|
3210
3240
|
{
|
|
3211
3241
|
value: "auto",
|
|
3212
3242
|
label: "Default (auto)"
|
|
@@ -3263,7 +3293,7 @@ var oo = [
|
|
|
3263
3293
|
value: "html",
|
|
3264
3294
|
label: "HTML"
|
|
3265
3295
|
}
|
|
3266
|
-
],
|
|
3296
|
+
], co = [
|
|
3267
3297
|
{
|
|
3268
3298
|
value: "preview",
|
|
3269
3299
|
label: "Preview (viewer)"
|
|
@@ -3284,7 +3314,7 @@ var oo = [
|
|
|
3284
3314
|
value: "text",
|
|
3285
3315
|
label: "Text (filename)"
|
|
3286
3316
|
}
|
|
3287
|
-
],
|
|
3317
|
+
], lo = [
|
|
3288
3318
|
{
|
|
3289
3319
|
value: "none",
|
|
3290
3320
|
label: "None"
|
|
@@ -3301,76 +3331,76 @@ var oo = [
|
|
|
3301
3331
|
value: "title",
|
|
3302
3332
|
label: "Title Case"
|
|
3303
3333
|
}
|
|
3304
|
-
],
|
|
3334
|
+
], uo = [
|
|
3305
3335
|
"location",
|
|
3306
3336
|
"path",
|
|
3307
3337
|
"url",
|
|
3308
3338
|
"key"
|
|
3309
|
-
],
|
|
3339
|
+
], fo = [
|
|
3310
3340
|
"location",
|
|
3311
3341
|
"filepath",
|
|
3312
3342
|
"path",
|
|
3313
3343
|
"url",
|
|
3314
3344
|
"key"
|
|
3315
|
-
],
|
|
3345
|
+
], po = [
|
|
3316
3346
|
"uploadedfilename",
|
|
3317
3347
|
"uploadname",
|
|
3318
3348
|
"originalname",
|
|
3319
3349
|
"displayname",
|
|
3320
3350
|
"documentname",
|
|
3321
3351
|
"filename"
|
|
3322
|
-
],
|
|
3323
|
-
function
|
|
3352
|
+
], mo = ["name"], ho = (e) => String(e).toLowerCase(), go = (e) => e == null || e === "";
|
|
3353
|
+
function _o(e, t) {
|
|
3324
3354
|
for (let n of t) {
|
|
3325
3355
|
let t = e[n];
|
|
3326
3356
|
if (typeof t == "string" && t) return t;
|
|
3327
3357
|
}
|
|
3328
3358
|
return "";
|
|
3329
3359
|
}
|
|
3330
|
-
function
|
|
3331
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3360
|
+
function vo(e, t) {
|
|
3361
|
+
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
3362
|
return "";
|
|
3333
3363
|
}
|
|
3334
|
-
function
|
|
3364
|
+
function yo(e) {
|
|
3335
3365
|
if (!e) return "";
|
|
3336
3366
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3337
3367
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3338
3368
|
}
|
|
3339
|
-
function
|
|
3369
|
+
function bo(e) {
|
|
3340
3370
|
if (!e) return "";
|
|
3341
3371
|
let t = String(e);
|
|
3342
3372
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3343
3373
|
}
|
|
3344
|
-
function
|
|
3374
|
+
function xo(e) {
|
|
3345
3375
|
let t = String(e ?? "").trim();
|
|
3346
3376
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3347
3377
|
}
|
|
3348
|
-
function xo(e) {
|
|
3349
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : go(e, lo) || _o(e, uo);
|
|
3350
|
-
}
|
|
3351
3378
|
function So(e) {
|
|
3352
|
-
return
|
|
3379
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : _o(e, uo) || vo(e, fo);
|
|
3353
3380
|
}
|
|
3354
3381
|
function Co(e) {
|
|
3355
|
-
|
|
3382
|
+
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";
|
|
3383
|
+
}
|
|
3384
|
+
function wo(e) {
|
|
3385
|
+
if (go(e)) return [];
|
|
3356
3386
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3357
|
-
for (let e of t) if (!
|
|
3387
|
+
for (let e of t) if (!go(e)) {
|
|
3358
3388
|
if (typeof e == "string") {
|
|
3359
3389
|
let t = e.includes("/") ? e : "";
|
|
3360
3390
|
n.push({
|
|
3361
3391
|
location: t,
|
|
3362
|
-
name:
|
|
3363
|
-
url:
|
|
3364
|
-
needsAuthFetch:
|
|
3392
|
+
name: yo(e) || e,
|
|
3393
|
+
url: bo(t),
|
|
3394
|
+
needsAuthFetch: xo(t)
|
|
3365
3395
|
});
|
|
3366
3396
|
} else if (typeof e == "object") {
|
|
3367
|
-
let t =
|
|
3397
|
+
let t = So(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3368
3398
|
n.push({
|
|
3369
3399
|
location: t,
|
|
3370
|
-
name:
|
|
3371
|
-
url: r ||
|
|
3400
|
+
name: Co(e),
|
|
3401
|
+
url: r || bo(t),
|
|
3372
3402
|
documentId: e.id || e._id || e.documentId || "",
|
|
3373
|
-
needsAuthFetch: !r &&
|
|
3403
|
+
needsAuthFetch: !r && xo(t)
|
|
3374
3404
|
});
|
|
3375
3405
|
}
|
|
3376
3406
|
}
|
|
@@ -3378,24 +3408,24 @@ function Co(e) {
|
|
|
3378
3408
|
}
|
|
3379
3409
|
//#endregion
|
|
3380
3410
|
//#region src/components/form/repeatableRowShape.js
|
|
3381
|
-
function
|
|
3411
|
+
function To(e) {
|
|
3382
3412
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3383
3413
|
}
|
|
3384
|
-
function
|
|
3414
|
+
function Eo(e, t) {
|
|
3385
3415
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3386
|
-
let n =
|
|
3416
|
+
let n = To(e);
|
|
3387
3417
|
if (!n) return t;
|
|
3388
3418
|
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
3419
|
return r ? i : t;
|
|
3390
3420
|
}
|
|
3391
3421
|
//#endregion
|
|
3392
3422
|
//#region src/components/form/applyGroupValues.js
|
|
3393
|
-
var
|
|
3394
|
-
function
|
|
3423
|
+
var Do = (e) => e === !0 || e === 1 || e === "1", Oo = (e) => e == null || e === "";
|
|
3424
|
+
function ko(e) {
|
|
3395
3425
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3396
3426
|
}
|
|
3397
3427
|
function q(e, t, n) {
|
|
3398
|
-
let r = Array.isArray(t) ? t :
|
|
3428
|
+
let r = Array.isArray(t) ? t : ko(t);
|
|
3399
3429
|
if (!r.length) return e;
|
|
3400
3430
|
let i = e;
|
|
3401
3431
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3404,23 +3434,23 @@ function q(e, t, n) {
|
|
|
3404
3434
|
}
|
|
3405
3435
|
return i[r[r.length - 1]] = n, e;
|
|
3406
3436
|
}
|
|
3407
|
-
function
|
|
3437
|
+
function Ao(e, t = []) {
|
|
3408
3438
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3409
3439
|
if (!n) continue;
|
|
3410
3440
|
let t = B(e, n);
|
|
3411
|
-
if (!
|
|
3441
|
+
if (!Oo(t)) return t;
|
|
3412
3442
|
}
|
|
3413
3443
|
}
|
|
3414
|
-
function
|
|
3444
|
+
function jo(e, t) {
|
|
3415
3445
|
if (!e || typeof e != "object") return;
|
|
3416
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3446
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Oo(n));
|
|
3417
3447
|
if (r) return r[1];
|
|
3418
3448
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3419
|
-
let n =
|
|
3420
|
-
if (!
|
|
3449
|
+
let n = jo(e, t);
|
|
3450
|
+
if (!Oo(n)) return n;
|
|
3421
3451
|
}
|
|
3422
3452
|
}
|
|
3423
|
-
function
|
|
3453
|
+
function Mo(e, t) {
|
|
3424
3454
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3425
3455
|
if (!n.length) return;
|
|
3426
3456
|
let r = n.map((e, n) => {
|
|
@@ -3430,9 +3460,9 @@ function jo(e, t) {
|
|
|
3430
3460
|
status: "done"
|
|
3431
3461
|
};
|
|
3432
3462
|
if (!e || typeof e != "object") return null;
|
|
3433
|
-
let r =
|
|
3463
|
+
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
3464
|
if (!r && !i) return null;
|
|
3435
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3465
|
+
let a = r && !String(r).startsWith("http") ? bo(r) : r;
|
|
3436
3466
|
return {
|
|
3437
3467
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3438
3468
|
name: i || "file",
|
|
@@ -3444,11 +3474,11 @@ function jo(e, t) {
|
|
|
3444
3474
|
}).filter(Boolean);
|
|
3445
3475
|
return r.length ? r : void 0;
|
|
3446
3476
|
}
|
|
3447
|
-
function
|
|
3477
|
+
function No(e, t) {
|
|
3448
3478
|
if (!e || typeof e != "object") return;
|
|
3449
|
-
let n =
|
|
3479
|
+
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
3480
|
if (!n && !r) return;
|
|
3451
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3481
|
+
let i = r && !String(r).startsWith("http") ? bo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3452
3482
|
return [{
|
|
3453
3483
|
uid: String(a),
|
|
3454
3484
|
name: n ?? "file",
|
|
@@ -3457,7 +3487,7 @@ function Mo(e, t) {
|
|
|
3457
3487
|
url: i || void 0
|
|
3458
3488
|
}];
|
|
3459
3489
|
}
|
|
3460
|
-
function
|
|
3490
|
+
function Po(e, t, n, r) {
|
|
3461
3491
|
(e.fields ?? []).forEach((e) => {
|
|
3462
3492
|
e?.verifyAction && [
|
|
3463
3493
|
e.verifyResultField,
|
|
@@ -3470,8 +3500,8 @@ function No(e, t, n, r) {
|
|
|
3470
3500
|
});
|
|
3471
3501
|
});
|
|
3472
3502
|
}
|
|
3473
|
-
function
|
|
3474
|
-
let t = Array.isArray(e.rows) ?
|
|
3503
|
+
function Fo(e) {
|
|
3504
|
+
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
3505
|
let i = {};
|
|
3476
3506
|
return (e.fields ?? []).forEach((e) => {
|
|
3477
3507
|
if (!e.field) return;
|
|
@@ -3482,30 +3512,30 @@ function Po(e) {
|
|
|
3482
3512
|
}
|
|
3483
3513
|
let a = r(t, e);
|
|
3484
3514
|
if (a == null) {
|
|
3485
|
-
let t = e.defaultOnEdit ?
|
|
3515
|
+
let t = e.defaultOnEdit ? Sa(e) : void 0;
|
|
3486
3516
|
t !== void 0 && q(i, e.field, t);
|
|
3487
3517
|
return;
|
|
3488
3518
|
}
|
|
3489
|
-
q(i, e.field,
|
|
3490
|
-
}),
|
|
3491
|
-
}, i =
|
|
3519
|
+
q(i, e.field, Do(e.addRow) ? Wa(e, a) : K(e, a));
|
|
3520
|
+
}), Po(e, t, i, r), i;
|
|
3521
|
+
}, i = ja(e, { editing: !0 });
|
|
3492
3522
|
if (t && t.length > 0) {
|
|
3493
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3523
|
+
let e = t.map((e) => r(e, (e, t) => No(e, t), (e, t) => B(e, t.field)));
|
|
3494
3524
|
for (; e.length < n;) e.push({ ...i });
|
|
3495
3525
|
return e;
|
|
3496
3526
|
}
|
|
3497
|
-
let a = r(e, (e, t) =>
|
|
3527
|
+
let a = r(e, (e, t) => Mo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3498
3528
|
for (; o.length < n;) o.push({ ...i });
|
|
3499
3529
|
return o;
|
|
3500
3530
|
}
|
|
3501
|
-
function
|
|
3531
|
+
function Io(e, t = []) {
|
|
3502
3532
|
let n = {};
|
|
3503
3533
|
return t.forEach((e) => {
|
|
3504
3534
|
e.toggleEnabled && e.toggleField && q(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3505
3535
|
if (!e.field || e.addRow) return;
|
|
3506
3536
|
let t = e.value, r = e.field;
|
|
3507
3537
|
if (e.type === "file") {
|
|
3508
|
-
let i =
|
|
3538
|
+
let i = Mo(t, e);
|
|
3509
3539
|
i && q(n, r, i);
|
|
3510
3540
|
return;
|
|
3511
3541
|
}
|
|
@@ -3515,12 +3545,12 @@ function Fo(e, t = []) {
|
|
|
3515
3545
|
if (i) {
|
|
3516
3546
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3517
3547
|
q(n, r, e ? [e[0]] : []);
|
|
3518
|
-
} else q(n, r,
|
|
3548
|
+
} else q(n, r, $i(e, Array.isArray(t) ? t : [t]));
|
|
3519
3549
|
return;
|
|
3520
3550
|
}
|
|
3521
3551
|
let i = e.splitDialCodeInto;
|
|
3522
3552
|
if (i && typeof t == "string") {
|
|
3523
|
-
let { code: a, rest: o } =
|
|
3553
|
+
let { code: a, rest: o } = io(t), s = to(a);
|
|
3524
3554
|
s && q(n, i, s), q(n, r, K(e, o || t));
|
|
3525
3555
|
return;
|
|
3526
3556
|
}
|
|
@@ -3530,27 +3560,27 @@ function Fo(e, t = []) {
|
|
|
3530
3560
|
}
|
|
3531
3561
|
//#endregion
|
|
3532
3562
|
//#region src/components/form/useAiActions.js
|
|
3533
|
-
function
|
|
3563
|
+
function Lo(e) {
|
|
3534
3564
|
let t = document.createElement("div");
|
|
3535
3565
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3536
3566
|
}
|
|
3537
|
-
function
|
|
3538
|
-
return t && t === "stripHtml" ?
|
|
3567
|
+
function Ro(e, t) {
|
|
3568
|
+
return t && t === "stripHtml" ? Lo(e) : e;
|
|
3539
3569
|
}
|
|
3540
|
-
function
|
|
3570
|
+
function zo(e) {
|
|
3541
3571
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3542
3572
|
}
|
|
3543
|
-
function
|
|
3573
|
+
function Bo(e) {
|
|
3544
3574
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3545
3575
|
}
|
|
3546
|
-
function
|
|
3576
|
+
function Vo(e, t) {
|
|
3547
3577
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3548
|
-
let n =
|
|
3578
|
+
let n = Ro(t, e.transform), r = String(n ?? "").trim();
|
|
3549
3579
|
if (!r) return !1;
|
|
3550
3580
|
let i = Number(e.minWords) || 0;
|
|
3551
|
-
return i > 0 ?
|
|
3581
|
+
return i > 0 ? zo(r) >= i : !0;
|
|
3552
3582
|
}
|
|
3553
|
-
function
|
|
3583
|
+
function Ho(e, t) {
|
|
3554
3584
|
let n = e.inputs || [];
|
|
3555
3585
|
if (n.length === 0) return !0;
|
|
3556
3586
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3558,10 +3588,10 @@ function Vo(e, t) {
|
|
|
3558
3588
|
let n = e.group || `__solo_${t}`;
|
|
3559
3589
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3560
3590
|
});
|
|
3561
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3591
|
+
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
3592
|
return !0;
|
|
3563
3593
|
}
|
|
3564
|
-
function
|
|
3594
|
+
function Uo(e = []) {
|
|
3565
3595
|
let t = [];
|
|
3566
3596
|
return e.forEach((e) => {
|
|
3567
3597
|
if (e?.addRow) {
|
|
@@ -3574,32 +3604,32 @@ function Ho(e = []) {
|
|
|
3574
3604
|
});
|
|
3575
3605
|
}), t;
|
|
3576
3606
|
}
|
|
3577
|
-
function
|
|
3578
|
-
return
|
|
3607
|
+
function Wo(e, t) {
|
|
3608
|
+
return Uo(t).some((t) => {
|
|
3579
3609
|
let n = e.getFieldValue(t);
|
|
3580
|
-
return Array.isArray(n) ? n.some(
|
|
3610
|
+
return Array.isArray(n) ? n.some(Bo) : n != null && n !== "";
|
|
3581
3611
|
});
|
|
3582
3612
|
}
|
|
3583
|
-
function
|
|
3613
|
+
function Go(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3584
3614
|
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
3615
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3586
|
-
if (!(i.has(e) || !a(e) || !
|
|
3616
|
+
if (!(i.has(e) || !a(e) || !Ko(t))) {
|
|
3587
3617
|
if (Array.isArray(t)) {
|
|
3588
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3618
|
+
o += t.filter((e) => e && typeof e == "object" ? Bo(e) : !!e).length;
|
|
3589
3619
|
return;
|
|
3590
3620
|
}
|
|
3591
3621
|
o += 1;
|
|
3592
3622
|
}
|
|
3593
3623
|
}), o;
|
|
3594
3624
|
}
|
|
3595
|
-
function
|
|
3596
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3625
|
+
function Ko(e) {
|
|
3626
|
+
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
3627
|
}
|
|
3598
|
-
function
|
|
3628
|
+
function qo(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3599
3629
|
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) =>
|
|
3630
|
+
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
3631
|
}
|
|
3602
|
-
function
|
|
3632
|
+
function Jo(e = []) {
|
|
3603
3633
|
let t = {};
|
|
3604
3634
|
return (e ?? []).forEach((e) => {
|
|
3605
3635
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3610,38 +3640,38 @@ function qo(e = []) {
|
|
|
3610
3640
|
});
|
|
3611
3641
|
}), t;
|
|
3612
3642
|
}
|
|
3613
|
-
function
|
|
3643
|
+
function Yo(e, t, n) {
|
|
3614
3644
|
let r = e?.confirmWhen ?? "never";
|
|
3615
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3645
|
+
return r === "never" ? !1 : r === "always" || Wo(t, n);
|
|
3616
3646
|
}
|
|
3617
|
-
var
|
|
3647
|
+
var Xo = [
|
|
3618
3648
|
"top-left",
|
|
3619
3649
|
"top-center",
|
|
3620
3650
|
"top-right",
|
|
3621
3651
|
"bottom-left",
|
|
3622
3652
|
"bottom-center",
|
|
3623
3653
|
"bottom-right"
|
|
3624
|
-
],
|
|
3625
|
-
function
|
|
3654
|
+
], Zo = "bottom-left";
|
|
3655
|
+
function Qo(e = []) {
|
|
3626
3656
|
let t = {};
|
|
3627
3657
|
return e.forEach((e) => {
|
|
3628
|
-
let n =
|
|
3658
|
+
let n = Xo.includes(e.position) ? e.position : Zo;
|
|
3629
3659
|
(t[n] ??= []).push(e);
|
|
3630
3660
|
}), t;
|
|
3631
3661
|
}
|
|
3632
|
-
function
|
|
3633
|
-
let [o, s] = v(null), [c, l] = v(""), u = x.useWatch((e) => e, e), d = p((e) =>
|
|
3662
|
+
function $o({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3663
|
+
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
3664
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3635
|
-
let n =
|
|
3665
|
+
let n = Io(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3636
3666
|
return t.forEach((t) => {
|
|
3637
3667
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3638
|
-
let n =
|
|
3668
|
+
let n = Fo(t);
|
|
3639
3669
|
if (n.length === 0) return;
|
|
3640
3670
|
r = !0;
|
|
3641
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3671
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Bo);
|
|
3642
3672
|
if (a.length) {
|
|
3643
3673
|
let e = t.label || t.name;
|
|
3644
|
-
|
|
3674
|
+
Xa({
|
|
3645
3675
|
tone: "overwrite",
|
|
3646
3676
|
title: `Replace what's in ${e}?`,
|
|
3647
3677
|
facts: [
|
|
@@ -3671,9 +3701,9 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3671
3701
|
return {
|
|
3672
3702
|
runAction: p(async (t, o, c, u) => {
|
|
3673
3703
|
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
|
|
3704
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || qo(e, [o?.field], { includeUntouched: a }))) {
|
|
3705
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = Go(e, [o?.field], { includeUntouched: a });
|
|
3706
|
+
if (!await Xa({
|
|
3677
3707
|
tone: "overwrite",
|
|
3678
3708
|
title: t.title || "Read this file and fill the form in?",
|
|
3679
3709
|
facts: [{
|
|
@@ -3697,12 +3727,12 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3697
3727
|
r && (s[t.param] = r);
|
|
3698
3728
|
} else {
|
|
3699
3729
|
let n = e.getFieldValue(t.sourceField);
|
|
3700
|
-
n != null && n !== "" && (a[t.param] =
|
|
3730
|
+
n != null && n !== "" && (a[t.param] = Ro(n, t.transform));
|
|
3701
3731
|
}
|
|
3702
3732
|
}), (c.inputs || []).forEach((e) => {
|
|
3703
3733
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3704
3734
|
});
|
|
3705
|
-
let l = await
|
|
3735
|
+
let l = await Qa({
|
|
3706
3736
|
module: n,
|
|
3707
3737
|
group: t,
|
|
3708
3738
|
field: o.field,
|
|
@@ -3710,9 +3740,9 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3710
3740
|
inputs: a,
|
|
3711
3741
|
files: s
|
|
3712
3742
|
}), d = c.label || "AI action", p = l?.groups;
|
|
3713
|
-
if (c?.trigger !== "upload" &&
|
|
3714
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3715
|
-
if (!await
|
|
3743
|
+
if (c?.trigger !== "upload" && Yo(c, e, p)) {
|
|
3744
|
+
let e = c.confirmMessages ?? {}, t = Uo(p).length;
|
|
3745
|
+
if (!await Xa({
|
|
3716
3746
|
tone: "overwrite",
|
|
3717
3747
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3718
3748
|
facts: [{
|
|
@@ -3733,7 +3763,7 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3733
3763
|
field: o,
|
|
3734
3764
|
groupName: t,
|
|
3735
3765
|
responseGroups: p,
|
|
3736
|
-
payload:
|
|
3766
|
+
payload: Jo(p)
|
|
3737
3767
|
});
|
|
3738
3768
|
if (e === !1 || e === "abort") return l;
|
|
3739
3769
|
}
|
|
@@ -3765,7 +3795,7 @@ function Qo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3765
3795
|
}
|
|
3766
3796
|
//#endregion
|
|
3767
3797
|
//#region src/components/form/AiActionButtons.jsx
|
|
3768
|
-
function
|
|
3798
|
+
function es({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3769
3799
|
if (!t || t.length === 0) return null;
|
|
3770
3800
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3771
3801
|
return /* @__PURE__ */ C(re, {
|
|
@@ -3786,18 +3816,18 @@ function $o({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3786
3816
|
}
|
|
3787
3817
|
//#endregion
|
|
3788
3818
|
//#region src/components/form/emailValidator.js
|
|
3789
|
-
function
|
|
3819
|
+
function ts(e) {
|
|
3790
3820
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3791
3821
|
if (!n) return !1;
|
|
3792
3822
|
let [, r, i] = n;
|
|
3793
3823
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3794
3824
|
}
|
|
3795
|
-
function
|
|
3796
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3825
|
+
function ns(e = "Email", t) {
|
|
3826
|
+
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
3827
|
}
|
|
3798
3828
|
//#endregion
|
|
3799
3829
|
//#region src/components/form/inputValidator.js
|
|
3800
|
-
var
|
|
3830
|
+
var rs = [
|
|
3801
3831
|
{
|
|
3802
3832
|
label: "Only Numbers",
|
|
3803
3833
|
value: "onlyNumber"
|
|
@@ -3870,7 +3900,7 @@ var ns = [
|
|
|
3870
3900
|
label: "Website URL",
|
|
3871
3901
|
value: "websiteUrl"
|
|
3872
3902
|
}
|
|
3873
|
-
],
|
|
3903
|
+
], is = {
|
|
3874
3904
|
onlyNumber: /^[0-9]$/,
|
|
3875
3905
|
experience: /^[0-9]$/,
|
|
3876
3906
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3886,10 +3916,10 @@ var ns = [
|
|
|
3886
3916
|
decimalRange: /^[0-9.]$/,
|
|
3887
3917
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3888
3918
|
};
|
|
3889
|
-
function
|
|
3890
|
-
return
|
|
3919
|
+
function as(e) {
|
|
3920
|
+
return is[e] ?? null;
|
|
3891
3921
|
}
|
|
3892
|
-
function
|
|
3922
|
+
function os(e, t = {}, n = "change") {
|
|
3893
3923
|
if (!t?.type || e == null) return {
|
|
3894
3924
|
cleaned: e ?? "",
|
|
3895
3925
|
error: null
|
|
@@ -3972,7 +4002,7 @@ function as(e, t = {}, n = "change") {
|
|
|
3972
4002
|
break;
|
|
3973
4003
|
}
|
|
3974
4004
|
case "email":
|
|
3975
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4005
|
+
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
4006
|
break;
|
|
3977
4007
|
case "websiteUrl":
|
|
3978
4008
|
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 +4014,21 @@ function as(e, t = {}, n = "change") {
|
|
|
3984
4014
|
error: l
|
|
3985
4015
|
};
|
|
3986
4016
|
}
|
|
3987
|
-
var
|
|
3988
|
-
function
|
|
4017
|
+
var ss = "This value is already present";
|
|
4018
|
+
function cs(e) {
|
|
3989
4019
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
3990
4020
|
}
|
|
3991
|
-
function
|
|
3992
|
-
if (
|
|
4021
|
+
function ls(e) {
|
|
4022
|
+
if (cs(e) !== "unique") return null;
|
|
3993
4023
|
if (typeof e == "string") return {
|
|
3994
|
-
message:
|
|
4024
|
+
message: ss,
|
|
3995
4025
|
normalizer: "trim",
|
|
3996
4026
|
skipBlank: !0,
|
|
3997
4027
|
validateOn: "blur"
|
|
3998
4028
|
};
|
|
3999
4029
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4000
4030
|
return {
|
|
4001
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4031
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ss,
|
|
4002
4032
|
collectionField: t.collectionField ?? "",
|
|
4003
4033
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4004
4034
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4009,20 +4039,20 @@ function cs(e) {
|
|
|
4009
4039
|
].includes(n) ? n : "blur"
|
|
4010
4040
|
};
|
|
4011
4041
|
}
|
|
4012
|
-
function
|
|
4042
|
+
function us(e) {
|
|
4013
4043
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4014
4044
|
if (!Array.isArray(t)) return null;
|
|
4015
4045
|
for (let e of t) {
|
|
4016
|
-
let t =
|
|
4046
|
+
let t = ls(e);
|
|
4017
4047
|
if (t) return t;
|
|
4018
4048
|
}
|
|
4019
4049
|
return null;
|
|
4020
4050
|
}
|
|
4021
|
-
function
|
|
4051
|
+
function ds(e = []) {
|
|
4022
4052
|
let t = [];
|
|
4023
4053
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4024
4054
|
(e?.fields ?? []).forEach((e) => {
|
|
4025
|
-
let n =
|
|
4055
|
+
let n = us(e);
|
|
4026
4056
|
!n || !e?.field || t.push({
|
|
4027
4057
|
field: e.field,
|
|
4028
4058
|
label: e.label ?? e.field,
|
|
@@ -4031,10 +4061,10 @@ function us(e = []) {
|
|
|
4031
4061
|
});
|
|
4032
4062
|
}), t;
|
|
4033
4063
|
}
|
|
4034
|
-
function
|
|
4064
|
+
function fs(e) {
|
|
4035
4065
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4036
4066
|
}
|
|
4037
|
-
function
|
|
4067
|
+
function ps(e, t = "trim") {
|
|
4038
4068
|
if (e == null) return "";
|
|
4039
4069
|
let n = String(e);
|
|
4040
4070
|
switch (String(t)) {
|
|
@@ -4046,10 +4076,10 @@ function fs(e, t = "trim") {
|
|
|
4046
4076
|
default: return n.trim();
|
|
4047
4077
|
}
|
|
4048
4078
|
}
|
|
4049
|
-
function
|
|
4050
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4079
|
+
function ms(e, t) {
|
|
4080
|
+
return !(!e || e.skipBlank !== !1 && fs(t));
|
|
4051
4081
|
}
|
|
4052
|
-
function
|
|
4082
|
+
function hs(e) {
|
|
4053
4083
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4054
4084
|
}
|
|
4055
4085
|
var J = {
|
|
@@ -4059,21 +4089,21 @@ var J = {
|
|
|
4059
4089
|
STALE: "stale",
|
|
4060
4090
|
ERROR: "error"
|
|
4061
4091
|
};
|
|
4062
|
-
function
|
|
4092
|
+
function gs({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4063
4093
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4064
4094
|
}
|
|
4065
|
-
function
|
|
4095
|
+
function _s({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4066
4096
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4067
4097
|
function o(e) {
|
|
4068
4098
|
a = e, typeof t == "function" && t(a);
|
|
4069
4099
|
}
|
|
4070
4100
|
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 =
|
|
4101
|
+
if (!c || !t || !s || typeof e != "function" || !ms(c, l)) return { status: J.SKIPPED };
|
|
4102
|
+
let p = gs({
|
|
4073
4103
|
module: t,
|
|
4074
4104
|
field: s,
|
|
4075
4105
|
recordId: u,
|
|
4076
|
-
normalized:
|
|
4106
|
+
normalized: ps(l, c.normalizer)
|
|
4077
4107
|
});
|
|
4078
4108
|
if (n.has(p)) return n.get(p);
|
|
4079
4109
|
i += 1;
|
|
@@ -4091,7 +4121,7 @@ function gs({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4091
4121
|
if (r.get(s) !== m) return { status: J.STALE };
|
|
4092
4122
|
let a = i?.available === !1 ? {
|
|
4093
4123
|
status: J.DUPLICATE,
|
|
4094
|
-
message:
|
|
4124
|
+
message: vs(i) || c.message || ss
|
|
4095
4125
|
} : { status: J.AVAILABLE };
|
|
4096
4126
|
return n.set(p, a), a;
|
|
4097
4127
|
} catch (e) {
|
|
@@ -4112,17 +4142,17 @@ function gs({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4112
4142
|
}
|
|
4113
4143
|
};
|
|
4114
4144
|
}
|
|
4115
|
-
function
|
|
4145
|
+
function vs(e) {
|
|
4116
4146
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4117
4147
|
}
|
|
4118
|
-
var
|
|
4119
|
-
function
|
|
4120
|
-
let r =
|
|
4148
|
+
var ys = "__uniqueRule";
|
|
4149
|
+
function bs({ field: e, validation: t, context: n }) {
|
|
4150
|
+
let r = ls(t);
|
|
4121
4151
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4122
4152
|
let i = e?.field ?? "";
|
|
4123
4153
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4124
|
-
[
|
|
4125
|
-
validateTrigger:
|
|
4154
|
+
[ys]: r,
|
|
4155
|
+
validateTrigger: hs(r),
|
|
4126
4156
|
validator: async (e, t) => {
|
|
4127
4157
|
let a = await n.checker.check({
|
|
4128
4158
|
module: n.module,
|
|
@@ -4137,22 +4167,22 @@ function ys({ field: e, validation: t, context: n }) {
|
|
|
4137
4167
|
}
|
|
4138
4168
|
};
|
|
4139
4169
|
}
|
|
4140
|
-
function
|
|
4170
|
+
function xs(e = []) {
|
|
4141
4171
|
let t = Array.isArray(e) ? e : [];
|
|
4142
|
-
if (!t.some((e) => e && e[
|
|
4143
|
-
let n = t.filter((e) => e && !e[
|
|
4172
|
+
if (!t.some((e) => e && e[ys])) return t;
|
|
4173
|
+
let n = t.filter((e) => e && !e[ys]);
|
|
4144
4174
|
return t.map((e) => {
|
|
4145
|
-
if (!e || !e[
|
|
4175
|
+
if (!e || !e[ys]) return e;
|
|
4146
4176
|
let t = e.validator;
|
|
4147
4177
|
return {
|
|
4148
4178
|
...e,
|
|
4149
|
-
validator: async (e, r) => await
|
|
4179
|
+
validator: async (e, r) => await Ss(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4150
4180
|
};
|
|
4151
4181
|
});
|
|
4152
4182
|
}
|
|
4153
|
-
async function
|
|
4183
|
+
async function Ss(e = [], t, n = {}) {
|
|
4154
4184
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4155
|
-
if (r.required &&
|
|
4185
|
+
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
4186
|
if (typeof r.validator == "function") try {
|
|
4157
4187
|
await r.validator(n, t);
|
|
4158
4188
|
} catch {
|
|
@@ -4161,7 +4191,7 @@ async function xs(e = [], t, n = {}) {
|
|
|
4161
4191
|
}
|
|
4162
4192
|
return !1;
|
|
4163
4193
|
}
|
|
4164
|
-
function
|
|
4194
|
+
function Cs(e) {
|
|
4165
4195
|
let t = String(e ?? "").trim();
|
|
4166
4196
|
if (!t.startsWith("{")) return null;
|
|
4167
4197
|
try {
|
|
@@ -4170,19 +4200,19 @@ function Ss(e) {
|
|
|
4170
4200
|
return null;
|
|
4171
4201
|
}
|
|
4172
4202
|
}
|
|
4173
|
-
function
|
|
4203
|
+
function ws(e) {
|
|
4174
4204
|
if (!e) return null;
|
|
4175
|
-
if (typeof e == "string") return
|
|
4205
|
+
if (typeof e == "string") return Cs(e);
|
|
4176
4206
|
let t = [
|
|
4177
4207
|
e.data,
|
|
4178
4208
|
e.response,
|
|
4179
4209
|
e,
|
|
4180
|
-
|
|
4210
|
+
Cs(e.message)
|
|
4181
4211
|
];
|
|
4182
4212
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4183
4213
|
return null;
|
|
4184
4214
|
}
|
|
4185
|
-
function
|
|
4215
|
+
function Ts({ field: e, group: t, rowIndex: n }) {
|
|
4186
4216
|
let r = String(e ?? ""), i = Number(n);
|
|
4187
4217
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4188
4218
|
String(t),
|
|
@@ -4190,14 +4220,14 @@ function ws({ field: e, group: t, rowIndex: n }) {
|
|
|
4190
4220
|
...r.split(".")
|
|
4191
4221
|
] : r;
|
|
4192
4222
|
}
|
|
4193
|
-
function
|
|
4194
|
-
let n =
|
|
4223
|
+
function Es(e, { uniqueRules: t = [] } = {}) {
|
|
4224
|
+
let n = ws(e);
|
|
4195
4225
|
if (n) {
|
|
4196
4226
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4197
4227
|
let t = {
|
|
4198
4228
|
field: e.field,
|
|
4199
|
-
name:
|
|
4200
|
-
message: e.message || n.message ||
|
|
4229
|
+
name: Ts(e),
|
|
4230
|
+
message: e.message || n.message || ss
|
|
4201
4231
|
};
|
|
4202
4232
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4203
4233
|
});
|
|
@@ -4214,7 +4244,7 @@ function Ts(e, { uniqueRules: t = [] } = {}) {
|
|
|
4214
4244
|
}
|
|
4215
4245
|
//#endregion
|
|
4216
4246
|
//#region src/services/uniqueValidationApi.js
|
|
4217
|
-
async function
|
|
4247
|
+
async function Ds({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4218
4248
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4219
4249
|
let c = {
|
|
4220
4250
|
field: t,
|
|
@@ -4248,7 +4278,7 @@ async function Es({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4248
4278
|
throw e;
|
|
4249
4279
|
}
|
|
4250
4280
|
}
|
|
4251
|
-
async function
|
|
4281
|
+
async function Os({ module: e, payload: t, excludeId: n } = {}) {
|
|
4252
4282
|
if (!e || !t) return { duplicate: !1 };
|
|
4253
4283
|
try {
|
|
4254
4284
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4266,7 +4296,7 @@ async function Ds({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4266
4296
|
}
|
|
4267
4297
|
//#endregion
|
|
4268
4298
|
//#region src/components/form/uploadAccept.js
|
|
4269
|
-
var
|
|
4299
|
+
var ks = [
|
|
4270
4300
|
"jpg",
|
|
4271
4301
|
"jpeg",
|
|
4272
4302
|
"png",
|
|
@@ -4275,18 +4305,18 @@ var Os = [
|
|
|
4275
4305
|
"bmp",
|
|
4276
4306
|
"svg",
|
|
4277
4307
|
"avif"
|
|
4278
|
-
],
|
|
4308
|
+
], As = [
|
|
4279
4309
|
"mp4",
|
|
4280
4310
|
"webm",
|
|
4281
4311
|
"ogg",
|
|
4282
4312
|
"ogv",
|
|
4283
4313
|
"mov",
|
|
4284
4314
|
"m4v"
|
|
4285
|
-
],
|
|
4315
|
+
], js = [
|
|
4286
4316
|
"pdf",
|
|
4287
4317
|
"doc",
|
|
4288
4318
|
"docx"
|
|
4289
|
-
],
|
|
4319
|
+
], Ms = [
|
|
4290
4320
|
{
|
|
4291
4321
|
label: "Any file",
|
|
4292
4322
|
value: "any"
|
|
@@ -4311,45 +4341,45 @@ var Os = [
|
|
|
4311
4341
|
label: "Images & Videos",
|
|
4312
4342
|
value: "imagesAndVideos"
|
|
4313
4343
|
}
|
|
4314
|
-
],
|
|
4344
|
+
], Ns = {
|
|
4315
4345
|
resume: {
|
|
4316
|
-
exts:
|
|
4346
|
+
exts: js,
|
|
4317
4347
|
maxSizeMB: 2,
|
|
4318
4348
|
hint: "PDF, DOC or DOCX",
|
|
4319
4349
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4320
4350
|
},
|
|
4321
4351
|
documents: {
|
|
4322
|
-
exts: [...
|
|
4352
|
+
exts: [...js, ...ks],
|
|
4323
4353
|
hint: "PDF, DOC or image files",
|
|
4324
4354
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4325
4355
|
},
|
|
4326
4356
|
images: {
|
|
4327
|
-
exts:
|
|
4357
|
+
exts: ks,
|
|
4328
4358
|
hint: "Image files",
|
|
4329
4359
|
error: "Only image files are allowed"
|
|
4330
4360
|
},
|
|
4331
4361
|
videos: {
|
|
4332
|
-
exts:
|
|
4362
|
+
exts: As,
|
|
4333
4363
|
hint: "Video files",
|
|
4334
4364
|
error: "Only video files are allowed"
|
|
4335
4365
|
},
|
|
4336
4366
|
imagesAndVideos: {
|
|
4337
|
-
exts: [...
|
|
4367
|
+
exts: [...ks, ...As],
|
|
4338
4368
|
hint: "Image or video files",
|
|
4339
4369
|
error: "Only image or video files are allowed"
|
|
4340
4370
|
}
|
|
4341
4371
|
};
|
|
4342
|
-
function
|
|
4372
|
+
function Ps(e) {
|
|
4343
4373
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4344
4374
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4345
4375
|
}
|
|
4346
|
-
function
|
|
4376
|
+
function Fs(e) {
|
|
4347
4377
|
let t = String(e?.accept ?? "").trim();
|
|
4348
|
-
return t && t !== "any" ?
|
|
4378
|
+
return t && t !== "any" ? Ns[t] ?? null : !t && Ps(e) ? Ns.resume : Ns[t] ?? null;
|
|
4349
4379
|
}
|
|
4350
4380
|
//#endregion
|
|
4351
4381
|
//#region src/components/form/quickActionLabels.js
|
|
4352
|
-
var
|
|
4382
|
+
var Is = /* @__PURE__ */ new Set([
|
|
4353
4383
|
"of",
|
|
4354
4384
|
"and",
|
|
4355
4385
|
"the",
|
|
@@ -4358,7 +4388,7 @@ var Fs = /* @__PURE__ */ new Set([
|
|
|
4358
4388
|
"in",
|
|
4359
4389
|
"a",
|
|
4360
4390
|
"an"
|
|
4361
|
-
]),
|
|
4391
|
+
]), Ls = {
|
|
4362
4392
|
addresses: "address",
|
|
4363
4393
|
branches: "branch",
|
|
4364
4394
|
batches: "batch",
|
|
@@ -4369,43 +4399,43 @@ var Fs = /* @__PURE__ */ new Set([
|
|
|
4369
4399
|
people: "person",
|
|
4370
4400
|
statuses: "status"
|
|
4371
4401
|
};
|
|
4372
|
-
function
|
|
4402
|
+
function Rs(e) {
|
|
4373
4403
|
let t = String(e ?? "").trim();
|
|
4374
4404
|
if (!t) return "";
|
|
4375
4405
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4376
4406
|
let n = t.toLowerCase();
|
|
4377
|
-
return
|
|
4407
|
+
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
4408
|
}
|
|
4379
|
-
function
|
|
4409
|
+
function zs(e) {
|
|
4380
4410
|
let t = String(e ?? "").trim();
|
|
4381
4411
|
if (!t) return "";
|
|
4382
4412
|
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
4413
|
if (!n.length) return "";
|
|
4384
|
-
let r =
|
|
4414
|
+
let r = Rs(n[n.length - 1]);
|
|
4385
4415
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4386
4416
|
let n = e.toLowerCase();
|
|
4387
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4417
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Is.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4388
4418
|
}).join(" ");
|
|
4389
4419
|
}
|
|
4390
|
-
function
|
|
4420
|
+
function Bs(e, t) {
|
|
4391
4421
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4392
4422
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4393
|
-
let r =
|
|
4423
|
+
let r = zs(e?.quickCreateModule || t);
|
|
4394
4424
|
return r ? `Add New ${r}` : "Add New";
|
|
4395
4425
|
}
|
|
4396
|
-
function
|
|
4426
|
+
function Vs(e, t) {
|
|
4397
4427
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4398
4428
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4399
|
-
let r =
|
|
4429
|
+
let r = zs(e?.quickEditModule || t);
|
|
4400
4430
|
return r ? `Edit ${r}` : "Edit";
|
|
4401
4431
|
}
|
|
4402
|
-
function
|
|
4403
|
-
let r =
|
|
4404
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4432
|
+
function Hs(e, t, n) {
|
|
4433
|
+
let r = zs((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4434
|
+
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
4435
|
}
|
|
4406
4436
|
//#endregion
|
|
4407
4437
|
//#region src/components/AppButton.jsx
|
|
4408
|
-
function
|
|
4438
|
+
function Us({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4409
4439
|
let o = /* @__PURE__ */ C(b, {
|
|
4410
4440
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4411
4441
|
icon: n,
|
|
@@ -4420,13 +4450,13 @@ function Vs({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4420
4450
|
}
|
|
4421
4451
|
//#endregion
|
|
4422
4452
|
//#region src/components/detail/userNames.js
|
|
4423
|
-
function
|
|
4453
|
+
function Ws(e) {
|
|
4424
4454
|
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
4455
|
}
|
|
4426
|
-
function
|
|
4456
|
+
function Gs(e) {
|
|
4427
4457
|
let t = {};
|
|
4428
4458
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4429
|
-
let n =
|
|
4459
|
+
let n = Ws(e);
|
|
4430
4460
|
n && [
|
|
4431
4461
|
e.legacyUserId,
|
|
4432
4462
|
e.userId,
|
|
@@ -4440,29 +4470,29 @@ function Us(e) {
|
|
|
4440
4470
|
});
|
|
4441
4471
|
}), t;
|
|
4442
4472
|
}
|
|
4443
|
-
var
|
|
4444
|
-
function
|
|
4473
|
+
var Ks = /* @__PURE__ */ new Map();
|
|
4474
|
+
function qs(e) {
|
|
4445
4475
|
let t = String(e ?? "").trim();
|
|
4446
4476
|
if (!t) return Promise.resolve("");
|
|
4447
|
-
if (
|
|
4448
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4449
|
-
return
|
|
4477
|
+
if (Ks.has(t)) return Ks.get(t);
|
|
4478
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => Ws(e?.data ?? e ?? null)).catch(() => "");
|
|
4479
|
+
return Ks.set(t, n), n;
|
|
4450
4480
|
}
|
|
4451
|
-
var
|
|
4452
|
-
function
|
|
4481
|
+
var Y = (e) => e == null ? "" : String(e).trim();
|
|
4482
|
+
function Js(e) {
|
|
4453
4483
|
let t = e?.quickCreateNotice;
|
|
4454
4484
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4455
4485
|
enabled: !0,
|
|
4456
|
-
title:
|
|
4457
|
-
message:
|
|
4486
|
+
title: Y(t.title) || "New record created",
|
|
4487
|
+
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
4488
|
showCreator: t.showCreator !== !1,
|
|
4459
4489
|
showRecordName: t.showRecordName !== !1,
|
|
4460
|
-
recordNameField:
|
|
4461
|
-
recordLabel:
|
|
4462
|
-
creatorLabel:
|
|
4490
|
+
recordNameField: Y(t.recordNameField),
|
|
4491
|
+
recordLabel: Y(t.recordLabel) || "Record name",
|
|
4492
|
+
creatorLabel: Y(t.creatorLabel) || "Created by"
|
|
4463
4493
|
};
|
|
4464
4494
|
}
|
|
4465
|
-
var
|
|
4495
|
+
var Ys = [
|
|
4466
4496
|
"clientName",
|
|
4467
4497
|
"companyName",
|
|
4468
4498
|
"name",
|
|
@@ -4472,24 +4502,24 @@ var qs = [
|
|
|
4472
4502
|
"label",
|
|
4473
4503
|
"employerName",
|
|
4474
4504
|
"vendorName"
|
|
4475
|
-
],
|
|
4505
|
+
], Xs = (e, t) => {
|
|
4476
4506
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4477
|
-
},
|
|
4478
|
-
function
|
|
4507
|
+
}, Zs = (e) => typeof e == "string" || typeof e == "number" ? Y(e) : e && typeof e == "object" ? Y(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4508
|
+
function Qs(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4479
4509
|
if (!e || typeof e != "object") return "";
|
|
4480
4510
|
for (let r of [
|
|
4481
4511
|
t,
|
|
4482
4512
|
n,
|
|
4483
|
-
...
|
|
4513
|
+
...Ys
|
|
4484
4514
|
]) {
|
|
4485
4515
|
if (!r) continue;
|
|
4486
|
-
let t =
|
|
4516
|
+
let t = Zs(Xs(e, r));
|
|
4487
4517
|
if (t) return t;
|
|
4488
4518
|
}
|
|
4489
4519
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4490
|
-
return r ?
|
|
4520
|
+
return r ? Y(e[r]) : "";
|
|
4491
4521
|
}
|
|
4492
|
-
function
|
|
4522
|
+
function $s(e) {
|
|
4493
4523
|
if (!e || typeof e != "object") return "";
|
|
4494
4524
|
let t = [
|
|
4495
4525
|
e.createdBy,
|
|
@@ -4502,76 +4532,76 @@ function Zs(e) {
|
|
|
4502
4532
|
for (let e of t) {
|
|
4503
4533
|
if (e == null || e === "") continue;
|
|
4504
4534
|
if (typeof e == "object") {
|
|
4505
|
-
let t =
|
|
4535
|
+
let t = Y(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
4506
4536
|
if (t) return t;
|
|
4507
4537
|
continue;
|
|
4508
4538
|
}
|
|
4509
|
-
let t =
|
|
4539
|
+
let t = Y(e);
|
|
4510
4540
|
if (t) return t;
|
|
4511
4541
|
}
|
|
4512
4542
|
return "";
|
|
4513
4543
|
}
|
|
4514
|
-
function
|
|
4544
|
+
function ec(e = i) {
|
|
4515
4545
|
try {
|
|
4516
|
-
return
|
|
4546
|
+
return Ws(e()) || "";
|
|
4517
4547
|
} catch {
|
|
4518
4548
|
return "";
|
|
4519
4549
|
}
|
|
4520
4550
|
}
|
|
4521
|
-
var
|
|
4551
|
+
var tc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4522
4552
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4523
4553
|
return Array.isArray(t) ? t[0] : t;
|
|
4524
4554
|
});
|
|
4525
|
-
async function
|
|
4526
|
-
let { fetchRecord: o =
|
|
4555
|
+
async function nc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4556
|
+
let { fetchRecord: o = tc, fetchUserNameFn: s = qs, getUser: c = i } = a, l = null;
|
|
4527
4557
|
if (e && t) try {
|
|
4528
4558
|
l = await o(e, t);
|
|
4529
4559
|
} catch {
|
|
4530
4560
|
l = null;
|
|
4531
4561
|
}
|
|
4532
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4562
|
+
let u = n?.showRecordName === !1 ? "" : Qs(l, {
|
|
4533
4563
|
recordNameField: n?.recordNameField,
|
|
4534
4564
|
displayField: r
|
|
4535
4565
|
}), d = "";
|
|
4536
4566
|
if (n?.showCreator !== !1) {
|
|
4537
|
-
let e =
|
|
4567
|
+
let e = $s(l);
|
|
4538
4568
|
if (e) try {
|
|
4539
|
-
d =
|
|
4569
|
+
d = Y(await s(e));
|
|
4540
4570
|
} catch {
|
|
4541
4571
|
d = "";
|
|
4542
4572
|
}
|
|
4543
|
-
d ||=
|
|
4573
|
+
d ||= ec(c);
|
|
4544
4574
|
}
|
|
4545
4575
|
return {
|
|
4546
4576
|
recordName: u,
|
|
4547
4577
|
creatorName: d
|
|
4548
4578
|
};
|
|
4549
4579
|
}
|
|
4550
|
-
var
|
|
4551
|
-
function
|
|
4580
|
+
var rc = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
4581
|
+
function ic(e) {
|
|
4552
4582
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
4553
4583
|
}
|
|
4554
|
-
var
|
|
4555
|
-
function
|
|
4556
|
-
let n =
|
|
4557
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
4584
|
+
var ac = (e) => ic(e).toLowerCase();
|
|
4585
|
+
function oc(e, t) {
|
|
4586
|
+
let n = ac(e);
|
|
4587
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => ac(e?.label) === n) ?? null;
|
|
4558
4588
|
}
|
|
4559
|
-
function
|
|
4560
|
-
return t || n ? !1 :
|
|
4589
|
+
function sc({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
4590
|
+
return t || n ? !1 : ic(e).length >= 3;
|
|
4561
4591
|
}
|
|
4562
4592
|
//#endregion
|
|
4563
4593
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4564
|
-
var
|
|
4565
|
-
function
|
|
4594
|
+
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];
|
|
4595
|
+
function fc(e, t, n, r, i) {
|
|
4566
4596
|
let a = e.quickEditIdFrom;
|
|
4567
4597
|
if (a) {
|
|
4568
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4569
|
-
return
|
|
4598
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...dc(a)] : dc(a), i = t?.getFieldValue?.(e);
|
|
4599
|
+
return uc(i) && (i = r?.[a]), uc(i) ? null : i;
|
|
4570
4600
|
}
|
|
4571
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4601
|
+
return i && typeof i == "object" ? i.value ?? null : uc(i) ? null : i;
|
|
4572
4602
|
}
|
|
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 ?
|
|
4603
|
+
function pc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4604
|
+
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
4605
|
p,
|
|
4576
4606
|
e,
|
|
4577
4607
|
t,
|
|
@@ -4585,7 +4615,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4585
4615
|
openCreateWith: null,
|
|
4586
4616
|
isModalOpen: !1
|
|
4587
4617
|
};
|
|
4588
|
-
let ee =
|
|
4618
|
+
let ee = rc(e, r), y = () => c(null), te = () => {
|
|
4589
4619
|
if (e?.quickCreateOnClick) {
|
|
4590
4620
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
4591
4621
|
return;
|
|
@@ -4609,12 +4639,12 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4609
4639
|
module: h,
|
|
4610
4640
|
recordId: String(_)
|
|
4611
4641
|
}), oe = (t) => {
|
|
4612
|
-
let n =
|
|
4642
|
+
let n = Js(e);
|
|
4613
4643
|
n && (d({
|
|
4614
4644
|
...n,
|
|
4615
4645
|
recordName: "",
|
|
4616
4646
|
creatorName: ""
|
|
4617
|
-
}),
|
|
4647
|
+
}), nc({
|
|
4618
4648
|
module: m,
|
|
4619
4649
|
recordId: t,
|
|
4620
4650
|
notice: n,
|
|
@@ -4644,20 +4674,20 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4644
4674
|
icon: /* @__PURE__ */ C(ge, {}),
|
|
4645
4675
|
onClick: te,
|
|
4646
4676
|
style: { paddingLeft: 0 },
|
|
4647
|
-
children:
|
|
4677
|
+
children: Bs(e, m)
|
|
4648
4678
|
}), p && /* @__PURE__ */ C(b, {
|
|
4649
4679
|
type: "link",
|
|
4650
4680
|
size: "small",
|
|
4651
4681
|
icon: /* @__PURE__ */ C(ce, {}),
|
|
4652
4682
|
onClick: ae,
|
|
4653
4683
|
disabled: !_,
|
|
4654
|
-
title: _ ? void 0 : `Choose a ${
|
|
4655
|
-
children:
|
|
4684
|
+
title: _ ? void 0 : `Choose a ${zs(h) || "record"} above first, then edit it here`,
|
|
4685
|
+
children: Vs(e, h)
|
|
4656
4686
|
})]
|
|
4657
4687
|
})
|
|
4658
4688
|
}), ue = s ? /* @__PURE__ */ C(ne, {
|
|
4659
4689
|
open: !0,
|
|
4660
|
-
title:
|
|
4690
|
+
title: Hs(s.mode, e, s.mode === "create" ? m : h),
|
|
4661
4691
|
width: "min(1080px, 96vw)",
|
|
4662
4692
|
footer: null,
|
|
4663
4693
|
destroyOnClose: !0,
|
|
@@ -4675,7 +4705,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4675
4705
|
},
|
|
4676
4706
|
children: /* @__PURE__ */ C(ie, {})
|
|
4677
4707
|
}),
|
|
4678
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4708
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(cc, {
|
|
4679
4709
|
moduleName: s.module,
|
|
4680
4710
|
embedded: !0,
|
|
4681
4711
|
breadcrumbItems: [],
|
|
@@ -4684,7 +4714,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4684
4714
|
onSuccess: (e) => {
|
|
4685
4715
|
y(), oe(e), o?.("create", e);
|
|
4686
4716
|
}
|
|
4687
|
-
}) : /* @__PURE__ */ C(
|
|
4717
|
+
}) : /* @__PURE__ */ C(lc, {
|
|
4688
4718
|
moduleName: s.module,
|
|
4689
4719
|
recordId: s.recordId,
|
|
4690
4720
|
embedded: !0,
|
|
@@ -4708,7 +4738,7 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4708
4738
|
width: "min(520px, 94vw)",
|
|
4709
4739
|
maskClosable: !1,
|
|
4710
4740
|
onCancel: () => d(null),
|
|
4711
|
-
footer: /* @__PURE__ */ C(
|
|
4741
|
+
footer: /* @__PURE__ */ C(Us, {
|
|
4712
4742
|
variant: "primary",
|
|
4713
4743
|
type: "primary",
|
|
4714
4744
|
onClick: () => d(null),
|
|
@@ -4747,8 +4777,8 @@ function dc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4747
4777
|
}
|
|
4748
4778
|
//#endregion
|
|
4749
4779
|
//#region src/components/form/crossFieldRules.js
|
|
4750
|
-
var
|
|
4751
|
-
function
|
|
4780
|
+
var mc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4781
|
+
function hc(e, t, n) {
|
|
4752
4782
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4753
4783
|
if (typeof n == "function") {
|
|
4754
4784
|
let e = n(t);
|
|
@@ -4756,23 +4786,23 @@ function pc(e, t, n) {
|
|
|
4756
4786
|
}
|
|
4757
4787
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4758
4788
|
}
|
|
4759
|
-
function
|
|
4789
|
+
function gc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4760
4790
|
let s = n.field ?? n.compareField ?? r;
|
|
4761
4791
|
return { validator: async (n, r) => {
|
|
4762
|
-
if (!s ||
|
|
4763
|
-
let c = i?.getFieldValue?.(
|
|
4764
|
-
if (
|
|
4792
|
+
if (!s || mc(r)) return Promise.resolve();
|
|
4793
|
+
let c = i?.getFieldValue?.(hc(a, s, o));
|
|
4794
|
+
if (mc(c)) return Promise.resolve();
|
|
4765
4795
|
let l = Number(c), u = Number(r);
|
|
4766
4796
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4767
4797
|
} };
|
|
4768
4798
|
}
|
|
4769
|
-
function
|
|
4799
|
+
function _c(e = {}, t, n) {
|
|
4770
4800
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4771
|
-
return r ?
|
|
4801
|
+
return r ? hc(t, r, n) : null;
|
|
4772
4802
|
}
|
|
4773
4803
|
//#endregion
|
|
4774
4804
|
//#region src/components/form/maxCeiling.js
|
|
4775
|
-
function
|
|
4805
|
+
function vc(e, t) {
|
|
4776
4806
|
let n = String(t).split(".").filter(Boolean);
|
|
4777
4807
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4778
4808
|
if (n.length > 1) {
|
|
@@ -4785,14 +4815,14 @@ function gc(e, t) {
|
|
|
4785
4815
|
let r = [...e];
|
|
4786
4816
|
return r[r.length - 1] = n[0], r;
|
|
4787
4817
|
}
|
|
4788
|
-
function
|
|
4789
|
-
let r = e?.getFieldValue?.(
|
|
4818
|
+
function yc(e, t, n) {
|
|
4819
|
+
let r = e?.getFieldValue?.(vc(t, n));
|
|
4790
4820
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4791
4821
|
}
|
|
4792
|
-
function
|
|
4822
|
+
function bc(e) {
|
|
4793
4823
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4794
4824
|
}
|
|
4795
|
-
function
|
|
4825
|
+
function xc(e, t) {
|
|
4796
4826
|
for (let n of e ?? []) {
|
|
4797
4827
|
let e = t(n);
|
|
4798
4828
|
if (e == null || e === "") continue;
|
|
@@ -4804,14 +4834,14 @@ function yc(e, t) {
|
|
|
4804
4834
|
}
|
|
4805
4835
|
return null;
|
|
4806
4836
|
}
|
|
4807
|
-
function
|
|
4837
|
+
function Sc({ input: e, compareFields: t, readValue: n }) {
|
|
4808
4838
|
let r = {
|
|
4809
4839
|
ok: !0,
|
|
4810
4840
|
field: null,
|
|
4811
4841
|
maximum: null
|
|
4812
4842
|
};
|
|
4813
4843
|
if (e == null || e === "") return r;
|
|
4814
|
-
let i =
|
|
4844
|
+
let i = xc(t, n);
|
|
4815
4845
|
if (!i) return r;
|
|
4816
4846
|
let a = Number(e);
|
|
4817
4847
|
return Number.isFinite(a) ? {
|
|
@@ -4822,39 +4852,39 @@ function bc({ input: e, compareFields: t, readValue: n }) {
|
|
|
4822
4852
|
}
|
|
4823
4853
|
//#endregion
|
|
4824
4854
|
//#region src/components/form/contextPrefill.js
|
|
4825
|
-
var
|
|
4826
|
-
function
|
|
4855
|
+
var Cc = { candidates: ["applicantId"] };
|
|
4856
|
+
function wc(e) {
|
|
4827
4857
|
let t = String(e ?? "").trim();
|
|
4828
4858
|
if (!t) return [];
|
|
4829
4859
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4830
4860
|
return [.../* @__PURE__ */ new Set([
|
|
4831
4861
|
`${n}Id`,
|
|
4832
4862
|
`${t}Id`,
|
|
4833
|
-
...
|
|
4863
|
+
...Cc[t] ?? []
|
|
4834
4864
|
])];
|
|
4835
4865
|
}
|
|
4836
|
-
function
|
|
4866
|
+
function Tc(e, t) {
|
|
4837
4867
|
if (!t) return "";
|
|
4838
4868
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4839
|
-
for (let r of
|
|
4869
|
+
for (let r of wc(e)) {
|
|
4840
4870
|
let e = String(n(t[r]) || "");
|
|
4841
4871
|
if (e) return e;
|
|
4842
4872
|
}
|
|
4843
4873
|
return "";
|
|
4844
4874
|
}
|
|
4845
|
-
function
|
|
4875
|
+
function Ec(e, t) {
|
|
4846
4876
|
let n = /* @__PURE__ */ new Set();
|
|
4847
4877
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4848
4878
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4849
4879
|
})), [...n];
|
|
4850
4880
|
}
|
|
4851
|
-
function
|
|
4881
|
+
function Dc(e) {
|
|
4852
4882
|
return e?.payloadMode === "skip";
|
|
4853
4883
|
}
|
|
4854
|
-
function
|
|
4884
|
+
function Oc(e) {
|
|
4855
4885
|
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
4886
|
}
|
|
4857
|
-
function
|
|
4887
|
+
function kc(e) {
|
|
4858
4888
|
let t = {};
|
|
4859
4889
|
return (e ?? []).forEach((e) => {
|
|
4860
4890
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4862,7 +4892,7 @@ function Dc(e) {
|
|
|
4862
4892
|
});
|
|
4863
4893
|
}), t;
|
|
4864
4894
|
}
|
|
4865
|
-
function
|
|
4895
|
+
function Ac(e, t) {
|
|
4866
4896
|
if (!e || !t) return;
|
|
4867
4897
|
let n = e;
|
|
4868
4898
|
for (let e of String(t).split(".")) {
|
|
@@ -4877,7 +4907,7 @@ function Oc(e, t) {
|
|
|
4877
4907
|
}
|
|
4878
4908
|
return n;
|
|
4879
4909
|
}
|
|
4880
|
-
function
|
|
4910
|
+
function jc(e, t) {
|
|
4881
4911
|
if (!(!e || !t)) for (let n of [
|
|
4882
4912
|
t.prefillFrom,
|
|
4883
4913
|
t.field,
|
|
@@ -4885,13 +4915,13 @@ function kc(e, t) {
|
|
|
4885
4915
|
]) {
|
|
4886
4916
|
if (!n) continue;
|
|
4887
4917
|
let t = e[n];
|
|
4888
|
-
if (t ??= B(e, n), t ??=
|
|
4918
|
+
if (t ??= B(e, n), t ??= Ac(e, n), t != null) return t;
|
|
4889
4919
|
}
|
|
4890
4920
|
}
|
|
4891
4921
|
//#endregion
|
|
4892
4922
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
4893
|
-
function
|
|
4894
|
-
let a =
|
|
4923
|
+
function Mc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
4924
|
+
let a = Vi(t), o = x.useWatch(n, e);
|
|
4895
4925
|
if (!a) return null;
|
|
4896
4926
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
4897
4927
|
setTimeout(() => {
|
|
@@ -4902,7 +4932,7 @@ function Ac({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4902
4932
|
e.setFieldValue(n, !1), c();
|
|
4903
4933
|
return;
|
|
4904
4934
|
}
|
|
4905
|
-
let i = await
|
|
4935
|
+
let i = await Xa(Ji(t));
|
|
4906
4936
|
e.setFieldValue(n, !!i), c();
|
|
4907
4937
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
4908
4938
|
return /* @__PURE__ */ C(ae, {
|
|
@@ -4921,34 +4951,34 @@ function Ac({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4921
4951
|
}
|
|
4922
4952
|
//#endregion
|
|
4923
4953
|
//#region src/components/form/prefillWhenRules.js
|
|
4924
|
-
var
|
|
4925
|
-
function
|
|
4954
|
+
var Nc = (e) => String(e ?? "");
|
|
4955
|
+
function Pc(e) {
|
|
4926
4956
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4927
4957
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4928
4958
|
let r = e?.field;
|
|
4929
4959
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
4930
4960
|
}), n;
|
|
4931
4961
|
}
|
|
4932
|
-
function
|
|
4933
|
-
return
|
|
4962
|
+
function Fc(e, t, n, r) {
|
|
4963
|
+
return Pc(e).map((e) => ({
|
|
4934
4964
|
field: e,
|
|
4935
4965
|
path: n(t, e, r)
|
|
4936
4966
|
}));
|
|
4937
4967
|
}
|
|
4938
|
-
function
|
|
4939
|
-
return !e || !e.field ? !1 :
|
|
4968
|
+
function Ic(e, t = {}) {
|
|
4969
|
+
return !e || !e.field ? !1 : Nc(t[e.field]) === Nc(e.value);
|
|
4940
4970
|
}
|
|
4941
|
-
function
|
|
4942
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
4971
|
+
function Lc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
4972
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Ic(e, t));
|
|
4943
4973
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
4944
4974
|
action: "set",
|
|
4945
4975
|
value: o.setValue
|
|
4946
|
-
} : i && r !== void 0 &&
|
|
4976
|
+
} : i && r !== void 0 && Nc(n) === Nc(r) ? { action: "clear" } : { action: "none" };
|
|
4947
4977
|
}
|
|
4948
4978
|
//#endregion
|
|
4949
4979
|
//#region src/components/form/optionConstraints.js
|
|
4950
|
-
var
|
|
4951
|
-
function
|
|
4980
|
+
var X = (e) => String(e ?? "").trim().toLowerCase();
|
|
4981
|
+
function Rc(e) {
|
|
4952
4982
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
4953
4983
|
return t.forEach((e) => {
|
|
4954
4984
|
if (e != null && e !== "") {
|
|
@@ -4960,50 +4990,50 @@ function Ic(e) {
|
|
|
4960
4990
|
e.label,
|
|
4961
4991
|
e.name
|
|
4962
4992
|
].forEach((e) => {
|
|
4963
|
-
e != null && e !== "" && n.push(
|
|
4993
|
+
e != null && e !== "" && n.push(X(e));
|
|
4964
4994
|
});
|
|
4965
4995
|
return;
|
|
4966
4996
|
}
|
|
4967
|
-
n.push(
|
|
4997
|
+
n.push(X(e));
|
|
4968
4998
|
}
|
|
4969
4999
|
}), n;
|
|
4970
5000
|
}
|
|
4971
|
-
function
|
|
4972
|
-
let n =
|
|
5001
|
+
function zc(e = [], t) {
|
|
5002
|
+
let n = Rc(t);
|
|
4973
5003
|
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(
|
|
5004
|
+
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
5005
|
return i.length > 0 ? i : e;
|
|
4976
5006
|
}
|
|
4977
|
-
function
|
|
5007
|
+
function Bc(e) {
|
|
4978
5008
|
let t = [];
|
|
4979
5009
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
4980
|
-
e != null && e !== "" && t.push(
|
|
5010
|
+
e != null && e !== "" && t.push(X(e));
|
|
4981
5011
|
}), t;
|
|
4982
5012
|
}
|
|
4983
|
-
function
|
|
5013
|
+
function Vc(e, t = {}) {
|
|
4984
5014
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
4985
5015
|
return n.forEach((e) => {
|
|
4986
5016
|
if (!e || e.clearValue) return;
|
|
4987
|
-
let n =
|
|
5017
|
+
let n = Bc(e);
|
|
4988
5018
|
if (!n.length) return;
|
|
4989
|
-
let a =
|
|
5019
|
+
let a = Ic(e, t) ? i : r;
|
|
4990
5020
|
n.forEach((e) => a.add(e));
|
|
4991
5021
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
4992
5022
|
}
|
|
4993
|
-
function
|
|
4994
|
-
let r =
|
|
5023
|
+
function Hc(e = [], t, n) {
|
|
5024
|
+
let r = Vc(t, n);
|
|
4995
5025
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4996
5026
|
let i = new Set(r);
|
|
4997
|
-
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(
|
|
5027
|
+
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
5028
|
}
|
|
4999
|
-
function
|
|
5029
|
+
function Uc(e, t = {}, n) {
|
|
5000
5030
|
let r = Array.isArray(e) ? e : [];
|
|
5001
5031
|
if (n == null || n === "") return [];
|
|
5002
|
-
let i =
|
|
5032
|
+
let i = X(n), a = [], o = /* @__PURE__ */ new Set();
|
|
5003
5033
|
return r.forEach((e) => {
|
|
5004
5034
|
if (!e || e.clearValue) return;
|
|
5005
5035
|
let { setValue: n, setValueLabel: r } = e;
|
|
5006
|
-
n != null && n !== "" && r &&
|
|
5036
|
+
n != null && n !== "" && r && X(n) === i && Ic(e, t) && (o.has(X(n)) || (o.add(X(n)), a.push({
|
|
5007
5037
|
value: n,
|
|
5008
5038
|
label: r
|
|
5009
5039
|
})));
|
|
@@ -5011,8 +5041,8 @@ function Vc(e, t = {}, n) {
|
|
|
5011
5041
|
}
|
|
5012
5042
|
//#endregion
|
|
5013
5043
|
//#region src/components/form/optionRowFilters.js
|
|
5014
|
-
var
|
|
5015
|
-
function
|
|
5044
|
+
var Wc = 64;
|
|
5045
|
+
function Gc(e) {
|
|
5016
5046
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5017
5047
|
try {
|
|
5018
5048
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5020,34 +5050,34 @@ function Uc(e) {
|
|
|
5020
5050
|
return "";
|
|
5021
5051
|
}
|
|
5022
5052
|
}
|
|
5023
|
-
var
|
|
5024
|
-
function
|
|
5053
|
+
var Z = (e) => String(e ?? "").trim().toLowerCase(), Kc = (e) => e != null && String(e).trim() !== "";
|
|
5054
|
+
function qc(e) {
|
|
5025
5055
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5026
|
-
return new Set(t.map(
|
|
5056
|
+
return new Set(t.map(Z).filter((e) => e !== ""));
|
|
5027
5057
|
}
|
|
5028
|
-
function
|
|
5029
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5058
|
+
function Jc(e, t) {
|
|
5059
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => Kc(e?.extraData?.[t]));
|
|
5030
5060
|
}
|
|
5031
|
-
function
|
|
5061
|
+
function Yc(e, t, n) {
|
|
5032
5062
|
let r = e?.extraData?.[t];
|
|
5033
|
-
if (!
|
|
5034
|
-
let i =
|
|
5035
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5063
|
+
if (!Kc(n)) return r === !0;
|
|
5064
|
+
let i = qc(n);
|
|
5065
|
+
return i.size === 0 ? r === !0 : i.has(Z(r));
|
|
5036
5066
|
}
|
|
5037
|
-
function
|
|
5067
|
+
function Xc(e, t) {
|
|
5038
5068
|
let n = /* @__PURE__ */ new Map();
|
|
5039
5069
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5040
|
-
let r =
|
|
5041
|
-
r && n.set(r,
|
|
5070
|
+
let r = Z(e?.value);
|
|
5071
|
+
r && n.set(r, Z(e?.extraData?.[t]));
|
|
5042
5072
|
}), n;
|
|
5043
5073
|
}
|
|
5044
|
-
function
|
|
5045
|
-
let r =
|
|
5074
|
+
function Zc(e, t, n) {
|
|
5075
|
+
let r = Z(n);
|
|
5046
5076
|
if (!r) return !1;
|
|
5047
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5077
|
+
let i = /* @__PURE__ */ new Set(), a = Z(e);
|
|
5048
5078
|
if (!a) return !1;
|
|
5049
5079
|
i.add(a);
|
|
5050
|
-
for (let e = 0; e <
|
|
5080
|
+
for (let e = 0; e < Wc; e += 1) {
|
|
5051
5081
|
let e = t.get(a);
|
|
5052
5082
|
if (!e) return !1;
|
|
5053
5083
|
if (e === r) return !0;
|
|
@@ -5056,74 +5086,74 @@ function Xc(e, t, n) {
|
|
|
5056
5086
|
}
|
|
5057
5087
|
return !1;
|
|
5058
5088
|
}
|
|
5059
|
-
function
|
|
5089
|
+
function Qc(e = {}) {
|
|
5060
5090
|
let t = [], n = (e) => {
|
|
5061
5091
|
let n = String(e ?? "").trim();
|
|
5062
5092
|
n && !t.includes(n) && t.push(n);
|
|
5063
5093
|
};
|
|
5064
5094
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5065
5095
|
}
|
|
5066
|
-
function
|
|
5096
|
+
function $c(e, t = {}, n = {}) {
|
|
5067
5097
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5068
5098
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5069
5099
|
typeof console < "u" && console.warn(e);
|
|
5070
5100
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5071
|
-
s && (
|
|
5101
|
+
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
5102
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5073
5103
|
if (c) {
|
|
5074
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5104
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Gc(n);
|
|
5075
5105
|
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 (!
|
|
5106
|
+
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
5107
|
else {
|
|
5078
|
-
let t =
|
|
5079
|
-
o = o.filter((e) =>
|
|
5108
|
+
let t = Xc(e, c);
|
|
5109
|
+
o = o.filter((e) => Zc(e?.value, t, s));
|
|
5080
5110
|
}
|
|
5081
5111
|
}
|
|
5082
5112
|
return o;
|
|
5083
5113
|
}
|
|
5084
5114
|
//#endregion
|
|
5085
5115
|
//#region src/components/form/fieldTooltip.js
|
|
5086
|
-
var
|
|
5087
|
-
function
|
|
5088
|
-
return
|
|
5116
|
+
var el = (e) => e == null || String(e).trim() === "", tl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5117
|
+
function nl(e) {
|
|
5118
|
+
return el(e?.tooltip) ? tl(e?.infoEnabled) && !el(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5089
5119
|
}
|
|
5090
5120
|
//#endregion
|
|
5091
5121
|
//#region src/components/form/autofillValue.js
|
|
5092
|
-
var
|
|
5093
|
-
function
|
|
5122
|
+
var rl = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5123
|
+
function il(e, t = {}, n = () => void 0) {
|
|
5094
5124
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5095
|
-
return
|
|
5125
|
+
return rl(i) && a != null && a !== "" ? a : i;
|
|
5096
5126
|
}
|
|
5097
5127
|
//#endregion
|
|
5098
5128
|
//#region src/components/form/dependentLookupReset.js
|
|
5099
|
-
var
|
|
5100
|
-
function
|
|
5101
|
-
return !(!r || e ===
|
|
5129
|
+
var al = Symbol("parentFilterUnseen"), ol = (e) => e == null || e === "", sl = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5130
|
+
function cl({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5131
|
+
return !(!r || e === al || sl(e, t) || ol(e) || ol(n));
|
|
5102
5132
|
}
|
|
5103
5133
|
//#endregion
|
|
5104
5134
|
//#region src/utils/roleAllowsAction.js
|
|
5105
|
-
function
|
|
5106
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5135
|
+
function ll(e) {
|
|
5136
|
+
return e == null ? !0 : typeof e == "object" ? ll(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5107
5137
|
}
|
|
5108
|
-
function
|
|
5138
|
+
function ul(e, t) {
|
|
5109
5139
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5110
5140
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5111
5141
|
let e = String(t).trim().toLowerCase();
|
|
5112
5142
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5113
5143
|
}
|
|
5114
5144
|
}
|
|
5115
|
-
function
|
|
5145
|
+
function dl(e, t) {
|
|
5116
5146
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5117
5147
|
let n = `${t}Access`;
|
|
5118
5148
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5119
5149
|
}
|
|
5120
|
-
function
|
|
5150
|
+
function fl(e, t) {
|
|
5121
5151
|
if (!e) return !0;
|
|
5122
5152
|
try {
|
|
5123
5153
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5124
5154
|
for (let e of o) {
|
|
5125
|
-
let t =
|
|
5126
|
-
if (t) return
|
|
5155
|
+
let t = ul(n, e);
|
|
5156
|
+
if (t) return ll(dl(t, a));
|
|
5127
5157
|
}
|
|
5128
5158
|
return !0;
|
|
5129
5159
|
} catch {
|
|
@@ -5132,10 +5162,10 @@ function dl(e, t) {
|
|
|
5132
5162
|
}
|
|
5133
5163
|
//#endregion
|
|
5134
5164
|
//#region src/utils/afterSubmitNav.js
|
|
5135
|
-
function
|
|
5165
|
+
function pl(e) {
|
|
5136
5166
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5137
5167
|
}
|
|
5138
|
-
function
|
|
5168
|
+
function ml(e, t, n) {
|
|
5139
5169
|
let r = String(e ?? "").trim();
|
|
5140
5170
|
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
5171
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5144,50 +5174,50 @@ function pl(e, t, n) {
|
|
|
5144
5174
|
}
|
|
5145
5175
|
//#endregion
|
|
5146
5176
|
//#region src/utils/backNav.js
|
|
5147
|
-
function
|
|
5177
|
+
function hl(e = typeof window < "u" ? window : void 0) {
|
|
5148
5178
|
let t = e?.history?.state?.idx;
|
|
5149
5179
|
return typeof t == "number" && t > 0;
|
|
5150
5180
|
}
|
|
5151
|
-
function
|
|
5152
|
-
return t && e ? { path: e } :
|
|
5181
|
+
function gl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5182
|
+
return t && e ? { path: e } : hl(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5153
5183
|
}
|
|
5154
|
-
function
|
|
5155
|
-
let n =
|
|
5184
|
+
function _l(e, t = {}) {
|
|
5185
|
+
let n = gl(t);
|
|
5156
5186
|
return n.back ? e(-1) : e(n.path), n;
|
|
5157
5187
|
}
|
|
5158
5188
|
//#endregion
|
|
5159
5189
|
//#region src/components/form/educationRules.js
|
|
5160
|
-
var
|
|
5161
|
-
function
|
|
5190
|
+
var vl = (e) => e == null ? "" : String(e).trim();
|
|
5191
|
+
function yl(e, t) {
|
|
5162
5192
|
let n = e?.regionRules;
|
|
5163
5193
|
if (!n || typeof n != "object") return e ?? {};
|
|
5164
|
-
let r =
|
|
5194
|
+
let r = vl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5165
5195
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5166
5196
|
...e,
|
|
5167
5197
|
...i
|
|
5168
5198
|
};
|
|
5169
5199
|
}
|
|
5170
|
-
function yl(e) {
|
|
5171
|
-
return e?.allowInProgress !== !1;
|
|
5172
|
-
}
|
|
5173
5200
|
function bl(e) {
|
|
5174
|
-
return
|
|
5201
|
+
return e?.allowInProgress !== !1;
|
|
5175
5202
|
}
|
|
5176
5203
|
function xl(e) {
|
|
5177
|
-
return
|
|
5204
|
+
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
5205
|
}
|
|
5179
5206
|
function Sl(e) {
|
|
5180
|
-
return
|
|
5207
|
+
return bl(e) ? "allow" : vl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5181
5208
|
}
|
|
5182
5209
|
function Cl(e) {
|
|
5183
|
-
return
|
|
5210
|
+
return Sl(e) === "block";
|
|
5184
5211
|
}
|
|
5185
5212
|
function wl(e) {
|
|
5186
|
-
|
|
5187
|
-
|
|
5213
|
+
return Sl(e) === "warn";
|
|
5214
|
+
}
|
|
5215
|
+
function Tl(e) {
|
|
5216
|
+
if (!Cl(e)) return null;
|
|
5217
|
+
let t = xl(e);
|
|
5188
5218
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5189
5219
|
}
|
|
5190
|
-
function
|
|
5220
|
+
function El(e, t = {}) {
|
|
5191
5221
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5192
5222
|
for (let t of [n, r]) {
|
|
5193
5223
|
let n = e?.[t];
|
|
@@ -5197,50 +5227,50 @@ function Tl(e, t = {}) {
|
|
|
5197
5227
|
}
|
|
5198
5228
|
return null;
|
|
5199
5229
|
}
|
|
5200
|
-
function
|
|
5230
|
+
function Dl(e, t = {}) {
|
|
5201
5231
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5202
5232
|
return !!e?.[n];
|
|
5203
5233
|
}
|
|
5204
|
-
function
|
|
5234
|
+
function Ol(e = [], t = {}) {
|
|
5205
5235
|
let n = (t.direction ?? "desc") === "desc";
|
|
5206
5236
|
return e.map((e, n) => ({
|
|
5207
5237
|
index: n,
|
|
5208
|
-
key:
|
|
5209
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5238
|
+
key: El(e, t),
|
|
5239
|
+
ongoing: t.inProgressFirst !== !1 && Dl(e, t)
|
|
5210
5240
|
})).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
5241
|
}
|
|
5212
|
-
function
|
|
5242
|
+
function kl(e, t, n = {}) {
|
|
5213
5243
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5214
|
-
let r =
|
|
5244
|
+
let r = Ol(e, n).indexOf(t);
|
|
5215
5245
|
return r === -1 || r === t ? null : {
|
|
5216
5246
|
from: t,
|
|
5217
5247
|
to: r,
|
|
5218
|
-
reason:
|
|
5248
|
+
reason: Dl(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5219
5249
|
};
|
|
5220
5250
|
}
|
|
5221
|
-
var
|
|
5251
|
+
var Al = Object.freeze({
|
|
5222
5252
|
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
5253
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5224
5254
|
ok: "Yes, move it up",
|
|
5225
5255
|
keep: "No, leave it here"
|
|
5226
5256
|
});
|
|
5227
|
-
function
|
|
5257
|
+
function jl(e, t = {}) {
|
|
5228
5258
|
let n = {
|
|
5229
|
-
...
|
|
5259
|
+
...Al,
|
|
5230
5260
|
...t.messages ?? {}
|
|
5231
5261
|
};
|
|
5232
5262
|
return n[e] ?? n.outOfOrder;
|
|
5233
5263
|
}
|
|
5234
|
-
function
|
|
5235
|
-
let n = t.levelField ?? "qualification", r =
|
|
5264
|
+
function Ml(e, t = {}) {
|
|
5265
|
+
let n = t.levelField ?? "qualification", r = vl(e?.[n]);
|
|
5236
5266
|
if (!r) return null;
|
|
5237
5267
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5238
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5268
|
+
return Number.isFinite(Number(a)) ? Number(a) : Nl(r, t);
|
|
5239
5269
|
}
|
|
5240
|
-
function
|
|
5270
|
+
function Nl(e, t) {
|
|
5241
5271
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5242
5272
|
for (let e of n) {
|
|
5243
|
-
let t =
|
|
5273
|
+
let t = vl(e?.match);
|
|
5244
5274
|
if (!t) continue;
|
|
5245
5275
|
let n;
|
|
5246
5276
|
try {
|
|
@@ -5252,14 +5282,14 @@ function Ml(e, t) {
|
|
|
5252
5282
|
}
|
|
5253
5283
|
return null;
|
|
5254
5284
|
}
|
|
5255
|
-
function
|
|
5256
|
-
return
|
|
5285
|
+
function Pl(e, t = {}) {
|
|
5286
|
+
return vl((t?.levelLabels ?? {})[e]) || vl(e);
|
|
5257
5287
|
}
|
|
5258
|
-
function
|
|
5288
|
+
function Fl(e = [], t = {}) {
|
|
5259
5289
|
if (!t || t.requireBelow === !1) return [];
|
|
5260
5290
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5261
5291
|
if (!r.length) return [];
|
|
5262
|
-
let i = e.map((e) =>
|
|
5292
|
+
let i = e.map((e) => Ml(e, t)).filter((e) => e !== null);
|
|
5263
5293
|
if (!i.length) return [];
|
|
5264
5294
|
let a = Math.max(...i), o = [];
|
|
5265
5295
|
return r.forEach((e) => {
|
|
@@ -5267,43 +5297,43 @@ function Pl(e = [], t = {}) {
|
|
|
5267
5297
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5268
5298
|
}), o;
|
|
5269
5299
|
}
|
|
5270
|
-
function
|
|
5271
|
-
let n =
|
|
5300
|
+
function Il(e, t = {}) {
|
|
5301
|
+
let n = Fl(e, t);
|
|
5272
5302
|
if (!n.length) return "";
|
|
5273
|
-
let r = n.map((e) =>
|
|
5303
|
+
let r = n.map((e) => Pl(e, t)).join(", ");
|
|
5274
5304
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5275
5305
|
}
|
|
5276
|
-
async function
|
|
5306
|
+
async function Ll({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5277
5307
|
let a = e?.orderBy;
|
|
5278
5308
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5279
|
-
let o =
|
|
5309
|
+
let o = kl(t, n, a);
|
|
5280
5310
|
if (!o) return !1;
|
|
5281
5311
|
let s = {
|
|
5282
|
-
...
|
|
5312
|
+
...Al,
|
|
5283
5313
|
...a.messages ?? {}
|
|
5284
5314
|
};
|
|
5285
5315
|
return await i({
|
|
5286
5316
|
reason: o.reason,
|
|
5287
5317
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5288
|
-
body:
|
|
5318
|
+
body: jl(o.reason, a),
|
|
5289
5319
|
okText: s.ok,
|
|
5290
5320
|
cancelText: s.keep,
|
|
5291
5321
|
from: o.from,
|
|
5292
5322
|
to: o.to
|
|
5293
5323
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5294
5324
|
}
|
|
5295
|
-
function
|
|
5296
|
-
let n =
|
|
5325
|
+
function Rl(e, t) {
|
|
5326
|
+
let n = yl(e, t), r = n?.orderBy?.inProgressField;
|
|
5297
5327
|
return r ? {
|
|
5298
5328
|
name: n.name,
|
|
5299
5329
|
label: n.label ?? n.name,
|
|
5300
5330
|
rowsKey: n.payloadKey || n.name,
|
|
5301
5331
|
inProgressField: r,
|
|
5302
|
-
severity:
|
|
5303
|
-
message:
|
|
5332
|
+
severity: Sl(n),
|
|
5333
|
+
message: xl(n)
|
|
5304
5334
|
} : null;
|
|
5305
5335
|
}
|
|
5306
|
-
function
|
|
5336
|
+
function zl(e = [], t, n) {
|
|
5307
5337
|
if (!n) return {
|
|
5308
5338
|
severity: "allow",
|
|
5309
5339
|
message: "",
|
|
@@ -5311,8 +5341,8 @@ function Rl(e = [], t, n) {
|
|
|
5311
5341
|
};
|
|
5312
5342
|
let r = null;
|
|
5313
5343
|
for (let i of e) {
|
|
5314
|
-
let e =
|
|
5315
|
-
if (!(!e || e.severity === "allow") &&
|
|
5344
|
+
let e = Rl(i, t);
|
|
5345
|
+
if (!(!e || e.severity === "allow") && Bl(n, e.rowsKey).some((t) => Dl(t, e))) {
|
|
5316
5346
|
if (e.severity === "block") return {
|
|
5317
5347
|
severity: "block",
|
|
5318
5348
|
message: e.message,
|
|
@@ -5331,23 +5361,23 @@ function Rl(e = [], t, n) {
|
|
|
5331
5361
|
group: null
|
|
5332
5362
|
};
|
|
5333
5363
|
}
|
|
5334
|
-
function
|
|
5364
|
+
function Bl(e, t) {
|
|
5335
5365
|
let n = e?.[t];
|
|
5336
5366
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5337
5367
|
}
|
|
5338
|
-
function
|
|
5368
|
+
function Vl(e) {
|
|
5339
5369
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5340
5370
|
}
|
|
5341
|
-
function
|
|
5371
|
+
function Hl(e = [], t = {}) {
|
|
5342
5372
|
let n = null;
|
|
5343
5373
|
for (let r of e) {
|
|
5344
5374
|
let e = r?.levelRule;
|
|
5345
5375
|
if (!e) continue;
|
|
5346
|
-
let i =
|
|
5376
|
+
let i = Ul(t, r);
|
|
5347
5377
|
if (!i.length) continue;
|
|
5348
|
-
let a =
|
|
5378
|
+
let a = Il(i, e);
|
|
5349
5379
|
if (a) {
|
|
5350
|
-
if (
|
|
5380
|
+
if (Vl(e) === "block") return {
|
|
5351
5381
|
severity: "block",
|
|
5352
5382
|
message: a,
|
|
5353
5383
|
group: r
|
|
@@ -5365,7 +5395,7 @@ function Vl(e = [], t = {}) {
|
|
|
5365
5395
|
group: null
|
|
5366
5396
|
};
|
|
5367
5397
|
}
|
|
5368
|
-
function
|
|
5398
|
+
function Ul(e, t) {
|
|
5369
5399
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5370
5400
|
if (!n) continue;
|
|
5371
5401
|
let t = e?.[n];
|
|
@@ -5375,10 +5405,10 @@ function Hl(e, t) {
|
|
|
5375
5405
|
}
|
|
5376
5406
|
//#endregion
|
|
5377
5407
|
//#region src/components/form/clearGroupOnChange.js
|
|
5378
|
-
function
|
|
5408
|
+
function Wl(e, t) {
|
|
5379
5409
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5380
5410
|
}
|
|
5381
|
-
function
|
|
5411
|
+
function Gl(e, t) {
|
|
5382
5412
|
let n = e?.field, r = [];
|
|
5383
5413
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5384
5414
|
e && e !== n && r.push(e);
|
|
@@ -5388,24 +5418,24 @@ function Wl(e, t) {
|
|
|
5388
5418
|
e && e !== n && r.push(e);
|
|
5389
5419
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5390
5420
|
}
|
|
5391
|
-
function
|
|
5392
|
-
let i =
|
|
5421
|
+
function Kl(e, t, n, r) {
|
|
5422
|
+
let i = Gl(t, r).map((e) => Wl(n, e));
|
|
5393
5423
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5394
5424
|
}
|
|
5395
5425
|
//#endregion
|
|
5396
5426
|
//#region src/components/form/resolveStoredOptions.js
|
|
5397
|
-
function
|
|
5427
|
+
function ql(e) {
|
|
5398
5428
|
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
5429
|
}
|
|
5400
|
-
function
|
|
5430
|
+
function Jl(e, t = []) {
|
|
5401
5431
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5402
|
-
for (let t of
|
|
5432
|
+
for (let t of ql(e)) {
|
|
5403
5433
|
let e = String(t);
|
|
5404
5434
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5405
5435
|
}
|
|
5406
5436
|
return r;
|
|
5407
5437
|
}
|
|
5408
|
-
async function
|
|
5438
|
+
async function Yl(e, t) {
|
|
5409
5439
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5410
5440
|
let n = new URLSearchParams({
|
|
5411
5441
|
collection: e.lookupCollection,
|
|
@@ -5417,7 +5447,7 @@ async function Jl(e, t) {
|
|
|
5417
5447
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5418
5448
|
return Array.isArray(i) ? i : [];
|
|
5419
5449
|
}
|
|
5420
|
-
function
|
|
5450
|
+
function Xl(e = [], t = []) {
|
|
5421
5451
|
if (!t.length) return e;
|
|
5422
5452
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5423
5453
|
...e,
|
|
@@ -5427,25 +5457,25 @@ function Yl(e = [], t = []) {
|
|
|
5427
5457
|
}
|
|
5428
5458
|
//#endregion
|
|
5429
5459
|
//#region src/components/form/requireAnyOf.js
|
|
5430
|
-
var
|
|
5431
|
-
function
|
|
5460
|
+
var Zl = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5461
|
+
function Ql(e) {
|
|
5432
5462
|
let t = e?.requireAnyOf;
|
|
5433
5463
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5434
5464
|
}
|
|
5435
|
-
function
|
|
5436
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5465
|
+
function $l(e) {
|
|
5466
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !Zl(e));
|
|
5437
5467
|
}
|
|
5438
|
-
function
|
|
5439
|
-
let n =
|
|
5468
|
+
function eu({ field: e, getRow: t }) {
|
|
5469
|
+
let n = Ql(e);
|
|
5440
5470
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5441
5471
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5442
5472
|
return { validator: async () => {
|
|
5443
5473
|
let e = t?.() ?? {};
|
|
5444
|
-
return
|
|
5474
|
+
return $l(e) ? n.some((t) => !Zl(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5445
5475
|
} };
|
|
5446
5476
|
}
|
|
5447
|
-
function
|
|
5448
|
-
let n =
|
|
5477
|
+
function tu(e, t = []) {
|
|
5478
|
+
let n = Ql(e);
|
|
5449
5479
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5450
5480
|
...t,
|
|
5451
5481
|
requireAnyOf: n,
|
|
@@ -5454,8 +5484,8 @@ function eu(e, t = []) {
|
|
|
5454
5484
|
}
|
|
5455
5485
|
//#endregion
|
|
5456
5486
|
//#region src/components/form/dateRules.js
|
|
5457
|
-
var
|
|
5458
|
-
function
|
|
5487
|
+
var nu = (e) => e == null || e === "";
|
|
5488
|
+
function ru(e) {
|
|
5459
5489
|
if (!e) return null;
|
|
5460
5490
|
if (typeof e.valueOf == "function") {
|
|
5461
5491
|
let t = e.valueOf();
|
|
@@ -5469,12 +5499,12 @@ function Q(e) {
|
|
|
5469
5499
|
let t = T(e);
|
|
5470
5500
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5471
5501
|
}
|
|
5472
|
-
function
|
|
5502
|
+
function iu(e) {
|
|
5473
5503
|
if (!e) return null;
|
|
5474
5504
|
let t = T(e);
|
|
5475
5505
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5476
5506
|
}
|
|
5477
|
-
var
|
|
5507
|
+
var au = {
|
|
5478
5508
|
d: "day",
|
|
5479
5509
|
day: "day",
|
|
5480
5510
|
days: "day",
|
|
@@ -5490,13 +5520,13 @@ var iu = {
|
|
|
5490
5520
|
year: "year",
|
|
5491
5521
|
years: "year"
|
|
5492
5522
|
};
|
|
5493
|
-
function
|
|
5523
|
+
function ou(e) {
|
|
5494
5524
|
if (e == null || e === "") return null;
|
|
5495
5525
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5496
5526
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5497
5527
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5498
5528
|
value: t,
|
|
5499
|
-
unit:
|
|
5529
|
+
unit: au[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5500
5530
|
};
|
|
5501
5531
|
}
|
|
5502
5532
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5506,49 +5536,49 @@ function au(e) {
|
|
|
5506
5536
|
let r = Number(n[1]);
|
|
5507
5537
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5508
5538
|
value: r,
|
|
5509
|
-
unit:
|
|
5539
|
+
unit: au[n[2]] ?? "month"
|
|
5510
5540
|
};
|
|
5511
5541
|
}
|
|
5512
|
-
function
|
|
5542
|
+
function su(e, t) {
|
|
5513
5543
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5514
5544
|
if (n && typeof t == "function") {
|
|
5515
|
-
let e =
|
|
5545
|
+
let e = ou(t(n));
|
|
5516
5546
|
if (e) return e;
|
|
5517
5547
|
}
|
|
5518
|
-
return
|
|
5548
|
+
return ou(e?.minGap);
|
|
5519
5549
|
}
|
|
5520
|
-
function
|
|
5550
|
+
function cu(e, t, n, r) {
|
|
5521
5551
|
if (t === null) return null;
|
|
5522
|
-
let i =
|
|
5552
|
+
let i = su(n, r), a = T(t);
|
|
5523
5553
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5524
5554
|
}
|
|
5525
|
-
function
|
|
5555
|
+
function lu(e, t, n, r, i) {
|
|
5526
5556
|
if (t === null || n === null) return !1;
|
|
5527
|
-
let a =
|
|
5557
|
+
let a = cu(e, n, r, i);
|
|
5528
5558
|
if (a === null) return !1;
|
|
5529
|
-
let o = !!r?.strict && !
|
|
5559
|
+
let o = !!r?.strict && !su(r, i);
|
|
5530
5560
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5531
5561
|
}
|
|
5532
|
-
function
|
|
5562
|
+
function uu(e, t, n, r) {
|
|
5533
5563
|
if (n?.message) return n.message;
|
|
5534
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5564
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = su(n, r);
|
|
5535
5565
|
if (a) {
|
|
5536
5566
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5537
5567
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5538
5568
|
}
|
|
5539
5569
|
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
5570
|
}
|
|
5541
|
-
function
|
|
5571
|
+
function du({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5542
5572
|
return { validator: async (i, a) => {
|
|
5543
5573
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5544
|
-
if (!o ||
|
|
5574
|
+
if (!o || nu(a)) return Promise.resolve();
|
|
5545
5575
|
let s = r(o);
|
|
5546
|
-
if (
|
|
5576
|
+
if (nu(s)) return Promise.resolve();
|
|
5547
5577
|
let c = Q(a), l = Q(s);
|
|
5548
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5578
|
+
return c === null || l === null ? Promise.resolve() : lu(e, c, l, n, r) ? Promise.reject(Error(uu(e, t, n, r))) : Promise.resolve();
|
|
5549
5579
|
} };
|
|
5550
5580
|
}
|
|
5551
|
-
function
|
|
5581
|
+
function fu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5552
5582
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5553
5583
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5554
5584
|
if (o) {
|
|
@@ -5562,11 +5592,11 @@ function du(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5562
5592
|
}
|
|
5563
5593
|
return !1;
|
|
5564
5594
|
}
|
|
5565
|
-
function
|
|
5595
|
+
function pu(e, t = "above", n = void 0) {
|
|
5566
5596
|
let r = e?.messages ?? {}, i = t === "below";
|
|
5567
5597
|
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
5598
|
}
|
|
5569
|
-
function
|
|
5599
|
+
function mu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = sr }) {
|
|
5570
5600
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5571
5601
|
for (let e of a) {
|
|
5572
5602
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5580,17 +5610,17 @@ function pu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
|
5580
5610
|
o.push((i) => {
|
|
5581
5611
|
if (!i) return !1;
|
|
5582
5612
|
let a = t(e);
|
|
5583
|
-
return !
|
|
5613
|
+
return !nu(a) && lu(r, Q(i), Q(a), n, t);
|
|
5584
5614
|
});
|
|
5585
5615
|
}
|
|
5586
5616
|
}
|
|
5587
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5617
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? fu(Q(t), e.rowHierarchy, {
|
|
5588
5618
|
rows: n,
|
|
5589
5619
|
rowIndex: r
|
|
5590
5620
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5591
5621
|
}
|
|
5592
|
-
function
|
|
5593
|
-
if (!
|
|
5622
|
+
function hu(e, t = sr, n = void 0) {
|
|
5623
|
+
if (!nu(n) && Q(n) !== null) return;
|
|
5594
5624
|
let r = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5595
5625
|
for (let e of r) {
|
|
5596
5626
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5598,7 +5628,7 @@ function mu(e, t = or, n = void 0) {
|
|
|
5598
5628
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5599
5629
|
}
|
|
5600
5630
|
}
|
|
5601
|
-
function
|
|
5631
|
+
function gu({ field: e, name: t, rows: n }) {
|
|
5602
5632
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5603
5633
|
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
5634
|
for (let e of o) {
|
|
@@ -5627,44 +5657,44 @@ function hu({ field: e, name: t, rows: n }) {
|
|
|
5627
5657
|
]));
|
|
5628
5658
|
return u;
|
|
5629
5659
|
}
|
|
5630
|
-
function
|
|
5660
|
+
function _u({ field: e, rows: t, rowIndex: n }) {
|
|
5631
5661
|
let r = e?.rowHierarchy;
|
|
5632
5662
|
return { validator: async (i, a) => {
|
|
5633
|
-
if (!r ||
|
|
5663
|
+
if (!r || nu(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5634
5664
|
let o = Q(a);
|
|
5635
|
-
if (o === null || !
|
|
5665
|
+
if (o === null || !fu(o, r, {
|
|
5636
5666
|
rows: t,
|
|
5637
5667
|
rowIndex: n
|
|
5638
5668
|
})) return Promise.resolve();
|
|
5639
5669
|
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(
|
|
5670
|
+
return Promise.reject(Error(pu(r, u, p)));
|
|
5641
5671
|
} };
|
|
5642
5672
|
}
|
|
5643
5673
|
//#endregion
|
|
5644
5674
|
//#region src/utils/submitMessages.js
|
|
5645
|
-
function
|
|
5675
|
+
function vu(e) {
|
|
5646
5676
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5647
5677
|
}
|
|
5648
5678
|
function $(e) {
|
|
5649
5679
|
let t = String(e ?? "").trim();
|
|
5650
5680
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5651
5681
|
}
|
|
5652
|
-
function
|
|
5682
|
+
function yu(e, t) {
|
|
5653
5683
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
5654
5684
|
}
|
|
5655
|
-
function
|
|
5656
|
-
let r =
|
|
5685
|
+
function bu(e, t, n) {
|
|
5686
|
+
let r = vu(e);
|
|
5657
5687
|
if (r?.suppress) return null;
|
|
5658
5688
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5659
|
-
return i && String(i).trim() ?
|
|
5689
|
+
return i && String(i).trim() ? yu(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
5660
5690
|
}
|
|
5661
|
-
function
|
|
5662
|
-
let i =
|
|
5663
|
-
return a && String(a).trim() ?
|
|
5691
|
+
function xu(e, t, n, r) {
|
|
5692
|
+
let i = vu(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5693
|
+
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
5694
|
}
|
|
5665
5695
|
//#endregion
|
|
5666
5696
|
//#region src/utils/scrollToFirstFormError.js
|
|
5667
|
-
function
|
|
5697
|
+
function Su({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5668
5698
|
if (!e?.length) return;
|
|
5669
5699
|
let r = e[0]?.name;
|
|
5670
5700
|
setTimeout(() => {
|
|
@@ -5689,10 +5719,10 @@ function xu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5689
5719
|
}
|
|
5690
5720
|
//#endregion
|
|
5691
5721
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5692
|
-
function
|
|
5722
|
+
function Cu(e) {
|
|
5693
5723
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5694
5724
|
}
|
|
5695
|
-
function
|
|
5725
|
+
function wu(e, t) {
|
|
5696
5726
|
if (!e?.field) return !1;
|
|
5697
5727
|
switch (e.operator ?? "eq") {
|
|
5698
5728
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5700,66 +5730,66 @@ function Cu(e, t) {
|
|
|
5700
5730
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5701
5731
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5702
5732
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5703
|
-
case "in": return
|
|
5704
|
-
case "notIn": return !
|
|
5733
|
+
case "in": return Cu(e.value).includes(String(t ?? ""));
|
|
5734
|
+
case "notIn": return !Cu(e.value).includes(String(t ?? ""));
|
|
5705
5735
|
default: return !1;
|
|
5706
5736
|
}
|
|
5707
5737
|
}
|
|
5708
|
-
function
|
|
5738
|
+
function Tu(e, t, n = !1) {
|
|
5709
5739
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5710
|
-
return
|
|
5740
|
+
return wu(i, t) && i?.label ? i.label : r;
|
|
5711
5741
|
}
|
|
5712
|
-
function
|
|
5742
|
+
function Eu(e) {
|
|
5713
5743
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5714
5744
|
}
|
|
5715
|
-
function
|
|
5716
|
-
let n =
|
|
5745
|
+
function Du(e, t) {
|
|
5746
|
+
let n = Eu(e);
|
|
5717
5747
|
if (!n.length) return !0;
|
|
5718
|
-
let r = n.map((e) =>
|
|
5748
|
+
let r = n.map((e) => wu(e, t(e.field)));
|
|
5719
5749
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5720
5750
|
}
|
|
5721
|
-
function
|
|
5751
|
+
function Ou(e) {
|
|
5722
5752
|
let t = e?.colWhen;
|
|
5723
5753
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5724
5754
|
}
|
|
5725
|
-
function
|
|
5726
|
-
for (let t of
|
|
5755
|
+
function ku(e, t, n) {
|
|
5756
|
+
for (let t of Ou(e)) if (wu(t, n(t))) return Number(t.col);
|
|
5727
5757
|
return t;
|
|
5728
5758
|
}
|
|
5729
|
-
function
|
|
5759
|
+
function Au(e, t) {
|
|
5730
5760
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5731
5761
|
}
|
|
5732
5762
|
//#endregion
|
|
5733
5763
|
//#region src/components/form/conditionalRequired.js
|
|
5734
|
-
function
|
|
5764
|
+
function ju(e, t) {
|
|
5735
5765
|
return (n) => {
|
|
5736
5766
|
if (!e || !n) return;
|
|
5737
5767
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5738
5768
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5739
5769
|
};
|
|
5740
5770
|
}
|
|
5741
|
-
function
|
|
5771
|
+
function Mu(e, t, n) {
|
|
5742
5772
|
let r = e?.requiredWhen;
|
|
5743
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
5773
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Du(r, ju(t, n));
|
|
5744
5774
|
}
|
|
5745
|
-
function
|
|
5775
|
+
function Nu(e, t, n) {
|
|
5746
5776
|
return { validator: (r, i) => {
|
|
5747
|
-
if (!
|
|
5777
|
+
if (!Mu(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5748
5778
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5749
5779
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5750
5780
|
} };
|
|
5751
5781
|
}
|
|
5752
5782
|
//#endregion
|
|
5753
5783
|
//#region src/components/Breadcrumb.jsx
|
|
5754
|
-
function
|
|
5755
|
-
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(
|
|
5784
|
+
function Pu({ items: e = [] }) {
|
|
5785
|
+
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Nr, {
|
|
5756
5786
|
variant: "body",
|
|
5757
5787
|
weight: "medium",
|
|
5758
5788
|
color: "link",
|
|
5759
5789
|
children: t.label
|
|
5760
5790
|
}) : /* @__PURE__ */ w(xe, {
|
|
5761
5791
|
to: t.href,
|
|
5762
|
-
children: [/* @__PURE__ */ C(
|
|
5792
|
+
children: [/* @__PURE__ */ C(Nr, {
|
|
5763
5793
|
variant: "body",
|
|
5764
5794
|
color: "secondary",
|
|
5765
5795
|
children: t.label
|
|
@@ -5769,34 +5799,34 @@ function Nu({ items: e = [] }) {
|
|
|
5769
5799
|
}
|
|
5770
5800
|
//#endregion
|
|
5771
5801
|
//#region src/components/form/canonicalOption.js
|
|
5772
|
-
var
|
|
5773
|
-
function
|
|
5802
|
+
var Fu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
5803
|
+
function Iu(e = []) {
|
|
5774
5804
|
let t = /* @__PURE__ */ new Map();
|
|
5775
5805
|
for (let n of e) {
|
|
5776
5806
|
if (n == null) continue;
|
|
5777
5807
|
let e = typeof n == "object" ? n.value : n;
|
|
5778
5808
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5779
|
-
let n =
|
|
5809
|
+
let n = Fu(r);
|
|
5780
5810
|
n && !t.has(n) && t.set(n, e);
|
|
5781
5811
|
}
|
|
5782
5812
|
}
|
|
5783
5813
|
return t;
|
|
5784
5814
|
}
|
|
5785
|
-
function
|
|
5815
|
+
function Lu(e, t) {
|
|
5786
5816
|
if (!Array.isArray(e)) {
|
|
5787
|
-
let n =
|
|
5817
|
+
let n = Lu([e], t);
|
|
5788
5818
|
return n.length ? n[0] : e;
|
|
5789
5819
|
}
|
|
5790
|
-
let n =
|
|
5820
|
+
let n = Iu(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
5791
5821
|
for (let t of e) {
|
|
5792
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
5822
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Fu(e)) ?? e, o = Fu(a);
|
|
5793
5823
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
5794
5824
|
}
|
|
5795
5825
|
return i;
|
|
5796
5826
|
}
|
|
5797
5827
|
//#endregion
|
|
5798
5828
|
//#region src/components/form/dependencyBusy.js
|
|
5799
|
-
function
|
|
5829
|
+
function Ru(e, t = []) {
|
|
5800
5830
|
if (!e) return [];
|
|
5801
5831
|
let n = /* @__PURE__ */ new Set();
|
|
5802
5832
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -5806,16 +5836,16 @@ function Lu(e, t = []) {
|
|
|
5806
5836
|
}
|
|
5807
5837
|
return n.delete(e), [...n];
|
|
5808
5838
|
}
|
|
5809
|
-
function
|
|
5810
|
-
return e?.blockWhileResolving ?
|
|
5839
|
+
function zu(e, t = []) {
|
|
5840
|
+
return e?.blockWhileResolving ? Ru(e.field, t).length > 0 : !1;
|
|
5811
5841
|
}
|
|
5812
|
-
function
|
|
5842
|
+
function Bu(e) {
|
|
5813
5843
|
let t = String(e?.label ?? "").trim();
|
|
5814
5844
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
5815
5845
|
}
|
|
5816
|
-
function
|
|
5846
|
+
function Vu(e, t = []) {
|
|
5817
5847
|
if (!e?.field) return [];
|
|
5818
|
-
let n = new Set(
|
|
5848
|
+
let n = new Set(Ru(e.field, t));
|
|
5819
5849
|
if (n.size === 0) return [];
|
|
5820
5850
|
let r = [];
|
|
5821
5851
|
for (let e of t) {
|
|
@@ -5824,19 +5854,19 @@ function Bu(e, t = []) {
|
|
|
5824
5854
|
}
|
|
5825
5855
|
return r;
|
|
5826
5856
|
}
|
|
5827
|
-
function
|
|
5857
|
+
function Hu(e) {
|
|
5828
5858
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
5829
5859
|
}
|
|
5830
5860
|
//#endregion
|
|
5831
5861
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
5832
|
-
var
|
|
5833
|
-
function
|
|
5862
|
+
var Uu = f(() => import("./index.js").then((e) => e.n)), Wu = f(() => import("./DocumentViewer-DSxsilzL.js").then((e) => e.n));
|
|
5863
|
+
function Gu(e) {
|
|
5834
5864
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
5835
5865
|
return C(t === "pdf" ? fe : t === "doc" || t === "docx" ? me : de, { className: "v1-file-chip__icon" });
|
|
5836
5866
|
}
|
|
5837
|
-
function
|
|
5867
|
+
function Ku({ field: e, recordMeta: t }) {
|
|
5838
5868
|
let n = e?.linkedModule, r = e?.linkedFileField, i = g(() => {
|
|
5839
|
-
let r =
|
|
5869
|
+
let r = Tc(n, t);
|
|
5840
5870
|
if (r) return r;
|
|
5841
5871
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
5842
5872
|
return a ? String(a) : "";
|
|
@@ -5856,7 +5886,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5856
5886
|
...e,
|
|
5857
5887
|
loading: !0
|
|
5858
5888
|
}));
|
|
5859
|
-
}),
|
|
5889
|
+
}), Xr(n, i).then((t) => {
|
|
5860
5890
|
e || o({
|
|
5861
5891
|
loading: !1,
|
|
5862
5892
|
fileValue: t?.[r] ?? null
|
|
@@ -5870,7 +5900,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5870
5900
|
r,
|
|
5871
5901
|
f
|
|
5872
5902
|
]);
|
|
5873
|
-
let m = g(() =>
|
|
5903
|
+
let m = g(() => wo(a.fileValue), [a.fileValue])[0], _ = !!m, y = e?.label ?? "File", b = zs(n) || "record";
|
|
5874
5904
|
if (!i) return /* @__PURE__ */ C("div", {
|
|
5875
5905
|
className: "v1-linked-file v1-linked-file--empty",
|
|
5876
5906
|
children: /* @__PURE__ */ C("span", { children: e?.unlinkedText ?? `Not available until the ${b} is set.` })
|
|
@@ -5898,7 +5928,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5898
5928
|
onClick: () => _ && c(!0),
|
|
5899
5929
|
title: _ ? `Preview or download ${m.name}` : re,
|
|
5900
5930
|
children: [
|
|
5901
|
-
_ ?
|
|
5931
|
+
_ ? Gu(m.name) : /* @__PURE__ */ C(de, { className: "v1-file-chip__icon" }),
|
|
5902
5932
|
/* @__PURE__ */ C("span", {
|
|
5903
5933
|
className: "v1-file-chip__name",
|
|
5904
5934
|
children: _ ? m.name : re
|
|
@@ -5922,7 +5952,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5922
5952
|
}),
|
|
5923
5953
|
s && te && /* @__PURE__ */ C(u, {
|
|
5924
5954
|
fallback: null,
|
|
5925
|
-
children: /* @__PURE__ */ C(
|
|
5955
|
+
children: /* @__PURE__ */ C(Wu, {
|
|
5926
5956
|
open: s,
|
|
5927
5957
|
onClose: () => c(!1),
|
|
5928
5958
|
documents: [te]
|
|
@@ -5953,7 +5983,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5953
5983
|
},
|
|
5954
5984
|
children: /* @__PURE__ */ C(ie, {})
|
|
5955
5985
|
}),
|
|
5956
|
-
children: /* @__PURE__ */ C(
|
|
5986
|
+
children: /* @__PURE__ */ C(Uu, {
|
|
5957
5987
|
moduleName: n,
|
|
5958
5988
|
recordId: i,
|
|
5959
5989
|
embedded: !0,
|
|
@@ -5967,7 +5997,7 @@ function Gu({ field: e, recordMeta: t }) {
|
|
|
5967
5997
|
})
|
|
5968
5998
|
] });
|
|
5969
5999
|
}
|
|
5970
|
-
|
|
6000
|
+
Ku.propTypes = {
|
|
5971
6001
|
field: E.shape({
|
|
5972
6002
|
label: E.string,
|
|
5973
6003
|
linkedModule: E.string,
|
|
@@ -5979,8 +6009,8 @@ Gu.propTypes = {
|
|
|
5979
6009
|
reuploadWarning: E.string
|
|
5980
6010
|
}).isRequired,
|
|
5981
6011
|
recordMeta: E.object
|
|
5982
|
-
},
|
|
6012
|
+
}, Ku.defaultProps = { recordMeta: void 0 };
|
|
5983
6013
|
//#endregion
|
|
5984
|
-
export {
|
|
6014
|
+
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
6015
|
|
|
5986
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
6016
|
+
//# sourceMappingURL=LinkedRecordFileField-CYg9t3lw.js.map
|