@realtek/core-theme-live 0.0.447 → 0.0.448
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-BD3KkJt_.js → LinkedRecordFileField-B5LSz3TG.js} +1173 -889
- package/dist-lib/LinkedRecordFileField-B5LSz3TG.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-C_xceMwt.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-C_xceMwt.cjs.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +14602 -14491
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-BD3KkJt_.js.map +0 -1
- package/dist-lib/LinkedRecordFileField-Bl-KLNrJ.cjs +0 -5
- package/dist-lib/LinkedRecordFileField-Bl-KLNrJ.cjs.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { D as e, S as t, T as n, a as r, d as i, o as a, t as o, x as s } from "./authApi-Dsc4NnFr.js";
|
|
2
2
|
import { n as c, r as l } from "./diceCandidateMapper-DqBO4EhL.js";
|
|
3
|
-
import { Suspense as u, createContext as d, lazy as f, useCallback as p, useContext as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
4
|
-
import { Alert as
|
|
5
|
-
import { DownOutlined as
|
|
3
|
+
import { Suspense as u, createContext as d, lazy as f, useCallback as p, useContext as m, useEffect as h, useMemo as g, useRef as _, useState as v, useSyncExternalStore as y } from "react";
|
|
4
|
+
import { Alert as b, Breadcrumb as ee, Button as x, Checkbox as te, Form as S, Modal as ne, Space as re, Spin as ie, Tooltip as ae, Typography as oe, message as se } from "antd";
|
|
5
|
+
import { DownOutlined as ce, EditOutlined as le, ExclamationCircleFilled as ue, EyeOutlined as de, FileOutlined as fe, FilePdfOutlined as pe, FileTextOutlined as me, FileWordOutlined as he, InfoCircleFilled as ge, PlusOutlined as _e, UserOutlined as ve } from "@ant-design/icons";
|
|
6
6
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
7
7
|
import E from "dayjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { Link as
|
|
11
|
-
import { EditorContent as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { Table as
|
|
8
|
+
import ye from "dayjs/plugin/utc";
|
|
9
|
+
import be from "dayjs/plugin/timezone";
|
|
10
|
+
import { Link as xe } from "react-router-dom";
|
|
11
|
+
import { EditorContent as Se, useEditor as Ce } from "@tiptap/react";
|
|
12
|
+
import we from "@tiptap/starter-kit";
|
|
13
|
+
import Te from "@tiptap/extension-link";
|
|
14
|
+
import Ee from "@tiptap/extension-underline";
|
|
15
|
+
import { Table as De, TableCell as Oe, TableHeader as ke, TableRow as Ae } from "@tiptap/extension-table";
|
|
16
16
|
import D from "prop-types";
|
|
17
|
-
import
|
|
17
|
+
import je from "dompurify";
|
|
18
18
|
//#region src/services/adminApi.js
|
|
19
|
-
var
|
|
19
|
+
var O = "/admin/field-config", k = [
|
|
20
20
|
{
|
|
21
21
|
key: "clients",
|
|
22
22
|
apiModule: "clients"
|
|
@@ -46,17 +46,17 @@ var je = "/admin/field-config", O = [
|
|
|
46
46
|
apiModule: "payroll"
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
|
-
function
|
|
49
|
+
function A(...e) {
|
|
50
50
|
return e.find(Array.isArray) ?? [];
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function j(e, t, n) {
|
|
53
53
|
return t.map((t) => e?.[t]).find((e) => e != null && e !== "") ?? n;
|
|
54
54
|
}
|
|
55
55
|
function Me(e, t) {
|
|
56
56
|
return e?.total ?? e?.totalCount ?? e?.count ?? e?.recordsTotal ?? e?.meta?.total ?? e?.pagination?.total ?? t.length;
|
|
57
57
|
}
|
|
58
58
|
function Ne(e, t) {
|
|
59
|
-
let n =
|
|
59
|
+
let n = j(e, [
|
|
60
60
|
"label",
|
|
61
61
|
"Label",
|
|
62
62
|
"fieldName",
|
|
@@ -64,7 +64,7 @@ function Ne(e, t) {
|
|
|
64
64
|
"name",
|
|
65
65
|
"fieldLabel",
|
|
66
66
|
"value"
|
|
67
|
-
], `Field ${t + 1}`), r =
|
|
67
|
+
], `Field ${t + 1}`), r = j(e, [
|
|
68
68
|
"field",
|
|
69
69
|
"Field",
|
|
70
70
|
"fieldKey",
|
|
@@ -73,7 +73,7 @@ function Ne(e, t) {
|
|
|
73
73
|
"value",
|
|
74
74
|
"fieldName",
|
|
75
75
|
"name"
|
|
76
|
-
], n), i =
|
|
76
|
+
], n), i = j(e, [
|
|
77
77
|
"isVisible",
|
|
78
78
|
"is_visible",
|
|
79
79
|
"visible",
|
|
@@ -81,14 +81,14 @@ function Ne(e, t) {
|
|
|
81
81
|
"is_show",
|
|
82
82
|
"isShow",
|
|
83
83
|
"enabled"
|
|
84
|
-
], !0), a =
|
|
84
|
+
], !0), a = j(e, [
|
|
85
85
|
"ismandatory",
|
|
86
86
|
"isMandatory",
|
|
87
87
|
"is_mandatory",
|
|
88
88
|
"mandatory",
|
|
89
89
|
"required",
|
|
90
90
|
"req"
|
|
91
|
-
], !1), o =
|
|
91
|
+
], !1), o = j(e, [
|
|
92
92
|
"order",
|
|
93
93
|
"Order",
|
|
94
94
|
"sortOrder",
|
|
@@ -98,7 +98,7 @@ function Ne(e, t) {
|
|
|
98
98
|
...e,
|
|
99
99
|
fieldKey: r,
|
|
100
100
|
fieldName: n,
|
|
101
|
-
type:
|
|
101
|
+
type: j(e, ["type", "Type"], "text"),
|
|
102
102
|
isVisible: typeof i == "string" ? ![
|
|
103
103
|
"false",
|
|
104
104
|
"0",
|
|
@@ -155,7 +155,7 @@ function Pe(e) {
|
|
|
155
155
|
key: e,
|
|
156
156
|
apiModule: e
|
|
157
157
|
};
|
|
158
|
-
let t =
|
|
158
|
+
let t = j(e, [
|
|
159
159
|
"key",
|
|
160
160
|
"moduleKey",
|
|
161
161
|
"value",
|
|
@@ -167,7 +167,7 @@ function Pe(e) {
|
|
|
167
167
|
], "");
|
|
168
168
|
return t ? {
|
|
169
169
|
key: t,
|
|
170
|
-
apiModule:
|
|
170
|
+
apiModule: j(e, [
|
|
171
171
|
"apiModule",
|
|
172
172
|
"api_module",
|
|
173
173
|
"module",
|
|
@@ -179,8 +179,8 @@ function Pe(e) {
|
|
|
179
179
|
], t)
|
|
180
180
|
} : null;
|
|
181
181
|
}
|
|
182
|
-
function Fe(e =
|
|
183
|
-
let t = Array.isArray(e) && e.length ? e :
|
|
182
|
+
function Fe(e = k) {
|
|
183
|
+
let t = Array.isArray(e) && e.length ? e : k, n = /* @__PURE__ */ new Set();
|
|
184
184
|
return t.map(Pe).filter(Boolean).filter((e) => !n.has(e.key) && (n.add(e.key), !0));
|
|
185
185
|
}
|
|
186
186
|
var Ie = "/admin/modules";
|
|
@@ -420,17 +420,17 @@ async function yt() {
|
|
|
420
420
|
enabled: !0
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
var
|
|
423
|
+
var M = "/admin/integration-config";
|
|
424
424
|
async function bt() {
|
|
425
|
-
let e = await a(s,
|
|
425
|
+
let e = await a(s, M);
|
|
426
426
|
return e?.data ?? e ?? [];
|
|
427
427
|
}
|
|
428
428
|
async function xt(e) {
|
|
429
|
-
let t = await a(s, `${
|
|
429
|
+
let t = await a(s, `${M}/${encodeURIComponent(e)}`);
|
|
430
430
|
return t?.data ?? t;
|
|
431
431
|
}
|
|
432
432
|
async function St(e) {
|
|
433
|
-
let t = e?.integrationKey, n = t ? `${
|
|
433
|
+
let t = e?.integrationKey, n = t ? `${M}/${encodeURIComponent(t)}` : M;
|
|
434
434
|
return a(s, n, {
|
|
435
435
|
method: t ? "PUT" : "POST",
|
|
436
436
|
headers: { "Content-Type": "application/json" },
|
|
@@ -438,10 +438,10 @@ async function St(e) {
|
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
async function Ct(e) {
|
|
441
|
-
return a(s, `${
|
|
441
|
+
return a(s, `${M}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
442
442
|
}
|
|
443
443
|
async function wt(e) {
|
|
444
|
-
let t = await a(s, `${
|
|
444
|
+
let t = await a(s, `${M}/test`, {
|
|
445
445
|
method: "POST",
|
|
446
446
|
headers: { "Content-Type": "application/json" },
|
|
447
447
|
body: JSON.stringify(e)
|
|
@@ -471,11 +471,11 @@ function Dt(e) {
|
|
|
471
471
|
raw: e
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function N(e) {
|
|
475
475
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
476
476
|
}
|
|
477
477
|
async function Ot() {
|
|
478
|
-
let e = await a(s, "/get-roles"), t = e.data ?? e, n =
|
|
478
|
+
let e = await a(s, "/get-roles"), t = e.data ?? e, n = A(t?.zinnext_default).map(Dt), r = A(t?.custom_roles).map(Dt), i = [...n, ...r];
|
|
479
479
|
return {
|
|
480
480
|
roles: i,
|
|
481
481
|
total: i.length
|
|
@@ -489,8 +489,8 @@ function kt(e) {
|
|
|
489
489
|
manager: e.reportingManager ?? "N/A",
|
|
490
490
|
managerId: e.reportingManagerId ?? 0,
|
|
491
491
|
memberCount: e.noOfTeamMembers ?? 0,
|
|
492
|
-
members:
|
|
493
|
-
memberIds:
|
|
492
|
+
members: A(e.teamMembers),
|
|
493
|
+
memberIds: A(e.teamMembersIds),
|
|
494
494
|
raw: e
|
|
495
495
|
};
|
|
496
496
|
}
|
|
@@ -503,7 +503,7 @@ async function jt({ offset: e = 0, limit: t = 10, sortBy: n = "new", search: r =
|
|
|
503
503
|
sortBy: n,
|
|
504
504
|
limit: String(t),
|
|
505
505
|
offset: String(e)
|
|
506
|
-
}), o = await a(s, `/get-teams?${i}`), c = o.data ?? o, l =
|
|
506
|
+
}), o = await a(s, `/get-teams?${i}`), c = o.data ?? o, l = A(c?.teams, c, o?.teams), u = c?.totalCount ?? c?.total ?? l.length;
|
|
507
507
|
return {
|
|
508
508
|
teams: l.map(kt),
|
|
509
509
|
total: u
|
|
@@ -529,15 +529,15 @@ async function Nt(e, t, n, r = "listView", i = !1) {
|
|
|
529
529
|
configType: r
|
|
530
530
|
});
|
|
531
531
|
i && (!r || r === "listView") && o.set("includeMeta", "1");
|
|
532
|
-
let c = await a(s, `${
|
|
532
|
+
let c = await a(s, `${O}?${o}`), l = c.data ?? c, u = A(l, l?.visibleFields, c?.visibleFields);
|
|
533
533
|
return i ? {
|
|
534
534
|
fields: u,
|
|
535
535
|
dataVisibilityMode: l?.dataVisibilityMode ?? c?.dataVisibilityMode ?? "all",
|
|
536
536
|
dataOwnerField: l?.dataOwnerField ?? c?.dataOwnerField ?? "createdBy"
|
|
537
537
|
} : u;
|
|
538
538
|
}
|
|
539
|
-
async function Pt(e, t = "listView", n =
|
|
540
|
-
let r =
|
|
539
|
+
async function Pt(e, t = "listView", n = k) {
|
|
540
|
+
let r = N(e), i = Fe(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await Nt(n, "roleId", r, t)).map((t, i) => ({
|
|
541
541
|
...Ne(t, i),
|
|
542
542
|
module: e,
|
|
543
543
|
apiModule: n,
|
|
@@ -545,8 +545,8 @@ async function Pt(e, t = "listView", n = O) {
|
|
|
545
545
|
}))]));
|
|
546
546
|
return Object.fromEntries(a);
|
|
547
547
|
}
|
|
548
|
-
async function Ft(e, t = "listView", n =
|
|
549
|
-
let r =
|
|
548
|
+
async function Ft(e, t = "listView", n = k) {
|
|
549
|
+
let r = N(e), i = Fe(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => {
|
|
550
550
|
let i = await Nt(n, "roleId", r, t, !0);
|
|
551
551
|
return [e, {
|
|
552
552
|
fields: i.fields.map((t, i) => ({
|
|
@@ -562,7 +562,7 @@ async function Ft(e, t = "listView", n = O) {
|
|
|
562
562
|
return Object.fromEntries(a);
|
|
563
563
|
}
|
|
564
564
|
async function It(e, t = "listView") {
|
|
565
|
-
let n = At(e), r = await Promise.all(
|
|
565
|
+
let n = At(e), r = await Promise.all(k.map(async ({ key: e, apiModule: r }) => [e, (await Nt(r, "teamId", n, t)).map((t, i) => ({
|
|
566
566
|
...Ne(t, i),
|
|
567
567
|
module: e,
|
|
568
568
|
apiModule: r,
|
|
@@ -623,9 +623,9 @@ function Rt(e, t) {
|
|
|
623
623
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
|
-
async function zt(e, t, n, r = "listView", i =
|
|
627
|
-
let u =
|
|
628
|
-
return a(s, `${
|
|
626
|
+
async function zt(e, t, n, r = "listView", i = k, o = "", c = "createdBy", l = !1) {
|
|
627
|
+
let u = N(e), d = Fe(i).find((e) => e.key === t)?.apiModule ?? t;
|
|
628
|
+
return a(s, `${O}/role`, {
|
|
629
629
|
method: "PUT",
|
|
630
630
|
body: JSON.stringify({
|
|
631
631
|
module: d,
|
|
@@ -645,7 +645,7 @@ function Vt(e) {
|
|
|
645
645
|
return `__group__:${e}`;
|
|
646
646
|
}
|
|
647
647
|
async function Ht(e, t, n = {}) {
|
|
648
|
-
let r =
|
|
648
|
+
let r = N(e), i = new URLSearchParams({
|
|
649
649
|
module: t,
|
|
650
650
|
roleId: String(r ?? "")
|
|
651
651
|
});
|
|
@@ -654,7 +654,7 @@ async function Ht(e, t, n = {}) {
|
|
|
654
654
|
return Array.isArray(c) ? c : [];
|
|
655
655
|
}
|
|
656
656
|
async function Ut(e, t, n) {
|
|
657
|
-
let r =
|
|
657
|
+
let r = N(e), i = [], o = 0;
|
|
658
658
|
for (let e of n) {
|
|
659
659
|
e.locked || i.push({
|
|
660
660
|
label: e.label,
|
|
@@ -671,7 +671,7 @@ async function Ut(e, t, n) {
|
|
|
671
671
|
order: o++
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
-
return a(s, `${
|
|
674
|
+
return a(s, `${O}/role`, {
|
|
675
675
|
method: "PUT",
|
|
676
676
|
body: JSON.stringify({
|
|
677
677
|
module: t,
|
|
@@ -682,8 +682,8 @@ async function Ut(e, t, n) {
|
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
684
|
async function Wt(e, t, n, r = "listView") {
|
|
685
|
-
let i = At(e), o =
|
|
686
|
-
return a(s, `${
|
|
685
|
+
let i = At(e), o = k.find((e) => e.key === t)?.apiModule ?? t;
|
|
686
|
+
return a(s, `${O}/team`, {
|
|
687
687
|
method: "PUT",
|
|
688
688
|
body: JSON.stringify({
|
|
689
689
|
module: o,
|
|
@@ -700,7 +700,7 @@ async function Gt({ offset: e = 0, limit: t = 10, sortBy: n = "new", searchQuery
|
|
|
700
700
|
sortBy: n
|
|
701
701
|
});
|
|
702
702
|
r && i.set("searchquery", r);
|
|
703
|
-
let o = await a(s, `/get-all-users?${i}`), c = o.data ?? o, l =
|
|
703
|
+
let o = await a(s, `/get-all-users?${i}`), c = o.data ?? o, l = A(c, o.users, o.rows, o.items, o.records, c?.users, c?.data, c?.rows, c?.items, c?.records, c?.docs, c?.result, c?.results);
|
|
704
704
|
return {
|
|
705
705
|
users: l,
|
|
706
706
|
total: Me({
|
|
@@ -710,14 +710,14 @@ async function Gt({ offset: e = 0, limit: t = 10, sortBy: n = "new", searchQuery
|
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
async function Kt(e = []) {
|
|
713
|
-
return a(s, `${
|
|
713
|
+
return a(s, `${O}/seed`, {
|
|
714
714
|
method: "POST",
|
|
715
715
|
headers: { "Content-Type": "application/json" },
|
|
716
716
|
body: JSON.stringify({ collections: e })
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
719
|
async function qt() {
|
|
720
|
-
let e = await a(s, `${
|
|
720
|
+
let e = await a(s, `${O}/seed-status`), t = e?.data ?? e ?? {};
|
|
721
721
|
return {
|
|
722
722
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
723
723
|
seededModules: t.seededModules ?? {}
|
|
@@ -876,7 +876,7 @@ async function un(e, t) {
|
|
|
876
876
|
}
|
|
877
877
|
async function dn() {
|
|
878
878
|
let e = await a(s, "/admin/menu-modules");
|
|
879
|
-
return
|
|
879
|
+
return A(e.data, e);
|
|
880
880
|
}
|
|
881
881
|
async function fn({ menuName: e, apiUrl: t = "", menuType: n = "menu", parentMenuId: r = 0, displayOrder: i = 0 }) {
|
|
882
882
|
let o = await a(s, "/admin/menu-modules", {
|
|
@@ -904,7 +904,7 @@ async function mn(e) {
|
|
|
904
904
|
}
|
|
905
905
|
async function hn() {
|
|
906
906
|
let e = await a(s, "/admin/menu-actions");
|
|
907
|
-
return
|
|
907
|
+
return A(e.data, e);
|
|
908
908
|
}
|
|
909
909
|
async function gn({ permissionName: e, permissionKey: t }) {
|
|
910
910
|
let n = await a(s, "/admin/menu-actions", {
|
|
@@ -1114,22 +1114,22 @@ var Wn = Object.freeze({
|
|
|
1114
1114
|
phoneFormat: "3-3-4",
|
|
1115
1115
|
phoneCountryCode: "",
|
|
1116
1116
|
candidateDetailViewMode: "popup"
|
|
1117
|
-
}),
|
|
1118
|
-
function
|
|
1119
|
-
return
|
|
1117
|
+
}), P = { ...Wn }, Gn = null;
|
|
1118
|
+
function F() {
|
|
1119
|
+
return P;
|
|
1120
1120
|
}
|
|
1121
1121
|
function Kn(e) {
|
|
1122
1122
|
if (!e || typeof e != "object") return {};
|
|
1123
1123
|
let t = {};
|
|
1124
1124
|
if (e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.dateTimeFormat && (t.dateTimeFormat = e.dateTimeFormat), typeof e.showTimeZoneLabel == "boolean" && (t.showTimeZoneLabel = e.showTimeZoneLabel), typeof e.timeZone == "string" && (t.timeZone = e.timeZone.trim()), typeof e.region == "string" && (t.region = e.region.trim()), e.timeZoneAliases && typeof e.timeZoneAliases == "object" && !Array.isArray(e.timeZoneAliases) && (t.timeZoneAliases = {
|
|
1125
|
-
...
|
|
1125
|
+
...P.timeZoneAliases,
|
|
1126
1126
|
...e.timeZoneAliases
|
|
1127
1127
|
}), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), e.emptyTexts && typeof e.emptyTexts == "object" && !Array.isArray(e.emptyTexts)) {
|
|
1128
1128
|
let n = {};
|
|
1129
1129
|
Object.entries(e.emptyTexts).forEach(([e, t]) => {
|
|
1130
1130
|
typeof t == "string" && t.trim() !== "" && (n[e] = t.trim());
|
|
1131
1131
|
}), Object.keys(n).length && (t.emptyTexts = {
|
|
1132
|
-
...
|
|
1132
|
+
...P.emptyTexts,
|
|
1133
1133
|
...n
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
@@ -1158,10 +1158,10 @@ function qn(e = Jn()) {
|
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
1160
|
function Jn() {
|
|
1161
|
-
return
|
|
1161
|
+
return P.phoneFormat || Wn.phoneFormat;
|
|
1162
1162
|
}
|
|
1163
1163
|
function Yn() {
|
|
1164
|
-
return
|
|
1164
|
+
return P.phoneCountryCode ?? Wn.phoneCountryCode;
|
|
1165
1165
|
}
|
|
1166
1166
|
function Xn(e, t = Jn()) {
|
|
1167
1167
|
let { total: n } = qn(t);
|
|
@@ -1179,17 +1179,17 @@ function Zn(e, t = Jn()) {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
function Qn(e) {
|
|
1181
1181
|
let t = Kn(e);
|
|
1182
|
-
return Object.keys(t).forEach((e) => $n.add(e)),
|
|
1183
|
-
...
|
|
1182
|
+
return Object.keys(t).forEach((e) => $n.add(e)), P = {
|
|
1183
|
+
...P,
|
|
1184
1184
|
...t
|
|
1185
|
-
},
|
|
1185
|
+
}, P;
|
|
1186
1186
|
}
|
|
1187
1187
|
var $n = /* @__PURE__ */ new Set();
|
|
1188
1188
|
function er() {
|
|
1189
|
-
return $n.has("dateFormat") ?
|
|
1189
|
+
return $n.has("dateFormat") ? P.dateFormat : void 0;
|
|
1190
1190
|
}
|
|
1191
1191
|
function tr(e) {
|
|
1192
|
-
let t =
|
|
1192
|
+
let t = P.formDateFormats, n = String(e ?? "").trim().toLowerCase();
|
|
1193
1193
|
if (!t || !n) return;
|
|
1194
1194
|
let r = n.endsWith("s") ? n.slice(0, -1) : n, i = Object.keys(t).find((e) => {
|
|
1195
1195
|
let t = e.trim().toLowerCase();
|
|
@@ -1198,9 +1198,9 @@ function tr(e) {
|
|
|
1198
1198
|
return i ? t[i] : void 0;
|
|
1199
1199
|
}
|
|
1200
1200
|
function nr(e = !1) {
|
|
1201
|
-
return Gn && !e || (Gn = Promise.resolve().then(() => lt()).then((e) => Qn(e)).catch(() =>
|
|
1201
|
+
return Gn && !e || (Gn = Promise.resolve().then(() => lt()).then((e) => Qn(e)).catch(() => P)), Gn;
|
|
1202
1202
|
}
|
|
1203
|
-
E.extend(
|
|
1203
|
+
E.extend(ye), E.extend(be);
|
|
1204
1204
|
var rr = null;
|
|
1205
1205
|
function ir() {
|
|
1206
1206
|
if (rr === null) try {
|
|
@@ -1219,23 +1219,23 @@ function ar(e) {
|
|
|
1219
1219
|
return !1;
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function I(e = F()) {
|
|
1223
1223
|
let t = String(e?.timeZone ?? "").trim();
|
|
1224
1224
|
return ar(t) ? t : ir();
|
|
1225
1225
|
}
|
|
1226
1226
|
function or(e) {
|
|
1227
|
-
return E().tz(
|
|
1227
|
+
return E().tz(I(e));
|
|
1228
1228
|
}
|
|
1229
1229
|
function sr(e, t) {
|
|
1230
1230
|
let n = E(e?.$date ?? e);
|
|
1231
|
-
return n.isValid() ? n.tz(
|
|
1231
|
+
return n.isValid() ? n.tz(I(t)) : n;
|
|
1232
1232
|
}
|
|
1233
|
-
function cr(e, t, n =
|
|
1233
|
+
function cr(e, t, n = F()) {
|
|
1234
1234
|
let r = sr(e, n);
|
|
1235
1235
|
return r.isValid() ? r.format(t || n?.dateFormat || "DD MMM YYYY") : "";
|
|
1236
1236
|
}
|
|
1237
|
-
function lr(e =
|
|
1238
|
-
let n =
|
|
1237
|
+
function lr(e = F(), t) {
|
|
1238
|
+
let n = I(e), r = _r(n, e);
|
|
1239
1239
|
if (r && r.includes("/")) {
|
|
1240
1240
|
let e = ur(n, t);
|
|
1241
1241
|
if (e) return r.split("/").map((e) => e.trim()).find((t) => t.toUpperCase() === e.toUpperCase()) || e;
|
|
@@ -1255,7 +1255,7 @@ function ur(e, t) {
|
|
|
1255
1255
|
return "";
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
function dr(e, t =
|
|
1258
|
+
function dr(e, t = F()) {
|
|
1259
1259
|
let n = cr(e, t?.dateTimeFormat || "MMM DD, YYYY | hh:mm A", t);
|
|
1260
1260
|
if (!n) return "";
|
|
1261
1261
|
if (t?.showTimeZoneLabel === !1) return n;
|
|
@@ -1273,10 +1273,10 @@ function pr(e, t) {
|
|
|
1273
1273
|
if (e == null || e === "") return null;
|
|
1274
1274
|
let n = E(e);
|
|
1275
1275
|
if (!n.isValid()) return null;
|
|
1276
|
-
let r =
|
|
1276
|
+
let r = I(t);
|
|
1277
1277
|
return E.tz(n.format("YYYY-MM-DDTHH:mm:ss"), r);
|
|
1278
1278
|
}
|
|
1279
|
-
function mr(e =
|
|
1279
|
+
function mr(e = I()) {
|
|
1280
1280
|
try {
|
|
1281
1281
|
let t = E().tz(e).utcOffset(), n = t < 0 ? "-" : "+", r = Math.abs(t);
|
|
1282
1282
|
return `UTC${n}${String(Math.floor(r / 60)).padStart(2, "0")}:${String(r % 60).padStart(2, "0")}`;
|
|
@@ -1284,8 +1284,8 @@ function mr(e = F()) {
|
|
|
1284
1284
|
return "";
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
function hr(e =
|
|
1288
|
-
let t =
|
|
1287
|
+
function hr(e = F()) {
|
|
1288
|
+
let t = I(e);
|
|
1289
1289
|
return `${_r(t, e) || t} (${mr(t)})`;
|
|
1290
1290
|
}
|
|
1291
1291
|
var gr = Object.freeze({
|
|
@@ -1303,10 +1303,10 @@ var gr = Object.freeze({
|
|
|
1303
1303
|
"Asia/Tokyo": "JST",
|
|
1304
1304
|
"Australia/Sydney": "AEST/AEDT"
|
|
1305
1305
|
});
|
|
1306
|
-
function _r(e, t =
|
|
1306
|
+
function _r(e, t = F()) {
|
|
1307
1307
|
return (t?.timeZoneAliases ?? {})[e] ?? gr[e] ?? "";
|
|
1308
1308
|
}
|
|
1309
|
-
function vr(e =
|
|
1309
|
+
function vr(e = F()) {
|
|
1310
1310
|
let t = [];
|
|
1311
1311
|
try {
|
|
1312
1312
|
t = Intl.supportedValuesOf("timeZone") ?? [];
|
|
@@ -1337,7 +1337,7 @@ function vr(e = P()) {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
//#endregion
|
|
1339
1339
|
//#region src/theme/colors/colors.js
|
|
1340
|
-
var
|
|
1340
|
+
var L = {
|
|
1341
1341
|
brand: "#0053a5",
|
|
1342
1342
|
brandDark: "#1d4ed8",
|
|
1343
1343
|
brandDarker: "#1e40af",
|
|
@@ -1413,8 +1413,8 @@ var I = {
|
|
|
1413
1413
|
avatarGreen: "#10b981",
|
|
1414
1414
|
linkedIn: "#0077b5"
|
|
1415
1415
|
};
|
|
1416
|
-
|
|
1417
|
-
var
|
|
1416
|
+
L.textPrimary, L.textSecondary, L.textMuted, L.textSubtle, L.textInverse, L.textLink, L.danger, L.success, L.danger, L.textLink, L.surfaceSoft, L.textSecondary, L.success, L.warning;
|
|
1417
|
+
var R = {
|
|
1418
1418
|
brand: "var(--color-brand)",
|
|
1419
1419
|
brandDark: "var(--color-brand-dark)",
|
|
1420
1420
|
brandDarker: "var(--color-brand-darker)",
|
|
@@ -1522,14 +1522,14 @@ var L = {
|
|
|
1522
1522
|
normal: "var(--line-height-normal)",
|
|
1523
1523
|
relaxed: "var(--line-height-relaxed)"
|
|
1524
1524
|
}, Dr = {
|
|
1525
|
-
primary:
|
|
1526
|
-
secondary:
|
|
1527
|
-
muted:
|
|
1528
|
-
subtle:
|
|
1529
|
-
inverse:
|
|
1530
|
-
link:
|
|
1531
|
-
danger:
|
|
1532
|
-
success:
|
|
1525
|
+
primary: R.textPrimary,
|
|
1526
|
+
secondary: R.textSecondary,
|
|
1527
|
+
muted: R.textMuted,
|
|
1528
|
+
subtle: R.textSubtle,
|
|
1529
|
+
inverse: R.textInverse,
|
|
1530
|
+
link: R.textLink,
|
|
1531
|
+
danger: R.danger,
|
|
1532
|
+
success: R.success
|
|
1533
1533
|
};
|
|
1534
1534
|
function Or(...e) {
|
|
1535
1535
|
return e.filter(Boolean).join(" ");
|
|
@@ -1603,7 +1603,7 @@ var Nr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?
|
|
|
1603
1603
|
});
|
|
1604
1604
|
return r.create(null, c);
|
|
1605
1605
|
};
|
|
1606
|
-
function
|
|
1606
|
+
function z({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
1607
1607
|
return /* @__PURE__ */ w("button", {
|
|
1608
1608
|
type: "button",
|
|
1609
1609
|
title: r,
|
|
@@ -1622,21 +1622,21 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1622
1622
|
/* @__PURE__ */ T("div", {
|
|
1623
1623
|
className: "tte-toolbar-group",
|
|
1624
1624
|
children: [
|
|
1625
|
-
/* @__PURE__ */ w(
|
|
1625
|
+
/* @__PURE__ */ w(z, {
|
|
1626
1626
|
title: "Bold",
|
|
1627
1627
|
disabled: t,
|
|
1628
1628
|
active: e.isActive("bold"),
|
|
1629
1629
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
1630
1630
|
children: /* @__PURE__ */ w("strong", { children: "B" })
|
|
1631
1631
|
}),
|
|
1632
|
-
/* @__PURE__ */ w(
|
|
1632
|
+
/* @__PURE__ */ w(z, {
|
|
1633
1633
|
title: "Italic",
|
|
1634
1634
|
disabled: t,
|
|
1635
1635
|
active: e.isActive("italic"),
|
|
1636
1636
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
1637
1637
|
children: /* @__PURE__ */ w("em", { children: "I" })
|
|
1638
1638
|
}),
|
|
1639
|
-
/* @__PURE__ */ w(
|
|
1639
|
+
/* @__PURE__ */ w(z, {
|
|
1640
1640
|
title: "Underline",
|
|
1641
1641
|
disabled: t,
|
|
1642
1642
|
active: e.isActive("underline"),
|
|
@@ -1646,7 +1646,7 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1646
1646
|
children: "U"
|
|
1647
1647
|
})
|
|
1648
1648
|
}),
|
|
1649
|
-
/* @__PURE__ */ w(
|
|
1649
|
+
/* @__PURE__ */ w(z, {
|
|
1650
1650
|
title: "Strikethrough",
|
|
1651
1651
|
disabled: t,
|
|
1652
1652
|
active: e.isActive("strike"),
|
|
@@ -1658,13 +1658,13 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1658
1658
|
/* @__PURE__ */ w("div", { className: "tte-toolbar-divider" }),
|
|
1659
1659
|
/* @__PURE__ */ T("div", {
|
|
1660
1660
|
className: "tte-toolbar-group",
|
|
1661
|
-
children: [/* @__PURE__ */ w(
|
|
1661
|
+
children: [/* @__PURE__ */ w(z, {
|
|
1662
1662
|
title: "Bullet List",
|
|
1663
1663
|
disabled: t,
|
|
1664
1664
|
active: e.isActive("bulletList"),
|
|
1665
1665
|
onClick: () => e.chain().focus().toggleBulletList().run(),
|
|
1666
1666
|
children: "≡"
|
|
1667
|
-
}), /* @__PURE__ */ w(
|
|
1667
|
+
}), /* @__PURE__ */ w(z, {
|
|
1668
1668
|
title: "Ordered List",
|
|
1669
1669
|
disabled: t,
|
|
1670
1670
|
active: e.isActive("orderedList"),
|
|
@@ -1675,7 +1675,7 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1675
1675
|
/* @__PURE__ */ w("div", { className: "tte-toolbar-divider" }),
|
|
1676
1676
|
/* @__PURE__ */ w("div", {
|
|
1677
1677
|
className: "tte-toolbar-group",
|
|
1678
|
-
children: /* @__PURE__ */ w(
|
|
1678
|
+
children: /* @__PURE__ */ w(z, {
|
|
1679
1679
|
title: "Link",
|
|
1680
1680
|
disabled: t,
|
|
1681
1681
|
active: e.isActive("link"),
|
|
@@ -1693,7 +1693,7 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1693
1693
|
/* @__PURE__ */ w("div", { className: "tte-toolbar-divider" }),
|
|
1694
1694
|
/* @__PURE__ */ T("div", {
|
|
1695
1695
|
className: "tte-toolbar-group tte-table-tools",
|
|
1696
|
-
children: [/* @__PURE__ */ w(
|
|
1696
|
+
children: [/* @__PURE__ */ w(z, {
|
|
1697
1697
|
title: "Insert 3 × 3 table",
|
|
1698
1698
|
disabled: t,
|
|
1699
1699
|
active: e.isActive("table"),
|
|
@@ -1704,37 +1704,37 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1704
1704
|
}).run(),
|
|
1705
1705
|
children: "▦"
|
|
1706
1706
|
}), e.isActive("table") && /* @__PURE__ */ T(C, { children: [
|
|
1707
|
-
/* @__PURE__ */ w(
|
|
1707
|
+
/* @__PURE__ */ w(z, {
|
|
1708
1708
|
title: "Add column",
|
|
1709
1709
|
disabled: t || !e.can().addColumnAfter(),
|
|
1710
1710
|
onClick: () => e.chain().focus().addColumnAfter().run(),
|
|
1711
1711
|
children: "C+"
|
|
1712
1712
|
}),
|
|
1713
|
-
/* @__PURE__ */ w(
|
|
1713
|
+
/* @__PURE__ */ w(z, {
|
|
1714
1714
|
title: "Delete column",
|
|
1715
1715
|
disabled: t || !e.can().deleteColumn(),
|
|
1716
1716
|
onClick: () => e.chain().focus().deleteColumn().run(),
|
|
1717
1717
|
children: "C−"
|
|
1718
1718
|
}),
|
|
1719
|
-
/* @__PURE__ */ w(
|
|
1719
|
+
/* @__PURE__ */ w(z, {
|
|
1720
1720
|
title: "Add row",
|
|
1721
1721
|
disabled: t || !e.can().addRowAfter(),
|
|
1722
1722
|
onClick: () => e.chain().focus().addRowAfter().run(),
|
|
1723
1723
|
children: "R+"
|
|
1724
1724
|
}),
|
|
1725
|
-
/* @__PURE__ */ w(
|
|
1725
|
+
/* @__PURE__ */ w(z, {
|
|
1726
1726
|
title: "Delete row",
|
|
1727
1727
|
disabled: t || !e.can().deleteRow(),
|
|
1728
1728
|
onClick: () => e.chain().focus().deleteRow().run(),
|
|
1729
1729
|
children: "R−"
|
|
1730
1730
|
}),
|
|
1731
|
-
/* @__PURE__ */ w(
|
|
1731
|
+
/* @__PURE__ */ w(z, {
|
|
1732
1732
|
title: "Toggle header row",
|
|
1733
1733
|
disabled: t || !e.can().toggleHeaderRow(),
|
|
1734
1734
|
onClick: () => e.chain().focus().toggleHeaderRow().run(),
|
|
1735
1735
|
children: "H"
|
|
1736
1736
|
}),
|
|
1737
|
-
/* @__PURE__ */ w(
|
|
1737
|
+
/* @__PURE__ */ w(z, {
|
|
1738
1738
|
title: "Delete table",
|
|
1739
1739
|
disabled: t || !e.can().deleteTable(),
|
|
1740
1740
|
onClick: () => e.chain().focus().deleteTable().run(),
|
|
@@ -1745,7 +1745,7 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1745
1745
|
/* @__PURE__ */ w("div", { className: "tte-toolbar-divider" }),
|
|
1746
1746
|
/* @__PURE__ */ w("div", {
|
|
1747
1747
|
className: "tte-toolbar-group",
|
|
1748
|
-
children: /* @__PURE__ */ w(
|
|
1748
|
+
children: /* @__PURE__ */ w(z, {
|
|
1749
1749
|
title: "Clear formatting",
|
|
1750
1750
|
disabled: t,
|
|
1751
1751
|
onClick: () => e.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
@@ -1756,21 +1756,21 @@ function Lr({ editor: e, disabled: t }) {
|
|
|
1756
1756
|
}) : null;
|
|
1757
1757
|
}
|
|
1758
1758
|
function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = "" }) {
|
|
1759
|
-
let i = _(e ?? ""), a =
|
|
1759
|
+
let i = _(e ?? ""), a = Ce({
|
|
1760
1760
|
extensions: [
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1761
|
+
we,
|
|
1762
|
+
Ee,
|
|
1763
|
+
Te.configure({
|
|
1764
1764
|
openOnClick: !1,
|
|
1765
1765
|
HTMLAttributes: { rel: "noopener noreferrer" }
|
|
1766
1766
|
}),
|
|
1767
|
-
|
|
1767
|
+
De.configure({
|
|
1768
1768
|
resizable: !0,
|
|
1769
1769
|
HTMLAttributes: { class: "email-template-table" }
|
|
1770
1770
|
}),
|
|
1771
|
+
Ae,
|
|
1771
1772
|
ke,
|
|
1772
|
-
Oe
|
|
1773
|
-
De
|
|
1773
|
+
Oe
|
|
1774
1774
|
],
|
|
1775
1775
|
content: e,
|
|
1776
1776
|
editable: !n,
|
|
@@ -1804,7 +1804,7 @@ function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1804
1804
|
editor: a,
|
|
1805
1805
|
disabled: n
|
|
1806
1806
|
}),
|
|
1807
|
-
/* @__PURE__ */ w(
|
|
1807
|
+
/* @__PURE__ */ w(Se, { editor: a }),
|
|
1808
1808
|
!e && !a?.isFocused && r && /* @__PURE__ */ w("div", {
|
|
1809
1809
|
className: "tte-placeholder",
|
|
1810
1810
|
children: r
|
|
@@ -1966,22 +1966,22 @@ async function ni(e, t = {}, n = {}, r = {}) {
|
|
|
1966
1966
|
});
|
|
1967
1967
|
let m = await a(s, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ = Zr(m, h, g, f), v = Qr(m, h);
|
|
1968
1968
|
f && v[f] === void 0 && Number.isFinite(_) && (v[f] = _);
|
|
1969
|
-
let
|
|
1969
|
+
let y = g.some((e) => [
|
|
1970
1970
|
e?.sourceType,
|
|
1971
1971
|
e?.profileSource,
|
|
1972
1972
|
e?.selectedSource,
|
|
1973
1973
|
e?.customFields?.sourceType,
|
|
1974
1974
|
e?.customFields?.profileSource
|
|
1975
|
-
].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData),
|
|
1976
|
-
if (
|
|
1975
|
+
].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData), b = g;
|
|
1976
|
+
if (y) try {
|
|
1977
1977
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
1978
|
-
|
|
1978
|
+
b = e(m, m)?.data?.data ?? g;
|
|
1979
1979
|
} catch (e) {
|
|
1980
|
-
console.error("[searchModuleData] Dice transformation failed:", e),
|
|
1980
|
+
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(ai);
|
|
1981
1981
|
}
|
|
1982
|
-
else
|
|
1982
|
+
else b = Array.isArray(g) ? g.map(ai) : [];
|
|
1983
1983
|
return {
|
|
1984
|
-
rows:
|
|
1984
|
+
rows: b,
|
|
1985
1985
|
total: Number(_) || 0,
|
|
1986
1986
|
counts: v,
|
|
1987
1987
|
tabs: m?.tabs ?? m?.tabList ?? h?.tabs ?? h?.tabList ?? [],
|
|
@@ -2302,7 +2302,7 @@ function Ii(e) {
|
|
|
2302
2302
|
return t = Fi(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2303
2303
|
}
|
|
2304
2304
|
function Li(e) {
|
|
2305
|
-
return
|
|
2305
|
+
return je.sanitize(String(e ?? ""), {
|
|
2306
2306
|
ALLOWED_TAGS: Di,
|
|
2307
2307
|
ALLOWED_ATTR: Oi,
|
|
2308
2308
|
ALLOW_DATA_ATTR: !1,
|
|
@@ -2519,23 +2519,38 @@ function da(e, t = E()) {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
2521
|
//#endregion
|
|
2522
|
+
//#region src/components/form/csvTags.js
|
|
2523
|
+
var fa = "csvTags", pa = (e) => e.toLowerCase();
|
|
2524
|
+
function ma(e) {
|
|
2525
|
+
let t = Array.isArray(e) ? e : [e], n = [], r = /* @__PURE__ */ new Set();
|
|
2526
|
+
return t.forEach((e) => {
|
|
2527
|
+
e != null && typeof e != "object" && String(e).split(",").forEach((e) => {
|
|
2528
|
+
let t = e.trim().replace(/\s+/g, " ");
|
|
2529
|
+
!t || r.has(pa(t)) || (r.add(pa(t)), n.push(t));
|
|
2530
|
+
});
|
|
2531
|
+
}), n;
|
|
2532
|
+
}
|
|
2533
|
+
function ha(e, t = ", ") {
|
|
2534
|
+
return ma(e).join(t || ", ");
|
|
2535
|
+
}
|
|
2536
|
+
//#endregion
|
|
2522
2537
|
//#region src/components/form/payloadTransformer.js
|
|
2523
|
-
var
|
|
2524
|
-
function
|
|
2538
|
+
var B = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, ga = (e) => e === !0 || e === 1 || e === "1", V = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !_a(e);
|
|
2539
|
+
function _a(e) {
|
|
2525
2540
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2526
2541
|
}
|
|
2527
|
-
function
|
|
2528
|
-
return
|
|
2542
|
+
function va(e) {
|
|
2543
|
+
return _a(e) || e instanceof Date;
|
|
2529
2544
|
}
|
|
2530
|
-
function
|
|
2531
|
-
return e instanceof Date ? e.toISOString() :
|
|
2545
|
+
function ya(e) {
|
|
2546
|
+
return e instanceof Date ? e.toISOString() : _a(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2532
2547
|
}
|
|
2533
|
-
function
|
|
2534
|
-
if (!fr(t)) return
|
|
2548
|
+
function ba(e, t) {
|
|
2549
|
+
if (!fr(t)) return ya(e);
|
|
2535
2550
|
let n = pr(e);
|
|
2536
|
-
return n ? n.toISOString() :
|
|
2551
|
+
return n ? n.toISOString() : ya(e);
|
|
2537
2552
|
}
|
|
2538
|
-
function
|
|
2553
|
+
function H(e, t) {
|
|
2539
2554
|
if (!t) return;
|
|
2540
2555
|
let n = String(t).split("."), r = e;
|
|
2541
2556
|
for (let e of n) {
|
|
@@ -2544,51 +2559,51 @@ function V(e, t) {
|
|
|
2544
2559
|
}
|
|
2545
2560
|
return r;
|
|
2546
2561
|
}
|
|
2547
|
-
function H(e, t) {
|
|
2548
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : V(e, t);
|
|
2549
|
-
}
|
|
2550
2562
|
function U(e, t) {
|
|
2551
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ?
|
|
2563
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : H(e, t);
|
|
2552
2564
|
}
|
|
2553
|
-
function W(e, t
|
|
2565
|
+
function W(e, t) {
|
|
2566
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 : H(e, t) !== void 0;
|
|
2567
|
+
}
|
|
2568
|
+
function G(e, t, n) {
|
|
2554
2569
|
let r = String(t).split("."), i = e;
|
|
2555
2570
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2556
2571
|
let t = r[e];
|
|
2557
|
-
|
|
2572
|
+
V(i[t]) || (i[t] = {}), i = i[t];
|
|
2558
2573
|
}
|
|
2559
2574
|
return i[r[r.length - 1]] = n, e;
|
|
2560
2575
|
}
|
|
2561
|
-
function
|
|
2576
|
+
function xa(e, t, n) {
|
|
2562
2577
|
let r = String(t).split("."), i = e;
|
|
2563
2578
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2564
2579
|
let t = r[e];
|
|
2565
|
-
|
|
2580
|
+
V(i[t]) || (i[t] = {}), i = i[t];
|
|
2566
2581
|
}
|
|
2567
2582
|
let a = r[r.length - 1];
|
|
2568
|
-
return i[a] =
|
|
2583
|
+
return i[a] = V(i[a]) && V(n) ? {
|
|
2569
2584
|
...n,
|
|
2570
2585
|
...i[a]
|
|
2571
2586
|
} : n, e;
|
|
2572
2587
|
}
|
|
2573
|
-
function
|
|
2588
|
+
function Sa(e) {
|
|
2574
2589
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2575
2590
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2576
2591
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2577
2592
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2578
2593
|
}
|
|
2579
|
-
function
|
|
2594
|
+
function Ca(e, t) {
|
|
2580
2595
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2581
|
-
|
|
2596
|
+
V(n) && V(e[t]) ? Ca(e[t], n) : e[t] = n;
|
|
2582
2597
|
}), e;
|
|
2583
2598
|
}
|
|
2584
|
-
function
|
|
2599
|
+
function wa(e, t) {
|
|
2585
2600
|
let n = e.options ?? e.values ?? [];
|
|
2586
2601
|
for (let e of n) if (typeof e == "string") {
|
|
2587
2602
|
if (e === t) return e;
|
|
2588
2603
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2589
2604
|
}
|
|
2590
|
-
function
|
|
2591
|
-
if (
|
|
2605
|
+
function Ta(e, t) {
|
|
2606
|
+
if (V(e)) {
|
|
2592
2607
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2593
2608
|
return {
|
|
2594
2609
|
value: n,
|
|
@@ -2597,12 +2612,13 @@ function xa(e, t) {
|
|
|
2597
2612
|
}
|
|
2598
2613
|
return {
|
|
2599
2614
|
value: e,
|
|
2600
|
-
label:
|
|
2615
|
+
label: wa(t, e) ?? e
|
|
2601
2616
|
};
|
|
2602
2617
|
}
|
|
2603
|
-
function
|
|
2618
|
+
function Ea(e = {}) {
|
|
2604
2619
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2605
2620
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2621
|
+
if (e.type === "csvTags") return "csv";
|
|
2606
2622
|
switch (e.type) {
|
|
2607
2623
|
case "number": return "number";
|
|
2608
2624
|
case "date":
|
|
@@ -2610,36 +2626,37 @@ function Sa(e = {}) {
|
|
|
2610
2626
|
default: return "auto";
|
|
2611
2627
|
}
|
|
2612
2628
|
}
|
|
2613
|
-
function
|
|
2614
|
-
if (
|
|
2615
|
-
if (t === "string") return
|
|
2629
|
+
function K(e, t, n = {}) {
|
|
2630
|
+
if (va(e)) {
|
|
2631
|
+
if (t === "string") return ba(e, n);
|
|
2616
2632
|
if (t === "number") {
|
|
2617
|
-
let t =
|
|
2633
|
+
let t = _a(e) ? e.valueOf() : e.getTime();
|
|
2618
2634
|
return Number.isNaN(t) ? null : t;
|
|
2619
2635
|
}
|
|
2620
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2636
|
+
if (t === "date" || t === "auto" || !t) return ba(e, n);
|
|
2621
2637
|
}
|
|
2622
2638
|
switch (t) {
|
|
2623
2639
|
case "string": return e == null ? "" : String(e);
|
|
2640
|
+
case "csv": return ha(e, n.csvSeparator);
|
|
2624
2641
|
case "number": {
|
|
2625
|
-
if (
|
|
2642
|
+
if (B(e)) return null;
|
|
2626
2643
|
let t = Number(e);
|
|
2627
2644
|
return Number.isNaN(t) ? null : t;
|
|
2628
2645
|
}
|
|
2629
2646
|
case "boolean": return e === !0 || e === 1 || e === "1" || e === "true";
|
|
2630
2647
|
case "array": {
|
|
2631
2648
|
let t;
|
|
2632
|
-
return t = Array.isArray(e) ? e :
|
|
2649
|
+
return t = Array.isArray(e) ? e : B(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => K(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2633
2650
|
}
|
|
2634
|
-
case "object": return
|
|
2635
|
-
case "date": return
|
|
2651
|
+
case "object": return V(e), e;
|
|
2652
|
+
case "date": return ba(e, n);
|
|
2636
2653
|
case "custom":
|
|
2637
2654
|
case "auto":
|
|
2638
2655
|
case void 0:
|
|
2639
2656
|
default: return e;
|
|
2640
2657
|
}
|
|
2641
2658
|
}
|
|
2642
|
-
var
|
|
2659
|
+
var Da = {
|
|
2643
2660
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2644
2661
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2645
2662
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2647,11 +2664,11 @@ var Ca = {
|
|
|
2647
2664
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2648
2665
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2649
2666
|
};
|
|
2650
|
-
function
|
|
2667
|
+
function Oa(e, t) {
|
|
2651
2668
|
if (!t) return e;
|
|
2652
2669
|
let n = t;
|
|
2653
2670
|
if (typeof n == "string") {
|
|
2654
|
-
if (
|
|
2671
|
+
if (Da[n]) return Da[n](e);
|
|
2655
2672
|
try {
|
|
2656
2673
|
n = JSON.parse(n);
|
|
2657
2674
|
} catch {
|
|
@@ -2659,39 +2676,39 @@ function wa(e, t) {
|
|
|
2659
2676
|
}
|
|
2660
2677
|
}
|
|
2661
2678
|
let r = e;
|
|
2662
|
-
if (n.name &&
|
|
2679
|
+
if (n.name && Da[n.name] && (r = Da[n.name](r)), n.map && typeof n.map == "object") {
|
|
2663
2680
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2664
2681
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2665
2682
|
}
|
|
2666
2683
|
return r;
|
|
2667
2684
|
}
|
|
2668
|
-
var
|
|
2669
|
-
function
|
|
2685
|
+
var ka = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2686
|
+
function Aa(e, t) {
|
|
2670
2687
|
let [n, ...r] = e.split("."), i;
|
|
2671
2688
|
if (n === "value") i = t.value;
|
|
2672
2689
|
else if (n === "label") i = t.label;
|
|
2673
2690
|
else if (n === "raw") i = t.raw;
|
|
2674
2691
|
else return;
|
|
2675
|
-
return r.length ?
|
|
2692
|
+
return r.length ? H(i, r.join(".")) : i;
|
|
2676
2693
|
}
|
|
2677
|
-
function
|
|
2694
|
+
function ja(e, t) {
|
|
2678
2695
|
if (typeof e == "string") {
|
|
2679
2696
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2680
|
-
return n ?
|
|
2681
|
-
let r =
|
|
2697
|
+
return n ? Aa(n[1], t) : e.replace(ka, (e, n) => {
|
|
2698
|
+
let r = Aa(n, t);
|
|
2682
2699
|
return r == null ? "" : String(r);
|
|
2683
2700
|
});
|
|
2684
2701
|
}
|
|
2685
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2686
|
-
if (
|
|
2702
|
+
if (Array.isArray(e)) return e.map((e) => ja(e, t));
|
|
2703
|
+
if (V(e)) {
|
|
2687
2704
|
let n = {};
|
|
2688
2705
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2689
|
-
n[e] =
|
|
2706
|
+
n[e] = ja(r, t);
|
|
2690
2707
|
}), n;
|
|
2691
2708
|
}
|
|
2692
2709
|
return e;
|
|
2693
2710
|
}
|
|
2694
|
-
function
|
|
2711
|
+
function Ma(e) {
|
|
2695
2712
|
if (!e) return null;
|
|
2696
2713
|
if (typeof e == "string") try {
|
|
2697
2714
|
return JSON.parse(e);
|
|
@@ -2700,36 +2717,36 @@ function Oa(e) {
|
|
|
2700
2717
|
}
|
|
2701
2718
|
return e;
|
|
2702
2719
|
}
|
|
2703
|
-
function
|
|
2704
|
-
let n = e.payloadMode || "auto", r =
|
|
2720
|
+
function Na(e, t) {
|
|
2721
|
+
let n = e.payloadMode || "auto", r = Ea(e), { value: i, label: a } = Ta(t, e);
|
|
2705
2722
|
switch (n) {
|
|
2706
2723
|
case "value": return {
|
|
2707
2724
|
kind: "scalar",
|
|
2708
|
-
out:
|
|
2725
|
+
out: K(i, r, e)
|
|
2709
2726
|
};
|
|
2710
2727
|
case "label": return {
|
|
2711
2728
|
kind: "scalar",
|
|
2712
|
-
out:
|
|
2729
|
+
out: K(a, e.dataType || "string", e)
|
|
2713
2730
|
};
|
|
2714
2731
|
case "object": {
|
|
2715
2732
|
let t = e.valueKey || "id", n = e.displayKey || "name";
|
|
2716
2733
|
return {
|
|
2717
2734
|
kind: "scalar",
|
|
2718
2735
|
out: {
|
|
2719
|
-
[t]:
|
|
2736
|
+
[t]: K(i, e.elementType || "auto", {}),
|
|
2720
2737
|
[n]: a
|
|
2721
2738
|
}
|
|
2722
2739
|
};
|
|
2723
2740
|
}
|
|
2724
2741
|
case "custom":
|
|
2725
2742
|
case "template": {
|
|
2726
|
-
let n =
|
|
2743
|
+
let n = Ma(e.payloadTemplate);
|
|
2727
2744
|
if (!n) return {
|
|
2728
2745
|
kind: "scalar",
|
|
2729
|
-
out:
|
|
2746
|
+
out: K(i, r, e)
|
|
2730
2747
|
};
|
|
2731
|
-
let o =
|
|
2732
|
-
value:
|
|
2748
|
+
let o = ja(n, {
|
|
2749
|
+
value: K(i, e.elementType || "auto", {}),
|
|
2733
2750
|
label: a,
|
|
2734
2751
|
raw: t
|
|
2735
2752
|
});
|
|
@@ -2740,27 +2757,27 @@ function ka(e, t) {
|
|
|
2740
2757
|
}
|
|
2741
2758
|
default: return {
|
|
2742
2759
|
kind: "scalar",
|
|
2743
|
-
out:
|
|
2760
|
+
out: K(i, r, e)
|
|
2744
2761
|
};
|
|
2745
2762
|
}
|
|
2746
2763
|
}
|
|
2747
|
-
function
|
|
2764
|
+
function Pa(e = {}) {
|
|
2748
2765
|
let t = e.defaultValue;
|
|
2749
2766
|
if (t !== void 0 && t !== "") return e.type === "time" ? ca(t) : e.type === "date" ? da(t) : t;
|
|
2750
2767
|
}
|
|
2751
|
-
function
|
|
2768
|
+
function Fa(e, t) {
|
|
2752
2769
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2753
2770
|
let n = t;
|
|
2754
|
-
if (
|
|
2755
|
-
let t =
|
|
2771
|
+
if (B(n)) {
|
|
2772
|
+
let t = Pa(e);
|
|
2756
2773
|
t !== void 0 && (n = t);
|
|
2757
2774
|
}
|
|
2758
|
-
return n =
|
|
2775
|
+
return n = Oa(n, e.transformRule), B(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Ea(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2759
2776
|
kind: "scalar",
|
|
2760
|
-
out: n.map((t) =>
|
|
2761
|
-
} :
|
|
2777
|
+
out: n.map((t) => Na(e, t).out)
|
|
2778
|
+
} : Na(e, n);
|
|
2762
2779
|
}
|
|
2763
|
-
function
|
|
2780
|
+
function Ia(e = {}) {
|
|
2764
2781
|
return !!e.richValue || [
|
|
2765
2782
|
"label",
|
|
2766
2783
|
"object",
|
|
@@ -2768,10 +2785,10 @@ function Ma(e = {}) {
|
|
|
2768
2785
|
"template"
|
|
2769
2786
|
].includes(e.payloadMode);
|
|
2770
2787
|
}
|
|
2771
|
-
function
|
|
2772
|
-
if (!
|
|
2788
|
+
function La(e, t, n = []) {
|
|
2789
|
+
if (!Ia(e) || t == null) return t;
|
|
2773
2790
|
let r = (e) => {
|
|
2774
|
-
if (
|
|
2791
|
+
if (V(e) && e.value !== void 0) return e;
|
|
2775
2792
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
2776
2793
|
return {
|
|
2777
2794
|
value: t?.value ?? e,
|
|
@@ -2780,9 +2797,9 @@ function Na(e, t, n = []) {
|
|
|
2780
2797
|
};
|
|
2781
2798
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2782
2799
|
}
|
|
2783
|
-
function
|
|
2800
|
+
function Ra(e, t, n) {
|
|
2784
2801
|
if (!e?.field) return !0;
|
|
2785
|
-
let r =
|
|
2802
|
+
let r = W(t, e.field) ? U(t, e.field) : U(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2786
2803
|
switch (e.operator) {
|
|
2787
2804
|
case "eq": return String(r ?? "") === String(e.value ?? "");
|
|
2788
2805
|
case "neq": return String(r ?? "") !== String(e.value ?? "");
|
|
@@ -2794,42 +2811,42 @@ function Pa(e, t, n) {
|
|
|
2794
2811
|
default: return !0;
|
|
2795
2812
|
}
|
|
2796
2813
|
}
|
|
2797
|
-
function
|
|
2814
|
+
function za(e) {
|
|
2798
2815
|
let t = [];
|
|
2799
2816
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2800
2817
|
e?.field && t.push(e.field);
|
|
2801
2818
|
}), t;
|
|
2802
2819
|
}
|
|
2803
|
-
function
|
|
2820
|
+
function Ba(e, t, n) {
|
|
2804
2821
|
if (!e) return !0;
|
|
2805
2822
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2806
2823
|
if (r.length) {
|
|
2807
|
-
let i = r.map((e) =>
|
|
2824
|
+
let i = r.map((e) => Ra(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2808
2825
|
if (e.field) {
|
|
2809
|
-
let r =
|
|
2826
|
+
let r = Ra(e, t, n);
|
|
2810
2827
|
o = a ? o || r : o && r;
|
|
2811
2828
|
}
|
|
2812
2829
|
return o;
|
|
2813
2830
|
}
|
|
2814
|
-
return
|
|
2831
|
+
return Ra(e, t, n);
|
|
2815
2832
|
}
|
|
2816
|
-
function
|
|
2817
|
-
let a =
|
|
2818
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2833
|
+
function Va(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2834
|
+
let a = za(e?.showIf);
|
|
2835
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Ba(e.showIf, t, n) ? a.every((e) => {
|
|
2819
2836
|
let a = r?.get?.(e);
|
|
2820
|
-
return !a ||
|
|
2837
|
+
return !a || Va(a, t, n, r, i);
|
|
2821
2838
|
}) : !1);
|
|
2822
2839
|
}
|
|
2823
|
-
function
|
|
2840
|
+
function Ha(e = []) {
|
|
2824
2841
|
let t = /* @__PURE__ */ new Map();
|
|
2825
2842
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2826
2843
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2827
2844
|
})), t;
|
|
2828
2845
|
}
|
|
2829
|
-
function
|
|
2846
|
+
function Ua(e = {}, { editing: t = !1 } = {}) {
|
|
2830
2847
|
let n = {};
|
|
2831
2848
|
return (e.fields ?? []).forEach((e) => {
|
|
2832
|
-
if (!(!e.field ||
|
|
2849
|
+
if (!(!e.field || q(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2833
2850
|
if (e.type === "time") {
|
|
2834
2851
|
let t = ca(e.defaultValue);
|
|
2835
2852
|
t !== void 0 && (n[e.field] = t);
|
|
@@ -2844,7 +2861,7 @@ function za(e = {}, { editing: t = !1 } = {}) {
|
|
|
2844
2861
|
}
|
|
2845
2862
|
}), n;
|
|
2846
2863
|
}
|
|
2847
|
-
function
|
|
2864
|
+
function Wa(e = []) {
|
|
2848
2865
|
let t = [];
|
|
2849
2866
|
return e.forEach((e) => {
|
|
2850
2867
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2855,27 +2872,27 @@ function Ba(e = []) {
|
|
|
2855
2872
|
});
|
|
2856
2873
|
}), t;
|
|
2857
2874
|
}
|
|
2858
|
-
var
|
|
2875
|
+
var Ga = [
|
|
2859
2876
|
"file",
|
|
2860
2877
|
"document",
|
|
2861
2878
|
"image",
|
|
2862
2879
|
"upload",
|
|
2863
2880
|
"attachment"
|
|
2864
2881
|
];
|
|
2865
|
-
function
|
|
2866
|
-
return
|
|
2882
|
+
function q(e) {
|
|
2883
|
+
return Ga.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2867
2884
|
}
|
|
2868
|
-
function
|
|
2869
|
-
return
|
|
2885
|
+
function Ka(e = []) {
|
|
2886
|
+
return Wa(e).map(({ field: e }) => e).filter(q);
|
|
2870
2887
|
}
|
|
2871
|
-
function
|
|
2888
|
+
function qa(e) {
|
|
2872
2889
|
return String(e ?? "").trim().toLowerCase();
|
|
2873
2890
|
}
|
|
2874
|
-
function
|
|
2875
|
-
return !!t &&
|
|
2891
|
+
function Ja(e, t) {
|
|
2892
|
+
return !!t && qa(e.moduleName) === t;
|
|
2876
2893
|
}
|
|
2877
|
-
function
|
|
2878
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2894
|
+
function Ya(e, t = [], n = {}) {
|
|
2895
|
+
let r = [], i = n.scope ?? "all", a = qa(n.module), o = (e, t) => {
|
|
2879
2896
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2880
2897
|
let n = t?.originFileObj || t;
|
|
2881
2898
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2885,9 +2902,9 @@ function Ga(e, t = [], n = {}) {
|
|
|
2885
2902
|
});
|
|
2886
2903
|
};
|
|
2887
2904
|
return (t ?? []).forEach((t) => {
|
|
2888
|
-
let r = (t.fields ?? []).filter(
|
|
2905
|
+
let r = (t.fields ?? []).filter(q);
|
|
2889
2906
|
if (!r.length) return;
|
|
2890
|
-
let s = t.moduleName && !
|
|
2907
|
+
let s = t.moduleName && !Ja(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2891
2908
|
if (t.addRow) {
|
|
2892
2909
|
if (i === "flat") return;
|
|
2893
2910
|
let a = e[t.name];
|
|
@@ -2896,94 +2913,94 @@ function Ga(e, t = [], n = {}) {
|
|
|
2896
2913
|
let t = e.fileKey ?? String(e.field).split(".")[0];
|
|
2897
2914
|
a.forEach((r, i) => {
|
|
2898
2915
|
let a = c(n.indexed ? `${t}[${i}]` : t);
|
|
2899
|
-
o(a,
|
|
2916
|
+
o(a, U(r, e.field));
|
|
2900
2917
|
});
|
|
2901
2918
|
});
|
|
2902
2919
|
return;
|
|
2903
2920
|
}
|
|
2904
2921
|
i !== "addRow" && r.forEach((t) => {
|
|
2905
2922
|
let n = c(t.fileKey ?? String(t.field).split(".")[0]);
|
|
2906
|
-
o(n,
|
|
2923
|
+
o(n, U(e, t.field));
|
|
2907
2924
|
});
|
|
2908
2925
|
}), r;
|
|
2909
2926
|
}
|
|
2910
|
-
function
|
|
2911
|
-
let r =
|
|
2912
|
-
|
|
2913
|
-
(e.payloadKey || e.field) && (
|
|
2927
|
+
function Xa(e, t, n = {}) {
|
|
2928
|
+
let r = V(n.base) ? structuredClone(n.base) : {};
|
|
2929
|
+
Ka(t).forEach((e) => {
|
|
2930
|
+
(e.payloadKey || e.field) && ($a(r, e.payloadKey || e.field), $a(r, e.field));
|
|
2914
2931
|
});
|
|
2915
|
-
let i =
|
|
2932
|
+
let i = qa(n.module), a = Ha(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Ja(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2916
2933
|
return (t ?? []).forEach((t) => {
|
|
2917
|
-
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField &&
|
|
2918
|
-
if (t.toggleEnabled && t.toggleField &&
|
|
2919
|
-
|
|
2934
|
+
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && W(e, t.toggleField) ? !!U(e, t.toggleField) : !1;
|
|
2935
|
+
if (t.toggleEnabled && t.toggleField && W(e, t.toggleField) && (G(n, t.toggleField, i), i && t.addRow)) {
|
|
2936
|
+
G(n, t.payloadKey || t.name, []);
|
|
2920
2937
|
return;
|
|
2921
2938
|
}
|
|
2922
2939
|
if (t.addRow) {
|
|
2923
2940
|
let i = e[t.name];
|
|
2924
2941
|
if (!Array.isArray(i)) return;
|
|
2925
|
-
|
|
2942
|
+
G(n, t.payloadKey || t.name, i.map((t) => Qa(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2926
2943
|
return;
|
|
2927
2944
|
}
|
|
2928
|
-
r.forEach((t) =>
|
|
2945
|
+
r.forEach((t) => Za(t, e, n, e, a));
|
|
2929
2946
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2930
2947
|
moduleName: e,
|
|
2931
2948
|
data: t
|
|
2932
2949
|
}))), Wi(r, t);
|
|
2933
2950
|
}
|
|
2934
|
-
function
|
|
2951
|
+
function Za(e, t, n, r, i) {
|
|
2935
2952
|
if (Ki(e) && Yi(e)) {
|
|
2936
2953
|
let r = qi(e);
|
|
2937
|
-
|
|
2954
|
+
W(t, r) && G(n, r, !!U(t, r));
|
|
2938
2955
|
}
|
|
2939
|
-
if (
|
|
2940
|
-
let i =
|
|
2956
|
+
if (q(e)) {
|
|
2957
|
+
let i = Sa(U(t, e.field));
|
|
2941
2958
|
if (i !== void 0) {
|
|
2942
2959
|
let a = r !== void 0 && r !== t;
|
|
2943
|
-
|
|
2960
|
+
xa(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2944
2961
|
}
|
|
2945
2962
|
return;
|
|
2946
2963
|
}
|
|
2947
|
-
if (
|
|
2948
|
-
(r === void 0 || r === t) &&
|
|
2964
|
+
if (za(e.showIf).length && !Va(e, t, r, i)) {
|
|
2965
|
+
(r === void 0 || r === t) && W(t, e.field) && G(n, e.payloadKey || e.field, null);
|
|
2949
2966
|
return;
|
|
2950
2967
|
}
|
|
2951
2968
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2952
|
-
if (!
|
|
2953
|
-
let a =
|
|
2969
|
+
if (!W(t, e.field)) return;
|
|
2970
|
+
let a = U(t, e.field);
|
|
2954
2971
|
if (!Array.isArray(a)) return;
|
|
2955
|
-
let o = a.map((t) =>
|
|
2956
|
-
|
|
2972
|
+
let o = a.map((t) => Qa(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2973
|
+
G(n, e.payloadKey || e.field, o);
|
|
2957
2974
|
return;
|
|
2958
2975
|
}
|
|
2959
|
-
if (!
|
|
2960
|
-
if (
|
|
2961
|
-
let r =
|
|
2962
|
-
|
|
2976
|
+
if (!W(t, e.field)) return;
|
|
2977
|
+
if (ga(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2978
|
+
let r = U(t, e.field), i = Array.isArray(r) ? r : B(r) ? [] : [r], a = to(e), o = i.map((e) => Fa(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2979
|
+
G(n, e.payloadKey || e.field, o);
|
|
2963
2980
|
return;
|
|
2964
2981
|
}
|
|
2965
|
-
let a =
|
|
2982
|
+
let a = Fa(e, U(t, e.field));
|
|
2966
2983
|
if (a.kind !== "skip") {
|
|
2967
|
-
if (a.kind === "spread" &&
|
|
2968
|
-
|
|
2984
|
+
if (a.kind === "spread" && V(a.out)) {
|
|
2985
|
+
Ca(n, a.out);
|
|
2969
2986
|
return;
|
|
2970
2987
|
}
|
|
2971
|
-
|
|
2988
|
+
G(n, e.payloadKey || e.field, a.out);
|
|
2972
2989
|
}
|
|
2973
2990
|
}
|
|
2974
|
-
function
|
|
2991
|
+
function Qa(e, t, n, r) {
|
|
2975
2992
|
let i = {};
|
|
2976
|
-
return e.forEach((e) =>
|
|
2993
|
+
return e.forEach((e) => Za(e, t, i, n ?? t, r)), i;
|
|
2977
2994
|
}
|
|
2978
|
-
function
|
|
2995
|
+
function $a(e, t) {
|
|
2979
2996
|
let n = String(t).split("."), r = e;
|
|
2980
2997
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2981
|
-
if (!
|
|
2998
|
+
if (!V(r[n[e]])) return;
|
|
2982
2999
|
r = r[n[e]];
|
|
2983
3000
|
}
|
|
2984
3001
|
delete r[n[n.length - 1]];
|
|
2985
3002
|
}
|
|
2986
|
-
var
|
|
3003
|
+
var eo = /* @__PURE__ */ new Set([
|
|
2987
3004
|
"text",
|
|
2988
3005
|
"textarea",
|
|
2989
3006
|
"email",
|
|
@@ -2995,22 +3012,23 @@ var Xa = /* @__PURE__ */ new Set([
|
|
|
2995
3012
|
"datetime",
|
|
2996
3013
|
"password"
|
|
2997
3014
|
]);
|
|
2998
|
-
function
|
|
2999
|
-
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ?
|
|
3015
|
+
function J(e, t) {
|
|
3016
|
+
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ? Pa(e) : void 0;
|
|
3000
3017
|
if (t == null) return r() ?? t;
|
|
3001
|
-
if (n(t) ||
|
|
3002
|
-
if (
|
|
3018
|
+
if (n(t) || B(t) && r() !== void 0) return r();
|
|
3019
|
+
if (eo.has(e.type) && V(t)) {
|
|
3003
3020
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
3004
|
-
if (r === void 0 ||
|
|
3021
|
+
if (r === void 0 || V(r)) return;
|
|
3005
3022
|
t = r;
|
|
3006
3023
|
}
|
|
3024
|
+
if (e.type === "csvTags") return ma(t);
|
|
3007
3025
|
if (e.type === "date" || e.type === "time") {
|
|
3008
3026
|
if (!t || t === "0001-01-01T00:00:00Z") return null;
|
|
3009
3027
|
let e = E(t);
|
|
3010
3028
|
return e.isValid() ? e : null;
|
|
3011
3029
|
}
|
|
3012
3030
|
t = ia(e, t);
|
|
3013
|
-
let i = (t) =>
|
|
3031
|
+
let i = (t) => V(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && Ea(e) === "array", o = (t) => {
|
|
3014
3032
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
3015
3033
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
3016
3034
|
return n ? n.value : t;
|
|
@@ -3022,7 +3040,7 @@ function q(e, t) {
|
|
|
3022
3040
|
}
|
|
3023
3041
|
return t;
|
|
3024
3042
|
}
|
|
3025
|
-
function
|
|
3043
|
+
function to(e = {}) {
|
|
3026
3044
|
return {
|
|
3027
3045
|
...e,
|
|
3028
3046
|
addRow: !1,
|
|
@@ -3031,26 +3049,26 @@ function Za(e = {}) {
|
|
|
3031
3049
|
dataType: void 0
|
|
3032
3050
|
};
|
|
3033
3051
|
}
|
|
3034
|
-
function
|
|
3052
|
+
function no(e, t) {
|
|
3035
3053
|
let n = Math.max(0, Number(e.minRows ?? 0) || 0), r = e.initialRows !== void 0 && e.initialRows !== "" ? Math.max(n, Math.max(0, Number(e.initialRows) || 0)) : n;
|
|
3036
3054
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
3037
3055
|
let i = [];
|
|
3038
3056
|
Array.isArray(t) && (i = t.map((t) => {
|
|
3039
3057
|
let n = {};
|
|
3040
3058
|
return e.subFields.forEach((e) => {
|
|
3041
|
-
if (!e.field ||
|
|
3042
|
-
let r =
|
|
3043
|
-
r != null && (n[e.field] =
|
|
3059
|
+
if (!e.field || q(e)) return;
|
|
3060
|
+
let r = H(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
3061
|
+
r != null && (n[e.field] = J(e, r));
|
|
3044
3062
|
}), n;
|
|
3045
3063
|
}));
|
|
3046
3064
|
let a = i.length > 0 ? n : Math.max(n, r);
|
|
3047
3065
|
for (; i.length < a;) i.push({});
|
|
3048
3066
|
return i;
|
|
3049
3067
|
}
|
|
3050
|
-
let i =
|
|
3051
|
-
if (Array.isArray(t)) a = t.map((e) =>
|
|
3068
|
+
let i = to(e), a = [];
|
|
3069
|
+
if (Array.isArray(t)) a = t.map((e) => J(i, e)).filter((e) => e != null && e !== "");
|
|
3052
3070
|
else if (t != null && t !== "") {
|
|
3053
|
-
let e =
|
|
3071
|
+
let e = J(i, t);
|
|
3054
3072
|
e != null && e !== "" && (a = [e]);
|
|
3055
3073
|
}
|
|
3056
3074
|
let o = a.length > 0 ? n : Math.max(n, r);
|
|
@@ -3059,12 +3077,12 @@ function Qa(e, t) {
|
|
|
3059
3077
|
}
|
|
3060
3078
|
//#endregion
|
|
3061
3079
|
//#region src/components/form/linkedAddRowGroups.js
|
|
3062
|
-
var
|
|
3063
|
-
function
|
|
3080
|
+
var ro = (e) => e === !0 || e === 1 || e === "1";
|
|
3081
|
+
function io(e = []) {
|
|
3064
3082
|
let t = /* @__PURE__ */ new Map();
|
|
3065
3083
|
e.forEach((e) => {
|
|
3066
3084
|
let n = e?.linkGroup;
|
|
3067
|
-
|
|
3085
|
+
!ro(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
3068
3086
|
});
|
|
3069
3087
|
let n = /* @__PURE__ */ new Map();
|
|
3070
3088
|
return t.forEach((e, t) => {
|
|
@@ -3074,11 +3092,11 @@ function eo(e = []) {
|
|
|
3074
3092
|
});
|
|
3075
3093
|
}), n;
|
|
3076
3094
|
}
|
|
3077
|
-
function
|
|
3095
|
+
function ao(e, t) {
|
|
3078
3096
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3079
3097
|
return null;
|
|
3080
3098
|
}
|
|
3081
|
-
function
|
|
3099
|
+
function oo(e, t = {}) {
|
|
3082
3100
|
let n = { ...t };
|
|
3083
3101
|
return e.forEach(({ memberNames: e }) => {
|
|
3084
3102
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3090,32 +3108,32 @@ function no(e, t = {}) {
|
|
|
3090
3108
|
}
|
|
3091
3109
|
//#endregion
|
|
3092
3110
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3093
|
-
var
|
|
3111
|
+
var so = {
|
|
3094
3112
|
duplicate: {
|
|
3095
3113
|
className: "fdd-tone-amber",
|
|
3096
|
-
Icon:
|
|
3114
|
+
Icon: ve
|
|
3097
3115
|
},
|
|
3098
3116
|
overwrite: {
|
|
3099
3117
|
className: "fdd-tone-amber",
|
|
3100
|
-
Icon:
|
|
3118
|
+
Icon: ue
|
|
3101
3119
|
},
|
|
3102
3120
|
suggestion: {
|
|
3103
3121
|
className: "fdd-tone-blue",
|
|
3104
|
-
Icon:
|
|
3122
|
+
Icon: ge
|
|
3105
3123
|
},
|
|
3106
3124
|
file: {
|
|
3107
3125
|
className: "fdd-tone-blue",
|
|
3108
|
-
Icon:
|
|
3126
|
+
Icon: me
|
|
3109
3127
|
}
|
|
3110
3128
|
};
|
|
3111
|
-
function
|
|
3112
|
-
let { className: l, Icon: u } =
|
|
3129
|
+
function co({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c } = {}) {
|
|
3130
|
+
let { className: l, Icon: u } = so[e] ?? so.suggestion, d = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3113
3131
|
return new Promise((e) => {
|
|
3114
3132
|
let r = !1, f = (t) => {
|
|
3115
3133
|
r || (r = !0, e(t));
|
|
3116
3134
|
}, p = ne.confirm({
|
|
3117
3135
|
...c ? { footer: (e, { OkBtn: t, CancelBtn: n }) => /* @__PURE__ */ T(C, { children: [
|
|
3118
|
-
/* @__PURE__ */ w(
|
|
3136
|
+
/* @__PURE__ */ w(x, {
|
|
3119
3137
|
size: "large",
|
|
3120
3138
|
className: "fdd-alt-btn",
|
|
3121
3139
|
onClick: () => {
|
|
@@ -3173,8 +3191,8 @@ function io({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3173
3191
|
});
|
|
3174
3192
|
});
|
|
3175
3193
|
}
|
|
3176
|
-
function
|
|
3177
|
-
let { className: a, Icon: o } =
|
|
3194
|
+
function lo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3195
|
+
let { className: a, Icon: o } = so[e] ?? so.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3178
3196
|
return new Promise((e) => {
|
|
3179
3197
|
ne.warning({
|
|
3180
3198
|
icon: null,
|
|
@@ -3216,7 +3234,7 @@ function ao({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3216
3234
|
}
|
|
3217
3235
|
//#endregion
|
|
3218
3236
|
//#region src/services/aiActionApi.js
|
|
3219
|
-
async function
|
|
3237
|
+
async function uo({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3220
3238
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3221
3239
|
let c = await r(), l = new FormData();
|
|
3222
3240
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3242,17 +3260,17 @@ async function oo({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3242
3260
|
}
|
|
3243
3261
|
//#endregion
|
|
3244
3262
|
//#region src/components/detail/phoneDisplay.js
|
|
3245
|
-
var
|
|
3246
|
-
function
|
|
3263
|
+
var fo = (e) => e == null || e === "";
|
|
3264
|
+
function po(e, t) {
|
|
3247
3265
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3248
3266
|
}
|
|
3249
|
-
function
|
|
3267
|
+
function mo(e) {
|
|
3250
3268
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3251
3269
|
if (!t) return "";
|
|
3252
3270
|
let n = t.replace(/^\+/, "");
|
|
3253
3271
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3254
3272
|
}
|
|
3255
|
-
function
|
|
3273
|
+
function ho(e) {
|
|
3256
3274
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3257
3275
|
return [
|
|
3258
3276
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3265,15 +3283,15 @@ function uo(e) {
|
|
|
3265
3283
|
"isdCode"
|
|
3266
3284
|
];
|
|
3267
3285
|
}
|
|
3268
|
-
function
|
|
3269
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3286
|
+
function go(e, t, n = "") {
|
|
3287
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...ho(e)] : ho(e);
|
|
3270
3288
|
for (let e of i) {
|
|
3271
|
-
let n =
|
|
3289
|
+
let n = mo(po(t, e));
|
|
3272
3290
|
if (n) return n;
|
|
3273
3291
|
}
|
|
3274
|
-
return
|
|
3292
|
+
return mo(n);
|
|
3275
3293
|
}
|
|
3276
|
-
function
|
|
3294
|
+
function _o(e) {
|
|
3277
3295
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3278
3296
|
return n ? {
|
|
3279
3297
|
code: n[1],
|
|
@@ -3283,17 +3301,17 @@ function po(e) {
|
|
|
3283
3301
|
rest: t
|
|
3284
3302
|
};
|
|
3285
3303
|
}
|
|
3286
|
-
function
|
|
3287
|
-
if (
|
|
3288
|
-
let { code: n, rest: r } =
|
|
3304
|
+
function vo(e, t = "") {
|
|
3305
|
+
if (fo(e)) return "";
|
|
3306
|
+
let { code: n, rest: r } = _o(e), i = n || mo(t), a = Zn(r) || r;
|
|
3289
3307
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3290
3308
|
}
|
|
3291
|
-
function
|
|
3292
|
-
return
|
|
3309
|
+
function yo(e, t, n) {
|
|
3310
|
+
return vo(t, go(e, n, Yn()));
|
|
3293
3311
|
}
|
|
3294
3312
|
//#endregion
|
|
3295
3313
|
//#region src/components/detail/renderConfig.js
|
|
3296
|
-
var
|
|
3314
|
+
var bo = [
|
|
3297
3315
|
{
|
|
3298
3316
|
value: "auto",
|
|
3299
3317
|
label: "Default (auto)"
|
|
@@ -3350,7 +3368,7 @@ var go = [
|
|
|
3350
3368
|
value: "html",
|
|
3351
3369
|
label: "HTML"
|
|
3352
3370
|
}
|
|
3353
|
-
],
|
|
3371
|
+
], xo = [
|
|
3354
3372
|
{
|
|
3355
3373
|
value: "preview",
|
|
3356
3374
|
label: "Preview (viewer)"
|
|
@@ -3371,7 +3389,7 @@ var go = [
|
|
|
3371
3389
|
value: "text",
|
|
3372
3390
|
label: "Text (filename)"
|
|
3373
3391
|
}
|
|
3374
|
-
],
|
|
3392
|
+
], So = [
|
|
3375
3393
|
{
|
|
3376
3394
|
value: "none",
|
|
3377
3395
|
label: "None"
|
|
@@ -3388,76 +3406,76 @@ var go = [
|
|
|
3388
3406
|
value: "title",
|
|
3389
3407
|
label: "Title Case"
|
|
3390
3408
|
}
|
|
3391
|
-
],
|
|
3409
|
+
], Co = [
|
|
3392
3410
|
"location",
|
|
3393
3411
|
"path",
|
|
3394
3412
|
"url",
|
|
3395
3413
|
"key"
|
|
3396
|
-
],
|
|
3414
|
+
], wo = [
|
|
3397
3415
|
"location",
|
|
3398
3416
|
"filepath",
|
|
3399
3417
|
"path",
|
|
3400
3418
|
"url",
|
|
3401
3419
|
"key"
|
|
3402
|
-
],
|
|
3420
|
+
], To = [
|
|
3403
3421
|
"uploadedfilename",
|
|
3404
3422
|
"uploadname",
|
|
3405
3423
|
"originalname",
|
|
3406
3424
|
"displayname",
|
|
3407
3425
|
"documentname",
|
|
3408
3426
|
"filename"
|
|
3409
|
-
],
|
|
3410
|
-
function
|
|
3427
|
+
], Eo = ["name"], Do = (e) => String(e).toLowerCase(), Oo = (e) => e == null || e === "";
|
|
3428
|
+
function ko(e, t) {
|
|
3411
3429
|
for (let n of t) {
|
|
3412
3430
|
let t = e[n];
|
|
3413
3431
|
if (typeof t == "string" && t) return t;
|
|
3414
3432
|
}
|
|
3415
3433
|
return "";
|
|
3416
3434
|
}
|
|
3417
|
-
function
|
|
3418
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3435
|
+
function Ao(e, t) {
|
|
3436
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Do(t).endsWith(n)) return r;
|
|
3419
3437
|
return "";
|
|
3420
3438
|
}
|
|
3421
|
-
function
|
|
3439
|
+
function jo(e) {
|
|
3422
3440
|
if (!e) return "";
|
|
3423
3441
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3424
3442
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3425
3443
|
}
|
|
3426
|
-
function
|
|
3444
|
+
function Mo(e) {
|
|
3427
3445
|
if (!e) return "";
|
|
3428
3446
|
let t = String(e);
|
|
3429
3447
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3430
3448
|
}
|
|
3431
|
-
function
|
|
3449
|
+
function No(e) {
|
|
3432
3450
|
let t = String(e ?? "").trim();
|
|
3433
3451
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3434
3452
|
}
|
|
3435
|
-
function
|
|
3436
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3453
|
+
function Po(e) {
|
|
3454
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : ko(e, Co) || Ao(e, wo);
|
|
3437
3455
|
}
|
|
3438
|
-
function
|
|
3439
|
-
return e ? typeof e == "string" ?
|
|
3456
|
+
function Fo(e) {
|
|
3457
|
+
return e ? typeof e == "string" ? jo(e) || e : typeof e == "object" && (ko(e, F().documentNameOrder ?? []) || Ao(e, To) || jo(Po(e)) || Ao(e, Eo)) || "Document" : "Document";
|
|
3440
3458
|
}
|
|
3441
|
-
function
|
|
3442
|
-
if (
|
|
3459
|
+
function Io(e) {
|
|
3460
|
+
if (Oo(e)) return [];
|
|
3443
3461
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3444
|
-
for (let e of t) if (!
|
|
3462
|
+
for (let e of t) if (!Oo(e)) {
|
|
3445
3463
|
if (typeof e == "string") {
|
|
3446
3464
|
let t = e.includes("/") ? e : "";
|
|
3447
3465
|
n.push({
|
|
3448
3466
|
location: t,
|
|
3449
|
-
name:
|
|
3450
|
-
url:
|
|
3451
|
-
needsAuthFetch:
|
|
3467
|
+
name: jo(e) || e,
|
|
3468
|
+
url: Mo(t),
|
|
3469
|
+
needsAuthFetch: No(t)
|
|
3452
3470
|
});
|
|
3453
3471
|
} else if (typeof e == "object") {
|
|
3454
|
-
let t =
|
|
3472
|
+
let t = Po(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3455
3473
|
n.push({
|
|
3456
3474
|
location: t,
|
|
3457
|
-
name:
|
|
3458
|
-
url: r ||
|
|
3475
|
+
name: Fo(e),
|
|
3476
|
+
url: r || Mo(t),
|
|
3459
3477
|
documentId: e.id || e._id || e.documentId || "",
|
|
3460
|
-
needsAuthFetch: !r &&
|
|
3478
|
+
needsAuthFetch: !r && No(t)
|
|
3461
3479
|
});
|
|
3462
3480
|
}
|
|
3463
3481
|
}
|
|
@@ -3465,24 +3483,24 @@ function Mo(e) {
|
|
|
3465
3483
|
}
|
|
3466
3484
|
//#endregion
|
|
3467
3485
|
//#region src/components/form/repeatableRowShape.js
|
|
3468
|
-
function
|
|
3486
|
+
function Lo(e) {
|
|
3469
3487
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3470
3488
|
}
|
|
3471
|
-
function
|
|
3489
|
+
function Ro(e, t) {
|
|
3472
3490
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3473
|
-
let n =
|
|
3491
|
+
let n = Lo(e);
|
|
3474
3492
|
if (!n) return t;
|
|
3475
3493
|
let r = !1, i = t.map((e) => typeof e == "object" && e && !Array.isArray(e) ? e : e == null || String(e).trim() === "" ? (r = !0, {}) : (r = !0, { [n]: e }));
|
|
3476
3494
|
return r ? i : t;
|
|
3477
3495
|
}
|
|
3478
3496
|
//#endregion
|
|
3479
3497
|
//#region src/components/form/applyGroupValues.js
|
|
3480
|
-
var
|
|
3481
|
-
function
|
|
3498
|
+
var zo = (e) => e === !0 || e === 1 || e === "1", Bo = (e) => e == null || e === "";
|
|
3499
|
+
function Vo(e) {
|
|
3482
3500
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3483
3501
|
}
|
|
3484
|
-
function
|
|
3485
|
-
let r = Array.isArray(t) ? t :
|
|
3502
|
+
function Y(e, t, n) {
|
|
3503
|
+
let r = Array.isArray(t) ? t : Vo(t);
|
|
3486
3504
|
if (!r.length) return e;
|
|
3487
3505
|
let i = e;
|
|
3488
3506
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3491,23 +3509,23 @@ function J(e, t, n) {
|
|
|
3491
3509
|
}
|
|
3492
3510
|
return i[r[r.length - 1]] = n, e;
|
|
3493
3511
|
}
|
|
3494
|
-
function
|
|
3512
|
+
function Ho(e, t = []) {
|
|
3495
3513
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3496
3514
|
if (!n) continue;
|
|
3497
|
-
let t =
|
|
3498
|
-
if (!
|
|
3515
|
+
let t = H(e, n);
|
|
3516
|
+
if (!Bo(t)) return t;
|
|
3499
3517
|
}
|
|
3500
3518
|
}
|
|
3501
|
-
function
|
|
3519
|
+
function Uo(e, t) {
|
|
3502
3520
|
if (!e || typeof e != "object") return;
|
|
3503
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3521
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Bo(n));
|
|
3504
3522
|
if (r) return r[1];
|
|
3505
3523
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3506
|
-
let n =
|
|
3507
|
-
if (!
|
|
3524
|
+
let n = Uo(e, t);
|
|
3525
|
+
if (!Bo(n)) return n;
|
|
3508
3526
|
}
|
|
3509
3527
|
}
|
|
3510
|
-
function
|
|
3528
|
+
function Wo(e, t) {
|
|
3511
3529
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3512
3530
|
if (!n.length) return;
|
|
3513
3531
|
let r = n.map((e, n) => {
|
|
@@ -3517,9 +3535,9 @@ function Bo(e, t) {
|
|
|
3517
3535
|
status: "done"
|
|
3518
3536
|
};
|
|
3519
3537
|
if (!e || typeof e != "object") return null;
|
|
3520
|
-
let r =
|
|
3538
|
+
let r = Ho(e, [t.fileUrlKey, t.locationKey]) ?? Uo(e, /(location|url|path)$/i) ?? "", i = Ho(e, [t.fileNameKey]) ?? Uo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3521
3539
|
if (!r && !i) return null;
|
|
3522
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3540
|
+
let a = r && !String(r).startsWith("http") ? Mo(r) : r;
|
|
3523
3541
|
return {
|
|
3524
3542
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3525
3543
|
name: i || "file",
|
|
@@ -3531,11 +3549,11 @@ function Bo(e, t) {
|
|
|
3531
3549
|
}).filter(Boolean);
|
|
3532
3550
|
return r.length ? r : void 0;
|
|
3533
3551
|
}
|
|
3534
|
-
function
|
|
3552
|
+
function Go(e, t) {
|
|
3535
3553
|
if (!e || typeof e != "object") return;
|
|
3536
|
-
let n =
|
|
3554
|
+
let n = Ho(e, [t.fileNameKey, t.field]) ?? Uo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Ho(e, [t.fileUrlKey, t.locationKey]) ?? Uo(e, /(location|url|path)$/i) ?? "";
|
|
3537
3555
|
if (!n && !r) return;
|
|
3538
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3556
|
+
let i = r && !String(r).startsWith("http") ? Mo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3539
3557
|
return [{
|
|
3540
3558
|
uid: String(a),
|
|
3541
3559
|
name: n ?? "file",
|
|
@@ -3544,56 +3562,56 @@ function Vo(e, t) {
|
|
|
3544
3562
|
url: i || void 0
|
|
3545
3563
|
}];
|
|
3546
3564
|
}
|
|
3547
|
-
function
|
|
3565
|
+
function Ko(e, t, n, r) {
|
|
3548
3566
|
(e.fields ?? []).forEach((e) => {
|
|
3549
3567
|
e?.verifyAction && [
|
|
3550
3568
|
e.verifyResultField,
|
|
3551
3569
|
e.verifyTimestampField,
|
|
3552
3570
|
...String(e.verifyLockedWhenFields ?? "").split(/[,\s]+/)
|
|
3553
3571
|
].map((e) => String(e ?? "").trim()).filter(Boolean).forEach((e) => {
|
|
3554
|
-
if (
|
|
3572
|
+
if (H(n, e) !== void 0) return;
|
|
3555
3573
|
let i = r(t, { field: e });
|
|
3556
|
-
i != null &&
|
|
3574
|
+
i != null && Y(n, e, i);
|
|
3557
3575
|
});
|
|
3558
3576
|
});
|
|
3559
3577
|
}
|
|
3560
|
-
function
|
|
3561
|
-
let t = Array.isArray(e.rows) ?
|
|
3578
|
+
function qo(e) {
|
|
3579
|
+
let t = Array.isArray(e.rows) ? Ro(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3562
3580
|
let i = {};
|
|
3563
3581
|
return (e.fields ?? []).forEach((e) => {
|
|
3564
3582
|
if (!e.field) return;
|
|
3565
3583
|
if (e.type === "file") {
|
|
3566
3584
|
let r = n(t, e);
|
|
3567
|
-
r &&
|
|
3585
|
+
r && Y(i, e.field, r);
|
|
3568
3586
|
return;
|
|
3569
3587
|
}
|
|
3570
3588
|
let a = r(t, e);
|
|
3571
3589
|
if (a == null) {
|
|
3572
|
-
let t = e.defaultOnEdit ?
|
|
3573
|
-
t !== void 0 &&
|
|
3590
|
+
let t = e.defaultOnEdit ? Pa(e) : void 0;
|
|
3591
|
+
t !== void 0 && Y(i, e.field, t);
|
|
3574
3592
|
return;
|
|
3575
3593
|
}
|
|
3576
|
-
|
|
3577
|
-
}),
|
|
3578
|
-
}, i =
|
|
3594
|
+
Y(i, e.field, zo(e.addRow) ? no(e, a) : J(e, a));
|
|
3595
|
+
}), Ko(e, t, i, r), i;
|
|
3596
|
+
}, i = Ua(e, { editing: !0 });
|
|
3579
3597
|
if (t && t.length > 0) {
|
|
3580
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3598
|
+
let e = t.map((e) => r(e, (e, t) => Go(e, t), (e, t) => H(e, t.field)));
|
|
3581
3599
|
for (; e.length < n;) e.push({ ...i });
|
|
3582
3600
|
return e;
|
|
3583
3601
|
}
|
|
3584
|
-
let a = r(e, (e, t) =>
|
|
3602
|
+
let a = r(e, (e, t) => Wo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3585
3603
|
for (; o.length < n;) o.push({ ...i });
|
|
3586
3604
|
return o;
|
|
3587
3605
|
}
|
|
3588
|
-
function
|
|
3606
|
+
function Jo(e, t = []) {
|
|
3589
3607
|
let n = {};
|
|
3590
3608
|
return t.forEach((e) => {
|
|
3591
|
-
e.toggleEnabled && e.toggleField &&
|
|
3609
|
+
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3592
3610
|
if (!e.field || e.addRow) return;
|
|
3593
3611
|
let t = e.value, r = e.field;
|
|
3594
3612
|
if (e.type === "file") {
|
|
3595
|
-
let i =
|
|
3596
|
-
i &&
|
|
3613
|
+
let i = Wo(t, e);
|
|
3614
|
+
i && Y(n, r, i);
|
|
3597
3615
|
return;
|
|
3598
3616
|
}
|
|
3599
3617
|
if (t == null) return;
|
|
@@ -3601,43 +3619,43 @@ function Wo(e, t = []) {
|
|
|
3601
3619
|
let i = e.transformRule?.map;
|
|
3602
3620
|
if (i) {
|
|
3603
3621
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3604
|
-
|
|
3605
|
-
} else
|
|
3622
|
+
Y(n, r, e ? [e[0]] : []);
|
|
3623
|
+
} else Y(n, r, ia(e, Array.isArray(t) ? t : [t]));
|
|
3606
3624
|
return;
|
|
3607
3625
|
}
|
|
3608
3626
|
let i = e.splitDialCodeInto;
|
|
3609
3627
|
if (i && typeof t == "string") {
|
|
3610
|
-
let { code: a, rest: o } =
|
|
3611
|
-
s &&
|
|
3628
|
+
let { code: a, rest: o } = _o(t), s = mo(a);
|
|
3629
|
+
s && Y(n, i, s), Y(n, r, J(e, o || t));
|
|
3612
3630
|
return;
|
|
3613
3631
|
}
|
|
3614
|
-
|
|
3632
|
+
Y(n, r, J(e, t));
|
|
3615
3633
|
});
|
|
3616
3634
|
}), Object.keys(n).length > 0 && e.setFieldsValue(n), n;
|
|
3617
3635
|
}
|
|
3618
3636
|
//#endregion
|
|
3619
3637
|
//#region src/components/form/useAiActions.js
|
|
3620
|
-
function
|
|
3638
|
+
function Yo(e) {
|
|
3621
3639
|
let t = document.createElement("div");
|
|
3622
3640
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3623
3641
|
}
|
|
3624
|
-
function
|
|
3625
|
-
return t && t === "stripHtml" ?
|
|
3642
|
+
function Xo(e, t) {
|
|
3643
|
+
return t && t === "stripHtml" ? Yo(e) : e;
|
|
3626
3644
|
}
|
|
3627
|
-
function
|
|
3645
|
+
function Zo(e) {
|
|
3628
3646
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3629
3647
|
}
|
|
3630
|
-
function
|
|
3648
|
+
function Qo(e) {
|
|
3631
3649
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3632
3650
|
}
|
|
3633
|
-
function
|
|
3651
|
+
function $o(e, t) {
|
|
3634
3652
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3635
|
-
let n =
|
|
3653
|
+
let n = Xo(t, e.transform), r = String(n ?? "").trim();
|
|
3636
3654
|
if (!r) return !1;
|
|
3637
3655
|
let i = Number(e.minWords) || 0;
|
|
3638
|
-
return i > 0 ?
|
|
3656
|
+
return i > 0 ? Zo(r) >= i : !0;
|
|
3639
3657
|
}
|
|
3640
|
-
function
|
|
3658
|
+
function es(e, t) {
|
|
3641
3659
|
let n = e.inputs || [];
|
|
3642
3660
|
if (n.length === 0) return !0;
|
|
3643
3661
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3645,10 +3663,10 @@ function Xo(e, t) {
|
|
|
3645
3663
|
let n = e.group || `__solo_${t}`;
|
|
3646
3664
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3647
3665
|
});
|
|
3648
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3666
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => $o(e, t(e.sourceField)))) return !1;
|
|
3649
3667
|
return !0;
|
|
3650
3668
|
}
|
|
3651
|
-
function
|
|
3669
|
+
function ts(e = []) {
|
|
3652
3670
|
let t = [];
|
|
3653
3671
|
return e.forEach((e) => {
|
|
3654
3672
|
if (e?.addRow) {
|
|
@@ -3661,32 +3679,32 @@ function Zo(e = []) {
|
|
|
3661
3679
|
});
|
|
3662
3680
|
}), t;
|
|
3663
3681
|
}
|
|
3664
|
-
function
|
|
3665
|
-
return
|
|
3682
|
+
function ns(e, t) {
|
|
3683
|
+
return ts(t).some((t) => {
|
|
3666
3684
|
let n = e.getFieldValue(t);
|
|
3667
|
-
return Array.isArray(n) ? n.some(
|
|
3685
|
+
return Array.isArray(n) ? n.some(Qo) : n != null && n !== "";
|
|
3668
3686
|
});
|
|
3669
3687
|
}
|
|
3670
|
-
function
|
|
3688
|
+
function rs(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3671
3689
|
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;
|
|
3672
3690
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3673
|
-
if (!(i.has(e) || !a(e) || !
|
|
3691
|
+
if (!(i.has(e) || !a(e) || !is(t))) {
|
|
3674
3692
|
if (Array.isArray(t)) {
|
|
3675
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3693
|
+
o += t.filter((e) => e && typeof e == "object" ? Qo(e) : !!e).length;
|
|
3676
3694
|
return;
|
|
3677
3695
|
}
|
|
3678
3696
|
o += 1;
|
|
3679
3697
|
}
|
|
3680
3698
|
}), o;
|
|
3681
3699
|
}
|
|
3682
|
-
function
|
|
3683
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3700
|
+
function is(e) {
|
|
3701
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? Qo(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
3684
3702
|
}
|
|
3685
|
-
function
|
|
3703
|
+
function as(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3686
3704
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
3687
|
-
return n ? a.some((e) =>
|
|
3705
|
+
return n ? a.some((e) => is(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && is(r[t])) : a.some((e) => is(r[e]));
|
|
3688
3706
|
}
|
|
3689
|
-
function
|
|
3707
|
+
function os(e = []) {
|
|
3690
3708
|
let t = {};
|
|
3691
3709
|
return (e ?? []).forEach((e) => {
|
|
3692
3710
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3697,38 +3715,38 @@ function ns(e = []) {
|
|
|
3697
3715
|
});
|
|
3698
3716
|
}), t;
|
|
3699
3717
|
}
|
|
3700
|
-
function
|
|
3718
|
+
function ss(e, t, n) {
|
|
3701
3719
|
let r = e?.confirmWhen ?? "never";
|
|
3702
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3720
|
+
return r === "never" ? !1 : r === "always" || ns(t, n);
|
|
3703
3721
|
}
|
|
3704
|
-
var
|
|
3722
|
+
var cs = [
|
|
3705
3723
|
"top-left",
|
|
3706
3724
|
"top-center",
|
|
3707
3725
|
"top-right",
|
|
3708
3726
|
"bottom-left",
|
|
3709
3727
|
"bottom-center",
|
|
3710
3728
|
"bottom-right"
|
|
3711
|
-
],
|
|
3712
|
-
function
|
|
3729
|
+
], ls = "bottom-left";
|
|
3730
|
+
function us(e = []) {
|
|
3713
3731
|
let t = {};
|
|
3714
3732
|
return e.forEach((e) => {
|
|
3715
|
-
let n =
|
|
3733
|
+
let n = cs.includes(e.position) ? e.position : ls;
|
|
3716
3734
|
(t[n] ??= []).push(e);
|
|
3717
3735
|
}), t;
|
|
3718
3736
|
}
|
|
3719
|
-
function
|
|
3720
|
-
let [o, s] = v(null), [c, l] = v(""), u =
|
|
3737
|
+
function ds({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3738
|
+
let [o, s] = v(null), [c, l] = v(""), u = S.useWatch((e) => e, e), d = p((e) => es(e, (e) => (u || {})[e]), [u]), f = p((t) => {
|
|
3721
3739
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3722
|
-
let n =
|
|
3740
|
+
let n = Jo(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3723
3741
|
return t.forEach((t) => {
|
|
3724
3742
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3725
|
-
let n =
|
|
3743
|
+
let n = qo(t);
|
|
3726
3744
|
if (n.length === 0) return;
|
|
3727
3745
|
r = !0;
|
|
3728
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3746
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Qo);
|
|
3729
3747
|
if (a.length) {
|
|
3730
3748
|
let e = t.label || t.name;
|
|
3731
|
-
|
|
3749
|
+
co({
|
|
3732
3750
|
tone: "overwrite",
|
|
3733
3751
|
title: `Replace what's in ${e}?`,
|
|
3734
3752
|
facts: [
|
|
@@ -3758,9 +3776,9 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3758
3776
|
return {
|
|
3759
3777
|
runAction: p(async (t, o, c, u) => {
|
|
3760
3778
|
let d = c?.confirmWhen ?? "never";
|
|
3761
|
-
if (c?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
3762
|
-
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
3763
|
-
if (!await
|
|
3779
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || as(e, [o?.field], { includeUntouched: a }))) {
|
|
3780
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = rs(e, [o?.field], { includeUntouched: a });
|
|
3781
|
+
if (!await co({
|
|
3764
3782
|
tone: "overwrite",
|
|
3765
3783
|
title: t.title || "Read this file and fill the form in?",
|
|
3766
3784
|
facts: [{
|
|
@@ -3784,12 +3802,12 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3784
3802
|
r && (s[t.param] = r);
|
|
3785
3803
|
} else {
|
|
3786
3804
|
let n = e.getFieldValue(t.sourceField);
|
|
3787
|
-
n != null && n !== "" && (a[t.param] =
|
|
3805
|
+
n != null && n !== "" && (a[t.param] = Xo(n, t.transform));
|
|
3788
3806
|
}
|
|
3789
3807
|
}), (c.inputs || []).forEach((e) => {
|
|
3790
3808
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3791
3809
|
});
|
|
3792
|
-
let l = await
|
|
3810
|
+
let l = await uo({
|
|
3793
3811
|
module: n,
|
|
3794
3812
|
group: t,
|
|
3795
3813
|
field: o.field,
|
|
@@ -3797,9 +3815,9 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3797
3815
|
inputs: a,
|
|
3798
3816
|
files: s
|
|
3799
3817
|
}), d = c.label || "AI action", p = l?.groups;
|
|
3800
|
-
if (c?.trigger !== "upload" &&
|
|
3801
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3802
|
-
if (!await
|
|
3818
|
+
if (c?.trigger !== "upload" && ss(c, e, p)) {
|
|
3819
|
+
let e = c.confirmMessages ?? {}, t = ts(p).length;
|
|
3820
|
+
if (!await co({
|
|
3803
3821
|
tone: "overwrite",
|
|
3804
3822
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3805
3823
|
facts: [{
|
|
@@ -3812,7 +3830,7 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3812
3830
|
body: e.body || "We found details you can use. Applying them will replace what you have already entered in those boxes.",
|
|
3813
3831
|
okText: e.ok || "Use these details",
|
|
3814
3832
|
cancelText: e.cancel || "Keep what I typed"
|
|
3815
|
-
})) return
|
|
3833
|
+
})) return se.info(`${d} cancelled — your entries were kept.`), l;
|
|
3816
3834
|
}
|
|
3817
3835
|
if (i) {
|
|
3818
3836
|
let e = await i({
|
|
@@ -3820,18 +3838,18 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3820
3838
|
field: o,
|
|
3821
3839
|
groupName: t,
|
|
3822
3840
|
responseGroups: p,
|
|
3823
|
-
payload:
|
|
3841
|
+
payload: os(p)
|
|
3824
3842
|
});
|
|
3825
3843
|
if (e === !1 || e === "abort") return l;
|
|
3826
3844
|
}
|
|
3827
3845
|
let m = f(p);
|
|
3828
|
-
return m ?
|
|
3846
|
+
return m ? se.success(`${d} completed successfully.`) : se.info(`${d} completed, but no matching details were found.`), m && r && await r({
|
|
3829
3847
|
action: c,
|
|
3830
3848
|
field: o,
|
|
3831
3849
|
groupName: t
|
|
3832
3850
|
}), l;
|
|
3833
3851
|
} catch (e) {
|
|
3834
|
-
|
|
3852
|
+
se.error(e?.message || `${c.label || "AI action"} failed`);
|
|
3835
3853
|
return;
|
|
3836
3854
|
} finally {
|
|
3837
3855
|
s(null), l("");
|
|
@@ -3852,7 +3870,7 @@ function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3852
3870
|
}
|
|
3853
3871
|
//#endregion
|
|
3854
3872
|
//#region src/components/form/AiActionButtons.jsx
|
|
3855
|
-
function
|
|
3873
|
+
function fs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3856
3874
|
if (!t || t.length === 0) return null;
|
|
3857
3875
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3858
3876
|
return /* @__PURE__ */ w(re, {
|
|
@@ -3862,7 +3880,7 @@ function cs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3862
3880
|
width: "100%",
|
|
3863
3881
|
justifyContent: a
|
|
3864
3882
|
},
|
|
3865
|
-
children: t.map((e) => /* @__PURE__ */ w(
|
|
3883
|
+
children: t.map((e) => /* @__PURE__ */ w(x, {
|
|
3866
3884
|
size: "small",
|
|
3867
3885
|
loading: n.loadingKey === e.key,
|
|
3868
3886
|
disabled: n.busy || !n.isActionEnabled(e),
|
|
@@ -3873,18 +3891,18 @@ function cs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3873
3891
|
}
|
|
3874
3892
|
//#endregion
|
|
3875
3893
|
//#region src/components/form/emailValidator.js
|
|
3876
|
-
function
|
|
3894
|
+
function ps(e) {
|
|
3877
3895
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3878
3896
|
if (!n) return !1;
|
|
3879
3897
|
let [, r, i] = n;
|
|
3880
3898
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3881
3899
|
}
|
|
3882
|
-
function
|
|
3883
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3900
|
+
function ms(e = "Email", t) {
|
|
3901
|
+
return { validator: (n, r) => r == null || r === "" || ps(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3884
3902
|
}
|
|
3885
3903
|
//#endregion
|
|
3886
3904
|
//#region src/components/form/inputValidator.js
|
|
3887
|
-
var
|
|
3905
|
+
var hs = [
|
|
3888
3906
|
{
|
|
3889
3907
|
label: "Only Numbers",
|
|
3890
3908
|
value: "onlyNumber"
|
|
@@ -3957,7 +3975,7 @@ var ds = [
|
|
|
3957
3975
|
label: "Website URL",
|
|
3958
3976
|
value: "websiteUrl"
|
|
3959
3977
|
}
|
|
3960
|
-
],
|
|
3978
|
+
], gs = {
|
|
3961
3979
|
onlyNumber: /^[0-9]$/,
|
|
3962
3980
|
experience: /^[0-9]$/,
|
|
3963
3981
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3973,10 +3991,10 @@ var ds = [
|
|
|
3973
3991
|
decimalRange: /^[0-9.]$/,
|
|
3974
3992
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3975
3993
|
};
|
|
3976
|
-
function
|
|
3977
|
-
return
|
|
3994
|
+
function _s(e) {
|
|
3995
|
+
return gs[e] ?? null;
|
|
3978
3996
|
}
|
|
3979
|
-
function
|
|
3997
|
+
function vs(e, t = {}, n = "change") {
|
|
3980
3998
|
if (!t?.type || e == null) return {
|
|
3981
3999
|
cleaned: e ?? "",
|
|
3982
4000
|
error: null
|
|
@@ -4059,7 +4077,7 @@ function ms(e, t = {}, n = "change") {
|
|
|
4059
4077
|
break;
|
|
4060
4078
|
}
|
|
4061
4079
|
case "email":
|
|
4062
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4080
|
+
c = n === "blur" ? r.trim() : r, c && !ps(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
4063
4081
|
break;
|
|
4064
4082
|
case "websiteUrl":
|
|
4065
4083
|
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.`);
|
|
@@ -4071,21 +4089,21 @@ function ms(e, t = {}, n = "change") {
|
|
|
4071
4089
|
error: l
|
|
4072
4090
|
};
|
|
4073
4091
|
}
|
|
4074
|
-
var
|
|
4075
|
-
function
|
|
4092
|
+
var ys = "This value is already present";
|
|
4093
|
+
function bs(e) {
|
|
4076
4094
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
4077
4095
|
}
|
|
4078
|
-
function
|
|
4079
|
-
if (
|
|
4096
|
+
function xs(e) {
|
|
4097
|
+
if (bs(e) !== "unique") return null;
|
|
4080
4098
|
if (typeof e == "string") return {
|
|
4081
|
-
message:
|
|
4099
|
+
message: ys,
|
|
4082
4100
|
normalizer: "trim",
|
|
4083
4101
|
skipBlank: !0,
|
|
4084
4102
|
validateOn: "blur"
|
|
4085
4103
|
};
|
|
4086
4104
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4087
4105
|
return {
|
|
4088
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4106
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ys,
|
|
4089
4107
|
collectionField: t.collectionField ?? "",
|
|
4090
4108
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4091
4109
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4096,20 +4114,20 @@ function _s(e) {
|
|
|
4096
4114
|
].includes(n) ? n : "blur"
|
|
4097
4115
|
};
|
|
4098
4116
|
}
|
|
4099
|
-
function
|
|
4117
|
+
function Ss(e) {
|
|
4100
4118
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4101
4119
|
if (!Array.isArray(t)) return null;
|
|
4102
4120
|
for (let e of t) {
|
|
4103
|
-
let t =
|
|
4121
|
+
let t = xs(e);
|
|
4104
4122
|
if (t) return t;
|
|
4105
4123
|
}
|
|
4106
4124
|
return null;
|
|
4107
4125
|
}
|
|
4108
|
-
function
|
|
4126
|
+
function Cs(e = []) {
|
|
4109
4127
|
let t = [];
|
|
4110
4128
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4111
4129
|
(e?.fields ?? []).forEach((e) => {
|
|
4112
|
-
let n =
|
|
4130
|
+
let n = Ss(e);
|
|
4113
4131
|
!n || !e?.field || t.push({
|
|
4114
4132
|
field: e.field,
|
|
4115
4133
|
label: e.label ?? e.field,
|
|
@@ -4118,10 +4136,10 @@ function ys(e = []) {
|
|
|
4118
4136
|
});
|
|
4119
4137
|
}), t;
|
|
4120
4138
|
}
|
|
4121
|
-
function
|
|
4139
|
+
function ws(e) {
|
|
4122
4140
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4123
4141
|
}
|
|
4124
|
-
function
|
|
4142
|
+
function Ts(e, t = "trim") {
|
|
4125
4143
|
if (e == null) return "";
|
|
4126
4144
|
let n = String(e);
|
|
4127
4145
|
switch (String(t)) {
|
|
@@ -4133,34 +4151,34 @@ function xs(e, t = "trim") {
|
|
|
4133
4151
|
default: return n.trim();
|
|
4134
4152
|
}
|
|
4135
4153
|
}
|
|
4136
|
-
function
|
|
4137
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4154
|
+
function Es(e, t) {
|
|
4155
|
+
return !(!e || e.skipBlank !== !1 && ws(t));
|
|
4138
4156
|
}
|
|
4139
|
-
function
|
|
4157
|
+
function Ds(e) {
|
|
4140
4158
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4141
4159
|
}
|
|
4142
|
-
var
|
|
4160
|
+
var X = {
|
|
4143
4161
|
SKIPPED: "skipped",
|
|
4144
4162
|
AVAILABLE: "available",
|
|
4145
4163
|
DUPLICATE: "duplicate",
|
|
4146
4164
|
STALE: "stale",
|
|
4147
4165
|
ERROR: "error"
|
|
4148
4166
|
};
|
|
4149
|
-
function
|
|
4167
|
+
function Os({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4150
4168
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4151
4169
|
}
|
|
4152
|
-
function
|
|
4170
|
+
function ks({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4153
4171
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4154
4172
|
function o(e) {
|
|
4155
4173
|
a = e, typeof t == "function" && t(a);
|
|
4156
4174
|
}
|
|
4157
4175
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4158
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4159
|
-
let p =
|
|
4176
|
+
if (!c || !t || !s || typeof e != "function" || !Es(c, l)) return { status: X.SKIPPED };
|
|
4177
|
+
let p = Os({
|
|
4160
4178
|
module: t,
|
|
4161
4179
|
field: s,
|
|
4162
4180
|
recordId: u,
|
|
4163
|
-
normalized:
|
|
4181
|
+
normalized: Ts(l, c.normalizer)
|
|
4164
4182
|
});
|
|
4165
4183
|
if (n.has(p)) return n.get(p);
|
|
4166
4184
|
i += 1;
|
|
@@ -4175,17 +4193,17 @@ function Ts({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4175
4193
|
clientId: d,
|
|
4176
4194
|
region: f
|
|
4177
4195
|
});
|
|
4178
|
-
if (r.get(s) !== m) return { status:
|
|
4196
|
+
if (r.get(s) !== m) return { status: X.STALE };
|
|
4179
4197
|
let a = i?.available === !1 ? {
|
|
4180
|
-
status:
|
|
4181
|
-
message:
|
|
4182
|
-
} : { status:
|
|
4198
|
+
status: X.DUPLICATE,
|
|
4199
|
+
message: As(i) || c.message || ys
|
|
4200
|
+
} : { status: X.AVAILABLE };
|
|
4183
4201
|
return n.set(p, a), a;
|
|
4184
4202
|
} catch (e) {
|
|
4185
4203
|
return r.get(s) === m ? {
|
|
4186
|
-
status:
|
|
4204
|
+
status: X.ERROR,
|
|
4187
4205
|
error: e
|
|
4188
|
-
} : { status:
|
|
4206
|
+
} : { status: X.STALE };
|
|
4189
4207
|
} finally {
|
|
4190
4208
|
o(Math.max(0, a - 1));
|
|
4191
4209
|
}
|
|
@@ -4199,17 +4217,17 @@ function Ts({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4199
4217
|
}
|
|
4200
4218
|
};
|
|
4201
4219
|
}
|
|
4202
|
-
function
|
|
4220
|
+
function As(e) {
|
|
4203
4221
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4204
4222
|
}
|
|
4205
|
-
var
|
|
4206
|
-
function
|
|
4207
|
-
let r =
|
|
4223
|
+
var js = "__uniqueRule";
|
|
4224
|
+
function Ms({ field: e, validation: t, context: n }) {
|
|
4225
|
+
let r = xs(t);
|
|
4208
4226
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4209
4227
|
let i = e?.field ?? "";
|
|
4210
4228
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4211
|
-
[
|
|
4212
|
-
validateTrigger:
|
|
4229
|
+
[js]: r,
|
|
4230
|
+
validateTrigger: Ds(r),
|
|
4213
4231
|
validator: async (e, t) => {
|
|
4214
4232
|
let a = await n.checker.check({
|
|
4215
4233
|
module: n.module,
|
|
@@ -4220,26 +4238,26 @@ function Os({ field: e, validation: t, context: n }) {
|
|
|
4220
4238
|
clientId: n.clientId,
|
|
4221
4239
|
region: n.region
|
|
4222
4240
|
});
|
|
4223
|
-
return a.status ===
|
|
4241
|
+
return a.status === X.DUPLICATE ? Promise.reject(Error(a.message || r.message)) : Promise.resolve();
|
|
4224
4242
|
}
|
|
4225
4243
|
};
|
|
4226
4244
|
}
|
|
4227
|
-
function
|
|
4245
|
+
function Ns(e = []) {
|
|
4228
4246
|
let t = Array.isArray(e) ? e : [];
|
|
4229
|
-
if (!t.some((e) => e && e[
|
|
4230
|
-
let n = t.filter((e) => e && !e[
|
|
4247
|
+
if (!t.some((e) => e && e[js])) return t;
|
|
4248
|
+
let n = t.filter((e) => e && !e[js] && !e.warningOnly);
|
|
4231
4249
|
return t.map((e) => {
|
|
4232
|
-
if (!e || !e[
|
|
4250
|
+
if (!e || !e[js]) return e;
|
|
4233
4251
|
let t = e.validator;
|
|
4234
4252
|
return {
|
|
4235
4253
|
...e,
|
|
4236
|
-
validator: async (e, r) => await
|
|
4254
|
+
validator: async (e, r) => await Ps(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4237
4255
|
};
|
|
4238
4256
|
});
|
|
4239
4257
|
}
|
|
4240
|
-
async function
|
|
4258
|
+
async function Ps(e = [], t, n = {}) {
|
|
4241
4259
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4242
|
-
if (r.required &&
|
|
4260
|
+
if (r.required && ws(t) || !ws(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;
|
|
4243
4261
|
if (typeof r.validator == "function") try {
|
|
4244
4262
|
await r.validator(n, t);
|
|
4245
4263
|
} catch {
|
|
@@ -4248,7 +4266,7 @@ async function As(e = [], t, n = {}) {
|
|
|
4248
4266
|
}
|
|
4249
4267
|
return !1;
|
|
4250
4268
|
}
|
|
4251
|
-
function
|
|
4269
|
+
function Fs(e) {
|
|
4252
4270
|
let t = String(e ?? "").trim();
|
|
4253
4271
|
if (!t.startsWith("{")) return null;
|
|
4254
4272
|
try {
|
|
@@ -4257,19 +4275,19 @@ function js(e) {
|
|
|
4257
4275
|
return null;
|
|
4258
4276
|
}
|
|
4259
4277
|
}
|
|
4260
|
-
function
|
|
4278
|
+
function Is(e) {
|
|
4261
4279
|
if (!e) return null;
|
|
4262
|
-
if (typeof e == "string") return
|
|
4280
|
+
if (typeof e == "string") return Fs(e);
|
|
4263
4281
|
let t = [
|
|
4264
4282
|
e.data,
|
|
4265
4283
|
e.response,
|
|
4266
4284
|
e,
|
|
4267
|
-
|
|
4285
|
+
Fs(e.message)
|
|
4268
4286
|
];
|
|
4269
4287
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4270
4288
|
return null;
|
|
4271
4289
|
}
|
|
4272
|
-
function
|
|
4290
|
+
function Ls({ field: e, group: t, rowIndex: n }) {
|
|
4273
4291
|
let r = String(e ?? ""), i = Number(n);
|
|
4274
4292
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4275
4293
|
String(t),
|
|
@@ -4277,14 +4295,14 @@ function Ns({ field: e, group: t, rowIndex: n }) {
|
|
|
4277
4295
|
...r.split(".")
|
|
4278
4296
|
] : r;
|
|
4279
4297
|
}
|
|
4280
|
-
function
|
|
4281
|
-
let n =
|
|
4298
|
+
function Rs(e, { uniqueRules: t = [] } = {}) {
|
|
4299
|
+
let n = Is(e);
|
|
4282
4300
|
if (n) {
|
|
4283
4301
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4284
4302
|
let t = {
|
|
4285
4303
|
field: e.field,
|
|
4286
|
-
name:
|
|
4287
|
-
message: e.message || n.message ||
|
|
4304
|
+
name: Ls(e),
|
|
4305
|
+
message: e.message || n.message || ys
|
|
4288
4306
|
};
|
|
4289
4307
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4290
4308
|
});
|
|
@@ -4301,29 +4319,29 @@ function Ps(e, { uniqueRules: t = [] } = {}) {
|
|
|
4301
4319
|
}
|
|
4302
4320
|
//#endregion
|
|
4303
4321
|
//#region src/components/form/patternRule.js
|
|
4304
|
-
var
|
|
4305
|
-
function
|
|
4306
|
-
return !!(e && typeof e == "object" &&
|
|
4322
|
+
var zs = (e) => e === !0 || e === 1 || e === "1" || typeof e == "string" && e.trim().toLowerCase() === "true";
|
|
4323
|
+
function Bs(e) {
|
|
4324
|
+
return !!(e && typeof e == "object" && zs(e.warningOnly));
|
|
4307
4325
|
}
|
|
4308
|
-
function
|
|
4326
|
+
function Vs({ label: e, message: t, rule: n }) {
|
|
4309
4327
|
let r = {
|
|
4310
4328
|
pattern: new RegExp(n.pattern ?? n.value, n.flags),
|
|
4311
4329
|
message: t ?? `Enter valid ${e}`
|
|
4312
4330
|
};
|
|
4313
|
-
return
|
|
4331
|
+
return Bs(n) && (r.warningOnly = !0), r;
|
|
4314
4332
|
}
|
|
4315
|
-
function
|
|
4316
|
-
return
|
|
4333
|
+
function Hs(e) {
|
|
4334
|
+
return Bs(e);
|
|
4317
4335
|
}
|
|
4318
|
-
function
|
|
4336
|
+
function Us(e, t) {
|
|
4319
4337
|
return e?.type === "pattern" && t?.warningOnly === !0 && (e.warningOnly = !0), e;
|
|
4320
4338
|
}
|
|
4321
|
-
function
|
|
4339
|
+
function Ws(e) {
|
|
4322
4340
|
return typeof e == "string" ? e.toUpperCase() : e;
|
|
4323
4341
|
}
|
|
4324
4342
|
//#endregion
|
|
4325
4343
|
//#region src/services/uniqueValidationApi.js
|
|
4326
|
-
async function
|
|
4344
|
+
async function Gs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4327
4345
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4328
4346
|
let c = {
|
|
4329
4347
|
field: t,
|
|
@@ -4357,7 +4375,7 @@ async function Vs({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4357
4375
|
throw e;
|
|
4358
4376
|
}
|
|
4359
4377
|
}
|
|
4360
|
-
async function
|
|
4378
|
+
async function Ks({ module: e, payload: t, excludeId: n } = {}) {
|
|
4361
4379
|
if (!e || !t) return { duplicate: !1 };
|
|
4362
4380
|
try {
|
|
4363
4381
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4375,7 +4393,7 @@ async function Hs({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4375
4393
|
}
|
|
4376
4394
|
//#endregion
|
|
4377
4395
|
//#region src/components/form/uploadAccept.js
|
|
4378
|
-
var
|
|
4396
|
+
var qs = [
|
|
4379
4397
|
"jpg",
|
|
4380
4398
|
"jpeg",
|
|
4381
4399
|
"png",
|
|
@@ -4384,18 +4402,18 @@ var Us = [
|
|
|
4384
4402
|
"bmp",
|
|
4385
4403
|
"svg",
|
|
4386
4404
|
"avif"
|
|
4387
|
-
],
|
|
4405
|
+
], Js = [
|
|
4388
4406
|
"mp4",
|
|
4389
4407
|
"webm",
|
|
4390
4408
|
"ogg",
|
|
4391
4409
|
"ogv",
|
|
4392
4410
|
"mov",
|
|
4393
4411
|
"m4v"
|
|
4394
|
-
],
|
|
4412
|
+
], Ys = [
|
|
4395
4413
|
"pdf",
|
|
4396
4414
|
"doc",
|
|
4397
4415
|
"docx"
|
|
4398
|
-
],
|
|
4416
|
+
], Xs = [
|
|
4399
4417
|
{
|
|
4400
4418
|
label: "Any file",
|
|
4401
4419
|
value: "any"
|
|
@@ -4420,45 +4438,45 @@ var Us = [
|
|
|
4420
4438
|
label: "Images & Videos",
|
|
4421
4439
|
value: "imagesAndVideos"
|
|
4422
4440
|
}
|
|
4423
|
-
],
|
|
4441
|
+
], Zs = {
|
|
4424
4442
|
resume: {
|
|
4425
|
-
exts:
|
|
4443
|
+
exts: Ys,
|
|
4426
4444
|
maxSizeMB: 2,
|
|
4427
4445
|
hint: "PDF, DOC or DOCX",
|
|
4428
4446
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4429
4447
|
},
|
|
4430
4448
|
documents: {
|
|
4431
|
-
exts: [...
|
|
4449
|
+
exts: [...Ys, ...qs],
|
|
4432
4450
|
hint: "PDF, DOC or image files",
|
|
4433
4451
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4434
4452
|
},
|
|
4435
4453
|
images: {
|
|
4436
|
-
exts:
|
|
4454
|
+
exts: qs,
|
|
4437
4455
|
hint: "Image files",
|
|
4438
4456
|
error: "Only image files are allowed"
|
|
4439
4457
|
},
|
|
4440
4458
|
videos: {
|
|
4441
|
-
exts:
|
|
4459
|
+
exts: Js,
|
|
4442
4460
|
hint: "Video files",
|
|
4443
4461
|
error: "Only video files are allowed"
|
|
4444
4462
|
},
|
|
4445
4463
|
imagesAndVideos: {
|
|
4446
|
-
exts: [...
|
|
4464
|
+
exts: [...qs, ...Js],
|
|
4447
4465
|
hint: "Image or video files",
|
|
4448
4466
|
error: "Only image or video files are allowed"
|
|
4449
4467
|
}
|
|
4450
4468
|
};
|
|
4451
|
-
function
|
|
4469
|
+
function Qs(e) {
|
|
4452
4470
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4453
4471
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4454
4472
|
}
|
|
4455
|
-
function
|
|
4473
|
+
function $s(e) {
|
|
4456
4474
|
let t = String(e?.accept ?? "").trim();
|
|
4457
|
-
return t && t !== "any" ?
|
|
4475
|
+
return t && t !== "any" ? Zs[t] ?? null : !t && Qs(e) ? Zs.resume : Zs[t] ?? null;
|
|
4458
4476
|
}
|
|
4459
4477
|
//#endregion
|
|
4460
4478
|
//#region src/components/form/quickActionLabels.js
|
|
4461
|
-
var
|
|
4479
|
+
var ec = /* @__PURE__ */ new Set([
|
|
4462
4480
|
"of",
|
|
4463
4481
|
"and",
|
|
4464
4482
|
"the",
|
|
@@ -4467,7 +4485,7 @@ var Xs = /* @__PURE__ */ new Set([
|
|
|
4467
4485
|
"in",
|
|
4468
4486
|
"a",
|
|
4469
4487
|
"an"
|
|
4470
|
-
]),
|
|
4488
|
+
]), tc = {
|
|
4471
4489
|
addresses: "address",
|
|
4472
4490
|
branches: "branch",
|
|
4473
4491
|
batches: "batch",
|
|
@@ -4478,50 +4496,50 @@ var Xs = /* @__PURE__ */ new Set([
|
|
|
4478
4496
|
people: "person",
|
|
4479
4497
|
statuses: "status"
|
|
4480
4498
|
};
|
|
4481
|
-
function
|
|
4499
|
+
function nc(e) {
|
|
4482
4500
|
let t = String(e ?? "").trim();
|
|
4483
4501
|
if (!t) return "";
|
|
4484
4502
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4485
4503
|
let n = t.toLowerCase();
|
|
4486
|
-
return
|
|
4504
|
+
return tc[n] ? tc[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;
|
|
4487
4505
|
}
|
|
4488
|
-
function
|
|
4506
|
+
function rc(e) {
|
|
4489
4507
|
let t = String(e ?? "").trim();
|
|
4490
4508
|
if (!t) return "";
|
|
4491
4509
|
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);
|
|
4492
4510
|
if (!n.length) return "";
|
|
4493
|
-
let r =
|
|
4511
|
+
let r = nc(n[n.length - 1]);
|
|
4494
4512
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4495
4513
|
let n = e.toLowerCase();
|
|
4496
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4514
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && ec.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4497
4515
|
}).join(" ");
|
|
4498
4516
|
}
|
|
4499
|
-
function
|
|
4517
|
+
function ic(e, t) {
|
|
4500
4518
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4501
4519
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4502
|
-
let r =
|
|
4520
|
+
let r = rc(e?.quickCreateModule || t);
|
|
4503
4521
|
return r ? `Add New ${r}` : "Add New";
|
|
4504
4522
|
}
|
|
4505
|
-
function
|
|
4523
|
+
function ac(e, t) {
|
|
4506
4524
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4507
4525
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4508
|
-
let r =
|
|
4526
|
+
let r = rc(e?.quickEditModule || t);
|
|
4509
4527
|
return r ? `Edit ${r}` : "Edit";
|
|
4510
4528
|
}
|
|
4511
|
-
function
|
|
4512
|
-
let r =
|
|
4513
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4529
|
+
function oc(e, t, n) {
|
|
4530
|
+
let r = rc((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4531
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : ic(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : ac(t, n));
|
|
4514
4532
|
}
|
|
4515
4533
|
//#endregion
|
|
4516
4534
|
//#region src/components/AppButton.jsx
|
|
4517
|
-
function
|
|
4518
|
-
let o = /* @__PURE__ */ w(
|
|
4535
|
+
function sc({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4536
|
+
let o = /* @__PURE__ */ w(x, {
|
|
4519
4537
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4520
4538
|
icon: n,
|
|
4521
4539
|
...a,
|
|
4522
4540
|
children: e
|
|
4523
4541
|
});
|
|
4524
|
-
return r ? /* @__PURE__ */ w(
|
|
4542
|
+
return r ? /* @__PURE__ */ w(xe, {
|
|
4525
4543
|
className: "app-button-link",
|
|
4526
4544
|
to: r,
|
|
4527
4545
|
children: o
|
|
@@ -4529,13 +4547,13 @@ function nc({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4529
4547
|
}
|
|
4530
4548
|
//#endregion
|
|
4531
4549
|
//#region src/components/detail/userNames.js
|
|
4532
|
-
function
|
|
4550
|
+
function cc(e) {
|
|
4533
4551
|
return !e || typeof e != "object" ? "" : [e.first_name ?? e.firstName ?? e.FIRST_NAME, e.last_name ?? e.lastName ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.user_name || e.userName || e.username || e.email || "";
|
|
4534
4552
|
}
|
|
4535
|
-
function
|
|
4553
|
+
function lc(e) {
|
|
4536
4554
|
let t = {};
|
|
4537
4555
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4538
|
-
let n =
|
|
4556
|
+
let n = cc(e);
|
|
4539
4557
|
n && [
|
|
4540
4558
|
e.legacyUserId,
|
|
4541
4559
|
e.userId,
|
|
@@ -4549,16 +4567,16 @@ function ic(e) {
|
|
|
4549
4567
|
});
|
|
4550
4568
|
}), t;
|
|
4551
4569
|
}
|
|
4552
|
-
var
|
|
4553
|
-
function
|
|
4570
|
+
var uc = /* @__PURE__ */ new Map();
|
|
4571
|
+
function dc(e) {
|
|
4554
4572
|
let t = String(e ?? "").trim();
|
|
4555
4573
|
if (!t) return Promise.resolve("");
|
|
4556
|
-
if (
|
|
4557
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4558
|
-
return
|
|
4574
|
+
if (uc.has(t)) return uc.get(t);
|
|
4575
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => cc(e?.data ?? e ?? null)).catch(() => "");
|
|
4576
|
+
return uc.set(t, n), n;
|
|
4559
4577
|
}
|
|
4560
4578
|
var Z = (e) => e == null ? "" : String(e).trim();
|
|
4561
|
-
function
|
|
4579
|
+
function fc(e) {
|
|
4562
4580
|
let t = e?.quickCreateNotice;
|
|
4563
4581
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4564
4582
|
enabled: !0,
|
|
@@ -4571,7 +4589,7 @@ function sc(e) {
|
|
|
4571
4589
|
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
4572
4590
|
};
|
|
4573
4591
|
}
|
|
4574
|
-
var
|
|
4592
|
+
var pc = [
|
|
4575
4593
|
"clientName",
|
|
4576
4594
|
"companyName",
|
|
4577
4595
|
"name",
|
|
@@ -4581,24 +4599,24 @@ var cc = [
|
|
|
4581
4599
|
"label",
|
|
4582
4600
|
"employerName",
|
|
4583
4601
|
"vendorName"
|
|
4584
|
-
],
|
|
4602
|
+
], mc = (e, t) => {
|
|
4585
4603
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4586
|
-
},
|
|
4587
|
-
function
|
|
4604
|
+
}, hc = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4605
|
+
function gc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4588
4606
|
if (!e || typeof e != "object") return "";
|
|
4589
4607
|
for (let r of [
|
|
4590
4608
|
t,
|
|
4591
4609
|
n,
|
|
4592
|
-
...
|
|
4610
|
+
...pc
|
|
4593
4611
|
]) {
|
|
4594
4612
|
if (!r) continue;
|
|
4595
|
-
let t =
|
|
4613
|
+
let t = hc(mc(e, r));
|
|
4596
4614
|
if (t) return t;
|
|
4597
4615
|
}
|
|
4598
4616
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4599
4617
|
return r ? Z(e[r]) : "";
|
|
4600
4618
|
}
|
|
4601
|
-
function
|
|
4619
|
+
function _c(e) {
|
|
4602
4620
|
if (!e || typeof e != "object") return "";
|
|
4603
4621
|
let t = [
|
|
4604
4622
|
e.createdBy,
|
|
@@ -4620,67 +4638,67 @@ function fc(e) {
|
|
|
4620
4638
|
}
|
|
4621
4639
|
return "";
|
|
4622
4640
|
}
|
|
4623
|
-
function
|
|
4641
|
+
function vc(e = i) {
|
|
4624
4642
|
try {
|
|
4625
|
-
return
|
|
4643
|
+
return cc(e()) || "";
|
|
4626
4644
|
} catch {
|
|
4627
4645
|
return "";
|
|
4628
4646
|
}
|
|
4629
4647
|
}
|
|
4630
|
-
var
|
|
4648
|
+
var yc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4631
4649
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4632
4650
|
return Array.isArray(t) ? t[0] : t;
|
|
4633
4651
|
});
|
|
4634
|
-
async function
|
|
4635
|
-
let { fetchRecord: o =
|
|
4652
|
+
async function bc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4653
|
+
let { fetchRecord: o = yc, fetchUserNameFn: s = dc, getUser: c = i } = a, l = null;
|
|
4636
4654
|
if (e && t) try {
|
|
4637
4655
|
l = await o(e, t);
|
|
4638
4656
|
} catch {
|
|
4639
4657
|
l = null;
|
|
4640
4658
|
}
|
|
4641
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4659
|
+
let u = n?.showRecordName === !1 ? "" : gc(l, {
|
|
4642
4660
|
recordNameField: n?.recordNameField,
|
|
4643
4661
|
displayField: r
|
|
4644
4662
|
}), d = "";
|
|
4645
4663
|
if (n?.showCreator !== !1) {
|
|
4646
|
-
let e =
|
|
4664
|
+
let e = _c(l);
|
|
4647
4665
|
if (e) try {
|
|
4648
4666
|
d = Z(await s(e));
|
|
4649
4667
|
} catch {
|
|
4650
4668
|
d = "";
|
|
4651
4669
|
}
|
|
4652
|
-
d ||=
|
|
4670
|
+
d ||= vc(c);
|
|
4653
4671
|
}
|
|
4654
4672
|
return {
|
|
4655
4673
|
recordName: u,
|
|
4656
4674
|
creatorName: d
|
|
4657
4675
|
};
|
|
4658
4676
|
}
|
|
4659
|
-
var
|
|
4660
|
-
function
|
|
4677
|
+
var xc = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
4678
|
+
function Sc(e) {
|
|
4661
4679
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
4662
4680
|
}
|
|
4663
|
-
var
|
|
4664
|
-
function
|
|
4665
|
-
let n =
|
|
4666
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
4681
|
+
var Cc = (e) => Sc(e).toLowerCase();
|
|
4682
|
+
function wc(e, t) {
|
|
4683
|
+
let n = Cc(e);
|
|
4684
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => Cc(e?.label) === n) ?? null;
|
|
4667
4685
|
}
|
|
4668
|
-
function
|
|
4669
|
-
return t || n ? !1 :
|
|
4686
|
+
function Tc({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
4687
|
+
return t || n ? !1 : Sc(e).length >= 3;
|
|
4670
4688
|
}
|
|
4671
4689
|
//#endregion
|
|
4672
4690
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4673
|
-
var
|
|
4674
|
-
function
|
|
4691
|
+
var Ec = f(() => import("./index.js").then((e) => e.i)), Dc = f(() => import("./index.js").then((e) => e.n)), Oc = (e) => e == null || e === "", kc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4692
|
+
function Ac(e, t, n, r, i) {
|
|
4675
4693
|
let a = e.quickEditIdFrom;
|
|
4676
4694
|
if (a) {
|
|
4677
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4678
|
-
return
|
|
4695
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...kc(a)] : kc(a), i = t?.getFieldValue?.(e);
|
|
4696
|
+
return Oc(i) && (i = r?.[a]), Oc(i) ? null : i;
|
|
4679
4697
|
}
|
|
4680
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4698
|
+
return i && typeof i == "object" ? i.value ?? null : Oc(i) ? null : i;
|
|
4681
4699
|
}
|
|
4682
|
-
function
|
|
4683
|
-
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ?
|
|
4700
|
+
function jc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4701
|
+
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ? Ac(e, t, n, i, a) : null, [
|
|
4684
4702
|
p,
|
|
4685
4703
|
e,
|
|
4686
4704
|
t,
|
|
@@ -4694,7 +4712,7 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4694
4712
|
openCreateWith: null,
|
|
4695
4713
|
isModalOpen: !1
|
|
4696
4714
|
};
|
|
4697
|
-
let
|
|
4715
|
+
let y = xc(e, r), b = () => c(null), ee = () => {
|
|
4698
4716
|
if (e?.quickCreateOnClick) {
|
|
4699
4717
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
4700
4718
|
return;
|
|
@@ -4713,17 +4731,17 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4713
4731
|
module: m,
|
|
4714
4732
|
prefill: e ?? null
|
|
4715
4733
|
});
|
|
4716
|
-
},
|
|
4734
|
+
}, S = () => h && _ && c({
|
|
4717
4735
|
mode: "edit",
|
|
4718
4736
|
module: h,
|
|
4719
4737
|
recordId: String(_)
|
|
4720
|
-
}),
|
|
4721
|
-
let n =
|
|
4738
|
+
}), ae = (t) => {
|
|
4739
|
+
let n = fc(e);
|
|
4722
4740
|
n && (d({
|
|
4723
4741
|
...n,
|
|
4724
4742
|
recordName: "",
|
|
4725
4743
|
creatorName: ""
|
|
4726
|
-
}),
|
|
4744
|
+
}), bc({
|
|
4727
4745
|
module: m,
|
|
4728
4746
|
recordId: t,
|
|
4729
4747
|
notice: n,
|
|
@@ -4735,7 +4753,7 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4735
4753
|
creatorName: t
|
|
4736
4754
|
});
|
|
4737
4755
|
}).catch(() => {}));
|
|
4738
|
-
},
|
|
4756
|
+
}, oe = f && !y, se = !oe && !p ? null : /* @__PURE__ */ w("div", {
|
|
4739
4757
|
className: "v1-quick-actions",
|
|
4740
4758
|
role: "presentation",
|
|
4741
4759
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -4747,31 +4765,31 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4747
4765
|
},
|
|
4748
4766
|
children: /* @__PURE__ */ T(re, {
|
|
4749
4767
|
size: 8,
|
|
4750
|
-
children: [
|
|
4768
|
+
children: [oe && /* @__PURE__ */ w(x, {
|
|
4751
4769
|
type: "link",
|
|
4752
4770
|
size: "small",
|
|
4753
|
-
icon: /* @__PURE__ */ w(
|
|
4754
|
-
onClick:
|
|
4771
|
+
icon: /* @__PURE__ */ w(_e, {}),
|
|
4772
|
+
onClick: ee,
|
|
4755
4773
|
style: { paddingLeft: 0 },
|
|
4756
|
-
children:
|
|
4757
|
-
}), p && /* @__PURE__ */ w(
|
|
4774
|
+
children: ic(e, m)
|
|
4775
|
+
}), p && /* @__PURE__ */ w(x, {
|
|
4758
4776
|
type: "link",
|
|
4759
4777
|
size: "small",
|
|
4760
|
-
icon: /* @__PURE__ */ w(
|
|
4761
|
-
onClick:
|
|
4778
|
+
icon: /* @__PURE__ */ w(le, {}),
|
|
4779
|
+
onClick: S,
|
|
4762
4780
|
disabled: !_,
|
|
4763
|
-
title: _ ? void 0 : `Choose a ${
|
|
4764
|
-
children:
|
|
4781
|
+
title: _ ? void 0 : `Choose a ${rc(h) || "record"} above first, then edit it here`,
|
|
4782
|
+
children: ac(e, h)
|
|
4765
4783
|
})]
|
|
4766
4784
|
})
|
|
4767
|
-
}),
|
|
4785
|
+
}), ce = s ? /* @__PURE__ */ w(ne, {
|
|
4768
4786
|
open: !0,
|
|
4769
|
-
title:
|
|
4787
|
+
title: oc(s.mode, e, s.mode === "create" ? m : h),
|
|
4770
4788
|
width: "min(1080px, 96vw)",
|
|
4771
4789
|
footer: null,
|
|
4772
4790
|
destroyOnClose: !0,
|
|
4773
4791
|
maskClosable: !1,
|
|
4774
|
-
onCancel:
|
|
4792
|
+
onCancel: b,
|
|
4775
4793
|
styles: { body: {
|
|
4776
4794
|
maxHeight: "78vh",
|
|
4777
4795
|
overflowY: "auto"
|
|
@@ -4784,23 +4802,23 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4784
4802
|
},
|
|
4785
4803
|
children: /* @__PURE__ */ w(ie, {})
|
|
4786
4804
|
}),
|
|
4787
|
-
children: s.mode === "create" ? /* @__PURE__ */ w(
|
|
4805
|
+
children: s.mode === "create" ? /* @__PURE__ */ w(Ec, {
|
|
4788
4806
|
moduleName: s.module,
|
|
4789
4807
|
embedded: !0,
|
|
4790
4808
|
breadcrumbItems: [],
|
|
4791
4809
|
initialRecord: s.prefill ?? void 0,
|
|
4792
|
-
onCancel:
|
|
4810
|
+
onCancel: b,
|
|
4793
4811
|
onSuccess: (e) => {
|
|
4794
|
-
|
|
4812
|
+
b(), ae(e), o?.("create", e);
|
|
4795
4813
|
}
|
|
4796
|
-
}) : /* @__PURE__ */ w(
|
|
4814
|
+
}) : /* @__PURE__ */ w(Dc, {
|
|
4797
4815
|
moduleName: s.module,
|
|
4798
4816
|
recordId: s.recordId,
|
|
4799
4817
|
embedded: !0,
|
|
4800
4818
|
breadcrumbItems: [],
|
|
4801
|
-
onCancel:
|
|
4819
|
+
onCancel: b,
|
|
4802
4820
|
onSuccess: (e) => {
|
|
4803
|
-
|
|
4821
|
+
b(), o?.("edit", e);
|
|
4804
4822
|
}
|
|
4805
4823
|
})
|
|
4806
4824
|
})
|
|
@@ -4812,12 +4830,12 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4812
4830
|
alignItems: "center",
|
|
4813
4831
|
gap: 8
|
|
4814
4832
|
},
|
|
4815
|
-
children: [/* @__PURE__ */ w(
|
|
4833
|
+
children: [/* @__PURE__ */ w(ue, { style: { color: "#faad14" } }), l.title]
|
|
4816
4834
|
}),
|
|
4817
4835
|
width: "min(520px, 94vw)",
|
|
4818
4836
|
maskClosable: !1,
|
|
4819
4837
|
onCancel: () => d(null),
|
|
4820
|
-
footer: /* @__PURE__ */ w(
|
|
4838
|
+
footer: /* @__PURE__ */ w(sc, {
|
|
4821
4839
|
variant: "primary",
|
|
4822
4840
|
type: "primary",
|
|
4823
4841
|
onClick: () => d(null),
|
|
@@ -4849,15 +4867,15 @@ function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4849
4867
|
}) : null;
|
|
4850
4868
|
return {
|
|
4851
4869
|
footer: se,
|
|
4852
|
-
modal:
|
|
4870
|
+
modal: ce || de ? /* @__PURE__ */ T(C, { children: [ce, de] }) : null,
|
|
4853
4871
|
openCreateWith: te,
|
|
4854
4872
|
isModalOpen: !!s
|
|
4855
4873
|
};
|
|
4856
4874
|
}
|
|
4857
4875
|
//#endregion
|
|
4858
4876
|
//#region src/components/form/crossFieldRules.js
|
|
4859
|
-
var
|
|
4860
|
-
function
|
|
4877
|
+
var Mc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4878
|
+
function Nc(e, t, n) {
|
|
4861
4879
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4862
4880
|
if (typeof n == "function") {
|
|
4863
4881
|
let e = n(t);
|
|
@@ -4865,23 +4883,23 @@ function Oc(e, t, n) {
|
|
|
4865
4883
|
}
|
|
4866
4884
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4867
4885
|
}
|
|
4868
|
-
function
|
|
4886
|
+
function Pc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4869
4887
|
let s = n.field ?? n.compareField ?? r;
|
|
4870
4888
|
return { validator: async (n, r) => {
|
|
4871
|
-
if (!s ||
|
|
4872
|
-
let c = i?.getFieldValue?.(
|
|
4873
|
-
if (
|
|
4889
|
+
if (!s || Mc(r)) return Promise.resolve();
|
|
4890
|
+
let c = i?.getFieldValue?.(Nc(a, s, o));
|
|
4891
|
+
if (Mc(c)) return Promise.resolve();
|
|
4874
4892
|
let l = Number(c), u = Number(r);
|
|
4875
4893
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4876
4894
|
} };
|
|
4877
4895
|
}
|
|
4878
|
-
function
|
|
4896
|
+
function Fc(e = {}, t, n) {
|
|
4879
4897
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4880
|
-
return r ?
|
|
4898
|
+
return r ? Nc(t, r, n) : null;
|
|
4881
4899
|
}
|
|
4882
4900
|
//#endregion
|
|
4883
4901
|
//#region src/components/form/maxCeiling.js
|
|
4884
|
-
function
|
|
4902
|
+
function Ic(e, t) {
|
|
4885
4903
|
let n = String(t).split(".").filter(Boolean);
|
|
4886
4904
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4887
4905
|
if (n.length > 1) {
|
|
@@ -4894,14 +4912,14 @@ function jc(e, t) {
|
|
|
4894
4912
|
let r = [...e];
|
|
4895
4913
|
return r[r.length - 1] = n[0], r;
|
|
4896
4914
|
}
|
|
4897
|
-
function
|
|
4898
|
-
let r = e?.getFieldValue?.(
|
|
4915
|
+
function Lc(e, t, n) {
|
|
4916
|
+
let r = e?.getFieldValue?.(Ic(t, n));
|
|
4899
4917
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4900
4918
|
}
|
|
4901
|
-
function
|
|
4919
|
+
function Rc(e) {
|
|
4902
4920
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4903
4921
|
}
|
|
4904
|
-
function
|
|
4922
|
+
function zc(e, t) {
|
|
4905
4923
|
for (let n of e ?? []) {
|
|
4906
4924
|
let e = t(n);
|
|
4907
4925
|
if (e == null || e === "") continue;
|
|
@@ -4913,14 +4931,14 @@ function Pc(e, t) {
|
|
|
4913
4931
|
}
|
|
4914
4932
|
return null;
|
|
4915
4933
|
}
|
|
4916
|
-
function
|
|
4934
|
+
function Bc({ input: e, compareFields: t, readValue: n }) {
|
|
4917
4935
|
let r = {
|
|
4918
4936
|
ok: !0,
|
|
4919
4937
|
field: null,
|
|
4920
4938
|
maximum: null
|
|
4921
4939
|
};
|
|
4922
4940
|
if (e == null || e === "") return r;
|
|
4923
|
-
let i =
|
|
4941
|
+
let i = zc(t, n);
|
|
4924
4942
|
if (!i) return r;
|
|
4925
4943
|
let a = Number(e);
|
|
4926
4944
|
return Number.isFinite(a) ? {
|
|
@@ -4931,39 +4949,39 @@ function Fc({ input: e, compareFields: t, readValue: n }) {
|
|
|
4931
4949
|
}
|
|
4932
4950
|
//#endregion
|
|
4933
4951
|
//#region src/components/form/contextPrefill.js
|
|
4934
|
-
var
|
|
4935
|
-
function
|
|
4952
|
+
var Vc = { candidates: ["applicantId"] };
|
|
4953
|
+
function Hc(e) {
|
|
4936
4954
|
let t = String(e ?? "").trim();
|
|
4937
4955
|
if (!t) return [];
|
|
4938
4956
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4939
4957
|
return [.../* @__PURE__ */ new Set([
|
|
4940
4958
|
`${n}Id`,
|
|
4941
4959
|
`${t}Id`,
|
|
4942
|
-
...
|
|
4960
|
+
...Vc[t] ?? []
|
|
4943
4961
|
])];
|
|
4944
4962
|
}
|
|
4945
|
-
function
|
|
4963
|
+
function Uc(e, t) {
|
|
4946
4964
|
if (!t) return "";
|
|
4947
4965
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4948
|
-
for (let r of
|
|
4966
|
+
for (let r of Hc(e)) {
|
|
4949
4967
|
let e = String(n(t[r]) || "");
|
|
4950
4968
|
if (e) return e;
|
|
4951
4969
|
}
|
|
4952
4970
|
return "";
|
|
4953
4971
|
}
|
|
4954
|
-
function
|
|
4972
|
+
function Wc(e, t) {
|
|
4955
4973
|
let n = /* @__PURE__ */ new Set();
|
|
4956
4974
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4957
4975
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4958
4976
|
})), [...n];
|
|
4959
4977
|
}
|
|
4960
|
-
function
|
|
4978
|
+
function Gc(e) {
|
|
4961
4979
|
return e?.payloadMode === "skip";
|
|
4962
4980
|
}
|
|
4963
|
-
function
|
|
4981
|
+
function Kc(e) {
|
|
4964
4982
|
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 : [];
|
|
4965
4983
|
}
|
|
4966
|
-
function
|
|
4984
|
+
function qc(e) {
|
|
4967
4985
|
let t = {};
|
|
4968
4986
|
return (e ?? []).forEach((e) => {
|
|
4969
4987
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4971,7 +4989,7 @@ function Hc(e) {
|
|
|
4971
4989
|
});
|
|
4972
4990
|
}), t;
|
|
4973
4991
|
}
|
|
4974
|
-
function
|
|
4992
|
+
function Jc(e, t) {
|
|
4975
4993
|
if (!e || !t) return;
|
|
4976
4994
|
let n = e;
|
|
4977
4995
|
for (let e of String(t).split(".")) {
|
|
@@ -4986,7 +5004,7 @@ function Uc(e, t) {
|
|
|
4986
5004
|
}
|
|
4987
5005
|
return n;
|
|
4988
5006
|
}
|
|
4989
|
-
function
|
|
5007
|
+
function Yc(e, t) {
|
|
4990
5008
|
if (!(!e || !t)) for (let n of [
|
|
4991
5009
|
t.prefillFrom,
|
|
4992
5010
|
t.field,
|
|
@@ -4994,13 +5012,13 @@ function Wc(e, t) {
|
|
|
4994
5012
|
]) {
|
|
4995
5013
|
if (!n) continue;
|
|
4996
5014
|
let t = e[n];
|
|
4997
|
-
if (t ??=
|
|
5015
|
+
if (t ??= H(e, n), t ??= Jc(e, n), t != null) return t;
|
|
4998
5016
|
}
|
|
4999
5017
|
}
|
|
5000
5018
|
//#endregion
|
|
5001
5019
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
5002
|
-
function
|
|
5003
|
-
let a = Ki(t), o =
|
|
5020
|
+
function Xc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
5021
|
+
let a = Ki(t), o = S.useWatch(n, e);
|
|
5004
5022
|
if (!a) return null;
|
|
5005
5023
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
5006
5024
|
setTimeout(() => {
|
|
@@ -5011,14 +5029,14 @@ function Gc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5011
5029
|
e.setFieldValue(n, !1), c();
|
|
5012
5030
|
return;
|
|
5013
5031
|
}
|
|
5014
|
-
let i = await
|
|
5032
|
+
let i = await co($i(t));
|
|
5015
5033
|
e.setFieldValue(n, !!i), c();
|
|
5016
5034
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
5017
5035
|
return /* @__PURE__ */ w(ae, {
|
|
5018
5036
|
title: u,
|
|
5019
5037
|
children: /* @__PURE__ */ w("span", {
|
|
5020
5038
|
className: "v1-override-wrap",
|
|
5021
|
-
children: /* @__PURE__ */ w(
|
|
5039
|
+
children: /* @__PURE__ */ w(te, {
|
|
5022
5040
|
className: "v1-override-checkbox",
|
|
5023
5041
|
checked: !!o,
|
|
5024
5042
|
disabled: i,
|
|
@@ -5030,52 +5048,52 @@ function Gc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5030
5048
|
}
|
|
5031
5049
|
//#endregion
|
|
5032
5050
|
//#region src/components/form/prefillWhenRules.js
|
|
5033
|
-
var
|
|
5034
|
-
function
|
|
5051
|
+
var Zc = (e) => String(e ?? "");
|
|
5052
|
+
function Qc(e) {
|
|
5035
5053
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5036
5054
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5037
5055
|
let r = e?.field;
|
|
5038
5056
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
5039
5057
|
}), n;
|
|
5040
5058
|
}
|
|
5041
|
-
function
|
|
5042
|
-
return
|
|
5059
|
+
function $c(e, t, n, r) {
|
|
5060
|
+
return Qc(e).map((e) => ({
|
|
5043
5061
|
field: e,
|
|
5044
5062
|
path: n(t, e, r)
|
|
5045
5063
|
}));
|
|
5046
5064
|
}
|
|
5047
|
-
function
|
|
5048
|
-
return !e || !e.field ? !1 :
|
|
5065
|
+
function el(e, t = {}) {
|
|
5066
|
+
return !e || !e.field ? !1 : Zc(t[e.field]) === Zc(e.value);
|
|
5049
5067
|
}
|
|
5050
|
-
function
|
|
5051
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
5068
|
+
function tl({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
5069
|
+
let o = (Array.isArray(e) ? e : []).find((e) => el(e, t));
|
|
5052
5070
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
5053
5071
|
action: "set",
|
|
5054
5072
|
value: o.setValue
|
|
5055
|
-
} : i && r !== void 0 &&
|
|
5073
|
+
} : i && r !== void 0 && Zc(n) === Zc(r) ? { action: "clear" } : { action: "none" };
|
|
5056
5074
|
}
|
|
5057
5075
|
//#endregion
|
|
5058
5076
|
//#region src/components/form/computeFromRules.js
|
|
5059
|
-
var
|
|
5060
|
-
function
|
|
5061
|
-
return !!(e &&
|
|
5077
|
+
var nl = ["daysUntil"], rl = (e) => e == null || e === "", il = (e) => String(e ?? "");
|
|
5078
|
+
function al(e) {
|
|
5079
|
+
return !!(e && nl.includes(e.type) && e.field);
|
|
5062
5080
|
}
|
|
5063
|
-
function
|
|
5064
|
-
if (
|
|
5081
|
+
function ol(e) {
|
|
5082
|
+
if (rl(e)) return null;
|
|
5065
5083
|
let t = E.isDayjs(e) ? e : E(e?.$date ?? e);
|
|
5066
5084
|
return t.isValid() ? t.format("YYYY-MM-DD") : null;
|
|
5067
5085
|
}
|
|
5068
|
-
function
|
|
5069
|
-
let n =
|
|
5086
|
+
function sl(e, t) {
|
|
5087
|
+
let n = ol(e), r = ol(t ?? E());
|
|
5070
5088
|
if (!(!n || !r)) return Math.max(0, E(n).diff(E(r), "day"));
|
|
5071
5089
|
}
|
|
5072
|
-
function
|
|
5073
|
-
if (
|
|
5074
|
-
case "daysUntil": return
|
|
5090
|
+
function cl(e, t, n) {
|
|
5091
|
+
if (al(e)) switch (e.type) {
|
|
5092
|
+
case "daysUntil": return sl(t, n);
|
|
5075
5093
|
default: return;
|
|
5076
5094
|
}
|
|
5077
5095
|
}
|
|
5078
|
-
function
|
|
5096
|
+
function ll(e, t, n, r) {
|
|
5079
5097
|
let i = Object.entries(e?.setFields || {}).filter(([e]) => !!e).map(([e, i]) => ({
|
|
5080
5098
|
field: e,
|
|
5081
5099
|
path: n(t, e, r),
|
|
@@ -5086,28 +5104,28 @@ function il(e, t, n, r) {
|
|
|
5086
5104
|
setFields: i
|
|
5087
5105
|
};
|
|
5088
5106
|
}
|
|
5089
|
-
function
|
|
5090
|
-
if (!
|
|
5091
|
-
let o =
|
|
5107
|
+
function ul({ cfg: e, sourceValue: t, previousSource: n, current: r, lastApplied: i, today: a } = {}) {
|
|
5108
|
+
if (!al(e) || rl(t) || ol(t) === ol(n)) return { action: "none" };
|
|
5109
|
+
let o = cl(e, t, a);
|
|
5092
5110
|
if (o === void 0) return { action: "none" };
|
|
5093
|
-
if (
|
|
5094
|
-
let e = i !== void 0 &&
|
|
5095
|
-
if (!
|
|
5111
|
+
if (rl(n)) {
|
|
5112
|
+
let e = i !== void 0 && il(r) === il(i);
|
|
5113
|
+
if (!rl(r) && !e) return { action: "none" };
|
|
5096
5114
|
}
|
|
5097
|
-
return
|
|
5115
|
+
return il(r) === il(o) ? { action: "none" } : {
|
|
5098
5116
|
action: "set",
|
|
5099
5117
|
value: o
|
|
5100
5118
|
};
|
|
5101
5119
|
}
|
|
5102
5120
|
//#endregion
|
|
5103
5121
|
//#region src/components/form/ComputeFromWatcher.jsx
|
|
5104
|
-
function
|
|
5105
|
-
let a =
|
|
5122
|
+
function dl({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [] }) {
|
|
5123
|
+
let a = S.useWatch(n, {
|
|
5106
5124
|
form: e,
|
|
5107
5125
|
preserve: !0
|
|
5108
5126
|
}), o = _(void 0), s = _(void 0), c = a?.format ? a.format("YYYY-MM-DD") : String(a ?? "");
|
|
5109
5127
|
return h(() => {
|
|
5110
|
-
let n =
|
|
5128
|
+
let n = ul({
|
|
5111
5129
|
cfg: t,
|
|
5112
5130
|
sourceValue: a,
|
|
5113
5131
|
previousSource: o.current,
|
|
@@ -5121,7 +5139,7 @@ function ol({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [
|
|
|
5121
5139
|
//#endregion
|
|
5122
5140
|
//#region src/components/form/optionConstraints.js
|
|
5123
5141
|
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
5124
|
-
function
|
|
5142
|
+
function fl(e) {
|
|
5125
5143
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
5126
5144
|
return t.forEach((e) => {
|
|
5127
5145
|
if (e != null && e !== "") {
|
|
@@ -5141,51 +5159,317 @@ function sl(e) {
|
|
|
5141
5159
|
}
|
|
5142
5160
|
}), n;
|
|
5143
5161
|
}
|
|
5144
|
-
function
|
|
5145
|
-
let n =
|
|
5162
|
+
function pl(e = [], t) {
|
|
5163
|
+
let n = fl(t);
|
|
5146
5164
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5147
5165
|
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)));
|
|
5148
5166
|
return i.length > 0 ? i : e;
|
|
5149
5167
|
}
|
|
5150
|
-
function
|
|
5168
|
+
function ml(e) {
|
|
5151
5169
|
let t = [];
|
|
5152
5170
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
5153
5171
|
e != null && e !== "" && t.push(Q(e));
|
|
5154
5172
|
}), t;
|
|
5155
5173
|
}
|
|
5156
|
-
function
|
|
5174
|
+
function hl(e, t = {}) {
|
|
5157
5175
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5158
5176
|
return n.forEach((e) => {
|
|
5159
5177
|
if (!e || e.clearValue) return;
|
|
5160
|
-
let n =
|
|
5178
|
+
let n = ml(e);
|
|
5161
5179
|
if (!n.length) return;
|
|
5162
|
-
let a =
|
|
5180
|
+
let a = el(e, t) ? i : r;
|
|
5163
5181
|
n.forEach((e) => a.add(e));
|
|
5164
5182
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
5165
5183
|
}
|
|
5166
|
-
function
|
|
5167
|
-
let r =
|
|
5184
|
+
function gl(e = [], t, n) {
|
|
5185
|
+
let r = hl(t, n);
|
|
5168
5186
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5169
5187
|
let i = new Set(r);
|
|
5170
5188
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
5171
5189
|
}
|
|
5172
|
-
function
|
|
5190
|
+
function _l(e, t = {}, n) {
|
|
5173
5191
|
let r = Array.isArray(e) ? e : [];
|
|
5174
5192
|
if (n == null || n === "") return [];
|
|
5175
5193
|
let i = Q(n), a = [], o = /* @__PURE__ */ new Set();
|
|
5176
5194
|
return r.forEach((e) => {
|
|
5177
5195
|
if (!e || e.clearValue) return;
|
|
5178
5196
|
let { setValue: n, setValueLabel: r } = e;
|
|
5179
|
-
n != null && n !== "" && r && Q(n) === i &&
|
|
5197
|
+
n != null && n !== "" && r && Q(n) === i && el(e, t) && (o.has(Q(n)) || (o.add(Q(n)), a.push({
|
|
5180
5198
|
value: n,
|
|
5181
5199
|
label: r
|
|
5182
5200
|
})));
|
|
5183
5201
|
}), a;
|
|
5184
5202
|
}
|
|
5185
5203
|
//#endregion
|
|
5204
|
+
//#region src/components/form/optionMembership.js
|
|
5205
|
+
var vl = /* @__PURE__ */ new Set([
|
|
5206
|
+
"select",
|
|
5207
|
+
"radio",
|
|
5208
|
+
"checkbox"
|
|
5209
|
+
]), yl = 3e5, bl = 1e4, xl = (e) => e === !1 || e === 0 || e === "0" || e === "false", Sl = (e) => e === !0 || e === 1 || e === "1" || e === "true", Cl = (e) => e == null || e === "";
|
|
5210
|
+
function wl(e) {
|
|
5211
|
+
let t = e?.options ?? e?.values;
|
|
5212
|
+
return Array.isArray(t) ? t : [];
|
|
5213
|
+
}
|
|
5214
|
+
function Tl(e) {
|
|
5215
|
+
return String(e?.dataSource ?? "").trim().toLowerCase();
|
|
5216
|
+
}
|
|
5217
|
+
function El(e) {
|
|
5218
|
+
if (!e || !vl.has(e.type) || xl(e.enforceOptions) || Sl(e.allowCustomValues) || e.mode === "tags") return !1;
|
|
5219
|
+
let t = Tl(e);
|
|
5220
|
+
return t === "master" ? !0 : t === "" || t === "static" ? wl(e).length > 0 : !1;
|
|
5221
|
+
}
|
|
5222
|
+
function Dl(e) {
|
|
5223
|
+
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.id ?? e.label : e).filter((e) => !Cl(e) && typeof e != "object" && typeof e != "boolean");
|
|
5224
|
+
}
|
|
5225
|
+
function Ol(e) {
|
|
5226
|
+
return e == null ? null : typeof e == "object" ? {
|
|
5227
|
+
label: e.label ?? e.name ?? e.value,
|
|
5228
|
+
value: e.value ?? e.id ?? e.name ?? e.label
|
|
5229
|
+
} : {
|
|
5230
|
+
label: String(e),
|
|
5231
|
+
value: e
|
|
5232
|
+
};
|
|
5233
|
+
}
|
|
5234
|
+
var kl = /* @__PURE__ */ new Map();
|
|
5235
|
+
function Al(e, t) {
|
|
5236
|
+
return [
|
|
5237
|
+
t,
|
|
5238
|
+
e.field,
|
|
5239
|
+
e.masterName,
|
|
5240
|
+
e.groupName
|
|
5241
|
+
].map((e) => e ?? "").join("|");
|
|
5242
|
+
}
|
|
5243
|
+
async function jl(e, t) {
|
|
5244
|
+
let n = Al(e, t), r = kl.get(n);
|
|
5245
|
+
if (r && Date.now() - r.at < yl) return r.promise;
|
|
5246
|
+
let i = Promise.resolve($r(t, e.field, "", bl, 0, {
|
|
5247
|
+
dataSource: "master",
|
|
5248
|
+
masterName: e.masterName,
|
|
5249
|
+
groupName: e.groupName
|
|
5250
|
+
})).then((e) => {
|
|
5251
|
+
let t = Array.isArray(e) ? e : e?.data ?? [];
|
|
5252
|
+
return (Array.isArray(t) ? t : []).map(Ol).filter(Boolean);
|
|
5253
|
+
});
|
|
5254
|
+
return kl.set(n, {
|
|
5255
|
+
at: Date.now(),
|
|
5256
|
+
promise: i
|
|
5257
|
+
}), i.catch(() => kl.delete(n)), i;
|
|
5258
|
+
}
|
|
5259
|
+
async function Ml(e, { moduleName: t } = {}) {
|
|
5260
|
+
return Tl(e) === "master" ? jl(e, t) : wl(e).map(Ol).filter(Boolean);
|
|
5261
|
+
}
|
|
5262
|
+
function Nl(e) {
|
|
5263
|
+
let t = /* @__PURE__ */ new Map();
|
|
5264
|
+
return e.forEach((e) => {
|
|
5265
|
+
[[e.label, e.label], [e.value, e.value]].forEach(([e, n]) => {
|
|
5266
|
+
let r = ea(e);
|
|
5267
|
+
r && !t.has(r) && t.set(r, n);
|
|
5268
|
+
});
|
|
5269
|
+
}), t;
|
|
5270
|
+
}
|
|
5271
|
+
async function Pl(e, t, { moduleName: n, constraintValue: r } = {}) {
|
|
5272
|
+
let i = Dl(t);
|
|
5273
|
+
if (!i.length) return {
|
|
5274
|
+
offList: [],
|
|
5275
|
+
snaps: /* @__PURE__ */ new Map(),
|
|
5276
|
+
options: []
|
|
5277
|
+
};
|
|
5278
|
+
let a = await Ml(e, { moduleName: n });
|
|
5279
|
+
e.optionsFromField && (a = pl(a, r));
|
|
5280
|
+
let o = Tl(e) === "master", s = o ? Nl(a) : ta({
|
|
5281
|
+
options: a,
|
|
5282
|
+
optionAliases: e.optionAliases
|
|
5283
|
+
}), c = new Set(a.flatMap((e) => o ? [String(e.value), String(e.label)] : [String(e.value)])), l = [], u = /* @__PURE__ */ new Map();
|
|
5284
|
+
return i.forEach((e) => {
|
|
5285
|
+
if (c.has(String(e))) return;
|
|
5286
|
+
let t = s.get(ea(e));
|
|
5287
|
+
t === void 0 ? l.push(String(e)) : u.set(e, t);
|
|
5288
|
+
}), {
|
|
5289
|
+
offList: l,
|
|
5290
|
+
snaps: u,
|
|
5291
|
+
options: a
|
|
5292
|
+
};
|
|
5293
|
+
}
|
|
5294
|
+
function Fl(e, t) {
|
|
5295
|
+
let n = e.label || e.field || "this field";
|
|
5296
|
+
if (e.optionsMismatchMessage) return e.optionsMismatchMessage;
|
|
5297
|
+
let r = t.map((e) => `"${e}"`).join(", ");
|
|
5298
|
+
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.`;
|
|
5299
|
+
}
|
|
5300
|
+
function Il(e = [], t = []) {
|
|
5301
|
+
let n = t[0];
|
|
5302
|
+
return e.find((e) => e?.name === n || e?.payloadKey === n) ?? e.find((e) => (e?.fields ?? []).some((e) => e?.field === n));
|
|
5303
|
+
}
|
|
5304
|
+
var Ll = /* @__PURE__ */ new WeakMap();
|
|
5305
|
+
function Rl(e) {
|
|
5306
|
+
let t = Ll.get(e);
|
|
5307
|
+
return t || (t = {
|
|
5308
|
+
entries: /* @__PURE__ */ new Map(),
|
|
5309
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
5310
|
+
snapshot: []
|
|
5311
|
+
}, Ll.set(e, t)), t;
|
|
5312
|
+
}
|
|
5313
|
+
var zl = (e) => JSON.stringify(Array.isArray(e) ? e : [e]);
|
|
5314
|
+
function Bl(e) {
|
|
5315
|
+
e.snapshot = [...e.entries.values()], e.listeners.forEach((e) => e());
|
|
5316
|
+
}
|
|
5317
|
+
function Vl(e, t, n) {
|
|
5318
|
+
if (!e) return;
|
|
5319
|
+
let r = Rl(e), i = zl(t);
|
|
5320
|
+
if (n) {
|
|
5321
|
+
let e = r.entries.get(i);
|
|
5322
|
+
if (e && e.message === n.message) return;
|
|
5323
|
+
r.entries.set(i, {
|
|
5324
|
+
...n,
|
|
5325
|
+
path: Array.isArray(t) ? t : [t]
|
|
5326
|
+
});
|
|
5327
|
+
} else if (r.entries.has(i)) r.entries.delete(i);
|
|
5328
|
+
else return;
|
|
5329
|
+
Bl(r);
|
|
5330
|
+
}
|
|
5331
|
+
function Hl(e) {
|
|
5332
|
+
return e ? Rl(e).snapshot : [];
|
|
5333
|
+
}
|
|
5334
|
+
function Ul(e) {
|
|
5335
|
+
return y((t) => {
|
|
5336
|
+
if (!e) return () => {};
|
|
5337
|
+
let n = Rl(e);
|
|
5338
|
+
return n.listeners.add(t), () => n.listeners.delete(t);
|
|
5339
|
+
}, () => Hl(e), () => Hl(e));
|
|
5340
|
+
}
|
|
5341
|
+
function Wl(e, t, n) {
|
|
5342
|
+
if (!n) return;
|
|
5343
|
+
let r = String(n).split(".").map((e) => e.trim()).filter(Boolean);
|
|
5344
|
+
if (Array.isArray(t) && t.length >= 3 && typeof t[1] == "number") {
|
|
5345
|
+
let n = e.getFieldValue([
|
|
5346
|
+
t[0],
|
|
5347
|
+
t[1],
|
|
5348
|
+
...r
|
|
5349
|
+
]);
|
|
5350
|
+
if (!Cl(n)) return n;
|
|
5351
|
+
}
|
|
5352
|
+
return e.getFieldValue(r);
|
|
5353
|
+
}
|
|
5354
|
+
function Gl({ field: e, form: t, name: n, moduleName: r }) {
|
|
5355
|
+
return { validator: async (i, a) => {
|
|
5356
|
+
if (!Dl(a).length) {
|
|
5357
|
+
Vl(t, n, null);
|
|
5358
|
+
return;
|
|
5359
|
+
}
|
|
5360
|
+
let o;
|
|
5361
|
+
try {
|
|
5362
|
+
o = await Pl(e, a, {
|
|
5363
|
+
moduleName: r,
|
|
5364
|
+
constraintValue: Wl(t, n, e.optionsFromField)
|
|
5365
|
+
});
|
|
5366
|
+
} catch (r) {
|
|
5367
|
+
console.warn(`[optionMembership] could not load options for "${e.field}"`, r), Vl(t, n, null);
|
|
5368
|
+
return;
|
|
5369
|
+
}
|
|
5370
|
+
if (!o.offList.length) {
|
|
5371
|
+
Vl(t, n, null);
|
|
5372
|
+
return;
|
|
5373
|
+
}
|
|
5374
|
+
let s = Fl(e, o.offList);
|
|
5375
|
+
throw Vl(t, n, {
|
|
5376
|
+
field: e.field,
|
|
5377
|
+
label: e.label || e.field,
|
|
5378
|
+
values: o.offList,
|
|
5379
|
+
message: s
|
|
5380
|
+
}), Error(s);
|
|
5381
|
+
} };
|
|
5382
|
+
}
|
|
5383
|
+
function Kl(e, t, { labeled: n = !1, options: r = [] } = {}) {
|
|
5384
|
+
if (!t?.size) return;
|
|
5385
|
+
let i = (e) => r.find((t) => String(t.value) === String(e)) ?? r.find((t) => String(t.label) === String(e)), a = (e) => {
|
|
5386
|
+
let r = e && typeof e == "object" ? e.value : e;
|
|
5387
|
+
if (!t.has(r)) return e;
|
|
5388
|
+
let a = t.get(r);
|
|
5389
|
+
if (!n) return a;
|
|
5390
|
+
let o = i(a);
|
|
5391
|
+
return {
|
|
5392
|
+
value: o?.value ?? a,
|
|
5393
|
+
label: o?.label ?? String(a)
|
|
5394
|
+
};
|
|
5395
|
+
};
|
|
5396
|
+
return Array.isArray(e) ? e.map(a) : a(e);
|
|
5397
|
+
}
|
|
5398
|
+
function ql({ field: e, form: t, name: n, moduleName: r, value: i, constraintValue: a, enabled: o = !0 }) {
|
|
5399
|
+
let s = !!(o && t && n !== void 0 && El(e)), c = s ? JSON.stringify(Dl(i)) : "[]", l = s && e.optionsFromField ? JSON.stringify(a ?? null) : "", u = zl(n);
|
|
5400
|
+
h(() => {
|
|
5401
|
+
if (!s || c === "[]") return;
|
|
5402
|
+
let i = !1;
|
|
5403
|
+
return Pl(e, t.getFieldValue(n), {
|
|
5404
|
+
moduleName: r,
|
|
5405
|
+
constraintValue: a
|
|
5406
|
+
}).then(({ offList: r, snaps: a, options: o }) => {
|
|
5407
|
+
if (i) return;
|
|
5408
|
+
let s = Kl(t.getFieldValue(n), a, {
|
|
5409
|
+
labeled: Ia(e),
|
|
5410
|
+
options: o
|
|
5411
|
+
});
|
|
5412
|
+
s !== void 0 && t.setFieldValue(n, s), (r.length || s !== void 0 || t.getFieldError(n).length) && t.validateFields([n]).catch(() => {});
|
|
5413
|
+
}).catch(() => {}), () => {
|
|
5414
|
+
i = !0;
|
|
5415
|
+
};
|
|
5416
|
+
}, [
|
|
5417
|
+
s,
|
|
5418
|
+
c,
|
|
5419
|
+
l,
|
|
5420
|
+
u,
|
|
5421
|
+
r,
|
|
5422
|
+
t
|
|
5423
|
+
]), h(() => {
|
|
5424
|
+
if (s) return () => Vl(t, n, null);
|
|
5425
|
+
}, [
|
|
5426
|
+
s,
|
|
5427
|
+
u,
|
|
5428
|
+
t
|
|
5429
|
+
]);
|
|
5430
|
+
}
|
|
5431
|
+
//#endregion
|
|
5432
|
+
//#region src/components/form/OptionMismatchBanner.jsx
|
|
5433
|
+
function Jl(e, t) {
|
|
5434
|
+
let n = Il(e, t), r = n?.label || n?.name, i = t.length >= 3 && typeof t[1] == "number";
|
|
5435
|
+
return r ? i ? `${r} #${t[1] + 1}` : r : "";
|
|
5436
|
+
}
|
|
5437
|
+
function Yl({ form: e, groups: t, onJump: n }) {
|
|
5438
|
+
let r = Ul(e);
|
|
5439
|
+
if (!r.length) return null;
|
|
5440
|
+
let i = r.length;
|
|
5441
|
+
return /* @__PURE__ */ w(b, {
|
|
5442
|
+
type: "error",
|
|
5443
|
+
showIcon: !0,
|
|
5444
|
+
className: "v1-option-mismatch-banner",
|
|
5445
|
+
style: { marginBottom: 16 },
|
|
5446
|
+
message: `${i} ${i === 1 ? "field has a value" : "fields have values"} that ${i === 1 ? "is" : "are"} not in the dropdown list`,
|
|
5447
|
+
description: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
|
|
5448
|
+
style: { marginBottom: 6 },
|
|
5449
|
+
children: "Choose a valid option for each of these before saving. The value that was read is still shown in the field so you can pick the closest match."
|
|
5450
|
+
}), /* @__PURE__ */ w("ul", {
|
|
5451
|
+
style: {
|
|
5452
|
+
margin: 0,
|
|
5453
|
+
paddingInlineStart: 18
|
|
5454
|
+
},
|
|
5455
|
+
children: r.map((e) => {
|
|
5456
|
+
let r = Jl(t, e.path);
|
|
5457
|
+
return /* @__PURE__ */ T("li", { children: [
|
|
5458
|
+
/* @__PURE__ */ T(oe.Link, {
|
|
5459
|
+
onClick: () => n?.(e.path),
|
|
5460
|
+
children: [r ? `${r} → ` : "", e.label]
|
|
5461
|
+
}),
|
|
5462
|
+
": ",
|
|
5463
|
+
e.values.map((e) => `"${e}"`).join(", ")
|
|
5464
|
+
] }, JSON.stringify(e.path));
|
|
5465
|
+
})
|
|
5466
|
+
})] })
|
|
5467
|
+
});
|
|
5468
|
+
}
|
|
5469
|
+
//#endregion
|
|
5186
5470
|
//#region src/components/form/optionRowFilters.js
|
|
5187
|
-
var
|
|
5188
|
-
function
|
|
5471
|
+
var Xl = 64;
|
|
5472
|
+
function Zl(e) {
|
|
5189
5473
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5190
5474
|
try {
|
|
5191
5475
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5193,34 +5477,34 @@ function ml(e) {
|
|
|
5193
5477
|
return "";
|
|
5194
5478
|
}
|
|
5195
5479
|
}
|
|
5196
|
-
var
|
|
5197
|
-
function
|
|
5480
|
+
var Ql = (e) => String(e ?? "").trim().toLowerCase(), $l = (e) => e != null && String(e).trim() !== "";
|
|
5481
|
+
function eu(e) {
|
|
5198
5482
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5199
|
-
return new Set(t.map(
|
|
5483
|
+
return new Set(t.map(Ql).filter((e) => e !== ""));
|
|
5200
5484
|
}
|
|
5201
|
-
function
|
|
5202
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5485
|
+
function tu(e, t) {
|
|
5486
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => $l(e?.extraData?.[t]));
|
|
5203
5487
|
}
|
|
5204
|
-
function
|
|
5488
|
+
function nu(e, t, n) {
|
|
5205
5489
|
let r = e?.extraData?.[t];
|
|
5206
|
-
if (
|
|
5207
|
-
let i =
|
|
5208
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5490
|
+
if (!$l(n)) return r === !0;
|
|
5491
|
+
let i = eu(n);
|
|
5492
|
+
return i.size === 0 ? r === !0 : i.has(Ql(r));
|
|
5209
5493
|
}
|
|
5210
|
-
function
|
|
5494
|
+
function ru(e, t) {
|
|
5211
5495
|
let n = /* @__PURE__ */ new Map();
|
|
5212
5496
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5213
|
-
let r =
|
|
5214
|
-
r && n.set(r,
|
|
5497
|
+
let r = Ql(e?.value);
|
|
5498
|
+
r && n.set(r, Ql(e?.extraData?.[t]));
|
|
5215
5499
|
}), n;
|
|
5216
5500
|
}
|
|
5217
|
-
function
|
|
5218
|
-
let r =
|
|
5501
|
+
function iu(e, t, n) {
|
|
5502
|
+
let r = Ql(n);
|
|
5219
5503
|
if (!r) return !1;
|
|
5220
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5504
|
+
let i = /* @__PURE__ */ new Set(), a = Ql(e);
|
|
5221
5505
|
if (!a) return !1;
|
|
5222
5506
|
i.add(a);
|
|
5223
|
-
for (let e = 0; e <
|
|
5507
|
+
for (let e = 0; e < Xl; e += 1) {
|
|
5224
5508
|
let e = t.get(a);
|
|
5225
5509
|
if (!e) return !1;
|
|
5226
5510
|
if (e === r) return !0;
|
|
@@ -5229,74 +5513,74 @@ function xl(e, t, n) {
|
|
|
5229
5513
|
}
|
|
5230
5514
|
return !1;
|
|
5231
5515
|
}
|
|
5232
|
-
function
|
|
5516
|
+
function au(e = {}) {
|
|
5233
5517
|
let t = [], n = (e) => {
|
|
5234
5518
|
let n = String(e ?? "").trim();
|
|
5235
5519
|
n && !t.includes(n) && t.push(n);
|
|
5236
5520
|
};
|
|
5237
5521
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5238
5522
|
}
|
|
5239
|
-
function
|
|
5523
|
+
function ou(e, t = {}, n = {}) {
|
|
5240
5524
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5241
5525
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5242
5526
|
typeof console < "u" && console.warn(e);
|
|
5243
5527
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5244
|
-
s && (
|
|
5528
|
+
s && (tu(o, s) ? o = o.filter((e) => nu(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".`));
|
|
5245
5529
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5246
5530
|
if (c) {
|
|
5247
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5531
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Zl(n);
|
|
5248
5532
|
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.`);
|
|
5249
|
-
else if (!
|
|
5533
|
+
else if (!tu(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".`);
|
|
5250
5534
|
else {
|
|
5251
|
-
let t =
|
|
5252
|
-
o = o.filter((e) =>
|
|
5535
|
+
let t = ru(e, c);
|
|
5536
|
+
o = o.filter((e) => iu(e?.value, t, s));
|
|
5253
5537
|
}
|
|
5254
5538
|
}
|
|
5255
5539
|
return o;
|
|
5256
5540
|
}
|
|
5257
5541
|
//#endregion
|
|
5258
5542
|
//#region src/components/form/fieldTooltip.js
|
|
5259
|
-
var
|
|
5260
|
-
function
|
|
5261
|
-
return
|
|
5543
|
+
var su = (e) => e == null || String(e).trim() === "", cu = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5544
|
+
function lu(e) {
|
|
5545
|
+
return su(e?.tooltip) ? cu(e?.infoEnabled) && !su(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5262
5546
|
}
|
|
5263
5547
|
//#endregion
|
|
5264
5548
|
//#region src/components/form/autofillValue.js
|
|
5265
|
-
var
|
|
5266
|
-
function
|
|
5549
|
+
var uu = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5550
|
+
function du(e, t = {}, n = () => void 0) {
|
|
5267
5551
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5268
|
-
return
|
|
5552
|
+
return uu(i) && a != null && a !== "" ? a : i;
|
|
5269
5553
|
}
|
|
5270
5554
|
//#endregion
|
|
5271
5555
|
//#region src/components/form/dependentLookupReset.js
|
|
5272
|
-
var
|
|
5273
|
-
function
|
|
5274
|
-
return !(!r || e ===
|
|
5556
|
+
var fu = Symbol("parentFilterUnseen"), pu = (e) => e == null || e === "", mu = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5557
|
+
function hu({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5558
|
+
return !(!r || e === fu || mu(e, t) || pu(e) || pu(n));
|
|
5275
5559
|
}
|
|
5276
5560
|
//#endregion
|
|
5277
5561
|
//#region src/utils/roleAllowsAction.js
|
|
5278
|
-
function
|
|
5279
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5562
|
+
function gu(e) {
|
|
5563
|
+
return e == null ? !0 : typeof e == "object" ? gu(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5280
5564
|
}
|
|
5281
|
-
function
|
|
5565
|
+
function _u(e, t) {
|
|
5282
5566
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5283
5567
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5284
5568
|
let e = String(t).trim().toLowerCase();
|
|
5285
5569
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5286
5570
|
}
|
|
5287
5571
|
}
|
|
5288
|
-
function
|
|
5572
|
+
function vu(e, t) {
|
|
5289
5573
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5290
5574
|
let n = `${t}Access`;
|
|
5291
5575
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5292
5576
|
}
|
|
5293
|
-
function
|
|
5577
|
+
function yu(e, t) {
|
|
5294
5578
|
if (!e) return !0;
|
|
5295
5579
|
try {
|
|
5296
5580
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5297
5581
|
for (let e of o) {
|
|
5298
|
-
let t =
|
|
5299
|
-
if (t) return
|
|
5582
|
+
let t = _u(n, e);
|
|
5583
|
+
if (t) return gu(vu(t, a));
|
|
5300
5584
|
}
|
|
5301
5585
|
return !0;
|
|
5302
5586
|
} catch {
|
|
@@ -5305,10 +5589,10 @@ function Il(e, t) {
|
|
|
5305
5589
|
}
|
|
5306
5590
|
//#endregion
|
|
5307
5591
|
//#region src/utils/afterSubmitNav.js
|
|
5308
|
-
function
|
|
5592
|
+
function bu(e) {
|
|
5309
5593
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5310
5594
|
}
|
|
5311
|
-
function
|
|
5595
|
+
function xu(e, t, n) {
|
|
5312
5596
|
let r = String(e ?? "").trim();
|
|
5313
5597
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5314
5598
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5317,50 +5601,50 @@ function Rl(e, t, n) {
|
|
|
5317
5601
|
}
|
|
5318
5602
|
//#endregion
|
|
5319
5603
|
//#region src/utils/backNav.js
|
|
5320
|
-
function
|
|
5604
|
+
function Su(e = typeof window < "u" ? window : void 0) {
|
|
5321
5605
|
let t = e?.history?.state?.idx;
|
|
5322
5606
|
return typeof t == "number" && t > 0;
|
|
5323
5607
|
}
|
|
5324
|
-
function
|
|
5325
|
-
return t && e ? { path: e } :
|
|
5608
|
+
function Cu({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5609
|
+
return t && e ? { path: e } : Su(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5326
5610
|
}
|
|
5327
|
-
function
|
|
5328
|
-
let n =
|
|
5611
|
+
function wu(e, t = {}) {
|
|
5612
|
+
let n = Cu(t);
|
|
5329
5613
|
return n.back ? e(-1) : e(n.path), n;
|
|
5330
5614
|
}
|
|
5331
5615
|
//#endregion
|
|
5332
5616
|
//#region src/components/form/educationRules.js
|
|
5333
|
-
var
|
|
5334
|
-
function
|
|
5617
|
+
var Tu = (e) => e == null ? "" : String(e).trim();
|
|
5618
|
+
function Eu(e, t) {
|
|
5335
5619
|
let n = e?.regionRules;
|
|
5336
5620
|
if (!n || typeof n != "object") return e ?? {};
|
|
5337
|
-
let r =
|
|
5621
|
+
let r = Tu(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5338
5622
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5339
5623
|
...e,
|
|
5340
5624
|
...i
|
|
5341
5625
|
};
|
|
5342
5626
|
}
|
|
5343
|
-
function
|
|
5627
|
+
function Du(e) {
|
|
5344
5628
|
return e?.allowInProgress !== !1;
|
|
5345
5629
|
}
|
|
5346
|
-
function
|
|
5347
|
-
return
|
|
5630
|
+
function Ou(e) {
|
|
5631
|
+
return Du(e) ? "" : ju(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.";
|
|
5348
5632
|
}
|
|
5349
|
-
function
|
|
5350
|
-
return
|
|
5633
|
+
function ku(e) {
|
|
5634
|
+
return Du(e) ? "allow" : Tu(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5351
5635
|
}
|
|
5352
|
-
function
|
|
5353
|
-
return
|
|
5636
|
+
function Au(e) {
|
|
5637
|
+
return ku(e) === "block";
|
|
5354
5638
|
}
|
|
5355
|
-
function
|
|
5356
|
-
return
|
|
5639
|
+
function ju(e) {
|
|
5640
|
+
return ku(e) === "warn";
|
|
5357
5641
|
}
|
|
5358
|
-
function
|
|
5359
|
-
if (!
|
|
5360
|
-
let t =
|
|
5642
|
+
function Mu(e) {
|
|
5643
|
+
if (!Au(e)) return null;
|
|
5644
|
+
let t = Ou(e);
|
|
5361
5645
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5362
5646
|
}
|
|
5363
|
-
function
|
|
5647
|
+
function Nu(e, t = {}) {
|
|
5364
5648
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5365
5649
|
for (let t of [n, r]) {
|
|
5366
5650
|
let n = e?.[t];
|
|
@@ -5370,50 +5654,50 @@ function Xl(e, t = {}) {
|
|
|
5370
5654
|
}
|
|
5371
5655
|
return null;
|
|
5372
5656
|
}
|
|
5373
|
-
function
|
|
5657
|
+
function Pu(e, t = {}) {
|
|
5374
5658
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5375
5659
|
return !!e?.[n];
|
|
5376
5660
|
}
|
|
5377
|
-
function
|
|
5661
|
+
function Fu(e = [], t = {}) {
|
|
5378
5662
|
let n = (t.direction ?? "desc") === "desc";
|
|
5379
5663
|
return e.map((e, n) => ({
|
|
5380
5664
|
index: n,
|
|
5381
|
-
key:
|
|
5382
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5665
|
+
key: Nu(e, t),
|
|
5666
|
+
ongoing: t.inProgressFirst !== !1 && Pu(e, t)
|
|
5383
5667
|
})).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);
|
|
5384
5668
|
}
|
|
5385
|
-
function
|
|
5669
|
+
function Iu(e, t, n = {}) {
|
|
5386
5670
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5387
|
-
let r =
|
|
5671
|
+
let r = Fu(e, n).indexOf(t);
|
|
5388
5672
|
return r === -1 || r === t ? null : {
|
|
5389
5673
|
from: t,
|
|
5390
5674
|
to: r,
|
|
5391
|
-
reason:
|
|
5675
|
+
reason: Pu(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5392
5676
|
};
|
|
5393
5677
|
}
|
|
5394
|
-
var
|
|
5678
|
+
var Lu = Object.freeze({
|
|
5395
5679
|
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.",
|
|
5396
5680
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5397
5681
|
ok: "Yes, move it up",
|
|
5398
5682
|
keep: "No, leave it here"
|
|
5399
5683
|
});
|
|
5400
|
-
function
|
|
5684
|
+
function Ru(e, t = {}) {
|
|
5401
5685
|
let n = {
|
|
5402
|
-
...
|
|
5686
|
+
...Lu,
|
|
5403
5687
|
...t.messages ?? {}
|
|
5404
5688
|
};
|
|
5405
5689
|
return n[e] ?? n.outOfOrder;
|
|
5406
5690
|
}
|
|
5407
|
-
function
|
|
5408
|
-
let n = t.levelField ?? "qualification", r =
|
|
5691
|
+
function zu(e, t = {}) {
|
|
5692
|
+
let n = t.levelField ?? "qualification", r = Tu(e?.[n]);
|
|
5409
5693
|
if (!r) return null;
|
|
5410
5694
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5411
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5695
|
+
return Number.isFinite(Number(a)) ? Number(a) : Bu(r, t);
|
|
5412
5696
|
}
|
|
5413
|
-
function
|
|
5697
|
+
function Bu(e, t) {
|
|
5414
5698
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5415
5699
|
for (let e of n) {
|
|
5416
|
-
let t =
|
|
5700
|
+
let t = Tu(e?.match);
|
|
5417
5701
|
if (!t) continue;
|
|
5418
5702
|
let n;
|
|
5419
5703
|
try {
|
|
@@ -5425,14 +5709,14 @@ function ru(e, t) {
|
|
|
5425
5709
|
}
|
|
5426
5710
|
return null;
|
|
5427
5711
|
}
|
|
5428
|
-
function
|
|
5429
|
-
return
|
|
5712
|
+
function Vu(e, t = {}) {
|
|
5713
|
+
return Tu((t?.levelLabels ?? {})[e]) || Tu(e);
|
|
5430
5714
|
}
|
|
5431
|
-
function
|
|
5715
|
+
function Hu(e = [], t = {}) {
|
|
5432
5716
|
if (!t || t.requireBelow === !1) return [];
|
|
5433
5717
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5434
5718
|
if (!r.length) return [];
|
|
5435
|
-
let i = e.map((e) =>
|
|
5719
|
+
let i = e.map((e) => zu(e, t)).filter((e) => e !== null);
|
|
5436
5720
|
if (!i.length) return [];
|
|
5437
5721
|
let a = Math.max(...i), o = [];
|
|
5438
5722
|
return r.forEach((e) => {
|
|
@@ -5440,43 +5724,43 @@ function au(e = [], t = {}) {
|
|
|
5440
5724
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5441
5725
|
}), o;
|
|
5442
5726
|
}
|
|
5443
|
-
function
|
|
5444
|
-
let n =
|
|
5727
|
+
function Uu(e, t = {}) {
|
|
5728
|
+
let n = Hu(e, t);
|
|
5445
5729
|
if (!n.length) return "";
|
|
5446
|
-
let r = n.map((e) =>
|
|
5730
|
+
let r = n.map((e) => Vu(e, t)).join(", ");
|
|
5447
5731
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5448
5732
|
}
|
|
5449
|
-
async function
|
|
5733
|
+
async function Wu({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5450
5734
|
let a = e?.orderBy;
|
|
5451
5735
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5452
|
-
let o =
|
|
5736
|
+
let o = Iu(t, n, a);
|
|
5453
5737
|
if (!o) return !1;
|
|
5454
5738
|
let s = {
|
|
5455
|
-
...
|
|
5739
|
+
...Lu,
|
|
5456
5740
|
...a.messages ?? {}
|
|
5457
5741
|
};
|
|
5458
5742
|
return await i({
|
|
5459
5743
|
reason: o.reason,
|
|
5460
5744
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5461
|
-
body:
|
|
5745
|
+
body: Ru(o.reason, a),
|
|
5462
5746
|
okText: s.ok,
|
|
5463
5747
|
cancelText: s.keep,
|
|
5464
5748
|
from: o.from,
|
|
5465
5749
|
to: o.to
|
|
5466
5750
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5467
5751
|
}
|
|
5468
|
-
function
|
|
5469
|
-
let n =
|
|
5752
|
+
function Gu(e, t) {
|
|
5753
|
+
let n = Eu(e, t), r = n?.orderBy?.inProgressField;
|
|
5470
5754
|
return r ? {
|
|
5471
5755
|
name: n.name,
|
|
5472
5756
|
label: n.label ?? n.name,
|
|
5473
5757
|
rowsKey: n.payloadKey || n.name,
|
|
5474
5758
|
inProgressField: r,
|
|
5475
|
-
severity:
|
|
5476
|
-
message:
|
|
5759
|
+
severity: ku(n),
|
|
5760
|
+
message: Ou(n)
|
|
5477
5761
|
} : null;
|
|
5478
5762
|
}
|
|
5479
|
-
function
|
|
5763
|
+
function Ku(e = [], t, n) {
|
|
5480
5764
|
if (!n) return {
|
|
5481
5765
|
severity: "allow",
|
|
5482
5766
|
message: "",
|
|
@@ -5484,8 +5768,8 @@ function lu(e = [], t, n) {
|
|
|
5484
5768
|
};
|
|
5485
5769
|
let r = null;
|
|
5486
5770
|
for (let i of e) {
|
|
5487
|
-
let e =
|
|
5488
|
-
if (!(!e || e.severity === "allow") &&
|
|
5771
|
+
let e = Gu(i, t);
|
|
5772
|
+
if (!(!e || e.severity === "allow") && qu(n, e.rowsKey).some((t) => Pu(t, e))) {
|
|
5489
5773
|
if (e.severity === "block") return {
|
|
5490
5774
|
severity: "block",
|
|
5491
5775
|
message: e.message,
|
|
@@ -5504,23 +5788,23 @@ function lu(e = [], t, n) {
|
|
|
5504
5788
|
group: null
|
|
5505
5789
|
};
|
|
5506
5790
|
}
|
|
5507
|
-
function
|
|
5791
|
+
function qu(e, t) {
|
|
5508
5792
|
let n = e?.[t];
|
|
5509
5793
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5510
5794
|
}
|
|
5511
|
-
function
|
|
5795
|
+
function Ju(e) {
|
|
5512
5796
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5513
5797
|
}
|
|
5514
|
-
function
|
|
5798
|
+
function Yu(e = [], t = {}) {
|
|
5515
5799
|
let n = null;
|
|
5516
5800
|
for (let r of e) {
|
|
5517
5801
|
let e = r?.levelRule;
|
|
5518
5802
|
if (!e) continue;
|
|
5519
|
-
let i =
|
|
5803
|
+
let i = Xu(t, r);
|
|
5520
5804
|
if (!i.length) continue;
|
|
5521
|
-
let a =
|
|
5805
|
+
let a = Uu(i, e);
|
|
5522
5806
|
if (a) {
|
|
5523
|
-
if (
|
|
5807
|
+
if (Ju(e) === "block") return {
|
|
5524
5808
|
severity: "block",
|
|
5525
5809
|
message: a,
|
|
5526
5810
|
group: r
|
|
@@ -5538,7 +5822,7 @@ function fu(e = [], t = {}) {
|
|
|
5538
5822
|
group: null
|
|
5539
5823
|
};
|
|
5540
5824
|
}
|
|
5541
|
-
function
|
|
5825
|
+
function Xu(e, t) {
|
|
5542
5826
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5543
5827
|
if (!n) continue;
|
|
5544
5828
|
let t = e?.[n];
|
|
@@ -5548,10 +5832,10 @@ function pu(e, t) {
|
|
|
5548
5832
|
}
|
|
5549
5833
|
//#endregion
|
|
5550
5834
|
//#region src/components/form/clearGroupOnChange.js
|
|
5551
|
-
function
|
|
5835
|
+
function Zu(e, t) {
|
|
5552
5836
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5553
5837
|
}
|
|
5554
|
-
function
|
|
5838
|
+
function Qu(e, t) {
|
|
5555
5839
|
let n = e?.field, r = [];
|
|
5556
5840
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5557
5841
|
e && e !== n && r.push(e);
|
|
@@ -5561,24 +5845,24 @@ function hu(e, t) {
|
|
|
5561
5845
|
e && e !== n && r.push(e);
|
|
5562
5846
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5563
5847
|
}
|
|
5564
|
-
function
|
|
5565
|
-
let i =
|
|
5848
|
+
function $u(e, t, n, r) {
|
|
5849
|
+
let i = Qu(t, r).map((e) => Zu(n, e));
|
|
5566
5850
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5567
5851
|
}
|
|
5568
5852
|
//#endregion
|
|
5569
5853
|
//#region src/components/form/resolveStoredOptions.js
|
|
5570
|
-
function
|
|
5854
|
+
function ed(e) {
|
|
5571
5855
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5572
5856
|
}
|
|
5573
|
-
function
|
|
5857
|
+
function td(e, t = []) {
|
|
5574
5858
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5575
|
-
for (let t of
|
|
5859
|
+
for (let t of ed(e)) {
|
|
5576
5860
|
let e = String(t);
|
|
5577
5861
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5578
5862
|
}
|
|
5579
5863
|
return r;
|
|
5580
5864
|
}
|
|
5581
|
-
async function
|
|
5865
|
+
async function nd(e, t) {
|
|
5582
5866
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5583
5867
|
let n = new URLSearchParams({
|
|
5584
5868
|
collection: e.lookupCollection,
|
|
@@ -5590,7 +5874,7 @@ async function yu(e, t) {
|
|
|
5590
5874
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5591
5875
|
return Array.isArray(i) ? i : [];
|
|
5592
5876
|
}
|
|
5593
|
-
function
|
|
5877
|
+
function rd(e = [], t = []) {
|
|
5594
5878
|
if (!t.length) return e;
|
|
5595
5879
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5596
5880
|
...e,
|
|
@@ -5600,25 +5884,25 @@ function bu(e = [], t = []) {
|
|
|
5600
5884
|
}
|
|
5601
5885
|
//#endregion
|
|
5602
5886
|
//#region src/components/form/requireAnyOf.js
|
|
5603
|
-
var
|
|
5604
|
-
function
|
|
5887
|
+
var id = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5888
|
+
function ad(e) {
|
|
5605
5889
|
let t = e?.requireAnyOf;
|
|
5606
5890
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5607
5891
|
}
|
|
5608
|
-
function
|
|
5609
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5892
|
+
function od(e) {
|
|
5893
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !id(e));
|
|
5610
5894
|
}
|
|
5611
|
-
function
|
|
5612
|
-
let n =
|
|
5895
|
+
function sd({ field: e, getRow: t }) {
|
|
5896
|
+
let n = ad(e);
|
|
5613
5897
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5614
5898
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5615
5899
|
return { validator: async () => {
|
|
5616
5900
|
let e = t?.() ?? {};
|
|
5617
|
-
return
|
|
5901
|
+
return od(e) ? n.some((t) => !id(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5618
5902
|
} };
|
|
5619
5903
|
}
|
|
5620
|
-
function
|
|
5621
|
-
let n =
|
|
5904
|
+
function cd(e, t = []) {
|
|
5905
|
+
let n = ad(e);
|
|
5622
5906
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5623
5907
|
...t,
|
|
5624
5908
|
requireAnyOf: n,
|
|
@@ -5627,8 +5911,8 @@ function Tu(e, t = []) {
|
|
|
5627
5911
|
}
|
|
5628
5912
|
//#endregion
|
|
5629
5913
|
//#region src/components/form/dateRules.js
|
|
5630
|
-
var
|
|
5631
|
-
function
|
|
5914
|
+
var ld = (e) => e == null || e === "";
|
|
5915
|
+
function ud(e) {
|
|
5632
5916
|
if (!e) return null;
|
|
5633
5917
|
if (typeof e.valueOf == "function") {
|
|
5634
5918
|
let t = e.valueOf();
|
|
@@ -5642,12 +5926,12 @@ function $(e) {
|
|
|
5642
5926
|
let t = E(e);
|
|
5643
5927
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5644
5928
|
}
|
|
5645
|
-
function
|
|
5929
|
+
function dd(e) {
|
|
5646
5930
|
if (!e) return null;
|
|
5647
5931
|
let t = E(e);
|
|
5648
5932
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5649
5933
|
}
|
|
5650
|
-
var
|
|
5934
|
+
var fd = {
|
|
5651
5935
|
d: "day",
|
|
5652
5936
|
day: "day",
|
|
5653
5937
|
days: "day",
|
|
@@ -5663,13 +5947,13 @@ var ku = {
|
|
|
5663
5947
|
year: "year",
|
|
5664
5948
|
years: "year"
|
|
5665
5949
|
};
|
|
5666
|
-
function
|
|
5950
|
+
function pd(e) {
|
|
5667
5951
|
if (e == null || e === "") return null;
|
|
5668
5952
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5669
5953
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5670
5954
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5671
5955
|
value: t,
|
|
5672
|
-
unit:
|
|
5956
|
+
unit: fd[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5673
5957
|
};
|
|
5674
5958
|
}
|
|
5675
5959
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5679,49 +5963,49 @@ function Au(e) {
|
|
|
5679
5963
|
let r = Number(n[1]);
|
|
5680
5964
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5681
5965
|
value: r,
|
|
5682
|
-
unit:
|
|
5966
|
+
unit: fd[n[2]] ?? "month"
|
|
5683
5967
|
};
|
|
5684
5968
|
}
|
|
5685
|
-
function
|
|
5969
|
+
function md(e, t) {
|
|
5686
5970
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5687
5971
|
if (n && typeof t == "function") {
|
|
5688
|
-
let e =
|
|
5972
|
+
let e = pd(t(n));
|
|
5689
5973
|
if (e) return e;
|
|
5690
5974
|
}
|
|
5691
|
-
return
|
|
5975
|
+
return pd(e?.minGap);
|
|
5692
5976
|
}
|
|
5693
|
-
function
|
|
5977
|
+
function hd(e, t, n, r) {
|
|
5694
5978
|
if (t === null) return null;
|
|
5695
|
-
let i =
|
|
5979
|
+
let i = md(n, r), a = E(t);
|
|
5696
5980
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5697
5981
|
}
|
|
5698
|
-
function
|
|
5982
|
+
function gd(e, t, n, r, i) {
|
|
5699
5983
|
if (t === null || n === null) return !1;
|
|
5700
|
-
let a =
|
|
5984
|
+
let a = hd(e, n, r, i);
|
|
5701
5985
|
if (a === null) return !1;
|
|
5702
|
-
let o = !!r?.strict && !
|
|
5986
|
+
let o = !!r?.strict && !md(r, i);
|
|
5703
5987
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5704
5988
|
}
|
|
5705
|
-
function
|
|
5989
|
+
function _d(e, t, n, r) {
|
|
5706
5990
|
if (n?.message) return n.message;
|
|
5707
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5991
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = md(n, r);
|
|
5708
5992
|
if (a) {
|
|
5709
5993
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5710
5994
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5711
5995
|
}
|
|
5712
5996
|
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}`;
|
|
5713
5997
|
}
|
|
5714
|
-
function
|
|
5998
|
+
function vd({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5715
5999
|
return { validator: async (i, a) => {
|
|
5716
6000
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5717
|
-
if (!o ||
|
|
6001
|
+
if (!o || ld(a)) return Promise.resolve();
|
|
5718
6002
|
let s = r(o);
|
|
5719
|
-
if (
|
|
6003
|
+
if (ld(s)) return Promise.resolve();
|
|
5720
6004
|
let c = $(a), l = $(s);
|
|
5721
|
-
return c === null || l === null ? Promise.resolve() :
|
|
6005
|
+
return c === null || l === null ? Promise.resolve() : gd(e, c, l, n, r) ? Promise.reject(Error(_d(e, t, n, r))) : Promise.resolve();
|
|
5722
6006
|
} };
|
|
5723
6007
|
}
|
|
5724
|
-
function
|
|
6008
|
+
function yd(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5725
6009
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5726
6010
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5727
6011
|
if (o) {
|
|
@@ -5735,11 +6019,11 @@ function Iu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5735
6019
|
}
|
|
5736
6020
|
return !1;
|
|
5737
6021
|
}
|
|
5738
|
-
function
|
|
6022
|
+
function bd(e, t = "above", n = void 0) {
|
|
5739
6023
|
let r = e?.messages ?? {}, i = t === "below";
|
|
5740
6024
|
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.");
|
|
5741
6025
|
}
|
|
5742
|
-
function
|
|
6026
|
+
function xd({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
5743
6027
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5744
6028
|
for (let e of a) {
|
|
5745
6029
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5753,17 +6037,17 @@ function Ru({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
|
5753
6037
|
o.push((i) => {
|
|
5754
6038
|
if (!i) return !1;
|
|
5755
6039
|
let a = t(e);
|
|
5756
|
-
return !
|
|
6040
|
+
return !ld(a) && gd(r, $(i), $(a), n, t);
|
|
5757
6041
|
});
|
|
5758
6042
|
}
|
|
5759
6043
|
}
|
|
5760
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
6044
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? yd($(t), e.rowHierarchy, {
|
|
5761
6045
|
rows: n,
|
|
5762
6046
|
rowIndex: r
|
|
5763
6047
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5764
6048
|
}
|
|
5765
|
-
function
|
|
5766
|
-
if (!
|
|
6049
|
+
function Sd(e, t = or, n = void 0, r = void 0) {
|
|
6050
|
+
if (!ld(n) && $(n) !== null) return;
|
|
5767
6051
|
let i, a = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5768
6052
|
for (let e of a) {
|
|
5769
6053
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5777,10 +6061,10 @@ function zu(e, t = or, n = void 0, r = void 0) {
|
|
|
5777
6061
|
}
|
|
5778
6062
|
}
|
|
5779
6063
|
if (typeof r != "function") return i;
|
|
5780
|
-
let o = E(i ?? t()), s =
|
|
6064
|
+
let o = E(i ?? t()), s = Cd(o, r);
|
|
5781
6065
|
return !s || s.isSame(o, "month") ? i : s;
|
|
5782
6066
|
}
|
|
5783
|
-
function
|
|
6067
|
+
function Cd(e, t, n = 240) {
|
|
5784
6068
|
let r = E(e).startOf("day");
|
|
5785
6069
|
if (!r.isValid() || typeof t != "function") return null;
|
|
5786
6070
|
let i = (e) => {
|
|
@@ -5808,7 +6092,7 @@ function Bu(e, t, n = 240) {
|
|
|
5808
6092
|
}
|
|
5809
6093
|
return null;
|
|
5810
6094
|
}
|
|
5811
|
-
function
|
|
6095
|
+
function wd({ field: e, name: t, rows: n }) {
|
|
5812
6096
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5813
6097
|
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 ?? [];
|
|
5814
6098
|
for (let e of o) {
|
|
@@ -5837,44 +6121,44 @@ function Vu({ field: e, name: t, rows: n }) {
|
|
|
5837
6121
|
]));
|
|
5838
6122
|
return u;
|
|
5839
6123
|
}
|
|
5840
|
-
function
|
|
6124
|
+
function Td({ field: e, rows: t, rowIndex: n }) {
|
|
5841
6125
|
let r = e?.rowHierarchy;
|
|
5842
6126
|
return { validator: async (i, a) => {
|
|
5843
|
-
if (!r ||
|
|
6127
|
+
if (!r || ld(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5844
6128
|
let o = $(a);
|
|
5845
|
-
if (o === null || !
|
|
6129
|
+
if (o === null || !yd(o, r, {
|
|
5846
6130
|
rows: t,
|
|
5847
6131
|
rowIndex: n
|
|
5848
6132
|
})) return Promise.resolve();
|
|
5849
6133
|
let s = r.startField ?? "startDate", c = t[n - 1], l = c ? $(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;
|
|
5850
|
-
return Promise.reject(Error(
|
|
6134
|
+
return Promise.reject(Error(bd(r, u, p)));
|
|
5851
6135
|
} };
|
|
5852
6136
|
}
|
|
5853
6137
|
//#endregion
|
|
5854
6138
|
//#region src/utils/submitMessages.js
|
|
5855
|
-
function
|
|
6139
|
+
function Ed(e) {
|
|
5856
6140
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5857
6141
|
}
|
|
5858
|
-
function
|
|
6142
|
+
function Dd(e) {
|
|
5859
6143
|
let t = String(e ?? "").trim();
|
|
5860
6144
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5861
6145
|
}
|
|
5862
|
-
function
|
|
5863
|
-
return String(e).replaceAll("${module}",
|
|
6146
|
+
function Od(e, t) {
|
|
6147
|
+
return String(e).replaceAll("${module}", Dd(t)).replaceAll("${moduleName}", Dd(t));
|
|
5864
6148
|
}
|
|
5865
|
-
function
|
|
5866
|
-
let r =
|
|
6149
|
+
function kd(e, t, n) {
|
|
6150
|
+
let r = Ed(e);
|
|
5867
6151
|
if (r?.suppress) return null;
|
|
5868
6152
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5869
|
-
return i && String(i).trim() ?
|
|
6153
|
+
return i && String(i).trim() ? Od(i, t) : n === "edit" ? `${Dd(t)} has Updated successfully` : `${Dd(t)} has added successfully`;
|
|
5870
6154
|
}
|
|
5871
|
-
function
|
|
5872
|
-
let i =
|
|
5873
|
-
return a && String(a).trim() ?
|
|
6155
|
+
function Ad(e, t, n, r) {
|
|
6156
|
+
let i = Ed(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
6157
|
+
return a && String(a).trim() ? Od(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${Dd(t)}` : `Failed to create ${Dd(t)}`;
|
|
5874
6158
|
}
|
|
5875
6159
|
//#endregion
|
|
5876
6160
|
//#region src/utils/scrollToFirstFormError.js
|
|
5877
|
-
function
|
|
6161
|
+
function jd({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5878
6162
|
if (!e?.length) return;
|
|
5879
6163
|
let r = e[0]?.name;
|
|
5880
6164
|
setTimeout(() => {
|
|
@@ -5899,10 +6183,10 @@ function Ju({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5899
6183
|
}
|
|
5900
6184
|
//#endregion
|
|
5901
6185
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5902
|
-
function
|
|
6186
|
+
function Md(e) {
|
|
5903
6187
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5904
6188
|
}
|
|
5905
|
-
function
|
|
6189
|
+
function Nd(e, t) {
|
|
5906
6190
|
if (!e?.field) return !1;
|
|
5907
6191
|
switch (e.operator ?? "eq") {
|
|
5908
6192
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5910,103 +6194,103 @@ function Xu(e, t) {
|
|
|
5910
6194
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5911
6195
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5912
6196
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5913
|
-
case "in": return
|
|
5914
|
-
case "notIn": return !
|
|
6197
|
+
case "in": return Md(e.value).includes(String(t ?? ""));
|
|
6198
|
+
case "notIn": return !Md(e.value).includes(String(t ?? ""));
|
|
5915
6199
|
default: return !1;
|
|
5916
6200
|
}
|
|
5917
6201
|
}
|
|
5918
|
-
function
|
|
6202
|
+
function Pd(e, t, n = !1) {
|
|
5919
6203
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5920
|
-
return
|
|
6204
|
+
return Nd(i, t) && i?.label ? i.label : r;
|
|
5921
6205
|
}
|
|
5922
|
-
function
|
|
6206
|
+
function Fd(e) {
|
|
5923
6207
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5924
6208
|
}
|
|
5925
|
-
function
|
|
5926
|
-
let n =
|
|
6209
|
+
function Id(e, t) {
|
|
6210
|
+
let n = Fd(e);
|
|
5927
6211
|
if (!n.length) return !0;
|
|
5928
|
-
let r = n.map((e) =>
|
|
6212
|
+
let r = n.map((e) => Nd(e, t(e.field)));
|
|
5929
6213
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5930
6214
|
}
|
|
5931
|
-
function
|
|
6215
|
+
function Ld(e) {
|
|
5932
6216
|
let t = e?.colWhen;
|
|
5933
6217
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5934
6218
|
}
|
|
5935
|
-
function
|
|
5936
|
-
for (let t of
|
|
6219
|
+
function Rd(e, t, n) {
|
|
6220
|
+
for (let t of Ld(e)) if (Nd(t, n(t))) return Number(t.col);
|
|
5937
6221
|
return t;
|
|
5938
6222
|
}
|
|
5939
|
-
function
|
|
6223
|
+
function zd(e, t) {
|
|
5940
6224
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5941
6225
|
}
|
|
5942
6226
|
//#endregion
|
|
5943
6227
|
//#region src/components/form/conditionalRequired.js
|
|
5944
|
-
function
|
|
6228
|
+
function Bd(e, t) {
|
|
5945
6229
|
return (n) => {
|
|
5946
6230
|
if (!e || !n) return;
|
|
5947
6231
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5948
6232
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5949
6233
|
};
|
|
5950
6234
|
}
|
|
5951
|
-
function
|
|
6235
|
+
function Vd(e, t, n) {
|
|
5952
6236
|
let r = e?.requiredWhen;
|
|
5953
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
6237
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Id(r, Bd(t, n));
|
|
5954
6238
|
}
|
|
5955
|
-
function
|
|
6239
|
+
function Hd(e, t, n) {
|
|
5956
6240
|
return { validator: (r, i) => {
|
|
5957
|
-
if (!
|
|
6241
|
+
if (!Vd(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5958
6242
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5959
6243
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5960
6244
|
} };
|
|
5961
6245
|
}
|
|
5962
6246
|
//#endregion
|
|
5963
6247
|
//#region src/components/Breadcrumb.jsx
|
|
5964
|
-
function
|
|
6248
|
+
function Ud({ items: e = [] }) {
|
|
5965
6249
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(Mr, {
|
|
5966
6250
|
variant: "body",
|
|
5967
6251
|
weight: "medium",
|
|
5968
6252
|
color: "link",
|
|
5969
6253
|
children: t.label
|
|
5970
|
-
}) : /* @__PURE__ */ T(
|
|
6254
|
+
}) : /* @__PURE__ */ T(xe, {
|
|
5971
6255
|
to: t.href,
|
|
5972
6256
|
children: [/* @__PURE__ */ w(Mr, {
|
|
5973
6257
|
variant: "body",
|
|
5974
6258
|
color: "secondary",
|
|
5975
6259
|
children: t.label
|
|
5976
|
-
}), t.dropdown && /* @__PURE__ */ w(
|
|
6260
|
+
}), t.dropdown && /* @__PURE__ */ w(ce, {})]
|
|
5977
6261
|
}) }));
|
|
5978
|
-
return /* @__PURE__ */ w(
|
|
6262
|
+
return /* @__PURE__ */ w(ee, { items: t });
|
|
5979
6263
|
}
|
|
5980
6264
|
//#endregion
|
|
5981
6265
|
//#region src/components/form/canonicalOption.js
|
|
5982
|
-
var
|
|
5983
|
-
function
|
|
6266
|
+
var Wd = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
6267
|
+
function Gd(e = []) {
|
|
5984
6268
|
let t = /* @__PURE__ */ new Map();
|
|
5985
6269
|
for (let n of e) {
|
|
5986
6270
|
if (n == null) continue;
|
|
5987
6271
|
let e = typeof n == "object" ? n.value : n;
|
|
5988
6272
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5989
|
-
let n =
|
|
6273
|
+
let n = Wd(r);
|
|
5990
6274
|
n && !t.has(n) && t.set(n, e);
|
|
5991
6275
|
}
|
|
5992
6276
|
}
|
|
5993
6277
|
return t;
|
|
5994
6278
|
}
|
|
5995
|
-
function
|
|
6279
|
+
function Kd(e, t) {
|
|
5996
6280
|
if (!Array.isArray(e)) {
|
|
5997
|
-
let n =
|
|
6281
|
+
let n = Kd([e], t);
|
|
5998
6282
|
return n.length ? n[0] : e;
|
|
5999
6283
|
}
|
|
6000
|
-
let n =
|
|
6284
|
+
let n = Gd(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
6001
6285
|
for (let t of e) {
|
|
6002
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
6286
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Wd(e)) ?? e, o = Wd(a);
|
|
6003
6287
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
6004
6288
|
}
|
|
6005
6289
|
return i;
|
|
6006
6290
|
}
|
|
6007
6291
|
//#endregion
|
|
6008
6292
|
//#region src/components/form/dependencyBusy.js
|
|
6009
|
-
function
|
|
6293
|
+
function qd(e, t = []) {
|
|
6010
6294
|
if (!e) return [];
|
|
6011
6295
|
let n = /* @__PURE__ */ new Set();
|
|
6012
6296
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -6016,16 +6300,16 @@ function ud(e, t = []) {
|
|
|
6016
6300
|
}
|
|
6017
6301
|
return n.delete(e), [...n];
|
|
6018
6302
|
}
|
|
6019
|
-
function
|
|
6020
|
-
return e?.blockWhileResolving ?
|
|
6303
|
+
function Jd(e, t = []) {
|
|
6304
|
+
return e?.blockWhileResolving ? qd(e.field, t).length > 0 : !1;
|
|
6021
6305
|
}
|
|
6022
|
-
function
|
|
6306
|
+
function Yd(e) {
|
|
6023
6307
|
let t = String(e?.label ?? "").trim();
|
|
6024
6308
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
6025
6309
|
}
|
|
6026
|
-
function
|
|
6310
|
+
function Xd(e, t = []) {
|
|
6027
6311
|
if (!e?.field) return [];
|
|
6028
|
-
let n = new Set(
|
|
6312
|
+
let n = new Set(qd(e.field, t));
|
|
6029
6313
|
if (n.size === 0) return [];
|
|
6030
6314
|
let r = [];
|
|
6031
6315
|
for (let e of t) {
|
|
@@ -6034,19 +6318,19 @@ function pd(e, t = []) {
|
|
|
6034
6318
|
}
|
|
6035
6319
|
return r;
|
|
6036
6320
|
}
|
|
6037
|
-
function
|
|
6321
|
+
function Zd(e) {
|
|
6038
6322
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
6039
6323
|
}
|
|
6040
6324
|
//#endregion
|
|
6041
6325
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
6042
|
-
var
|
|
6043
|
-
function
|
|
6326
|
+
var Qd = f(() => import("./index.js").then((e) => e.n)), $d = f(() => import("./DocumentViewer-DcgKxqov.js").then((e) => e.n));
|
|
6327
|
+
function ef(e) {
|
|
6044
6328
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
6045
|
-
return w(t === "pdf" ?
|
|
6329
|
+
return w(t === "pdf" ? pe : t === "doc" || t === "docx" ? he : fe, { className: "v1-file-chip__icon" });
|
|
6046
6330
|
}
|
|
6047
|
-
function
|
|
6331
|
+
function tf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
6048
6332
|
let r = e?.linkedModule, i = e?.linkedFileField, a = g(() => {
|
|
6049
|
-
let n =
|
|
6333
|
+
let n = Uc(r, t);
|
|
6050
6334
|
if (n) return n;
|
|
6051
6335
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
6052
6336
|
return a ? String(a) : "";
|
|
@@ -6080,7 +6364,7 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6080
6364
|
i,
|
|
6081
6365
|
p
|
|
6082
6366
|
]);
|
|
6083
|
-
let _ = g(() =>
|
|
6367
|
+
let _ = g(() => Io(o.fileValue), [o.fileValue])[0], y = !!_, ee = e?.label ?? "File", x = rc(r) || "record";
|
|
6084
6368
|
if (!a) return /* @__PURE__ */ w("div", {
|
|
6085
6369
|
className: "v1-linked-file v1-linked-file--empty",
|
|
6086
6370
|
children: /* @__PURE__ */ w("span", { children: e?.unlinkedText ?? `Not available until the ${x} is set.` })
|
|
@@ -6097,7 +6381,7 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6097
6381
|
refId: a,
|
|
6098
6382
|
fieldName: i
|
|
6099
6383
|
} : void 0
|
|
6100
|
-
} : null,
|
|
6384
|
+
} : null, S = () => f(!1), re = e?.emptyText ?? `No ${ee.toLowerCase()} on file yet`, ae = e?.reuploadLabel ?? `${y ? "Reupload" : "Upload"} in ${x}`, oe = e?.reuploadWarning ?? `The ${ee.toLowerCase()} belongs to the ${x.toLowerCase()}, not to this record. Changing it here updates the ${x.toLowerCase()} everywhere it is used.`;
|
|
6101
6385
|
return /* @__PURE__ */ T(C, { children: [
|
|
6102
6386
|
/* @__PURE__ */ T("div", {
|
|
6103
6387
|
className: `v1-linked-file-row ${y ? "" : "v1-linked-file--empty"}`,
|
|
@@ -6106,14 +6390,14 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6106
6390
|
className: "v1-linked-file v1-file-chip",
|
|
6107
6391
|
disabled: !y,
|
|
6108
6392
|
onClick: () => y && l(!0),
|
|
6109
|
-
title: y ? `Preview or download ${_.name}` :
|
|
6393
|
+
title: y ? `Preview or download ${_.name}` : re,
|
|
6110
6394
|
children: [
|
|
6111
|
-
y ?
|
|
6395
|
+
y ? ef(_.name) : /* @__PURE__ */ w(fe, { className: "v1-file-chip__icon" }),
|
|
6112
6396
|
/* @__PURE__ */ w("span", {
|
|
6113
6397
|
className: "v1-file-chip__name",
|
|
6114
|
-
children: y ? _.name :
|
|
6398
|
+
children: y ? _.name : re
|
|
6115
6399
|
}),
|
|
6116
|
-
y && /* @__PURE__ */ w(
|
|
6400
|
+
y && /* @__PURE__ */ w(de, {
|
|
6117
6401
|
className: "v1-file-chip__action",
|
|
6118
6402
|
"aria-hidden": "true"
|
|
6119
6403
|
})
|
|
@@ -6122,17 +6406,17 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6122
6406
|
type: "button",
|
|
6123
6407
|
className: "v1-linked-file__edit-btn",
|
|
6124
6408
|
onClick: () => f(!0),
|
|
6125
|
-
title:
|
|
6409
|
+
title: oe,
|
|
6126
6410
|
children: [
|
|
6127
|
-
/* @__PURE__ */ w(
|
|
6411
|
+
/* @__PURE__ */ w(le, {}),
|
|
6128
6412
|
" ",
|
|
6129
|
-
|
|
6413
|
+
ae
|
|
6130
6414
|
]
|
|
6131
6415
|
})]
|
|
6132
6416
|
}),
|
|
6133
6417
|
c && te && /* @__PURE__ */ w(u, {
|
|
6134
6418
|
fallback: null,
|
|
6135
|
-
children: /* @__PURE__ */ w(
|
|
6419
|
+
children: /* @__PURE__ */ w($d, {
|
|
6136
6420
|
open: c,
|
|
6137
6421
|
onClose: () => l(!1),
|
|
6138
6422
|
documents: [te]
|
|
@@ -6140,20 +6424,20 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6140
6424
|
}),
|
|
6141
6425
|
d && /* @__PURE__ */ T(ne, {
|
|
6142
6426
|
open: !0,
|
|
6143
|
-
title:
|
|
6427
|
+
title: ae,
|
|
6144
6428
|
width: "min(1080px, 96vw)",
|
|
6145
6429
|
footer: null,
|
|
6146
6430
|
destroyOnClose: !0,
|
|
6147
6431
|
maskClosable: !1,
|
|
6148
|
-
onCancel:
|
|
6432
|
+
onCancel: S,
|
|
6149
6433
|
styles: { body: {
|
|
6150
6434
|
maxHeight: "78vh",
|
|
6151
6435
|
overflowY: "auto"
|
|
6152
6436
|
} },
|
|
6153
|
-
children: [/* @__PURE__ */ w(
|
|
6437
|
+
children: [/* @__PURE__ */ w(b, {
|
|
6154
6438
|
type: "warning",
|
|
6155
6439
|
showIcon: !0,
|
|
6156
|
-
message:
|
|
6440
|
+
message: oe,
|
|
6157
6441
|
style: { marginBottom: 16 }
|
|
6158
6442
|
}), /* @__PURE__ */ w(u, {
|
|
6159
6443
|
fallback: /* @__PURE__ */ w("div", {
|
|
@@ -6163,21 +6447,21 @@ function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6163
6447
|
},
|
|
6164
6448
|
children: /* @__PURE__ */ w(ie, {})
|
|
6165
6449
|
}),
|
|
6166
|
-
children: /* @__PURE__ */ w(
|
|
6450
|
+
children: /* @__PURE__ */ w(Qd, {
|
|
6167
6451
|
moduleName: r,
|
|
6168
6452
|
recordId: a,
|
|
6169
6453
|
embedded: !0,
|
|
6170
6454
|
breadcrumbItems: [],
|
|
6171
|
-
onCancel:
|
|
6455
|
+
onCancel: S,
|
|
6172
6456
|
onSuccess: () => {
|
|
6173
|
-
|
|
6457
|
+
S(), m((e) => e + 1), n?.(a);
|
|
6174
6458
|
}
|
|
6175
6459
|
})
|
|
6176
6460
|
})]
|
|
6177
6461
|
})
|
|
6178
6462
|
] });
|
|
6179
6463
|
}
|
|
6180
|
-
|
|
6464
|
+
tf.propTypes = {
|
|
6181
6465
|
field: D.shape({
|
|
6182
6466
|
label: D.string,
|
|
6183
6467
|
linkedModule: D.string,
|
|
@@ -6190,11 +6474,11 @@ vd.propTypes = {
|
|
|
6190
6474
|
}).isRequired,
|
|
6191
6475
|
recordMeta: D.object,
|
|
6192
6476
|
onLinkedRecordUpdated: D.func
|
|
6193
|
-
},
|
|
6477
|
+
}, tf.defaultProps = {
|
|
6194
6478
|
recordMeta: void 0,
|
|
6195
6479
|
onLinkedRecordUpdated: void 0
|
|
6196
6480
|
};
|
|
6197
6481
|
//#endregion
|
|
6198
|
-
export {
|
|
6482
|
+
export { au as $, Be as $i, di as $n, mn as $r, Rs as $t, nd as A, Re as Ai, H as An, F as Ar, jc as At, Yu as B, It as Bi, Xi as Bn, Et as Br, ac as Bt, Sd as C, bt as Ci, ao as Cn, sr as Cr, Bc as Ct, wd as D, hn as Di, no as Dn, Qn as Dr, Fc as Dt, ld as E, tn as Ei, Xa as En, Wn as Er, Ic as Et, Gu as F, N as Fi, Ia as Fn, Bn as Fr, dc as Ft, xu as G, nt as Gi, Ti as Gn, In as Gr, Vs as Gt, Eu as H, ze as Hi, Li as Hn, Tn as Hr, $s as Ht, Du as I, Pt as Ii, fa as In, Hn as Ir, lc as It, fu as J, ot as Ji, xi as Jn, tt as Jr, Ws as Jt, gu as K, pt as Ki, Ei as Kn, Zt as Kr, Hs as Kt, Au as L, Ft as Li, ma as Ln, Vn as Lr, sc as Lt, td as M, an as Mi, Ua as Mn, qn as Mr, wc as Mt, $u as N, Qe as Ni, to as Nn, Xn as Nr, xc as Nt, cd as O, dn as Oi, Ya as On, Zn as Or, Pc as Ot, Mu as P, Ht as Pi, La as Pn, zn as Pr, Sc as Pt, ou as Q, on as Qi, fi as Qn, vn as Qr, ks as Qt, Ou as R, xn as Ri, aa as Rn, Un as Rr, rc as Rt, Td as S, xt as Si, io as Sn, vr as Sr, Jc as St, dd as T, en as Ti, J as Tn, lr as Tr, Lc as Tt, wu as U, nn as Ui, Hi as Un, gn as Ur, Ks as Ut, Wu as V, Xt as Vi, Qi as Vn, $e as Vr, Xs as Vt, bu as W, rn as Wi, Vi as Wn, fn as Wr, Gs as Wt, du as X, St as Xi, bi as Xn, Dn as Xr, Ms as Xt, hu as Y, ut as Yi, Ci as Yn, mt as Yr, Ns as Yt, lu as Z, He as Zi, vi as Zn, Ct as Zr, Cs as Zt, jd as _, ln as _i, Io as _n, L as _r, Uc as _t, Jd as a, En as aa, Yt as ai, fs as an, si as ar, Ul as at, xd as b, lt as bi, co as bn, dr as br, Gc as bt, Vd as c, Ln as ca, ft as ci, Jo as cn, ni as cr, gl as ct, zd as d, Sn as da, Gt as di, Y as dn, Wr as dr, al as dt, Ut as ea, Rn as ei, hs as en, yi as er, Yl as et, Nd as f, Mn as fa, un as fi, Ro as fn, Ur as fr, Qc as ft, Fd as g, sn as ga, yt as gi, Mo as gn, R as gr, Wc as gt, Rd as h, Jt as ha, _t as hi, So as hn, Mr as hr, Xc as ht, Yd as i, et as ia, st as ii, ps as in, ci as ir, ql as it, rd as j, We as ji, q as jn, nr as jr, Tc as jt, sd as k, Fn as ki, Ea as kn, er as kr, Nc as kt, Hd as l, Qt as la, Ot as li, qo as ln, Kr as lr, dl as lt, Id as m, Wt as ma, Ue as mi, bo as mn, Rr as mr, tl as mt, Zd as n, ht as na, Ve as ni, _s as nn, mi as nr, Gl as nt, Kd as o, _n as oa, Ze as oi, us as on, $r as or, pl as ot, Pd as p, Mt as pa, cn as pi, xo as pn, Hr as pr, $c as pt, yu as q, vt as qi, wi as qn, jn as qr, Us as qt, Xd as r, wt as ra, Nn as ri, ms as rn, li as rr, El as rt, Ud as s, pn as sa, Xe as si, ds as sn, ei as sr, _l as st, tf as t, Kt as ta, $t as ti, vs as tn, pi as tr, Il as tt, Ld as u, zt as ua, jt as ui, Vo as un, Gr as ur, ll as ut, Ad as v, wn as vi, ho as vn, or as vr, Kc as vt, ud as w, Tt as wi, oo as wn, hr as wr, Rc as wt, vd as x, qt as xi, lo as xn, I as xr, Yc as xt, kd as y, at as yi, yo as yn, cr as yr, qc as yt, Ku as z, An as zi, Ki as zn, rt as zr, ic as zt };
|
|
6199
6483
|
|
|
6200
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
6484
|
+
//# sourceMappingURL=LinkedRecordFileField-B5LSz3TG.js.map
|