@realtek/core-theme-live 0.0.378 → 0.0.380
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/{canonicalOption-RYxKIrID.cjs → dependencyBusy-BOOD_t7i.cjs} +3 -3
- package/dist-lib/dependencyBusy-BOOD_t7i.cjs.map +1 -0
- package/dist-lib/{canonicalOption-Cu4ql6EU.js → dependencyBusy-DxiLAocF.js} +688 -641
- package/dist-lib/dependencyBusy-DxiLAocF.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +13884 -13721
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/style.css +1 -1
- package/package.json +1 -1
- package/dist-lib/canonicalOption-Cu4ql6EU.js.map +0 -1
- package/dist-lib/canonicalOption-RYxKIrID.cjs.map +0 -1
|
@@ -2534,38 +2534,46 @@ async function Si(e, t, n = "") {
|
|
|
2534
2534
|
total: o?.total ?? 0
|
|
2535
2535
|
};
|
|
2536
2536
|
}
|
|
2537
|
+
async function Ci(e) {
|
|
2538
|
+
if (!e) return !1;
|
|
2539
|
+
try {
|
|
2540
|
+
return await a(s, `/documents/${encodeURIComponent(String(e))}`, { method: "DELETE" }), !0;
|
|
2541
|
+
} catch {
|
|
2542
|
+
return !1;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2537
2545
|
//#endregion
|
|
2538
2546
|
//#region src/services/detailedViewApi.js
|
|
2539
|
-
var
|
|
2547
|
+
var wi = {
|
|
2540
2548
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2541
2549
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2542
2550
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2543
2551
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2544
2552
|
};
|
|
2545
|
-
async function
|
|
2553
|
+
async function Ti(e, t) {
|
|
2546
2554
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2547
2555
|
if (n === "job" || n === "jobs") {
|
|
2548
2556
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2549
2557
|
return e(t);
|
|
2550
2558
|
}
|
|
2551
|
-
if (n === "candidate" || n === "candidates") return
|
|
2559
|
+
if (n === "candidate" || n === "candidates") return Di(n === "candidate" ? "candidate" : "candidates", t);
|
|
2552
2560
|
let r = new URLSearchParams({
|
|
2553
2561
|
module: String(e ?? ""),
|
|
2554
2562
|
id: String(t)
|
|
2555
2563
|
});
|
|
2556
2564
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2557
2565
|
}
|
|
2558
|
-
async function
|
|
2566
|
+
async function Ei(e) {
|
|
2559
2567
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2560
2568
|
return {
|
|
2561
2569
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2562
2570
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2563
2571
|
};
|
|
2564
2572
|
}
|
|
2565
|
-
async function
|
|
2573
|
+
async function Di(e, t) {
|
|
2566
2574
|
if (!e) throw Error("module is required");
|
|
2567
2575
|
if (!t) throw Error("id is required");
|
|
2568
|
-
let n =
|
|
2576
|
+
let n = wi[e];
|
|
2569
2577
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2570
2578
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2571
2579
|
method: "GET",
|
|
@@ -2578,7 +2586,7 @@ async function Ei(e, t) {
|
|
|
2578
2586
|
let o = await a.json();
|
|
2579
2587
|
return o.data ?? o;
|
|
2580
2588
|
}
|
|
2581
|
-
async function
|
|
2589
|
+
async function Oi(e, t, n, i = []) {
|
|
2582
2590
|
if (!e) throw Error("module is required");
|
|
2583
2591
|
if (!t) throw Error("id is required");
|
|
2584
2592
|
let a = await r(), o = new FormData();
|
|
@@ -2591,15 +2599,15 @@ async function Di(e, t, n, i = []) {
|
|
|
2591
2599
|
if (!c.ok) {
|
|
2592
2600
|
let e = await c.text();
|
|
2593
2601
|
console.error("[updateRecord] Error response:", e);
|
|
2594
|
-
let t = Error(
|
|
2595
|
-
throw t.status = c.status, t.response =
|
|
2602
|
+
let t = Error(Ai(e) || `API ${c.status}: ${c.statusText}`);
|
|
2603
|
+
throw t.status = c.status, t.response = ki(e), t;
|
|
2596
2604
|
}
|
|
2597
2605
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2598
2606
|
l();
|
|
2599
2607
|
let u = await c.json();
|
|
2600
2608
|
return u.data ?? u;
|
|
2601
2609
|
}
|
|
2602
|
-
function
|
|
2610
|
+
function ki(e) {
|
|
2603
2611
|
let t = String(e ?? "").trim();
|
|
2604
2612
|
if (!t.startsWith("{")) return null;
|
|
2605
2613
|
try {
|
|
@@ -2608,7 +2616,7 @@ function Oi(e) {
|
|
|
2608
2616
|
return null;
|
|
2609
2617
|
}
|
|
2610
2618
|
}
|
|
2611
|
-
function
|
|
2619
|
+
function Ai(e) {
|
|
2612
2620
|
let t = String(e ?? "").trim();
|
|
2613
2621
|
if (!t.startsWith("{")) return t;
|
|
2614
2622
|
try {
|
|
@@ -2618,22 +2626,22 @@ function ki(e) {
|
|
|
2618
2626
|
return t;
|
|
2619
2627
|
}
|
|
2620
2628
|
}
|
|
2621
|
-
var
|
|
2622
|
-
async function
|
|
2629
|
+
var ji = (e) => e?.data ?? e;
|
|
2630
|
+
async function Mi(e, t) {
|
|
2623
2631
|
if (!e || !t) return [];
|
|
2624
2632
|
let n = new URLSearchParams({
|
|
2625
2633
|
module: e,
|
|
2626
2634
|
id: String(t)
|
|
2627
|
-
}), r =
|
|
2635
|
+
}), r = ji(await a(s, `/module-activity?${n.toString()}`));
|
|
2628
2636
|
return Array.isArray(r) ? r : [];
|
|
2629
2637
|
}
|
|
2630
|
-
async function
|
|
2638
|
+
async function Ni(e) {
|
|
2631
2639
|
if (!e) return [];
|
|
2632
|
-
let t =
|
|
2640
|
+
let t = ji(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2633
2641
|
return Array.isArray(t) ? t : [];
|
|
2634
2642
|
}
|
|
2635
|
-
async function
|
|
2636
|
-
return
|
|
2643
|
+
async function Pi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2644
|
+
return ji(await a(s, "/notes", {
|
|
2637
2645
|
method: "POST",
|
|
2638
2646
|
body: JSON.stringify({
|
|
2639
2647
|
relatedId: e,
|
|
@@ -2645,19 +2653,19 @@ async function Ni({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2645
2653
|
}
|
|
2646
2654
|
//#endregion
|
|
2647
2655
|
//#region src/utils/roleFormPermissionGate.js
|
|
2648
|
-
function
|
|
2656
|
+
function Fi(e, t) {
|
|
2649
2657
|
if (!e) return !0;
|
|
2650
2658
|
let n = e.find((e) => e.name === t);
|
|
2651
2659
|
return !n || n.enabled !== !1;
|
|
2652
2660
|
}
|
|
2653
|
-
function
|
|
2661
|
+
function Ii(e, t, n) {
|
|
2654
2662
|
if (!e) return !0;
|
|
2655
2663
|
let r = e.find((e) => e.name === t);
|
|
2656
2664
|
if (!r) return !0;
|
|
2657
2665
|
let i = r.fields?.find((e) => e.field === n);
|
|
2658
2666
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2659
2667
|
}
|
|
2660
|
-
function
|
|
2668
|
+
function Li(e, t, n) {
|
|
2661
2669
|
if (!e) return !0;
|
|
2662
2670
|
let r = e.find((e) => e.name === t);
|
|
2663
2671
|
if (!r) return !0;
|
|
@@ -2667,7 +2675,7 @@ function Ii(e, t, n) {
|
|
|
2667
2675
|
}
|
|
2668
2676
|
//#endregion
|
|
2669
2677
|
//#region src/components/form/inputSecurity.js
|
|
2670
|
-
var
|
|
2678
|
+
var Ri = [
|
|
2671
2679
|
"p",
|
|
2672
2680
|
"br",
|
|
2673
2681
|
"strong",
|
|
@@ -2689,12 +2697,12 @@ var Li = [
|
|
|
2689
2697
|
"a",
|
|
2690
2698
|
"code",
|
|
2691
2699
|
"pre"
|
|
2692
|
-
],
|
|
2700
|
+
], zi = [
|
|
2693
2701
|
"href",
|
|
2694
2702
|
"title",
|
|
2695
2703
|
"target",
|
|
2696
2704
|
"rel"
|
|
2697
|
-
],
|
|
2705
|
+
], Bi = /[\u200B-\u200D\u2060\uFEFF]/g, Vi = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, Hi = /^[\p{L}\p{M}\p{N} .'-]+$/u, Ui = /^\+?[0-9 ()-]+$/, Wi = /^-?(?:\d+|\d*\.\d+)$/, Gi = [
|
|
2698
2706
|
{
|
|
2699
2707
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2700
2708
|
message: "HTML/script content is not allowed"
|
|
@@ -2721,12 +2729,12 @@ var Li = [
|
|
|
2721
2729
|
plainOnly: !0
|
|
2722
2730
|
}
|
|
2723
2731
|
];
|
|
2724
|
-
function
|
|
2732
|
+
function Ki(e) {
|
|
2725
2733
|
if (typeof document > "u") return e;
|
|
2726
2734
|
let t = document.createElement("textarea");
|
|
2727
2735
|
return t.innerHTML = e, t.value;
|
|
2728
2736
|
}
|
|
2729
|
-
function
|
|
2737
|
+
function qi(e) {
|
|
2730
2738
|
let t = String(e ?? "");
|
|
2731
2739
|
for (let e = 0; e < 2; e += 1) try {
|
|
2732
2740
|
let e = decodeURIComponent(t);
|
|
@@ -2735,12 +2743,12 @@ function Ki(e) {
|
|
|
2735
2743
|
} catch {
|
|
2736
2744
|
break;
|
|
2737
2745
|
}
|
|
2738
|
-
return t =
|
|
2746
|
+
return t = Ki(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");
|
|
2739
2747
|
}
|
|
2740
|
-
function
|
|
2748
|
+
function Ji(e) {
|
|
2741
2749
|
return Pe.sanitize(String(e ?? ""), {
|
|
2742
|
-
ALLOWED_TAGS:
|
|
2743
|
-
ALLOWED_ATTR:
|
|
2750
|
+
ALLOWED_TAGS: Ri,
|
|
2751
|
+
ALLOWED_ATTR: zi,
|
|
2744
2752
|
ALLOW_DATA_ATTR: !1,
|
|
2745
2753
|
FORBID_TAGS: [
|
|
2746
2754
|
"script",
|
|
@@ -2760,35 +2768,35 @@ function qi(e) {
|
|
|
2760
2768
|
]
|
|
2761
2769
|
});
|
|
2762
2770
|
}
|
|
2763
|
-
function
|
|
2771
|
+
function Yi(e) {
|
|
2764
2772
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2765
2773
|
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
2766
2774
|
}
|
|
2767
|
-
function
|
|
2775
|
+
function Xi(e) {
|
|
2768
2776
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2769
2777
|
}
|
|
2770
|
-
function
|
|
2778
|
+
function Zi(e, t = {}) {
|
|
2771
2779
|
if (typeof e != "string") return e;
|
|
2772
|
-
if (t.type === "text-editor") return
|
|
2773
|
-
let n = e.normalize("NFC").replace(
|
|
2774
|
-
return n =
|
|
2780
|
+
if (t.type === "text-editor") return Ji(e.normalize("NFC"));
|
|
2781
|
+
let n = e.normalize("NFC").replace(Bi, "").replace(/\u00A0/g, " ").replace(Vi, "");
|
|
2782
|
+
return n = Xi(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2775
2783
|
}
|
|
2776
|
-
function
|
|
2784
|
+
function Qi(e, t = {}) {
|
|
2777
2785
|
if (typeof e != "string" || e === "") return null;
|
|
2778
|
-
let n = t.label || t.field || "Field", r =
|
|
2786
|
+
let n = t.label || t.field || "Field", r = qi(e);
|
|
2779
2787
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2780
|
-
let i = t.type === "text-editor", a =
|
|
2788
|
+
let i = t.type === "text-editor", a = Gi.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2781
2789
|
if (a) return `${n}: ${a.message}`;
|
|
2782
|
-
let o =
|
|
2783
|
-
return [...o].length >
|
|
2790
|
+
let o = Zi(e, t);
|
|
2791
|
+
return [...o].length > Yi(t) ? `${n} is too long` : t.formatter === "name" && o && !Hi.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !Ui.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !Wi.test(o) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && o && !/^https?:\/\//i.test(o) ? `${n} must use http:// or https://` : null;
|
|
2784
2792
|
}
|
|
2785
|
-
function
|
|
2793
|
+
function $i(e) {
|
|
2786
2794
|
return { validator: (t, n) => {
|
|
2787
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2795
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Qi(t, e)).find(Boolean);
|
|
2788
2796
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2789
2797
|
} };
|
|
2790
2798
|
}
|
|
2791
|
-
function
|
|
2799
|
+
function ea(e = []) {
|
|
2792
2800
|
let t = /* @__PURE__ */ new Map();
|
|
2793
2801
|
return e.forEach((e) => {
|
|
2794
2802
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2800,12 +2808,12 @@ function $i(e = []) {
|
|
|
2800
2808
|
});
|
|
2801
2809
|
}), t;
|
|
2802
2810
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let n =
|
|
2811
|
+
function ta(e, t = []) {
|
|
2812
|
+
let n = ea(t), r = (e, t = "") => {
|
|
2805
2813
|
if (typeof e == "string") {
|
|
2806
|
-
let r = n.get(t) ?? {}, i =
|
|
2814
|
+
let r = n.get(t) ?? {}, i = Qi(e, r);
|
|
2807
2815
|
if (i) throw Error(i);
|
|
2808
|
-
return
|
|
2816
|
+
return Zi(e, r);
|
|
2809
2817
|
}
|
|
2810
2818
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2811
2819
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2817,23 +2825,23 @@ function ea(e, t = []) {
|
|
|
2817
2825
|
}
|
|
2818
2826
|
//#endregion
|
|
2819
2827
|
//#region src/components/form/validationOverride.js
|
|
2820
|
-
var
|
|
2821
|
-
function
|
|
2828
|
+
var na = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2829
|
+
function ra(e) {
|
|
2822
2830
|
let t = e?.overrideCheckbox;
|
|
2823
|
-
return !t || typeof t != "object" ? null :
|
|
2831
|
+
return !t || typeof t != "object" ? null : aa(e).size > 0 ? t : null;
|
|
2824
2832
|
}
|
|
2825
|
-
function
|
|
2833
|
+
function ia(e) {
|
|
2826
2834
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2827
2835
|
}
|
|
2828
|
-
function
|
|
2836
|
+
function aa(e) {
|
|
2829
2837
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2830
2838
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2831
2839
|
}
|
|
2832
|
-
function
|
|
2840
|
+
function oa(e) {
|
|
2833
2841
|
return e?.overrideCheckbox?.store !== !1;
|
|
2834
2842
|
}
|
|
2835
|
-
function
|
|
2836
|
-
let r =
|
|
2843
|
+
function sa(e, t, n) {
|
|
2844
|
+
let r = ia(e);
|
|
2837
2845
|
if (typeof n == "function") {
|
|
2838
2846
|
let e = n(r);
|
|
2839
2847
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2844,27 +2852,27 @@ function oa(e, t, n) {
|
|
|
2844
2852
|
r
|
|
2845
2853
|
] : [r];
|
|
2846
2854
|
}
|
|
2847
|
-
function
|
|
2855
|
+
function ca(e, t) {
|
|
2848
2856
|
return (n) => {
|
|
2849
2857
|
let r = !1;
|
|
2850
2858
|
try {
|
|
2851
|
-
r =
|
|
2859
|
+
r = na(n?.getFieldValue?.(t));
|
|
2852
2860
|
} catch {
|
|
2853
2861
|
r = !1;
|
|
2854
2862
|
}
|
|
2855
2863
|
return r ? {} : e;
|
|
2856
2864
|
};
|
|
2857
2865
|
}
|
|
2858
|
-
function
|
|
2859
|
-
if (!
|
|
2860
|
-
let i =
|
|
2866
|
+
function la(e, t, n, r) {
|
|
2867
|
+
if (!ra(e)) return r;
|
|
2868
|
+
let i = aa(e), a = sa(e, t, n);
|
|
2861
2869
|
return (e) => {
|
|
2862
2870
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2863
|
-
return i.has(n) ?
|
|
2871
|
+
return i.has(n) ? ca(t, a) : t;
|
|
2864
2872
|
};
|
|
2865
2873
|
}
|
|
2866
|
-
function
|
|
2867
|
-
let t =
|
|
2874
|
+
function ua(e) {
|
|
2875
|
+
let t = ra(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2868
2876
|
return {
|
|
2869
2877
|
tone: t.tone ?? "overwrite",
|
|
2870
2878
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2875,12 +2883,12 @@ function la(e) {
|
|
|
2875
2883
|
}
|
|
2876
2884
|
//#endregion
|
|
2877
2885
|
//#region src/components/form/optionMatching.js
|
|
2878
|
-
function
|
|
2886
|
+
function da(e) {
|
|
2879
2887
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2880
2888
|
}
|
|
2881
|
-
function
|
|
2889
|
+
function fa(e) {
|
|
2882
2890
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2883
|
-
let r =
|
|
2891
|
+
let r = da(e);
|
|
2884
2892
|
r && !t.has(r) && t.set(r, n);
|
|
2885
2893
|
};
|
|
2886
2894
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2888,37 +2896,37 @@ function da(e) {
|
|
|
2888
2896
|
let t = typeof e == "object" ? e.value : e;
|
|
2889
2897
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2890
2898
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2891
|
-
let i = t.get(
|
|
2899
|
+
let i = t.get(da(r));
|
|
2892
2900
|
i !== void 0 && n(e, i);
|
|
2893
2901
|
}), t;
|
|
2894
2902
|
}
|
|
2895
|
-
var
|
|
2896
|
-
function
|
|
2903
|
+
var pa = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2904
|
+
function ma(e, t) {
|
|
2897
2905
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2898
|
-
let n = e.get(
|
|
2906
|
+
let n = e.get(da(t));
|
|
2899
2907
|
return n === void 0 ? t : n;
|
|
2900
2908
|
}
|
|
2901
|
-
function
|
|
2902
|
-
if (!
|
|
2903
|
-
let n =
|
|
2904
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2909
|
+
function ha(e, t) {
|
|
2910
|
+
if (!pa(e)) return t;
|
|
2911
|
+
let n = fa(e);
|
|
2912
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => ma(n, e)) : ma(n, t);
|
|
2905
2913
|
}
|
|
2906
2914
|
//#endregion
|
|
2907
2915
|
//#region src/components/form/payloadTransformer.js
|
|
2908
|
-
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2909
|
-
function ga(e) {
|
|
2910
|
-
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2911
|
-
}
|
|
2916
|
+
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, ga = (e) => e === !0 || e === 1 || e === "1", H = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !_a(e);
|
|
2912
2917
|
function _a(e) {
|
|
2913
|
-
return
|
|
2918
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2914
2919
|
}
|
|
2915
2920
|
function va(e) {
|
|
2916
|
-
return
|
|
2921
|
+
return _a(e) || e instanceof Date;
|
|
2922
|
+
}
|
|
2923
|
+
function ya(e) {
|
|
2924
|
+
return e instanceof Date ? e.toISOString() : _a(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2917
2925
|
}
|
|
2918
|
-
function
|
|
2919
|
-
if (!sr(t)) return
|
|
2926
|
+
function ba(e, t) {
|
|
2927
|
+
if (!sr(t)) return ya(e);
|
|
2920
2928
|
let n = cr(e);
|
|
2921
|
-
return n ? n.toISOString() :
|
|
2929
|
+
return n ? n.toISOString() : ya(e);
|
|
2922
2930
|
}
|
|
2923
2931
|
function U(e, t) {
|
|
2924
2932
|
if (!t) return;
|
|
@@ -2943,7 +2951,7 @@ function K(e, t, n) {
|
|
|
2943
2951
|
}
|
|
2944
2952
|
return i[r[r.length - 1]] = n, e;
|
|
2945
2953
|
}
|
|
2946
|
-
function
|
|
2954
|
+
function xa(e, t, n) {
|
|
2947
2955
|
let r = String(t).split("."), i = e;
|
|
2948
2956
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2949
2957
|
let t = r[e];
|
|
@@ -2955,24 +2963,24 @@ function ba(e, t, n) {
|
|
|
2955
2963
|
...i[a]
|
|
2956
2964
|
} : n, e;
|
|
2957
2965
|
}
|
|
2958
|
-
function
|
|
2966
|
+
function Sa(e) {
|
|
2959
2967
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2960
2968
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2961
2969
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2962
2970
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2963
2971
|
}
|
|
2964
|
-
function
|
|
2972
|
+
function Ca(e, t) {
|
|
2965
2973
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2966
|
-
H(n) && H(e[t]) ?
|
|
2974
|
+
H(n) && H(e[t]) ? Ca(e[t], n) : e[t] = n;
|
|
2967
2975
|
}), e;
|
|
2968
2976
|
}
|
|
2969
|
-
function
|
|
2977
|
+
function wa(e, t) {
|
|
2970
2978
|
let n = e.options ?? e.values ?? [];
|
|
2971
2979
|
for (let e of n) if (typeof e == "string") {
|
|
2972
2980
|
if (e === t) return e;
|
|
2973
2981
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2974
2982
|
}
|
|
2975
|
-
function
|
|
2983
|
+
function Ta(e, t) {
|
|
2976
2984
|
if (H(e)) {
|
|
2977
2985
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2978
2986
|
return {
|
|
@@ -2982,10 +2990,10 @@ function wa(e, t) {
|
|
|
2982
2990
|
}
|
|
2983
2991
|
return {
|
|
2984
2992
|
value: e,
|
|
2985
|
-
label:
|
|
2993
|
+
label: wa(t, e) ?? e
|
|
2986
2994
|
};
|
|
2987
2995
|
}
|
|
2988
|
-
function
|
|
2996
|
+
function Ea(e = {}) {
|
|
2989
2997
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2990
2998
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2991
2999
|
switch (e.type) {
|
|
@@ -2996,13 +3004,13 @@ function Ta(e = {}) {
|
|
|
2996
3004
|
}
|
|
2997
3005
|
}
|
|
2998
3006
|
function q(e, t, n = {}) {
|
|
2999
|
-
if (
|
|
3000
|
-
if (t === "string") return
|
|
3007
|
+
if (va(e)) {
|
|
3008
|
+
if (t === "string") return ba(e, n);
|
|
3001
3009
|
if (t === "number") {
|
|
3002
|
-
let t =
|
|
3010
|
+
let t = _a(e) ? e.valueOf() : e.getTime();
|
|
3003
3011
|
return Number.isNaN(t) ? null : t;
|
|
3004
3012
|
}
|
|
3005
|
-
if (t === "date" || t === "auto" || !t) return
|
|
3013
|
+
if (t === "date" || t === "auto" || !t) return ba(e, n);
|
|
3006
3014
|
}
|
|
3007
3015
|
switch (t) {
|
|
3008
3016
|
case "string": return e == null ? "" : String(e);
|
|
@@ -3017,14 +3025,14 @@ function q(e, t, n = {}) {
|
|
|
3017
3025
|
return t = Array.isArray(e) ? e : V(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => q(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
3018
3026
|
}
|
|
3019
3027
|
case "object": return H(e), e;
|
|
3020
|
-
case "date": return
|
|
3028
|
+
case "date": return ba(e, n);
|
|
3021
3029
|
case "custom":
|
|
3022
3030
|
case "auto":
|
|
3023
3031
|
case void 0:
|
|
3024
3032
|
default: return e;
|
|
3025
3033
|
}
|
|
3026
3034
|
}
|
|
3027
|
-
var
|
|
3035
|
+
var Da = {
|
|
3028
3036
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
3029
3037
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
3030
3038
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -3032,11 +3040,11 @@ var Ea = {
|
|
|
3032
3040
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
3033
3041
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
3034
3042
|
};
|
|
3035
|
-
function
|
|
3043
|
+
function Oa(e, t) {
|
|
3036
3044
|
if (!t) return e;
|
|
3037
3045
|
let n = t;
|
|
3038
3046
|
if (typeof n == "string") {
|
|
3039
|
-
if (
|
|
3047
|
+
if (Da[n]) return Da[n](e);
|
|
3040
3048
|
try {
|
|
3041
3049
|
n = JSON.parse(n);
|
|
3042
3050
|
} catch {
|
|
@@ -3044,14 +3052,14 @@ function Da(e, t) {
|
|
|
3044
3052
|
}
|
|
3045
3053
|
}
|
|
3046
3054
|
let r = e;
|
|
3047
|
-
if (n.name &&
|
|
3055
|
+
if (n.name && Da[n.name] && (r = Da[n.name](r)), n.map && typeof n.map == "object") {
|
|
3048
3056
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
3049
3057
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
3050
3058
|
}
|
|
3051
3059
|
return r;
|
|
3052
3060
|
}
|
|
3053
|
-
var
|
|
3054
|
-
function
|
|
3061
|
+
var ka = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
3062
|
+
function Aa(e, t) {
|
|
3055
3063
|
let [n, ...r] = e.split("."), i;
|
|
3056
3064
|
if (n === "value") i = t.value;
|
|
3057
3065
|
else if (n === "label") i = t.label;
|
|
@@ -3059,24 +3067,24 @@ function ka(e, t) {
|
|
|
3059
3067
|
else return;
|
|
3060
3068
|
return r.length ? U(i, r.join(".")) : i;
|
|
3061
3069
|
}
|
|
3062
|
-
function
|
|
3070
|
+
function ja(e, t) {
|
|
3063
3071
|
if (typeof e == "string") {
|
|
3064
3072
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
3065
|
-
return n ?
|
|
3066
|
-
let r =
|
|
3073
|
+
return n ? Aa(n[1], t) : e.replace(ka, (e, n) => {
|
|
3074
|
+
let r = Aa(n, t);
|
|
3067
3075
|
return r == null ? "" : String(r);
|
|
3068
3076
|
});
|
|
3069
3077
|
}
|
|
3070
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
3078
|
+
if (Array.isArray(e)) return e.map((e) => ja(e, t));
|
|
3071
3079
|
if (H(e)) {
|
|
3072
3080
|
let n = {};
|
|
3073
3081
|
return Object.entries(e).forEach(([e, r]) => {
|
|
3074
|
-
n[e] =
|
|
3082
|
+
n[e] = ja(r, t);
|
|
3075
3083
|
}), n;
|
|
3076
3084
|
}
|
|
3077
3085
|
return e;
|
|
3078
3086
|
}
|
|
3079
|
-
function
|
|
3087
|
+
function Ma(e) {
|
|
3080
3088
|
if (!e) return null;
|
|
3081
3089
|
if (typeof e == "string") try {
|
|
3082
3090
|
return JSON.parse(e);
|
|
@@ -3085,8 +3093,8 @@ function ja(e) {
|
|
|
3085
3093
|
}
|
|
3086
3094
|
return e;
|
|
3087
3095
|
}
|
|
3088
|
-
function
|
|
3089
|
-
let n = e.payloadMode || "auto", r =
|
|
3096
|
+
function Na(e, t) {
|
|
3097
|
+
let n = e.payloadMode || "auto", r = Ea(e), { value: i, label: a } = Ta(t, e);
|
|
3090
3098
|
switch (n) {
|
|
3091
3099
|
case "value": return {
|
|
3092
3100
|
kind: "scalar",
|
|
@@ -3108,12 +3116,12 @@ function Ma(e, t) {
|
|
|
3108
3116
|
}
|
|
3109
3117
|
case "custom":
|
|
3110
3118
|
case "template": {
|
|
3111
|
-
let n =
|
|
3119
|
+
let n = Ma(e.payloadTemplate);
|
|
3112
3120
|
if (!n) return {
|
|
3113
3121
|
kind: "scalar",
|
|
3114
3122
|
out: q(i, r, e)
|
|
3115
3123
|
};
|
|
3116
|
-
let o =
|
|
3124
|
+
let o = ja(n, {
|
|
3117
3125
|
value: q(i, e.elementType || "auto", {}),
|
|
3118
3126
|
label: a,
|
|
3119
3127
|
raw: t
|
|
@@ -3129,15 +3137,15 @@ function Ma(e, t) {
|
|
|
3129
3137
|
};
|
|
3130
3138
|
}
|
|
3131
3139
|
}
|
|
3132
|
-
function
|
|
3140
|
+
function Pa(e, t) {
|
|
3133
3141
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
3134
3142
|
let n = t;
|
|
3135
|
-
return V(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n =
|
|
3143
|
+
return V(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = Oa(n, e.transformRule), V(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Ea(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
3136
3144
|
kind: "scalar",
|
|
3137
|
-
out: n.map((t) =>
|
|
3138
|
-
} :
|
|
3145
|
+
out: n.map((t) => Na(e, t).out)
|
|
3146
|
+
} : Na(e, n);
|
|
3139
3147
|
}
|
|
3140
|
-
function
|
|
3148
|
+
function Fa(e = {}) {
|
|
3141
3149
|
return !!e.richValue || [
|
|
3142
3150
|
"label",
|
|
3143
3151
|
"object",
|
|
@@ -3145,8 +3153,8 @@ function Pa(e = {}) {
|
|
|
3145
3153
|
"template"
|
|
3146
3154
|
].includes(e.payloadMode);
|
|
3147
3155
|
}
|
|
3148
|
-
function
|
|
3149
|
-
if (!
|
|
3156
|
+
function Ia(e, t, n = []) {
|
|
3157
|
+
if (!Fa(e) || t == null) return t;
|
|
3150
3158
|
let r = (e) => {
|
|
3151
3159
|
if (H(e) && e.value !== void 0) return e;
|
|
3152
3160
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -3157,7 +3165,7 @@ function Fa(e, t, n = []) {
|
|
|
3157
3165
|
};
|
|
3158
3166
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
3159
3167
|
}
|
|
3160
|
-
function
|
|
3168
|
+
function La(e, t, n) {
|
|
3161
3169
|
if (!e?.field) return !0;
|
|
3162
3170
|
let r = G(t, e.field) ? W(t, e.field) : W(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
3163
3171
|
switch (e.operator) {
|
|
@@ -3171,45 +3179,45 @@ function Ia(e, t, n) {
|
|
|
3171
3179
|
default: return !0;
|
|
3172
3180
|
}
|
|
3173
3181
|
}
|
|
3174
|
-
function
|
|
3182
|
+
function Ra(e) {
|
|
3175
3183
|
let t = [];
|
|
3176
3184
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
3177
3185
|
e?.field && t.push(e.field);
|
|
3178
3186
|
}), t;
|
|
3179
3187
|
}
|
|
3180
|
-
function
|
|
3188
|
+
function za(e, t, n) {
|
|
3181
3189
|
if (!e) return !0;
|
|
3182
3190
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
3183
3191
|
if (r.length) {
|
|
3184
|
-
let i = r.map((e) =>
|
|
3192
|
+
let i = r.map((e) => La(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
3185
3193
|
if (e.field) {
|
|
3186
|
-
let r =
|
|
3194
|
+
let r = La(e, t, n);
|
|
3187
3195
|
o = a ? o || r : o && r;
|
|
3188
3196
|
}
|
|
3189
3197
|
return o;
|
|
3190
3198
|
}
|
|
3191
|
-
return
|
|
3199
|
+
return La(e, t, n);
|
|
3192
3200
|
}
|
|
3193
|
-
function
|
|
3194
|
-
let a =
|
|
3195
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
3201
|
+
function Ba(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
3202
|
+
let a = Ra(e?.showIf);
|
|
3203
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), za(e.showIf, t, n) ? a.every((e) => {
|
|
3196
3204
|
let a = r?.get?.(e);
|
|
3197
|
-
return !a ||
|
|
3205
|
+
return !a || Ba(a, t, n, r, i);
|
|
3198
3206
|
}) : !1);
|
|
3199
3207
|
}
|
|
3200
|
-
function
|
|
3208
|
+
function Va(e = []) {
|
|
3201
3209
|
let t = /* @__PURE__ */ new Map();
|
|
3202
3210
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
3203
3211
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
3204
3212
|
})), t;
|
|
3205
3213
|
}
|
|
3206
|
-
function
|
|
3214
|
+
function Ha(e = {}, { editing: t = !1 } = {}) {
|
|
3207
3215
|
let n = {};
|
|
3208
3216
|
return (e.fields ?? []).forEach((e) => {
|
|
3209
|
-
!e.field ||
|
|
3217
|
+
!e.field || Ga(e) || t && !e.defaultOnEdit || e.defaultValue !== void 0 && e.defaultValue !== "" && (n[e.field] = e.defaultValue);
|
|
3210
3218
|
}), n;
|
|
3211
3219
|
}
|
|
3212
|
-
function
|
|
3220
|
+
function Ua(e = []) {
|
|
3213
3221
|
let t = [];
|
|
3214
3222
|
return e.forEach((e) => {
|
|
3215
3223
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -3220,27 +3228,27 @@ function Ha(e = []) {
|
|
|
3220
3228
|
});
|
|
3221
3229
|
}), t;
|
|
3222
3230
|
}
|
|
3223
|
-
var
|
|
3231
|
+
var Wa = [
|
|
3224
3232
|
"file",
|
|
3225
3233
|
"document",
|
|
3226
3234
|
"image",
|
|
3227
3235
|
"upload",
|
|
3228
3236
|
"attachment"
|
|
3229
3237
|
];
|
|
3230
|
-
function
|
|
3231
|
-
return
|
|
3238
|
+
function Ga(e) {
|
|
3239
|
+
return Wa.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
3232
3240
|
}
|
|
3233
|
-
function
|
|
3234
|
-
return
|
|
3241
|
+
function Ka(e = []) {
|
|
3242
|
+
return Ua(e).map(({ field: e }) => e).filter(Ga);
|
|
3235
3243
|
}
|
|
3236
|
-
function
|
|
3244
|
+
function qa(e) {
|
|
3237
3245
|
return String(e ?? "").trim().toLowerCase();
|
|
3238
3246
|
}
|
|
3239
|
-
function
|
|
3240
|
-
return !!t &&
|
|
3247
|
+
function Ja(e, t) {
|
|
3248
|
+
return !!t && qa(e.moduleName) === t;
|
|
3241
3249
|
}
|
|
3242
|
-
function
|
|
3243
|
-
let r = [], i = n.scope ?? "all", a =
|
|
3250
|
+
function Ya(e, t = [], n = {}) {
|
|
3251
|
+
let r = [], i = n.scope ?? "all", a = qa(n.module), o = (e, t) => {
|
|
3244
3252
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
3245
3253
|
let n = t?.originFileObj || t;
|
|
3246
3254
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -3250,9 +3258,9 @@ function Ja(e, t = [], n = {}) {
|
|
|
3250
3258
|
});
|
|
3251
3259
|
};
|
|
3252
3260
|
return (t ?? []).forEach((t) => {
|
|
3253
|
-
let r = (t.fields ?? []).filter(
|
|
3261
|
+
let r = (t.fields ?? []).filter(Ga);
|
|
3254
3262
|
if (!r.length) return;
|
|
3255
|
-
let s = t.moduleName && !
|
|
3263
|
+
let s = t.moduleName && !Ja(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
3256
3264
|
if (t.addRow) {
|
|
3257
3265
|
if (i === "flat") return;
|
|
3258
3266
|
let a = e[t.name];
|
|
@@ -3272,12 +3280,12 @@ function Ja(e, t = [], n = {}) {
|
|
|
3272
3280
|
});
|
|
3273
3281
|
}), r;
|
|
3274
3282
|
}
|
|
3275
|
-
function
|
|
3283
|
+
function Xa(e, t, n = {}) {
|
|
3276
3284
|
let r = H(n.base) ? structuredClone(n.base) : {};
|
|
3277
|
-
|
|
3278
|
-
(e.payloadKey || e.field) && (
|
|
3285
|
+
Ka(t).forEach((e) => {
|
|
3286
|
+
(e.payloadKey || e.field) && ($a(r, e.payloadKey || e.field), $a(r, e.field));
|
|
3279
3287
|
});
|
|
3280
|
-
let i =
|
|
3288
|
+
let i = qa(n.module), a = Va(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));
|
|
3281
3289
|
return (t ?? []).forEach((t) => {
|
|
3282
3290
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && G(e, t.toggleField) ? !!W(e, t.toggleField) : !1;
|
|
3283
3291
|
if (t.toggleEnabled && t.toggleField && G(e, t.toggleField) && (K(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -3287,29 +3295,29 @@ function Ya(e, t, n = {}) {
|
|
|
3287
3295
|
if (t.addRow) {
|
|
3288
3296
|
let i = e[t.name];
|
|
3289
3297
|
if (!Array.isArray(i)) return;
|
|
3290
|
-
K(n, t.payloadKey || t.name, i.map((t) =>
|
|
3298
|
+
K(n, t.payloadKey || t.name, i.map((t) => Qa(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
3291
3299
|
return;
|
|
3292
3300
|
}
|
|
3293
|
-
r.forEach((t) =>
|
|
3301
|
+
r.forEach((t) => Za(t, e, n, e, a));
|
|
3294
3302
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
3295
3303
|
moduleName: e,
|
|
3296
3304
|
data: t
|
|
3297
|
-
}))),
|
|
3305
|
+
}))), ta(r, t);
|
|
3298
3306
|
}
|
|
3299
|
-
function
|
|
3300
|
-
if (
|
|
3301
|
-
let r =
|
|
3307
|
+
function Za(e, t, n, r, i) {
|
|
3308
|
+
if (ra(e) && oa(e)) {
|
|
3309
|
+
let r = ia(e);
|
|
3302
3310
|
G(t, r) && K(n, r, !!W(t, r));
|
|
3303
3311
|
}
|
|
3304
|
-
if (
|
|
3305
|
-
let i =
|
|
3312
|
+
if (Ga(e)) {
|
|
3313
|
+
let i = Sa(W(t, e.field));
|
|
3306
3314
|
if (i !== void 0) {
|
|
3307
3315
|
let a = r !== void 0 && r !== t;
|
|
3308
|
-
|
|
3316
|
+
xa(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
3309
3317
|
}
|
|
3310
3318
|
return;
|
|
3311
3319
|
}
|
|
3312
|
-
if (
|
|
3320
|
+
if (Ra(e.showIf).length && !Ba(e, t, r, i)) {
|
|
3313
3321
|
(r === void 0 || r === t) && G(t, e.field) && K(n, e.payloadKey || e.field, null);
|
|
3314
3322
|
return;
|
|
3315
3323
|
}
|
|
@@ -3317,30 +3325,30 @@ function Xa(e, t, n, r, i) {
|
|
|
3317
3325
|
if (!G(t, e.field)) return;
|
|
3318
3326
|
let a = W(t, e.field);
|
|
3319
3327
|
if (!Array.isArray(a)) return;
|
|
3320
|
-
let o = a.map((t) =>
|
|
3328
|
+
let o = a.map((t) => Qa(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
3321
3329
|
K(n, e.payloadKey || e.field, o);
|
|
3322
3330
|
return;
|
|
3323
3331
|
}
|
|
3324
3332
|
if (!G(t, e.field)) return;
|
|
3325
|
-
if (
|
|
3326
|
-
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a =
|
|
3333
|
+
if (ga(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
3334
|
+
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a = to(e), o = i.map((e) => Pa(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
3327
3335
|
K(n, e.payloadKey || e.field, o);
|
|
3328
3336
|
return;
|
|
3329
3337
|
}
|
|
3330
|
-
let a =
|
|
3338
|
+
let a = Pa(e, W(t, e.field));
|
|
3331
3339
|
if (a.kind !== "skip") {
|
|
3332
3340
|
if (a.kind === "spread" && H(a.out)) {
|
|
3333
|
-
|
|
3341
|
+
Ca(n, a.out);
|
|
3334
3342
|
return;
|
|
3335
3343
|
}
|
|
3336
3344
|
K(n, e.payloadKey || e.field, a.out);
|
|
3337
3345
|
}
|
|
3338
3346
|
}
|
|
3339
|
-
function
|
|
3347
|
+
function Qa(e, t, n, r) {
|
|
3340
3348
|
let i = {};
|
|
3341
|
-
return e.forEach((e) =>
|
|
3349
|
+
return e.forEach((e) => Za(e, t, i, n ?? t, r)), i;
|
|
3342
3350
|
}
|
|
3343
|
-
function
|
|
3351
|
+
function $a(e, t) {
|
|
3344
3352
|
let n = String(t).split("."), r = e;
|
|
3345
3353
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
3346
3354
|
if (!H(r[n[e]])) return;
|
|
@@ -3348,7 +3356,7 @@ function Qa(e, t) {
|
|
|
3348
3356
|
}
|
|
3349
3357
|
delete r[n[n.length - 1]];
|
|
3350
3358
|
}
|
|
3351
|
-
var
|
|
3359
|
+
var eo = /* @__PURE__ */ new Set([
|
|
3352
3360
|
"text",
|
|
3353
3361
|
"textarea",
|
|
3354
3362
|
"email",
|
|
@@ -3365,7 +3373,7 @@ function J(e, t) {
|
|
|
3365
3373
|
if (t == null) return r() ?? t;
|
|
3366
3374
|
if (n(t)) return r();
|
|
3367
3375
|
if (V(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
3368
|
-
if (
|
|
3376
|
+
if (eo.has(e.type) && H(t)) {
|
|
3369
3377
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
3370
3378
|
if (r === void 0 || H(r)) return;
|
|
3371
3379
|
t = r;
|
|
@@ -3375,8 +3383,8 @@ function J(e, t) {
|
|
|
3375
3383
|
let e = E(t);
|
|
3376
3384
|
return e.isValid() ? e : null;
|
|
3377
3385
|
}
|
|
3378
|
-
t =
|
|
3379
|
-
let i = (t) => H(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
3386
|
+
t = ha(e, t);
|
|
3387
|
+
let i = (t) => H(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) => {
|
|
3380
3388
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
3381
3389
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
3382
3390
|
return n ? n.value : t;
|
|
@@ -3388,7 +3396,7 @@ function J(e, t) {
|
|
|
3388
3396
|
}
|
|
3389
3397
|
return t;
|
|
3390
3398
|
}
|
|
3391
|
-
function
|
|
3399
|
+
function to(e = {}) {
|
|
3392
3400
|
return {
|
|
3393
3401
|
...e,
|
|
3394
3402
|
addRow: !1,
|
|
@@ -3397,14 +3405,14 @@ function eo(e = {}) {
|
|
|
3397
3405
|
dataType: void 0
|
|
3398
3406
|
};
|
|
3399
3407
|
}
|
|
3400
|
-
function
|
|
3408
|
+
function no(e, t) {
|
|
3401
3409
|
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;
|
|
3402
3410
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
3403
3411
|
let i = [];
|
|
3404
3412
|
Array.isArray(t) && (i = t.map((t) => {
|
|
3405
3413
|
let n = {};
|
|
3406
3414
|
return e.subFields.forEach((e) => {
|
|
3407
|
-
if (!e.field ||
|
|
3415
|
+
if (!e.field || Ga(e)) return;
|
|
3408
3416
|
let r = U(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
3409
3417
|
r != null && (n[e.field] = J(e, r));
|
|
3410
3418
|
}), n;
|
|
@@ -3413,7 +3421,7 @@ function to(e, t) {
|
|
|
3413
3421
|
for (; i.length < a;) i.push({});
|
|
3414
3422
|
return i;
|
|
3415
3423
|
}
|
|
3416
|
-
let i =
|
|
3424
|
+
let i = to(e), a = [];
|
|
3417
3425
|
if (Array.isArray(t)) a = t.map((e) => J(i, e)).filter((e) => e != null && e !== "");
|
|
3418
3426
|
else if (t != null && t !== "") {
|
|
3419
3427
|
let e = J(i, t);
|
|
@@ -3425,12 +3433,12 @@ function to(e, t) {
|
|
|
3425
3433
|
}
|
|
3426
3434
|
//#endregion
|
|
3427
3435
|
//#region src/components/form/linkedAddRowGroups.js
|
|
3428
|
-
var
|
|
3429
|
-
function
|
|
3436
|
+
var ro = (e) => e === !0 || e === 1 || e === "1";
|
|
3437
|
+
function io(e = []) {
|
|
3430
3438
|
let t = /* @__PURE__ */ new Map();
|
|
3431
3439
|
e.forEach((e) => {
|
|
3432
3440
|
let n = e?.linkGroup;
|
|
3433
|
-
!
|
|
3441
|
+
!ro(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
3434
3442
|
});
|
|
3435
3443
|
let n = /* @__PURE__ */ new Map();
|
|
3436
3444
|
return t.forEach((e, t) => {
|
|
@@ -3440,11 +3448,11 @@ function ro(e = []) {
|
|
|
3440
3448
|
});
|
|
3441
3449
|
}), n;
|
|
3442
3450
|
}
|
|
3443
|
-
function
|
|
3451
|
+
function ao(e, t) {
|
|
3444
3452
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3445
3453
|
return null;
|
|
3446
3454
|
}
|
|
3447
|
-
function
|
|
3455
|
+
function oo(e, t = {}) {
|
|
3448
3456
|
let n = { ...t };
|
|
3449
3457
|
return e.forEach(({ memberNames: e }) => {
|
|
3450
3458
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3456,7 +3464,7 @@ function ao(e, t = {}) {
|
|
|
3456
3464
|
}
|
|
3457
3465
|
//#endregion
|
|
3458
3466
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3459
|
-
var
|
|
3467
|
+
var so = {
|
|
3460
3468
|
duplicate: {
|
|
3461
3469
|
className: "fdd-tone-amber",
|
|
3462
3470
|
Icon: me
|
|
@@ -3474,8 +3482,8 @@ var oo = {
|
|
|
3474
3482
|
Icon: ce
|
|
3475
3483
|
}
|
|
3476
3484
|
};
|
|
3477
|
-
function
|
|
3478
|
-
let { className: c, Icon: l } =
|
|
3485
|
+
function co({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s } = {}) {
|
|
3486
|
+
let { className: c, Icon: l } = so[e] ?? so.suggestion, u = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3479
3487
|
return new Promise((e) => {
|
|
3480
3488
|
x.confirm({
|
|
3481
3489
|
icon: null,
|
|
@@ -3525,8 +3533,8 @@ function so({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3525
3533
|
});
|
|
3526
3534
|
});
|
|
3527
3535
|
}
|
|
3528
|
-
function
|
|
3529
|
-
let { className: a, Icon: o } =
|
|
3536
|
+
function lo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3537
|
+
let { className: a, Icon: o } = so[e] ?? so.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3530
3538
|
return new Promise((e) => {
|
|
3531
3539
|
x.warning({
|
|
3532
3540
|
icon: null,
|
|
@@ -3568,7 +3576,7 @@ function co({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3568
3576
|
}
|
|
3569
3577
|
//#endregion
|
|
3570
3578
|
//#region src/services/aiActionApi.js
|
|
3571
|
-
async function
|
|
3579
|
+
async function uo({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3572
3580
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3573
3581
|
let c = await r(), l = new FormData();
|
|
3574
3582
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3594,17 +3602,17 @@ async function lo({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3594
3602
|
}
|
|
3595
3603
|
//#endregion
|
|
3596
3604
|
//#region src/components/detail/phoneDisplay.js
|
|
3597
|
-
var
|
|
3598
|
-
function
|
|
3605
|
+
var fo = (e) => e == null || e === "";
|
|
3606
|
+
function po(e, t) {
|
|
3599
3607
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3600
3608
|
}
|
|
3601
|
-
function
|
|
3609
|
+
function mo(e) {
|
|
3602
3610
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3603
3611
|
if (!t) return "";
|
|
3604
3612
|
let n = t.replace(/^\+/, "");
|
|
3605
3613
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3606
3614
|
}
|
|
3607
|
-
function
|
|
3615
|
+
function ho(e) {
|
|
3608
3616
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3609
3617
|
return [
|
|
3610
3618
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3617,15 +3625,15 @@ function mo(e) {
|
|
|
3617
3625
|
"isdCode"
|
|
3618
3626
|
];
|
|
3619
3627
|
}
|
|
3620
|
-
function
|
|
3621
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3628
|
+
function go(e, t, n = "") {
|
|
3629
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...ho(e)] : ho(e);
|
|
3622
3630
|
for (let e of i) {
|
|
3623
|
-
let n = po(
|
|
3631
|
+
let n = mo(po(t, e));
|
|
3624
3632
|
if (n) return n;
|
|
3625
3633
|
}
|
|
3626
|
-
return
|
|
3634
|
+
return mo(n);
|
|
3627
3635
|
}
|
|
3628
|
-
function
|
|
3636
|
+
function _o(e) {
|
|
3629
3637
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3630
3638
|
return n ? {
|
|
3631
3639
|
code: n[1],
|
|
@@ -3635,17 +3643,17 @@ function go(e) {
|
|
|
3635
3643
|
rest: t
|
|
3636
3644
|
};
|
|
3637
3645
|
}
|
|
3638
|
-
function
|
|
3639
|
-
if (
|
|
3640
|
-
let { code: n, rest: r } =
|
|
3646
|
+
function vo(e, t = "") {
|
|
3647
|
+
if (fo(e)) return "";
|
|
3648
|
+
let { code: n, rest: r } = _o(e), i = n || mo(t), a = Yn(r) || r;
|
|
3641
3649
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3642
3650
|
}
|
|
3643
|
-
function
|
|
3644
|
-
return
|
|
3651
|
+
function yo(e, t, n) {
|
|
3652
|
+
return vo(t, go(e, n, qn()));
|
|
3645
3653
|
}
|
|
3646
3654
|
//#endregion
|
|
3647
3655
|
//#region src/components/detail/renderConfig.js
|
|
3648
|
-
var
|
|
3656
|
+
var bo = [
|
|
3649
3657
|
{
|
|
3650
3658
|
value: "auto",
|
|
3651
3659
|
label: "Default (auto)"
|
|
@@ -3702,7 +3710,7 @@ var yo = [
|
|
|
3702
3710
|
value: "html",
|
|
3703
3711
|
label: "HTML"
|
|
3704
3712
|
}
|
|
3705
|
-
],
|
|
3713
|
+
], xo = [
|
|
3706
3714
|
{
|
|
3707
3715
|
value: "preview",
|
|
3708
3716
|
label: "Preview (viewer)"
|
|
@@ -3723,7 +3731,7 @@ var yo = [
|
|
|
3723
3731
|
value: "text",
|
|
3724
3732
|
label: "Text (filename)"
|
|
3725
3733
|
}
|
|
3726
|
-
],
|
|
3734
|
+
], So = [
|
|
3727
3735
|
{
|
|
3728
3736
|
value: "none",
|
|
3729
3737
|
label: "None"
|
|
@@ -3740,76 +3748,76 @@ var yo = [
|
|
|
3740
3748
|
value: "title",
|
|
3741
3749
|
label: "Title Case"
|
|
3742
3750
|
}
|
|
3743
|
-
],
|
|
3751
|
+
], Co = [
|
|
3744
3752
|
"location",
|
|
3745
3753
|
"path",
|
|
3746
3754
|
"url",
|
|
3747
3755
|
"key"
|
|
3748
|
-
],
|
|
3756
|
+
], wo = [
|
|
3749
3757
|
"location",
|
|
3750
3758
|
"filepath",
|
|
3751
3759
|
"path",
|
|
3752
3760
|
"url",
|
|
3753
3761
|
"key"
|
|
3754
|
-
],
|
|
3762
|
+
], To = [
|
|
3755
3763
|
"uploadedfilename",
|
|
3756
3764
|
"uploadname",
|
|
3757
3765
|
"originalname",
|
|
3758
3766
|
"displayname",
|
|
3759
3767
|
"documentname",
|
|
3760
3768
|
"filename"
|
|
3761
|
-
],
|
|
3762
|
-
function
|
|
3769
|
+
], Eo = ["name"], Do = (e) => String(e).toLowerCase(), Oo = (e) => e == null || e === "";
|
|
3770
|
+
function ko(e, t) {
|
|
3763
3771
|
for (let n of t) {
|
|
3764
3772
|
let t = e[n];
|
|
3765
3773
|
if (typeof t == "string" && t) return t;
|
|
3766
3774
|
}
|
|
3767
3775
|
return "";
|
|
3768
3776
|
}
|
|
3769
|
-
function
|
|
3770
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3777
|
+
function Ao(e, t) {
|
|
3778
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Do(t).endsWith(n)) return r;
|
|
3771
3779
|
return "";
|
|
3772
3780
|
}
|
|
3773
|
-
function
|
|
3781
|
+
function jo(e) {
|
|
3774
3782
|
if (!e) return "";
|
|
3775
3783
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3776
3784
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3777
3785
|
}
|
|
3778
|
-
function
|
|
3786
|
+
function Mo(e) {
|
|
3779
3787
|
if (!e) return "";
|
|
3780
3788
|
let t = String(e);
|
|
3781
3789
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3782
3790
|
}
|
|
3783
|
-
function
|
|
3791
|
+
function No(e) {
|
|
3784
3792
|
let t = String(e ?? "").trim();
|
|
3785
3793
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3786
3794
|
}
|
|
3787
|
-
function No(e) {
|
|
3788
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Oo(e, So) || ko(e, Co);
|
|
3789
|
-
}
|
|
3790
3795
|
function Po(e) {
|
|
3791
|
-
return
|
|
3796
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : ko(e, Co) || Ao(e, wo);
|
|
3792
3797
|
}
|
|
3793
3798
|
function Fo(e) {
|
|
3794
|
-
|
|
3799
|
+
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";
|
|
3800
|
+
}
|
|
3801
|
+
function Io(e) {
|
|
3802
|
+
if (Oo(e)) return [];
|
|
3795
3803
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3796
|
-
for (let e of t) if (!
|
|
3804
|
+
for (let e of t) if (!Oo(e)) {
|
|
3797
3805
|
if (typeof e == "string") {
|
|
3798
3806
|
let t = e.includes("/") ? e : "";
|
|
3799
3807
|
n.push({
|
|
3800
3808
|
location: t,
|
|
3801
|
-
name:
|
|
3802
|
-
url:
|
|
3803
|
-
needsAuthFetch:
|
|
3809
|
+
name: jo(e) || e,
|
|
3810
|
+
url: Mo(t),
|
|
3811
|
+
needsAuthFetch: No(t)
|
|
3804
3812
|
});
|
|
3805
3813
|
} else if (typeof e == "object") {
|
|
3806
|
-
let t =
|
|
3814
|
+
let t = Po(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3807
3815
|
n.push({
|
|
3808
3816
|
location: t,
|
|
3809
|
-
name:
|
|
3810
|
-
url: r ||
|
|
3817
|
+
name: Fo(e),
|
|
3818
|
+
url: r || Mo(t),
|
|
3811
3819
|
documentId: e.id || e._id || e.documentId || "",
|
|
3812
|
-
needsAuthFetch: !r &&
|
|
3820
|
+
needsAuthFetch: !r && No(t)
|
|
3813
3821
|
});
|
|
3814
3822
|
}
|
|
3815
3823
|
}
|
|
@@ -3817,24 +3825,24 @@ function Fo(e) {
|
|
|
3817
3825
|
}
|
|
3818
3826
|
//#endregion
|
|
3819
3827
|
//#region src/components/form/repeatableRowShape.js
|
|
3820
|
-
function
|
|
3828
|
+
function Lo(e) {
|
|
3821
3829
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3822
3830
|
}
|
|
3823
|
-
function
|
|
3831
|
+
function Ro(e, t) {
|
|
3824
3832
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3825
|
-
let n =
|
|
3833
|
+
let n = Lo(e);
|
|
3826
3834
|
if (!n) return t;
|
|
3827
3835
|
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 }));
|
|
3828
3836
|
return r ? i : t;
|
|
3829
3837
|
}
|
|
3830
3838
|
//#endregion
|
|
3831
3839
|
//#region src/components/form/applyGroupValues.js
|
|
3832
|
-
var
|
|
3833
|
-
function
|
|
3840
|
+
var zo = (e) => e === !0 || e === 1 || e === "1", Bo = (e) => e == null || e === "";
|
|
3841
|
+
function Vo(e) {
|
|
3834
3842
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3835
3843
|
}
|
|
3836
3844
|
function Y(e, t, n) {
|
|
3837
|
-
let r = Array.isArray(t) ? t :
|
|
3845
|
+
let r = Array.isArray(t) ? t : Vo(t);
|
|
3838
3846
|
if (!r.length) return e;
|
|
3839
3847
|
let i = e;
|
|
3840
3848
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3843,23 +3851,23 @@ function Y(e, t, n) {
|
|
|
3843
3851
|
}
|
|
3844
3852
|
return i[r[r.length - 1]] = n, e;
|
|
3845
3853
|
}
|
|
3846
|
-
function
|
|
3854
|
+
function Ho(e, t = []) {
|
|
3847
3855
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3848
3856
|
if (!n) continue;
|
|
3849
3857
|
let t = U(e, n);
|
|
3850
|
-
if (!
|
|
3858
|
+
if (!Bo(t)) return t;
|
|
3851
3859
|
}
|
|
3852
3860
|
}
|
|
3853
|
-
function
|
|
3861
|
+
function Uo(e, t) {
|
|
3854
3862
|
if (!e || typeof e != "object") return;
|
|
3855
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3863
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Bo(n));
|
|
3856
3864
|
if (r) return r[1];
|
|
3857
3865
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3858
|
-
let n =
|
|
3859
|
-
if (!
|
|
3866
|
+
let n = Uo(e, t);
|
|
3867
|
+
if (!Bo(n)) return n;
|
|
3860
3868
|
}
|
|
3861
3869
|
}
|
|
3862
|
-
function
|
|
3870
|
+
function Wo(e, t) {
|
|
3863
3871
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3864
3872
|
if (!n.length) return;
|
|
3865
3873
|
let r = n.map((e, n) => {
|
|
@@ -3869,9 +3877,9 @@ function Uo(e, t) {
|
|
|
3869
3877
|
status: "done"
|
|
3870
3878
|
};
|
|
3871
3879
|
if (!e || typeof e != "object") return null;
|
|
3872
|
-
let r =
|
|
3880
|
+
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) ?? "";
|
|
3873
3881
|
if (!r && !i) return null;
|
|
3874
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3882
|
+
let a = r && !String(r).startsWith("http") ? Mo(r) : r;
|
|
3875
3883
|
return {
|
|
3876
3884
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3877
3885
|
name: i || "file",
|
|
@@ -3883,11 +3891,11 @@ function Uo(e, t) {
|
|
|
3883
3891
|
}).filter(Boolean);
|
|
3884
3892
|
return r.length ? r : void 0;
|
|
3885
3893
|
}
|
|
3886
|
-
function
|
|
3894
|
+
function Go(e, t) {
|
|
3887
3895
|
if (!e || typeof e != "object") return;
|
|
3888
|
-
let n =
|
|
3896
|
+
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) ?? "";
|
|
3889
3897
|
if (!n && !r) return;
|
|
3890
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3898
|
+
let i = r && !String(r).startsWith("http") ? Mo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3891
3899
|
return [{
|
|
3892
3900
|
uid: String(a),
|
|
3893
3901
|
name: n ?? "file",
|
|
@@ -3896,7 +3904,7 @@ function Wo(e, t) {
|
|
|
3896
3904
|
url: i || void 0
|
|
3897
3905
|
}];
|
|
3898
3906
|
}
|
|
3899
|
-
function
|
|
3907
|
+
function Ko(e, t, n, r) {
|
|
3900
3908
|
(e.fields ?? []).forEach((e) => {
|
|
3901
3909
|
e?.verifyAction && [
|
|
3902
3910
|
e.verifyResultField,
|
|
@@ -3909,8 +3917,8 @@ function Go(e, t, n, r) {
|
|
|
3909
3917
|
});
|
|
3910
3918
|
});
|
|
3911
3919
|
}
|
|
3912
|
-
function
|
|
3913
|
-
let t = Array.isArray(e.rows) ?
|
|
3920
|
+
function qo(e) {
|
|
3921
|
+
let t = Array.isArray(e.rows) ? Ro(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3914
3922
|
let i = {};
|
|
3915
3923
|
return (e.fields ?? []).forEach((e) => {
|
|
3916
3924
|
if (!e.field) return;
|
|
@@ -3924,26 +3932,26 @@ function Ko(e) {
|
|
|
3924
3932
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Y(i, e.field, e.defaultValue);
|
|
3925
3933
|
return;
|
|
3926
3934
|
}
|
|
3927
|
-
Y(i, e.field,
|
|
3928
|
-
}),
|
|
3929
|
-
}, i =
|
|
3935
|
+
Y(i, e.field, zo(e.addRow) ? no(e, a) : J(e, a));
|
|
3936
|
+
}), Ko(e, t, i, r), i;
|
|
3937
|
+
}, i = Ha(e, { editing: !0 });
|
|
3930
3938
|
if (t && t.length > 0) {
|
|
3931
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3939
|
+
let e = t.map((e) => r(e, (e, t) => Go(e, t), (e, t) => U(e, t.field)));
|
|
3932
3940
|
for (; e.length < n;) e.push({ ...i });
|
|
3933
3941
|
return e;
|
|
3934
3942
|
}
|
|
3935
|
-
let a = r(e, (e, t) =>
|
|
3943
|
+
let a = r(e, (e, t) => Wo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3936
3944
|
for (; o.length < n;) o.push({ ...i });
|
|
3937
3945
|
return o;
|
|
3938
3946
|
}
|
|
3939
|
-
function
|
|
3947
|
+
function Jo(e, t = []) {
|
|
3940
3948
|
let n = {};
|
|
3941
3949
|
return t.forEach((e) => {
|
|
3942
3950
|
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3943
3951
|
if (!e.field || e.addRow) return;
|
|
3944
3952
|
let t = e.value, r = e.field;
|
|
3945
3953
|
if (e.type === "file") {
|
|
3946
|
-
let i =
|
|
3954
|
+
let i = Wo(t, e);
|
|
3947
3955
|
i && Y(n, r, i);
|
|
3948
3956
|
return;
|
|
3949
3957
|
}
|
|
@@ -3953,12 +3961,12 @@ function qo(e, t = []) {
|
|
|
3953
3961
|
if (i) {
|
|
3954
3962
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3955
3963
|
Y(n, r, e ? [e[0]] : []);
|
|
3956
|
-
} else Y(n, r,
|
|
3964
|
+
} else Y(n, r, ha(e, Array.isArray(t) ? t : [t]));
|
|
3957
3965
|
return;
|
|
3958
3966
|
}
|
|
3959
3967
|
let i = e.splitDialCodeInto;
|
|
3960
3968
|
if (i && typeof t == "string") {
|
|
3961
|
-
let { code: a, rest: o } =
|
|
3969
|
+
let { code: a, rest: o } = _o(t), s = mo(a);
|
|
3962
3970
|
s && Y(n, i, s), Y(n, r, J(e, o || t));
|
|
3963
3971
|
return;
|
|
3964
3972
|
}
|
|
@@ -3968,27 +3976,27 @@ function qo(e, t = []) {
|
|
|
3968
3976
|
}
|
|
3969
3977
|
//#endregion
|
|
3970
3978
|
//#region src/components/form/useAiActions.js
|
|
3971
|
-
function
|
|
3979
|
+
function Yo(e) {
|
|
3972
3980
|
let t = document.createElement("div");
|
|
3973
3981
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3974
3982
|
}
|
|
3975
|
-
function
|
|
3976
|
-
return t && t === "stripHtml" ?
|
|
3983
|
+
function Xo(e, t) {
|
|
3984
|
+
return t && t === "stripHtml" ? Yo(e) : e;
|
|
3977
3985
|
}
|
|
3978
|
-
function
|
|
3986
|
+
function Zo(e) {
|
|
3979
3987
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3980
3988
|
}
|
|
3981
|
-
function
|
|
3989
|
+
function Qo(e) {
|
|
3982
3990
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3983
3991
|
}
|
|
3984
|
-
function
|
|
3992
|
+
function $o(e, t) {
|
|
3985
3993
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3986
|
-
let n =
|
|
3994
|
+
let n = Xo(t, e.transform), r = String(n ?? "").trim();
|
|
3987
3995
|
if (!r) return !1;
|
|
3988
3996
|
let i = Number(e.minWords) || 0;
|
|
3989
|
-
return i > 0 ?
|
|
3997
|
+
return i > 0 ? Zo(r) >= i : !0;
|
|
3990
3998
|
}
|
|
3991
|
-
function
|
|
3999
|
+
function es(e, t) {
|
|
3992
4000
|
let n = e.inputs || [];
|
|
3993
4001
|
if (n.length === 0) return !0;
|
|
3994
4002
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3996,10 +4004,10 @@ function $o(e, t) {
|
|
|
3996
4004
|
let n = e.group || `__solo_${t}`;
|
|
3997
4005
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3998
4006
|
});
|
|
3999
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
4007
|
+
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;
|
|
4000
4008
|
return !0;
|
|
4001
4009
|
}
|
|
4002
|
-
function
|
|
4010
|
+
function ts(e = []) {
|
|
4003
4011
|
let t = [];
|
|
4004
4012
|
return e.forEach((e) => {
|
|
4005
4013
|
if (e?.addRow) {
|
|
@@ -4012,32 +4020,32 @@ function es(e = []) {
|
|
|
4012
4020
|
});
|
|
4013
4021
|
}), t;
|
|
4014
4022
|
}
|
|
4015
|
-
function
|
|
4016
|
-
return
|
|
4023
|
+
function ns(e, t) {
|
|
4024
|
+
return ts(t).some((t) => {
|
|
4017
4025
|
let n = e.getFieldValue(t);
|
|
4018
|
-
return Array.isArray(n) ? n.some(
|
|
4026
|
+
return Array.isArray(n) ? n.some(Qo) : n != null && n !== "";
|
|
4019
4027
|
});
|
|
4020
4028
|
}
|
|
4021
|
-
function
|
|
4029
|
+
function rs(e, t = []) {
|
|
4022
4030
|
let n = e.getFieldsValue(!0) ?? {}, r = new Set([t].flat().filter(Boolean)), i = typeof e.isFieldTouched == "function" ? (t) => e.isFieldTouched(t) : () => !0, a = 0;
|
|
4023
4031
|
return Object.entries(n).forEach(([e, t]) => {
|
|
4024
|
-
if (!(r.has(e) || !i(e) || !
|
|
4032
|
+
if (!(r.has(e) || !i(e) || !is(t))) {
|
|
4025
4033
|
if (Array.isArray(t)) {
|
|
4026
|
-
a += t.filter((e) => e && typeof e == "object" ?
|
|
4034
|
+
a += t.filter((e) => e && typeof e == "object" ? Qo(e) : !!e).length;
|
|
4027
4035
|
return;
|
|
4028
4036
|
}
|
|
4029
4037
|
a += 1;
|
|
4030
4038
|
}
|
|
4031
4039
|
}), a;
|
|
4032
4040
|
}
|
|
4033
|
-
function
|
|
4034
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
4041
|
+
function is(e) {
|
|
4042
|
+
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 !== "");
|
|
4035
4043
|
}
|
|
4036
|
-
function
|
|
4044
|
+
function as(e, t = []) {
|
|
4037
4045
|
let n = e.getFieldsValue(!0) ?? {}, r = new Set([t].flat().filter(Boolean)), i = Object.keys(n).filter((e) => !r.has(e));
|
|
4038
|
-
return typeof e.isFieldTouched == "function" ? i.some((t) => e.isFieldTouched(t) &&
|
|
4046
|
+
return typeof e.isFieldTouched == "function" ? i.some((t) => e.isFieldTouched(t) && is(n[t])) : i.some((e) => is(n[e]));
|
|
4039
4047
|
}
|
|
4040
|
-
function
|
|
4048
|
+
function os(e = []) {
|
|
4041
4049
|
let t = {};
|
|
4042
4050
|
return (e ?? []).forEach((e) => {
|
|
4043
4051
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4048,38 +4056,38 @@ function as(e = []) {
|
|
|
4048
4056
|
});
|
|
4049
4057
|
}), t;
|
|
4050
4058
|
}
|
|
4051
|
-
function
|
|
4059
|
+
function ss(e, t, n) {
|
|
4052
4060
|
let r = e?.confirmWhen ?? "never";
|
|
4053
|
-
return r === "never" ? !1 : r === "always" ||
|
|
4061
|
+
return r === "never" ? !1 : r === "always" || ns(t, n);
|
|
4054
4062
|
}
|
|
4055
|
-
var
|
|
4063
|
+
var cs = [
|
|
4056
4064
|
"top-left",
|
|
4057
4065
|
"top-center",
|
|
4058
4066
|
"top-right",
|
|
4059
4067
|
"bottom-left",
|
|
4060
4068
|
"bottom-center",
|
|
4061
4069
|
"bottom-right"
|
|
4062
|
-
],
|
|
4063
|
-
function
|
|
4070
|
+
], ls = "bottom-left";
|
|
4071
|
+
function us(e = []) {
|
|
4064
4072
|
let t = {};
|
|
4065
4073
|
return e.forEach((e) => {
|
|
4066
|
-
let n =
|
|
4074
|
+
let n = cs.includes(e.position) ? e.position : ls;
|
|
4067
4075
|
(t[n] ??= []).push(e);
|
|
4068
4076
|
}), t;
|
|
4069
4077
|
}
|
|
4070
|
-
function
|
|
4071
|
-
let [a, o] = g(null), [s, c] = g(""), l = b.useWatch((e) => e, e), u = f((e) =>
|
|
4078
|
+
function ds({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
4079
|
+
let [a, o] = g(null), [s, c] = g(""), l = b.useWatch((e) => e, e), u = f((e) => es(e, (e) => (l || {})[e]), [l]), d = f((t) => {
|
|
4072
4080
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
4073
|
-
let n =
|
|
4081
|
+
let n = Jo(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
4074
4082
|
return t.forEach((t) => {
|
|
4075
4083
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
4076
|
-
let n =
|
|
4084
|
+
let n = qo(t);
|
|
4077
4085
|
if (n.length === 0) return;
|
|
4078
4086
|
r = !0;
|
|
4079
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
4087
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Qo);
|
|
4080
4088
|
if (a.length) {
|
|
4081
4089
|
let e = t.label || t.name;
|
|
4082
|
-
|
|
4090
|
+
co({
|
|
4083
4091
|
tone: "overwrite",
|
|
4084
4092
|
title: `Replace what's in ${e}?`,
|
|
4085
4093
|
facts: [
|
|
@@ -4109,9 +4117,9 @@ function us({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4109
4117
|
return {
|
|
4110
4118
|
runAction: f(async (t, a, s, l) => {
|
|
4111
4119
|
let u = s?.confirmWhen ?? "never";
|
|
4112
|
-
if (s?.trigger === "upload" && u !== "never" && (u === "always" ||
|
|
4113
|
-
let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(a?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
4114
|
-
if (!await
|
|
4120
|
+
if (s?.trigger === "upload" && u !== "never" && (u === "always" || as(e, [a?.field]))) {
|
|
4121
|
+
let t = s.confirmMessages ?? {}, n = l?.name || e.getFieldValue(a?.field)?.slice?.(-1)?.[0]?.name, r = rs(e, [a?.field]);
|
|
4122
|
+
if (!await co({
|
|
4115
4123
|
tone: "overwrite",
|
|
4116
4124
|
title: t.title || "Read this file and fill the form in?",
|
|
4117
4125
|
facts: [{
|
|
@@ -4135,12 +4143,12 @@ function us({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4135
4143
|
r && (c[t.param] = r);
|
|
4136
4144
|
} else {
|
|
4137
4145
|
let n = e.getFieldValue(t.sourceField);
|
|
4138
|
-
n != null && n !== "" && (o[t.param] =
|
|
4146
|
+
n != null && n !== "" && (o[t.param] = Xo(n, t.transform));
|
|
4139
4147
|
}
|
|
4140
4148
|
}), (s.inputs || []).forEach((e) => {
|
|
4141
4149
|
!e.group || e.kind !== "text" || (s.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete o[e.param];
|
|
4142
4150
|
});
|
|
4143
|
-
let u = await
|
|
4151
|
+
let u = await uo({
|
|
4144
4152
|
module: n,
|
|
4145
4153
|
group: t,
|
|
4146
4154
|
field: a.field,
|
|
@@ -4148,9 +4156,9 @@ function us({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4148
4156
|
inputs: o,
|
|
4149
4157
|
files: c
|
|
4150
4158
|
}), f = s.label || "AI action", p = u?.groups;
|
|
4151
|
-
if (s?.trigger !== "upload" &&
|
|
4152
|
-
let e = s.confirmMessages ?? {}, t =
|
|
4153
|
-
if (!await
|
|
4159
|
+
if (s?.trigger !== "upload" && ss(s, e, p)) {
|
|
4160
|
+
let e = s.confirmMessages ?? {}, t = ts(p).length;
|
|
4161
|
+
if (!await co({
|
|
4154
4162
|
tone: "overwrite",
|
|
4155
4163
|
title: e.title || `Fill the form in from ${f}?`,
|
|
4156
4164
|
facts: [{
|
|
@@ -4171,7 +4179,7 @@ function us({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4171
4179
|
field: a,
|
|
4172
4180
|
groupName: t,
|
|
4173
4181
|
responseGroups: p,
|
|
4174
|
-
payload:
|
|
4182
|
+
payload: os(p)
|
|
4175
4183
|
});
|
|
4176
4184
|
if (e === !1 || e === "abort") return u;
|
|
4177
4185
|
}
|
|
@@ -4202,7 +4210,7 @@ function us({ form: e, groups: t, module: n, onApplied: r, onParsed: i }) {
|
|
|
4202
4210
|
}
|
|
4203
4211
|
//#endregion
|
|
4204
4212
|
//#region src/components/form/AiActionButtons.jsx
|
|
4205
|
-
function
|
|
4213
|
+
function fs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
4206
4214
|
if (!t || t.length === 0) return null;
|
|
4207
4215
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
4208
4216
|
return /* @__PURE__ */ w(ee, {
|
|
@@ -4223,18 +4231,18 @@ function ds({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
4223
4231
|
}
|
|
4224
4232
|
//#endregion
|
|
4225
4233
|
//#region src/components/form/emailValidator.js
|
|
4226
|
-
function
|
|
4234
|
+
function ps(e) {
|
|
4227
4235
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
4228
4236
|
if (!n) return !1;
|
|
4229
4237
|
let [, r, i] = n;
|
|
4230
4238
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
4231
4239
|
}
|
|
4232
|
-
function
|
|
4233
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
4240
|
+
function ms(e = "Email", t) {
|
|
4241
|
+
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`)) };
|
|
4234
4242
|
}
|
|
4235
4243
|
//#endregion
|
|
4236
4244
|
//#region src/components/form/inputValidator.js
|
|
4237
|
-
var
|
|
4245
|
+
var hs = [
|
|
4238
4246
|
{
|
|
4239
4247
|
label: "Only Numbers",
|
|
4240
4248
|
value: "onlyNumber"
|
|
@@ -4307,7 +4315,7 @@ var ms = [
|
|
|
4307
4315
|
label: "Website URL",
|
|
4308
4316
|
value: "websiteUrl"
|
|
4309
4317
|
}
|
|
4310
|
-
],
|
|
4318
|
+
], gs = {
|
|
4311
4319
|
onlyNumber: /^[0-9]$/,
|
|
4312
4320
|
experience: /^[0-9]$/,
|
|
4313
4321
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -4323,10 +4331,10 @@ var ms = [
|
|
|
4323
4331
|
decimalRange: /^[0-9.]$/,
|
|
4324
4332
|
contactNumber: /^[0-9()\-+\s]$/
|
|
4325
4333
|
};
|
|
4326
|
-
function
|
|
4327
|
-
return
|
|
4334
|
+
function _s(e) {
|
|
4335
|
+
return gs[e] ?? null;
|
|
4328
4336
|
}
|
|
4329
|
-
function
|
|
4337
|
+
function vs(e, t = {}, n = "change") {
|
|
4330
4338
|
if (!t?.type || e == null) return {
|
|
4331
4339
|
cleaned: e ?? "",
|
|
4332
4340
|
error: null
|
|
@@ -4409,7 +4417,7 @@ function _s(e, t = {}, n = "change") {
|
|
|
4409
4417
|
break;
|
|
4410
4418
|
}
|
|
4411
4419
|
case "email":
|
|
4412
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4420
|
+
c = n === "blur" ? r.trim() : r, c && !ps(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
4413
4421
|
break;
|
|
4414
4422
|
case "websiteUrl":
|
|
4415
4423
|
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.`);
|
|
@@ -4421,21 +4429,21 @@ function _s(e, t = {}, n = "change") {
|
|
|
4421
4429
|
error: l
|
|
4422
4430
|
};
|
|
4423
4431
|
}
|
|
4424
|
-
var
|
|
4425
|
-
function
|
|
4432
|
+
var ys = "This value is already present";
|
|
4433
|
+
function bs(e) {
|
|
4426
4434
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
4427
4435
|
}
|
|
4428
|
-
function
|
|
4429
|
-
if (
|
|
4436
|
+
function xs(e) {
|
|
4437
|
+
if (bs(e) !== "unique") return null;
|
|
4430
4438
|
if (typeof e == "string") return {
|
|
4431
|
-
message:
|
|
4439
|
+
message: ys,
|
|
4432
4440
|
normalizer: "trim",
|
|
4433
4441
|
skipBlank: !0,
|
|
4434
4442
|
validateOn: "blur"
|
|
4435
4443
|
};
|
|
4436
4444
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4437
4445
|
return {
|
|
4438
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4446
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ys,
|
|
4439
4447
|
collectionField: t.collectionField ?? "",
|
|
4440
4448
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4441
4449
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4446,20 +4454,20 @@ function bs(e) {
|
|
|
4446
4454
|
].includes(n) ? n : "blur"
|
|
4447
4455
|
};
|
|
4448
4456
|
}
|
|
4449
|
-
function
|
|
4457
|
+
function Ss(e) {
|
|
4450
4458
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4451
4459
|
if (!Array.isArray(t)) return null;
|
|
4452
4460
|
for (let e of t) {
|
|
4453
|
-
let t =
|
|
4461
|
+
let t = xs(e);
|
|
4454
4462
|
if (t) return t;
|
|
4455
4463
|
}
|
|
4456
4464
|
return null;
|
|
4457
4465
|
}
|
|
4458
|
-
function
|
|
4466
|
+
function Cs(e = []) {
|
|
4459
4467
|
let t = [];
|
|
4460
4468
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4461
4469
|
(e?.fields ?? []).forEach((e) => {
|
|
4462
|
-
let n =
|
|
4470
|
+
let n = Ss(e);
|
|
4463
4471
|
!n || !e?.field || t.push({
|
|
4464
4472
|
field: e.field,
|
|
4465
4473
|
label: e.label ?? e.field,
|
|
@@ -4468,10 +4476,10 @@ function Ss(e = []) {
|
|
|
4468
4476
|
});
|
|
4469
4477
|
}), t;
|
|
4470
4478
|
}
|
|
4471
|
-
function
|
|
4479
|
+
function ws(e) {
|
|
4472
4480
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4473
4481
|
}
|
|
4474
|
-
function
|
|
4482
|
+
function Ts(e, t = "trim") {
|
|
4475
4483
|
if (e == null) return "";
|
|
4476
4484
|
let n = String(e);
|
|
4477
4485
|
switch (String(t)) {
|
|
@@ -4483,10 +4491,10 @@ function ws(e, t = "trim") {
|
|
|
4483
4491
|
default: return n.trim();
|
|
4484
4492
|
}
|
|
4485
4493
|
}
|
|
4486
|
-
function
|
|
4487
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4494
|
+
function Es(e, t) {
|
|
4495
|
+
return !(!e || e.skipBlank !== !1 && ws(t));
|
|
4488
4496
|
}
|
|
4489
|
-
function
|
|
4497
|
+
function Ds(e) {
|
|
4490
4498
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4491
4499
|
}
|
|
4492
4500
|
var X = {
|
|
@@ -4496,21 +4504,21 @@ var X = {
|
|
|
4496
4504
|
STALE: "stale",
|
|
4497
4505
|
ERROR: "error"
|
|
4498
4506
|
};
|
|
4499
|
-
function
|
|
4507
|
+
function Os({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4500
4508
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4501
4509
|
}
|
|
4502
|
-
function
|
|
4510
|
+
function ks({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4503
4511
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4504
4512
|
function o(e) {
|
|
4505
4513
|
a = e, typeof t == "function" && t(a);
|
|
4506
4514
|
}
|
|
4507
4515
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4508
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4509
|
-
let p =
|
|
4516
|
+
if (!c || !t || !s || typeof e != "function" || !Es(c, l)) return { status: X.SKIPPED };
|
|
4517
|
+
let p = Os({
|
|
4510
4518
|
module: t,
|
|
4511
4519
|
field: s,
|
|
4512
4520
|
recordId: u,
|
|
4513
|
-
normalized:
|
|
4521
|
+
normalized: Ts(l, c.normalizer)
|
|
4514
4522
|
});
|
|
4515
4523
|
if (n.has(p)) return n.get(p);
|
|
4516
4524
|
i += 1;
|
|
@@ -4528,7 +4536,7 @@ function Os({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4528
4536
|
if (r.get(s) !== m) return { status: X.STALE };
|
|
4529
4537
|
let a = i?.available === !1 ? {
|
|
4530
4538
|
status: X.DUPLICATE,
|
|
4531
|
-
message:
|
|
4539
|
+
message: As(i) || c.message || ys
|
|
4532
4540
|
} : { status: X.AVAILABLE };
|
|
4533
4541
|
return n.set(p, a), a;
|
|
4534
4542
|
} catch (e) {
|
|
@@ -4549,17 +4557,17 @@ function Os({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4549
4557
|
}
|
|
4550
4558
|
};
|
|
4551
4559
|
}
|
|
4552
|
-
function
|
|
4560
|
+
function As(e) {
|
|
4553
4561
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4554
4562
|
}
|
|
4555
|
-
var
|
|
4556
|
-
function
|
|
4557
|
-
let r =
|
|
4563
|
+
var js = "__uniqueRule";
|
|
4564
|
+
function Ms({ field: e, validation: t, context: n }) {
|
|
4565
|
+
let r = xs(t);
|
|
4558
4566
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4559
4567
|
let i = e?.field ?? "";
|
|
4560
4568
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4561
|
-
[
|
|
4562
|
-
validateTrigger:
|
|
4569
|
+
[js]: r,
|
|
4570
|
+
validateTrigger: Ds(r),
|
|
4563
4571
|
validator: async (e, t) => {
|
|
4564
4572
|
let a = await n.checker.check({
|
|
4565
4573
|
module: n.module,
|
|
@@ -4574,22 +4582,22 @@ function js({ field: e, validation: t, context: n }) {
|
|
|
4574
4582
|
}
|
|
4575
4583
|
};
|
|
4576
4584
|
}
|
|
4577
|
-
function
|
|
4585
|
+
function Ns(e = []) {
|
|
4578
4586
|
let t = Array.isArray(e) ? e : [];
|
|
4579
|
-
if (!t.some((e) => e && e[
|
|
4580
|
-
let n = t.filter((e) => e && !e[
|
|
4587
|
+
if (!t.some((e) => e && e[js])) return t;
|
|
4588
|
+
let n = t.filter((e) => e && !e[js]);
|
|
4581
4589
|
return t.map((e) => {
|
|
4582
|
-
if (!e || !e[
|
|
4590
|
+
if (!e || !e[js]) return e;
|
|
4583
4591
|
let t = e.validator;
|
|
4584
4592
|
return {
|
|
4585
4593
|
...e,
|
|
4586
|
-
validator: async (e, r) => await
|
|
4594
|
+
validator: async (e, r) => await Ps(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4587
4595
|
};
|
|
4588
4596
|
});
|
|
4589
4597
|
}
|
|
4590
|
-
async function
|
|
4598
|
+
async function Ps(e = [], t, n = {}) {
|
|
4591
4599
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4592
|
-
if (r.required &&
|
|
4600
|
+
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;
|
|
4593
4601
|
if (typeof r.validator == "function") try {
|
|
4594
4602
|
await r.validator(n, t);
|
|
4595
4603
|
} catch {
|
|
@@ -4598,7 +4606,7 @@ async function Ns(e = [], t, n = {}) {
|
|
|
4598
4606
|
}
|
|
4599
4607
|
return !1;
|
|
4600
4608
|
}
|
|
4601
|
-
function
|
|
4609
|
+
function Fs(e) {
|
|
4602
4610
|
let t = String(e ?? "").trim();
|
|
4603
4611
|
if (!t.startsWith("{")) return null;
|
|
4604
4612
|
try {
|
|
@@ -4607,19 +4615,19 @@ function Ps(e) {
|
|
|
4607
4615
|
return null;
|
|
4608
4616
|
}
|
|
4609
4617
|
}
|
|
4610
|
-
function
|
|
4618
|
+
function Is(e) {
|
|
4611
4619
|
if (!e) return null;
|
|
4612
|
-
if (typeof e == "string") return
|
|
4620
|
+
if (typeof e == "string") return Fs(e);
|
|
4613
4621
|
let t = [
|
|
4614
4622
|
e.data,
|
|
4615
4623
|
e.response,
|
|
4616
4624
|
e,
|
|
4617
|
-
|
|
4625
|
+
Fs(e.message)
|
|
4618
4626
|
];
|
|
4619
4627
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4620
4628
|
return null;
|
|
4621
4629
|
}
|
|
4622
|
-
function
|
|
4630
|
+
function Ls({ field: e, group: t, rowIndex: n }) {
|
|
4623
4631
|
let r = String(e ?? ""), i = Number(n);
|
|
4624
4632
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4625
4633
|
String(t),
|
|
@@ -4627,14 +4635,14 @@ function Is({ field: e, group: t, rowIndex: n }) {
|
|
|
4627
4635
|
...r.split(".")
|
|
4628
4636
|
] : r;
|
|
4629
4637
|
}
|
|
4630
|
-
function
|
|
4631
|
-
let n =
|
|
4638
|
+
function Rs(e, { uniqueRules: t = [] } = {}) {
|
|
4639
|
+
let n = Is(e);
|
|
4632
4640
|
if (n) {
|
|
4633
4641
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4634
4642
|
let t = {
|
|
4635
4643
|
field: e.field,
|
|
4636
|
-
name:
|
|
4637
|
-
message: e.message || n.message ||
|
|
4644
|
+
name: Ls(e),
|
|
4645
|
+
message: e.message || n.message || ys
|
|
4638
4646
|
};
|
|
4639
4647
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4640
4648
|
});
|
|
@@ -4651,7 +4659,7 @@ function Ls(e, { uniqueRules: t = [] } = {}) {
|
|
|
4651
4659
|
}
|
|
4652
4660
|
//#endregion
|
|
4653
4661
|
//#region src/services/uniqueValidationApi.js
|
|
4654
|
-
async function
|
|
4662
|
+
async function zs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4655
4663
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4656
4664
|
let c = {
|
|
4657
4665
|
field: t,
|
|
@@ -4685,7 +4693,7 @@ async function Rs({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4685
4693
|
throw e;
|
|
4686
4694
|
}
|
|
4687
4695
|
}
|
|
4688
|
-
async function
|
|
4696
|
+
async function Bs({ module: e, payload: t, excludeId: n } = {}) {
|
|
4689
4697
|
if (!e || !t) return { duplicate: !1 };
|
|
4690
4698
|
try {
|
|
4691
4699
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4703,7 +4711,7 @@ async function zs({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4703
4711
|
}
|
|
4704
4712
|
//#endregion
|
|
4705
4713
|
//#region src/components/form/uploadAccept.js
|
|
4706
|
-
var
|
|
4714
|
+
var Vs = [
|
|
4707
4715
|
"jpg",
|
|
4708
4716
|
"jpeg",
|
|
4709
4717
|
"png",
|
|
@@ -4712,18 +4720,18 @@ var Bs = [
|
|
|
4712
4720
|
"bmp",
|
|
4713
4721
|
"svg",
|
|
4714
4722
|
"avif"
|
|
4715
|
-
],
|
|
4723
|
+
], Hs = [
|
|
4716
4724
|
"mp4",
|
|
4717
4725
|
"webm",
|
|
4718
4726
|
"ogg",
|
|
4719
4727
|
"ogv",
|
|
4720
4728
|
"mov",
|
|
4721
4729
|
"m4v"
|
|
4722
|
-
],
|
|
4730
|
+
], Us = [
|
|
4723
4731
|
"pdf",
|
|
4724
4732
|
"doc",
|
|
4725
4733
|
"docx"
|
|
4726
|
-
],
|
|
4734
|
+
], Ws = [
|
|
4727
4735
|
{
|
|
4728
4736
|
label: "Any file",
|
|
4729
4737
|
value: "any"
|
|
@@ -4748,45 +4756,45 @@ var Bs = [
|
|
|
4748
4756
|
label: "Images & Videos",
|
|
4749
4757
|
value: "imagesAndVideos"
|
|
4750
4758
|
}
|
|
4751
|
-
],
|
|
4759
|
+
], Gs = {
|
|
4752
4760
|
resume: {
|
|
4753
|
-
exts:
|
|
4761
|
+
exts: Us,
|
|
4754
4762
|
maxSizeMB: 2,
|
|
4755
4763
|
hint: "PDF, DOC or DOCX",
|
|
4756
4764
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4757
4765
|
},
|
|
4758
4766
|
documents: {
|
|
4759
|
-
exts: [...
|
|
4767
|
+
exts: [...Us, ...Vs],
|
|
4760
4768
|
hint: "PDF, DOC or image files",
|
|
4761
4769
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4762
4770
|
},
|
|
4763
4771
|
images: {
|
|
4764
|
-
exts:
|
|
4772
|
+
exts: Vs,
|
|
4765
4773
|
hint: "Image files",
|
|
4766
4774
|
error: "Only image files are allowed"
|
|
4767
4775
|
},
|
|
4768
4776
|
videos: {
|
|
4769
|
-
exts:
|
|
4777
|
+
exts: Hs,
|
|
4770
4778
|
hint: "Video files",
|
|
4771
4779
|
error: "Only video files are allowed"
|
|
4772
4780
|
},
|
|
4773
4781
|
imagesAndVideos: {
|
|
4774
|
-
exts: [...
|
|
4782
|
+
exts: [...Vs, ...Hs],
|
|
4775
4783
|
hint: "Image or video files",
|
|
4776
4784
|
error: "Only image or video files are allowed"
|
|
4777
4785
|
}
|
|
4778
4786
|
};
|
|
4779
|
-
function
|
|
4787
|
+
function Ks(e) {
|
|
4780
4788
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4781
4789
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4782
4790
|
}
|
|
4783
|
-
function
|
|
4791
|
+
function qs(e) {
|
|
4784
4792
|
let t = String(e?.accept ?? "").trim();
|
|
4785
|
-
return t && t !== "any" ?
|
|
4793
|
+
return t && t !== "any" ? Gs[t] ?? null : !t && Ks(e) ? Gs.resume : Gs[t] ?? null;
|
|
4786
4794
|
}
|
|
4787
4795
|
//#endregion
|
|
4788
4796
|
//#region src/components/form/quickActionLabels.js
|
|
4789
|
-
var
|
|
4797
|
+
var Js = /* @__PURE__ */ new Set([
|
|
4790
4798
|
"of",
|
|
4791
4799
|
"and",
|
|
4792
4800
|
"the",
|
|
@@ -4795,7 +4803,7 @@ var qs = /* @__PURE__ */ new Set([
|
|
|
4795
4803
|
"in",
|
|
4796
4804
|
"a",
|
|
4797
4805
|
"an"
|
|
4798
|
-
]),
|
|
4806
|
+
]), Ys = {
|
|
4799
4807
|
addresses: "address",
|
|
4800
4808
|
branches: "branch",
|
|
4801
4809
|
batches: "batch",
|
|
@@ -4806,43 +4814,43 @@ var qs = /* @__PURE__ */ new Set([
|
|
|
4806
4814
|
people: "person",
|
|
4807
4815
|
statuses: "status"
|
|
4808
4816
|
};
|
|
4809
|
-
function
|
|
4817
|
+
function Xs(e) {
|
|
4810
4818
|
let t = String(e ?? "").trim();
|
|
4811
4819
|
if (!t) return "";
|
|
4812
4820
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4813
4821
|
let n = t.toLowerCase();
|
|
4814
|
-
return
|
|
4822
|
+
return Ys[n] ? Ys[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;
|
|
4815
4823
|
}
|
|
4816
|
-
function
|
|
4824
|
+
function Zs(e) {
|
|
4817
4825
|
let t = String(e ?? "").trim();
|
|
4818
4826
|
if (!t) return "";
|
|
4819
4827
|
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);
|
|
4820
4828
|
if (!n.length) return "";
|
|
4821
|
-
let r =
|
|
4829
|
+
let r = Xs(n[n.length - 1]);
|
|
4822
4830
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4823
4831
|
let n = e.toLowerCase();
|
|
4824
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4832
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Js.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4825
4833
|
}).join(" ");
|
|
4826
4834
|
}
|
|
4827
|
-
function
|
|
4835
|
+
function Qs(e, t) {
|
|
4828
4836
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4829
4837
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4830
|
-
let r =
|
|
4838
|
+
let r = Zs(e?.quickCreateModule || t);
|
|
4831
4839
|
return r ? `Add New ${r}` : "Add New";
|
|
4832
4840
|
}
|
|
4833
|
-
function
|
|
4841
|
+
function $s(e, t) {
|
|
4834
4842
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4835
4843
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4836
|
-
let r =
|
|
4844
|
+
let r = Zs(e?.quickEditModule || t);
|
|
4837
4845
|
return r ? `Edit ${r}` : "Edit";
|
|
4838
4846
|
}
|
|
4839
|
-
function
|
|
4840
|
-
let r =
|
|
4841
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4847
|
+
function ec(e, t, n) {
|
|
4848
|
+
let r = Zs((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4849
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : Qs(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : $s(t, n));
|
|
4842
4850
|
}
|
|
4843
4851
|
//#endregion
|
|
4844
4852
|
//#region src/components/AppButton.jsx
|
|
4845
|
-
function
|
|
4853
|
+
function tc({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4846
4854
|
let o = /* @__PURE__ */ w(v, {
|
|
4847
4855
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4848
4856
|
icon: n,
|
|
@@ -4857,13 +4865,13 @@ function ec({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4857
4865
|
}
|
|
4858
4866
|
//#endregion
|
|
4859
4867
|
//#region src/components/detail/userNames.js
|
|
4860
|
-
function
|
|
4868
|
+
function nc(e) {
|
|
4861
4869
|
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 || "";
|
|
4862
4870
|
}
|
|
4863
|
-
function
|
|
4871
|
+
function rc(e) {
|
|
4864
4872
|
let t = {};
|
|
4865
4873
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4866
|
-
let n =
|
|
4874
|
+
let n = nc(e);
|
|
4867
4875
|
n && [
|
|
4868
4876
|
e.legacyUserId,
|
|
4869
4877
|
e.userId,
|
|
@@ -4877,16 +4885,16 @@ function nc(e) {
|
|
|
4877
4885
|
});
|
|
4878
4886
|
}), t;
|
|
4879
4887
|
}
|
|
4880
|
-
var
|
|
4881
|
-
function
|
|
4888
|
+
var ic = /* @__PURE__ */ new Map();
|
|
4889
|
+
function ac(e) {
|
|
4882
4890
|
let t = String(e ?? "").trim();
|
|
4883
4891
|
if (!t) return Promise.resolve("");
|
|
4884
|
-
if (
|
|
4885
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4886
|
-
return
|
|
4892
|
+
if (ic.has(t)) return ic.get(t);
|
|
4893
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => nc(e?.data ?? e ?? null)).catch(() => "");
|
|
4894
|
+
return ic.set(t, n), n;
|
|
4887
4895
|
}
|
|
4888
4896
|
var Z = (e) => e == null ? "" : String(e).trim();
|
|
4889
|
-
function
|
|
4897
|
+
function oc(e) {
|
|
4890
4898
|
let t = e?.quickCreateNotice;
|
|
4891
4899
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4892
4900
|
enabled: !0,
|
|
@@ -4899,7 +4907,7 @@ function ac(e) {
|
|
|
4899
4907
|
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
4900
4908
|
};
|
|
4901
4909
|
}
|
|
4902
|
-
var
|
|
4910
|
+
var sc = [
|
|
4903
4911
|
"clientName",
|
|
4904
4912
|
"companyName",
|
|
4905
4913
|
"name",
|
|
@@ -4909,24 +4917,24 @@ var oc = [
|
|
|
4909
4917
|
"label",
|
|
4910
4918
|
"employerName",
|
|
4911
4919
|
"vendorName"
|
|
4912
|
-
],
|
|
4920
|
+
], cc = (e, t) => {
|
|
4913
4921
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4914
|
-
},
|
|
4915
|
-
function
|
|
4922
|
+
}, lc = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4923
|
+
function uc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4916
4924
|
if (!e || typeof e != "object") return "";
|
|
4917
4925
|
for (let r of [
|
|
4918
4926
|
t,
|
|
4919
4927
|
n,
|
|
4920
|
-
...
|
|
4928
|
+
...sc
|
|
4921
4929
|
]) {
|
|
4922
4930
|
if (!r) continue;
|
|
4923
|
-
let t = cc(
|
|
4931
|
+
let t = lc(cc(e, r));
|
|
4924
4932
|
if (t) return t;
|
|
4925
4933
|
}
|
|
4926
4934
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4927
4935
|
return r ? Z(e[r]) : "";
|
|
4928
4936
|
}
|
|
4929
|
-
function
|
|
4937
|
+
function dc(e) {
|
|
4930
4938
|
if (!e || typeof e != "object") return "";
|
|
4931
4939
|
let t = [
|
|
4932
4940
|
e.createdBy,
|
|
@@ -4948,36 +4956,36 @@ function uc(e) {
|
|
|
4948
4956
|
}
|
|
4949
4957
|
return "";
|
|
4950
4958
|
}
|
|
4951
|
-
function
|
|
4959
|
+
function fc(e = i) {
|
|
4952
4960
|
try {
|
|
4953
|
-
return
|
|
4961
|
+
return nc(e()) || "";
|
|
4954
4962
|
} catch {
|
|
4955
4963
|
return "";
|
|
4956
4964
|
}
|
|
4957
4965
|
}
|
|
4958
|
-
var
|
|
4966
|
+
var pc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4959
4967
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4960
4968
|
return Array.isArray(t) ? t[0] : t;
|
|
4961
4969
|
});
|
|
4962
|
-
async function
|
|
4963
|
-
let { fetchRecord: o =
|
|
4970
|
+
async function mc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4971
|
+
let { fetchRecord: o = pc, fetchUserNameFn: s = ac, getUser: c = i } = a, l = null;
|
|
4964
4972
|
if (e && t) try {
|
|
4965
4973
|
l = await o(e, t);
|
|
4966
4974
|
} catch {
|
|
4967
4975
|
l = null;
|
|
4968
4976
|
}
|
|
4969
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4977
|
+
let u = n?.showRecordName === !1 ? "" : uc(l, {
|
|
4970
4978
|
recordNameField: n?.recordNameField,
|
|
4971
4979
|
displayField: r
|
|
4972
4980
|
}), d = "";
|
|
4973
4981
|
if (n?.showCreator !== !1) {
|
|
4974
|
-
let e =
|
|
4982
|
+
let e = dc(l);
|
|
4975
4983
|
if (e) try {
|
|
4976
4984
|
d = Z(await s(e));
|
|
4977
4985
|
} catch {
|
|
4978
4986
|
d = "";
|
|
4979
4987
|
}
|
|
4980
|
-
d ||=
|
|
4988
|
+
d ||= fc(c);
|
|
4981
4989
|
}
|
|
4982
4990
|
return {
|
|
4983
4991
|
recordName: u,
|
|
@@ -4986,17 +4994,17 @@ async function pc({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
4986
4994
|
}
|
|
4987
4995
|
//#endregion
|
|
4988
4996
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4989
|
-
var
|
|
4990
|
-
function
|
|
4997
|
+
var hc = d(() => import("./index.js").then((e) => e.i)), gc = d(() => import("./index.js").then((e) => e.n)), _c = (e) => e == null || e === "", vc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4998
|
+
function yc(e, t, n, r, i) {
|
|
4991
4999
|
let a = e.quickEditIdFrom;
|
|
4992
5000
|
if (a) {
|
|
4993
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4994
|
-
return
|
|
5001
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...vc(a)] : vc(a), i = t?.getFieldValue?.(e);
|
|
5002
|
+
return _c(i) && (i = r?.[a]), _c(i) ? null : i;
|
|
4995
5003
|
}
|
|
4996
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
5004
|
+
return i && typeof i == "object" ? i.value ?? null : _c(i) ? null : i;
|
|
4997
5005
|
}
|
|
4998
|
-
function
|
|
4999
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ?
|
|
5006
|
+
function bc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
5007
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ? yc(e, t, n, i, a) : null, [
|
|
5000
5008
|
p,
|
|
5001
5009
|
e,
|
|
5002
5010
|
t,
|
|
@@ -5026,12 +5034,12 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5026
5034
|
module: _,
|
|
5027
5035
|
recordId: String(y)
|
|
5028
5036
|
}), C = (t) => {
|
|
5029
|
-
let n =
|
|
5037
|
+
let n = oc(e);
|
|
5030
5038
|
n && (d({
|
|
5031
5039
|
...n,
|
|
5032
5040
|
recordName: "",
|
|
5033
5041
|
creatorName: ""
|
|
5034
|
-
}),
|
|
5042
|
+
}), mc({
|
|
5035
5043
|
module: h,
|
|
5036
5044
|
recordId: t,
|
|
5037
5045
|
notice: n,
|
|
@@ -5061,20 +5069,20 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5061
5069
|
icon: /* @__PURE__ */ w(fe, {}),
|
|
5062
5070
|
onClick: S,
|
|
5063
5071
|
style: { paddingLeft: 0 },
|
|
5064
|
-
children:
|
|
5072
|
+
children: Qs(e, h)
|
|
5065
5073
|
}), p && /* @__PURE__ */ w(v, {
|
|
5066
5074
|
type: "link",
|
|
5067
5075
|
size: "small",
|
|
5068
5076
|
icon: /* @__PURE__ */ w(oe, {}),
|
|
5069
5077
|
onClick: ne,
|
|
5070
5078
|
disabled: !y,
|
|
5071
|
-
title: y ? void 0 : `Choose a ${
|
|
5072
|
-
children:
|
|
5079
|
+
title: y ? void 0 : `Choose a ${Zs(_) || "record"} above first, then edit it here`,
|
|
5080
|
+
children: $s(e, _)
|
|
5073
5081
|
})]
|
|
5074
5082
|
})
|
|
5075
5083
|
}), ie = s ? /* @__PURE__ */ w(x, {
|
|
5076
5084
|
open: !0,
|
|
5077
|
-
title:
|
|
5085
|
+
title: ec(s.mode, e, s.mode === "create" ? h : _),
|
|
5078
5086
|
width: "min(1080px, 96vw)",
|
|
5079
5087
|
footer: null,
|
|
5080
5088
|
destroyOnClose: !0,
|
|
@@ -5092,7 +5100,7 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5092
5100
|
},
|
|
5093
5101
|
children: /* @__PURE__ */ w(te, {})
|
|
5094
5102
|
}),
|
|
5095
|
-
children: s.mode === "create" ? /* @__PURE__ */ w(
|
|
5103
|
+
children: s.mode === "create" ? /* @__PURE__ */ w(hc, {
|
|
5096
5104
|
moduleName: s.module,
|
|
5097
5105
|
embedded: !0,
|
|
5098
5106
|
breadcrumbItems: [],
|
|
@@ -5100,7 +5108,7 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5100
5108
|
onSuccess: (e) => {
|
|
5101
5109
|
b(), C(e), o?.("create", e);
|
|
5102
5110
|
}
|
|
5103
|
-
}) : /* @__PURE__ */ w(
|
|
5111
|
+
}) : /* @__PURE__ */ w(gc, {
|
|
5104
5112
|
moduleName: s.module,
|
|
5105
5113
|
recordId: s.recordId,
|
|
5106
5114
|
embedded: !0,
|
|
@@ -5124,7 +5132,7 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5124
5132
|
width: "min(520px, 94vw)",
|
|
5125
5133
|
maskClosable: !1,
|
|
5126
5134
|
onCancel: () => d(null),
|
|
5127
|
-
footer: /* @__PURE__ */ w(
|
|
5135
|
+
footer: /* @__PURE__ */ w(tc, {
|
|
5128
5136
|
variant: "primary",
|
|
5129
5137
|
type: "primary",
|
|
5130
5138
|
onClick: () => d(null),
|
|
@@ -5161,8 +5169,8 @@ function yc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
5161
5169
|
}
|
|
5162
5170
|
//#endregion
|
|
5163
5171
|
//#region src/components/form/crossFieldRules.js
|
|
5164
|
-
var
|
|
5165
|
-
function
|
|
5172
|
+
var xc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5173
|
+
function Sc(e, t, n) {
|
|
5166
5174
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
5167
5175
|
if (typeof n == "function") {
|
|
5168
5176
|
let e = n(t);
|
|
@@ -5170,23 +5178,23 @@ function xc(e, t, n) {
|
|
|
5170
5178
|
}
|
|
5171
5179
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
5172
5180
|
}
|
|
5173
|
-
function
|
|
5181
|
+
function Cc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
5174
5182
|
let s = n.field ?? n.compareField ?? r;
|
|
5175
5183
|
return { validator: async (n, r) => {
|
|
5176
|
-
if (!s ||
|
|
5177
|
-
let c = i?.getFieldValue?.(
|
|
5178
|
-
if (
|
|
5184
|
+
if (!s || xc(r)) return Promise.resolve();
|
|
5185
|
+
let c = i?.getFieldValue?.(Sc(a, s, o));
|
|
5186
|
+
if (xc(c)) return Promise.resolve();
|
|
5179
5187
|
let l = Number(c), u = Number(r);
|
|
5180
5188
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
5181
5189
|
} };
|
|
5182
5190
|
}
|
|
5183
|
-
function
|
|
5191
|
+
function wc(e = {}, t, n) {
|
|
5184
5192
|
let r = e.field ?? e.compareField ?? e.value;
|
|
5185
|
-
return r ?
|
|
5193
|
+
return r ? Sc(t, r, n) : null;
|
|
5186
5194
|
}
|
|
5187
5195
|
//#endregion
|
|
5188
5196
|
//#region src/components/form/maxCeiling.js
|
|
5189
|
-
function
|
|
5197
|
+
function Tc(e, t) {
|
|
5190
5198
|
let n = String(t).split(".").filter(Boolean);
|
|
5191
5199
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
5192
5200
|
if (n.length > 1) {
|
|
@@ -5199,14 +5207,14 @@ function wc(e, t) {
|
|
|
5199
5207
|
let r = [...e];
|
|
5200
5208
|
return r[r.length - 1] = n[0], r;
|
|
5201
5209
|
}
|
|
5202
|
-
function
|
|
5203
|
-
let r = e?.getFieldValue?.(
|
|
5210
|
+
function Ec(e, t, n) {
|
|
5211
|
+
let r = e?.getFieldValue?.(Tc(t, n));
|
|
5204
5212
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
5205
5213
|
}
|
|
5206
|
-
function
|
|
5214
|
+
function Dc(e) {
|
|
5207
5215
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
5208
5216
|
}
|
|
5209
|
-
function
|
|
5217
|
+
function Oc(e, t) {
|
|
5210
5218
|
for (let n of e ?? []) {
|
|
5211
5219
|
let e = t(n);
|
|
5212
5220
|
if (e == null || e === "") continue;
|
|
@@ -5218,14 +5226,14 @@ function Dc(e, t) {
|
|
|
5218
5226
|
}
|
|
5219
5227
|
return null;
|
|
5220
5228
|
}
|
|
5221
|
-
function
|
|
5229
|
+
function kc({ input: e, compareFields: t, readValue: n }) {
|
|
5222
5230
|
let r = {
|
|
5223
5231
|
ok: !0,
|
|
5224
5232
|
field: null,
|
|
5225
5233
|
maximum: null
|
|
5226
5234
|
};
|
|
5227
5235
|
if (e == null || e === "") return r;
|
|
5228
|
-
let i =
|
|
5236
|
+
let i = Oc(t, n);
|
|
5229
5237
|
if (!i) return r;
|
|
5230
5238
|
let a = Number(e);
|
|
5231
5239
|
return Number.isFinite(a) ? {
|
|
@@ -5236,39 +5244,39 @@ function Oc({ input: e, compareFields: t, readValue: n }) {
|
|
|
5236
5244
|
}
|
|
5237
5245
|
//#endregion
|
|
5238
5246
|
//#region src/components/form/contextPrefill.js
|
|
5239
|
-
var
|
|
5240
|
-
function
|
|
5247
|
+
var Ac = { candidates: ["applicantId"] };
|
|
5248
|
+
function jc(e) {
|
|
5241
5249
|
let t = String(e ?? "").trim();
|
|
5242
5250
|
if (!t) return [];
|
|
5243
5251
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
5244
5252
|
return [.../* @__PURE__ */ new Set([
|
|
5245
5253
|
`${n}Id`,
|
|
5246
5254
|
`${t}Id`,
|
|
5247
|
-
...
|
|
5255
|
+
...Ac[t] ?? []
|
|
5248
5256
|
])];
|
|
5249
5257
|
}
|
|
5250
|
-
function
|
|
5258
|
+
function Mc(e, t) {
|
|
5251
5259
|
if (!t) return "";
|
|
5252
5260
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
5253
|
-
for (let r of
|
|
5261
|
+
for (let r of jc(e)) {
|
|
5254
5262
|
let e = String(n(t[r]) || "");
|
|
5255
5263
|
if (e) return e;
|
|
5256
5264
|
}
|
|
5257
5265
|
return "";
|
|
5258
5266
|
}
|
|
5259
|
-
function
|
|
5267
|
+
function Nc(e, t) {
|
|
5260
5268
|
let n = /* @__PURE__ */ new Set();
|
|
5261
5269
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
5262
5270
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
5263
5271
|
})), [...n];
|
|
5264
5272
|
}
|
|
5265
|
-
function
|
|
5273
|
+
function Pc(e) {
|
|
5266
5274
|
return e?.payloadMode === "skip";
|
|
5267
5275
|
}
|
|
5268
|
-
function
|
|
5276
|
+
function Fc(e) {
|
|
5269
5277
|
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 : [];
|
|
5270
5278
|
}
|
|
5271
|
-
function
|
|
5279
|
+
function Ic(e) {
|
|
5272
5280
|
let t = {};
|
|
5273
5281
|
return (e ?? []).forEach((e) => {
|
|
5274
5282
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -5276,7 +5284,7 @@ function Fc(e) {
|
|
|
5276
5284
|
});
|
|
5277
5285
|
}), t;
|
|
5278
5286
|
}
|
|
5279
|
-
function
|
|
5287
|
+
function Lc(e, t) {
|
|
5280
5288
|
if (!e || !t) return;
|
|
5281
5289
|
let n = e;
|
|
5282
5290
|
for (let e of String(t).split(".")) {
|
|
@@ -5291,7 +5299,7 @@ function Ic(e, t) {
|
|
|
5291
5299
|
}
|
|
5292
5300
|
return n;
|
|
5293
5301
|
}
|
|
5294
|
-
function
|
|
5302
|
+
function Rc(e, t) {
|
|
5295
5303
|
if (!(!e || !t)) for (let n of [
|
|
5296
5304
|
t.prefillFrom,
|
|
5297
5305
|
t.field,
|
|
@@ -5299,13 +5307,13 @@ function Lc(e, t) {
|
|
|
5299
5307
|
]) {
|
|
5300
5308
|
if (!n) continue;
|
|
5301
5309
|
let t = e[n];
|
|
5302
|
-
if (t ??= U(e, n), t ??=
|
|
5310
|
+
if (t ??= U(e, n), t ??= Lc(e, n), t != null) return t;
|
|
5303
5311
|
}
|
|
5304
5312
|
}
|
|
5305
5313
|
//#endregion
|
|
5306
5314
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
5307
|
-
function
|
|
5308
|
-
let a =
|
|
5315
|
+
function zc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
5316
|
+
let a = ra(t), o = b.useWatch(n, e);
|
|
5309
5317
|
if (!a) return null;
|
|
5310
5318
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
5311
5319
|
setTimeout(() => {
|
|
@@ -5316,7 +5324,7 @@ function Rc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5316
5324
|
e.setFieldValue(n, !1), c();
|
|
5317
5325
|
return;
|
|
5318
5326
|
}
|
|
5319
|
-
let i = await
|
|
5327
|
+
let i = await co(ua(t));
|
|
5320
5328
|
e.setFieldValue(n, !!i), c();
|
|
5321
5329
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
5322
5330
|
return /* @__PURE__ */ w(S, {
|
|
@@ -5335,34 +5343,34 @@ function Rc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5335
5343
|
}
|
|
5336
5344
|
//#endregion
|
|
5337
5345
|
//#region src/components/form/prefillWhenRules.js
|
|
5338
|
-
var
|
|
5339
|
-
function
|
|
5346
|
+
var Bc = (e) => String(e ?? "");
|
|
5347
|
+
function Vc(e) {
|
|
5340
5348
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5341
5349
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5342
5350
|
let r = e?.field;
|
|
5343
5351
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
5344
5352
|
}), n;
|
|
5345
5353
|
}
|
|
5346
|
-
function
|
|
5347
|
-
return
|
|
5354
|
+
function Hc(e, t, n, r) {
|
|
5355
|
+
return Vc(e).map((e) => ({
|
|
5348
5356
|
field: e,
|
|
5349
5357
|
path: n(t, e, r)
|
|
5350
5358
|
}));
|
|
5351
5359
|
}
|
|
5352
|
-
function
|
|
5353
|
-
return !e || !e.field ? !1 :
|
|
5360
|
+
function Uc(e, t = {}) {
|
|
5361
|
+
return !e || !e.field ? !1 : Bc(t[e.field]) === Bc(e.value);
|
|
5354
5362
|
}
|
|
5355
|
-
function
|
|
5356
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
5363
|
+
function Wc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
5364
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Uc(e, t));
|
|
5357
5365
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
5358
5366
|
action: "set",
|
|
5359
5367
|
value: o.setValue
|
|
5360
|
-
} : i && r !== void 0 &&
|
|
5368
|
+
} : i && r !== void 0 && Bc(n) === Bc(r) ? { action: "clear" } : { action: "none" };
|
|
5361
5369
|
}
|
|
5362
5370
|
//#endregion
|
|
5363
5371
|
//#region src/components/form/optionConstraints.js
|
|
5364
5372
|
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
5365
|
-
function
|
|
5373
|
+
function Gc(e) {
|
|
5366
5374
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
5367
5375
|
return t.forEach((e) => {
|
|
5368
5376
|
if (e != null && e !== "") {
|
|
@@ -5382,38 +5390,38 @@ function Wc(e) {
|
|
|
5382
5390
|
}
|
|
5383
5391
|
}), n;
|
|
5384
5392
|
}
|
|
5385
|
-
function
|
|
5386
|
-
let n =
|
|
5393
|
+
function Kc(e = [], t) {
|
|
5394
|
+
let n = Gc(t);
|
|
5387
5395
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5388
5396
|
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)));
|
|
5389
5397
|
return i.length > 0 ? i : e;
|
|
5390
5398
|
}
|
|
5391
|
-
function
|
|
5399
|
+
function qc(e) {
|
|
5392
5400
|
let t = [];
|
|
5393
5401
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
5394
5402
|
e != null && e !== "" && t.push(Q(e));
|
|
5395
5403
|
}), t;
|
|
5396
5404
|
}
|
|
5397
|
-
function
|
|
5405
|
+
function Jc(e, t = {}) {
|
|
5398
5406
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5399
5407
|
return n.forEach((e) => {
|
|
5400
5408
|
if (!e || e.clearValue) return;
|
|
5401
|
-
let n =
|
|
5409
|
+
let n = qc(e);
|
|
5402
5410
|
if (!n.length) return;
|
|
5403
|
-
let a =
|
|
5411
|
+
let a = Uc(e, t) ? i : r;
|
|
5404
5412
|
n.forEach((e) => a.add(e));
|
|
5405
5413
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
5406
5414
|
}
|
|
5407
|
-
function
|
|
5408
|
-
let r =
|
|
5415
|
+
function Yc(e = [], t, n) {
|
|
5416
|
+
let r = Jc(t, n);
|
|
5409
5417
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5410
5418
|
let i = new Set(r);
|
|
5411
5419
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
5412
5420
|
}
|
|
5413
5421
|
//#endregion
|
|
5414
5422
|
//#region src/components/form/optionRowFilters.js
|
|
5415
|
-
var
|
|
5416
|
-
function
|
|
5423
|
+
var Xc = 64;
|
|
5424
|
+
function Zc(e) {
|
|
5417
5425
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5418
5426
|
try {
|
|
5419
5427
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5421,34 +5429,34 @@ function Xc(e) {
|
|
|
5421
5429
|
return "";
|
|
5422
5430
|
}
|
|
5423
5431
|
}
|
|
5424
|
-
var
|
|
5425
|
-
function
|
|
5432
|
+
var Qc = (e) => String(e ?? "").trim().toLowerCase(), $c = (e) => e != null && String(e).trim() !== "";
|
|
5433
|
+
function el(e) {
|
|
5426
5434
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5427
|
-
return new Set(t.map(
|
|
5435
|
+
return new Set(t.map(Qc).filter((e) => e !== ""));
|
|
5428
5436
|
}
|
|
5429
|
-
function
|
|
5430
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5437
|
+
function tl(e, t) {
|
|
5438
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => $c(e?.extraData?.[t]));
|
|
5431
5439
|
}
|
|
5432
|
-
function
|
|
5440
|
+
function nl(e, t, n) {
|
|
5433
5441
|
let r = e?.extraData?.[t];
|
|
5434
|
-
if (
|
|
5435
|
-
let i =
|
|
5436
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5442
|
+
if (!$c(n)) return r === !0;
|
|
5443
|
+
let i = el(n);
|
|
5444
|
+
return i.size === 0 ? r === !0 : i.has(Qc(r));
|
|
5437
5445
|
}
|
|
5438
|
-
function
|
|
5446
|
+
function rl(e, t) {
|
|
5439
5447
|
let n = /* @__PURE__ */ new Map();
|
|
5440
5448
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5441
|
-
let r =
|
|
5442
|
-
r && n.set(r,
|
|
5449
|
+
let r = Qc(e?.value);
|
|
5450
|
+
r && n.set(r, Qc(e?.extraData?.[t]));
|
|
5443
5451
|
}), n;
|
|
5444
5452
|
}
|
|
5445
|
-
function
|
|
5446
|
-
let r =
|
|
5453
|
+
function il(e, t, n) {
|
|
5454
|
+
let r = Qc(n);
|
|
5447
5455
|
if (!r) return !1;
|
|
5448
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5456
|
+
let i = /* @__PURE__ */ new Set(), a = Qc(e);
|
|
5449
5457
|
if (!a) return !1;
|
|
5450
5458
|
i.add(a);
|
|
5451
|
-
for (let e = 0; e <
|
|
5459
|
+
for (let e = 0; e < Xc; e += 1) {
|
|
5452
5460
|
let e = t.get(a);
|
|
5453
5461
|
if (!e) return !1;
|
|
5454
5462
|
if (e === r) return !0;
|
|
@@ -5457,63 +5465,63 @@ function rl(e, t, n) {
|
|
|
5457
5465
|
}
|
|
5458
5466
|
return !1;
|
|
5459
5467
|
}
|
|
5460
|
-
function
|
|
5468
|
+
function al(e = {}) {
|
|
5461
5469
|
let t = [], n = (e) => {
|
|
5462
5470
|
let n = String(e ?? "").trim();
|
|
5463
5471
|
n && !t.includes(n) && t.push(n);
|
|
5464
5472
|
};
|
|
5465
5473
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5466
5474
|
}
|
|
5467
|
-
function
|
|
5475
|
+
function ol(e, t = {}, n = {}) {
|
|
5468
5476
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5469
5477
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5470
5478
|
typeof console < "u" && console.warn(e);
|
|
5471
5479
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5472
|
-
s && (
|
|
5480
|
+
s && (tl(o, s) ? o = o.filter((e) => nl(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".`));
|
|
5473
5481
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5474
5482
|
if (c) {
|
|
5475
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5483
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Zc(n);
|
|
5476
5484
|
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.`);
|
|
5477
|
-
else if (!
|
|
5485
|
+
else if (!tl(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".`);
|
|
5478
5486
|
else {
|
|
5479
|
-
let t =
|
|
5480
|
-
o = o.filter((e) =>
|
|
5487
|
+
let t = rl(e, c);
|
|
5488
|
+
o = o.filter((e) => il(e?.value, t, s));
|
|
5481
5489
|
}
|
|
5482
5490
|
}
|
|
5483
5491
|
return o;
|
|
5484
5492
|
}
|
|
5485
5493
|
//#endregion
|
|
5486
5494
|
//#region src/components/form/fieldTooltip.js
|
|
5487
|
-
var
|
|
5488
|
-
function
|
|
5489
|
-
return
|
|
5495
|
+
var sl = (e) => e == null || String(e).trim() === "", cl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5496
|
+
function ll(e) {
|
|
5497
|
+
return sl(e?.tooltip) ? cl(e?.infoEnabled) && !sl(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5490
5498
|
}
|
|
5491
5499
|
//#endregion
|
|
5492
5500
|
//#region src/components/form/dependentLookupReset.js
|
|
5493
|
-
var
|
|
5494
|
-
function
|
|
5495
|
-
return !(!r || e ===
|
|
5501
|
+
var ul = Symbol("parentFilterUnseen"), dl = (e) => e == null || e === "", fl = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5502
|
+
function pl({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5503
|
+
return !(!r || e === ul || fl(e, t) || dl(e) || dl(n));
|
|
5496
5504
|
}
|
|
5497
5505
|
//#endregion
|
|
5498
5506
|
//#region src/utils/roleAllowsAction.js
|
|
5499
|
-
function
|
|
5500
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5507
|
+
function ml(e) {
|
|
5508
|
+
return e == null ? !0 : typeof e == "object" ? ml(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5501
5509
|
}
|
|
5502
|
-
function
|
|
5510
|
+
function hl(e, t) {
|
|
5503
5511
|
if (!e) return !0;
|
|
5504
5512
|
try {
|
|
5505
5513
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
5506
|
-
return
|
|
5514
|
+
return ml((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
5507
5515
|
} catch {
|
|
5508
5516
|
return !0;
|
|
5509
5517
|
}
|
|
5510
5518
|
}
|
|
5511
5519
|
//#endregion
|
|
5512
5520
|
//#region src/utils/afterSubmitNav.js
|
|
5513
|
-
function
|
|
5521
|
+
function gl(e) {
|
|
5514
5522
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5515
5523
|
}
|
|
5516
|
-
function
|
|
5524
|
+
function _l(e, t, n) {
|
|
5517
5525
|
let r = String(e ?? "").trim();
|
|
5518
5526
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5519
5527
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5522,50 +5530,50 @@ function gl(e, t, n) {
|
|
|
5522
5530
|
}
|
|
5523
5531
|
//#endregion
|
|
5524
5532
|
//#region src/utils/backNav.js
|
|
5525
|
-
function
|
|
5533
|
+
function vl(e = typeof window < "u" ? window : void 0) {
|
|
5526
5534
|
let t = e?.history?.state?.idx;
|
|
5527
5535
|
return typeof t == "number" && t > 0;
|
|
5528
5536
|
}
|
|
5529
|
-
function
|
|
5530
|
-
return t && e ? { path: e } :
|
|
5537
|
+
function yl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5538
|
+
return t && e ? { path: e } : vl(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5531
5539
|
}
|
|
5532
|
-
function
|
|
5533
|
-
let n =
|
|
5540
|
+
function bl(e, t = {}) {
|
|
5541
|
+
let n = yl(t);
|
|
5534
5542
|
return n.back ? e(-1) : e(n.path), n;
|
|
5535
5543
|
}
|
|
5536
5544
|
//#endregion
|
|
5537
5545
|
//#region src/components/form/educationRules.js
|
|
5538
|
-
var
|
|
5539
|
-
function
|
|
5546
|
+
var xl = (e) => e == null ? "" : String(e).trim();
|
|
5547
|
+
function Sl(e, t) {
|
|
5540
5548
|
let n = e?.regionRules;
|
|
5541
5549
|
if (!n || typeof n != "object") return e ?? {};
|
|
5542
|
-
let r =
|
|
5550
|
+
let r = xl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5543
5551
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5544
5552
|
...e,
|
|
5545
5553
|
...i
|
|
5546
5554
|
};
|
|
5547
5555
|
}
|
|
5548
|
-
function Sl(e) {
|
|
5549
|
-
return e?.allowInProgress !== !1;
|
|
5550
|
-
}
|
|
5551
5556
|
function Cl(e) {
|
|
5552
|
-
return
|
|
5557
|
+
return e?.allowInProgress !== !1;
|
|
5553
5558
|
}
|
|
5554
5559
|
function wl(e) {
|
|
5555
|
-
return
|
|
5560
|
+
return Cl(e) ? "" : Dl(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.";
|
|
5556
5561
|
}
|
|
5557
5562
|
function Tl(e) {
|
|
5558
|
-
return
|
|
5563
|
+
return Cl(e) ? "allow" : xl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5559
5564
|
}
|
|
5560
5565
|
function El(e) {
|
|
5561
|
-
return
|
|
5566
|
+
return Tl(e) === "block";
|
|
5562
5567
|
}
|
|
5563
5568
|
function Dl(e) {
|
|
5564
|
-
|
|
5565
|
-
|
|
5569
|
+
return Tl(e) === "warn";
|
|
5570
|
+
}
|
|
5571
|
+
function Ol(e) {
|
|
5572
|
+
if (!El(e)) return null;
|
|
5573
|
+
let t = wl(e);
|
|
5566
5574
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5567
5575
|
}
|
|
5568
|
-
function
|
|
5576
|
+
function kl(e, t = {}) {
|
|
5569
5577
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5570
5578
|
for (let t of [n, r]) {
|
|
5571
5579
|
let n = e?.[t];
|
|
@@ -5575,50 +5583,50 @@ function Ol(e, t = {}) {
|
|
|
5575
5583
|
}
|
|
5576
5584
|
return null;
|
|
5577
5585
|
}
|
|
5578
|
-
function
|
|
5586
|
+
function Al(e, t = {}) {
|
|
5579
5587
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5580
5588
|
return !!e?.[n];
|
|
5581
5589
|
}
|
|
5582
|
-
function
|
|
5590
|
+
function jl(e = [], t = {}) {
|
|
5583
5591
|
let n = (t.direction ?? "desc") === "desc";
|
|
5584
5592
|
return e.map((e, n) => ({
|
|
5585
5593
|
index: n,
|
|
5586
|
-
key:
|
|
5587
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5594
|
+
key: kl(e, t),
|
|
5595
|
+
ongoing: t.inProgressFirst !== !1 && Al(e, t)
|
|
5588
5596
|
})).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);
|
|
5589
5597
|
}
|
|
5590
|
-
function
|
|
5598
|
+
function Ml(e, t, n = {}) {
|
|
5591
5599
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5592
|
-
let r =
|
|
5600
|
+
let r = jl(e, n).indexOf(t);
|
|
5593
5601
|
return r === -1 || r === t ? null : {
|
|
5594
5602
|
from: t,
|
|
5595
5603
|
to: r,
|
|
5596
|
-
reason:
|
|
5604
|
+
reason: Al(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5597
5605
|
};
|
|
5598
5606
|
}
|
|
5599
|
-
var
|
|
5607
|
+
var Nl = Object.freeze({
|
|
5600
5608
|
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.",
|
|
5601
5609
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5602
5610
|
ok: "Yes, move it up",
|
|
5603
5611
|
keep: "No, leave it here"
|
|
5604
5612
|
});
|
|
5605
|
-
function
|
|
5613
|
+
function Pl(e, t = {}) {
|
|
5606
5614
|
let n = {
|
|
5607
|
-
...
|
|
5615
|
+
...Nl,
|
|
5608
5616
|
...t.messages ?? {}
|
|
5609
5617
|
};
|
|
5610
5618
|
return n[e] ?? n.outOfOrder;
|
|
5611
5619
|
}
|
|
5612
|
-
function
|
|
5613
|
-
let n = t.levelField ?? "qualification", r =
|
|
5620
|
+
function Fl(e, t = {}) {
|
|
5621
|
+
let n = t.levelField ?? "qualification", r = xl(e?.[n]);
|
|
5614
5622
|
if (!r) return null;
|
|
5615
5623
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5616
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5624
|
+
return Number.isFinite(Number(a)) ? Number(a) : Il(r, t);
|
|
5617
5625
|
}
|
|
5618
|
-
function
|
|
5626
|
+
function Il(e, t) {
|
|
5619
5627
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5620
5628
|
for (let e of n) {
|
|
5621
|
-
let t =
|
|
5629
|
+
let t = xl(e?.match);
|
|
5622
5630
|
if (!t) continue;
|
|
5623
5631
|
let n;
|
|
5624
5632
|
try {
|
|
@@ -5630,14 +5638,14 @@ function Fl(e, t) {
|
|
|
5630
5638
|
}
|
|
5631
5639
|
return null;
|
|
5632
5640
|
}
|
|
5633
|
-
function
|
|
5634
|
-
return
|
|
5641
|
+
function Ll(e, t = {}) {
|
|
5642
|
+
return xl((t?.levelLabels ?? {})[e]) || xl(e);
|
|
5635
5643
|
}
|
|
5636
|
-
function
|
|
5644
|
+
function Rl(e = [], t = {}) {
|
|
5637
5645
|
if (!t || t.requireBelow === !1) return [];
|
|
5638
5646
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5639
5647
|
if (!r.length) return [];
|
|
5640
|
-
let i = e.map((e) =>
|
|
5648
|
+
let i = e.map((e) => Fl(e, t)).filter((e) => e !== null);
|
|
5641
5649
|
if (!i.length) return [];
|
|
5642
5650
|
let a = Math.max(...i), o = [];
|
|
5643
5651
|
return r.forEach((e) => {
|
|
@@ -5645,43 +5653,43 @@ function Ll(e = [], t = {}) {
|
|
|
5645
5653
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5646
5654
|
}), o;
|
|
5647
5655
|
}
|
|
5648
|
-
function
|
|
5649
|
-
let n =
|
|
5656
|
+
function zl(e, t = {}) {
|
|
5657
|
+
let n = Rl(e, t);
|
|
5650
5658
|
if (!n.length) return "";
|
|
5651
|
-
let r = n.map((e) =>
|
|
5659
|
+
let r = n.map((e) => Ll(e, t)).join(", ");
|
|
5652
5660
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5653
5661
|
}
|
|
5654
|
-
async function
|
|
5662
|
+
async function Bl({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5655
5663
|
let a = e?.orderBy;
|
|
5656
5664
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5657
|
-
let o =
|
|
5665
|
+
let o = Ml(t, n, a);
|
|
5658
5666
|
if (!o) return !1;
|
|
5659
5667
|
let s = {
|
|
5660
|
-
...
|
|
5668
|
+
...Nl,
|
|
5661
5669
|
...a.messages ?? {}
|
|
5662
5670
|
};
|
|
5663
5671
|
return await i({
|
|
5664
5672
|
reason: o.reason,
|
|
5665
5673
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5666
|
-
body:
|
|
5674
|
+
body: Pl(o.reason, a),
|
|
5667
5675
|
okText: s.ok,
|
|
5668
5676
|
cancelText: s.keep,
|
|
5669
5677
|
from: o.from,
|
|
5670
5678
|
to: o.to
|
|
5671
5679
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5672
5680
|
}
|
|
5673
|
-
function
|
|
5674
|
-
let n =
|
|
5681
|
+
function Vl(e, t) {
|
|
5682
|
+
let n = Sl(e, t), r = n?.orderBy?.inProgressField;
|
|
5675
5683
|
return r ? {
|
|
5676
5684
|
name: n.name,
|
|
5677
5685
|
label: n.label ?? n.name,
|
|
5678
5686
|
rowsKey: n.payloadKey || n.name,
|
|
5679
5687
|
inProgressField: r,
|
|
5680
|
-
severity:
|
|
5681
|
-
message:
|
|
5688
|
+
severity: Tl(n),
|
|
5689
|
+
message: wl(n)
|
|
5682
5690
|
} : null;
|
|
5683
5691
|
}
|
|
5684
|
-
function
|
|
5692
|
+
function Hl(e = [], t, n) {
|
|
5685
5693
|
if (!n) return {
|
|
5686
5694
|
severity: "allow",
|
|
5687
5695
|
message: "",
|
|
@@ -5689,8 +5697,8 @@ function Vl(e = [], t, n) {
|
|
|
5689
5697
|
};
|
|
5690
5698
|
let r = null;
|
|
5691
5699
|
for (let i of e) {
|
|
5692
|
-
let e =
|
|
5693
|
-
if (!(!e || e.severity === "allow") &&
|
|
5700
|
+
let e = Vl(i, t);
|
|
5701
|
+
if (!(!e || e.severity === "allow") && Ul(n, e.rowsKey).some((t) => Al(t, e))) {
|
|
5694
5702
|
if (e.severity === "block") return {
|
|
5695
5703
|
severity: "block",
|
|
5696
5704
|
message: e.message,
|
|
@@ -5709,23 +5717,23 @@ function Vl(e = [], t, n) {
|
|
|
5709
5717
|
group: null
|
|
5710
5718
|
};
|
|
5711
5719
|
}
|
|
5712
|
-
function
|
|
5720
|
+
function Ul(e, t) {
|
|
5713
5721
|
let n = e?.[t];
|
|
5714
5722
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5715
5723
|
}
|
|
5716
|
-
function
|
|
5724
|
+
function Wl(e) {
|
|
5717
5725
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5718
5726
|
}
|
|
5719
|
-
function
|
|
5727
|
+
function Gl(e = [], t = {}) {
|
|
5720
5728
|
let n = null;
|
|
5721
5729
|
for (let r of e) {
|
|
5722
5730
|
let e = r?.levelRule;
|
|
5723
5731
|
if (!e) continue;
|
|
5724
|
-
let i =
|
|
5732
|
+
let i = Kl(t, r);
|
|
5725
5733
|
if (!i.length) continue;
|
|
5726
|
-
let a =
|
|
5734
|
+
let a = zl(i, e);
|
|
5727
5735
|
if (a) {
|
|
5728
|
-
if (
|
|
5736
|
+
if (Wl(e) === "block") return {
|
|
5729
5737
|
severity: "block",
|
|
5730
5738
|
message: a,
|
|
5731
5739
|
group: r
|
|
@@ -5743,7 +5751,7 @@ function Wl(e = [], t = {}) {
|
|
|
5743
5751
|
group: null
|
|
5744
5752
|
};
|
|
5745
5753
|
}
|
|
5746
|
-
function
|
|
5754
|
+
function Kl(e, t) {
|
|
5747
5755
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5748
5756
|
if (!n) continue;
|
|
5749
5757
|
let t = e?.[n];
|
|
@@ -5753,10 +5761,10 @@ function Gl(e, t) {
|
|
|
5753
5761
|
}
|
|
5754
5762
|
//#endregion
|
|
5755
5763
|
//#region src/components/form/clearGroupOnChange.js
|
|
5756
|
-
function
|
|
5764
|
+
function ql(e, t) {
|
|
5757
5765
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5758
5766
|
}
|
|
5759
|
-
function
|
|
5767
|
+
function Jl(e, t) {
|
|
5760
5768
|
let n = e?.field, r = [];
|
|
5761
5769
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5762
5770
|
e && e !== n && r.push(e);
|
|
@@ -5766,24 +5774,24 @@ function ql(e, t) {
|
|
|
5766
5774
|
e && e !== n && r.push(e);
|
|
5767
5775
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5768
5776
|
}
|
|
5769
|
-
function
|
|
5770
|
-
let i =
|
|
5777
|
+
function Yl(e, t, n, r) {
|
|
5778
|
+
let i = Jl(t, r).map((e) => ql(n, e));
|
|
5771
5779
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5772
5780
|
}
|
|
5773
5781
|
//#endregion
|
|
5774
5782
|
//#region src/components/form/resolveStoredOptions.js
|
|
5775
|
-
function
|
|
5783
|
+
function Xl(e) {
|
|
5776
5784
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5777
5785
|
}
|
|
5778
|
-
function
|
|
5786
|
+
function Zl(e, t = []) {
|
|
5779
5787
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5780
|
-
for (let t of
|
|
5788
|
+
for (let t of Xl(e)) {
|
|
5781
5789
|
let e = String(t);
|
|
5782
5790
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5783
5791
|
}
|
|
5784
5792
|
return r;
|
|
5785
5793
|
}
|
|
5786
|
-
async function
|
|
5794
|
+
async function Ql(e, t) {
|
|
5787
5795
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5788
5796
|
let n = new URLSearchParams({
|
|
5789
5797
|
collection: e.lookupCollection,
|
|
@@ -5795,7 +5803,7 @@ async function Zl(e, t) {
|
|
|
5795
5803
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5796
5804
|
return Array.isArray(i) ? i : [];
|
|
5797
5805
|
}
|
|
5798
|
-
function
|
|
5806
|
+
function $l(e = [], t = []) {
|
|
5799
5807
|
if (!t.length) return e;
|
|
5800
5808
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5801
5809
|
...e,
|
|
@@ -5805,8 +5813,8 @@ function Ql(e = [], t = []) {
|
|
|
5805
5813
|
}
|
|
5806
5814
|
//#endregion
|
|
5807
5815
|
//#region src/components/form/dateRules.js
|
|
5808
|
-
var
|
|
5809
|
-
function
|
|
5816
|
+
var eu = (e) => e == null || e === "";
|
|
5817
|
+
function tu(e) {
|
|
5810
5818
|
if (!e) return null;
|
|
5811
5819
|
if (typeof e.valueOf == "function") {
|
|
5812
5820
|
let t = e.valueOf();
|
|
@@ -5820,12 +5828,12 @@ function $(e) {
|
|
|
5820
5828
|
let t = E(e);
|
|
5821
5829
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5822
5830
|
}
|
|
5823
|
-
function
|
|
5831
|
+
function nu(e) {
|
|
5824
5832
|
if (!e) return null;
|
|
5825
5833
|
let t = E(e);
|
|
5826
5834
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5827
5835
|
}
|
|
5828
|
-
var
|
|
5836
|
+
var ru = {
|
|
5829
5837
|
d: "day",
|
|
5830
5838
|
day: "day",
|
|
5831
5839
|
days: "day",
|
|
@@ -5841,13 +5849,13 @@ var nu = {
|
|
|
5841
5849
|
year: "year",
|
|
5842
5850
|
years: "year"
|
|
5843
5851
|
};
|
|
5844
|
-
function
|
|
5852
|
+
function iu(e) {
|
|
5845
5853
|
if (e == null || e === "") return null;
|
|
5846
5854
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5847
5855
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5848
5856
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5849
5857
|
value: t,
|
|
5850
|
-
unit:
|
|
5858
|
+
unit: ru[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5851
5859
|
};
|
|
5852
5860
|
}
|
|
5853
5861
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5857,49 +5865,49 @@ function ru(e) {
|
|
|
5857
5865
|
let r = Number(n[1]);
|
|
5858
5866
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5859
5867
|
value: r,
|
|
5860
|
-
unit:
|
|
5868
|
+
unit: ru[n[2]] ?? "month"
|
|
5861
5869
|
};
|
|
5862
5870
|
}
|
|
5863
|
-
function
|
|
5871
|
+
function au(e, t) {
|
|
5864
5872
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5865
5873
|
if (n && typeof t == "function") {
|
|
5866
|
-
let e =
|
|
5874
|
+
let e = iu(t(n));
|
|
5867
5875
|
if (e) return e;
|
|
5868
5876
|
}
|
|
5869
|
-
return
|
|
5877
|
+
return iu(e?.minGap);
|
|
5870
5878
|
}
|
|
5871
|
-
function
|
|
5879
|
+
function ou(e, t, n, r) {
|
|
5872
5880
|
if (t === null) return null;
|
|
5873
|
-
let i =
|
|
5881
|
+
let i = au(n, r), a = E(t);
|
|
5874
5882
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5875
5883
|
}
|
|
5876
|
-
function
|
|
5884
|
+
function su(e, t, n, r, i) {
|
|
5877
5885
|
if (t === null || n === null) return !1;
|
|
5878
|
-
let a =
|
|
5886
|
+
let a = ou(e, n, r, i);
|
|
5879
5887
|
if (a === null) return !1;
|
|
5880
|
-
let o = !!r?.strict && !
|
|
5888
|
+
let o = !!r?.strict && !au(r, i);
|
|
5881
5889
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5882
5890
|
}
|
|
5883
|
-
function
|
|
5891
|
+
function cu(e, t, n, r) {
|
|
5884
5892
|
if (n?.message) return n.message;
|
|
5885
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5893
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = au(n, r);
|
|
5886
5894
|
if (a) {
|
|
5887
5895
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5888
5896
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5889
5897
|
}
|
|
5890
5898
|
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}`;
|
|
5891
5899
|
}
|
|
5892
|
-
function
|
|
5900
|
+
function lu({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5893
5901
|
return { validator: async (i, a) => {
|
|
5894
5902
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5895
|
-
if (!o ||
|
|
5903
|
+
if (!o || eu(a)) return Promise.resolve();
|
|
5896
5904
|
let s = r(o);
|
|
5897
|
-
if (
|
|
5905
|
+
if (eu(s)) return Promise.resolve();
|
|
5898
5906
|
let c = $(a), l = $(s);
|
|
5899
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5907
|
+
return c === null || l === null ? Promise.resolve() : su(e, c, l, n, r) ? Promise.reject(Error(cu(e, t, n, r))) : Promise.resolve();
|
|
5900
5908
|
} };
|
|
5901
5909
|
}
|
|
5902
|
-
function
|
|
5910
|
+
function uu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5903
5911
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5904
5912
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5905
5913
|
if (o) {
|
|
@@ -5913,11 +5921,11 @@ function lu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5913
5921
|
}
|
|
5914
5922
|
return !1;
|
|
5915
5923
|
}
|
|
5916
|
-
function
|
|
5924
|
+
function du(e, t = "above") {
|
|
5917
5925
|
let n = e?.messages ?? {};
|
|
5918
5926
|
return t === "below" ? n.below || "This starts before the entry below it finished. Entries are listed newest first, so they cannot overlap." : n.above || "This overlaps the entry above it. Entries are listed newest first, so this one must finish before that one started.";
|
|
5919
5927
|
}
|
|
5920
|
-
function
|
|
5928
|
+
function fu({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = tr }) {
|
|
5921
5929
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5922
5930
|
for (let e of a) {
|
|
5923
5931
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5931,16 +5939,16 @@ function du({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = tr }) {
|
|
|
5931
5939
|
o.push((i) => {
|
|
5932
5940
|
if (!i) return !1;
|
|
5933
5941
|
let a = t(e);
|
|
5934
|
-
return
|
|
5942
|
+
return !eu(a) && su(r, $(i), $(a), n, t);
|
|
5935
5943
|
});
|
|
5936
5944
|
}
|
|
5937
5945
|
}
|
|
5938
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5946
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? uu($(t), e.rowHierarchy, {
|
|
5939
5947
|
rows: n,
|
|
5940
5948
|
rowIndex: r
|
|
5941
5949
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5942
5950
|
}
|
|
5943
|
-
function
|
|
5951
|
+
function pu(e, t = tr) {
|
|
5944
5952
|
let n = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5945
5953
|
for (let e of n) {
|
|
5946
5954
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5948,44 +5956,44 @@ function fu(e, t = tr) {
|
|
|
5948
5956
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5949
5957
|
}
|
|
5950
5958
|
}
|
|
5951
|
-
function
|
|
5959
|
+
function mu({ field: e, rows: t, rowIndex: n }) {
|
|
5952
5960
|
let r = e?.rowHierarchy;
|
|
5953
5961
|
return { validator: async (e, i) => {
|
|
5954
|
-
if (!r ||
|
|
5962
|
+
if (!r || eu(i) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5955
5963
|
let a = $(i);
|
|
5956
|
-
if (a === null || !
|
|
5964
|
+
if (a === null || !uu(a, r, {
|
|
5957
5965
|
rows: t,
|
|
5958
5966
|
rowIndex: n
|
|
5959
5967
|
})) return Promise.resolve();
|
|
5960
5968
|
let o = r.startField ?? "startDate", s = t[n - 1], c = s ? $(s[o]) : null, l = c !== null && a >= c ? "above" : "below";
|
|
5961
|
-
return Promise.reject(Error(
|
|
5969
|
+
return Promise.reject(Error(du(r, l)));
|
|
5962
5970
|
} };
|
|
5963
5971
|
}
|
|
5964
5972
|
//#endregion
|
|
5965
5973
|
//#region src/utils/submitMessages.js
|
|
5966
|
-
function
|
|
5974
|
+
function hu(e) {
|
|
5967
5975
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5968
5976
|
}
|
|
5969
|
-
function
|
|
5977
|
+
function gu(e) {
|
|
5970
5978
|
let t = String(e ?? "").trim();
|
|
5971
5979
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5972
5980
|
}
|
|
5973
|
-
function
|
|
5974
|
-
return String(e).replaceAll("${module}",
|
|
5981
|
+
function _u(e, t) {
|
|
5982
|
+
return String(e).replaceAll("${module}", gu(t)).replaceAll("${moduleName}", gu(t));
|
|
5975
5983
|
}
|
|
5976
|
-
function
|
|
5977
|
-
let r =
|
|
5984
|
+
function vu(e, t, n) {
|
|
5985
|
+
let r = hu(e);
|
|
5978
5986
|
if (r?.suppress) return null;
|
|
5979
5987
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5980
|
-
return i && String(i).trim() ?
|
|
5988
|
+
return i && String(i).trim() ? _u(i, t) : n === "edit" ? `${gu(t)} has Updated successfully` : `${gu(t)} has added successfully`;
|
|
5981
5989
|
}
|
|
5982
|
-
function
|
|
5983
|
-
let i =
|
|
5984
|
-
return a && String(a).trim() ?
|
|
5990
|
+
function yu(e, t, n, r) {
|
|
5991
|
+
let i = hu(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5992
|
+
return a && String(a).trim() ? _u(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${gu(t)}` : `Failed to create ${gu(t)}`;
|
|
5985
5993
|
}
|
|
5986
5994
|
//#endregion
|
|
5987
5995
|
//#region src/utils/scrollToFirstFormError.js
|
|
5988
|
-
function
|
|
5996
|
+
function bu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5989
5997
|
if (!e?.length) return;
|
|
5990
5998
|
let r = e[0]?.name;
|
|
5991
5999
|
setTimeout(() => {
|
|
@@ -6010,10 +6018,10 @@ function yu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
6010
6018
|
}
|
|
6011
6019
|
//#endregion
|
|
6012
6020
|
//#region src/components/form/conditionalFieldLabel.js
|
|
6013
|
-
function
|
|
6021
|
+
function xu(e) {
|
|
6014
6022
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
6015
6023
|
}
|
|
6016
|
-
function
|
|
6024
|
+
function Su(e, t) {
|
|
6017
6025
|
if (!e?.field) return !1;
|
|
6018
6026
|
switch (e.operator ?? "eq") {
|
|
6019
6027
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -6021,38 +6029,58 @@ function xu(e, t) {
|
|
|
6021
6029
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
6022
6030
|
case "falsy": return t == null || t === "" || t === !1;
|
|
6023
6031
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
6024
|
-
case "in": return
|
|
6025
|
-
case "notIn": return !
|
|
6032
|
+
case "in": return xu(e.value).includes(String(t ?? ""));
|
|
6033
|
+
case "notIn": return !xu(e.value).includes(String(t ?? ""));
|
|
6026
6034
|
default: return !1;
|
|
6027
6035
|
}
|
|
6028
6036
|
}
|
|
6029
|
-
function
|
|
6037
|
+
function Cu(e, t, n = !1) {
|
|
6030
6038
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
6031
|
-
return
|
|
6039
|
+
return Su(i, t) && i?.label ? i.label : r;
|
|
6032
6040
|
}
|
|
6033
|
-
function
|
|
6041
|
+
function wu(e) {
|
|
6034
6042
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
6035
6043
|
}
|
|
6036
|
-
function
|
|
6037
|
-
let n =
|
|
6044
|
+
function Tu(e, t) {
|
|
6045
|
+
let n = wu(e);
|
|
6038
6046
|
if (!n.length) return !0;
|
|
6039
|
-
let r = n.map((e) =>
|
|
6047
|
+
let r = n.map((e) => Su(e, t(e.field)));
|
|
6040
6048
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
6041
6049
|
}
|
|
6042
|
-
function
|
|
6050
|
+
function Eu(e) {
|
|
6043
6051
|
let t = e?.colWhen;
|
|
6044
6052
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
6045
6053
|
}
|
|
6046
|
-
function
|
|
6047
|
-
for (let t of
|
|
6054
|
+
function Du(e, t, n) {
|
|
6055
|
+
for (let t of Eu(e)) if (Su(t, n(t))) return Number(t.col);
|
|
6048
6056
|
return t;
|
|
6049
6057
|
}
|
|
6050
|
-
function
|
|
6058
|
+
function Ou(e, t) {
|
|
6051
6059
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
6052
6060
|
}
|
|
6053
6061
|
//#endregion
|
|
6062
|
+
//#region src/components/form/conditionalRequired.js
|
|
6063
|
+
function ku(e, t) {
|
|
6064
|
+
return (n) => {
|
|
6065
|
+
if (!e || !n) return;
|
|
6066
|
+
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
6067
|
+
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
6068
|
+
};
|
|
6069
|
+
}
|
|
6070
|
+
function Au(e, t, n) {
|
|
6071
|
+
let r = e?.requiredWhen;
|
|
6072
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Tu(r, ku(t, n));
|
|
6073
|
+
}
|
|
6074
|
+
function ju(e, t, n) {
|
|
6075
|
+
return { validator: (r, i) => {
|
|
6076
|
+
if (!Au(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
6077
|
+
let a = e?.label ?? e?.field ?? "This field";
|
|
6078
|
+
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
6079
|
+
} };
|
|
6080
|
+
}
|
|
6081
|
+
//#endregion
|
|
6054
6082
|
//#region src/components/Breadcrumb.jsx
|
|
6055
|
-
function
|
|
6083
|
+
function Mu({ items: e = [] }) {
|
|
6056
6084
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(Dr, {
|
|
6057
6085
|
variant: "body",
|
|
6058
6086
|
weight: "medium",
|
|
@@ -6070,32 +6098,51 @@ function Ou({ items: e = [] }) {
|
|
|
6070
6098
|
}
|
|
6071
6099
|
//#endregion
|
|
6072
6100
|
//#region src/components/form/canonicalOption.js
|
|
6073
|
-
var
|
|
6074
|
-
function
|
|
6101
|
+
var Nu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
6102
|
+
function Pu(e = []) {
|
|
6075
6103
|
let t = /* @__PURE__ */ new Map();
|
|
6076
6104
|
for (let n of e) {
|
|
6077
6105
|
if (n == null) continue;
|
|
6078
6106
|
let e = typeof n == "object" ? n.value : n;
|
|
6079
6107
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
6080
|
-
let n =
|
|
6108
|
+
let n = Nu(r);
|
|
6081
6109
|
n && !t.has(n) && t.set(n, e);
|
|
6082
6110
|
}
|
|
6083
6111
|
}
|
|
6084
6112
|
return t;
|
|
6085
6113
|
}
|
|
6086
|
-
function
|
|
6114
|
+
function Fu(e, t) {
|
|
6087
6115
|
if (!Array.isArray(e)) {
|
|
6088
|
-
let n =
|
|
6116
|
+
let n = Fu([e], t);
|
|
6089
6117
|
return n.length ? n[0] : e;
|
|
6090
6118
|
}
|
|
6091
|
-
let n =
|
|
6119
|
+
let n = Pu(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
6092
6120
|
for (let t of e) {
|
|
6093
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
6121
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Nu(e)) ?? e, o = Nu(a);
|
|
6094
6122
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
6095
6123
|
}
|
|
6096
6124
|
return i;
|
|
6097
6125
|
}
|
|
6098
6126
|
//#endregion
|
|
6099
|
-
|
|
6127
|
+
//#region src/components/form/dependencyBusy.js
|
|
6128
|
+
function Iu(e, t = []) {
|
|
6129
|
+
if (!e) return [];
|
|
6130
|
+
let n = /* @__PURE__ */ new Set();
|
|
6131
|
+
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
6132
|
+
if (t.field === e) for (let e of t.autofillFrom ?? []) e?.targetField && n.add(e.targetField);
|
|
6133
|
+
t.lookupFilterValueFrom === e && n.add(t.field);
|
|
6134
|
+
for (let r of t.prefillWhen ?? []) r?.field === e && n.add(t.field);
|
|
6135
|
+
}
|
|
6136
|
+
return n.delete(e), [...n];
|
|
6137
|
+
}
|
|
6138
|
+
function Lu(e, t = []) {
|
|
6139
|
+
return e?.blockWhileResolving ? Iu(e.field, t).length > 0 : !1;
|
|
6140
|
+
}
|
|
6141
|
+
function Ru(e) {
|
|
6142
|
+
let t = String(e?.label ?? "").trim();
|
|
6143
|
+
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
6144
|
+
}
|
|
6145
|
+
//#endregion
|
|
6146
|
+
export { Mc as $, ot as $n, Nn as $r, Xa as $t, El as A, un as Ai, gi as An, St as Ar, _s as At, hl as B, or as Bn, an as Br, xo as Bt, Ql as C, tn as Ci, Di as Cn, jt as Cr, Ns as Ct, Ol as D, Ft as Di, xi as Dn, dn as Dr, Rs as Dt, Yl as E, Fn as Ei, Si as En, pn as Er, ks as Et, Sl as F, Dr as Fn, Xt as Fr, ds as Ft, al as G, ir as Gn, qe as Gr, ho as Gt, pl as H, pr as Hn, mn as Hr, So as Ht, bl as I, R as In, wt as Ir, Jo as It, Vc as J, Yn as Jn, Gt as Jr, lo as Jt, Kc as K, Hn as Kn, cn as Kr, yo as Kt, gl as L, L as Ln, Ct as Lr, qo as Lt, Hl as M, oi as Mn, Dn as Mr, ps as Mt, Gl as N, ai as Nn, ct as Nr, fs as Nt, Vl as O, qt as Oi, mi as On, Ke as Or, hs as Ot, Bl as P, Nr as Pn, ft as Pr, us as Pt, Nc as Q, Jn as Qn, wn as Qr, J as Qt, _l as R, tr as Rn, Ot as Rr, Vo as Rt, nu as S, Bn as Si, Ni as Sn, ht as Sr, zs as St, Zl as T, Tn as Ti, Ci as Tn, Jt as Tr, Cs as Tt, ll as U, nr as Un, Rn as Ur, Mo as Ut, ul as V, I as Vn, vn as Vr, bo as Vt, ol as W, ur as Wn, Ve as Wr, Io as Wt, Wc as X, Zn as Xn, Lt as Xr, ao as Xt, Hc as Y, F as Yn, N as Yr, io as Yt, zc as Z, Gn as Zn, Rt as Zr, oo as Zt, fu as _, Dt as _i, Fi as _n, In as _r, Qs as _t, Au as a, at as ai, Ha as an, zn as ar, kc as at, pu as b, bn as bi, Ei as bn, et as br, qs as bt, Ou as c, lt as ci, Fa as cn, it as cr, Tc as ct, Tu as d, Ge as di, la as dn, Et as dr, Sc as dt, zt as ei, no as en, kt as er, Fc as et, Du as f, ln as fi, Ji as fn, xn as fr, bc as ft, vu as g, vt as gi, Li as gn, We as gr, Zs as gt, yu as h, Yt as hi, Ii as hn, nn as hr, tc as ht, Mu as i, sn as ii, Ga as in, hn as ir, Lc as it, wl as j, si as jn, fn as jr, ms as jt, Cl as k, Zt as ki, hi as kn, bt as kr, vs as kt, Su as l, pt as li, ra as ln, _t as lr, wc as lt, bu as m, Kt as mi, Qi as mn, Vn as mr, rc as mt, Lu as n, He as ni, Ea as nn, On as nr, Pc as nt, ju as o, gt as oi, to as on, en as or, Dc as ot, wu as p, Ue as pi, $i as pn, _n as pr, ac as pt, Yc as q, Xn as qn, tt as qr, co as qt, Fu as r, on as ri, U as rn, yn as rr, Rc as rt, Eu as s, xt as si, Ia as sn, Pn as sr, Ec as st, Ru as t, $t as ti, Ya as tn, nt as tr, Ic as tt, Cu as u, Tt as ui, sa as un, An as ur, Cc as ut, lu as v, rt as vi, Pi as vn, ut as vr, $s as vt, $l as w, Ht as wi, Oi as wn, Pt as wr, Ms as wt, tu as x, gn as xi, Ti as xn, $e as xr, Bs as xt, mu as y, kn as yi, Mi as yn, Qt as yr, Ws as yt, ml as z, rr as zn, rn as zr, Y as zt };
|
|
6100
6147
|
|
|
6101
|
-
//# sourceMappingURL=
|
|
6148
|
+
//# sourceMappingURL=dependencyBusy-DxiLAocF.js.map
|