@realtek/zinnext-theme 1.0.1 → 1.0.3
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-IXUcG6eb.js → LinkedRecordFileField-B1kOm0Qb.js} +587 -582
- package/dist-lib/LinkedRecordFileField-B1kOm0Qb.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-BWEUWFVV.cjs +4 -0
- package/dist-lib/LinkedRecordFileField-BWEUWFVV.cjs.map +1 -0
- package/dist-lib/index.cjs +4 -4
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +181 -154
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-IXUcG6eb.js.map +0 -1
- package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs +0 -4
- package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs.map +0 -1
|
@@ -3,15 +3,15 @@ import { A as s, B as c, C as l, E as u, F as d, H as f, M as p, O as m, S as h,
|
|
|
3
3
|
import { r as de } from "./addFormApi-DEuEstyI.js";
|
|
4
4
|
import { Suspense as fe, createContext as pe, lazy as x, useCallback as me, useContext as he, useEffect as S, useMemo as C, useRef as ge, useState as w, useSyncExternalStore as _e } from "react";
|
|
5
5
|
import { Alert as ve, Breadcrumb as ye, Button as be, Checkbox as xe, Form as Se, Modal as T, Space as Ce, Spin as we, Tag as Te, Tooltip as Ee, Typography as De, message as E } from "antd";
|
|
6
|
-
import { DownOutlined as Oe, EditOutlined as ke, ExclamationCircleFilled as Ae, EyeOutlined as je, FileOutlined as Me, FilePdfOutlined as Ne, FileTextOutlined as Pe, FileWordOutlined as Fe, InfoCircleFilled as Ie,
|
|
6
|
+
import { DownOutlined as Oe, EditOutlined as ke, ExclamationCircleFilled as Ae, EyeOutlined as je, FileOutlined as Me, FilePdfOutlined as Ne, FileTextOutlined as Pe, FileWordOutlined as Fe, InfoCircleFilled as Ie, InfoCircleOutlined as Le, PlusOutlined as Re, UserOutlined as ze } from "@ant-design/icons";
|
|
7
7
|
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
8
8
|
import A from "dayjs";
|
|
9
|
-
import { Link as
|
|
10
|
-
import { EditorContent as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Table as
|
|
9
|
+
import { Link as Be } from "react-router-dom";
|
|
10
|
+
import { EditorContent as Ve, useEditor as He } from "@tiptap/react";
|
|
11
|
+
import Ue from "@tiptap/starter-kit";
|
|
12
|
+
import We from "@tiptap/extension-link";
|
|
13
|
+
import Ge from "@tiptap/extension-underline";
|
|
14
|
+
import { Table as Ke, TableCell as qe, TableHeader as Je, TableRow as Ye } from "@tiptap/extension-table";
|
|
15
15
|
import j from "prop-types";
|
|
16
16
|
//#region src/theme/colors/colors.js
|
|
17
17
|
var M = {
|
|
@@ -160,7 +160,7 @@ var N = {
|
|
|
160
160
|
avatarPurpleBg: "var(--color-avatar-purple-bg)",
|
|
161
161
|
avatarMoreBg: "var(--color-avatar-more-bg)",
|
|
162
162
|
avatarMoreText: "var(--color-avatar-more-text)"
|
|
163
|
-
}, { Text:
|
|
163
|
+
}, { Text: Xe, Title: Ze, Paragraph: Qe, Link: $e } = De, et = {
|
|
164
164
|
display: "h1",
|
|
165
165
|
h1: "h1",
|
|
166
166
|
h2: "h2",
|
|
@@ -178,7 +178,7 @@ var N = {
|
|
|
178
178
|
metric: "span",
|
|
179
179
|
helper: "span",
|
|
180
180
|
link: "a"
|
|
181
|
-
},
|
|
181
|
+
}, tt = {
|
|
182
182
|
xs: "var(--font-size-xs)",
|
|
183
183
|
sm: "var(--font-size-sm)",
|
|
184
184
|
md: "var(--font-size-md)",
|
|
@@ -187,18 +187,18 @@ var N = {
|
|
|
187
187
|
"2xl": "var(--font-size-2xl)",
|
|
188
188
|
"3xl": "var(--font-size-3xl)",
|
|
189
189
|
"4xl": "var(--font-size-4xl)"
|
|
190
|
-
},
|
|
190
|
+
}, nt = {
|
|
191
191
|
regular: "var(--font-weight-regular)",
|
|
192
192
|
medium: "var(--font-weight-medium)",
|
|
193
193
|
semibold: "var(--font-weight-semibold)",
|
|
194
194
|
bold: "var(--font-weight-bold)",
|
|
195
195
|
extrabold: "var(--font-weight-extrabold)"
|
|
196
|
-
},
|
|
196
|
+
}, rt = {
|
|
197
197
|
tight: "var(--line-height-tight)",
|
|
198
198
|
snug: "var(--line-height-snug)",
|
|
199
199
|
normal: "var(--line-height-normal)",
|
|
200
200
|
relaxed: "var(--line-height-relaxed)"
|
|
201
|
-
},
|
|
201
|
+
}, it = {
|
|
202
202
|
primary: N.textPrimary,
|
|
203
203
|
secondary: N.textSecondary,
|
|
204
204
|
muted: N.textMuted,
|
|
@@ -208,37 +208,37 @@ var N = {
|
|
|
208
208
|
danger: N.danger,
|
|
209
209
|
success: N.success
|
|
210
210
|
};
|
|
211
|
-
function
|
|
211
|
+
function at(...e) {
|
|
212
212
|
return e.filter(Boolean).join(" ");
|
|
213
213
|
}
|
|
214
214
|
function P(e, t) {
|
|
215
215
|
if (e != null) return t[e] || e;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return t === "link" || e === "a" ?
|
|
217
|
+
function ot(e, t) {
|
|
218
|
+
return t === "link" || e === "a" ? $e : e === "p" ? Qe : [
|
|
219
219
|
"h1",
|
|
220
220
|
"h2",
|
|
221
221
|
"h3",
|
|
222
222
|
"h4",
|
|
223
223
|
"h5"
|
|
224
|
-
].includes(e) ?
|
|
224
|
+
].includes(e) ? Ze : Xe;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
let n = e ||
|
|
226
|
+
function st(e, t) {
|
|
227
|
+
let n = e || et[t];
|
|
228
228
|
if (n?.startsWith("h")) return Number(n.slice(1));
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
let m = t || e ||
|
|
232
|
-
color: P(r,
|
|
233
|
-
fontSize: P(i,
|
|
234
|
-
fontWeight: P(a,
|
|
235
|
-
lineHeight: P(o,
|
|
230
|
+
function ct({ 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 }) {
|
|
231
|
+
let m = t || e || et[n] || "span", h = ot(m, n), g = st(m, n), _ = {
|
|
232
|
+
color: P(r, it),
|
|
233
|
+
fontSize: P(i, tt),
|
|
234
|
+
fontWeight: P(a, nt),
|
|
235
|
+
lineHeight: P(o, rt),
|
|
236
236
|
display: l,
|
|
237
237
|
...d
|
|
238
238
|
};
|
|
239
239
|
return /* @__PURE__ */ O(h, {
|
|
240
240
|
...g ? { level: g } : {},
|
|
241
|
-
className:
|
|
241
|
+
className: at("app-typography", `app-typography--${n}`, r && it[r] && `app-typography--${r}`, s && `app-typography--${s}`, c && "app-typography--truncate", u),
|
|
242
242
|
style: _,
|
|
243
243
|
...p,
|
|
244
244
|
children: f
|
|
@@ -246,14 +246,14 @@ function st({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a,
|
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/components/form/selectOptionColors.jsx
|
|
249
|
-
var
|
|
250
|
-
function
|
|
249
|
+
var lt = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
250
|
+
function ut(e, t = [], n) {
|
|
251
251
|
let r = Array.isArray(e?.optionColors) ? e.optionColors : [], i = n && typeof n == "object" ? n.value : n, a = (e) => String(e ?? "").trim().toLowerCase(), o = [i, t.find((e) => a(e.value) === a(i))?.label], s = r.find((e) => o.some((t) => t != null && a(e.value) === a(t))), c = {};
|
|
252
|
-
return
|
|
252
|
+
return lt.test(s?.backgroundColor ?? "") && (c.backgroundColor = s.backgroundColor), lt.test(s?.textColor ?? "") && (c.color = s.textColor, c.WebkitTextFillColor = s.textColor), c;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function dt(e, t = [], n) {
|
|
255
255
|
if (!(Array.isArray(e?.optionColors) ? e.optionColors : []).length) return {};
|
|
256
|
-
let r = (n) =>
|
|
256
|
+
let r = (n) => ut(e, t, n), i = (e, n) => n ?? t.find((t) => String(t.value) === String(e))?.label ?? e, a = (e, t) => {
|
|
257
257
|
let n = r(e), a = i(e, t);
|
|
258
258
|
return Object.keys(n).length ? /* @__PURE__ */ O("span", {
|
|
259
259
|
style: {
|
|
@@ -288,13 +288,13 @@ function ut(e, t = [], n) {
|
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/components/TipTapEditor.jsx
|
|
291
|
-
var
|
|
291
|
+
var ft = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?)__$/s, "$1"), pt = (e = []) => e.length > 0 && e.every((e) => /^:?-{3,}:?$/.test(String(e).trim())), mt = (e = "") => {
|
|
292
292
|
let t = String(e || "").replace(/\r\n?/g, "\n").trim();
|
|
293
293
|
if (!t) return null;
|
|
294
294
|
let n = t.split("\n").filter((e) => e.trim().length > 0);
|
|
295
295
|
if (n.length < 2) return null;
|
|
296
296
|
if (n.some((e) => e.includes(" "))) {
|
|
297
|
-
let e = n.map((e) => e.split(" ").map(
|
|
297
|
+
let e = n.map((e) => e.split(" ").map(ft)), t = Math.max(...e.map((e) => e.length));
|
|
298
298
|
return t < 2 ? null : {
|
|
299
299
|
rows: e.map((e) => [...e, ...Array(t - e.length).fill("")]),
|
|
300
300
|
hasHeaderRow: !0
|
|
@@ -302,15 +302,15 @@ var dt = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?
|
|
|
302
302
|
}
|
|
303
303
|
let r = n.filter((e) => e.includes("|")).map((e) => {
|
|
304
304
|
let t = e.trim();
|
|
305
|
-
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(
|
|
305
|
+
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(ft);
|
|
306
306
|
});
|
|
307
307
|
if (r.length < 2) return null;
|
|
308
|
-
let i = r.findIndex(
|
|
308
|
+
let i = r.findIndex(pt), a = r.filter((e, t) => t !== i), o = Math.max(...a.map((e) => e.length));
|
|
309
309
|
return a.length < 2 || o < 2 ? null : {
|
|
310
310
|
rows: a.map((e) => [...e, ...Array(o - e.length).fill("")]),
|
|
311
311
|
hasHeaderRow: i === 1
|
|
312
312
|
};
|
|
313
|
-
},
|
|
313
|
+
}, ht = (e, t, n) => {
|
|
314
314
|
let { table: r, tableRow: i, tableHeader: a, tableCell: o, paragraph: s } = e.nodes;
|
|
315
315
|
if (!r || !i || !o || !s) return null;
|
|
316
316
|
let c = t.map((t, r) => {
|
|
@@ -334,7 +334,7 @@ function F({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
|
334
334
|
children: i
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function gt({ editor: e, disabled: t }) {
|
|
338
338
|
return e ? /* @__PURE__ */ k("div", {
|
|
339
339
|
className: `tte-toolbar${t ? " tte-toolbar--disabled" : ""}`,
|
|
340
340
|
children: [
|
|
@@ -474,31 +474,31 @@ function ht({ editor: e, disabled: t }) {
|
|
|
474
474
|
]
|
|
475
475
|
}) : null;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
let i = ge(e ?? ""), a =
|
|
477
|
+
function _t({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = "" }) {
|
|
478
|
+
let i = ge(e ?? ""), a = He({
|
|
479
479
|
extensions: [
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
Ue,
|
|
481
|
+
Ge,
|
|
482
|
+
We.configure({
|
|
483
483
|
openOnClick: !1,
|
|
484
484
|
HTMLAttributes: { rel: "noopener noreferrer" }
|
|
485
485
|
}),
|
|
486
|
-
|
|
486
|
+
Ke.configure({
|
|
487
487
|
resizable: !0,
|
|
488
488
|
HTMLAttributes: { class: "email-template-table" }
|
|
489
489
|
}),
|
|
490
|
+
Ye,
|
|
490
491
|
Je,
|
|
491
|
-
qe
|
|
492
|
-
Ke
|
|
492
|
+
qe
|
|
493
493
|
],
|
|
494
494
|
content: e,
|
|
495
495
|
editable: !n,
|
|
496
496
|
editorProps: {
|
|
497
497
|
attributes: { class: "tte-content" },
|
|
498
498
|
handlePaste: (e, t) => {
|
|
499
|
-
let n =
|
|
499
|
+
let n = mt(t.clipboardData?.getData("text/plain") || "");
|
|
500
500
|
if (!n) return !1;
|
|
501
|
-
let r =
|
|
501
|
+
let r = ht(e.state.schema, n.rows, n.hasHeaderRow);
|
|
502
502
|
if (!r) return !1;
|
|
503
503
|
t.preventDefault();
|
|
504
504
|
let i = e.state.tr.replaceSelectionWith(r, !1).scrollIntoView();
|
|
@@ -519,11 +519,11 @@ function gt({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
519
519
|
}, [n, a]), /* @__PURE__ */ k("div", {
|
|
520
520
|
className: `tte-wrapper${n ? " tte-wrapper--disabled" : ""}`,
|
|
521
521
|
children: [
|
|
522
|
-
/* @__PURE__ */ O(
|
|
522
|
+
/* @__PURE__ */ O(gt, {
|
|
523
523
|
editor: a,
|
|
524
524
|
disabled: n
|
|
525
525
|
}),
|
|
526
|
-
/* @__PURE__ */ O(
|
|
526
|
+
/* @__PURE__ */ O(Ve, { editor: a }),
|
|
527
527
|
!e && !a?.isFocused && r && /* @__PURE__ */ O("div", {
|
|
528
528
|
className: "tte-placeholder",
|
|
529
529
|
children: r
|
|
@@ -533,68 +533,68 @@ function gt({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
533
533
|
}
|
|
534
534
|
//#endregion
|
|
535
535
|
//#region src/components/form/optionsApi.js
|
|
536
|
-
var
|
|
537
|
-
function
|
|
536
|
+
var vt = /\{([A-Za-z0-9_.]+)\}/g, yt = (e) => e == null || e === "" || e === "_";
|
|
537
|
+
function bt(e) {
|
|
538
538
|
return !!(e && typeof e.path == "string" && e.path.trim());
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
if (!
|
|
540
|
+
function xt(e, t, n = {}) {
|
|
541
|
+
if (!bt(e)) return null;
|
|
542
542
|
let r = n[String(e.service || "core").toLowerCase()];
|
|
543
543
|
if (!r) return null;
|
|
544
|
-
let i = !1, a = e.path.trim().replace(
|
|
544
|
+
let i = !1, a = e.path.trim().replace(vt, (e, n) => {
|
|
545
545
|
let r = typeof t == "function" ? t(n) : void 0;
|
|
546
|
-
return
|
|
546
|
+
return yt(r) ? (i = !0, "") : encodeURIComponent(String(r));
|
|
547
547
|
});
|
|
548
548
|
return i ? null : {
|
|
549
549
|
base: r,
|
|
550
550
|
path: a.startsWith("/") ? a : `/${a}`
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function St(e, t) {
|
|
554
554
|
let n = e && typeof e == "object" && "data" in e ? e.data : e;
|
|
555
555
|
return String(t || "").split(".").filter(Boolean).forEach((e) => {
|
|
556
556
|
n = n == null ? n : n[e];
|
|
557
557
|
}), Array.isArray(n) ? n : [];
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Ct({ routeParams: e = {}, searchParams: t, getFormValue: n } = {}) {
|
|
560
560
|
return (r) => {
|
|
561
|
-
if (!
|
|
561
|
+
if (!yt(e[r])) return e[r];
|
|
562
562
|
let i = t?.get ? t.get(r) : void 0;
|
|
563
|
-
return
|
|
563
|
+
return yt(i) ? typeof n == "function" ? n(r) : void 0 : i;
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
566
|
//#endregion
|
|
567
567
|
//#region src/services/detailedViewApi.js
|
|
568
|
-
var
|
|
568
|
+
var wt = {
|
|
569
569
|
job: { fetchUrl: (e) => `${t}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
570
570
|
candidate: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` },
|
|
571
571
|
candidates: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` },
|
|
572
572
|
submission: { fetchUrl: (e) => `${n}/edit/detailed-view?_id=${encodeURIComponent(e)}` }
|
|
573
573
|
};
|
|
574
|
-
async function
|
|
574
|
+
async function Tt(e, t) {
|
|
575
575
|
let n = String(e ?? "").trim().toLowerCase();
|
|
576
576
|
if (n === "job" || n === "jobs") {
|
|
577
577
|
let { getJobDetailView: e } = await import("./jobsApi-BWnuOB-d.js").then((e) => e.n);
|
|
578
578
|
return e(t);
|
|
579
579
|
}
|
|
580
|
-
if (n === "candidate" || n === "candidates") return
|
|
580
|
+
if (n === "candidate" || n === "candidates") return Dt(n === "candidate" ? "candidate" : "candidates", t);
|
|
581
581
|
let i = new URLSearchParams({
|
|
582
582
|
module: String(e ?? ""),
|
|
583
583
|
id: String(t)
|
|
584
584
|
});
|
|
585
585
|
return o(r, `/module-data-detail?${i.toString()}`);
|
|
586
586
|
}
|
|
587
|
-
async function
|
|
587
|
+
async function Et(e) {
|
|
588
588
|
let t = await o(r, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
589
589
|
return {
|
|
590
590
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
591
591
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
async function
|
|
594
|
+
async function Dt(e, t) {
|
|
595
595
|
if (!e) throw Error("module is required");
|
|
596
596
|
if (!t) throw Error("id is required");
|
|
597
|
-
let n =
|
|
597
|
+
let n = wt[e];
|
|
598
598
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
599
599
|
let r = await i(), a = await fetch(n.fetchUrl(t), {
|
|
600
600
|
method: "GET",
|
|
@@ -607,7 +607,7 @@ async function Et(e, t) {
|
|
|
607
607
|
let o = await a.json();
|
|
608
608
|
return o.data ?? o;
|
|
609
609
|
}
|
|
610
|
-
async function
|
|
610
|
+
async function Ot(e, t, n, a = []) {
|
|
611
611
|
if (!e) throw Error("module is required");
|
|
612
612
|
if (!t) throw Error("id is required");
|
|
613
613
|
let o = await i(), s = new FormData();
|
|
@@ -626,15 +626,15 @@ async function Dt(e, t, n, a = []) {
|
|
|
626
626
|
if (!c.ok) {
|
|
627
627
|
let e = await c.text();
|
|
628
628
|
console.error("[updateRecord] Error response:", e);
|
|
629
|
-
let t = Error(
|
|
630
|
-
throw t.status = c.status, t.response =
|
|
629
|
+
let t = Error(At(e) || `API ${c.status}: ${c.statusText}`);
|
|
630
|
+
throw t.status = c.status, t.response = kt(e), t;
|
|
631
631
|
}
|
|
632
632
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
633
633
|
l();
|
|
634
634
|
let u = await c.json();
|
|
635
635
|
return u.data ?? u;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function kt(e) {
|
|
638
638
|
let t = String(e ?? "").trim();
|
|
639
639
|
if (!t.startsWith("{")) return null;
|
|
640
640
|
try {
|
|
@@ -643,7 +643,7 @@ function Ot(e) {
|
|
|
643
643
|
return null;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function At(e) {
|
|
647
647
|
let t = String(e ?? "").trim();
|
|
648
648
|
if (!t.startsWith("{")) return t;
|
|
649
649
|
try {
|
|
@@ -653,22 +653,22 @@ function kt(e) {
|
|
|
653
653
|
return t;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
var
|
|
657
|
-
async function
|
|
656
|
+
var jt = (e) => e?.data ?? e;
|
|
657
|
+
async function Mt(e, t) {
|
|
658
658
|
if (!e || !t) return [];
|
|
659
659
|
let n = new URLSearchParams({
|
|
660
660
|
module: e,
|
|
661
661
|
id: String(t)
|
|
662
|
-
}), i =
|
|
662
|
+
}), i = jt(await o(r, `/module-activity?${n.toString()}`));
|
|
663
663
|
return Array.isArray(i) ? i : [];
|
|
664
664
|
}
|
|
665
|
-
async function
|
|
665
|
+
async function Nt(e) {
|
|
666
666
|
if (!e) return [];
|
|
667
|
-
let t =
|
|
667
|
+
let t = jt(await o(r, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
668
668
|
return Array.isArray(t) ? t : [];
|
|
669
669
|
}
|
|
670
|
-
async function
|
|
671
|
-
return
|
|
670
|
+
async function Pt({ relatedId: e, notes: t, title: n, notesFor: i }) {
|
|
671
|
+
return jt(await o(r, "/notes", {
|
|
672
672
|
method: "POST",
|
|
673
673
|
body: JSON.stringify({
|
|
674
674
|
relatedId: e,
|
|
@@ -680,29 +680,29 @@ async function Nt({ relatedId: e, notes: t, title: n, notesFor: i }) {
|
|
|
680
680
|
}
|
|
681
681
|
//#endregion
|
|
682
682
|
//#region src/components/form/formDateInputFormat.js
|
|
683
|
-
var
|
|
684
|
-
function
|
|
683
|
+
var Ft = pe(void 0);
|
|
684
|
+
function It(e, t) {
|
|
685
685
|
return (typeof e == "string" ? e.trim() : "") || ee(t) || se();
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
let e = he(
|
|
689
|
-
return
|
|
687
|
+
function Lt() {
|
|
688
|
+
let e = he(Ft);
|
|
689
|
+
return It(e?.override, e?.moduleName);
|
|
690
690
|
}
|
|
691
691
|
//#endregion
|
|
692
692
|
//#region src/utils/roleFormPermissionGate.js
|
|
693
|
-
function
|
|
693
|
+
function Rt(e, t) {
|
|
694
694
|
if (!e) return !0;
|
|
695
695
|
let n = e.find((e) => e.name === t);
|
|
696
696
|
return !n || n.enabled !== !1;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function zt(e, t, n) {
|
|
699
699
|
if (!e) return !0;
|
|
700
700
|
let r = e.find((e) => e.name === t);
|
|
701
701
|
if (!r) return !0;
|
|
702
702
|
let i = r.fields?.find((e) => e.field === n);
|
|
703
703
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Bt(e, t, n) {
|
|
706
706
|
if (!e) return !0;
|
|
707
707
|
let r = e.find((e) => e.name === t);
|
|
708
708
|
if (!r) return !0;
|
|
@@ -712,12 +712,12 @@ function zt(e, t, n) {
|
|
|
712
712
|
}
|
|
713
713
|
//#endregion
|
|
714
714
|
//#region src/components/form/linkedAddRowGroups.js
|
|
715
|
-
var
|
|
716
|
-
function
|
|
715
|
+
var Vt = (e) => e === !0 || e === 1 || e === "1";
|
|
716
|
+
function Ht(e = []) {
|
|
717
717
|
let t = /* @__PURE__ */ new Map();
|
|
718
718
|
e.forEach((e) => {
|
|
719
719
|
let n = e?.linkGroup;
|
|
720
|
-
!
|
|
720
|
+
!Vt(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
721
721
|
});
|
|
722
722
|
let n = /* @__PURE__ */ new Map();
|
|
723
723
|
return t.forEach((e, t) => {
|
|
@@ -727,11 +727,11 @@ function Vt(e = []) {
|
|
|
727
727
|
});
|
|
728
728
|
}), n;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function Ut(e, t) {
|
|
731
731
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
732
732
|
return null;
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Wt(e, t = {}) {
|
|
735
735
|
let n = { ...t };
|
|
736
736
|
return e.forEach(({ memberNames: e }) => {
|
|
737
737
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -744,9 +744,13 @@ function Ut(e, t = {}) {
|
|
|
744
744
|
//#endregion
|
|
745
745
|
//#region src/components/form/formDecisionDialog.jsx
|
|
746
746
|
var I = {
|
|
747
|
+
information: {
|
|
748
|
+
className: "fdd-tone-blue",
|
|
749
|
+
Icon: Le
|
|
750
|
+
},
|
|
747
751
|
duplicate: {
|
|
748
752
|
className: "fdd-tone-amber",
|
|
749
|
-
Icon:
|
|
753
|
+
Icon: ze
|
|
750
754
|
},
|
|
751
755
|
overwrite: {
|
|
752
756
|
className: "fdd-tone-amber",
|
|
@@ -761,18 +765,18 @@ var I = {
|
|
|
761
765
|
Icon: Pe
|
|
762
766
|
}
|
|
763
767
|
};
|
|
764
|
-
function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c, renderExtra: l } = {}) {
|
|
765
|
-
let { className:
|
|
768
|
+
function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c, renderExtra: l, className: u = "", width: d, closable: f = !1 } = {}) {
|
|
769
|
+
let { className: p, Icon: m } = I[e] ?? I.suggestion, h = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
766
770
|
return new Promise((e) => {
|
|
767
|
-
let r = !1,
|
|
771
|
+
let r = !1, g = (t) => {
|
|
768
772
|
r || (r = !0, e(t));
|
|
769
|
-
},
|
|
773
|
+
}, _ = T.confirm({
|
|
770
774
|
...c ? { footer: (e, { OkBtn: t, CancelBtn: n }) => /* @__PURE__ */ k(D, { children: [
|
|
771
775
|
/* @__PURE__ */ O(be, {
|
|
772
776
|
size: "large",
|
|
773
777
|
className: "fdd-alt-btn",
|
|
774
778
|
onClick: () => {
|
|
775
|
-
|
|
779
|
+
g("alt"), _.destroy();
|
|
776
780
|
},
|
|
777
781
|
children: c
|
|
778
782
|
}),
|
|
@@ -781,8 +785,9 @@ function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i
|
|
|
781
785
|
] }) } : {},
|
|
782
786
|
icon: null,
|
|
783
787
|
centered: !0,
|
|
784
|
-
|
|
785
|
-
|
|
788
|
+
closable: f,
|
|
789
|
+
width: d ?? (c ? 600 : 480),
|
|
790
|
+
className: `fdd-modal ${p}${c ? " fdd-modal--three" : ""} ${u}`,
|
|
786
791
|
okText: i,
|
|
787
792
|
cancelText: a,
|
|
788
793
|
okButtonProps: {
|
|
@@ -798,15 +803,15 @@ function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i
|
|
|
798
803
|
children: [/* @__PURE__ */ O("span", {
|
|
799
804
|
className: "fdd-icon",
|
|
800
805
|
"aria-hidden": "true",
|
|
801
|
-
children: /* @__PURE__ */ O(
|
|
806
|
+
children: /* @__PURE__ */ O(m, {})
|
|
802
807
|
}), /* @__PURE__ */ O("h3", {
|
|
803
808
|
className: "fdd-title",
|
|
804
809
|
children: t
|
|
805
810
|
})]
|
|
806
811
|
}),
|
|
807
|
-
|
|
812
|
+
h.length > 0 && /* @__PURE__ */ O("dl", {
|
|
808
813
|
className: "fdd-facts",
|
|
809
|
-
children:
|
|
814
|
+
children: h.map((e) => /* @__PURE__ */ k("div", {
|
|
810
815
|
className: "fdd-fact",
|
|
811
816
|
children: [/* @__PURE__ */ O("dt", { children: e.label }), /* @__PURE__ */ O("dd", { children: e.value })]
|
|
812
817
|
}, e.label))
|
|
@@ -816,7 +821,7 @@ function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i
|
|
|
816
821
|
children: n
|
|
817
822
|
}),
|
|
818
823
|
l?.(() => {
|
|
819
|
-
|
|
824
|
+
g(!0), _.destroy();
|
|
820
825
|
}),
|
|
821
826
|
s && /* @__PURE__ */ O("p", {
|
|
822
827
|
className: "fdd-footnote",
|
|
@@ -824,12 +829,12 @@ function L({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i
|
|
|
824
829
|
})
|
|
825
830
|
]
|
|
826
831
|
}),
|
|
827
|
-
onOk: () =>
|
|
828
|
-
onCancel: () =>
|
|
832
|
+
onOk: () => g(!0),
|
|
833
|
+
onCancel: () => g(!1)
|
|
829
834
|
});
|
|
830
835
|
});
|
|
831
836
|
}
|
|
832
|
-
function
|
|
837
|
+
function Gt({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back", renderExtra: a } = {}) {
|
|
833
838
|
let { className: o, Icon: s } = I[e] ?? I.suggestion, c = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
834
839
|
return new Promise((e) => {
|
|
835
840
|
let r = T.warning({
|
|
@@ -875,7 +880,7 @@ function Wt({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
875
880
|
}
|
|
876
881
|
//#endregion
|
|
877
882
|
//#region src/services/aiActionApi.js
|
|
878
|
-
async function
|
|
883
|
+
async function Kt({ module: e, group: t, field: n, actionKey: a, inputs: o = {}, files: s = {} }) {
|
|
879
884
|
if (!e || !t || !n || !a) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
880
885
|
let c = await i(), l = new FormData();
|
|
881
886
|
l.append("json", JSON.stringify({ inputs: o })), Object.entries(s).forEach(([e, t]) => {
|
|
@@ -901,12 +906,12 @@ async function Gt({ module: e, group: t, field: n, actionKey: a, inputs: o = {},
|
|
|
901
906
|
}
|
|
902
907
|
//#endregion
|
|
903
908
|
//#region src/components/form/applyGroupValues.js
|
|
904
|
-
var
|
|
905
|
-
function
|
|
909
|
+
var qt = (e) => e === !0 || e === 1 || e === "1", Jt = (e) => e == null || e === "";
|
|
910
|
+
function Yt(e) {
|
|
906
911
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
907
912
|
}
|
|
908
913
|
function R(e, t, n) {
|
|
909
|
-
let r = Array.isArray(t) ? t :
|
|
914
|
+
let r = Array.isArray(t) ? t : Yt(t);
|
|
910
915
|
if (!r.length) return e;
|
|
911
916
|
let i = e;
|
|
912
917
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -919,19 +924,19 @@ function z(e, t = []) {
|
|
|
919
924
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
920
925
|
if (!n) continue;
|
|
921
926
|
let t = s(e, n);
|
|
922
|
-
if (!
|
|
927
|
+
if (!Jt(t)) return t;
|
|
923
928
|
}
|
|
924
929
|
}
|
|
925
930
|
function B(e, t) {
|
|
926
931
|
if (!e || typeof e != "object") return;
|
|
927
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
932
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Jt(n));
|
|
928
933
|
if (r) return r[1];
|
|
929
934
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
930
935
|
let n = B(e, t);
|
|
931
|
-
if (!
|
|
936
|
+
if (!Jt(n)) return n;
|
|
932
937
|
}
|
|
933
938
|
}
|
|
934
|
-
function
|
|
939
|
+
function Xt(e, t) {
|
|
935
940
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
936
941
|
if (!n.length) return;
|
|
937
942
|
let r = n.map((e, n) => {
|
|
@@ -955,7 +960,7 @@ function Yt(e, t) {
|
|
|
955
960
|
}).filter(Boolean);
|
|
956
961
|
return r.length ? r : void 0;
|
|
957
962
|
}
|
|
958
|
-
function
|
|
963
|
+
function Zt(e, t) {
|
|
959
964
|
if (!e || typeof e != "object") return;
|
|
960
965
|
let n = z(e, [t.fileNameKey, t.field]) ?? B(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = z(e, [t.fileUrlKey, t.locationKey]) ?? B(e, /(location|url|path)$/i) ?? "";
|
|
961
966
|
if (!n && !r) return;
|
|
@@ -968,7 +973,7 @@ function Xt(e, t) {
|
|
|
968
973
|
url: i || void 0
|
|
969
974
|
}];
|
|
970
975
|
}
|
|
971
|
-
function
|
|
976
|
+
function Qt(e, t, n, r) {
|
|
972
977
|
(e.fields ?? []).forEach((e) => {
|
|
973
978
|
e?.verifyAction && [
|
|
974
979
|
e.verifyResultField,
|
|
@@ -981,7 +986,7 @@ function Zt(e, t, n, r) {
|
|
|
981
986
|
});
|
|
982
987
|
});
|
|
983
988
|
}
|
|
984
|
-
function
|
|
989
|
+
function $t(e) {
|
|
985
990
|
let t = Array.isArray(e.rows) ? te(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
986
991
|
let i = {};
|
|
987
992
|
return (e.fields ?? []).forEach((e) => {
|
|
@@ -997,26 +1002,26 @@ function Qt(e) {
|
|
|
997
1002
|
t !== void 0 && R(i, e.field, t);
|
|
998
1003
|
return;
|
|
999
1004
|
}
|
|
1000
|
-
R(i, e.field,
|
|
1001
|
-
}),
|
|
1005
|
+
R(i, e.field, qt(e.addRow) ? u(e, a) : ce(e, a));
|
|
1006
|
+
}), Qt(e, t, i, r), i;
|
|
1002
1007
|
}, i = p(e, { editing: !0 });
|
|
1003
1008
|
if (t && t.length > 0) {
|
|
1004
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
1009
|
+
let e = t.map((e) => r(e, (e, t) => Zt(e, t), (e, t) => s(e, t.field)));
|
|
1005
1010
|
for (; e.length < n;) e.push({ ...i });
|
|
1006
1011
|
return e;
|
|
1007
1012
|
}
|
|
1008
|
-
let a = r(e, (e, t) =>
|
|
1013
|
+
let a = r(e, (e, t) => Xt(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
1009
1014
|
for (; o.length < n;) o.push({ ...i });
|
|
1010
1015
|
return o;
|
|
1011
1016
|
}
|
|
1012
|
-
function
|
|
1017
|
+
function en(e, t = []) {
|
|
1013
1018
|
let n = {};
|
|
1014
1019
|
return t.forEach((e) => {
|
|
1015
1020
|
e.toggleEnabled && e.toggleField && R(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
1016
1021
|
if (!e.field || e.addRow) return;
|
|
1017
1022
|
let t = e.value, r = e.field;
|
|
1018
1023
|
if (e.type === "file") {
|
|
1019
|
-
let i =
|
|
1024
|
+
let i = Xt(t, e);
|
|
1020
1025
|
i && R(n, r, i);
|
|
1021
1026
|
return;
|
|
1022
1027
|
}
|
|
@@ -1041,27 +1046,27 @@ function $t(e, t = []) {
|
|
|
1041
1046
|
}
|
|
1042
1047
|
//#endregion
|
|
1043
1048
|
//#region src/components/form/useAiActions.js
|
|
1044
|
-
function
|
|
1049
|
+
function tn(e) {
|
|
1045
1050
|
let t = document.createElement("div");
|
|
1046
1051
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return t && t === "stripHtml" ?
|
|
1053
|
+
function nn(e, t) {
|
|
1054
|
+
return t && t === "stripHtml" ? tn(e) : e;
|
|
1050
1055
|
}
|
|
1051
|
-
function
|
|
1056
|
+
function rn(e) {
|
|
1052
1057
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
1053
1058
|
}
|
|
1054
1059
|
function V(e) {
|
|
1055
1060
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
1056
1061
|
}
|
|
1057
|
-
function
|
|
1062
|
+
function an(e, t) {
|
|
1058
1063
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
1059
|
-
let n =
|
|
1064
|
+
let n = nn(t, e.transform), r = String(n ?? "").trim();
|
|
1060
1065
|
if (!r) return !1;
|
|
1061
1066
|
let i = Number(e.minWords) || 0;
|
|
1062
|
-
return i > 0 ?
|
|
1067
|
+
return i > 0 ? rn(r) >= i : !0;
|
|
1063
1068
|
}
|
|
1064
|
-
function
|
|
1069
|
+
function on(e) {
|
|
1065
1070
|
let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
1066
1071
|
if (!(!e || typeof e != "object" || n.has(e))) {
|
|
1067
1072
|
if (n.add(e), Array.isArray(e)) {
|
|
@@ -1075,7 +1080,7 @@ function an(e) {
|
|
|
1075
1080
|
};
|
|
1076
1081
|
return r(e), t;
|
|
1077
1082
|
}
|
|
1078
|
-
function
|
|
1083
|
+
function sn(e, t) {
|
|
1079
1084
|
let n = e.inputs || [];
|
|
1080
1085
|
if (n.length === 0) return !0;
|
|
1081
1086
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -1083,10 +1088,10 @@ function on(e, t) {
|
|
|
1083
1088
|
let n = e.group || `__solo_${t}`;
|
|
1084
1089
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
1085
1090
|
});
|
|
1086
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
1091
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => an(e, t(e.sourceField)))) return !1;
|
|
1087
1092
|
return !0;
|
|
1088
1093
|
}
|
|
1089
|
-
function
|
|
1094
|
+
function cn(e = []) {
|
|
1090
1095
|
let t = [];
|
|
1091
1096
|
return e.forEach((e) => {
|
|
1092
1097
|
if (e?.addRow) {
|
|
@@ -1099,13 +1104,13 @@ function sn(e = []) {
|
|
|
1099
1104
|
});
|
|
1100
1105
|
}), t;
|
|
1101
1106
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1107
|
+
function ln(e, t) {
|
|
1108
|
+
return cn(t).some((t) => {
|
|
1104
1109
|
let n = e.getFieldValue(t);
|
|
1105
1110
|
return Array.isArray(n) ? n.some(V) : n != null && n !== "";
|
|
1106
1111
|
});
|
|
1107
1112
|
}
|
|
1108
|
-
function
|
|
1113
|
+
function un(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
1109
1114
|
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;
|
|
1110
1115
|
return Object.entries(r).forEach(([e, t]) => {
|
|
1111
1116
|
if (!(i.has(e) || !a(e) || !H(t))) {
|
|
@@ -1120,11 +1125,11 @@ function ln(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
|
1120
1125
|
function H(e) {
|
|
1121
1126
|
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? V(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
1122
1127
|
}
|
|
1123
|
-
function
|
|
1128
|
+
function dn(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
1124
1129
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
1125
1130
|
return n ? a.some((e) => H(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && H(r[t])) : a.some((e) => H(r[e]));
|
|
1126
1131
|
}
|
|
1127
|
-
function
|
|
1132
|
+
function fn(e = []) {
|
|
1128
1133
|
let t = {};
|
|
1129
1134
|
return (e ?? []).forEach((e) => {
|
|
1130
1135
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -1135,30 +1140,30 @@ function dn(e = []) {
|
|
|
1135
1140
|
});
|
|
1136
1141
|
}), t;
|
|
1137
1142
|
}
|
|
1138
|
-
function
|
|
1143
|
+
function pn(e, t, n) {
|
|
1139
1144
|
let r = e?.confirmWhen ?? "never";
|
|
1140
|
-
return r === "never" ? !1 : r === "always" ||
|
|
1145
|
+
return r === "never" ? !1 : r === "always" || ln(t, n);
|
|
1141
1146
|
}
|
|
1142
|
-
var
|
|
1147
|
+
var mn = [
|
|
1143
1148
|
"top-left",
|
|
1144
1149
|
"top-center",
|
|
1145
1150
|
"top-right",
|
|
1146
1151
|
"bottom-left",
|
|
1147
1152
|
"bottom-center",
|
|
1148
1153
|
"bottom-right"
|
|
1149
|
-
],
|
|
1150
|
-
function
|
|
1154
|
+
], hn = "bottom-left";
|
|
1155
|
+
function gn(e = []) {
|
|
1151
1156
|
let t = {};
|
|
1152
1157
|
return e.forEach((e) => {
|
|
1153
|
-
let n =
|
|
1158
|
+
let n = mn.includes(e.position) ? e.position : hn;
|
|
1154
1159
|
(t[n] ??= []).push(e);
|
|
1155
1160
|
}), t;
|
|
1156
1161
|
}
|
|
1157
|
-
function
|
|
1158
|
-
let [s, c] = w(null), [l, u] = w(""), d = C(() =>
|
|
1159
|
-
if (!o) return
|
|
1162
|
+
function _n({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1, watchSourcesOnly: o = !1 }) {
|
|
1163
|
+
let [s, c] = w(null), [l, u] = w(""), d = C(() => on(t), [t]), f = Se.useWatch((e) => o ? d.map((t) => sn(t, (t) => e?.[t]) ? "1" : "0").join("") : e, e), p = me((t) => {
|
|
1164
|
+
if (!o) return sn(t, (e) => (f || {})[e]);
|
|
1160
1165
|
let n = d.indexOf(t);
|
|
1161
|
-
return n >= 0 ? String(f ?? "")[n] === "1" :
|
|
1166
|
+
return n >= 0 ? String(f ?? "")[n] === "1" : sn(t, (t) => (e.getFieldsValue() || {})[t]);
|
|
1162
1167
|
}, [
|
|
1163
1168
|
f,
|
|
1164
1169
|
o,
|
|
@@ -1166,10 +1171,10 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1166
1171
|
e
|
|
1167
1172
|
]), m = me((t) => {
|
|
1168
1173
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
1169
|
-
let n =
|
|
1174
|
+
let n = en(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
1170
1175
|
return t.forEach((t) => {
|
|
1171
1176
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
1172
|
-
let n =
|
|
1177
|
+
let n = $t(t);
|
|
1173
1178
|
if (n.length === 0) return;
|
|
1174
1179
|
r = !0;
|
|
1175
1180
|
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(V);
|
|
@@ -1205,8 +1210,8 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1205
1210
|
return {
|
|
1206
1211
|
runAction: me(async (t, o, s, l) => {
|
|
1207
1212
|
let d = s?.confirmWhen ?? "never";
|
|
1208
|
-
if (s?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
1209
|
-
let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
1213
|
+
if (s?.trigger === "upload" && d !== "never" && (d === "always" || dn(e, [o?.field], { includeUntouched: a }))) {
|
|
1214
|
+
let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = un(e, [o?.field], { includeUntouched: a });
|
|
1210
1215
|
if (!await L({
|
|
1211
1216
|
tone: "overwrite",
|
|
1212
1217
|
title: t.title || "Read this file and fill the form in?",
|
|
@@ -1231,12 +1236,12 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1231
1236
|
r && (c[t.param] = r);
|
|
1232
1237
|
} else {
|
|
1233
1238
|
let n = e.getFieldValue(t.sourceField);
|
|
1234
|
-
n != null && n !== "" && (a[t.param] =
|
|
1239
|
+
n != null && n !== "" && (a[t.param] = nn(n, t.transform));
|
|
1235
1240
|
}
|
|
1236
1241
|
}), (s.inputs || []).forEach((e) => {
|
|
1237
1242
|
!e.group || e.kind !== "text" || (s.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete a[e.param];
|
|
1238
1243
|
});
|
|
1239
|
-
let u = await
|
|
1244
|
+
let u = await Kt({
|
|
1240
1245
|
module: n,
|
|
1241
1246
|
group: t,
|
|
1242
1247
|
field: o.field,
|
|
@@ -1244,8 +1249,8 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1244
1249
|
inputs: a,
|
|
1245
1250
|
files: c
|
|
1246
1251
|
}), d = s.label || "AI action", f = u?.groups;
|
|
1247
|
-
if (s?.trigger !== "upload" &&
|
|
1248
|
-
let e = s.confirmMessages ?? {}, t =
|
|
1252
|
+
if (s?.trigger !== "upload" && pn(s, e, f)) {
|
|
1253
|
+
let e = s.confirmMessages ?? {}, t = cn(f).length;
|
|
1249
1254
|
if (!await L({
|
|
1250
1255
|
tone: "overwrite",
|
|
1251
1256
|
title: e.title || `Fill the form in from ${d}?`,
|
|
@@ -1267,7 +1272,7 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1267
1272
|
field: o,
|
|
1268
1273
|
groupName: t,
|
|
1269
1274
|
responseGroups: f,
|
|
1270
|
-
payload:
|
|
1275
|
+
payload: fn(f)
|
|
1271
1276
|
});
|
|
1272
1277
|
if (e === !1 || e === "abort") return u;
|
|
1273
1278
|
}
|
|
@@ -1299,7 +1304,7 @@ function gn({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
1299
1304
|
}
|
|
1300
1305
|
//#endregion
|
|
1301
1306
|
//#region src/components/form/AiActionButtons.jsx
|
|
1302
|
-
function
|
|
1307
|
+
function vn({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
1303
1308
|
if (!t || t.length === 0) return null;
|
|
1304
1309
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
1305
1310
|
return /* @__PURE__ */ O(Ce, {
|
|
@@ -1320,18 +1325,18 @@ function _n({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
1320
1325
|
}
|
|
1321
1326
|
//#endregion
|
|
1322
1327
|
//#region src/components/form/emailValidator.js
|
|
1323
|
-
function
|
|
1328
|
+
function yn(e) {
|
|
1324
1329
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
1325
1330
|
if (!n) return !1;
|
|
1326
1331
|
let [, r, i] = n;
|
|
1327
1332
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
1328
1333
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
1334
|
+
function bn(e = "Email", t) {
|
|
1335
|
+
return { validator: (n, r) => r == null || r === "" || yn(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
1331
1336
|
}
|
|
1332
1337
|
//#endregion
|
|
1333
1338
|
//#region src/components/form/inputValidator.js
|
|
1334
|
-
var
|
|
1339
|
+
var xn = [
|
|
1335
1340
|
{
|
|
1336
1341
|
label: "Only Numbers",
|
|
1337
1342
|
value: "onlyNumber"
|
|
@@ -1404,7 +1409,7 @@ var bn = [
|
|
|
1404
1409
|
label: "Website URL",
|
|
1405
1410
|
value: "websiteUrl"
|
|
1406
1411
|
}
|
|
1407
|
-
],
|
|
1412
|
+
], Sn = {
|
|
1408
1413
|
onlyNumber: /^[0-9]$/,
|
|
1409
1414
|
experience: /^[0-9]$/,
|
|
1410
1415
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -1420,10 +1425,10 @@ var bn = [
|
|
|
1420
1425
|
decimalRange: /^[0-9.]$/,
|
|
1421
1426
|
contactNumber: /^[0-9()\-+\s]$/
|
|
1422
1427
|
};
|
|
1423
|
-
function
|
|
1424
|
-
return
|
|
1428
|
+
function Cn(e) {
|
|
1429
|
+
return Sn[e] ?? null;
|
|
1425
1430
|
}
|
|
1426
|
-
function
|
|
1431
|
+
function wn(e, t = {}, n = "change") {
|
|
1427
1432
|
if (!t?.type || e == null) return {
|
|
1428
1433
|
cleaned: e ?? "",
|
|
1429
1434
|
error: null
|
|
@@ -1506,7 +1511,7 @@ function Cn(e, t = {}, n = "change") {
|
|
|
1506
1511
|
break;
|
|
1507
1512
|
}
|
|
1508
1513
|
case "email":
|
|
1509
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
1514
|
+
c = n === "blur" ? r.trim() : r, c && !yn(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
1510
1515
|
break;
|
|
1511
1516
|
case "websiteUrl":
|
|
1512
1517
|
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.`);
|
|
@@ -1519,11 +1524,11 @@ function Cn(e, t = {}, n = "change") {
|
|
|
1519
1524
|
};
|
|
1520
1525
|
}
|
|
1521
1526
|
var U = "This value is already present";
|
|
1522
|
-
function
|
|
1527
|
+
function Tn(e) {
|
|
1523
1528
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
1524
1529
|
}
|
|
1525
|
-
function
|
|
1526
|
-
if (
|
|
1530
|
+
function En(e) {
|
|
1531
|
+
if (Tn(e) !== "unique") return null;
|
|
1527
1532
|
if (typeof e == "string") return {
|
|
1528
1533
|
message: U,
|
|
1529
1534
|
normalizer: "trim",
|
|
@@ -1543,20 +1548,20 @@ function Tn(e) {
|
|
|
1543
1548
|
].includes(n) ? n : "blur"
|
|
1544
1549
|
};
|
|
1545
1550
|
}
|
|
1546
|
-
function
|
|
1551
|
+
function Dn(e) {
|
|
1547
1552
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
1548
1553
|
if (!Array.isArray(t)) return null;
|
|
1549
1554
|
for (let e of t) {
|
|
1550
|
-
let t =
|
|
1555
|
+
let t = En(e);
|
|
1551
1556
|
if (t) return t;
|
|
1552
1557
|
}
|
|
1553
1558
|
return null;
|
|
1554
1559
|
}
|
|
1555
|
-
function
|
|
1560
|
+
function On(e = []) {
|
|
1556
1561
|
let t = [];
|
|
1557
1562
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
1558
1563
|
(e?.fields ?? []).forEach((e) => {
|
|
1559
|
-
let n =
|
|
1564
|
+
let n = Dn(e);
|
|
1560
1565
|
!n || !e?.field || t.push({
|
|
1561
1566
|
field: e.field,
|
|
1562
1567
|
label: e.label ?? e.field,
|
|
@@ -1565,10 +1570,10 @@ function Dn(e = []) {
|
|
|
1565
1570
|
});
|
|
1566
1571
|
}), t;
|
|
1567
1572
|
}
|
|
1568
|
-
function
|
|
1573
|
+
function kn(e) {
|
|
1569
1574
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
1570
1575
|
}
|
|
1571
|
-
function
|
|
1576
|
+
function An(e, t = "trim") {
|
|
1572
1577
|
if (e == null) return "";
|
|
1573
1578
|
let n = String(e);
|
|
1574
1579
|
switch (String(t)) {
|
|
@@ -1580,10 +1585,10 @@ function kn(e, t = "trim") {
|
|
|
1580
1585
|
default: return n.trim();
|
|
1581
1586
|
}
|
|
1582
1587
|
}
|
|
1583
|
-
function
|
|
1584
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
1588
|
+
function jn(e, t) {
|
|
1589
|
+
return !(!e || e.skipBlank !== !1 && kn(t));
|
|
1585
1590
|
}
|
|
1586
|
-
function
|
|
1591
|
+
function Mn(e) {
|
|
1587
1592
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
1588
1593
|
}
|
|
1589
1594
|
var W = {
|
|
@@ -1593,21 +1598,21 @@ var W = {
|
|
|
1593
1598
|
STALE: "stale",
|
|
1594
1599
|
ERROR: "error"
|
|
1595
1600
|
};
|
|
1596
|
-
function
|
|
1601
|
+
function Nn({ module: e, field: t, recordId: n, normalized: r }) {
|
|
1597
1602
|
return `${e}${t}${n ?? ""}${r}`;
|
|
1598
1603
|
}
|
|
1599
|
-
function
|
|
1604
|
+
function Pn({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
1600
1605
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
1601
1606
|
function o(e) {
|
|
1602
1607
|
a = e, typeof t == "function" && t(a);
|
|
1603
1608
|
}
|
|
1604
1609
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
1605
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
1606
|
-
let p =
|
|
1610
|
+
if (!c || !t || !s || typeof e != "function" || !jn(c, l)) return { status: W.SKIPPED };
|
|
1611
|
+
let p = Nn({
|
|
1607
1612
|
module: t,
|
|
1608
1613
|
field: s,
|
|
1609
1614
|
recordId: u,
|
|
1610
|
-
normalized:
|
|
1615
|
+
normalized: An(l, c.normalizer)
|
|
1611
1616
|
});
|
|
1612
1617
|
if (n.has(p)) return n.get(p);
|
|
1613
1618
|
i += 1;
|
|
@@ -1625,7 +1630,7 @@ function Nn({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
1625
1630
|
if (r.get(s) !== m) return { status: W.STALE };
|
|
1626
1631
|
let a = i?.available === !1 ? {
|
|
1627
1632
|
status: W.DUPLICATE,
|
|
1628
|
-
message:
|
|
1633
|
+
message: Fn(i) || c.message || U
|
|
1629
1634
|
} : { status: W.AVAILABLE };
|
|
1630
1635
|
return n.set(p, a), a;
|
|
1631
1636
|
} catch (e) {
|
|
@@ -1646,17 +1651,17 @@ function Nn({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
1646
1651
|
}
|
|
1647
1652
|
};
|
|
1648
1653
|
}
|
|
1649
|
-
function
|
|
1654
|
+
function Fn(e) {
|
|
1650
1655
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
1651
1656
|
}
|
|
1652
|
-
var
|
|
1653
|
-
function
|
|
1654
|
-
let r =
|
|
1657
|
+
var In = "__uniqueRule";
|
|
1658
|
+
function Ln({ field: e, validation: t, context: n }) {
|
|
1659
|
+
let r = En(t);
|
|
1655
1660
|
if (!r) return { validator: () => Promise.resolve() };
|
|
1656
1661
|
let i = e?.field ?? "";
|
|
1657
1662
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
1658
|
-
[
|
|
1659
|
-
validateTrigger:
|
|
1663
|
+
[In]: r,
|
|
1664
|
+
validateTrigger: Mn(r),
|
|
1660
1665
|
validator: async (e, t) => {
|
|
1661
1666
|
let a = await n.checker.check({
|
|
1662
1667
|
module: n.module,
|
|
@@ -1671,22 +1676,22 @@ function In({ field: e, validation: t, context: n }) {
|
|
|
1671
1676
|
}
|
|
1672
1677
|
};
|
|
1673
1678
|
}
|
|
1674
|
-
function
|
|
1679
|
+
function Rn(e = []) {
|
|
1675
1680
|
let t = Array.isArray(e) ? e : [];
|
|
1676
|
-
if (!t.some((e) => e && e[
|
|
1677
|
-
let n = t.filter((e) => e && !e[
|
|
1681
|
+
if (!t.some((e) => e && e[In])) return t;
|
|
1682
|
+
let n = t.filter((e) => e && !e[In] && !e.warningOnly);
|
|
1678
1683
|
return t.map((e) => {
|
|
1679
|
-
if (!e || !e[
|
|
1684
|
+
if (!e || !e[In]) return e;
|
|
1680
1685
|
let t = e.validator;
|
|
1681
1686
|
return {
|
|
1682
1687
|
...e,
|
|
1683
|
-
validator: async (e, r) => await
|
|
1688
|
+
validator: async (e, r) => await zn(n, r, e) ? Promise.resolve() : t(e, r)
|
|
1684
1689
|
};
|
|
1685
1690
|
});
|
|
1686
1691
|
}
|
|
1687
|
-
async function
|
|
1692
|
+
async function zn(e = [], t, n = {}) {
|
|
1688
1693
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
1689
|
-
if (r.required &&
|
|
1694
|
+
if (r.required && kn(t) || !kn(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;
|
|
1690
1695
|
if (typeof r.validator == "function") try {
|
|
1691
1696
|
await r.validator(n, t);
|
|
1692
1697
|
} catch {
|
|
@@ -1695,7 +1700,7 @@ async function Rn(e = [], t, n = {}) {
|
|
|
1695
1700
|
}
|
|
1696
1701
|
return !1;
|
|
1697
1702
|
}
|
|
1698
|
-
function
|
|
1703
|
+
function Bn(e) {
|
|
1699
1704
|
let t = String(e ?? "").trim();
|
|
1700
1705
|
if (!t.startsWith("{")) return null;
|
|
1701
1706
|
try {
|
|
@@ -1704,19 +1709,19 @@ function zn(e) {
|
|
|
1704
1709
|
return null;
|
|
1705
1710
|
}
|
|
1706
1711
|
}
|
|
1707
|
-
function
|
|
1712
|
+
function Vn(e) {
|
|
1708
1713
|
if (!e) return null;
|
|
1709
|
-
if (typeof e == "string") return
|
|
1714
|
+
if (typeof e == "string") return Bn(e);
|
|
1710
1715
|
let t = [
|
|
1711
1716
|
e.data,
|
|
1712
1717
|
e.response,
|
|
1713
1718
|
e,
|
|
1714
|
-
|
|
1719
|
+
Bn(e.message)
|
|
1715
1720
|
];
|
|
1716
1721
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
1717
1722
|
return null;
|
|
1718
1723
|
}
|
|
1719
|
-
function
|
|
1724
|
+
function Hn({ field: e, group: t, rowIndex: n }) {
|
|
1720
1725
|
let r = String(e ?? ""), i = Number(n);
|
|
1721
1726
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
1722
1727
|
String(t),
|
|
@@ -1724,13 +1729,13 @@ function Vn({ field: e, group: t, rowIndex: n }) {
|
|
|
1724
1729
|
...r.split(".")
|
|
1725
1730
|
] : r;
|
|
1726
1731
|
}
|
|
1727
|
-
function
|
|
1728
|
-
let n =
|
|
1732
|
+
function Un(e, { uniqueRules: t = [] } = {}) {
|
|
1733
|
+
let n = Vn(e);
|
|
1729
1734
|
if (n) {
|
|
1730
1735
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
1731
1736
|
let t = {
|
|
1732
1737
|
field: e.field,
|
|
1733
|
-
name:
|
|
1738
|
+
name: Hn(e),
|
|
1734
1739
|
message: e.message || n.message || U
|
|
1735
1740
|
};
|
|
1736
1741
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
@@ -1748,29 +1753,29 @@ function Hn(e, { uniqueRules: t = [] } = {}) {
|
|
|
1748
1753
|
}
|
|
1749
1754
|
//#endregion
|
|
1750
1755
|
//#region src/components/form/patternRule.js
|
|
1751
|
-
var
|
|
1752
|
-
function
|
|
1753
|
-
return !!(e && typeof e == "object" &&
|
|
1756
|
+
var Wn = (e) => e === !0 || e === 1 || e === "1" || typeof e == "string" && e.trim().toLowerCase() === "true";
|
|
1757
|
+
function Gn(e) {
|
|
1758
|
+
return !!(e && typeof e == "object" && Wn(e.warningOnly));
|
|
1754
1759
|
}
|
|
1755
|
-
function
|
|
1760
|
+
function Kn({ label: e, message: t, rule: n }) {
|
|
1756
1761
|
let r = {
|
|
1757
1762
|
pattern: new RegExp(n.pattern ?? n.value, n.flags),
|
|
1758
1763
|
message: t ?? `Enter valid ${e}`
|
|
1759
1764
|
};
|
|
1760
|
-
return
|
|
1765
|
+
return Gn(n) && (r.warningOnly = !0), r;
|
|
1761
1766
|
}
|
|
1762
|
-
function
|
|
1763
|
-
return
|
|
1767
|
+
function qn(e) {
|
|
1768
|
+
return Gn(e);
|
|
1764
1769
|
}
|
|
1765
|
-
function
|
|
1770
|
+
function Jn(e, t) {
|
|
1766
1771
|
return e?.type === "pattern" && t?.warningOnly === !0 && (e.warningOnly = !0), e;
|
|
1767
1772
|
}
|
|
1768
|
-
function
|
|
1773
|
+
function Yn(e) {
|
|
1769
1774
|
return typeof e == "string" ? e.toUpperCase() : e;
|
|
1770
1775
|
}
|
|
1771
1776
|
//#endregion
|
|
1772
1777
|
//#region src/services/uniqueValidationApi.js
|
|
1773
|
-
async function
|
|
1778
|
+
async function Xn({ module: e, field: t, value: n, recordId: i, clientId: a, region: s } = {}) {
|
|
1774
1779
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
1775
1780
|
let c = {
|
|
1776
1781
|
field: t,
|
|
@@ -1804,7 +1809,7 @@ async function Yn({ module: e, field: t, value: n, recordId: i, clientId: a, reg
|
|
|
1804
1809
|
throw e;
|
|
1805
1810
|
}
|
|
1806
1811
|
}
|
|
1807
|
-
async function
|
|
1812
|
+
async function Zn({ module: e, payload: t, excludeId: n } = {}) {
|
|
1808
1813
|
if (!e || !t) return { duplicate: !1 };
|
|
1809
1814
|
try {
|
|
1810
1815
|
let i = await o(r, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -1822,7 +1827,7 @@ async function Xn({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
1822
1827
|
}
|
|
1823
1828
|
//#endregion
|
|
1824
1829
|
//#region src/components/form/uploadAccept.js
|
|
1825
|
-
var
|
|
1830
|
+
var Qn = [
|
|
1826
1831
|
"jpg",
|
|
1827
1832
|
"jpeg",
|
|
1828
1833
|
"png",
|
|
@@ -1831,18 +1836,18 @@ var Zn = [
|
|
|
1831
1836
|
"bmp",
|
|
1832
1837
|
"svg",
|
|
1833
1838
|
"avif"
|
|
1834
|
-
],
|
|
1839
|
+
], $n = [
|
|
1835
1840
|
"mp4",
|
|
1836
1841
|
"webm",
|
|
1837
1842
|
"ogg",
|
|
1838
1843
|
"ogv",
|
|
1839
1844
|
"mov",
|
|
1840
1845
|
"m4v"
|
|
1841
|
-
],
|
|
1846
|
+
], er = [
|
|
1842
1847
|
"pdf",
|
|
1843
1848
|
"doc",
|
|
1844
1849
|
"docx"
|
|
1845
|
-
],
|
|
1850
|
+
], tr = [
|
|
1846
1851
|
{
|
|
1847
1852
|
label: "Any file",
|
|
1848
1853
|
value: "any"
|
|
@@ -1867,45 +1872,45 @@ var Zn = [
|
|
|
1867
1872
|
label: "Images & Videos",
|
|
1868
1873
|
value: "imagesAndVideos"
|
|
1869
1874
|
}
|
|
1870
|
-
],
|
|
1875
|
+
], nr = {
|
|
1871
1876
|
resume: {
|
|
1872
|
-
exts:
|
|
1877
|
+
exts: er,
|
|
1873
1878
|
maxSizeMB: 2,
|
|
1874
1879
|
hint: "PDF, DOC or DOCX",
|
|
1875
1880
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
1876
1881
|
},
|
|
1877
1882
|
documents: {
|
|
1878
|
-
exts: [
|
|
1883
|
+
exts: [...er, ...Qn],
|
|
1879
1884
|
hint: "PDF, DOC or image files",
|
|
1880
1885
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
1881
1886
|
},
|
|
1882
1887
|
images: {
|
|
1883
|
-
exts:
|
|
1888
|
+
exts: Qn,
|
|
1884
1889
|
hint: "Image files",
|
|
1885
1890
|
error: "Only image files are allowed"
|
|
1886
1891
|
},
|
|
1887
1892
|
videos: {
|
|
1888
|
-
exts:
|
|
1893
|
+
exts: $n,
|
|
1889
1894
|
hint: "Video files",
|
|
1890
1895
|
error: "Only video files are allowed"
|
|
1891
1896
|
},
|
|
1892
1897
|
imagesAndVideos: {
|
|
1893
|
-
exts: [...
|
|
1898
|
+
exts: [...Qn, ...$n],
|
|
1894
1899
|
hint: "Image or video files",
|
|
1895
1900
|
error: "Only image or video files are allowed"
|
|
1896
1901
|
}
|
|
1897
1902
|
};
|
|
1898
|
-
function
|
|
1903
|
+
function rr(e) {
|
|
1899
1904
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
1900
1905
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
1901
1906
|
}
|
|
1902
|
-
function
|
|
1907
|
+
function ir(e) {
|
|
1903
1908
|
let t = String(e?.accept ?? "").trim();
|
|
1904
|
-
return t && t !== "any" ?
|
|
1909
|
+
return t && t !== "any" ? nr[t] ?? null : !t && rr(e) ? nr.resume : nr[t] ?? null;
|
|
1905
1910
|
}
|
|
1906
1911
|
//#endregion
|
|
1907
1912
|
//#region src/components/form/quickActionLabels.js
|
|
1908
|
-
var
|
|
1913
|
+
var ar = /* @__PURE__ */ new Set([
|
|
1909
1914
|
"of",
|
|
1910
1915
|
"and",
|
|
1911
1916
|
"the",
|
|
@@ -1914,7 +1919,7 @@ var ir = /* @__PURE__ */ new Set([
|
|
|
1914
1919
|
"in",
|
|
1915
1920
|
"a",
|
|
1916
1921
|
"an"
|
|
1917
|
-
]),
|
|
1922
|
+
]), or = {
|
|
1918
1923
|
addresses: "address",
|
|
1919
1924
|
branches: "branch",
|
|
1920
1925
|
batches: "batch",
|
|
@@ -1925,42 +1930,42 @@ var ir = /* @__PURE__ */ new Set([
|
|
|
1925
1930
|
people: "person",
|
|
1926
1931
|
statuses: "status"
|
|
1927
1932
|
};
|
|
1928
|
-
function
|
|
1933
|
+
function sr(e) {
|
|
1929
1934
|
let t = String(e ?? "").trim();
|
|
1930
1935
|
if (!t) return "";
|
|
1931
1936
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
1932
1937
|
let n = t.toLowerCase();
|
|
1933
|
-
return
|
|
1938
|
+
return or[n] ? or[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;
|
|
1934
1939
|
}
|
|
1935
1940
|
function G(e) {
|
|
1936
1941
|
let t = String(e ?? "").trim();
|
|
1937
1942
|
if (!t) return "";
|
|
1938
1943
|
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);
|
|
1939
1944
|
if (!n.length) return "";
|
|
1940
|
-
let r =
|
|
1945
|
+
let r = sr(n[n.length - 1]);
|
|
1941
1946
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
1942
1947
|
let n = e.toLowerCase();
|
|
1943
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
1948
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && ar.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
1944
1949
|
}).join(" ");
|
|
1945
1950
|
}
|
|
1946
|
-
function
|
|
1951
|
+
function cr(e, t) {
|
|
1947
1952
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
1948
1953
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
1949
1954
|
let r = G(e?.quickCreateModule || t);
|
|
1950
1955
|
return r ? `Add New ${r}` : "Add New";
|
|
1951
1956
|
}
|
|
1952
|
-
function
|
|
1957
|
+
function lr(e, t) {
|
|
1953
1958
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
1954
1959
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
1955
1960
|
let r = G(e?.quickEditModule || t);
|
|
1956
1961
|
return r ? `Edit ${r}` : "Edit";
|
|
1957
1962
|
}
|
|
1958
|
-
function
|
|
1963
|
+
function ur(e, t, n) {
|
|
1959
1964
|
let r = G((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
1960
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
1965
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : cr(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : lr(t, n));
|
|
1961
1966
|
}
|
|
1962
1967
|
var K = (e) => e == null ? "" : String(e).trim();
|
|
1963
|
-
function
|
|
1968
|
+
function dr(e) {
|
|
1964
1969
|
let t = e?.quickCreateNotice;
|
|
1965
1970
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
1966
1971
|
enabled: !0,
|
|
@@ -1973,7 +1978,7 @@ function ur(e) {
|
|
|
1973
1978
|
creatorLabel: K(t.creatorLabel) || "Created by"
|
|
1974
1979
|
};
|
|
1975
1980
|
}
|
|
1976
|
-
var
|
|
1981
|
+
var fr = [
|
|
1977
1982
|
"clientName",
|
|
1978
1983
|
"companyName",
|
|
1979
1984
|
"name",
|
|
@@ -1983,24 +1988,24 @@ var dr = [
|
|
|
1983
1988
|
"label",
|
|
1984
1989
|
"employerName",
|
|
1985
1990
|
"vendorName"
|
|
1986
|
-
],
|
|
1991
|
+
], pr = (e, t) => {
|
|
1987
1992
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
1988
|
-
},
|
|
1989
|
-
function
|
|
1993
|
+
}, mr = (e) => typeof e == "string" || typeof e == "number" ? K(e) : e && typeof e == "object" ? K(e.label ?? e.name ?? e.title ?? "") : "";
|
|
1994
|
+
function hr(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
1990
1995
|
if (!e || typeof e != "object") return "";
|
|
1991
1996
|
for (let r of [
|
|
1992
1997
|
t,
|
|
1993
1998
|
n,
|
|
1994
|
-
...
|
|
1999
|
+
...fr
|
|
1995
2000
|
]) {
|
|
1996
2001
|
if (!r) continue;
|
|
1997
|
-
let t = pr(
|
|
2002
|
+
let t = mr(pr(e, r));
|
|
1998
2003
|
if (t) return t;
|
|
1999
2004
|
}
|
|
2000
2005
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
2001
2006
|
return r ? K(e[r]) : "";
|
|
2002
2007
|
}
|
|
2003
|
-
function
|
|
2008
|
+
function gr(e) {
|
|
2004
2009
|
if (!e || typeof e != "object") return "";
|
|
2005
2010
|
let t = [
|
|
2006
2011
|
e.createdBy,
|
|
@@ -2022,67 +2027,67 @@ function hr(e) {
|
|
|
2022
2027
|
}
|
|
2023
2028
|
return "";
|
|
2024
2029
|
}
|
|
2025
|
-
function
|
|
2030
|
+
function _r(e = a) {
|
|
2026
2031
|
try {
|
|
2027
2032
|
return y(e()) || "";
|
|
2028
2033
|
} catch {
|
|
2029
2034
|
return "";
|
|
2030
2035
|
}
|
|
2031
2036
|
}
|
|
2032
|
-
var
|
|
2037
|
+
var vr = (e, t) => o(r, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
2033
2038
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
2034
2039
|
return Array.isArray(t) ? t[0] : t;
|
|
2035
2040
|
});
|
|
2036
|
-
async function
|
|
2037
|
-
let { fetchRecord: o =
|
|
2041
|
+
async function yr({ module: e, recordId: t, notice: n, displayField: r = "", deps: i = {} } = {}) {
|
|
2042
|
+
let { fetchRecord: o = vr, fetchUserNameFn: s = ae, getUser: c = a } = i, l = null;
|
|
2038
2043
|
if (e && t) try {
|
|
2039
2044
|
l = await o(e, t);
|
|
2040
2045
|
} catch {
|
|
2041
2046
|
l = null;
|
|
2042
2047
|
}
|
|
2043
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
2048
|
+
let u = n?.showRecordName === !1 ? "" : hr(l, {
|
|
2044
2049
|
recordNameField: n?.recordNameField,
|
|
2045
2050
|
displayField: r
|
|
2046
2051
|
}), d = "";
|
|
2047
2052
|
if (n?.showCreator !== !1) {
|
|
2048
|
-
let e =
|
|
2053
|
+
let e = gr(l);
|
|
2049
2054
|
if (e) try {
|
|
2050
2055
|
d = K(await s(e));
|
|
2051
2056
|
} catch {
|
|
2052
2057
|
d = "";
|
|
2053
2058
|
}
|
|
2054
|
-
d ||=
|
|
2059
|
+
d ||= _r(c);
|
|
2055
2060
|
}
|
|
2056
2061
|
return {
|
|
2057
2062
|
recordName: u,
|
|
2058
2063
|
creatorName: d
|
|
2059
2064
|
};
|
|
2060
2065
|
}
|
|
2061
|
-
var
|
|
2062
|
-
function
|
|
2066
|
+
var br = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
2067
|
+
function xr(e) {
|
|
2063
2068
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
2064
2069
|
}
|
|
2065
|
-
var
|
|
2066
|
-
function
|
|
2067
|
-
let n =
|
|
2068
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
2070
|
+
var Sr = (e) => xr(e).toLowerCase();
|
|
2071
|
+
function Cr(e, t) {
|
|
2072
|
+
let n = Sr(e);
|
|
2073
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => Sr(e?.label) === n) ?? null;
|
|
2069
2074
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return t || n ? !1 :
|
|
2075
|
+
function wr({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
2076
|
+
return t || n ? !1 : xr(e).length >= 3;
|
|
2072
2077
|
}
|
|
2073
2078
|
//#endregion
|
|
2074
2079
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
2075
|
-
var
|
|
2076
|
-
function
|
|
2080
|
+
var Tr = x(() => import("./index.js").then((e) => e.r)), Er = x(() => import("./index.js").then((e) => e.n)), Dr = (e) => e == null || e === "", Or = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
2081
|
+
function kr(e, t, n, r, i) {
|
|
2077
2082
|
let a = e.quickEditIdFrom;
|
|
2078
2083
|
if (a) {
|
|
2079
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
2080
|
-
return
|
|
2084
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Or(a)] : Or(a), i = t?.getFieldValue?.(e);
|
|
2085
|
+
return Dr(i) && (i = r?.[a]), Dr(i) ? null : i;
|
|
2081
2086
|
}
|
|
2082
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
2087
|
+
return i && typeof i == "object" ? i.value ?? null : Dr(i) ? null : i;
|
|
2083
2088
|
}
|
|
2084
|
-
function
|
|
2085
|
-
let [s, c] = w(null), [l, u] = w(null), d = !!e?.quickCreate, f = !!e?.quickEdit, p = e?.quickCreateModule || e?.lookupCollection || "", m = e?.quickEditModule || e?.lookupCollection || "", h = C(() => f ?
|
|
2089
|
+
function Ar({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
2090
|
+
let [s, c] = w(null), [l, u] = w(null), d = !!e?.quickCreate, f = !!e?.quickEdit, p = e?.quickCreateModule || e?.lookupCollection || "", m = e?.quickEditModule || e?.lookupCollection || "", h = C(() => f ? kr(e, t, n, i, a) : null, [
|
|
2086
2091
|
f,
|
|
2087
2092
|
e,
|
|
2088
2093
|
t,
|
|
@@ -2096,7 +2101,7 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2096
2101
|
openCreateWith: null,
|
|
2097
2102
|
isModalOpen: !1
|
|
2098
2103
|
};
|
|
2099
|
-
let g =
|
|
2104
|
+
let g = br(e, r), _ = () => c(null), v = () => {
|
|
2100
2105
|
if (e?.quickCreateOnClick) {
|
|
2101
2106
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
2102
2107
|
return;
|
|
@@ -2120,12 +2125,12 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2120
2125
|
module: m,
|
|
2121
2126
|
recordId: String(h)
|
|
2122
2127
|
}), te = (t) => {
|
|
2123
|
-
let n =
|
|
2128
|
+
let n = dr(e);
|
|
2124
2129
|
n && (u({
|
|
2125
2130
|
...n,
|
|
2126
2131
|
recordName: "",
|
|
2127
2132
|
creatorName: ""
|
|
2128
|
-
}),
|
|
2133
|
+
}), yr({
|
|
2129
2134
|
module: p,
|
|
2130
2135
|
recordId: t,
|
|
2131
2136
|
notice: n,
|
|
@@ -2152,10 +2157,10 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2152
2157
|
children: [re && /* @__PURE__ */ O(be, {
|
|
2153
2158
|
type: "link",
|
|
2154
2159
|
size: "small",
|
|
2155
|
-
icon: /* @__PURE__ */ O(
|
|
2160
|
+
icon: /* @__PURE__ */ O(Re, {}),
|
|
2156
2161
|
onClick: v,
|
|
2157
2162
|
style: { paddingLeft: 0 },
|
|
2158
|
-
children:
|
|
2163
|
+
children: cr(e, p)
|
|
2159
2164
|
}), f && /* @__PURE__ */ O(be, {
|
|
2160
2165
|
type: "link",
|
|
2161
2166
|
size: "small",
|
|
@@ -2163,12 +2168,12 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2163
2168
|
onClick: y,
|
|
2164
2169
|
disabled: !h,
|
|
2165
2170
|
title: h ? void 0 : `Choose a ${G(m) || "record"} above first, then edit it here`,
|
|
2166
|
-
children:
|
|
2171
|
+
children: lr(e, m)
|
|
2167
2172
|
})]
|
|
2168
2173
|
})
|
|
2169
2174
|
}), ie = s ? /* @__PURE__ */ O(T, {
|
|
2170
2175
|
open: !0,
|
|
2171
|
-
title:
|
|
2176
|
+
title: ur(s.mode, e, s.mode === "create" ? p : m),
|
|
2172
2177
|
width: "min(1080px, 96vw)",
|
|
2173
2178
|
footer: null,
|
|
2174
2179
|
destroyOnClose: !0,
|
|
@@ -2186,7 +2191,7 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2186
2191
|
},
|
|
2187
2192
|
children: /* @__PURE__ */ O(we, {})
|
|
2188
2193
|
}),
|
|
2189
|
-
children: s.mode === "create" ? /* @__PURE__ */ O(
|
|
2194
|
+
children: s.mode === "create" ? /* @__PURE__ */ O(Tr, {
|
|
2190
2195
|
moduleName: s.module,
|
|
2191
2196
|
embedded: !0,
|
|
2192
2197
|
breadcrumbItems: [],
|
|
@@ -2195,7 +2200,7 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2195
2200
|
onSuccess: (e) => {
|
|
2196
2201
|
_(), te(e), o?.("create", e);
|
|
2197
2202
|
}
|
|
2198
|
-
}) : /* @__PURE__ */ O(
|
|
2203
|
+
}) : /* @__PURE__ */ O(Er, {
|
|
2199
2204
|
moduleName: s.module,
|
|
2200
2205
|
recordId: s.recordId,
|
|
2201
2206
|
embedded: !0,
|
|
@@ -2258,8 +2263,8 @@ function kr({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
2258
2263
|
}
|
|
2259
2264
|
//#endregion
|
|
2260
2265
|
//#region src/components/form/crossFieldRules.js
|
|
2261
|
-
var
|
|
2262
|
-
function
|
|
2266
|
+
var jr = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
2267
|
+
function Mr(e, t, n) {
|
|
2263
2268
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
2264
2269
|
if (typeof n == "function") {
|
|
2265
2270
|
let e = n(t);
|
|
@@ -2267,23 +2272,23 @@ function jr(e, t, n) {
|
|
|
2267
2272
|
}
|
|
2268
2273
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
2269
2274
|
}
|
|
2270
|
-
function
|
|
2275
|
+
function Nr({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
2271
2276
|
let s = n.field ?? n.compareField ?? r;
|
|
2272
2277
|
return { validator: async (n, r) => {
|
|
2273
|
-
if (!s ||
|
|
2274
|
-
let c = i?.getFieldValue?.(
|
|
2275
|
-
if (
|
|
2278
|
+
if (!s || jr(r)) return Promise.resolve();
|
|
2279
|
+
let c = i?.getFieldValue?.(Mr(a, s, o));
|
|
2280
|
+
if (jr(c)) return Promise.resolve();
|
|
2276
2281
|
let l = Number(c), u = Number(r);
|
|
2277
2282
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
2278
2283
|
} };
|
|
2279
2284
|
}
|
|
2280
|
-
function
|
|
2285
|
+
function Pr(e = {}, t, n) {
|
|
2281
2286
|
let r = e.field ?? e.compareField ?? e.value;
|
|
2282
|
-
return r ?
|
|
2287
|
+
return r ? Mr(t, r, n) : null;
|
|
2283
2288
|
}
|
|
2284
2289
|
//#endregion
|
|
2285
2290
|
//#region src/components/form/maxCeiling.js
|
|
2286
|
-
function
|
|
2291
|
+
function Fr(e, t) {
|
|
2287
2292
|
let n = String(t).split(".").filter(Boolean);
|
|
2288
2293
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
2289
2294
|
if (n.length > 1) {
|
|
@@ -2296,14 +2301,14 @@ function Pr(e, t) {
|
|
|
2296
2301
|
let r = [...e];
|
|
2297
2302
|
return r[r.length - 1] = n[0], r;
|
|
2298
2303
|
}
|
|
2299
|
-
function
|
|
2300
|
-
let r = e?.getFieldValue?.(
|
|
2304
|
+
function Ir(e, t, n) {
|
|
2305
|
+
let r = e?.getFieldValue?.(Fr(t, n));
|
|
2301
2306
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
2302
2307
|
}
|
|
2303
|
-
function
|
|
2308
|
+
function Lr(e) {
|
|
2304
2309
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
2305
2310
|
}
|
|
2306
|
-
function
|
|
2311
|
+
function Rr(e, t) {
|
|
2307
2312
|
for (let n of e ?? []) {
|
|
2308
2313
|
let e = t(n);
|
|
2309
2314
|
if (e == null || e === "") continue;
|
|
@@ -2315,14 +2320,14 @@ function Lr(e, t) {
|
|
|
2315
2320
|
}
|
|
2316
2321
|
return null;
|
|
2317
2322
|
}
|
|
2318
|
-
function
|
|
2323
|
+
function zr({ input: e, compareFields: t, readValue: n }) {
|
|
2319
2324
|
let r = {
|
|
2320
2325
|
ok: !0,
|
|
2321
2326
|
field: null,
|
|
2322
2327
|
maximum: null
|
|
2323
2328
|
};
|
|
2324
2329
|
if (e == null || e === "") return r;
|
|
2325
|
-
let i =
|
|
2330
|
+
let i = Rr(t, n);
|
|
2326
2331
|
if (!i) return r;
|
|
2327
2332
|
let a = Number(e);
|
|
2328
2333
|
return Number.isFinite(a) ? {
|
|
@@ -2333,39 +2338,39 @@ function Rr({ input: e, compareFields: t, readValue: n }) {
|
|
|
2333
2338
|
}
|
|
2334
2339
|
//#endregion
|
|
2335
2340
|
//#region src/components/form/contextPrefill.js
|
|
2336
|
-
var
|
|
2337
|
-
function
|
|
2341
|
+
var Br = { candidates: ["applicantId"] };
|
|
2342
|
+
function Vr(e) {
|
|
2338
2343
|
let t = String(e ?? "").trim();
|
|
2339
2344
|
if (!t) return [];
|
|
2340
2345
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
2341
2346
|
return [.../* @__PURE__ */ new Set([
|
|
2342
2347
|
`${n}Id`,
|
|
2343
2348
|
`${t}Id`,
|
|
2344
|
-
...
|
|
2349
|
+
...Br[t] ?? []
|
|
2345
2350
|
])];
|
|
2346
2351
|
}
|
|
2347
|
-
function
|
|
2352
|
+
function Hr(e, t) {
|
|
2348
2353
|
if (!t) return "";
|
|
2349
2354
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
2350
|
-
for (let r of
|
|
2355
|
+
for (let r of Vr(e)) {
|
|
2351
2356
|
let e = String(n(t[r]) || "");
|
|
2352
2357
|
if (e) return e;
|
|
2353
2358
|
}
|
|
2354
2359
|
return "";
|
|
2355
2360
|
}
|
|
2356
|
-
function
|
|
2361
|
+
function Ur(e, t) {
|
|
2357
2362
|
let n = /* @__PURE__ */ new Set();
|
|
2358
2363
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2359
2364
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
2360
2365
|
})), [...n];
|
|
2361
2366
|
}
|
|
2362
|
-
function
|
|
2367
|
+
function Wr(e) {
|
|
2363
2368
|
return e?.payloadMode === "skip";
|
|
2364
2369
|
}
|
|
2365
|
-
function
|
|
2370
|
+
function Gr(e) {
|
|
2366
2371
|
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 : [];
|
|
2367
2372
|
}
|
|
2368
|
-
function
|
|
2373
|
+
function Kr(e) {
|
|
2369
2374
|
let t = {};
|
|
2370
2375
|
return (e ?? []).forEach((e) => {
|
|
2371
2376
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -2373,7 +2378,7 @@ function Gr(e) {
|
|
|
2373
2378
|
});
|
|
2374
2379
|
}), t;
|
|
2375
2380
|
}
|
|
2376
|
-
function
|
|
2381
|
+
function qr(e, t) {
|
|
2377
2382
|
if (!e || !t) return;
|
|
2378
2383
|
let n = e;
|
|
2379
2384
|
for (let e of String(t).split(".")) {
|
|
@@ -2388,7 +2393,7 @@ function Kr(e, t) {
|
|
|
2388
2393
|
}
|
|
2389
2394
|
return n;
|
|
2390
2395
|
}
|
|
2391
|
-
function
|
|
2396
|
+
function Jr(e, t) {
|
|
2392
2397
|
if (!(!e || !t)) for (let n of [
|
|
2393
2398
|
t.prefillFrom,
|
|
2394
2399
|
t.field,
|
|
@@ -2396,12 +2401,12 @@ function qr(e, t) {
|
|
|
2396
2401
|
]) {
|
|
2397
2402
|
if (!n) continue;
|
|
2398
2403
|
let t = e[n];
|
|
2399
|
-
if (t ??= s(e, n), t ??=
|
|
2404
|
+
if (t ??= s(e, n), t ??= qr(e, n), t != null) return t;
|
|
2400
2405
|
}
|
|
2401
2406
|
}
|
|
2402
2407
|
//#endregion
|
|
2403
2408
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
2404
|
-
function
|
|
2409
|
+
function Yr({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
2405
2410
|
let a = f(t), o = Se.useWatch(n, e);
|
|
2406
2411
|
if (!a) return null;
|
|
2407
2412
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
@@ -2432,52 +2437,52 @@ function Jr({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
2432
2437
|
}
|
|
2433
2438
|
//#endregion
|
|
2434
2439
|
//#region src/components/form/prefillWhenRules.js
|
|
2435
|
-
var
|
|
2436
|
-
function
|
|
2440
|
+
var Xr = (e) => String(e ?? "");
|
|
2441
|
+
function Zr(e) {
|
|
2437
2442
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2438
2443
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
2439
2444
|
let r = e?.field;
|
|
2440
2445
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
2441
2446
|
}), n;
|
|
2442
2447
|
}
|
|
2443
|
-
function
|
|
2444
|
-
return
|
|
2448
|
+
function Qr(e, t, n, r) {
|
|
2449
|
+
return Zr(e).map((e) => ({
|
|
2445
2450
|
field: e,
|
|
2446
2451
|
path: n(t, e, r)
|
|
2447
2452
|
}));
|
|
2448
2453
|
}
|
|
2449
|
-
function
|
|
2450
|
-
return !e || !e.field ? !1 :
|
|
2454
|
+
function $r(e, t = {}) {
|
|
2455
|
+
return !e || !e.field ? !1 : Xr(t[e.field]) === Xr(e.value);
|
|
2451
2456
|
}
|
|
2452
|
-
function
|
|
2453
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
2457
|
+
function ei({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
2458
|
+
let o = (Array.isArray(e) ? e : []).find((e) => $r(e, t));
|
|
2454
2459
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
2455
2460
|
action: "set",
|
|
2456
2461
|
value: o.setValue
|
|
2457
|
-
} : i && r !== void 0 &&
|
|
2462
|
+
} : i && r !== void 0 && Xr(n) === Xr(r) ? { action: "clear" } : { action: "none" };
|
|
2458
2463
|
}
|
|
2459
2464
|
//#endregion
|
|
2460
2465
|
//#region src/components/form/computeFromRules.js
|
|
2461
|
-
var
|
|
2462
|
-
function ri(e) {
|
|
2463
|
-
return !!(e && ei.includes(e.type) && e.field);
|
|
2464
|
-
}
|
|
2466
|
+
var ti = ["daysUntil"], ni = (e) => e == null || e === "", ri = (e) => String(e ?? "");
|
|
2465
2467
|
function ii(e) {
|
|
2466
|
-
|
|
2468
|
+
return !!(e && ti.includes(e.type) && e.field);
|
|
2469
|
+
}
|
|
2470
|
+
function ai(e) {
|
|
2471
|
+
if (ni(e)) return null;
|
|
2467
2472
|
let t = A.isDayjs(e) ? e : A(e?.$date ?? e);
|
|
2468
2473
|
return t.isValid() ? t.format("YYYY-MM-DD") : null;
|
|
2469
2474
|
}
|
|
2470
|
-
function
|
|
2471
|
-
let n =
|
|
2475
|
+
function oi(e, t) {
|
|
2476
|
+
let n = ai(e), r = ai(t ?? A());
|
|
2472
2477
|
if (!(!n || !r)) return Math.max(0, A(n).diff(A(r), "day"));
|
|
2473
2478
|
}
|
|
2474
|
-
function
|
|
2475
|
-
if (
|
|
2476
|
-
case "daysUntil": return
|
|
2479
|
+
function si(e, t, n) {
|
|
2480
|
+
if (ii(e)) switch (e.type) {
|
|
2481
|
+
case "daysUntil": return oi(t, n);
|
|
2477
2482
|
default: return;
|
|
2478
2483
|
}
|
|
2479
2484
|
}
|
|
2480
|
-
function
|
|
2485
|
+
function ci(e, t, n, r) {
|
|
2481
2486
|
let i = Object.entries(e?.setFields || {}).filter(([e]) => !!e).map(([e, i]) => ({
|
|
2482
2487
|
field: e,
|
|
2483
2488
|
path: n(t, e, r),
|
|
@@ -2488,28 +2493,28 @@ function si(e, t, n, r) {
|
|
|
2488
2493
|
setFields: i
|
|
2489
2494
|
};
|
|
2490
2495
|
}
|
|
2491
|
-
function
|
|
2492
|
-
if (!
|
|
2493
|
-
let o =
|
|
2496
|
+
function li({ cfg: e, sourceValue: t, previousSource: n, current: r, lastApplied: i, today: a } = {}) {
|
|
2497
|
+
if (!ii(e) || ni(t) || ai(t) === ai(n)) return { action: "none" };
|
|
2498
|
+
let o = si(e, t, a);
|
|
2494
2499
|
if (o === void 0) return { action: "none" };
|
|
2495
|
-
if (
|
|
2496
|
-
let e = i !== void 0 &&
|
|
2497
|
-
if (!
|
|
2500
|
+
if (ni(n)) {
|
|
2501
|
+
let e = i !== void 0 && ri(r) === ri(i);
|
|
2502
|
+
if (!ni(r) && !e) return { action: "none" };
|
|
2498
2503
|
}
|
|
2499
|
-
return
|
|
2504
|
+
return ri(r) === ri(o) ? { action: "none" } : {
|
|
2500
2505
|
action: "set",
|
|
2501
2506
|
value: o
|
|
2502
2507
|
};
|
|
2503
2508
|
}
|
|
2504
2509
|
//#endregion
|
|
2505
2510
|
//#region src/components/form/ComputeFromWatcher.jsx
|
|
2506
|
-
function
|
|
2511
|
+
function ui({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [] }) {
|
|
2507
2512
|
let a = Se.useWatch(n, {
|
|
2508
2513
|
form: e,
|
|
2509
2514
|
preserve: !0
|
|
2510
2515
|
}), o = ge(void 0), s = ge(void 0), c = a?.format ? a.format("YYYY-MM-DD") : String(a ?? "");
|
|
2511
2516
|
return S(() => {
|
|
2512
|
-
let n =
|
|
2517
|
+
let n = li({
|
|
2513
2518
|
cfg: t,
|
|
2514
2519
|
sourceValue: a,
|
|
2515
2520
|
previousSource: o.current,
|
|
@@ -2523,7 +2528,7 @@ function li({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [
|
|
|
2523
2528
|
//#endregion
|
|
2524
2529
|
//#region src/components/form/optionConstraints.js
|
|
2525
2530
|
var q = (e) => String(e ?? "").trim().toLowerCase();
|
|
2526
|
-
function
|
|
2531
|
+
function di(e) {
|
|
2527
2532
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
2528
2533
|
return t.forEach((e) => {
|
|
2529
2534
|
if (e != null && e !== "") {
|
|
@@ -2543,42 +2548,42 @@ function ui(e) {
|
|
|
2543
2548
|
}
|
|
2544
2549
|
}), n;
|
|
2545
2550
|
}
|
|
2546
|
-
function
|
|
2547
|
-
let n =
|
|
2551
|
+
function fi(e = [], t) {
|
|
2552
|
+
let n = di(t);
|
|
2548
2553
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
2549
2554
|
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(q(e.value)) || r.has(q(e.label)) : r.has(q(e)));
|
|
2550
2555
|
return i.length > 0 ? i : e;
|
|
2551
2556
|
}
|
|
2552
|
-
function
|
|
2557
|
+
function pi(e) {
|
|
2553
2558
|
let t = [];
|
|
2554
2559
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
2555
2560
|
e != null && e !== "" && t.push(q(e));
|
|
2556
2561
|
}), t;
|
|
2557
2562
|
}
|
|
2558
|
-
function
|
|
2563
|
+
function mi(e, t = {}) {
|
|
2559
2564
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
2560
2565
|
return n.forEach((e) => {
|
|
2561
2566
|
if (!e || e.clearValue) return;
|
|
2562
|
-
let n =
|
|
2567
|
+
let n = pi(e);
|
|
2563
2568
|
if (!n.length) return;
|
|
2564
|
-
let a =
|
|
2569
|
+
let a = $r(e, t) ? i : r;
|
|
2565
2570
|
n.forEach((e) => a.add(e));
|
|
2566
2571
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
2567
2572
|
}
|
|
2568
|
-
function
|
|
2569
|
-
let r =
|
|
2573
|
+
function hi(e = [], t, n) {
|
|
2574
|
+
let r = mi(t, n);
|
|
2570
2575
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
2571
2576
|
let i = new Set(r);
|
|
2572
2577
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(q(e.value)) || i.has(q(e.label))) : !i.has(q(e)));
|
|
2573
2578
|
}
|
|
2574
|
-
function
|
|
2579
|
+
function gi(e, t = {}, n) {
|
|
2575
2580
|
let r = Array.isArray(e) ? e : [];
|
|
2576
2581
|
if (n == null || n === "") return [];
|
|
2577
2582
|
let i = q(n), a = [], o = /* @__PURE__ */ new Set();
|
|
2578
2583
|
return r.forEach((e) => {
|
|
2579
2584
|
if (!e || e.clearValue) return;
|
|
2580
2585
|
let { setValue: n, setValueLabel: r } = e;
|
|
2581
|
-
n != null && n !== "" && r && q(n) === i &&
|
|
2586
|
+
n != null && n !== "" && r && q(n) === i && $r(e, t) && (o.has(q(n)) || (o.add(q(n)), a.push({
|
|
2582
2587
|
value: n,
|
|
2583
2588
|
label: r
|
|
2584
2589
|
})));
|
|
@@ -2586,27 +2591,27 @@ function hi(e, t = {}, n) {
|
|
|
2586
2591
|
}
|
|
2587
2592
|
//#endregion
|
|
2588
2593
|
//#region src/components/form/optionMembership.js
|
|
2589
|
-
var
|
|
2594
|
+
var _i = /* @__PURE__ */ new Set([
|
|
2590
2595
|
"select",
|
|
2591
2596
|
"radio",
|
|
2592
2597
|
"checkbox"
|
|
2593
|
-
]),
|
|
2594
|
-
function
|
|
2598
|
+
]), vi = 3e5, yi = 1e4, bi = (e) => e === !1 || e === 0 || e === "0" || e === "false", xi = (e) => e === !0 || e === 1 || e === "1" || e === "true", Si = (e) => e == null || e === "";
|
|
2599
|
+
function Ci(e) {
|
|
2595
2600
|
let t = e?.options ?? e?.values;
|
|
2596
2601
|
return Array.isArray(t) ? t : [];
|
|
2597
2602
|
}
|
|
2598
|
-
function Ci(e) {
|
|
2599
|
-
return String(e?.dataSource ?? "").trim().toLowerCase();
|
|
2600
|
-
}
|
|
2601
2603
|
function wi(e) {
|
|
2602
|
-
|
|
2603
|
-
let t = Ci(e);
|
|
2604
|
-
return t === "master" ? !0 : t === "" || t === "static" ? Si(e).length > 0 : !1;
|
|
2604
|
+
return String(e?.dataSource ?? "").trim().toLowerCase();
|
|
2605
2605
|
}
|
|
2606
2606
|
function Ti(e) {
|
|
2607
|
-
|
|
2607
|
+
if (!e || !_i.has(e.type) || bi(e.enforceOptions) || xi(e.allowCustomValues) || e.mode === "tags") return !1;
|
|
2608
|
+
let t = wi(e);
|
|
2609
|
+
return t === "master" ? !0 : t === "" || t === "static" ? Ci(e).length > 0 : !1;
|
|
2608
2610
|
}
|
|
2609
2611
|
function Ei(e) {
|
|
2612
|
+
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.id ?? e.label : e).filter((e) => !Si(e) && typeof e != "object" && typeof e != "boolean");
|
|
2613
|
+
}
|
|
2614
|
+
function Di(e) {
|
|
2610
2615
|
return e == null ? null : typeof e == "object" ? {
|
|
2611
2616
|
label: e.label ?? e.name ?? e.value,
|
|
2612
2617
|
value: e.value ?? e.id ?? e.name ?? e.label
|
|
@@ -2615,8 +2620,8 @@ function Ei(e) {
|
|
|
2615
2620
|
value: e
|
|
2616
2621
|
};
|
|
2617
2622
|
}
|
|
2618
|
-
var
|
|
2619
|
-
function
|
|
2623
|
+
var Oi = /* @__PURE__ */ new Map();
|
|
2624
|
+
function ki(e, t) {
|
|
2620
2625
|
return [
|
|
2621
2626
|
t,
|
|
2622
2627
|
e.field,
|
|
@@ -2624,26 +2629,26 @@ function Oi(e, t) {
|
|
|
2624
2629
|
e.groupName
|
|
2625
2630
|
].map((e) => e ?? "").join("|");
|
|
2626
2631
|
}
|
|
2627
|
-
async function
|
|
2628
|
-
let n =
|
|
2629
|
-
if (r && Date.now() - r.at <
|
|
2630
|
-
let i = Promise.resolve(ie(t, e.field, "",
|
|
2632
|
+
async function Ai(e, t) {
|
|
2633
|
+
let n = ki(e, t), r = Oi.get(n);
|
|
2634
|
+
if (r && Date.now() - r.at < vi) return r.promise;
|
|
2635
|
+
let i = Promise.resolve(ie(t, e.field, "", yi, 0, {
|
|
2631
2636
|
dataSource: "master",
|
|
2632
2637
|
masterName: e.masterName,
|
|
2633
2638
|
groupName: e.groupName
|
|
2634
2639
|
})).then((e) => {
|
|
2635
2640
|
let t = Array.isArray(e) ? e : e?.data ?? [];
|
|
2636
|
-
return (Array.isArray(t) ? t : []).map(
|
|
2641
|
+
return (Array.isArray(t) ? t : []).map(Di).filter(Boolean);
|
|
2637
2642
|
});
|
|
2638
|
-
return
|
|
2643
|
+
return Oi.set(n, {
|
|
2639
2644
|
at: Date.now(),
|
|
2640
2645
|
promise: i
|
|
2641
|
-
}), i.catch(() =>
|
|
2646
|
+
}), i.catch(() => Oi.delete(n)), i;
|
|
2642
2647
|
}
|
|
2643
|
-
async function
|
|
2644
|
-
return
|
|
2648
|
+
async function ji(e, { moduleName: t } = {}) {
|
|
2649
|
+
return wi(e) === "master" ? Ai(e, t) : Ci(e).map(Di).filter(Boolean);
|
|
2645
2650
|
}
|
|
2646
|
-
function
|
|
2651
|
+
function Mi(e) {
|
|
2647
2652
|
let t = /* @__PURE__ */ new Map();
|
|
2648
2653
|
return e.forEach((e) => {
|
|
2649
2654
|
[[e.label, e.label], [e.value, e.value]].forEach(([e, n]) => {
|
|
@@ -2652,16 +2657,16 @@ function ji(e) {
|
|
|
2652
2657
|
});
|
|
2653
2658
|
}), t;
|
|
2654
2659
|
}
|
|
2655
|
-
async function
|
|
2656
|
-
let i =
|
|
2660
|
+
async function Ni(e, t, { moduleName: n, constraintValue: r } = {}) {
|
|
2661
|
+
let i = Ei(t);
|
|
2657
2662
|
if (!i.length) return {
|
|
2658
2663
|
offList: [],
|
|
2659
2664
|
snaps: /* @__PURE__ */ new Map(),
|
|
2660
2665
|
options: []
|
|
2661
2666
|
};
|
|
2662
|
-
let a = await
|
|
2663
|
-
e.optionsFromField && (a =
|
|
2664
|
-
let o =
|
|
2667
|
+
let a = await ji(e, { moduleName: n });
|
|
2668
|
+
e.optionsFromField && (a = fi(a, r));
|
|
2669
|
+
let o = wi(e) === "master", s = o ? Mi(a) : c({
|
|
2665
2670
|
options: a,
|
|
2666
2671
|
optionAliases: e.optionAliases
|
|
2667
2672
|
}), l = new Set(a.flatMap((e) => o ? [String(e.value), String(e.label)] : [String(e.value)])), u = [], d = /* @__PURE__ */ new Map();
|
|
@@ -2675,32 +2680,32 @@ async function Mi(e, t, { moduleName: n, constraintValue: r } = {}) {
|
|
|
2675
2680
|
options: a
|
|
2676
2681
|
};
|
|
2677
2682
|
}
|
|
2678
|
-
function
|
|
2683
|
+
function Pi(e, t) {
|
|
2679
2684
|
let n = e.label || e.field || "this field";
|
|
2680
2685
|
if (e.optionsMismatchMessage) return e.optionsMismatchMessage;
|
|
2681
2686
|
let r = t.map((e) => `"${e}"`).join(", ");
|
|
2682
2687
|
return t.length === 1 ? `${r} is not in the ${n} list. Please choose an option from the dropdown.` : `${r} are not in the ${n} list. Please choose options from the dropdown.`;
|
|
2683
2688
|
}
|
|
2684
|
-
function
|
|
2689
|
+
function Fi(e = [], t = []) {
|
|
2685
2690
|
let n = t[0];
|
|
2686
2691
|
return e.find((e) => e?.name === n || e?.payloadKey === n) ?? e.find((e) => (e?.fields ?? []).some((e) => e?.field === n));
|
|
2687
2692
|
}
|
|
2688
|
-
var
|
|
2689
|
-
function
|
|
2690
|
-
let t =
|
|
2693
|
+
var Ii = /* @__PURE__ */ new WeakMap();
|
|
2694
|
+
function Li(e) {
|
|
2695
|
+
let t = Ii.get(e);
|
|
2691
2696
|
return t || (t = {
|
|
2692
2697
|
entries: /* @__PURE__ */ new Map(),
|
|
2693
2698
|
listeners: /* @__PURE__ */ new Set(),
|
|
2694
2699
|
snapshot: []
|
|
2695
|
-
},
|
|
2700
|
+
}, Ii.set(e, t)), t;
|
|
2696
2701
|
}
|
|
2697
|
-
var
|
|
2698
|
-
function
|
|
2702
|
+
var Ri = (e) => JSON.stringify(Array.isArray(e) ? e : [e]);
|
|
2703
|
+
function zi(e) {
|
|
2699
2704
|
e.snapshot = [...e.entries.values()], e.listeners.forEach((e) => e());
|
|
2700
2705
|
}
|
|
2701
2706
|
function J(e, t, n) {
|
|
2702
2707
|
if (!e) return;
|
|
2703
|
-
let r =
|
|
2708
|
+
let r = Li(e), i = Ri(t);
|
|
2704
2709
|
if (n) {
|
|
2705
2710
|
let e = r.entries.get(i);
|
|
2706
2711
|
if (e && e.message === n.message) return;
|
|
@@ -2710,19 +2715,19 @@ function J(e, t, n) {
|
|
|
2710
2715
|
});
|
|
2711
2716
|
} else if (r.entries.has(i)) r.entries.delete(i);
|
|
2712
2717
|
else return;
|
|
2713
|
-
|
|
2714
|
-
}
|
|
2715
|
-
function zi(e) {
|
|
2716
|
-
return e ? Ii(e).snapshot : [];
|
|
2718
|
+
zi(r);
|
|
2717
2719
|
}
|
|
2718
2720
|
function Bi(e) {
|
|
2721
|
+
return e ? Li(e).snapshot : [];
|
|
2722
|
+
}
|
|
2723
|
+
function Vi(e) {
|
|
2719
2724
|
return _e((t) => {
|
|
2720
2725
|
if (!e) return () => {};
|
|
2721
|
-
let n =
|
|
2726
|
+
let n = Li(e);
|
|
2722
2727
|
return n.listeners.add(t), () => n.listeners.delete(t);
|
|
2723
|
-
}, () =>
|
|
2728
|
+
}, () => Bi(e), () => Bi(e));
|
|
2724
2729
|
}
|
|
2725
|
-
function
|
|
2730
|
+
function Hi(e, t, n) {
|
|
2726
2731
|
if (!n) return;
|
|
2727
2732
|
let r = String(n).split(".").map((e) => e.trim()).filter(Boolean);
|
|
2728
2733
|
if (Array.isArray(t) && t.length >= 3 && typeof t[1] == "number") {
|
|
@@ -2731,21 +2736,21 @@ function Vi(e, t, n) {
|
|
|
2731
2736
|
t[1],
|
|
2732
2737
|
...r
|
|
2733
2738
|
]);
|
|
2734
|
-
if (!
|
|
2739
|
+
if (!Si(n)) return n;
|
|
2735
2740
|
}
|
|
2736
2741
|
return e.getFieldValue(r);
|
|
2737
2742
|
}
|
|
2738
|
-
function
|
|
2743
|
+
function Ui({ field: e, form: t, name: n, moduleName: r }) {
|
|
2739
2744
|
return { validator: async (i, a) => {
|
|
2740
|
-
if (!
|
|
2745
|
+
if (!Ei(a).length) {
|
|
2741
2746
|
J(t, n, null);
|
|
2742
2747
|
return;
|
|
2743
2748
|
}
|
|
2744
2749
|
let o;
|
|
2745
2750
|
try {
|
|
2746
|
-
o = await
|
|
2751
|
+
o = await Ni(e, a, {
|
|
2747
2752
|
moduleName: r,
|
|
2748
|
-
constraintValue:
|
|
2753
|
+
constraintValue: Hi(t, n, e.optionsFromField)
|
|
2749
2754
|
});
|
|
2750
2755
|
} catch (r) {
|
|
2751
2756
|
console.warn(`[optionMembership] could not load options for "${e.field}"`, r), J(t, n, null);
|
|
@@ -2755,7 +2760,7 @@ function Hi({ field: e, form: t, name: n, moduleName: r }) {
|
|
|
2755
2760
|
J(t, n, null);
|
|
2756
2761
|
return;
|
|
2757
2762
|
}
|
|
2758
|
-
let s =
|
|
2763
|
+
let s = Pi(e, o.offList);
|
|
2759
2764
|
throw J(t, n, {
|
|
2760
2765
|
field: e.field,
|
|
2761
2766
|
label: e.label || e.field,
|
|
@@ -2764,7 +2769,7 @@ function Hi({ field: e, form: t, name: n, moduleName: r }) {
|
|
|
2764
2769
|
}), Error(s);
|
|
2765
2770
|
} };
|
|
2766
2771
|
}
|
|
2767
|
-
function
|
|
2772
|
+
function Wi(e, t, { labeled: n = !1, options: r = [] } = {}) {
|
|
2768
2773
|
if (!t?.size) return;
|
|
2769
2774
|
let i = (e) => r.find((t) => String(t.value) === String(e)) ?? r.find((t) => String(t.label) === String(e)), a = (e) => {
|
|
2770
2775
|
let r = e && typeof e == "object" ? e.value : e;
|
|
@@ -2779,17 +2784,17 @@ function Ui(e, t, { labeled: n = !1, options: r = [] } = {}) {
|
|
|
2779
2784
|
};
|
|
2780
2785
|
return Array.isArray(e) ? e.map(a) : a(e);
|
|
2781
2786
|
}
|
|
2782
|
-
function
|
|
2783
|
-
let s = !!(o && t && n !== void 0 &&
|
|
2787
|
+
function Gi({ field: e, form: t, name: n, moduleName: r, value: i, constraintValue: a, enabled: o = !0 }) {
|
|
2788
|
+
let s = !!(o && t && n !== void 0 && Ti(e)), c = s ? JSON.stringify(Ei(i)) : "[]", l = s && e.optionsFromField ? JSON.stringify(a ?? null) : "", u = Ri(n);
|
|
2784
2789
|
S(() => {
|
|
2785
2790
|
if (!s || c === "[]") return;
|
|
2786
2791
|
let i = !1;
|
|
2787
|
-
return
|
|
2792
|
+
return Ni(e, t.getFieldValue(n), {
|
|
2788
2793
|
moduleName: r,
|
|
2789
2794
|
constraintValue: a
|
|
2790
2795
|
}).then(({ offList: r, snaps: a, options: o }) => {
|
|
2791
2796
|
if (i) return;
|
|
2792
|
-
let s =
|
|
2797
|
+
let s = Wi(t.getFieldValue(n), a, {
|
|
2793
2798
|
labeled: d(e),
|
|
2794
2799
|
options: o
|
|
2795
2800
|
});
|
|
@@ -2814,12 +2819,12 @@ function Wi({ field: e, form: t, name: n, moduleName: r, value: i, constraintVal
|
|
|
2814
2819
|
}
|
|
2815
2820
|
//#endregion
|
|
2816
2821
|
//#region src/components/form/OptionMismatchBanner.jsx
|
|
2817
|
-
function
|
|
2818
|
-
let n =
|
|
2822
|
+
function Ki(e, t) {
|
|
2823
|
+
let n = Fi(e, t), r = n?.label || n?.name, i = t.length >= 3 && typeof t[1] == "number";
|
|
2819
2824
|
return r ? i ? `${r} #${t[1] + 1}` : r : "";
|
|
2820
2825
|
}
|
|
2821
|
-
function
|
|
2822
|
-
let r =
|
|
2826
|
+
function qi({ form: e, groups: t, onJump: n }) {
|
|
2827
|
+
let r = Vi(e);
|
|
2823
2828
|
if (!r.length) return null;
|
|
2824
2829
|
let i = r.length;
|
|
2825
2830
|
return /* @__PURE__ */ O(ve, {
|
|
@@ -2837,7 +2842,7 @@ function Ki({ form: e, groups: t, onJump: n }) {
|
|
|
2837
2842
|
paddingInlineStart: 18
|
|
2838
2843
|
},
|
|
2839
2844
|
children: r.map((e) => {
|
|
2840
|
-
let r =
|
|
2845
|
+
let r = Ki(t, e.path);
|
|
2841
2846
|
return /* @__PURE__ */ k("li", { children: [
|
|
2842
2847
|
/* @__PURE__ */ k(De.Link, {
|
|
2843
2848
|
onClick: () => n?.(e.path),
|
|
@@ -2852,8 +2857,8 @@ function Ki({ form: e, groups: t, onJump: n }) {
|
|
|
2852
2857
|
}
|
|
2853
2858
|
//#endregion
|
|
2854
2859
|
//#region src/components/form/optionRowFilters.js
|
|
2855
|
-
var
|
|
2856
|
-
function
|
|
2860
|
+
var Ji = 64;
|
|
2861
|
+
function Yi(e) {
|
|
2857
2862
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
2858
2863
|
try {
|
|
2859
2864
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -2861,34 +2866,34 @@ function Ji(e) {
|
|
|
2861
2866
|
return "";
|
|
2862
2867
|
}
|
|
2863
2868
|
}
|
|
2864
|
-
var Y = (e) => String(e ?? "").trim().toLowerCase(),
|
|
2865
|
-
function
|
|
2869
|
+
var Y = (e) => String(e ?? "").trim().toLowerCase(), Xi = (e) => e != null && String(e).trim() !== "";
|
|
2870
|
+
function Zi(e) {
|
|
2866
2871
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
2867
2872
|
return new Set(t.map(Y).filter((e) => e !== ""));
|
|
2868
2873
|
}
|
|
2869
|
-
function
|
|
2870
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
2874
|
+
function Qi(e, t) {
|
|
2875
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => Xi(e?.extraData?.[t]));
|
|
2871
2876
|
}
|
|
2872
|
-
function
|
|
2877
|
+
function $i(e, t, n) {
|
|
2873
2878
|
let r = e?.extraData?.[t];
|
|
2874
|
-
if (!
|
|
2875
|
-
let i =
|
|
2879
|
+
if (!Xi(n)) return r === !0;
|
|
2880
|
+
let i = Zi(n);
|
|
2876
2881
|
return i.size === 0 ? r === !0 : i.has(Y(r));
|
|
2877
2882
|
}
|
|
2878
|
-
function
|
|
2883
|
+
function ea(e, t) {
|
|
2879
2884
|
let n = /* @__PURE__ */ new Map();
|
|
2880
2885
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
2881
2886
|
let r = Y(e?.value);
|
|
2882
2887
|
r && n.set(r, Y(e?.extraData?.[t]));
|
|
2883
2888
|
}), n;
|
|
2884
2889
|
}
|
|
2885
|
-
function
|
|
2890
|
+
function ta(e, t, n) {
|
|
2886
2891
|
let r = Y(n);
|
|
2887
2892
|
if (!r) return !1;
|
|
2888
2893
|
let i = /* @__PURE__ */ new Set(), a = Y(e);
|
|
2889
2894
|
if (!a) return !1;
|
|
2890
2895
|
i.add(a);
|
|
2891
|
-
for (let e = 0; e <
|
|
2896
|
+
for (let e = 0; e < Ji; e += 1) {
|
|
2892
2897
|
let e = t.get(a);
|
|
2893
2898
|
if (!e) return !1;
|
|
2894
2899
|
if (e === r) return !0;
|
|
@@ -2897,56 +2902,56 @@ function ea(e, t, n) {
|
|
|
2897
2902
|
}
|
|
2898
2903
|
return !1;
|
|
2899
2904
|
}
|
|
2900
|
-
function
|
|
2905
|
+
function na(e = {}) {
|
|
2901
2906
|
let t = [], n = (e) => {
|
|
2902
2907
|
let n = String(e ?? "").trim();
|
|
2903
2908
|
n && !t.includes(n) && t.push(n);
|
|
2904
2909
|
};
|
|
2905
2910
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
2906
2911
|
}
|
|
2907
|
-
function
|
|
2912
|
+
function ra(e, t = {}, n = {}) {
|
|
2908
2913
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
2909
2914
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
2910
2915
|
typeof console < "u" && console.warn(e);
|
|
2911
2916
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
2912
|
-
s && (
|
|
2917
|
+
s && (Qi(o, s) ? o = o.filter((e) => $i(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".`));
|
|
2913
2918
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
2914
2919
|
if (c) {
|
|
2915
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
2920
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Yi(n);
|
|
2916
2921
|
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.`);
|
|
2917
|
-
else if (!
|
|
2922
|
+
else if (!Qi(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".`);
|
|
2918
2923
|
else {
|
|
2919
|
-
let t =
|
|
2920
|
-
o = o.filter((e) =>
|
|
2924
|
+
let t = ea(e, c);
|
|
2925
|
+
o = o.filter((e) => ta(e?.value, t, s));
|
|
2921
2926
|
}
|
|
2922
2927
|
}
|
|
2923
2928
|
return o;
|
|
2924
2929
|
}
|
|
2925
2930
|
//#endregion
|
|
2926
2931
|
//#region src/components/form/fieldTooltip.js
|
|
2927
|
-
var
|
|
2928
|
-
function
|
|
2929
|
-
return
|
|
2932
|
+
var ia = (e) => e == null || String(e).trim() === "", aa = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2933
|
+
function oa(e) {
|
|
2934
|
+
return ia(e?.tooltip) ? aa(e?.infoEnabled) && !ia(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
2930
2935
|
}
|
|
2931
2936
|
//#endregion
|
|
2932
2937
|
//#region src/components/form/autofillValue.js
|
|
2933
|
-
var
|
|
2934
|
-
function
|
|
2938
|
+
var sa = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
2939
|
+
function ca(e, t = {}, n = () => void 0) {
|
|
2935
2940
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
2936
|
-
return
|
|
2941
|
+
return sa(i) && a != null && a !== "" ? a : i;
|
|
2937
2942
|
}
|
|
2938
2943
|
//#endregion
|
|
2939
2944
|
//#region src/components/form/dependentLookupReset.js
|
|
2940
|
-
var
|
|
2941
|
-
function
|
|
2942
|
-
return !(!r || e ===
|
|
2945
|
+
var la = Symbol("parentFilterUnseen"), ua = (e) => e == null || e === "", da = (e, t) => String(e ?? "") === String(t ?? "");
|
|
2946
|
+
function fa({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
2947
|
+
return !(!r || e === la || da(e, t) || ua(e) || ua(n));
|
|
2943
2948
|
}
|
|
2944
2949
|
//#endregion
|
|
2945
2950
|
//#region src/utils/afterSubmitNav.js
|
|
2946
|
-
function
|
|
2951
|
+
function pa(e) {
|
|
2947
2952
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
2948
2953
|
}
|
|
2949
|
-
function
|
|
2954
|
+
function ma(e, t, n) {
|
|
2950
2955
|
let r = String(e ?? "").trim();
|
|
2951
2956
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
2952
2957
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -2955,21 +2960,21 @@ function pa(e, t, n) {
|
|
|
2955
2960
|
}
|
|
2956
2961
|
//#endregion
|
|
2957
2962
|
//#region src/utils/backNav.js
|
|
2958
|
-
function
|
|
2963
|
+
function ha(e = typeof window < "u" ? window : void 0) {
|
|
2959
2964
|
let t = e?.history?.state?.idx;
|
|
2960
2965
|
return typeof t == "number" && t > 0;
|
|
2961
2966
|
}
|
|
2962
|
-
function
|
|
2963
|
-
return t && e ? { path: e } :
|
|
2967
|
+
function ga({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
2968
|
+
return t && e ? { path: e } : ha(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
2964
2969
|
}
|
|
2965
|
-
function
|
|
2966
|
-
let n =
|
|
2970
|
+
function _a(e, t = {}) {
|
|
2971
|
+
let n = ga(t);
|
|
2967
2972
|
return n.back ? e(-1) : e(n.path), n;
|
|
2968
2973
|
}
|
|
2969
2974
|
//#endregion
|
|
2970
2975
|
//#region src/components/form/educationRules.js
|
|
2971
2976
|
var X = (e) => e == null ? "" : String(e).trim();
|
|
2972
|
-
function
|
|
2977
|
+
function va(e, t) {
|
|
2973
2978
|
let n = e?.regionRules;
|
|
2974
2979
|
if (!n || typeof n != "object") return e ?? {};
|
|
2975
2980
|
let r = X(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
@@ -2978,27 +2983,27 @@ function _a(e, t) {
|
|
|
2978
2983
|
...i
|
|
2979
2984
|
};
|
|
2980
2985
|
}
|
|
2981
|
-
function va(e) {
|
|
2982
|
-
return e?.allowInProgress !== !1;
|
|
2983
|
-
}
|
|
2984
2986
|
function ya(e) {
|
|
2985
|
-
return
|
|
2987
|
+
return e?.allowInProgress !== !1;
|
|
2986
2988
|
}
|
|
2987
2989
|
function ba(e) {
|
|
2988
|
-
return
|
|
2990
|
+
return ya(e) ? "" : Ca(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.";
|
|
2989
2991
|
}
|
|
2990
2992
|
function xa(e) {
|
|
2991
|
-
return
|
|
2993
|
+
return ya(e) ? "allow" : X(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
2992
2994
|
}
|
|
2993
2995
|
function Sa(e) {
|
|
2994
|
-
return
|
|
2996
|
+
return xa(e) === "block";
|
|
2995
2997
|
}
|
|
2996
2998
|
function Ca(e) {
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
+
return xa(e) === "warn";
|
|
3000
|
+
}
|
|
3001
|
+
function wa(e) {
|
|
3002
|
+
if (!Sa(e)) return null;
|
|
3003
|
+
let t = ba(e);
|
|
2999
3004
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
3000
3005
|
}
|
|
3001
|
-
function
|
|
3006
|
+
function Ta(e, t = {}) {
|
|
3002
3007
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
3003
3008
|
for (let t of [n, r]) {
|
|
3004
3009
|
let n = e?.[t];
|
|
@@ -3008,47 +3013,47 @@ function wa(e, t = {}) {
|
|
|
3008
3013
|
}
|
|
3009
3014
|
return null;
|
|
3010
3015
|
}
|
|
3011
|
-
function
|
|
3016
|
+
function Ea(e, t = {}) {
|
|
3012
3017
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
3013
3018
|
return !!e?.[n];
|
|
3014
3019
|
}
|
|
3015
|
-
function
|
|
3020
|
+
function Da(e = [], t = {}) {
|
|
3016
3021
|
let n = (t.direction ?? "desc") === "desc";
|
|
3017
3022
|
return e.map((e, n) => ({
|
|
3018
3023
|
index: n,
|
|
3019
|
-
key:
|
|
3020
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
3024
|
+
key: Ta(e, t),
|
|
3025
|
+
ongoing: t.inProgressFirst !== !1 && Ea(e, t)
|
|
3021
3026
|
})).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);
|
|
3022
3027
|
}
|
|
3023
|
-
function
|
|
3028
|
+
function Oa(e, t, n = {}) {
|
|
3024
3029
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
3025
|
-
let r =
|
|
3030
|
+
let r = Da(e, n).indexOf(t);
|
|
3026
3031
|
return r === -1 || r === t ? null : {
|
|
3027
3032
|
from: t,
|
|
3028
3033
|
to: r,
|
|
3029
|
-
reason:
|
|
3034
|
+
reason: Ea(e[t], n) ? "inProgress" : "outOfOrder"
|
|
3030
3035
|
};
|
|
3031
3036
|
}
|
|
3032
|
-
var
|
|
3037
|
+
var ka = Object.freeze({
|
|
3033
3038
|
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.",
|
|
3034
3039
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
3035
3040
|
ok: "Yes, move it up",
|
|
3036
3041
|
keep: "No, leave it here"
|
|
3037
3042
|
});
|
|
3038
|
-
function
|
|
3043
|
+
function Aa(e, t = {}) {
|
|
3039
3044
|
let n = {
|
|
3040
|
-
...
|
|
3045
|
+
...ka,
|
|
3041
3046
|
...t.messages ?? {}
|
|
3042
3047
|
};
|
|
3043
3048
|
return n[e] ?? n.outOfOrder;
|
|
3044
3049
|
}
|
|
3045
|
-
function
|
|
3050
|
+
function ja(e, t = {}) {
|
|
3046
3051
|
let n = t.levelField ?? "qualification", r = X(e?.[n]);
|
|
3047
3052
|
if (!r) return null;
|
|
3048
3053
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
3049
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
3054
|
+
return Number.isFinite(Number(a)) ? Number(a) : Ma(r, t);
|
|
3050
3055
|
}
|
|
3051
|
-
function
|
|
3056
|
+
function Ma(e, t) {
|
|
3052
3057
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
3053
3058
|
for (let e of n) {
|
|
3054
3059
|
let t = X(e?.match);
|
|
@@ -3063,14 +3068,14 @@ function ja(e, t) {
|
|
|
3063
3068
|
}
|
|
3064
3069
|
return null;
|
|
3065
3070
|
}
|
|
3066
|
-
function
|
|
3071
|
+
function Na(e, t = {}) {
|
|
3067
3072
|
return X((t?.levelLabels ?? {})[e]) || X(e);
|
|
3068
3073
|
}
|
|
3069
|
-
function
|
|
3074
|
+
function Pa(e = [], t = {}) {
|
|
3070
3075
|
if (!t || t.requireBelow === !1) return [];
|
|
3071
3076
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
3072
3077
|
if (!r.length) return [];
|
|
3073
|
-
let i = e.map((e) =>
|
|
3078
|
+
let i = e.map((e) => ja(e, t)).filter((e) => e !== null);
|
|
3074
3079
|
if (!i.length) return [];
|
|
3075
3080
|
let a = Math.max(...i), o = [];
|
|
3076
3081
|
return r.forEach((e) => {
|
|
@@ -3078,43 +3083,43 @@ function Na(e = [], t = {}) {
|
|
|
3078
3083
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
3079
3084
|
}), o;
|
|
3080
3085
|
}
|
|
3081
|
-
function
|
|
3082
|
-
let n =
|
|
3086
|
+
function Fa(e, t = {}) {
|
|
3087
|
+
let n = Pa(e, t);
|
|
3083
3088
|
if (!n.length) return "";
|
|
3084
|
-
let r = n.map((e) =>
|
|
3089
|
+
let r = n.map((e) => Na(e, t)).join(", ");
|
|
3085
3090
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
3086
3091
|
}
|
|
3087
|
-
async function
|
|
3092
|
+
async function Ia({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
3088
3093
|
let a = e?.orderBy;
|
|
3089
3094
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
3090
|
-
let o =
|
|
3095
|
+
let o = Oa(t, n, a);
|
|
3091
3096
|
if (!o) return !1;
|
|
3092
3097
|
let s = {
|
|
3093
|
-
...
|
|
3098
|
+
...ka,
|
|
3094
3099
|
...a.messages ?? {}
|
|
3095
3100
|
};
|
|
3096
3101
|
return await i({
|
|
3097
3102
|
reason: o.reason,
|
|
3098
3103
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
3099
|
-
body:
|
|
3104
|
+
body: Aa(o.reason, a),
|
|
3100
3105
|
okText: s.ok,
|
|
3101
3106
|
cancelText: s.keep,
|
|
3102
3107
|
from: o.from,
|
|
3103
3108
|
to: o.to
|
|
3104
3109
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
3105
3110
|
}
|
|
3106
|
-
function
|
|
3107
|
-
let n =
|
|
3111
|
+
function La(e, t) {
|
|
3112
|
+
let n = va(e, t), r = n?.orderBy?.inProgressField;
|
|
3108
3113
|
return r ? {
|
|
3109
3114
|
name: n.name,
|
|
3110
3115
|
label: n.label ?? n.name,
|
|
3111
3116
|
rowsKey: n.payloadKey || n.name,
|
|
3112
3117
|
inProgressField: r,
|
|
3113
|
-
severity:
|
|
3114
|
-
message:
|
|
3118
|
+
severity: xa(n),
|
|
3119
|
+
message: ba(n)
|
|
3115
3120
|
} : null;
|
|
3116
3121
|
}
|
|
3117
|
-
function
|
|
3122
|
+
function Ra(e = [], t, n) {
|
|
3118
3123
|
if (!n) return {
|
|
3119
3124
|
severity: "allow",
|
|
3120
3125
|
message: "",
|
|
@@ -3122,8 +3127,8 @@ function La(e = [], t, n) {
|
|
|
3122
3127
|
};
|
|
3123
3128
|
let r = null;
|
|
3124
3129
|
for (let i of e) {
|
|
3125
|
-
let e =
|
|
3126
|
-
if (!(!e || e.severity === "allow") &&
|
|
3130
|
+
let e = La(i, t);
|
|
3131
|
+
if (!(!e || e.severity === "allow") && za(n, e.rowsKey).some((t) => Ea(t, e))) {
|
|
3127
3132
|
if (e.severity === "block") return {
|
|
3128
3133
|
severity: "block",
|
|
3129
3134
|
message: e.message,
|
|
@@ -3142,23 +3147,23 @@ function La(e = [], t, n) {
|
|
|
3142
3147
|
group: null
|
|
3143
3148
|
};
|
|
3144
3149
|
}
|
|
3145
|
-
function
|
|
3150
|
+
function za(e, t) {
|
|
3146
3151
|
let n = e?.[t];
|
|
3147
3152
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
3148
3153
|
}
|
|
3149
|
-
function
|
|
3154
|
+
function Ba(e) {
|
|
3150
3155
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
3151
3156
|
}
|
|
3152
|
-
function
|
|
3157
|
+
function Va(e = [], t = {}) {
|
|
3153
3158
|
let n = null;
|
|
3154
3159
|
for (let r of e) {
|
|
3155
3160
|
let e = r?.levelRule;
|
|
3156
3161
|
if (!e) continue;
|
|
3157
|
-
let i =
|
|
3162
|
+
let i = Ha(t, r);
|
|
3158
3163
|
if (!i.length) continue;
|
|
3159
|
-
let a =
|
|
3164
|
+
let a = Fa(i, e);
|
|
3160
3165
|
if (a) {
|
|
3161
|
-
if (
|
|
3166
|
+
if (Ba(e) === "block") return {
|
|
3162
3167
|
severity: "block",
|
|
3163
3168
|
message: a,
|
|
3164
3169
|
group: r
|
|
@@ -3176,7 +3181,7 @@ function Ba(e = [], t = {}) {
|
|
|
3176
3181
|
group: null
|
|
3177
3182
|
};
|
|
3178
3183
|
}
|
|
3179
|
-
function
|
|
3184
|
+
function Ha(e, t) {
|
|
3180
3185
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
3181
3186
|
if (!n) continue;
|
|
3182
3187
|
let t = e?.[n];
|
|
@@ -3186,10 +3191,10 @@ function Va(e, t) {
|
|
|
3186
3191
|
}
|
|
3187
3192
|
//#endregion
|
|
3188
3193
|
//#region src/components/form/clearGroupOnChange.js
|
|
3189
|
-
function
|
|
3194
|
+
function Ua(e, t) {
|
|
3190
3195
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
3191
3196
|
}
|
|
3192
|
-
function
|
|
3197
|
+
function Wa(e, t) {
|
|
3193
3198
|
let n = e?.field, r = [];
|
|
3194
3199
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
3195
3200
|
e && e !== n && r.push(e);
|
|
@@ -3199,24 +3204,24 @@ function Ua(e, t) {
|
|
|
3199
3204
|
e && e !== n && r.push(e);
|
|
3200
3205
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
3201
3206
|
}
|
|
3202
|
-
function
|
|
3203
|
-
let i =
|
|
3207
|
+
function Ga(e, t, n, r) {
|
|
3208
|
+
let i = Wa(t, r).map((e) => Ua(n, e));
|
|
3204
3209
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
3205
3210
|
}
|
|
3206
3211
|
//#endregion
|
|
3207
3212
|
//#region src/components/form/resolveStoredOptions.js
|
|
3208
|
-
function
|
|
3213
|
+
function Ka(e) {
|
|
3209
3214
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
3210
3215
|
}
|
|
3211
|
-
function
|
|
3216
|
+
function qa(e, t = []) {
|
|
3212
3217
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
3213
|
-
for (let t of
|
|
3218
|
+
for (let t of Ka(e)) {
|
|
3214
3219
|
let e = String(t);
|
|
3215
3220
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
3216
3221
|
}
|
|
3217
3222
|
return r;
|
|
3218
3223
|
}
|
|
3219
|
-
async function
|
|
3224
|
+
async function Ja(e, t) {
|
|
3220
3225
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
3221
3226
|
let n = new URLSearchParams({
|
|
3222
3227
|
collection: e.lookupCollection,
|
|
@@ -3228,7 +3233,7 @@ async function qa(e, t) {
|
|
|
3228
3233
|
let i = await o(r, `/admin/lookup-dropdown-values?${n}`), a = i?.data ?? i ?? [];
|
|
3229
3234
|
return Array.isArray(a) ? a : [];
|
|
3230
3235
|
}
|
|
3231
|
-
function
|
|
3236
|
+
function Ya(e = [], t = []) {
|
|
3232
3237
|
if (!t.length) return e;
|
|
3233
3238
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
3234
3239
|
...e,
|
|
@@ -3238,25 +3243,25 @@ function Ja(e = [], t = []) {
|
|
|
3238
3243
|
}
|
|
3239
3244
|
//#endregion
|
|
3240
3245
|
//#region src/components/form/requireAnyOf.js
|
|
3241
|
-
var
|
|
3242
|
-
function
|
|
3246
|
+
var Xa = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
3247
|
+
function Za(e) {
|
|
3243
3248
|
let t = e?.requireAnyOf;
|
|
3244
3249
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
3245
3250
|
}
|
|
3246
|
-
function
|
|
3247
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
3251
|
+
function Qa(e) {
|
|
3252
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !Xa(e));
|
|
3248
3253
|
}
|
|
3249
|
-
function
|
|
3250
|
-
let n =
|
|
3254
|
+
function $a({ field: e, getRow: t }) {
|
|
3255
|
+
let n = Za(e);
|
|
3251
3256
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
3252
3257
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
3253
3258
|
return { validator: async () => {
|
|
3254
3259
|
let e = t?.() ?? {};
|
|
3255
|
-
return
|
|
3260
|
+
return Qa(e) ? n.some((t) => !Xa(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
3256
3261
|
} };
|
|
3257
3262
|
}
|
|
3258
|
-
function
|
|
3259
|
-
let n =
|
|
3263
|
+
function eo(e, t = []) {
|
|
3264
|
+
let n = Za(e);
|
|
3260
3265
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
3261
3266
|
...t,
|
|
3262
3267
|
requireAnyOf: n,
|
|
@@ -3266,7 +3271,7 @@ function $a(e, t = []) {
|
|
|
3266
3271
|
//#endregion
|
|
3267
3272
|
//#region src/components/form/dateRules.js
|
|
3268
3273
|
var Z = (e) => e == null || e === "";
|
|
3269
|
-
function
|
|
3274
|
+
function to(e) {
|
|
3270
3275
|
if (!e) return null;
|
|
3271
3276
|
if (typeof e.valueOf == "function") {
|
|
3272
3277
|
let t = e.valueOf();
|
|
@@ -3280,12 +3285,12 @@ function Q(e) {
|
|
|
3280
3285
|
let t = A(e);
|
|
3281
3286
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
3282
3287
|
}
|
|
3283
|
-
function
|
|
3288
|
+
function no(e) {
|
|
3284
3289
|
if (!e) return null;
|
|
3285
3290
|
let t = A(e);
|
|
3286
3291
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
3287
3292
|
}
|
|
3288
|
-
var
|
|
3293
|
+
var ro = {
|
|
3289
3294
|
d: "day",
|
|
3290
3295
|
day: "day",
|
|
3291
3296
|
days: "day",
|
|
@@ -3301,13 +3306,13 @@ var no = {
|
|
|
3301
3306
|
year: "year",
|
|
3302
3307
|
years: "year"
|
|
3303
3308
|
};
|
|
3304
|
-
function
|
|
3309
|
+
function io(e) {
|
|
3305
3310
|
if (e == null || e === "") return null;
|
|
3306
3311
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
3307
3312
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
3308
3313
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
3309
3314
|
value: t,
|
|
3310
|
-
unit:
|
|
3315
|
+
unit: ro[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
3311
3316
|
};
|
|
3312
3317
|
}
|
|
3313
3318
|
let t = String(e).trim().toLowerCase();
|
|
@@ -3317,49 +3322,49 @@ function ro(e) {
|
|
|
3317
3322
|
let r = Number(n[1]);
|
|
3318
3323
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
3319
3324
|
value: r,
|
|
3320
|
-
unit:
|
|
3325
|
+
unit: ro[n[2]] ?? "month"
|
|
3321
3326
|
};
|
|
3322
3327
|
}
|
|
3323
|
-
function
|
|
3328
|
+
function ao(e, t) {
|
|
3324
3329
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
3325
3330
|
if (n && typeof t == "function") {
|
|
3326
|
-
let e =
|
|
3331
|
+
let e = io(t(n));
|
|
3327
3332
|
if (e) return e;
|
|
3328
3333
|
}
|
|
3329
|
-
return
|
|
3334
|
+
return io(e?.minGap);
|
|
3330
3335
|
}
|
|
3331
|
-
function
|
|
3336
|
+
function oo(e, t, n, r) {
|
|
3332
3337
|
if (t === null) return null;
|
|
3333
|
-
let i =
|
|
3338
|
+
let i = ao(n, r), a = A(t);
|
|
3334
3339
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
3335
3340
|
}
|
|
3336
|
-
function
|
|
3341
|
+
function so(e, t, n, r, i) {
|
|
3337
3342
|
if (t === null || n === null) return !1;
|
|
3338
|
-
let a =
|
|
3343
|
+
let a = oo(e, n, r, i);
|
|
3339
3344
|
if (a === null) return !1;
|
|
3340
|
-
let o = !!r?.strict && !
|
|
3345
|
+
let o = !!r?.strict && !ao(r, i);
|
|
3341
3346
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
3342
3347
|
}
|
|
3343
|
-
function
|
|
3348
|
+
function co(e, t, n, r) {
|
|
3344
3349
|
if (n?.message) return n.message;
|
|
3345
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
3350
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = ao(n, r);
|
|
3346
3351
|
if (a) {
|
|
3347
3352
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
3348
3353
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
3349
3354
|
}
|
|
3350
3355
|
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}`;
|
|
3351
3356
|
}
|
|
3352
|
-
function
|
|
3357
|
+
function lo({ type: e, label: t, rule: n, readSibling: r }) {
|
|
3353
3358
|
return { validator: async (i, a) => {
|
|
3354
3359
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
3355
3360
|
if (!o || Z(a)) return Promise.resolve();
|
|
3356
3361
|
let s = r(o);
|
|
3357
3362
|
if (Z(s)) return Promise.resolve();
|
|
3358
3363
|
let c = Q(a), l = Q(s);
|
|
3359
|
-
return c === null || l === null ? Promise.resolve() :
|
|
3364
|
+
return c === null || l === null ? Promise.resolve() : so(e, c, l, n, r) ? Promise.reject(Error(co(e, t, n, r))) : Promise.resolve();
|
|
3360
3365
|
} };
|
|
3361
3366
|
}
|
|
3362
|
-
function
|
|
3367
|
+
function uo(e, t, { rows: n, rowIndex: r } = {}) {
|
|
3363
3368
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
3364
3369
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
3365
3370
|
if (o) {
|
|
@@ -3373,11 +3378,11 @@ function lo(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
3373
3378
|
}
|
|
3374
3379
|
return !1;
|
|
3375
3380
|
}
|
|
3376
|
-
function
|
|
3381
|
+
function fo(e, t = "above", n = void 0) {
|
|
3377
3382
|
let r = e?.messages ?? {}, i = t === "below";
|
|
3378
3383
|
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.");
|
|
3379
3384
|
}
|
|
3380
|
-
function
|
|
3385
|
+
function po({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = b }) {
|
|
3381
3386
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
3382
3387
|
for (let e of a) {
|
|
3383
3388
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -3391,16 +3396,16 @@ function fo({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = b }) {
|
|
|
3391
3396
|
o.push((i) => {
|
|
3392
3397
|
if (!i) return !1;
|
|
3393
3398
|
let a = t(e);
|
|
3394
|
-
return !Z(a) &&
|
|
3399
|
+
return !Z(a) && so(r, Q(i), Q(a), n, t);
|
|
3395
3400
|
});
|
|
3396
3401
|
}
|
|
3397
3402
|
}
|
|
3398
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
3403
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? uo(Q(t), e.rowHierarchy, {
|
|
3399
3404
|
rows: n,
|
|
3400
3405
|
rowIndex: r
|
|
3401
3406
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
3402
3407
|
}
|
|
3403
|
-
function
|
|
3408
|
+
function mo(e, t = b, n = void 0, r = void 0) {
|
|
3404
3409
|
if (!Z(n) && Q(n) !== null) return;
|
|
3405
3410
|
let i, a = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
3406
3411
|
for (let e of a) {
|
|
@@ -3415,10 +3420,10 @@ function po(e, t = b, n = void 0, r = void 0) {
|
|
|
3415
3420
|
}
|
|
3416
3421
|
}
|
|
3417
3422
|
if (typeof r != "function") return i;
|
|
3418
|
-
let o = A(i ?? t()), s =
|
|
3423
|
+
let o = A(i ?? t()), s = ho(o, r);
|
|
3419
3424
|
return !s || s.isSame(o, "month") ? i : s;
|
|
3420
3425
|
}
|
|
3421
|
-
function
|
|
3426
|
+
function ho(e, t, n = 240) {
|
|
3422
3427
|
let r = A(e).startOf("day");
|
|
3423
3428
|
if (!r.isValid() || typeof t != "function") return null;
|
|
3424
3429
|
let i = (e) => {
|
|
@@ -3446,7 +3451,7 @@ function mo(e, t, n = 240) {
|
|
|
3446
3451
|
}
|
|
3447
3452
|
return null;
|
|
3448
3453
|
}
|
|
3449
|
-
function
|
|
3454
|
+
function go({ field: e, name: t, rows: n }) {
|
|
3450
3455
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
3451
3456
|
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 ?? [];
|
|
3452
3457
|
for (let e of o) {
|
|
@@ -3475,44 +3480,44 @@ function ho({ field: e, name: t, rows: n }) {
|
|
|
3475
3480
|
]));
|
|
3476
3481
|
return u;
|
|
3477
3482
|
}
|
|
3478
|
-
function
|
|
3483
|
+
function _o({ field: e, rows: t, rowIndex: n }) {
|
|
3479
3484
|
let r = e?.rowHierarchy;
|
|
3480
3485
|
return { validator: async (i, a) => {
|
|
3481
3486
|
if (!r || Z(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
3482
3487
|
let o = Q(a);
|
|
3483
|
-
if (o === null || !
|
|
3488
|
+
if (o === null || !uo(o, r, {
|
|
3484
3489
|
rows: t,
|
|
3485
3490
|
rowIndex: n
|
|
3486
3491
|
})) return Promise.resolve();
|
|
3487
3492
|
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;
|
|
3488
|
-
return Promise.reject(Error(
|
|
3493
|
+
return Promise.reject(Error(fo(r, u, p)));
|
|
3489
3494
|
} };
|
|
3490
3495
|
}
|
|
3491
3496
|
//#endregion
|
|
3492
3497
|
//#region src/utils/submitMessages.js
|
|
3493
|
-
function
|
|
3498
|
+
function vo(e) {
|
|
3494
3499
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
3495
3500
|
}
|
|
3496
3501
|
function $(e) {
|
|
3497
3502
|
let t = String(e ?? "").trim();
|
|
3498
3503
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
3499
3504
|
}
|
|
3500
|
-
function
|
|
3505
|
+
function yo(e, t) {
|
|
3501
3506
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
3502
3507
|
}
|
|
3503
|
-
function
|
|
3504
|
-
let r =
|
|
3508
|
+
function bo(e, t, n) {
|
|
3509
|
+
let r = vo(e);
|
|
3505
3510
|
if (r?.suppress) return null;
|
|
3506
3511
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
3507
|
-
return i && String(i).trim() ?
|
|
3512
|
+
return i && String(i).trim() ? yo(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
3508
3513
|
}
|
|
3509
|
-
function
|
|
3514
|
+
function xo(e, t, n) {
|
|
3510
3515
|
if (!e) return "";
|
|
3511
3516
|
let r = "";
|
|
3512
3517
|
if (typeof e == "string") {
|
|
3513
3518
|
let i = e.trim();
|
|
3514
3519
|
if (i.startsWith("{") && i.endsWith("}")) try {
|
|
3515
|
-
return
|
|
3520
|
+
return xo(JSON.parse(i), t, n);
|
|
3516
3521
|
} catch {}
|
|
3517
3522
|
r = i;
|
|
3518
3523
|
} else if (e instanceof Error) r = e.message || "";
|
|
@@ -3528,15 +3533,15 @@ function bo(e, t, n) {
|
|
|
3528
3533
|
}
|
|
3529
3534
|
return r;
|
|
3530
3535
|
}
|
|
3531
|
-
function
|
|
3532
|
-
let i =
|
|
3536
|
+
function So(e, t, n, r) {
|
|
3537
|
+
let i = xo(r, t, n);
|
|
3533
3538
|
if (i && String(i).trim()) return i;
|
|
3534
|
-
let a =
|
|
3535
|
-
return o && String(o).trim() ?
|
|
3539
|
+
let a = vo(e), o = n === "edit" ? a?.editError : a?.addError;
|
|
3540
|
+
return o && String(o).trim() ? yo(o, t) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
3536
3541
|
}
|
|
3537
3542
|
//#endregion
|
|
3538
3543
|
//#region src/utils/scrollToFirstFormError.js
|
|
3539
|
-
function
|
|
3544
|
+
function Co({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
3540
3545
|
if (!e?.length) return;
|
|
3541
3546
|
let r = e[0]?.name;
|
|
3542
3547
|
setTimeout(() => {
|
|
@@ -3561,35 +3566,35 @@ function So({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
3561
3566
|
}
|
|
3562
3567
|
//#endregion
|
|
3563
3568
|
//#region src/components/form/conditionalRequired.js
|
|
3564
|
-
function
|
|
3569
|
+
function wo(e, t) {
|
|
3565
3570
|
return (n) => {
|
|
3566
3571
|
if (!e || !n) return;
|
|
3567
3572
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
3568
3573
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
3569
3574
|
};
|
|
3570
3575
|
}
|
|
3571
|
-
function
|
|
3576
|
+
function To(e, t, n) {
|
|
3572
3577
|
let r = e?.requiredWhen;
|
|
3573
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : v(r,
|
|
3578
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : v(r, wo(t, n));
|
|
3574
3579
|
}
|
|
3575
|
-
function
|
|
3580
|
+
function Eo(e, t, n) {
|
|
3576
3581
|
return { validator: (r, i) => {
|
|
3577
|
-
if (!
|
|
3582
|
+
if (!To(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
3578
3583
|
let a = e?.label ?? e?.field ?? "This field";
|
|
3579
3584
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
3580
3585
|
} };
|
|
3581
3586
|
}
|
|
3582
3587
|
//#endregion
|
|
3583
3588
|
//#region src/components/Breadcrumb.jsx
|
|
3584
|
-
function
|
|
3585
|
-
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ O(
|
|
3589
|
+
function Do({ items: e = [] }) {
|
|
3590
|
+
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ O(ct, {
|
|
3586
3591
|
variant: "body",
|
|
3587
3592
|
weight: "medium",
|
|
3588
3593
|
color: "link",
|
|
3589
3594
|
children: t.label
|
|
3590
|
-
}) : /* @__PURE__ */ k(
|
|
3595
|
+
}) : /* @__PURE__ */ k(Be, {
|
|
3591
3596
|
to: t.href,
|
|
3592
|
-
children: [/* @__PURE__ */ O(
|
|
3597
|
+
children: [/* @__PURE__ */ O(ct, {
|
|
3593
3598
|
variant: "body",
|
|
3594
3599
|
color: "secondary",
|
|
3595
3600
|
children: t.label
|
|
@@ -3599,34 +3604,34 @@ function Eo({ items: e = [] }) {
|
|
|
3599
3604
|
}
|
|
3600
3605
|
//#endregion
|
|
3601
3606
|
//#region src/components/form/canonicalOption.js
|
|
3602
|
-
var
|
|
3603
|
-
function
|
|
3607
|
+
var Oo = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
3608
|
+
function ko(e = []) {
|
|
3604
3609
|
let t = /* @__PURE__ */ new Map();
|
|
3605
3610
|
for (let n of e) {
|
|
3606
3611
|
if (n == null) continue;
|
|
3607
3612
|
let e = typeof n == "object" ? n.value : n;
|
|
3608
3613
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
3609
|
-
let n =
|
|
3614
|
+
let n = Oo(r);
|
|
3610
3615
|
n && !t.has(n) && t.set(n, e);
|
|
3611
3616
|
}
|
|
3612
3617
|
}
|
|
3613
3618
|
return t;
|
|
3614
3619
|
}
|
|
3615
|
-
function
|
|
3620
|
+
function Ao(e, t) {
|
|
3616
3621
|
if (!Array.isArray(e)) {
|
|
3617
|
-
let n =
|
|
3622
|
+
let n = Ao([e], t);
|
|
3618
3623
|
return n.length ? n[0] : e;
|
|
3619
3624
|
}
|
|
3620
|
-
let n =
|
|
3625
|
+
let n = ko(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
3621
3626
|
for (let t of e) {
|
|
3622
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
3627
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Oo(e)) ?? e, o = Oo(a);
|
|
3623
3628
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
3624
3629
|
}
|
|
3625
3630
|
return i;
|
|
3626
3631
|
}
|
|
3627
3632
|
//#endregion
|
|
3628
3633
|
//#region src/components/form/dependencyBusy.js
|
|
3629
|
-
function
|
|
3634
|
+
function jo(e, t = []) {
|
|
3630
3635
|
if (!e) return [];
|
|
3631
3636
|
let n = /* @__PURE__ */ new Set();
|
|
3632
3637
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -3636,16 +3641,16 @@ function Ao(e, t = []) {
|
|
|
3636
3641
|
}
|
|
3637
3642
|
return n.delete(e), [...n];
|
|
3638
3643
|
}
|
|
3639
|
-
function
|
|
3640
|
-
return e?.blockWhileResolving ?
|
|
3644
|
+
function Mo(e, t = []) {
|
|
3645
|
+
return e?.blockWhileResolving ? jo(e.field, t).length > 0 : !1;
|
|
3641
3646
|
}
|
|
3642
|
-
function
|
|
3647
|
+
function No(e) {
|
|
3643
3648
|
let t = String(e?.label ?? "").trim();
|
|
3644
3649
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
3645
3650
|
}
|
|
3646
|
-
function
|
|
3651
|
+
function Po(e, t = []) {
|
|
3647
3652
|
if (!e?.field) return [];
|
|
3648
|
-
let n = new Set(
|
|
3653
|
+
let n = new Set(jo(e.field, t));
|
|
3649
3654
|
if (n.size === 0) return [];
|
|
3650
3655
|
let r = [];
|
|
3651
3656
|
for (let e of t) {
|
|
@@ -3654,19 +3659,19 @@ function No(e, t = []) {
|
|
|
3654
3659
|
}
|
|
3655
3660
|
return r;
|
|
3656
3661
|
}
|
|
3657
|
-
function
|
|
3662
|
+
function Fo(e) {
|
|
3658
3663
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
3659
3664
|
}
|
|
3660
3665
|
//#endregion
|
|
3661
3666
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
3662
|
-
var
|
|
3663
|
-
function
|
|
3667
|
+
var Io = x(() => import("./index.js").then((e) => e.n)), Lo = x(() => import("./DocumentViewer-BaSdIaiX.js").then((e) => e.n));
|
|
3668
|
+
function Ro(e) {
|
|
3664
3669
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
3665
3670
|
return O(t === "pdf" ? Ne : t === "doc" || t === "docx" ? Fe : Me, { className: "v1-file-chip__icon" });
|
|
3666
3671
|
}
|
|
3667
|
-
function
|
|
3672
|
+
function zo({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
3668
3673
|
let r = e?.linkedModule, i = e?.linkedFileField, a = C(() => {
|
|
3669
|
-
let n =
|
|
3674
|
+
let n = Hr(r, t);
|
|
3670
3675
|
if (n) return n;
|
|
3671
3676
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
3672
3677
|
return a ? String(a) : "";
|
|
@@ -3742,7 +3747,7 @@ function Ro({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
3742
3747
|
onClick: () => g && l(!0),
|
|
3743
3748
|
title: g ? `Preview or download ${h.name}` : te,
|
|
3744
3749
|
children: [
|
|
3745
|
-
g ?
|
|
3750
|
+
g ? Ro(h.name) : /* @__PURE__ */ O(Me, { className: "v1-file-chip__icon" }),
|
|
3746
3751
|
/* @__PURE__ */ O("span", {
|
|
3747
3752
|
className: "v1-file-chip__name",
|
|
3748
3753
|
children: g ? h.name : te
|
|
@@ -3766,7 +3771,7 @@ function Ro({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
3766
3771
|
}),
|
|
3767
3772
|
c && ee && /* @__PURE__ */ O(fe, {
|
|
3768
3773
|
fallback: null,
|
|
3769
|
-
children: /* @__PURE__ */ O(
|
|
3774
|
+
children: /* @__PURE__ */ O(Lo, {
|
|
3770
3775
|
open: c,
|
|
3771
3776
|
onClose: () => l(!1),
|
|
3772
3777
|
documents: [ee]
|
|
@@ -3797,7 +3802,7 @@ function Ro({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
3797
3802
|
},
|
|
3798
3803
|
children: /* @__PURE__ */ O(we, {})
|
|
3799
3804
|
}),
|
|
3800
|
-
children: /* @__PURE__ */ O(
|
|
3805
|
+
children: /* @__PURE__ */ O(Io, {
|
|
3801
3806
|
moduleName: r,
|
|
3802
3807
|
recordId: a,
|
|
3803
3808
|
embedded: !0,
|
|
@@ -3811,7 +3816,7 @@ function Ro({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
3811
3816
|
})
|
|
3812
3817
|
] });
|
|
3813
3818
|
}
|
|
3814
|
-
|
|
3819
|
+
zo.propTypes = {
|
|
3815
3820
|
field: j.shape({
|
|
3816
3821
|
label: j.string,
|
|
3817
3822
|
linkedModule: j.string,
|
|
@@ -3824,11 +3829,11 @@ Ro.propTypes = {
|
|
|
3824
3829
|
}).isRequired,
|
|
3825
3830
|
recordMeta: j.object,
|
|
3826
3831
|
onLinkedRecordUpdated: j.func
|
|
3827
|
-
},
|
|
3832
|
+
}, zo.defaultProps = {
|
|
3828
3833
|
recordMeta: void 0,
|
|
3829
3834
|
onLinkedRecordUpdated: void 0
|
|
3830
3835
|
};
|
|
3831
3836
|
//#endregion
|
|
3832
|
-
export {
|
|
3837
|
+
export { hi as $, R as $t, Sa as A, ir as At, fa as B, Pn as Bt, Ja as C, ct as Cn, Cr as Ct, wa as D, cr as Dt, Ga as E, G as Et, va as F, Jn as Ft, qi as G, bn as Gt, oa as H, xn as Ht, _a as I, Yn as It, Ti as J, gn as Jt, Fi as K, yn as Kt, pa as L, Rn as Lt, Ra as M, Xn as Mt, Va as N, Kn as Nt, La as O, lr as Ot, Ia as P, qn as Pt, gi as Q, Yt as Qt, ma as R, Ln as Rt, $a as S, dt as Sn, wr as St, qa as T, M as Tn, xr as Tt, ra as U, wn as Ut, ca as V, Un as Vt, na as W, Cn as Wt, Vi as X, en as Xt, Gi as Y, _n as Yt, fi as Z, $t as Zt, to as _, Ct as _n, Fr as _t, Mo as a, zt as an, ei as at, go as b, _t as bn, Mr as bt, To as c, Ft as cn, Hr as ct, So as d, Mt as dn, Wr as dt, L as en, ui as et, bo as f, Et as fn, Jr as ft, mo as g, Ot as gn, Ir as gt, _o as h, Dt as hn, Lr as ht, No as i, Wt as in, Qr as it, ba as j, Zn as jt, ya as k, tr as kt, Eo as l, Lt as ln, Gr as lt, lo as m, Nt as mn, zr as mt, Fo as n, Ht as nn, ii as nt, Ao as o, Bt as on, Yr as ot, po as p, Tt as pn, qr as pt, Ui as q, vn as qt, Po as r, Ut as rn, Zr as rt, Do as s, Rt as sn, Ur as st, zo as t, Gt as tn, ci as tt, Co as u, Pt as un, Kr as ut, no as v, St as vn, Pr as vt, Ya as w, N as wn, br as wt, eo as x, ut as xn, Ar as xt, Z as y, xt as yn, Nr as yt, la as z, On as zt };
|
|
3833
3838
|
|
|
3834
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
3839
|
+
//# sourceMappingURL=LinkedRecordFileField-B1kOm0Qb.js.map
|