@realtek/core-theme-live 0.0.399 → 0.0.401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{LinkedRecordFileField-Banivq2z.js → LinkedRecordFileField-BmenMK75.js} +632 -587
- package/dist-lib/LinkedRecordFileField-BmenMK75.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-C3B7wx5h.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-C3B7wx5h.cjs.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +8675 -8604
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-BHkiuhQ5.cjs +0 -5
- package/dist-lib/LinkedRecordFileField-BHkiuhQ5.cjs.map +0 -1
- package/dist-lib/LinkedRecordFileField-Banivq2z.js.map +0 -1
|
@@ -2403,21 +2403,52 @@ function Gi(e, t) {
|
|
|
2403
2403
|
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => Wi(n, e)) : Wi(n, t);
|
|
2404
2404
|
}
|
|
2405
2405
|
//#endregion
|
|
2406
|
+
//#region src/components/form/mountDefaultValue.js
|
|
2407
|
+
function Ki(e = {}) {
|
|
2408
|
+
let t = e?.defaultValue;
|
|
2409
|
+
if (t === void 0 || t === "") return;
|
|
2410
|
+
if (e?.type === "time") return Yi(t);
|
|
2411
|
+
if (e?.type !== "checkbox") return t;
|
|
2412
|
+
let n = Array.isArray(e.options) ? e.options : [];
|
|
2413
|
+
if (!n.length) return t;
|
|
2414
|
+
let r = n.map((e) => String(e && typeof e == "object" ? e.value : e));
|
|
2415
|
+
return (Array.isArray(t) ? t : [t]).some((e) => r.includes(String(e))) ? t : void 0;
|
|
2416
|
+
}
|
|
2417
|
+
var qi = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i, Ji = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
2418
|
+
function Yi(e) {
|
|
2419
|
+
if (e == null || e === "") return;
|
|
2420
|
+
if (T.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2421
|
+
if (typeof e != "string") return;
|
|
2422
|
+
let t = e.trim(), n = t.match(qi);
|
|
2423
|
+
if (n) {
|
|
2424
|
+
let e = Number(n[1]), t = Number(n[2]), r = Number(n[3] ?? 0), i = n[4]?.replace(/[.\s]/g, "").toLowerCase();
|
|
2425
|
+
if (i) {
|
|
2426
|
+
if (e < 1 || e > 12) return;
|
|
2427
|
+
e = e % 12 + (i === "pm" ? 12 : 0);
|
|
2428
|
+
}
|
|
2429
|
+
return e > 23 || t > 59 || r > 59 ? void 0 : T().hour(e).minute(t).second(r).millisecond(0);
|
|
2430
|
+
}
|
|
2431
|
+
if (Ji.test(t)) {
|
|
2432
|
+
let e = T(t);
|
|
2433
|
+
return e.isValid() ? e : void 0;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
//#endregion
|
|
2406
2437
|
//#region src/components/form/payloadTransformer.js
|
|
2407
|
-
var R = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2408
|
-
function
|
|
2438
|
+
var R = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, Xi = (e) => e === !0 || e === 1 || e === "1", z = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !Zi(e);
|
|
2439
|
+
function Zi(e) {
|
|
2409
2440
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2410
2441
|
}
|
|
2411
|
-
function
|
|
2412
|
-
return
|
|
2442
|
+
function Qi(e) {
|
|
2443
|
+
return Zi(e) || e instanceof Date;
|
|
2413
2444
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return e instanceof Date ? e.toISOString() :
|
|
2445
|
+
function $i(e) {
|
|
2446
|
+
return e instanceof Date ? e.toISOString() : Zi(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2416
2447
|
}
|
|
2417
|
-
function
|
|
2418
|
-
if (!cr(t)) return
|
|
2448
|
+
function ea(e, t) {
|
|
2449
|
+
if (!cr(t)) return $i(e);
|
|
2419
2450
|
let n = lr(e);
|
|
2420
|
-
return n ? n.toISOString() :
|
|
2451
|
+
return n ? n.toISOString() : $i(e);
|
|
2421
2452
|
}
|
|
2422
2453
|
function B(e, t) {
|
|
2423
2454
|
if (!t) return;
|
|
@@ -2442,7 +2473,7 @@ function U(e, t, n) {
|
|
|
2442
2473
|
}
|
|
2443
2474
|
return i[r[r.length - 1]] = n, e;
|
|
2444
2475
|
}
|
|
2445
|
-
function
|
|
2476
|
+
function ta(e, t, n) {
|
|
2446
2477
|
let r = String(t).split("."), i = e;
|
|
2447
2478
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2448
2479
|
let t = r[e];
|
|
@@ -2454,24 +2485,24 @@ function Zi(e, t, n) {
|
|
|
2454
2485
|
...i[a]
|
|
2455
2486
|
} : n, e;
|
|
2456
2487
|
}
|
|
2457
|
-
function
|
|
2488
|
+
function na(e) {
|
|
2458
2489
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2459
2490
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2460
2491
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2461
2492
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2462
2493
|
}
|
|
2463
|
-
function
|
|
2494
|
+
function ra(e, t) {
|
|
2464
2495
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2465
|
-
z(n) && z(e[t]) ?
|
|
2496
|
+
z(n) && z(e[t]) ? ra(e[t], n) : e[t] = n;
|
|
2466
2497
|
}), e;
|
|
2467
2498
|
}
|
|
2468
|
-
function
|
|
2499
|
+
function ia(e, t) {
|
|
2469
2500
|
let n = e.options ?? e.values ?? [];
|
|
2470
2501
|
for (let e of n) if (typeof e == "string") {
|
|
2471
2502
|
if (e === t) return e;
|
|
2472
2503
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2473
2504
|
}
|
|
2474
|
-
function
|
|
2505
|
+
function aa(e, t) {
|
|
2475
2506
|
if (z(e)) {
|
|
2476
2507
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2477
2508
|
return {
|
|
@@ -2481,10 +2512,10 @@ function ta(e, t) {
|
|
|
2481
2512
|
}
|
|
2482
2513
|
return {
|
|
2483
2514
|
value: e,
|
|
2484
|
-
label:
|
|
2515
|
+
label: ia(t, e) ?? e
|
|
2485
2516
|
};
|
|
2486
2517
|
}
|
|
2487
|
-
function
|
|
2518
|
+
function oa(e = {}) {
|
|
2488
2519
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2489
2520
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2490
2521
|
switch (e.type) {
|
|
@@ -2495,13 +2526,13 @@ function na(e = {}) {
|
|
|
2495
2526
|
}
|
|
2496
2527
|
}
|
|
2497
2528
|
function W(e, t, n = {}) {
|
|
2498
|
-
if (
|
|
2499
|
-
if (t === "string") return
|
|
2529
|
+
if (Qi(e)) {
|
|
2530
|
+
if (t === "string") return ea(e, n);
|
|
2500
2531
|
if (t === "number") {
|
|
2501
|
-
let t =
|
|
2532
|
+
let t = Zi(e) ? e.valueOf() : e.getTime();
|
|
2502
2533
|
return Number.isNaN(t) ? null : t;
|
|
2503
2534
|
}
|
|
2504
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2535
|
+
if (t === "date" || t === "auto" || !t) return ea(e, n);
|
|
2505
2536
|
}
|
|
2506
2537
|
switch (t) {
|
|
2507
2538
|
case "string": return e == null ? "" : String(e);
|
|
@@ -2516,14 +2547,14 @@ function W(e, t, n = {}) {
|
|
|
2516
2547
|
return t = Array.isArray(e) ? e : R(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => W(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2517
2548
|
}
|
|
2518
2549
|
case "object": return z(e), e;
|
|
2519
|
-
case "date": return
|
|
2550
|
+
case "date": return ea(e, n);
|
|
2520
2551
|
case "custom":
|
|
2521
2552
|
case "auto":
|
|
2522
2553
|
case void 0:
|
|
2523
2554
|
default: return e;
|
|
2524
2555
|
}
|
|
2525
2556
|
}
|
|
2526
|
-
var
|
|
2557
|
+
var sa = {
|
|
2527
2558
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2528
2559
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2529
2560
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2531,11 +2562,11 @@ var ra = {
|
|
|
2531
2562
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2532
2563
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2533
2564
|
};
|
|
2534
|
-
function
|
|
2565
|
+
function ca(e, t) {
|
|
2535
2566
|
if (!t) return e;
|
|
2536
2567
|
let n = t;
|
|
2537
2568
|
if (typeof n == "string") {
|
|
2538
|
-
if (
|
|
2569
|
+
if (sa[n]) return sa[n](e);
|
|
2539
2570
|
try {
|
|
2540
2571
|
n = JSON.parse(n);
|
|
2541
2572
|
} catch {
|
|
@@ -2543,14 +2574,14 @@ function ia(e, t) {
|
|
|
2543
2574
|
}
|
|
2544
2575
|
}
|
|
2545
2576
|
let r = e;
|
|
2546
|
-
if (n.name &&
|
|
2577
|
+
if (n.name && sa[n.name] && (r = sa[n.name](r)), n.map && typeof n.map == "object") {
|
|
2547
2578
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2548
2579
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2549
2580
|
}
|
|
2550
2581
|
return r;
|
|
2551
2582
|
}
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2583
|
+
var la = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2584
|
+
function ua(e, t) {
|
|
2554
2585
|
let [n, ...r] = e.split("."), i;
|
|
2555
2586
|
if (n === "value") i = t.value;
|
|
2556
2587
|
else if (n === "label") i = t.label;
|
|
@@ -2558,24 +2589,24 @@ function oa(e, t) {
|
|
|
2558
2589
|
else return;
|
|
2559
2590
|
return r.length ? B(i, r.join(".")) : i;
|
|
2560
2591
|
}
|
|
2561
|
-
function
|
|
2592
|
+
function da(e, t) {
|
|
2562
2593
|
if (typeof e == "string") {
|
|
2563
2594
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2564
|
-
return n ?
|
|
2565
|
-
let r =
|
|
2595
|
+
return n ? ua(n[1], t) : e.replace(la, (e, n) => {
|
|
2596
|
+
let r = ua(n, t);
|
|
2566
2597
|
return r == null ? "" : String(r);
|
|
2567
2598
|
});
|
|
2568
2599
|
}
|
|
2569
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2600
|
+
if (Array.isArray(e)) return e.map((e) => da(e, t));
|
|
2570
2601
|
if (z(e)) {
|
|
2571
2602
|
let n = {};
|
|
2572
2603
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2573
|
-
n[e] =
|
|
2604
|
+
n[e] = da(r, t);
|
|
2574
2605
|
}), n;
|
|
2575
2606
|
}
|
|
2576
2607
|
return e;
|
|
2577
2608
|
}
|
|
2578
|
-
function
|
|
2609
|
+
function fa(e) {
|
|
2579
2610
|
if (!e) return null;
|
|
2580
2611
|
if (typeof e == "string") try {
|
|
2581
2612
|
return JSON.parse(e);
|
|
@@ -2584,8 +2615,8 @@ function ca(e) {
|
|
|
2584
2615
|
}
|
|
2585
2616
|
return e;
|
|
2586
2617
|
}
|
|
2587
|
-
function
|
|
2588
|
-
let n = e.payloadMode || "auto", r =
|
|
2618
|
+
function pa(e, t) {
|
|
2619
|
+
let n = e.payloadMode || "auto", r = oa(e), { value: i, label: a } = aa(t, e);
|
|
2589
2620
|
switch (n) {
|
|
2590
2621
|
case "value": return {
|
|
2591
2622
|
kind: "scalar",
|
|
@@ -2607,12 +2638,12 @@ function la(e, t) {
|
|
|
2607
2638
|
}
|
|
2608
2639
|
case "custom":
|
|
2609
2640
|
case "template": {
|
|
2610
|
-
let n =
|
|
2641
|
+
let n = fa(e.payloadTemplate);
|
|
2611
2642
|
if (!n) return {
|
|
2612
2643
|
kind: "scalar",
|
|
2613
2644
|
out: W(i, r, e)
|
|
2614
2645
|
};
|
|
2615
|
-
let o =
|
|
2646
|
+
let o = da(n, {
|
|
2616
2647
|
value: W(i, e.elementType || "auto", {}),
|
|
2617
2648
|
label: a,
|
|
2618
2649
|
raw: t
|
|
@@ -2628,15 +2659,15 @@ function la(e, t) {
|
|
|
2628
2659
|
};
|
|
2629
2660
|
}
|
|
2630
2661
|
}
|
|
2631
|
-
function
|
|
2662
|
+
function ma(e, t) {
|
|
2632
2663
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2633
2664
|
let n = t;
|
|
2634
|
-
return R(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n =
|
|
2665
|
+
return R(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = ca(n, e.transformRule), R(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (oa(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2635
2666
|
kind: "scalar",
|
|
2636
|
-
out: n.map((t) =>
|
|
2637
|
-
} :
|
|
2667
|
+
out: n.map((t) => pa(e, t).out)
|
|
2668
|
+
} : pa(e, n);
|
|
2638
2669
|
}
|
|
2639
|
-
function
|
|
2670
|
+
function ha(e = {}) {
|
|
2640
2671
|
return !!e.richValue || [
|
|
2641
2672
|
"label",
|
|
2642
2673
|
"object",
|
|
@@ -2644,8 +2675,8 @@ function da(e = {}) {
|
|
|
2644
2675
|
"template"
|
|
2645
2676
|
].includes(e.payloadMode);
|
|
2646
2677
|
}
|
|
2647
|
-
function
|
|
2648
|
-
if (!
|
|
2678
|
+
function ga(e, t, n = []) {
|
|
2679
|
+
if (!ha(e) || t == null) return t;
|
|
2649
2680
|
let r = (e) => {
|
|
2650
2681
|
if (z(e) && e.value !== void 0) return e;
|
|
2651
2682
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2656,7 +2687,7 @@ function fa(e, t, n = []) {
|
|
|
2656
2687
|
};
|
|
2657
2688
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2658
2689
|
}
|
|
2659
|
-
function
|
|
2690
|
+
function _a(e, t, n) {
|
|
2660
2691
|
if (!e?.field) return !0;
|
|
2661
2692
|
let r = H(t, e.field) ? V(t, e.field) : V(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2662
2693
|
switch (e.operator) {
|
|
@@ -2670,45 +2701,52 @@ function pa(e, t, n) {
|
|
|
2670
2701
|
default: return !0;
|
|
2671
2702
|
}
|
|
2672
2703
|
}
|
|
2673
|
-
function
|
|
2704
|
+
function va(e) {
|
|
2674
2705
|
let t = [];
|
|
2675
2706
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2676
2707
|
e?.field && t.push(e.field);
|
|
2677
2708
|
}), t;
|
|
2678
2709
|
}
|
|
2679
|
-
function
|
|
2710
|
+
function ya(e, t, n) {
|
|
2680
2711
|
if (!e) return !0;
|
|
2681
2712
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2682
2713
|
if (r.length) {
|
|
2683
|
-
let i = r.map((e) =>
|
|
2714
|
+
let i = r.map((e) => _a(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2684
2715
|
if (e.field) {
|
|
2685
|
-
let r =
|
|
2716
|
+
let r = _a(e, t, n);
|
|
2686
2717
|
o = a ? o || r : o && r;
|
|
2687
2718
|
}
|
|
2688
2719
|
return o;
|
|
2689
2720
|
}
|
|
2690
|
-
return
|
|
2721
|
+
return _a(e, t, n);
|
|
2691
2722
|
}
|
|
2692
|
-
function
|
|
2693
|
-
let a =
|
|
2694
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2723
|
+
function ba(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2724
|
+
let a = va(e?.showIf);
|
|
2725
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), ya(e.showIf, t, n) ? a.every((e) => {
|
|
2695
2726
|
let a = r?.get?.(e);
|
|
2696
|
-
return !a ||
|
|
2727
|
+
return !a || ba(a, t, n, r, i);
|
|
2697
2728
|
}) : !1);
|
|
2698
2729
|
}
|
|
2699
|
-
function
|
|
2730
|
+
function xa(e = []) {
|
|
2700
2731
|
let t = /* @__PURE__ */ new Map();
|
|
2701
2732
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2702
2733
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2703
2734
|
})), t;
|
|
2704
2735
|
}
|
|
2705
|
-
function
|
|
2736
|
+
function Sa(e = {}, { editing: t = !1 } = {}) {
|
|
2706
2737
|
let n = {};
|
|
2707
2738
|
return (e.fields ?? []).forEach((e) => {
|
|
2708
|
-
!e.field || G(e)
|
|
2739
|
+
if (!(!e.field || G(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2740
|
+
if (e.type === "time") {
|
|
2741
|
+
let t = Yi(e.defaultValue);
|
|
2742
|
+
t !== void 0 && (n[e.field] = t);
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
n[e.field] = e.defaultValue;
|
|
2746
|
+
}
|
|
2709
2747
|
}), n;
|
|
2710
2748
|
}
|
|
2711
|
-
function
|
|
2749
|
+
function Ca(e = []) {
|
|
2712
2750
|
let t = [];
|
|
2713
2751
|
return e.forEach((e) => {
|
|
2714
2752
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2719,7 +2757,7 @@ function ya(e = []) {
|
|
|
2719
2757
|
});
|
|
2720
2758
|
}), t;
|
|
2721
2759
|
}
|
|
2722
|
-
var
|
|
2760
|
+
var wa = [
|
|
2723
2761
|
"file",
|
|
2724
2762
|
"document",
|
|
2725
2763
|
"image",
|
|
@@ -2727,19 +2765,19 @@ var ba = [
|
|
|
2727
2765
|
"attachment"
|
|
2728
2766
|
];
|
|
2729
2767
|
function G(e) {
|
|
2730
|
-
return
|
|
2768
|
+
return wa.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2731
2769
|
}
|
|
2732
|
-
function
|
|
2733
|
-
return
|
|
2770
|
+
function Ta(e = []) {
|
|
2771
|
+
return Ca(e).map(({ field: e }) => e).filter(G);
|
|
2734
2772
|
}
|
|
2735
|
-
function
|
|
2773
|
+
function Ea(e) {
|
|
2736
2774
|
return String(e ?? "").trim().toLowerCase();
|
|
2737
2775
|
}
|
|
2738
|
-
function
|
|
2739
|
-
return !!t &&
|
|
2776
|
+
function Da(e, t) {
|
|
2777
|
+
return !!t && Ea(e.moduleName) === t;
|
|
2740
2778
|
}
|
|
2741
|
-
function
|
|
2742
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2779
|
+
function Oa(e, t = [], n = {}) {
|
|
2780
|
+
let r = [], i = n.scope ?? "all", a = Ea(n.module), o = (e, t) => {
|
|
2743
2781
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2744
2782
|
let n = t?.originFileObj || t;
|
|
2745
2783
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2751,7 +2789,7 @@ function wa(e, t = [], n = {}) {
|
|
|
2751
2789
|
return (t ?? []).forEach((t) => {
|
|
2752
2790
|
let r = (t.fields ?? []).filter(G);
|
|
2753
2791
|
if (!r.length) return;
|
|
2754
|
-
let s = t.moduleName && !
|
|
2792
|
+
let s = t.moduleName && !Da(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2755
2793
|
if (t.addRow) {
|
|
2756
2794
|
if (i === "flat") return;
|
|
2757
2795
|
let a = e[t.name];
|
|
@@ -2771,12 +2809,12 @@ function wa(e, t = [], n = {}) {
|
|
|
2771
2809
|
});
|
|
2772
2810
|
}), r;
|
|
2773
2811
|
}
|
|
2774
|
-
function
|
|
2812
|
+
function ka(e, t, n = {}) {
|
|
2775
2813
|
let r = z(n.base) ? structuredClone(n.base) : {};
|
|
2776
|
-
|
|
2777
|
-
(e.payloadKey || e.field) && (
|
|
2814
|
+
Ta(t).forEach((e) => {
|
|
2815
|
+
(e.payloadKey || e.field) && (Ma(r, e.payloadKey || e.field), Ma(r, e.field));
|
|
2778
2816
|
});
|
|
2779
|
-
let i =
|
|
2817
|
+
let i = Ea(n.module), a = xa(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Da(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2780
2818
|
return (t ?? []).forEach((t) => {
|
|
2781
2819
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && H(e, t.toggleField) ? !!V(e, t.toggleField) : !1;
|
|
2782
2820
|
if (t.toggleEnabled && t.toggleField && H(e, t.toggleField) && (U(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2786,29 +2824,29 @@ function Ta(e, t, n = {}) {
|
|
|
2786
2824
|
if (t.addRow) {
|
|
2787
2825
|
let i = e[t.name];
|
|
2788
2826
|
if (!Array.isArray(i)) return;
|
|
2789
|
-
U(n, t.payloadKey || t.name, i.map((t) =>
|
|
2827
|
+
U(n, t.payloadKey || t.name, i.map((t) => ja(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2790
2828
|
return;
|
|
2791
2829
|
}
|
|
2792
|
-
r.forEach((t) =>
|
|
2830
|
+
r.forEach((t) => Aa(t, e, n, e, a));
|
|
2793
2831
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2794
2832
|
moduleName: e,
|
|
2795
2833
|
data: t
|
|
2796
2834
|
}))), ji(r, t);
|
|
2797
2835
|
}
|
|
2798
|
-
function
|
|
2836
|
+
function Aa(e, t, n, r, i) {
|
|
2799
2837
|
if (Ni(e) && Ii(e)) {
|
|
2800
2838
|
let r = Pi(e);
|
|
2801
2839
|
H(t, r) && U(n, r, !!V(t, r));
|
|
2802
2840
|
}
|
|
2803
2841
|
if (G(e)) {
|
|
2804
|
-
let i =
|
|
2842
|
+
let i = na(V(t, e.field));
|
|
2805
2843
|
if (i !== void 0) {
|
|
2806
2844
|
let a = r !== void 0 && r !== t;
|
|
2807
|
-
|
|
2845
|
+
ta(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2808
2846
|
}
|
|
2809
2847
|
return;
|
|
2810
2848
|
}
|
|
2811
|
-
if (
|
|
2849
|
+
if (va(e.showIf).length && !ba(e, t, r, i)) {
|
|
2812
2850
|
(r === void 0 || r === t) && H(t, e.field) && U(n, e.payloadKey || e.field, null);
|
|
2813
2851
|
return;
|
|
2814
2852
|
}
|
|
@@ -2816,30 +2854,30 @@ function Ea(e, t, n, r, i) {
|
|
|
2816
2854
|
if (!H(t, e.field)) return;
|
|
2817
2855
|
let a = V(t, e.field);
|
|
2818
2856
|
if (!Array.isArray(a)) return;
|
|
2819
|
-
let o = a.map((t) =>
|
|
2857
|
+
let o = a.map((t) => ja(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2820
2858
|
U(n, e.payloadKey || e.field, o);
|
|
2821
2859
|
return;
|
|
2822
2860
|
}
|
|
2823
2861
|
if (!H(t, e.field)) return;
|
|
2824
|
-
if (
|
|
2825
|
-
let r = V(t, e.field), i = Array.isArray(r) ? r : R(r) ? [] : [r], a =
|
|
2862
|
+
if (Xi(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2863
|
+
let r = V(t, e.field), i = Array.isArray(r) ? r : R(r) ? [] : [r], a = Pa(e), o = i.map((e) => ma(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2826
2864
|
U(n, e.payloadKey || e.field, o);
|
|
2827
2865
|
return;
|
|
2828
2866
|
}
|
|
2829
|
-
let a =
|
|
2867
|
+
let a = ma(e, V(t, e.field));
|
|
2830
2868
|
if (a.kind !== "skip") {
|
|
2831
2869
|
if (a.kind === "spread" && z(a.out)) {
|
|
2832
|
-
|
|
2870
|
+
ra(n, a.out);
|
|
2833
2871
|
return;
|
|
2834
2872
|
}
|
|
2835
2873
|
U(n, e.payloadKey || e.field, a.out);
|
|
2836
2874
|
}
|
|
2837
2875
|
}
|
|
2838
|
-
function
|
|
2876
|
+
function ja(e, t, n, r) {
|
|
2839
2877
|
let i = {};
|
|
2840
|
-
return e.forEach((e) =>
|
|
2878
|
+
return e.forEach((e) => Aa(e, t, i, n ?? t, r)), i;
|
|
2841
2879
|
}
|
|
2842
|
-
function
|
|
2880
|
+
function Ma(e, t) {
|
|
2843
2881
|
let n = String(t).split("."), r = e;
|
|
2844
2882
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2845
2883
|
if (!z(r[n[e]])) return;
|
|
@@ -2847,7 +2885,7 @@ function Oa(e, t) {
|
|
|
2847
2885
|
}
|
|
2848
2886
|
delete r[n[n.length - 1]];
|
|
2849
2887
|
}
|
|
2850
|
-
var
|
|
2888
|
+
var Na = /* @__PURE__ */ new Set([
|
|
2851
2889
|
"text",
|
|
2852
2890
|
"textarea",
|
|
2853
2891
|
"email",
|
|
@@ -2864,7 +2902,7 @@ function K(e, t) {
|
|
|
2864
2902
|
if (t == null) return r() ?? t;
|
|
2865
2903
|
if (n(t)) return r();
|
|
2866
2904
|
if (R(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
2867
|
-
if (
|
|
2905
|
+
if (Na.has(e.type) && z(t)) {
|
|
2868
2906
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2869
2907
|
if (r === void 0 || z(r)) return;
|
|
2870
2908
|
t = r;
|
|
@@ -2875,7 +2913,7 @@ function K(e, t) {
|
|
|
2875
2913
|
return e.isValid() ? e : null;
|
|
2876
2914
|
}
|
|
2877
2915
|
t = Gi(e, t);
|
|
2878
|
-
let i = (t) => z(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
2916
|
+
let i = (t) => z(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && oa(e) === "array", o = (t) => {
|
|
2879
2917
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2880
2918
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2881
2919
|
return n ? n.value : t;
|
|
@@ -2887,7 +2925,7 @@ function K(e, t) {
|
|
|
2887
2925
|
}
|
|
2888
2926
|
return t;
|
|
2889
2927
|
}
|
|
2890
|
-
function
|
|
2928
|
+
function Pa(e = {}) {
|
|
2891
2929
|
return {
|
|
2892
2930
|
...e,
|
|
2893
2931
|
addRow: !1,
|
|
@@ -2896,7 +2934,7 @@ function Aa(e = {}) {
|
|
|
2896
2934
|
dataType: void 0
|
|
2897
2935
|
};
|
|
2898
2936
|
}
|
|
2899
|
-
function
|
|
2937
|
+
function Fa(e, t) {
|
|
2900
2938
|
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;
|
|
2901
2939
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2902
2940
|
let i = [];
|
|
@@ -2912,7 +2950,7 @@ function ja(e, t) {
|
|
|
2912
2950
|
for (; i.length < a;) i.push({});
|
|
2913
2951
|
return i;
|
|
2914
2952
|
}
|
|
2915
|
-
let i =
|
|
2953
|
+
let i = Pa(e), a = [];
|
|
2916
2954
|
if (Array.isArray(t)) a = t.map((e) => K(i, e)).filter((e) => e != null && e !== "");
|
|
2917
2955
|
else if (t != null && t !== "") {
|
|
2918
2956
|
let e = K(i, t);
|
|
@@ -2924,12 +2962,12 @@ function ja(e, t) {
|
|
|
2924
2962
|
}
|
|
2925
2963
|
//#endregion
|
|
2926
2964
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2927
|
-
var
|
|
2928
|
-
function
|
|
2965
|
+
var Ia = (e) => e === !0 || e === 1 || e === "1";
|
|
2966
|
+
function La(e = []) {
|
|
2929
2967
|
let t = /* @__PURE__ */ new Map();
|
|
2930
2968
|
e.forEach((e) => {
|
|
2931
2969
|
let n = e?.linkGroup;
|
|
2932
|
-
!
|
|
2970
|
+
!Ia(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2933
2971
|
});
|
|
2934
2972
|
let n = /* @__PURE__ */ new Map();
|
|
2935
2973
|
return t.forEach((e, t) => {
|
|
@@ -2939,11 +2977,11 @@ function Na(e = []) {
|
|
|
2939
2977
|
});
|
|
2940
2978
|
}), n;
|
|
2941
2979
|
}
|
|
2942
|
-
function
|
|
2980
|
+
function Ra(e, t) {
|
|
2943
2981
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
2944
2982
|
return null;
|
|
2945
2983
|
}
|
|
2946
|
-
function
|
|
2984
|
+
function za(e, t = {}) {
|
|
2947
2985
|
let n = { ...t };
|
|
2948
2986
|
return e.forEach(({ memberNames: e }) => {
|
|
2949
2987
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -2955,7 +2993,7 @@ function Fa(e, t = {}) {
|
|
|
2955
2993
|
}
|
|
2956
2994
|
//#endregion
|
|
2957
2995
|
//#region src/components/form/formDecisionDialog.jsx
|
|
2958
|
-
var
|
|
2996
|
+
var Ba = {
|
|
2959
2997
|
duplicate: {
|
|
2960
2998
|
className: "fdd-tone-amber",
|
|
2961
2999
|
Icon: he
|
|
@@ -2973,8 +3011,8 @@ var Ia = {
|
|
|
2973
3011
|
Icon: de
|
|
2974
3012
|
}
|
|
2975
3013
|
};
|
|
2976
|
-
function
|
|
2977
|
-
let { className: c, Icon: l } =
|
|
3014
|
+
function Va({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s } = {}) {
|
|
3015
|
+
let { className: c, Icon: l } = Ba[e] ?? Ba.suggestion, u = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
2978
3016
|
return new Promise((e) => {
|
|
2979
3017
|
ee.confirm({
|
|
2980
3018
|
icon: null,
|
|
@@ -3024,8 +3062,8 @@ function La({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3024
3062
|
});
|
|
3025
3063
|
});
|
|
3026
3064
|
}
|
|
3027
|
-
function
|
|
3028
|
-
let { className: a, Icon: o } =
|
|
3065
|
+
function Ha({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3066
|
+
let { className: a, Icon: o } = Ba[e] ?? Ba.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3029
3067
|
return new Promise((e) => {
|
|
3030
3068
|
ee.warning({
|
|
3031
3069
|
icon: null,
|
|
@@ -3067,7 +3105,7 @@ function Ra({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3067
3105
|
}
|
|
3068
3106
|
//#endregion
|
|
3069
3107
|
//#region src/services/aiActionApi.js
|
|
3070
|
-
async function
|
|
3108
|
+
async function Ua({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3071
3109
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3072
3110
|
let c = await r(), l = new FormData();
|
|
3073
3111
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3093,17 +3131,17 @@ async function za({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3093
3131
|
}
|
|
3094
3132
|
//#endregion
|
|
3095
3133
|
//#region src/components/detail/phoneDisplay.js
|
|
3096
|
-
var
|
|
3097
|
-
function
|
|
3134
|
+
var Wa = (e) => e == null || e === "";
|
|
3135
|
+
function Ga(e, t) {
|
|
3098
3136
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3099
3137
|
}
|
|
3100
|
-
function
|
|
3138
|
+
function Ka(e) {
|
|
3101
3139
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3102
3140
|
if (!t) return "";
|
|
3103
3141
|
let n = t.replace(/^\+/, "");
|
|
3104
3142
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3105
3143
|
}
|
|
3106
|
-
function
|
|
3144
|
+
function qa(e) {
|
|
3107
3145
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3108
3146
|
return [
|
|
3109
3147
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3116,15 +3154,15 @@ function Ua(e) {
|
|
|
3116
3154
|
"isdCode"
|
|
3117
3155
|
];
|
|
3118
3156
|
}
|
|
3119
|
-
function
|
|
3120
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3157
|
+
function Ja(e, t, n = "") {
|
|
3158
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...qa(e)] : qa(e);
|
|
3121
3159
|
for (let e of i) {
|
|
3122
|
-
let n =
|
|
3160
|
+
let n = Ka(Ga(t, e));
|
|
3123
3161
|
if (n) return n;
|
|
3124
3162
|
}
|
|
3125
|
-
return
|
|
3163
|
+
return Ka(n);
|
|
3126
3164
|
}
|
|
3127
|
-
function
|
|
3165
|
+
function Ya(e) {
|
|
3128
3166
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3129
3167
|
return n ? {
|
|
3130
3168
|
code: n[1],
|
|
@@ -3134,17 +3172,17 @@ function Ga(e) {
|
|
|
3134
3172
|
rest: t
|
|
3135
3173
|
};
|
|
3136
3174
|
}
|
|
3137
|
-
function
|
|
3138
|
-
if (
|
|
3139
|
-
let { code: n, rest: r } =
|
|
3175
|
+
function Xa(e, t = "") {
|
|
3176
|
+
if (Wa(e)) return "";
|
|
3177
|
+
let { code: n, rest: r } = Ya(e), i = n || Ka(t), a = Xn(r) || r;
|
|
3140
3178
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3141
3179
|
}
|
|
3142
|
-
function
|
|
3143
|
-
return
|
|
3180
|
+
function Za(e, t, n) {
|
|
3181
|
+
return Xa(t, Ja(e, n, Jn()));
|
|
3144
3182
|
}
|
|
3145
3183
|
//#endregion
|
|
3146
3184
|
//#region src/components/detail/renderConfig.js
|
|
3147
|
-
var
|
|
3185
|
+
var Qa = [
|
|
3148
3186
|
{
|
|
3149
3187
|
value: "auto",
|
|
3150
3188
|
label: "Default (auto)"
|
|
@@ -3201,7 +3239,7 @@ var Ja = [
|
|
|
3201
3239
|
value: "html",
|
|
3202
3240
|
label: "HTML"
|
|
3203
3241
|
}
|
|
3204
|
-
],
|
|
3242
|
+
], $a = [
|
|
3205
3243
|
{
|
|
3206
3244
|
value: "preview",
|
|
3207
3245
|
label: "Preview (viewer)"
|
|
@@ -3222,7 +3260,7 @@ var Ja = [
|
|
|
3222
3260
|
value: "text",
|
|
3223
3261
|
label: "Text (filename)"
|
|
3224
3262
|
}
|
|
3225
|
-
],
|
|
3263
|
+
], eo = [
|
|
3226
3264
|
{
|
|
3227
3265
|
value: "none",
|
|
3228
3266
|
label: "None"
|
|
@@ -3239,76 +3277,76 @@ var Ja = [
|
|
|
3239
3277
|
value: "title",
|
|
3240
3278
|
label: "Title Case"
|
|
3241
3279
|
}
|
|
3242
|
-
],
|
|
3280
|
+
], to = [
|
|
3243
3281
|
"location",
|
|
3244
3282
|
"path",
|
|
3245
3283
|
"url",
|
|
3246
3284
|
"key"
|
|
3247
|
-
],
|
|
3285
|
+
], no = [
|
|
3248
3286
|
"location",
|
|
3249
3287
|
"filepath",
|
|
3250
3288
|
"path",
|
|
3251
3289
|
"url",
|
|
3252
3290
|
"key"
|
|
3253
|
-
],
|
|
3291
|
+
], ro = [
|
|
3254
3292
|
"uploadedfilename",
|
|
3255
3293
|
"uploadname",
|
|
3256
3294
|
"originalname",
|
|
3257
3295
|
"displayname",
|
|
3258
3296
|
"documentname",
|
|
3259
3297
|
"filename"
|
|
3260
|
-
],
|
|
3261
|
-
function
|
|
3298
|
+
], io = ["name"], ao = (e) => String(e).toLowerCase(), oo = (e) => e == null || e === "";
|
|
3299
|
+
function so(e, t) {
|
|
3262
3300
|
for (let n of t) {
|
|
3263
3301
|
let t = e[n];
|
|
3264
3302
|
if (typeof t == "string" && t) return t;
|
|
3265
3303
|
}
|
|
3266
3304
|
return "";
|
|
3267
3305
|
}
|
|
3268
|
-
function
|
|
3269
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3306
|
+
function co(e, t) {
|
|
3307
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && ao(t).endsWith(n)) return r;
|
|
3270
3308
|
return "";
|
|
3271
3309
|
}
|
|
3272
|
-
function
|
|
3310
|
+
function lo(e) {
|
|
3273
3311
|
if (!e) return "";
|
|
3274
3312
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3275
3313
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3276
3314
|
}
|
|
3277
|
-
function
|
|
3315
|
+
function uo(e) {
|
|
3278
3316
|
if (!e) return "";
|
|
3279
3317
|
let t = String(e);
|
|
3280
3318
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3281
3319
|
}
|
|
3282
|
-
function
|
|
3320
|
+
function fo(e) {
|
|
3283
3321
|
let t = String(e ?? "").trim();
|
|
3284
3322
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3285
3323
|
}
|
|
3286
|
-
function
|
|
3287
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3324
|
+
function po(e) {
|
|
3325
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : so(e, to) || co(e, no);
|
|
3288
3326
|
}
|
|
3289
|
-
function
|
|
3290
|
-
return e ? typeof e == "string" ?
|
|
3327
|
+
function mo(e) {
|
|
3328
|
+
return e ? typeof e == "string" ? lo(e) || e : typeof e == "object" && (so(e, N().documentNameOrder ?? []) || co(e, ro) || lo(po(e)) || co(e, io)) || "Document" : "Document";
|
|
3291
3329
|
}
|
|
3292
|
-
function
|
|
3293
|
-
if (
|
|
3330
|
+
function ho(e) {
|
|
3331
|
+
if (oo(e)) return [];
|
|
3294
3332
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3295
|
-
for (let e of t) if (!
|
|
3333
|
+
for (let e of t) if (!oo(e)) {
|
|
3296
3334
|
if (typeof e == "string") {
|
|
3297
3335
|
let t = e.includes("/") ? e : "";
|
|
3298
3336
|
n.push({
|
|
3299
3337
|
location: t,
|
|
3300
|
-
name:
|
|
3301
|
-
url:
|
|
3302
|
-
needsAuthFetch:
|
|
3338
|
+
name: lo(e) || e,
|
|
3339
|
+
url: uo(t),
|
|
3340
|
+
needsAuthFetch: fo(t)
|
|
3303
3341
|
});
|
|
3304
3342
|
} else if (typeof e == "object") {
|
|
3305
|
-
let t =
|
|
3343
|
+
let t = po(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3306
3344
|
n.push({
|
|
3307
3345
|
location: t,
|
|
3308
|
-
name:
|
|
3309
|
-
url: r ||
|
|
3346
|
+
name: mo(e),
|
|
3347
|
+
url: r || uo(t),
|
|
3310
3348
|
documentId: e.id || e._id || e.documentId || "",
|
|
3311
|
-
needsAuthFetch: !r &&
|
|
3349
|
+
needsAuthFetch: !r && fo(t)
|
|
3312
3350
|
});
|
|
3313
3351
|
}
|
|
3314
3352
|
}
|
|
@@ -3316,24 +3354,24 @@ function uo(e) {
|
|
|
3316
3354
|
}
|
|
3317
3355
|
//#endregion
|
|
3318
3356
|
//#region src/components/form/repeatableRowShape.js
|
|
3319
|
-
function
|
|
3357
|
+
function go(e) {
|
|
3320
3358
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3321
3359
|
}
|
|
3322
|
-
function
|
|
3360
|
+
function _o(e, t) {
|
|
3323
3361
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3324
|
-
let n =
|
|
3362
|
+
let n = go(e);
|
|
3325
3363
|
if (!n) return t;
|
|
3326
3364
|
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 }));
|
|
3327
3365
|
return r ? i : t;
|
|
3328
3366
|
}
|
|
3329
3367
|
//#endregion
|
|
3330
3368
|
//#region src/components/form/applyGroupValues.js
|
|
3331
|
-
var
|
|
3332
|
-
function
|
|
3369
|
+
var vo = (e) => e === !0 || e === 1 || e === "1", yo = (e) => e == null || e === "";
|
|
3370
|
+
function bo(e) {
|
|
3333
3371
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3334
3372
|
}
|
|
3335
3373
|
function q(e, t, n) {
|
|
3336
|
-
let r = Array.isArray(t) ? t :
|
|
3374
|
+
let r = Array.isArray(t) ? t : bo(t);
|
|
3337
3375
|
if (!r.length) return e;
|
|
3338
3376
|
let i = e;
|
|
3339
3377
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3342,23 +3380,23 @@ function q(e, t, n) {
|
|
|
3342
3380
|
}
|
|
3343
3381
|
return i[r[r.length - 1]] = n, e;
|
|
3344
3382
|
}
|
|
3345
|
-
function
|
|
3383
|
+
function xo(e, t = []) {
|
|
3346
3384
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3347
3385
|
if (!n) continue;
|
|
3348
3386
|
let t = B(e, n);
|
|
3349
|
-
if (!
|
|
3387
|
+
if (!yo(t)) return t;
|
|
3350
3388
|
}
|
|
3351
3389
|
}
|
|
3352
|
-
function
|
|
3390
|
+
function So(e, t) {
|
|
3353
3391
|
if (!e || typeof e != "object") return;
|
|
3354
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3392
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !yo(n));
|
|
3355
3393
|
if (r) return r[1];
|
|
3356
3394
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3357
|
-
let n =
|
|
3358
|
-
if (!
|
|
3395
|
+
let n = So(e, t);
|
|
3396
|
+
if (!yo(n)) return n;
|
|
3359
3397
|
}
|
|
3360
3398
|
}
|
|
3361
|
-
function
|
|
3399
|
+
function Co(e, t) {
|
|
3362
3400
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3363
3401
|
if (!n.length) return;
|
|
3364
3402
|
let r = n.map((e, n) => {
|
|
@@ -3368,9 +3406,9 @@ function yo(e, t) {
|
|
|
3368
3406
|
status: "done"
|
|
3369
3407
|
};
|
|
3370
3408
|
if (!e || typeof e != "object") return null;
|
|
3371
|
-
let r =
|
|
3409
|
+
let r = xo(e, [t.fileUrlKey, t.locationKey]) ?? So(e, /(location|url|path)$/i) ?? "", i = xo(e, [t.fileNameKey]) ?? So(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3372
3410
|
if (!r && !i) return null;
|
|
3373
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3411
|
+
let a = r && !String(r).startsWith("http") ? uo(r) : r;
|
|
3374
3412
|
return {
|
|
3375
3413
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3376
3414
|
name: i || "file",
|
|
@@ -3382,11 +3420,11 @@ function yo(e, t) {
|
|
|
3382
3420
|
}).filter(Boolean);
|
|
3383
3421
|
return r.length ? r : void 0;
|
|
3384
3422
|
}
|
|
3385
|
-
function
|
|
3423
|
+
function wo(e, t) {
|
|
3386
3424
|
if (!e || typeof e != "object") return;
|
|
3387
|
-
let n =
|
|
3425
|
+
let n = xo(e, [t.fileNameKey, t.field]) ?? So(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = xo(e, [t.fileUrlKey, t.locationKey]) ?? So(e, /(location|url|path)$/i) ?? "";
|
|
3388
3426
|
if (!n && !r) return;
|
|
3389
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3427
|
+
let i = r && !String(r).startsWith("http") ? uo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3390
3428
|
return [{
|
|
3391
3429
|
uid: String(a),
|
|
3392
3430
|
name: n ?? "file",
|
|
@@ -3395,7 +3433,7 @@ function bo(e, t) {
|
|
|
3395
3433
|
url: i || void 0
|
|
3396
3434
|
}];
|
|
3397
3435
|
}
|
|
3398
|
-
function
|
|
3436
|
+
function To(e, t, n, r) {
|
|
3399
3437
|
(e.fields ?? []).forEach((e) => {
|
|
3400
3438
|
e?.verifyAction && [
|
|
3401
3439
|
e.verifyResultField,
|
|
@@ -3408,8 +3446,8 @@ function xo(e, t, n, r) {
|
|
|
3408
3446
|
});
|
|
3409
3447
|
});
|
|
3410
3448
|
}
|
|
3411
|
-
function
|
|
3412
|
-
let t = Array.isArray(e.rows) ?
|
|
3449
|
+
function Eo(e) {
|
|
3450
|
+
let t = Array.isArray(e.rows) ? _o(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3413
3451
|
let i = {};
|
|
3414
3452
|
return (e.fields ?? []).forEach((e) => {
|
|
3415
3453
|
if (!e.field) return;
|
|
@@ -3423,26 +3461,26 @@ function So(e) {
|
|
|
3423
3461
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && q(i, e.field, e.defaultValue);
|
|
3424
3462
|
return;
|
|
3425
3463
|
}
|
|
3426
|
-
q(i, e.field,
|
|
3427
|
-
}),
|
|
3428
|
-
}, i =
|
|
3464
|
+
q(i, e.field, vo(e.addRow) ? Fa(e, a) : K(e, a));
|
|
3465
|
+
}), To(e, t, i, r), i;
|
|
3466
|
+
}, i = Sa(e, { editing: !0 });
|
|
3429
3467
|
if (t && t.length > 0) {
|
|
3430
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3468
|
+
let e = t.map((e) => r(e, (e, t) => wo(e, t), (e, t) => B(e, t.field)));
|
|
3431
3469
|
for (; e.length < n;) e.push({ ...i });
|
|
3432
3470
|
return e;
|
|
3433
3471
|
}
|
|
3434
|
-
let a = r(e, (e, t) =>
|
|
3472
|
+
let a = r(e, (e, t) => Co(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3435
3473
|
for (; o.length < n;) o.push({ ...i });
|
|
3436
3474
|
return o;
|
|
3437
3475
|
}
|
|
3438
|
-
function
|
|
3476
|
+
function Do(e, t = []) {
|
|
3439
3477
|
let n = {};
|
|
3440
3478
|
return t.forEach((e) => {
|
|
3441
3479
|
e.toggleEnabled && e.toggleField && q(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3442
3480
|
if (!e.field || e.addRow) return;
|
|
3443
3481
|
let t = e.value, r = e.field;
|
|
3444
3482
|
if (e.type === "file") {
|
|
3445
|
-
let i =
|
|
3483
|
+
let i = Co(t, e);
|
|
3446
3484
|
i && q(n, r, i);
|
|
3447
3485
|
return;
|
|
3448
3486
|
}
|
|
@@ -3457,7 +3495,7 @@ function Co(e, t = []) {
|
|
|
3457
3495
|
}
|
|
3458
3496
|
let i = e.splitDialCodeInto;
|
|
3459
3497
|
if (i && typeof t == "string") {
|
|
3460
|
-
let { code: a, rest: o } =
|
|
3498
|
+
let { code: a, rest: o } = Ya(t), s = Ka(a);
|
|
3461
3499
|
s && q(n, i, s), q(n, r, K(e, o || t));
|
|
3462
3500
|
return;
|
|
3463
3501
|
}
|
|
@@ -3467,27 +3505,27 @@ function Co(e, t = []) {
|
|
|
3467
3505
|
}
|
|
3468
3506
|
//#endregion
|
|
3469
3507
|
//#region src/components/form/useAiActions.js
|
|
3470
|
-
function
|
|
3508
|
+
function Oo(e) {
|
|
3471
3509
|
let t = document.createElement("div");
|
|
3472
3510
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3473
3511
|
}
|
|
3474
|
-
function
|
|
3475
|
-
return t && t === "stripHtml" ?
|
|
3512
|
+
function ko(e, t) {
|
|
3513
|
+
return t && t === "stripHtml" ? Oo(e) : e;
|
|
3476
3514
|
}
|
|
3477
|
-
function
|
|
3515
|
+
function Ao(e) {
|
|
3478
3516
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3479
3517
|
}
|
|
3480
|
-
function
|
|
3518
|
+
function jo(e) {
|
|
3481
3519
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3482
3520
|
}
|
|
3483
|
-
function
|
|
3521
|
+
function Mo(e, t) {
|
|
3484
3522
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3485
|
-
let n =
|
|
3523
|
+
let n = ko(t, e.transform), r = String(n ?? "").trim();
|
|
3486
3524
|
if (!r) return !1;
|
|
3487
3525
|
let i = Number(e.minWords) || 0;
|
|
3488
|
-
return i > 0 ?
|
|
3526
|
+
return i > 0 ? Ao(r) >= i : !0;
|
|
3489
3527
|
}
|
|
3490
|
-
function
|
|
3528
|
+
function No(e, t) {
|
|
3491
3529
|
let n = e.inputs || [];
|
|
3492
3530
|
if (n.length === 0) return !0;
|
|
3493
3531
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3495,10 +3533,10 @@ function ko(e, t) {
|
|
|
3495
3533
|
let n = e.group || `__solo_${t}`;
|
|
3496
3534
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3497
3535
|
});
|
|
3498
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3536
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => Mo(e, t(e.sourceField)))) return !1;
|
|
3499
3537
|
return !0;
|
|
3500
3538
|
}
|
|
3501
|
-
function
|
|
3539
|
+
function Po(e = []) {
|
|
3502
3540
|
let t = [];
|
|
3503
3541
|
return e.forEach((e) => {
|
|
3504
3542
|
if (e?.addRow) {
|
|
@@ -3511,32 +3549,32 @@ function Ao(e = []) {
|
|
|
3511
3549
|
});
|
|
3512
3550
|
}), t;
|
|
3513
3551
|
}
|
|
3514
|
-
function
|
|
3515
|
-
return
|
|
3552
|
+
function Fo(e, t) {
|
|
3553
|
+
return Po(t).some((t) => {
|
|
3516
3554
|
let n = e.getFieldValue(t);
|
|
3517
|
-
return Array.isArray(n) ? n.some(
|
|
3555
|
+
return Array.isArray(n) ? n.some(jo) : n != null && n !== "";
|
|
3518
3556
|
});
|
|
3519
3557
|
}
|
|
3520
|
-
function
|
|
3558
|
+
function Io(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3521
3559
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = n || typeof e.isFieldTouched != "function" ? () => !0 : (t) => e.isFieldTouched(t), o = 0;
|
|
3522
3560
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3523
|
-
if (!(i.has(e) || !a(e) || !
|
|
3561
|
+
if (!(i.has(e) || !a(e) || !Lo(t))) {
|
|
3524
3562
|
if (Array.isArray(t)) {
|
|
3525
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3563
|
+
o += t.filter((e) => e && typeof e == "object" ? jo(e) : !!e).length;
|
|
3526
3564
|
return;
|
|
3527
3565
|
}
|
|
3528
3566
|
o += 1;
|
|
3529
3567
|
}
|
|
3530
3568
|
}), o;
|
|
3531
3569
|
}
|
|
3532
|
-
function
|
|
3533
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3570
|
+
function Lo(e) {
|
|
3571
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? jo(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
3534
3572
|
}
|
|
3535
|
-
function
|
|
3573
|
+
function Ro(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3536
3574
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
3537
|
-
return n ? a.some((e) =>
|
|
3575
|
+
return n ? a.some((e) => Lo(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && Lo(r[t])) : a.some((e) => Lo(r[e]));
|
|
3538
3576
|
}
|
|
3539
|
-
function
|
|
3577
|
+
function zo(e = []) {
|
|
3540
3578
|
let t = {};
|
|
3541
3579
|
return (e ?? []).forEach((e) => {
|
|
3542
3580
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3547,38 +3585,38 @@ function Fo(e = []) {
|
|
|
3547
3585
|
});
|
|
3548
3586
|
}), t;
|
|
3549
3587
|
}
|
|
3550
|
-
function
|
|
3588
|
+
function Bo(e, t, n) {
|
|
3551
3589
|
let r = e?.confirmWhen ?? "never";
|
|
3552
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3590
|
+
return r === "never" ? !1 : r === "always" || Fo(t, n);
|
|
3553
3591
|
}
|
|
3554
|
-
var
|
|
3592
|
+
var Vo = [
|
|
3555
3593
|
"top-left",
|
|
3556
3594
|
"top-center",
|
|
3557
3595
|
"top-right",
|
|
3558
3596
|
"bottom-left",
|
|
3559
3597
|
"bottom-center",
|
|
3560
3598
|
"bottom-right"
|
|
3561
|
-
],
|
|
3562
|
-
function
|
|
3599
|
+
], Ho = "bottom-left";
|
|
3600
|
+
function Uo(e = []) {
|
|
3563
3601
|
let t = {};
|
|
3564
3602
|
return e.forEach((e) => {
|
|
3565
|
-
let n =
|
|
3603
|
+
let n = Vo.includes(e.position) ? e.position : Ho;
|
|
3566
3604
|
(t[n] ??= []).push(e);
|
|
3567
3605
|
}), t;
|
|
3568
3606
|
}
|
|
3569
|
-
function
|
|
3570
|
-
let [o, s] = g(null), [c, l] = g(""), u = x.useWatch((e) => e, e), d = f((e) =>
|
|
3607
|
+
function Wo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3608
|
+
let [o, s] = g(null), [c, l] = g(""), u = x.useWatch((e) => e, e), d = f((e) => No(e, (e) => (u || {})[e]), [u]), p = f((t) => {
|
|
3571
3609
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3572
|
-
let n =
|
|
3610
|
+
let n = Do(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3573
3611
|
return t.forEach((t) => {
|
|
3574
3612
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3575
|
-
let n =
|
|
3613
|
+
let n = Eo(t);
|
|
3576
3614
|
if (n.length === 0) return;
|
|
3577
3615
|
r = !0;
|
|
3578
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3616
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(jo);
|
|
3579
3617
|
if (a.length) {
|
|
3580
3618
|
let e = t.label || t.name;
|
|
3581
|
-
|
|
3619
|
+
Va({
|
|
3582
3620
|
tone: "overwrite",
|
|
3583
3621
|
title: `Replace what's in ${e}?`,
|
|
3584
3622
|
facts: [
|
|
@@ -3608,9 +3646,9 @@ function Bo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3608
3646
|
return {
|
|
3609
3647
|
runAction: f(async (t, o, c, u) => {
|
|
3610
3648
|
let d = c?.confirmWhen ?? "never";
|
|
3611
|
-
if (c?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
3612
|
-
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
3613
|
-
if (!await
|
|
3649
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || Ro(e, [o?.field], { includeUntouched: a }))) {
|
|
3650
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = Io(e, [o?.field], { includeUntouched: a });
|
|
3651
|
+
if (!await Va({
|
|
3614
3652
|
tone: "overwrite",
|
|
3615
3653
|
title: t.title || "Read this file and fill the form in?",
|
|
3616
3654
|
facts: [{
|
|
@@ -3634,12 +3672,12 @@ function Bo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3634
3672
|
r && (s[t.param] = r);
|
|
3635
3673
|
} else {
|
|
3636
3674
|
let n = e.getFieldValue(t.sourceField);
|
|
3637
|
-
n != null && n !== "" && (a[t.param] =
|
|
3675
|
+
n != null && n !== "" && (a[t.param] = ko(n, t.transform));
|
|
3638
3676
|
}
|
|
3639
3677
|
}), (c.inputs || []).forEach((e) => {
|
|
3640
3678
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3641
3679
|
});
|
|
3642
|
-
let l = await
|
|
3680
|
+
let l = await Ua({
|
|
3643
3681
|
module: n,
|
|
3644
3682
|
group: t,
|
|
3645
3683
|
field: o.field,
|
|
@@ -3647,9 +3685,9 @@ function Bo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3647
3685
|
inputs: a,
|
|
3648
3686
|
files: s
|
|
3649
3687
|
}), d = c.label || "AI action", f = l?.groups;
|
|
3650
|
-
if (c?.trigger !== "upload" &&
|
|
3651
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3652
|
-
if (!await
|
|
3688
|
+
if (c?.trigger !== "upload" && Bo(c, e, f)) {
|
|
3689
|
+
let e = c.confirmMessages ?? {}, t = Po(f).length;
|
|
3690
|
+
if (!await Va({
|
|
3653
3691
|
tone: "overwrite",
|
|
3654
3692
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3655
3693
|
facts: [{
|
|
@@ -3670,7 +3708,7 @@ function Bo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3670
3708
|
field: o,
|
|
3671
3709
|
groupName: t,
|
|
3672
3710
|
responseGroups: f,
|
|
3673
|
-
payload:
|
|
3711
|
+
payload: zo(f)
|
|
3674
3712
|
});
|
|
3675
3713
|
if (e === !1 || e === "abort") return l;
|
|
3676
3714
|
}
|
|
@@ -3702,7 +3740,7 @@ function Bo({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3702
3740
|
}
|
|
3703
3741
|
//#endregion
|
|
3704
3742
|
//#region src/components/form/AiActionButtons.jsx
|
|
3705
|
-
function
|
|
3743
|
+
function Go({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3706
3744
|
if (!t || t.length === 0) return null;
|
|
3707
3745
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3708
3746
|
return /* @__PURE__ */ C(te, {
|
|
@@ -3723,18 +3761,18 @@ function Vo({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3723
3761
|
}
|
|
3724
3762
|
//#endregion
|
|
3725
3763
|
//#region src/components/form/emailValidator.js
|
|
3726
|
-
function
|
|
3764
|
+
function Ko(e) {
|
|
3727
3765
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3728
3766
|
if (!n) return !1;
|
|
3729
3767
|
let [, r, i] = n;
|
|
3730
3768
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3731
3769
|
}
|
|
3732
|
-
function
|
|
3733
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3770
|
+
function qo(e = "Email", t) {
|
|
3771
|
+
return { validator: (n, r) => r == null || r === "" || Ko(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3734
3772
|
}
|
|
3735
3773
|
//#endregion
|
|
3736
3774
|
//#region src/components/form/inputValidator.js
|
|
3737
|
-
var
|
|
3775
|
+
var Jo = [
|
|
3738
3776
|
{
|
|
3739
3777
|
label: "Only Numbers",
|
|
3740
3778
|
value: "onlyNumber"
|
|
@@ -3807,7 +3845,7 @@ var Wo = [
|
|
|
3807
3845
|
label: "Website URL",
|
|
3808
3846
|
value: "websiteUrl"
|
|
3809
3847
|
}
|
|
3810
|
-
],
|
|
3848
|
+
], Yo = {
|
|
3811
3849
|
onlyNumber: /^[0-9]$/,
|
|
3812
3850
|
experience: /^[0-9]$/,
|
|
3813
3851
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3823,10 +3861,10 @@ var Wo = [
|
|
|
3823
3861
|
decimalRange: /^[0-9.]$/,
|
|
3824
3862
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3825
3863
|
};
|
|
3826
|
-
function
|
|
3827
|
-
return
|
|
3864
|
+
function Xo(e) {
|
|
3865
|
+
return Yo[e] ?? null;
|
|
3828
3866
|
}
|
|
3829
|
-
function
|
|
3867
|
+
function Zo(e, t = {}, n = "change") {
|
|
3830
3868
|
if (!t?.type || e == null) return {
|
|
3831
3869
|
cleaned: e ?? "",
|
|
3832
3870
|
error: null
|
|
@@ -3909,7 +3947,7 @@ function qo(e, t = {}, n = "change") {
|
|
|
3909
3947
|
break;
|
|
3910
3948
|
}
|
|
3911
3949
|
case "email":
|
|
3912
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
3950
|
+
c = n === "blur" ? r.trim() : r, c && !Ko(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3913
3951
|
break;
|
|
3914
3952
|
case "websiteUrl":
|
|
3915
3953
|
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.`);
|
|
@@ -3921,21 +3959,21 @@ function qo(e, t = {}, n = "change") {
|
|
|
3921
3959
|
error: l
|
|
3922
3960
|
};
|
|
3923
3961
|
}
|
|
3924
|
-
var
|
|
3925
|
-
function
|
|
3962
|
+
var Qo = "This value is already present";
|
|
3963
|
+
function $o(e) {
|
|
3926
3964
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
3927
3965
|
}
|
|
3928
|
-
function
|
|
3929
|
-
if (
|
|
3966
|
+
function es(e) {
|
|
3967
|
+
if ($o(e) !== "unique") return null;
|
|
3930
3968
|
if (typeof e == "string") return {
|
|
3931
|
-
message:
|
|
3969
|
+
message: Qo,
|
|
3932
3970
|
normalizer: "trim",
|
|
3933
3971
|
skipBlank: !0,
|
|
3934
3972
|
validateOn: "blur"
|
|
3935
3973
|
};
|
|
3936
3974
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
3937
3975
|
return {
|
|
3938
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
3976
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : Qo,
|
|
3939
3977
|
collectionField: t.collectionField ?? "",
|
|
3940
3978
|
normalizer: String(t.normalizer ?? "trim"),
|
|
3941
3979
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -3946,20 +3984,20 @@ function Xo(e) {
|
|
|
3946
3984
|
].includes(n) ? n : "blur"
|
|
3947
3985
|
};
|
|
3948
3986
|
}
|
|
3949
|
-
function
|
|
3987
|
+
function ts(e) {
|
|
3950
3988
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
3951
3989
|
if (!Array.isArray(t)) return null;
|
|
3952
3990
|
for (let e of t) {
|
|
3953
|
-
let t =
|
|
3991
|
+
let t = es(e);
|
|
3954
3992
|
if (t) return t;
|
|
3955
3993
|
}
|
|
3956
3994
|
return null;
|
|
3957
3995
|
}
|
|
3958
|
-
function
|
|
3996
|
+
function ns(e = []) {
|
|
3959
3997
|
let t = [];
|
|
3960
3998
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3961
3999
|
(e?.fields ?? []).forEach((e) => {
|
|
3962
|
-
let n =
|
|
4000
|
+
let n = ts(e);
|
|
3963
4001
|
!n || !e?.field || t.push({
|
|
3964
4002
|
field: e.field,
|
|
3965
4003
|
label: e.label ?? e.field,
|
|
@@ -3968,10 +4006,10 @@ function Qo(e = []) {
|
|
|
3968
4006
|
});
|
|
3969
4007
|
}), t;
|
|
3970
4008
|
}
|
|
3971
|
-
function
|
|
4009
|
+
function rs(e) {
|
|
3972
4010
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
3973
4011
|
}
|
|
3974
|
-
function
|
|
4012
|
+
function is(e, t = "trim") {
|
|
3975
4013
|
if (e == null) return "";
|
|
3976
4014
|
let n = String(e);
|
|
3977
4015
|
switch (String(t)) {
|
|
@@ -3983,10 +4021,10 @@ function es(e, t = "trim") {
|
|
|
3983
4021
|
default: return n.trim();
|
|
3984
4022
|
}
|
|
3985
4023
|
}
|
|
3986
|
-
function
|
|
3987
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4024
|
+
function as(e, t) {
|
|
4025
|
+
return !(!e || e.skipBlank !== !1 && rs(t));
|
|
3988
4026
|
}
|
|
3989
|
-
function
|
|
4027
|
+
function os(e) {
|
|
3990
4028
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
3991
4029
|
}
|
|
3992
4030
|
var J = {
|
|
@@ -3996,21 +4034,21 @@ var J = {
|
|
|
3996
4034
|
STALE: "stale",
|
|
3997
4035
|
ERROR: "error"
|
|
3998
4036
|
};
|
|
3999
|
-
function
|
|
4037
|
+
function ss({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4000
4038
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4001
4039
|
}
|
|
4002
|
-
function
|
|
4040
|
+
function cs({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4003
4041
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4004
4042
|
function o(e) {
|
|
4005
4043
|
a = e, typeof t == "function" && t(a);
|
|
4006
4044
|
}
|
|
4007
4045
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4008
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4009
|
-
let p =
|
|
4046
|
+
if (!c || !t || !s || typeof e != "function" || !as(c, l)) return { status: J.SKIPPED };
|
|
4047
|
+
let p = ss({
|
|
4010
4048
|
module: t,
|
|
4011
4049
|
field: s,
|
|
4012
4050
|
recordId: u,
|
|
4013
|
-
normalized:
|
|
4051
|
+
normalized: is(l, c.normalizer)
|
|
4014
4052
|
});
|
|
4015
4053
|
if (n.has(p)) return n.get(p);
|
|
4016
4054
|
i += 1;
|
|
@@ -4028,7 +4066,7 @@ function is({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4028
4066
|
if (r.get(s) !== m) return { status: J.STALE };
|
|
4029
4067
|
let a = i?.available === !1 ? {
|
|
4030
4068
|
status: J.DUPLICATE,
|
|
4031
|
-
message:
|
|
4069
|
+
message: ls(i) || c.message || Qo
|
|
4032
4070
|
} : { status: J.AVAILABLE };
|
|
4033
4071
|
return n.set(p, a), a;
|
|
4034
4072
|
} catch (e) {
|
|
@@ -4049,17 +4087,17 @@ function is({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4049
4087
|
}
|
|
4050
4088
|
};
|
|
4051
4089
|
}
|
|
4052
|
-
function
|
|
4090
|
+
function ls(e) {
|
|
4053
4091
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4054
4092
|
}
|
|
4055
|
-
var
|
|
4056
|
-
function
|
|
4057
|
-
let r =
|
|
4093
|
+
var us = "__uniqueRule";
|
|
4094
|
+
function ds({ field: e, validation: t, context: n }) {
|
|
4095
|
+
let r = es(t);
|
|
4058
4096
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4059
4097
|
let i = e?.field ?? "";
|
|
4060
4098
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4061
|
-
[
|
|
4062
|
-
validateTrigger:
|
|
4099
|
+
[us]: r,
|
|
4100
|
+
validateTrigger: os(r),
|
|
4063
4101
|
validator: async (e, t) => {
|
|
4064
4102
|
let a = await n.checker.check({
|
|
4065
4103
|
module: n.module,
|
|
@@ -4074,22 +4112,22 @@ function ss({ field: e, validation: t, context: n }) {
|
|
|
4074
4112
|
}
|
|
4075
4113
|
};
|
|
4076
4114
|
}
|
|
4077
|
-
function
|
|
4115
|
+
function fs(e = []) {
|
|
4078
4116
|
let t = Array.isArray(e) ? e : [];
|
|
4079
|
-
if (!t.some((e) => e && e[
|
|
4080
|
-
let n = t.filter((e) => e && !e[
|
|
4117
|
+
if (!t.some((e) => e && e[us])) return t;
|
|
4118
|
+
let n = t.filter((e) => e && !e[us]);
|
|
4081
4119
|
return t.map((e) => {
|
|
4082
|
-
if (!e || !e[
|
|
4120
|
+
if (!e || !e[us]) return e;
|
|
4083
4121
|
let t = e.validator;
|
|
4084
4122
|
return {
|
|
4085
4123
|
...e,
|
|
4086
|
-
validator: async (e, r) => await
|
|
4124
|
+
validator: async (e, r) => await ps(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4087
4125
|
};
|
|
4088
4126
|
});
|
|
4089
4127
|
}
|
|
4090
|
-
async function
|
|
4128
|
+
async function ps(e = [], t, n = {}) {
|
|
4091
4129
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4092
|
-
if (r.required &&
|
|
4130
|
+
if (r.required && rs(t) || !rs(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;
|
|
4093
4131
|
if (typeof r.validator == "function") try {
|
|
4094
4132
|
await r.validator(n, t);
|
|
4095
4133
|
} catch {
|
|
@@ -4098,7 +4136,7 @@ async function ls(e = [], t, n = {}) {
|
|
|
4098
4136
|
}
|
|
4099
4137
|
return !1;
|
|
4100
4138
|
}
|
|
4101
|
-
function
|
|
4139
|
+
function ms(e) {
|
|
4102
4140
|
let t = String(e ?? "").trim();
|
|
4103
4141
|
if (!t.startsWith("{")) return null;
|
|
4104
4142
|
try {
|
|
@@ -4107,19 +4145,19 @@ function us(e) {
|
|
|
4107
4145
|
return null;
|
|
4108
4146
|
}
|
|
4109
4147
|
}
|
|
4110
|
-
function
|
|
4148
|
+
function hs(e) {
|
|
4111
4149
|
if (!e) return null;
|
|
4112
|
-
if (typeof e == "string") return
|
|
4150
|
+
if (typeof e == "string") return ms(e);
|
|
4113
4151
|
let t = [
|
|
4114
4152
|
e.data,
|
|
4115
4153
|
e.response,
|
|
4116
4154
|
e,
|
|
4117
|
-
|
|
4155
|
+
ms(e.message)
|
|
4118
4156
|
];
|
|
4119
4157
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4120
4158
|
return null;
|
|
4121
4159
|
}
|
|
4122
|
-
function
|
|
4160
|
+
function gs({ field: e, group: t, rowIndex: n }) {
|
|
4123
4161
|
let r = String(e ?? ""), i = Number(n);
|
|
4124
4162
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4125
4163
|
String(t),
|
|
@@ -4127,14 +4165,14 @@ function fs({ field: e, group: t, rowIndex: n }) {
|
|
|
4127
4165
|
...r.split(".")
|
|
4128
4166
|
] : r;
|
|
4129
4167
|
}
|
|
4130
|
-
function
|
|
4131
|
-
let n =
|
|
4168
|
+
function _s(e, { uniqueRules: t = [] } = {}) {
|
|
4169
|
+
let n = hs(e);
|
|
4132
4170
|
if (n) {
|
|
4133
4171
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4134
4172
|
let t = {
|
|
4135
4173
|
field: e.field,
|
|
4136
|
-
name:
|
|
4137
|
-
message: e.message || n.message ||
|
|
4174
|
+
name: gs(e),
|
|
4175
|
+
message: e.message || n.message || Qo
|
|
4138
4176
|
};
|
|
4139
4177
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4140
4178
|
});
|
|
@@ -4151,7 +4189,7 @@ function ps(e, { uniqueRules: t = [] } = {}) {
|
|
|
4151
4189
|
}
|
|
4152
4190
|
//#endregion
|
|
4153
4191
|
//#region src/services/uniqueValidationApi.js
|
|
4154
|
-
async function
|
|
4192
|
+
async function vs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4155
4193
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4156
4194
|
let c = {
|
|
4157
4195
|
field: t,
|
|
@@ -4185,7 +4223,7 @@ async function ms({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4185
4223
|
throw e;
|
|
4186
4224
|
}
|
|
4187
4225
|
}
|
|
4188
|
-
async function
|
|
4226
|
+
async function ys({ module: e, payload: t, excludeId: n } = {}) {
|
|
4189
4227
|
if (!e || !t) return { duplicate: !1 };
|
|
4190
4228
|
try {
|
|
4191
4229
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4203,7 +4241,7 @@ async function hs({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4203
4241
|
}
|
|
4204
4242
|
//#endregion
|
|
4205
4243
|
//#region src/components/form/uploadAccept.js
|
|
4206
|
-
var
|
|
4244
|
+
var bs = [
|
|
4207
4245
|
"jpg",
|
|
4208
4246
|
"jpeg",
|
|
4209
4247
|
"png",
|
|
@@ -4212,18 +4250,18 @@ var gs = [
|
|
|
4212
4250
|
"bmp",
|
|
4213
4251
|
"svg",
|
|
4214
4252
|
"avif"
|
|
4215
|
-
],
|
|
4253
|
+
], xs = [
|
|
4216
4254
|
"mp4",
|
|
4217
4255
|
"webm",
|
|
4218
4256
|
"ogg",
|
|
4219
4257
|
"ogv",
|
|
4220
4258
|
"mov",
|
|
4221
4259
|
"m4v"
|
|
4222
|
-
],
|
|
4260
|
+
], Ss = [
|
|
4223
4261
|
"pdf",
|
|
4224
4262
|
"doc",
|
|
4225
4263
|
"docx"
|
|
4226
|
-
],
|
|
4264
|
+
], Cs = [
|
|
4227
4265
|
{
|
|
4228
4266
|
label: "Any file",
|
|
4229
4267
|
value: "any"
|
|
@@ -4248,45 +4286,45 @@ var gs = [
|
|
|
4248
4286
|
label: "Images & Videos",
|
|
4249
4287
|
value: "imagesAndVideos"
|
|
4250
4288
|
}
|
|
4251
|
-
],
|
|
4289
|
+
], ws = {
|
|
4252
4290
|
resume: {
|
|
4253
|
-
exts:
|
|
4291
|
+
exts: Ss,
|
|
4254
4292
|
maxSizeMB: 2,
|
|
4255
4293
|
hint: "PDF, DOC or DOCX",
|
|
4256
4294
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4257
4295
|
},
|
|
4258
4296
|
documents: {
|
|
4259
|
-
exts: [...
|
|
4297
|
+
exts: [...Ss, ...bs],
|
|
4260
4298
|
hint: "PDF, DOC or image files",
|
|
4261
4299
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4262
4300
|
},
|
|
4263
4301
|
images: {
|
|
4264
|
-
exts:
|
|
4302
|
+
exts: bs,
|
|
4265
4303
|
hint: "Image files",
|
|
4266
4304
|
error: "Only image files are allowed"
|
|
4267
4305
|
},
|
|
4268
4306
|
videos: {
|
|
4269
|
-
exts:
|
|
4307
|
+
exts: xs,
|
|
4270
4308
|
hint: "Video files",
|
|
4271
4309
|
error: "Only video files are allowed"
|
|
4272
4310
|
},
|
|
4273
4311
|
imagesAndVideos: {
|
|
4274
|
-
exts: [...
|
|
4312
|
+
exts: [...bs, ...xs],
|
|
4275
4313
|
hint: "Image or video files",
|
|
4276
4314
|
error: "Only image or video files are allowed"
|
|
4277
4315
|
}
|
|
4278
4316
|
};
|
|
4279
|
-
function
|
|
4317
|
+
function Ts(e) {
|
|
4280
4318
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4281
4319
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4282
4320
|
}
|
|
4283
|
-
function
|
|
4321
|
+
function Es(e) {
|
|
4284
4322
|
let t = String(e?.accept ?? "").trim();
|
|
4285
|
-
return t && t !== "any" ?
|
|
4323
|
+
return t && t !== "any" ? ws[t] ?? null : !t && Ts(e) ? ws.resume : ws[t] ?? null;
|
|
4286
4324
|
}
|
|
4287
4325
|
//#endregion
|
|
4288
4326
|
//#region src/components/form/quickActionLabels.js
|
|
4289
|
-
var
|
|
4327
|
+
var Ds = /* @__PURE__ */ new Set([
|
|
4290
4328
|
"of",
|
|
4291
4329
|
"and",
|
|
4292
4330
|
"the",
|
|
@@ -4295,7 +4333,7 @@ var Cs = /* @__PURE__ */ new Set([
|
|
|
4295
4333
|
"in",
|
|
4296
4334
|
"a",
|
|
4297
4335
|
"an"
|
|
4298
|
-
]),
|
|
4336
|
+
]), Os = {
|
|
4299
4337
|
addresses: "address",
|
|
4300
4338
|
branches: "branch",
|
|
4301
4339
|
batches: "batch",
|
|
@@ -4306,43 +4344,43 @@ var Cs = /* @__PURE__ */ new Set([
|
|
|
4306
4344
|
people: "person",
|
|
4307
4345
|
statuses: "status"
|
|
4308
4346
|
};
|
|
4309
|
-
function
|
|
4347
|
+
function ks(e) {
|
|
4310
4348
|
let t = String(e ?? "").trim();
|
|
4311
4349
|
if (!t) return "";
|
|
4312
4350
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4313
4351
|
let n = t.toLowerCase();
|
|
4314
|
-
return
|
|
4352
|
+
return Os[n] ? Os[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;
|
|
4315
4353
|
}
|
|
4316
4354
|
function Y(e) {
|
|
4317
4355
|
let t = String(e ?? "").trim();
|
|
4318
4356
|
if (!t) return "";
|
|
4319
4357
|
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);
|
|
4320
4358
|
if (!n.length) return "";
|
|
4321
|
-
let r =
|
|
4359
|
+
let r = ks(n[n.length - 1]);
|
|
4322
4360
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4323
4361
|
let n = e.toLowerCase();
|
|
4324
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4362
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Ds.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4325
4363
|
}).join(" ");
|
|
4326
4364
|
}
|
|
4327
|
-
function
|
|
4365
|
+
function As(e, t) {
|
|
4328
4366
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4329
4367
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4330
4368
|
let r = Y(e?.quickCreateModule || t);
|
|
4331
4369
|
return r ? `Add New ${r}` : "Add New";
|
|
4332
4370
|
}
|
|
4333
|
-
function
|
|
4371
|
+
function js(e, t) {
|
|
4334
4372
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4335
4373
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4336
4374
|
let r = Y(e?.quickEditModule || t);
|
|
4337
4375
|
return r ? `Edit ${r}` : "Edit";
|
|
4338
4376
|
}
|
|
4339
|
-
function
|
|
4377
|
+
function Ms(e, t, n) {
|
|
4340
4378
|
let r = Y((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4341
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4379
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : As(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : js(t, n));
|
|
4342
4380
|
}
|
|
4343
4381
|
//#endregion
|
|
4344
4382
|
//#region src/components/AppButton.jsx
|
|
4345
|
-
function
|
|
4383
|
+
function Ns({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4346
4384
|
let o = /* @__PURE__ */ C(y, {
|
|
4347
4385
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4348
4386
|
icon: n,
|
|
@@ -4357,13 +4395,13 @@ function ks({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4357
4395
|
}
|
|
4358
4396
|
//#endregion
|
|
4359
4397
|
//#region src/components/detail/userNames.js
|
|
4360
|
-
function
|
|
4398
|
+
function Ps(e) {
|
|
4361
4399
|
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 || "";
|
|
4362
4400
|
}
|
|
4363
|
-
function
|
|
4401
|
+
function Fs(e) {
|
|
4364
4402
|
let t = {};
|
|
4365
4403
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4366
|
-
let n =
|
|
4404
|
+
let n = Ps(e);
|
|
4367
4405
|
n && [
|
|
4368
4406
|
e.legacyUserId,
|
|
4369
4407
|
e.userId,
|
|
@@ -4377,16 +4415,16 @@ function js(e) {
|
|
|
4377
4415
|
});
|
|
4378
4416
|
}), t;
|
|
4379
4417
|
}
|
|
4380
|
-
var
|
|
4381
|
-
function
|
|
4418
|
+
var Is = /* @__PURE__ */ new Map();
|
|
4419
|
+
function Ls(e) {
|
|
4382
4420
|
let t = String(e ?? "").trim();
|
|
4383
4421
|
if (!t) return Promise.resolve("");
|
|
4384
|
-
if (
|
|
4385
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4386
|
-
return
|
|
4422
|
+
if (Is.has(t)) return Is.get(t);
|
|
4423
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => Ps(e?.data ?? e ?? null)).catch(() => "");
|
|
4424
|
+
return Is.set(t, n), n;
|
|
4387
4425
|
}
|
|
4388
4426
|
var X = (e) => e == null ? "" : String(e).trim();
|
|
4389
|
-
function
|
|
4427
|
+
function Rs(e) {
|
|
4390
4428
|
let t = e?.quickCreateNotice;
|
|
4391
4429
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4392
4430
|
enabled: !0,
|
|
@@ -4399,7 +4437,7 @@ function Ps(e) {
|
|
|
4399
4437
|
creatorLabel: X(t.creatorLabel) || "Created by"
|
|
4400
4438
|
};
|
|
4401
4439
|
}
|
|
4402
|
-
var
|
|
4440
|
+
var zs = [
|
|
4403
4441
|
"clientName",
|
|
4404
4442
|
"companyName",
|
|
4405
4443
|
"name",
|
|
@@ -4409,24 +4447,24 @@ var Fs = [
|
|
|
4409
4447
|
"label",
|
|
4410
4448
|
"employerName",
|
|
4411
4449
|
"vendorName"
|
|
4412
|
-
],
|
|
4450
|
+
], Bs = (e, t) => {
|
|
4413
4451
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4414
|
-
},
|
|
4415
|
-
function
|
|
4452
|
+
}, Vs = (e) => typeof e == "string" || typeof e == "number" ? X(e) : e && typeof e == "object" ? X(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4453
|
+
function Hs(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4416
4454
|
if (!e || typeof e != "object") return "";
|
|
4417
4455
|
for (let r of [
|
|
4418
4456
|
t,
|
|
4419
4457
|
n,
|
|
4420
|
-
...
|
|
4458
|
+
...zs
|
|
4421
4459
|
]) {
|
|
4422
4460
|
if (!r) continue;
|
|
4423
|
-
let t =
|
|
4461
|
+
let t = Vs(Bs(e, r));
|
|
4424
4462
|
if (t) return t;
|
|
4425
4463
|
}
|
|
4426
4464
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4427
4465
|
return r ? X(e[r]) : "";
|
|
4428
4466
|
}
|
|
4429
|
-
function
|
|
4467
|
+
function Us(e) {
|
|
4430
4468
|
if (!e || typeof e != "object") return "";
|
|
4431
4469
|
let t = [
|
|
4432
4470
|
e.createdBy,
|
|
@@ -4448,36 +4486,36 @@ function zs(e) {
|
|
|
4448
4486
|
}
|
|
4449
4487
|
return "";
|
|
4450
4488
|
}
|
|
4451
|
-
function
|
|
4489
|
+
function Ws(e = i) {
|
|
4452
4490
|
try {
|
|
4453
|
-
return
|
|
4491
|
+
return Ps(e()) || "";
|
|
4454
4492
|
} catch {
|
|
4455
4493
|
return "";
|
|
4456
4494
|
}
|
|
4457
4495
|
}
|
|
4458
|
-
var
|
|
4496
|
+
var Gs = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4459
4497
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4460
4498
|
return Array.isArray(t) ? t[0] : t;
|
|
4461
4499
|
});
|
|
4462
|
-
async function
|
|
4463
|
-
let { fetchRecord: o =
|
|
4500
|
+
async function Ks({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4501
|
+
let { fetchRecord: o = Gs, fetchUserNameFn: s = Ls, getUser: c = i } = a, l = null;
|
|
4464
4502
|
if (e && t) try {
|
|
4465
4503
|
l = await o(e, t);
|
|
4466
4504
|
} catch {
|
|
4467
4505
|
l = null;
|
|
4468
4506
|
}
|
|
4469
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4507
|
+
let u = n?.showRecordName === !1 ? "" : Hs(l, {
|
|
4470
4508
|
recordNameField: n?.recordNameField,
|
|
4471
4509
|
displayField: r
|
|
4472
4510
|
}), d = "";
|
|
4473
4511
|
if (n?.showCreator !== !1) {
|
|
4474
|
-
let e =
|
|
4512
|
+
let e = Us(l);
|
|
4475
4513
|
if (e) try {
|
|
4476
4514
|
d = X(await s(e));
|
|
4477
4515
|
} catch {
|
|
4478
4516
|
d = "";
|
|
4479
4517
|
}
|
|
4480
|
-
d ||=
|
|
4518
|
+
d ||= Ws(c);
|
|
4481
4519
|
}
|
|
4482
4520
|
return {
|
|
4483
4521
|
recordName: u,
|
|
@@ -4486,17 +4524,17 @@ async function Hs({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
4486
4524
|
}
|
|
4487
4525
|
//#endregion
|
|
4488
4526
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4489
|
-
var
|
|
4490
|
-
function
|
|
4527
|
+
var qs = d(() => import("./index.js").then((e) => e.i)), Js = d(() => import("./index.js").then((e) => e.n)), Ys = (e) => e == null || e === "", Xs = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4528
|
+
function Zs(e, t, n, r, i) {
|
|
4491
4529
|
let a = e.quickEditIdFrom;
|
|
4492
4530
|
if (a) {
|
|
4493
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4494
|
-
return
|
|
4531
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Xs(a)] : Xs(a), i = t?.getFieldValue?.(e);
|
|
4532
|
+
return Ys(i) && (i = r?.[a]), Ys(i) ? null : i;
|
|
4495
4533
|
}
|
|
4496
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4534
|
+
return i && typeof i == "object" ? i.value ?? null : Ys(i) ? null : i;
|
|
4497
4535
|
}
|
|
4498
|
-
function
|
|
4499
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", v = m(() => p ?
|
|
4536
|
+
function Qs({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4537
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", v = m(() => p ? Zs(e, t, n, i, a) : null, [
|
|
4500
4538
|
p,
|
|
4501
4539
|
e,
|
|
4502
4540
|
t,
|
|
@@ -4526,12 +4564,12 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4526
4564
|
module: _,
|
|
4527
4565
|
recordId: String(v)
|
|
4528
4566
|
}), ie = (t) => {
|
|
4529
|
-
let n =
|
|
4567
|
+
let n = Rs(e);
|
|
4530
4568
|
n && (d({
|
|
4531
4569
|
...n,
|
|
4532
4570
|
recordName: "",
|
|
4533
4571
|
creatorName: ""
|
|
4534
|
-
}),
|
|
4572
|
+
}), Ks({
|
|
4535
4573
|
module: h,
|
|
4536
4574
|
recordId: t,
|
|
4537
4575
|
notice: n,
|
|
@@ -4561,7 +4599,7 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4561
4599
|
icon: /* @__PURE__ */ C(me, {}),
|
|
4562
4600
|
onClick: x,
|
|
4563
4601
|
style: { paddingLeft: 0 },
|
|
4564
|
-
children:
|
|
4602
|
+
children: As(e, h)
|
|
4565
4603
|
}), p && /* @__PURE__ */ C(y, {
|
|
4566
4604
|
type: "link",
|
|
4567
4605
|
size: "small",
|
|
@@ -4569,12 +4607,12 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4569
4607
|
onClick: re,
|
|
4570
4608
|
disabled: !v,
|
|
4571
4609
|
title: v ? void 0 : `Choose a ${Y(_) || "record"} above first, then edit it here`,
|
|
4572
|
-
children:
|
|
4610
|
+
children: js(e, _)
|
|
4573
4611
|
})]
|
|
4574
4612
|
})
|
|
4575
4613
|
}), ae = s ? /* @__PURE__ */ C(ee, {
|
|
4576
4614
|
open: !0,
|
|
4577
|
-
title:
|
|
4615
|
+
title: Ms(s.mode, e, s.mode === "create" ? h : _),
|
|
4578
4616
|
width: "min(1080px, 96vw)",
|
|
4579
4617
|
footer: null,
|
|
4580
4618
|
destroyOnClose: !0,
|
|
@@ -4592,7 +4630,7 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4592
4630
|
},
|
|
4593
4631
|
children: /* @__PURE__ */ C(ne, {})
|
|
4594
4632
|
}),
|
|
4595
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4633
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(qs, {
|
|
4596
4634
|
moduleName: s.module,
|
|
4597
4635
|
embedded: !0,
|
|
4598
4636
|
breadcrumbItems: [],
|
|
@@ -4600,7 +4638,7 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4600
4638
|
onSuccess: (e) => {
|
|
4601
4639
|
b(), ie(e), o?.("create", e);
|
|
4602
4640
|
}
|
|
4603
|
-
}) : /* @__PURE__ */ C(
|
|
4641
|
+
}) : /* @__PURE__ */ C(Js, {
|
|
4604
4642
|
moduleName: s.module,
|
|
4605
4643
|
recordId: s.recordId,
|
|
4606
4644
|
embedded: !0,
|
|
@@ -4624,7 +4662,7 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4624
4662
|
width: "min(520px, 94vw)",
|
|
4625
4663
|
maskClosable: !1,
|
|
4626
4664
|
onCancel: () => d(null),
|
|
4627
|
-
footer: /* @__PURE__ */ C(
|
|
4665
|
+
footer: /* @__PURE__ */ C(Ns, {
|
|
4628
4666
|
variant: "primary",
|
|
4629
4667
|
type: "primary",
|
|
4630
4668
|
onClick: () => d(null),
|
|
@@ -4661,8 +4699,8 @@ function Js({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4661
4699
|
}
|
|
4662
4700
|
//#endregion
|
|
4663
4701
|
//#region src/components/form/crossFieldRules.js
|
|
4664
|
-
var
|
|
4665
|
-
function
|
|
4702
|
+
var $s = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4703
|
+
function ec(e, t, n) {
|
|
4666
4704
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4667
4705
|
if (typeof n == "function") {
|
|
4668
4706
|
let e = n(t);
|
|
@@ -4670,23 +4708,23 @@ function Xs(e, t, n) {
|
|
|
4670
4708
|
}
|
|
4671
4709
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4672
4710
|
}
|
|
4673
|
-
function
|
|
4711
|
+
function tc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4674
4712
|
let s = n.field ?? n.compareField ?? r;
|
|
4675
4713
|
return { validator: async (n, r) => {
|
|
4676
|
-
if (!s ||
|
|
4677
|
-
let c = i?.getFieldValue?.(
|
|
4678
|
-
if (
|
|
4714
|
+
if (!s || $s(r)) return Promise.resolve();
|
|
4715
|
+
let c = i?.getFieldValue?.(ec(a, s, o));
|
|
4716
|
+
if ($s(c)) return Promise.resolve();
|
|
4679
4717
|
let l = Number(c), u = Number(r);
|
|
4680
4718
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4681
4719
|
} };
|
|
4682
4720
|
}
|
|
4683
|
-
function
|
|
4721
|
+
function nc(e = {}, t, n) {
|
|
4684
4722
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4685
|
-
return r ?
|
|
4723
|
+
return r ? ec(t, r, n) : null;
|
|
4686
4724
|
}
|
|
4687
4725
|
//#endregion
|
|
4688
4726
|
//#region src/components/form/maxCeiling.js
|
|
4689
|
-
function
|
|
4727
|
+
function rc(e, t) {
|
|
4690
4728
|
let n = String(t).split(".").filter(Boolean);
|
|
4691
4729
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4692
4730
|
if (n.length > 1) {
|
|
@@ -4699,14 +4737,14 @@ function $s(e, t) {
|
|
|
4699
4737
|
let r = [...e];
|
|
4700
4738
|
return r[r.length - 1] = n[0], r;
|
|
4701
4739
|
}
|
|
4702
|
-
function
|
|
4703
|
-
let r = e?.getFieldValue?.(
|
|
4740
|
+
function ic(e, t, n) {
|
|
4741
|
+
let r = e?.getFieldValue?.(rc(t, n));
|
|
4704
4742
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4705
4743
|
}
|
|
4706
|
-
function
|
|
4744
|
+
function ac(e) {
|
|
4707
4745
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4708
4746
|
}
|
|
4709
|
-
function
|
|
4747
|
+
function oc(e, t) {
|
|
4710
4748
|
for (let n of e ?? []) {
|
|
4711
4749
|
let e = t(n);
|
|
4712
4750
|
if (e == null || e === "") continue;
|
|
@@ -4718,14 +4756,14 @@ function nc(e, t) {
|
|
|
4718
4756
|
}
|
|
4719
4757
|
return null;
|
|
4720
4758
|
}
|
|
4721
|
-
function
|
|
4759
|
+
function sc({ input: e, compareFields: t, readValue: n }) {
|
|
4722
4760
|
let r = {
|
|
4723
4761
|
ok: !0,
|
|
4724
4762
|
field: null,
|
|
4725
4763
|
maximum: null
|
|
4726
4764
|
};
|
|
4727
4765
|
if (e == null || e === "") return r;
|
|
4728
|
-
let i =
|
|
4766
|
+
let i = oc(t, n);
|
|
4729
4767
|
if (!i) return r;
|
|
4730
4768
|
let a = Number(e);
|
|
4731
4769
|
return Number.isFinite(a) ? {
|
|
@@ -4736,39 +4774,39 @@ function rc({ input: e, compareFields: t, readValue: n }) {
|
|
|
4736
4774
|
}
|
|
4737
4775
|
//#endregion
|
|
4738
4776
|
//#region src/components/form/contextPrefill.js
|
|
4739
|
-
var
|
|
4740
|
-
function
|
|
4777
|
+
var cc = { candidates: ["applicantId"] };
|
|
4778
|
+
function lc(e) {
|
|
4741
4779
|
let t = String(e ?? "").trim();
|
|
4742
4780
|
if (!t) return [];
|
|
4743
4781
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4744
4782
|
return [.../* @__PURE__ */ new Set([
|
|
4745
4783
|
`${n}Id`,
|
|
4746
4784
|
`${t}Id`,
|
|
4747
|
-
...
|
|
4785
|
+
...cc[t] ?? []
|
|
4748
4786
|
])];
|
|
4749
4787
|
}
|
|
4750
|
-
function
|
|
4788
|
+
function uc(e, t) {
|
|
4751
4789
|
if (!t) return "";
|
|
4752
4790
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4753
|
-
for (let r of
|
|
4791
|
+
for (let r of lc(e)) {
|
|
4754
4792
|
let e = String(n(t[r]) || "");
|
|
4755
4793
|
if (e) return e;
|
|
4756
4794
|
}
|
|
4757
4795
|
return "";
|
|
4758
4796
|
}
|
|
4759
|
-
function
|
|
4797
|
+
function dc(e, t) {
|
|
4760
4798
|
let n = /* @__PURE__ */ new Set();
|
|
4761
4799
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4762
4800
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4763
4801
|
})), [...n];
|
|
4764
4802
|
}
|
|
4765
|
-
function
|
|
4803
|
+
function fc(e) {
|
|
4766
4804
|
return e?.payloadMode === "skip";
|
|
4767
4805
|
}
|
|
4768
|
-
function
|
|
4806
|
+
function pc(e) {
|
|
4769
4807
|
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 : [];
|
|
4770
4808
|
}
|
|
4771
|
-
function
|
|
4809
|
+
function mc(e) {
|
|
4772
4810
|
let t = {};
|
|
4773
4811
|
return (e ?? []).forEach((e) => {
|
|
4774
4812
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4776,7 +4814,7 @@ function uc(e) {
|
|
|
4776
4814
|
});
|
|
4777
4815
|
}), t;
|
|
4778
4816
|
}
|
|
4779
|
-
function
|
|
4817
|
+
function hc(e, t) {
|
|
4780
4818
|
if (!e || !t) return;
|
|
4781
4819
|
let n = e;
|
|
4782
4820
|
for (let e of String(t).split(".")) {
|
|
@@ -4791,7 +4829,7 @@ function dc(e, t) {
|
|
|
4791
4829
|
}
|
|
4792
4830
|
return n;
|
|
4793
4831
|
}
|
|
4794
|
-
function
|
|
4832
|
+
function gc(e, t) {
|
|
4795
4833
|
if (!(!e || !t)) for (let n of [
|
|
4796
4834
|
t.prefillFrom,
|
|
4797
4835
|
t.field,
|
|
@@ -4799,12 +4837,12 @@ function fc(e, t) {
|
|
|
4799
4837
|
]) {
|
|
4800
4838
|
if (!n) continue;
|
|
4801
4839
|
let t = e[n];
|
|
4802
|
-
if (t ??= B(e, n), t ??=
|
|
4840
|
+
if (t ??= B(e, n), t ??= hc(e, n), t != null) return t;
|
|
4803
4841
|
}
|
|
4804
4842
|
}
|
|
4805
4843
|
//#endregion
|
|
4806
4844
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
4807
|
-
function
|
|
4845
|
+
function _c({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
4808
4846
|
let a = Ni(t), o = x.useWatch(n, e);
|
|
4809
4847
|
if (!a) return null;
|
|
4810
4848
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
@@ -4816,7 +4854,7 @@ function pc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4816
4854
|
e.setFieldValue(n, !1), c();
|
|
4817
4855
|
return;
|
|
4818
4856
|
}
|
|
4819
|
-
let i = await
|
|
4857
|
+
let i = await Va(Bi(t));
|
|
4820
4858
|
e.setFieldValue(n, !!i), c();
|
|
4821
4859
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
4822
4860
|
return /* @__PURE__ */ C(re, {
|
|
@@ -4835,34 +4873,34 @@ function pc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4835
4873
|
}
|
|
4836
4874
|
//#endregion
|
|
4837
4875
|
//#region src/components/form/prefillWhenRules.js
|
|
4838
|
-
var
|
|
4839
|
-
function
|
|
4876
|
+
var vc = (e) => String(e ?? "");
|
|
4877
|
+
function yc(e) {
|
|
4840
4878
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4841
4879
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4842
4880
|
let r = e?.field;
|
|
4843
4881
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
4844
4882
|
}), n;
|
|
4845
4883
|
}
|
|
4846
|
-
function
|
|
4847
|
-
return
|
|
4884
|
+
function bc(e, t, n, r) {
|
|
4885
|
+
return yc(e).map((e) => ({
|
|
4848
4886
|
field: e,
|
|
4849
4887
|
path: n(t, e, r)
|
|
4850
4888
|
}));
|
|
4851
4889
|
}
|
|
4852
|
-
function
|
|
4853
|
-
return !e || !e.field ? !1 :
|
|
4890
|
+
function xc(e, t = {}) {
|
|
4891
|
+
return !e || !e.field ? !1 : vc(t[e.field]) === vc(e.value);
|
|
4854
4892
|
}
|
|
4855
|
-
function
|
|
4856
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
4893
|
+
function Sc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
4894
|
+
let o = (Array.isArray(e) ? e : []).find((e) => xc(e, t));
|
|
4857
4895
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
4858
4896
|
action: "set",
|
|
4859
4897
|
value: o.setValue
|
|
4860
|
-
} : i && r !== void 0 &&
|
|
4898
|
+
} : i && r !== void 0 && vc(n) === vc(r) ? { action: "clear" } : { action: "none" };
|
|
4861
4899
|
}
|
|
4862
4900
|
//#endregion
|
|
4863
4901
|
//#region src/components/form/optionConstraints.js
|
|
4864
4902
|
var Z = (e) => String(e ?? "").trim().toLowerCase();
|
|
4865
|
-
function
|
|
4903
|
+
function Cc(e) {
|
|
4866
4904
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
4867
4905
|
return t.forEach((e) => {
|
|
4868
4906
|
if (e != null && e !== "") {
|
|
@@ -4882,42 +4920,42 @@ function yc(e) {
|
|
|
4882
4920
|
}
|
|
4883
4921
|
}), n;
|
|
4884
4922
|
}
|
|
4885
|
-
function
|
|
4886
|
-
let n =
|
|
4923
|
+
function wc(e = [], t) {
|
|
4924
|
+
let n = Cc(t);
|
|
4887
4925
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4888
4926
|
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(Z(e.value)) || r.has(Z(e.label)) : r.has(Z(e)));
|
|
4889
4927
|
return i.length > 0 ? i : e;
|
|
4890
4928
|
}
|
|
4891
|
-
function
|
|
4929
|
+
function Tc(e) {
|
|
4892
4930
|
let t = [];
|
|
4893
4931
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
4894
4932
|
e != null && e !== "" && t.push(Z(e));
|
|
4895
4933
|
}), t;
|
|
4896
4934
|
}
|
|
4897
|
-
function
|
|
4935
|
+
function Ec(e, t = {}) {
|
|
4898
4936
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
4899
4937
|
return n.forEach((e) => {
|
|
4900
4938
|
if (!e || e.clearValue) return;
|
|
4901
|
-
let n =
|
|
4939
|
+
let n = Tc(e);
|
|
4902
4940
|
if (!n.length) return;
|
|
4903
|
-
let a =
|
|
4941
|
+
let a = xc(e, t) ? i : r;
|
|
4904
4942
|
n.forEach((e) => a.add(e));
|
|
4905
4943
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
4906
4944
|
}
|
|
4907
|
-
function
|
|
4908
|
-
let r =
|
|
4945
|
+
function Dc(e = [], t, n) {
|
|
4946
|
+
let r = Ec(t, n);
|
|
4909
4947
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4910
4948
|
let i = new Set(r);
|
|
4911
4949
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Z(e.value)) || i.has(Z(e.label))) : !i.has(Z(e)));
|
|
4912
4950
|
}
|
|
4913
|
-
function
|
|
4951
|
+
function Oc(e, t = {}, n) {
|
|
4914
4952
|
let r = Array.isArray(e) ? e : [];
|
|
4915
4953
|
if (n == null || n === "") return [];
|
|
4916
4954
|
let i = Z(n), a = [], o = /* @__PURE__ */ new Set();
|
|
4917
4955
|
return r.forEach((e) => {
|
|
4918
4956
|
if (!e || e.clearValue) return;
|
|
4919
4957
|
let { setValue: n, setValueLabel: r } = e;
|
|
4920
|
-
n != null && n !== "" && r && Z(n) === i &&
|
|
4958
|
+
n != null && n !== "" && r && Z(n) === i && xc(e, t) && (o.has(Z(n)) || (o.add(Z(n)), a.push({
|
|
4921
4959
|
value: n,
|
|
4922
4960
|
label: r
|
|
4923
4961
|
})));
|
|
@@ -4925,8 +4963,8 @@ function wc(e, t = {}, n) {
|
|
|
4925
4963
|
}
|
|
4926
4964
|
//#endregion
|
|
4927
4965
|
//#region src/components/form/optionRowFilters.js
|
|
4928
|
-
var
|
|
4929
|
-
function
|
|
4966
|
+
var kc = 64;
|
|
4967
|
+
function Ac(e) {
|
|
4930
4968
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
4931
4969
|
try {
|
|
4932
4970
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -4934,34 +4972,34 @@ function Ec(e) {
|
|
|
4934
4972
|
return "";
|
|
4935
4973
|
}
|
|
4936
4974
|
}
|
|
4937
|
-
var Q = (e) => String(e ?? "").trim().toLowerCase(),
|
|
4938
|
-
function
|
|
4975
|
+
var Q = (e) => String(e ?? "").trim().toLowerCase(), jc = (e) => e != null && String(e).trim() !== "";
|
|
4976
|
+
function Mc(e) {
|
|
4939
4977
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
4940
4978
|
return new Set(t.map(Q).filter((e) => e !== ""));
|
|
4941
4979
|
}
|
|
4942
|
-
function
|
|
4943
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
4980
|
+
function Nc(e, t) {
|
|
4981
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => jc(e?.extraData?.[t]));
|
|
4944
4982
|
}
|
|
4945
|
-
function
|
|
4983
|
+
function Pc(e, t, n) {
|
|
4946
4984
|
let r = e?.extraData?.[t];
|
|
4947
|
-
if (!
|
|
4948
|
-
let i =
|
|
4985
|
+
if (!jc(n)) return r === !0;
|
|
4986
|
+
let i = Mc(n);
|
|
4949
4987
|
return i.size === 0 ? r === !0 : i.has(Q(r));
|
|
4950
4988
|
}
|
|
4951
|
-
function
|
|
4989
|
+
function Fc(e, t) {
|
|
4952
4990
|
let n = /* @__PURE__ */ new Map();
|
|
4953
4991
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4954
4992
|
let r = Q(e?.value);
|
|
4955
4993
|
r && n.set(r, Q(e?.extraData?.[t]));
|
|
4956
4994
|
}), n;
|
|
4957
4995
|
}
|
|
4958
|
-
function
|
|
4996
|
+
function Ic(e, t, n) {
|
|
4959
4997
|
let r = Q(n);
|
|
4960
4998
|
if (!r) return !1;
|
|
4961
4999
|
let i = /* @__PURE__ */ new Set(), a = Q(e);
|
|
4962
5000
|
if (!a) return !1;
|
|
4963
5001
|
i.add(a);
|
|
4964
|
-
for (let e = 0; e <
|
|
5002
|
+
for (let e = 0; e < kc; e += 1) {
|
|
4965
5003
|
let e = t.get(a);
|
|
4966
5004
|
if (!e) return !1;
|
|
4967
5005
|
if (e === r) return !0;
|
|
@@ -4970,67 +5008,74 @@ function Mc(e, t, n) {
|
|
|
4970
5008
|
}
|
|
4971
5009
|
return !1;
|
|
4972
5010
|
}
|
|
4973
|
-
function
|
|
5011
|
+
function Lc(e = {}) {
|
|
4974
5012
|
let t = [], n = (e) => {
|
|
4975
5013
|
let n = String(e ?? "").trim();
|
|
4976
5014
|
n && !t.includes(n) && t.push(n);
|
|
4977
5015
|
};
|
|
4978
5016
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
4979
5017
|
}
|
|
4980
|
-
function
|
|
5018
|
+
function Rc(e, t = {}, n = {}) {
|
|
4981
5019
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
4982
5020
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
4983
5021
|
typeof console < "u" && console.warn(e);
|
|
4984
5022
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
4985
|
-
s && (
|
|
5023
|
+
s && (Nc(o, s) ? o = o.filter((e) => Pc(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".`));
|
|
4986
5024
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
4987
5025
|
if (c) {
|
|
4988
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5026
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Ac(n);
|
|
4989
5027
|
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.`);
|
|
4990
|
-
else if (!
|
|
5028
|
+
else if (!Nc(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".`);
|
|
4991
5029
|
else {
|
|
4992
|
-
let t =
|
|
4993
|
-
o = o.filter((e) =>
|
|
5030
|
+
let t = Fc(e, c);
|
|
5031
|
+
o = o.filter((e) => Ic(e?.value, t, s));
|
|
4994
5032
|
}
|
|
4995
5033
|
}
|
|
4996
5034
|
return o;
|
|
4997
5035
|
}
|
|
4998
5036
|
//#endregion
|
|
4999
5037
|
//#region src/components/form/fieldTooltip.js
|
|
5000
|
-
var
|
|
5001
|
-
function
|
|
5002
|
-
return
|
|
5038
|
+
var zc = (e) => e == null || String(e).trim() === "", Bc = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5039
|
+
function Vc(e) {
|
|
5040
|
+
return zc(e?.tooltip) ? Bc(e?.infoEnabled) && !zc(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5041
|
+
}
|
|
5042
|
+
//#endregion
|
|
5043
|
+
//#region src/components/form/autofillValue.js
|
|
5044
|
+
var Hc = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5045
|
+
function Uc(e, t = {}, n = () => void 0) {
|
|
5046
|
+
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5047
|
+
return Hc(i) && a != null && a !== "" ? a : i;
|
|
5003
5048
|
}
|
|
5004
5049
|
//#endregion
|
|
5005
5050
|
//#region src/components/form/dependentLookupReset.js
|
|
5006
|
-
var
|
|
5007
|
-
function
|
|
5008
|
-
return !(!r || e ===
|
|
5051
|
+
var Wc = Symbol("parentFilterUnseen"), Gc = (e) => e == null || e === "", Kc = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5052
|
+
function qc({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5053
|
+
return !(!r || e === Wc || Kc(e, t) || Gc(e) || Gc(n));
|
|
5009
5054
|
}
|
|
5010
5055
|
//#endregion
|
|
5011
5056
|
//#region src/utils/roleAllowsAction.js
|
|
5012
|
-
function
|
|
5013
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5057
|
+
function Jc(e) {
|
|
5058
|
+
return e == null ? !0 : typeof e == "object" ? Jc(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5014
5059
|
}
|
|
5015
|
-
function
|
|
5060
|
+
function Yc(e, t) {
|
|
5016
5061
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5017
5062
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5018
5063
|
let e = String(t).trim().toLowerCase();
|
|
5019
5064
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5020
5065
|
}
|
|
5021
5066
|
}
|
|
5022
|
-
function
|
|
5067
|
+
function Xc(e, t) {
|
|
5023
5068
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5024
5069
|
let n = `${t}Access`;
|
|
5025
5070
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5026
5071
|
}
|
|
5027
|
-
function
|
|
5072
|
+
function Zc(e, t) {
|
|
5028
5073
|
if (!e) return !0;
|
|
5029
5074
|
try {
|
|
5030
5075
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5031
5076
|
for (let e of o) {
|
|
5032
|
-
let t =
|
|
5033
|
-
if (t) return
|
|
5077
|
+
let t = Yc(n, e);
|
|
5078
|
+
if (t) return Jc(Xc(t, a));
|
|
5034
5079
|
}
|
|
5035
5080
|
return !0;
|
|
5036
5081
|
} catch {
|
|
@@ -5039,10 +5084,10 @@ function Gc(e, t) {
|
|
|
5039
5084
|
}
|
|
5040
5085
|
//#endregion
|
|
5041
5086
|
//#region src/utils/afterSubmitNav.js
|
|
5042
|
-
function
|
|
5087
|
+
function Qc(e) {
|
|
5043
5088
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5044
5089
|
}
|
|
5045
|
-
function
|
|
5090
|
+
function $c(e, t, n) {
|
|
5046
5091
|
let r = String(e ?? "").trim();
|
|
5047
5092
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5048
5093
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5051,50 +5096,50 @@ function qc(e, t, n) {
|
|
|
5051
5096
|
}
|
|
5052
5097
|
//#endregion
|
|
5053
5098
|
//#region src/utils/backNav.js
|
|
5054
|
-
function
|
|
5099
|
+
function el(e = typeof window < "u" ? window : void 0) {
|
|
5055
5100
|
let t = e?.history?.state?.idx;
|
|
5056
5101
|
return typeof t == "number" && t > 0;
|
|
5057
5102
|
}
|
|
5058
|
-
function
|
|
5059
|
-
return t && e ? { path: e } :
|
|
5103
|
+
function tl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5104
|
+
return t && e ? { path: e } : el(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5060
5105
|
}
|
|
5061
|
-
function
|
|
5062
|
-
let n =
|
|
5106
|
+
function nl(e, t = {}) {
|
|
5107
|
+
let n = tl(t);
|
|
5063
5108
|
return n.back ? e(-1) : e(n.path), n;
|
|
5064
5109
|
}
|
|
5065
5110
|
//#endregion
|
|
5066
5111
|
//#region src/components/form/educationRules.js
|
|
5067
|
-
var
|
|
5068
|
-
function
|
|
5112
|
+
var rl = (e) => e == null ? "" : String(e).trim();
|
|
5113
|
+
function il(e, t) {
|
|
5069
5114
|
let n = e?.regionRules;
|
|
5070
5115
|
if (!n || typeof n != "object") return e ?? {};
|
|
5071
|
-
let r =
|
|
5116
|
+
let r = rl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5072
5117
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5073
5118
|
...e,
|
|
5074
5119
|
...i
|
|
5075
5120
|
};
|
|
5076
5121
|
}
|
|
5077
|
-
function
|
|
5122
|
+
function al(e) {
|
|
5078
5123
|
return e?.allowInProgress !== !1;
|
|
5079
5124
|
}
|
|
5080
|
-
function
|
|
5081
|
-
return
|
|
5125
|
+
function ol(e) {
|
|
5126
|
+
return al(e) ? "" : ll(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.";
|
|
5082
5127
|
}
|
|
5083
|
-
function
|
|
5084
|
-
return
|
|
5128
|
+
function sl(e) {
|
|
5129
|
+
return al(e) ? "allow" : rl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5085
5130
|
}
|
|
5086
|
-
function
|
|
5087
|
-
return
|
|
5131
|
+
function cl(e) {
|
|
5132
|
+
return sl(e) === "block";
|
|
5088
5133
|
}
|
|
5089
|
-
function
|
|
5090
|
-
return
|
|
5134
|
+
function ll(e) {
|
|
5135
|
+
return sl(e) === "warn";
|
|
5091
5136
|
}
|
|
5092
|
-
function
|
|
5093
|
-
if (!
|
|
5094
|
-
let t =
|
|
5137
|
+
function ul(e) {
|
|
5138
|
+
if (!cl(e)) return null;
|
|
5139
|
+
let t = ol(e);
|
|
5095
5140
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5096
5141
|
}
|
|
5097
|
-
function
|
|
5142
|
+
function dl(e, t = {}) {
|
|
5098
5143
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5099
5144
|
for (let t of [n, r]) {
|
|
5100
5145
|
let n = e?.[t];
|
|
@@ -5104,50 +5149,50 @@ function al(e, t = {}) {
|
|
|
5104
5149
|
}
|
|
5105
5150
|
return null;
|
|
5106
5151
|
}
|
|
5107
|
-
function
|
|
5152
|
+
function fl(e, t = {}) {
|
|
5108
5153
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5109
5154
|
return !!e?.[n];
|
|
5110
5155
|
}
|
|
5111
|
-
function
|
|
5156
|
+
function pl(e = [], t = {}) {
|
|
5112
5157
|
let n = (t.direction ?? "desc") === "desc";
|
|
5113
5158
|
return e.map((e, n) => ({
|
|
5114
5159
|
index: n,
|
|
5115
|
-
key:
|
|
5116
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5160
|
+
key: dl(e, t),
|
|
5161
|
+
ongoing: t.inProgressFirst !== !1 && fl(e, t)
|
|
5117
5162
|
})).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);
|
|
5118
5163
|
}
|
|
5119
|
-
function
|
|
5164
|
+
function ml(e, t, n = {}) {
|
|
5120
5165
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5121
|
-
let r =
|
|
5166
|
+
let r = pl(e, n).indexOf(t);
|
|
5122
5167
|
return r === -1 || r === t ? null : {
|
|
5123
5168
|
from: t,
|
|
5124
5169
|
to: r,
|
|
5125
|
-
reason:
|
|
5170
|
+
reason: fl(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5126
5171
|
};
|
|
5127
5172
|
}
|
|
5128
|
-
var
|
|
5173
|
+
var hl = Object.freeze({
|
|
5129
5174
|
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.",
|
|
5130
5175
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5131
5176
|
ok: "Yes, move it up",
|
|
5132
5177
|
keep: "No, leave it here"
|
|
5133
5178
|
});
|
|
5134
|
-
function
|
|
5179
|
+
function gl(e, t = {}) {
|
|
5135
5180
|
let n = {
|
|
5136
|
-
...
|
|
5181
|
+
...hl,
|
|
5137
5182
|
...t.messages ?? {}
|
|
5138
5183
|
};
|
|
5139
5184
|
return n[e] ?? n.outOfOrder;
|
|
5140
5185
|
}
|
|
5141
|
-
function
|
|
5142
|
-
let n = t.levelField ?? "qualification", r =
|
|
5186
|
+
function _l(e, t = {}) {
|
|
5187
|
+
let n = t.levelField ?? "qualification", r = rl(e?.[n]);
|
|
5143
5188
|
if (!r) return null;
|
|
5144
5189
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5145
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5190
|
+
return Number.isFinite(Number(a)) ? Number(a) : vl(r, t);
|
|
5146
5191
|
}
|
|
5147
|
-
function
|
|
5192
|
+
function vl(e, t) {
|
|
5148
5193
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5149
5194
|
for (let e of n) {
|
|
5150
|
-
let t =
|
|
5195
|
+
let t = rl(e?.match);
|
|
5151
5196
|
if (!t) continue;
|
|
5152
5197
|
let n;
|
|
5153
5198
|
try {
|
|
@@ -5159,14 +5204,14 @@ function fl(e, t) {
|
|
|
5159
5204
|
}
|
|
5160
5205
|
return null;
|
|
5161
5206
|
}
|
|
5162
|
-
function
|
|
5163
|
-
return
|
|
5207
|
+
function yl(e, t = {}) {
|
|
5208
|
+
return rl((t?.levelLabels ?? {})[e]) || rl(e);
|
|
5164
5209
|
}
|
|
5165
|
-
function
|
|
5210
|
+
function bl(e = [], t = {}) {
|
|
5166
5211
|
if (!t || t.requireBelow === !1) return [];
|
|
5167
5212
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5168
5213
|
if (!r.length) return [];
|
|
5169
|
-
let i = e.map((e) =>
|
|
5214
|
+
let i = e.map((e) => _l(e, t)).filter((e) => e !== null);
|
|
5170
5215
|
if (!i.length) return [];
|
|
5171
5216
|
let a = Math.max(...i), o = [];
|
|
5172
5217
|
return r.forEach((e) => {
|
|
@@ -5174,43 +5219,43 @@ function ml(e = [], t = {}) {
|
|
|
5174
5219
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5175
5220
|
}), o;
|
|
5176
5221
|
}
|
|
5177
|
-
function
|
|
5178
|
-
let n =
|
|
5222
|
+
function xl(e, t = {}) {
|
|
5223
|
+
let n = bl(e, t);
|
|
5179
5224
|
if (!n.length) return "";
|
|
5180
|
-
let r = n.map((e) =>
|
|
5225
|
+
let r = n.map((e) => yl(e, t)).join(", ");
|
|
5181
5226
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5182
5227
|
}
|
|
5183
|
-
async function
|
|
5228
|
+
async function Sl({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5184
5229
|
let a = e?.orderBy;
|
|
5185
5230
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5186
|
-
let o =
|
|
5231
|
+
let o = ml(t, n, a);
|
|
5187
5232
|
if (!o) return !1;
|
|
5188
5233
|
let s = {
|
|
5189
|
-
...
|
|
5234
|
+
...hl,
|
|
5190
5235
|
...a.messages ?? {}
|
|
5191
5236
|
};
|
|
5192
5237
|
return await i({
|
|
5193
5238
|
reason: o.reason,
|
|
5194
5239
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5195
|
-
body:
|
|
5240
|
+
body: gl(o.reason, a),
|
|
5196
5241
|
okText: s.ok,
|
|
5197
5242
|
cancelText: s.keep,
|
|
5198
5243
|
from: o.from,
|
|
5199
5244
|
to: o.to
|
|
5200
5245
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5201
5246
|
}
|
|
5202
|
-
function
|
|
5203
|
-
let n =
|
|
5247
|
+
function Cl(e, t) {
|
|
5248
|
+
let n = il(e, t), r = n?.orderBy?.inProgressField;
|
|
5204
5249
|
return r ? {
|
|
5205
5250
|
name: n.name,
|
|
5206
5251
|
label: n.label ?? n.name,
|
|
5207
5252
|
rowsKey: n.payloadKey || n.name,
|
|
5208
5253
|
inProgressField: r,
|
|
5209
|
-
severity:
|
|
5210
|
-
message:
|
|
5254
|
+
severity: sl(n),
|
|
5255
|
+
message: ol(n)
|
|
5211
5256
|
} : null;
|
|
5212
5257
|
}
|
|
5213
|
-
function
|
|
5258
|
+
function wl(e = [], t, n) {
|
|
5214
5259
|
if (!n) return {
|
|
5215
5260
|
severity: "allow",
|
|
5216
5261
|
message: "",
|
|
@@ -5218,8 +5263,8 @@ function vl(e = [], t, n) {
|
|
|
5218
5263
|
};
|
|
5219
5264
|
let r = null;
|
|
5220
5265
|
for (let i of e) {
|
|
5221
|
-
let e =
|
|
5222
|
-
if (!(!e || e.severity === "allow") &&
|
|
5266
|
+
let e = Cl(i, t);
|
|
5267
|
+
if (!(!e || e.severity === "allow") && Tl(n, e.rowsKey).some((t) => fl(t, e))) {
|
|
5223
5268
|
if (e.severity === "block") return {
|
|
5224
5269
|
severity: "block",
|
|
5225
5270
|
message: e.message,
|
|
@@ -5238,23 +5283,23 @@ function vl(e = [], t, n) {
|
|
|
5238
5283
|
group: null
|
|
5239
5284
|
};
|
|
5240
5285
|
}
|
|
5241
|
-
function
|
|
5286
|
+
function Tl(e, t) {
|
|
5242
5287
|
let n = e?.[t];
|
|
5243
5288
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5244
5289
|
}
|
|
5245
|
-
function
|
|
5290
|
+
function El(e) {
|
|
5246
5291
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5247
5292
|
}
|
|
5248
|
-
function
|
|
5293
|
+
function Dl(e = [], t = {}) {
|
|
5249
5294
|
let n = null;
|
|
5250
5295
|
for (let r of e) {
|
|
5251
5296
|
let e = r?.levelRule;
|
|
5252
5297
|
if (!e) continue;
|
|
5253
|
-
let i =
|
|
5298
|
+
let i = Ol(t, r);
|
|
5254
5299
|
if (!i.length) continue;
|
|
5255
|
-
let a =
|
|
5300
|
+
let a = xl(i, e);
|
|
5256
5301
|
if (a) {
|
|
5257
|
-
if (
|
|
5302
|
+
if (El(e) === "block") return {
|
|
5258
5303
|
severity: "block",
|
|
5259
5304
|
message: a,
|
|
5260
5305
|
group: r
|
|
@@ -5272,7 +5317,7 @@ function xl(e = [], t = {}) {
|
|
|
5272
5317
|
group: null
|
|
5273
5318
|
};
|
|
5274
5319
|
}
|
|
5275
|
-
function
|
|
5320
|
+
function Ol(e, t) {
|
|
5276
5321
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5277
5322
|
if (!n) continue;
|
|
5278
5323
|
let t = e?.[n];
|
|
@@ -5282,10 +5327,10 @@ function Sl(e, t) {
|
|
|
5282
5327
|
}
|
|
5283
5328
|
//#endregion
|
|
5284
5329
|
//#region src/components/form/clearGroupOnChange.js
|
|
5285
|
-
function
|
|
5330
|
+
function kl(e, t) {
|
|
5286
5331
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5287
5332
|
}
|
|
5288
|
-
function
|
|
5333
|
+
function Al(e, t) {
|
|
5289
5334
|
let n = e?.field, r = [];
|
|
5290
5335
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5291
5336
|
e && e !== n && r.push(e);
|
|
@@ -5295,24 +5340,24 @@ function wl(e, t) {
|
|
|
5295
5340
|
e && e !== n && r.push(e);
|
|
5296
5341
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5297
5342
|
}
|
|
5298
|
-
function
|
|
5299
|
-
let i =
|
|
5343
|
+
function jl(e, t, n, r) {
|
|
5344
|
+
let i = Al(t, r).map((e) => kl(n, e));
|
|
5300
5345
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5301
5346
|
}
|
|
5302
5347
|
//#endregion
|
|
5303
5348
|
//#region src/components/form/resolveStoredOptions.js
|
|
5304
|
-
function
|
|
5349
|
+
function Ml(e) {
|
|
5305
5350
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5306
5351
|
}
|
|
5307
|
-
function
|
|
5352
|
+
function Nl(e, t = []) {
|
|
5308
5353
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5309
|
-
for (let t of
|
|
5354
|
+
for (let t of Ml(e)) {
|
|
5310
5355
|
let e = String(t);
|
|
5311
5356
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5312
5357
|
}
|
|
5313
5358
|
return r;
|
|
5314
5359
|
}
|
|
5315
|
-
async function
|
|
5360
|
+
async function Pl(e, t) {
|
|
5316
5361
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5317
5362
|
let n = new URLSearchParams({
|
|
5318
5363
|
collection: e.lookupCollection,
|
|
@@ -5324,7 +5369,7 @@ async function Ol(e, t) {
|
|
|
5324
5369
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5325
5370
|
return Array.isArray(i) ? i : [];
|
|
5326
5371
|
}
|
|
5327
|
-
function
|
|
5372
|
+
function Fl(e = [], t = []) {
|
|
5328
5373
|
if (!t.length) return e;
|
|
5329
5374
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5330
5375
|
...e,
|
|
@@ -5334,25 +5379,25 @@ function kl(e = [], t = []) {
|
|
|
5334
5379
|
}
|
|
5335
5380
|
//#endregion
|
|
5336
5381
|
//#region src/components/form/requireAnyOf.js
|
|
5337
|
-
var
|
|
5338
|
-
function
|
|
5382
|
+
var Il = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5383
|
+
function Ll(e) {
|
|
5339
5384
|
let t = e?.requireAnyOf;
|
|
5340
5385
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5341
5386
|
}
|
|
5342
|
-
function
|
|
5343
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5387
|
+
function Rl(e) {
|
|
5388
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !Il(e));
|
|
5344
5389
|
}
|
|
5345
|
-
function
|
|
5346
|
-
let n =
|
|
5390
|
+
function zl({ field: e, getRow: t }) {
|
|
5391
|
+
let n = Ll(e);
|
|
5347
5392
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5348
5393
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5349
5394
|
return { validator: async () => {
|
|
5350
5395
|
let e = t?.() ?? {};
|
|
5351
|
-
return
|
|
5396
|
+
return Rl(e) ? n.some((t) => !Il(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5352
5397
|
} };
|
|
5353
5398
|
}
|
|
5354
|
-
function
|
|
5355
|
-
let n =
|
|
5399
|
+
function Bl(e, t = []) {
|
|
5400
|
+
let n = Ll(e);
|
|
5356
5401
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5357
5402
|
...t,
|
|
5358
5403
|
requireAnyOf: n,
|
|
@@ -5361,8 +5406,8 @@ function Pl(e, t = []) {
|
|
|
5361
5406
|
}
|
|
5362
5407
|
//#endregion
|
|
5363
5408
|
//#region src/components/form/dateRules.js
|
|
5364
|
-
var
|
|
5365
|
-
function
|
|
5409
|
+
var Vl = (e) => e == null || e === "";
|
|
5410
|
+
function Hl(e) {
|
|
5366
5411
|
if (!e) return null;
|
|
5367
5412
|
if (typeof e.valueOf == "function") {
|
|
5368
5413
|
let t = e.valueOf();
|
|
@@ -5376,12 +5421,12 @@ function $(e) {
|
|
|
5376
5421
|
let t = T(e);
|
|
5377
5422
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5378
5423
|
}
|
|
5379
|
-
function
|
|
5424
|
+
function Ul(e) {
|
|
5380
5425
|
if (!e) return null;
|
|
5381
5426
|
let t = T(e);
|
|
5382
5427
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5383
5428
|
}
|
|
5384
|
-
var
|
|
5429
|
+
var Wl = {
|
|
5385
5430
|
d: "day",
|
|
5386
5431
|
day: "day",
|
|
5387
5432
|
days: "day",
|
|
@@ -5397,13 +5442,13 @@ var Rl = {
|
|
|
5397
5442
|
year: "year",
|
|
5398
5443
|
years: "year"
|
|
5399
5444
|
};
|
|
5400
|
-
function
|
|
5445
|
+
function Gl(e) {
|
|
5401
5446
|
if (e == null || e === "") return null;
|
|
5402
5447
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5403
5448
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5404
5449
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5405
5450
|
value: t,
|
|
5406
|
-
unit:
|
|
5451
|
+
unit: Wl[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5407
5452
|
};
|
|
5408
5453
|
}
|
|
5409
5454
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5413,49 +5458,49 @@ function zl(e) {
|
|
|
5413
5458
|
let r = Number(n[1]);
|
|
5414
5459
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5415
5460
|
value: r,
|
|
5416
|
-
unit:
|
|
5461
|
+
unit: Wl[n[2]] ?? "month"
|
|
5417
5462
|
};
|
|
5418
5463
|
}
|
|
5419
|
-
function
|
|
5464
|
+
function Kl(e, t) {
|
|
5420
5465
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5421
5466
|
if (n && typeof t == "function") {
|
|
5422
|
-
let e =
|
|
5467
|
+
let e = Gl(t(n));
|
|
5423
5468
|
if (e) return e;
|
|
5424
5469
|
}
|
|
5425
|
-
return
|
|
5470
|
+
return Gl(e?.minGap);
|
|
5426
5471
|
}
|
|
5427
|
-
function
|
|
5472
|
+
function ql(e, t, n, r) {
|
|
5428
5473
|
if (t === null) return null;
|
|
5429
|
-
let i =
|
|
5474
|
+
let i = Kl(n, r), a = T(t);
|
|
5430
5475
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5431
5476
|
}
|
|
5432
|
-
function
|
|
5477
|
+
function Jl(e, t, n, r, i) {
|
|
5433
5478
|
if (t === null || n === null) return !1;
|
|
5434
|
-
let a =
|
|
5479
|
+
let a = ql(e, n, r, i);
|
|
5435
5480
|
if (a === null) return !1;
|
|
5436
|
-
let o = !!r?.strict && !
|
|
5481
|
+
let o = !!r?.strict && !Kl(r, i);
|
|
5437
5482
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5438
5483
|
}
|
|
5439
|
-
function
|
|
5484
|
+
function Yl(e, t, n, r) {
|
|
5440
5485
|
if (n?.message) return n.message;
|
|
5441
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5486
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = Kl(n, r);
|
|
5442
5487
|
if (a) {
|
|
5443
5488
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5444
5489
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5445
5490
|
}
|
|
5446
5491
|
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}`;
|
|
5447
5492
|
}
|
|
5448
|
-
function
|
|
5493
|
+
function Xl({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5449
5494
|
return { validator: async (i, a) => {
|
|
5450
5495
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5451
|
-
if (!o ||
|
|
5496
|
+
if (!o || Vl(a)) return Promise.resolve();
|
|
5452
5497
|
let s = r(o);
|
|
5453
|
-
if (
|
|
5498
|
+
if (Vl(s)) return Promise.resolve();
|
|
5454
5499
|
let c = $(a), l = $(s);
|
|
5455
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5500
|
+
return c === null || l === null ? Promise.resolve() : Jl(e, c, l, n, r) ? Promise.reject(Error(Yl(e, t, n, r))) : Promise.resolve();
|
|
5456
5501
|
} };
|
|
5457
5502
|
}
|
|
5458
|
-
function
|
|
5503
|
+
function Zl(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5459
5504
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5460
5505
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5461
5506
|
if (o) {
|
|
@@ -5469,11 +5514,11 @@ function Gl(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5469
5514
|
}
|
|
5470
5515
|
return !1;
|
|
5471
5516
|
}
|
|
5472
|
-
function
|
|
5517
|
+
function Ql(e, t = "above", n = void 0) {
|
|
5473
5518
|
let r = e?.messages ?? {}, i = t === "below";
|
|
5474
5519
|
return (n === "start" ? i ? r.belowStart : r.aboveStart : n === "end" ? i ? r.belowEnd : r.aboveEnd : void 0) || (i ? r.below || "Start date must be after the end date of the entry below it." : n === "end" ? r.above || "End date must be before the start date of the entry above it." : r.above || "This period overlaps the entry above it. Please adjust the dates.");
|
|
5475
5520
|
}
|
|
5476
|
-
function
|
|
5521
|
+
function $l({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = nr }) {
|
|
5477
5522
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5478
5523
|
for (let e of a) {
|
|
5479
5524
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5487,17 +5532,17 @@ function ql({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = nr }) {
|
|
|
5487
5532
|
o.push((i) => {
|
|
5488
5533
|
if (!i) return !1;
|
|
5489
5534
|
let a = t(e);
|
|
5490
|
-
return !
|
|
5535
|
+
return !Vl(a) && Jl(r, $(i), $(a), n, t);
|
|
5491
5536
|
});
|
|
5492
5537
|
}
|
|
5493
5538
|
}
|
|
5494
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5539
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? Zl($(t), e.rowHierarchy, {
|
|
5495
5540
|
rows: n,
|
|
5496
5541
|
rowIndex: r
|
|
5497
5542
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5498
5543
|
}
|
|
5499
|
-
function
|
|
5500
|
-
if (!
|
|
5544
|
+
function eu(e, t = nr, n = void 0) {
|
|
5545
|
+
if (!Vl(n) && $(n) !== null) return;
|
|
5501
5546
|
let r = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5502
5547
|
for (let e of r) {
|
|
5503
5548
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -5505,7 +5550,7 @@ function Jl(e, t = nr, n = void 0) {
|
|
|
5505
5550
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5506
5551
|
}
|
|
5507
5552
|
}
|
|
5508
|
-
function
|
|
5553
|
+
function tu({ field: e, name: t, rows: n }) {
|
|
5509
5554
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5510
5555
|
let r = t[t.length - 1], i = t.length >= 3 && typeof t[1] == "number", a = /* @__PURE__ */ new Set(), o = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5511
5556
|
for (let e of o) {
|
|
@@ -5534,44 +5579,44 @@ function Yl({ field: e, name: t, rows: n }) {
|
|
|
5534
5579
|
]));
|
|
5535
5580
|
return u;
|
|
5536
5581
|
}
|
|
5537
|
-
function
|
|
5582
|
+
function nu({ field: e, rows: t, rowIndex: n }) {
|
|
5538
5583
|
let r = e?.rowHierarchy;
|
|
5539
5584
|
return { validator: async (i, a) => {
|
|
5540
|
-
if (!r ||
|
|
5585
|
+
if (!r || Vl(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5541
5586
|
let o = $(a);
|
|
5542
|
-
if (o === null || !
|
|
5587
|
+
if (o === null || !Zl(o, r, {
|
|
5543
5588
|
rows: t,
|
|
5544
5589
|
rowIndex: n
|
|
5545
5590
|
})) return Promise.resolve();
|
|
5546
5591
|
let s = r.startField ?? "startDate", c = t[n - 1], l = c ? $(c[s]) : null, u = l !== null && o >= l ? "above" : "below", d = r.endField ?? "endDate", f = e?.field, p = f === s ? "start" : f === d ? "end" : void 0;
|
|
5547
|
-
return Promise.reject(Error(
|
|
5592
|
+
return Promise.reject(Error(Ql(r, u, p)));
|
|
5548
5593
|
} };
|
|
5549
5594
|
}
|
|
5550
5595
|
//#endregion
|
|
5551
5596
|
//#region src/utils/submitMessages.js
|
|
5552
|
-
function
|
|
5597
|
+
function ru(e) {
|
|
5553
5598
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5554
5599
|
}
|
|
5555
|
-
function
|
|
5600
|
+
function iu(e) {
|
|
5556
5601
|
let t = String(e ?? "").trim();
|
|
5557
5602
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5558
5603
|
}
|
|
5559
|
-
function
|
|
5560
|
-
return String(e).replaceAll("${module}",
|
|
5604
|
+
function au(e, t) {
|
|
5605
|
+
return String(e).replaceAll("${module}", iu(t)).replaceAll("${moduleName}", iu(t));
|
|
5561
5606
|
}
|
|
5562
|
-
function
|
|
5563
|
-
let r =
|
|
5607
|
+
function ou(e, t, n) {
|
|
5608
|
+
let r = ru(e);
|
|
5564
5609
|
if (r?.suppress) return null;
|
|
5565
5610
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5566
|
-
return i && String(i).trim() ?
|
|
5611
|
+
return i && String(i).trim() ? au(i, t) : n === "edit" ? `${iu(t)} has Updated successfully` : `${iu(t)} has added successfully`;
|
|
5567
5612
|
}
|
|
5568
|
-
function
|
|
5569
|
-
let i =
|
|
5570
|
-
return a && String(a).trim() ?
|
|
5613
|
+
function su(e, t, n, r) {
|
|
5614
|
+
let i = ru(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5615
|
+
return a && String(a).trim() ? au(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${iu(t)}` : `Failed to create ${iu(t)}`;
|
|
5571
5616
|
}
|
|
5572
5617
|
//#endregion
|
|
5573
5618
|
//#region src/utils/scrollToFirstFormError.js
|
|
5574
|
-
function
|
|
5619
|
+
function cu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5575
5620
|
if (!e?.length) return;
|
|
5576
5621
|
let r = e[0]?.name;
|
|
5577
5622
|
setTimeout(() => {
|
|
@@ -5596,10 +5641,10 @@ function nu({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5596
5641
|
}
|
|
5597
5642
|
//#endregion
|
|
5598
5643
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5599
|
-
function
|
|
5644
|
+
function lu(e) {
|
|
5600
5645
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5601
5646
|
}
|
|
5602
|
-
function
|
|
5647
|
+
function uu(e, t) {
|
|
5603
5648
|
if (!e?.field) return !1;
|
|
5604
5649
|
switch (e.operator ?? "eq") {
|
|
5605
5650
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5607,58 +5652,58 @@ function iu(e, t) {
|
|
|
5607
5652
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5608
5653
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5609
5654
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5610
|
-
case "in": return
|
|
5611
|
-
case "notIn": return !
|
|
5655
|
+
case "in": return lu(e.value).includes(String(t ?? ""));
|
|
5656
|
+
case "notIn": return !lu(e.value).includes(String(t ?? ""));
|
|
5612
5657
|
default: return !1;
|
|
5613
5658
|
}
|
|
5614
5659
|
}
|
|
5615
|
-
function
|
|
5660
|
+
function du(e, t, n = !1) {
|
|
5616
5661
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5617
|
-
return
|
|
5662
|
+
return uu(i, t) && i?.label ? i.label : r;
|
|
5618
5663
|
}
|
|
5619
|
-
function
|
|
5664
|
+
function fu(e) {
|
|
5620
5665
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5621
5666
|
}
|
|
5622
|
-
function
|
|
5623
|
-
let n =
|
|
5667
|
+
function pu(e, t) {
|
|
5668
|
+
let n = fu(e);
|
|
5624
5669
|
if (!n.length) return !0;
|
|
5625
|
-
let r = n.map((e) =>
|
|
5670
|
+
let r = n.map((e) => uu(e, t(e.field)));
|
|
5626
5671
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5627
5672
|
}
|
|
5628
|
-
function
|
|
5673
|
+
function mu(e) {
|
|
5629
5674
|
let t = e?.colWhen;
|
|
5630
5675
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5631
5676
|
}
|
|
5632
|
-
function
|
|
5633
|
-
for (let t of
|
|
5677
|
+
function hu(e, t, n) {
|
|
5678
|
+
for (let t of mu(e)) if (uu(t, n(t))) return Number(t.col);
|
|
5634
5679
|
return t;
|
|
5635
5680
|
}
|
|
5636
|
-
function
|
|
5681
|
+
function gu(e, t) {
|
|
5637
5682
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5638
5683
|
}
|
|
5639
5684
|
//#endregion
|
|
5640
5685
|
//#region src/components/form/conditionalRequired.js
|
|
5641
|
-
function
|
|
5686
|
+
function _u(e, t) {
|
|
5642
5687
|
return (n) => {
|
|
5643
5688
|
if (!e || !n) return;
|
|
5644
5689
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5645
5690
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5646
5691
|
};
|
|
5647
5692
|
}
|
|
5648
|
-
function
|
|
5693
|
+
function vu(e, t, n) {
|
|
5649
5694
|
let r = e?.requiredWhen;
|
|
5650
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
5695
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : pu(r, _u(t, n));
|
|
5651
5696
|
}
|
|
5652
|
-
function
|
|
5697
|
+
function yu(e, t, n) {
|
|
5653
5698
|
return { validator: (r, i) => {
|
|
5654
|
-
if (!
|
|
5699
|
+
if (!vu(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5655
5700
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5656
5701
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5657
5702
|
} };
|
|
5658
5703
|
}
|
|
5659
5704
|
//#endregion
|
|
5660
5705
|
//#region src/components/Breadcrumb.jsx
|
|
5661
|
-
function
|
|
5706
|
+
function bu({ items: e = [] }) {
|
|
5662
5707
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Or, {
|
|
5663
5708
|
variant: "body",
|
|
5664
5709
|
weight: "medium",
|
|
@@ -5676,34 +5721,34 @@ function mu({ items: e = [] }) {
|
|
|
5676
5721
|
}
|
|
5677
5722
|
//#endregion
|
|
5678
5723
|
//#region src/components/form/canonicalOption.js
|
|
5679
|
-
var
|
|
5680
|
-
function
|
|
5724
|
+
var xu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
5725
|
+
function Su(e = []) {
|
|
5681
5726
|
let t = /* @__PURE__ */ new Map();
|
|
5682
5727
|
for (let n of e) {
|
|
5683
5728
|
if (n == null) continue;
|
|
5684
5729
|
let e = typeof n == "object" ? n.value : n;
|
|
5685
5730
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5686
|
-
let n =
|
|
5731
|
+
let n = xu(r);
|
|
5687
5732
|
n && !t.has(n) && t.set(n, e);
|
|
5688
5733
|
}
|
|
5689
5734
|
}
|
|
5690
5735
|
return t;
|
|
5691
5736
|
}
|
|
5692
|
-
function
|
|
5737
|
+
function Cu(e, t) {
|
|
5693
5738
|
if (!Array.isArray(e)) {
|
|
5694
|
-
let n =
|
|
5739
|
+
let n = Cu([e], t);
|
|
5695
5740
|
return n.length ? n[0] : e;
|
|
5696
5741
|
}
|
|
5697
|
-
let n =
|
|
5742
|
+
let n = Su(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
5698
5743
|
for (let t of e) {
|
|
5699
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
5744
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(xu(e)) ?? e, o = xu(a);
|
|
5700
5745
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
5701
5746
|
}
|
|
5702
5747
|
return i;
|
|
5703
5748
|
}
|
|
5704
5749
|
//#endregion
|
|
5705
5750
|
//#region src/components/form/dependencyBusy.js
|
|
5706
|
-
function
|
|
5751
|
+
function wu(e, t = []) {
|
|
5707
5752
|
if (!e) return [];
|
|
5708
5753
|
let n = /* @__PURE__ */ new Set();
|
|
5709
5754
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -5713,16 +5758,16 @@ function vu(e, t = []) {
|
|
|
5713
5758
|
}
|
|
5714
5759
|
return n.delete(e), [...n];
|
|
5715
5760
|
}
|
|
5716
|
-
function
|
|
5717
|
-
return e?.blockWhileResolving ?
|
|
5761
|
+
function Tu(e, t = []) {
|
|
5762
|
+
return e?.blockWhileResolving ? wu(e.field, t).length > 0 : !1;
|
|
5718
5763
|
}
|
|
5719
|
-
function
|
|
5764
|
+
function Eu(e) {
|
|
5720
5765
|
let t = String(e?.label ?? "").trim();
|
|
5721
5766
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
5722
5767
|
}
|
|
5723
|
-
function
|
|
5768
|
+
function Du(e, t = []) {
|
|
5724
5769
|
if (!e?.field) return [];
|
|
5725
|
-
let n = new Set(
|
|
5770
|
+
let n = new Set(wu(e.field, t));
|
|
5726
5771
|
if (n.size === 0) return [];
|
|
5727
5772
|
let r = [];
|
|
5728
5773
|
for (let e of t) {
|
|
@@ -5731,19 +5776,19 @@ function xu(e, t = []) {
|
|
|
5731
5776
|
}
|
|
5732
5777
|
return r;
|
|
5733
5778
|
}
|
|
5734
|
-
function
|
|
5779
|
+
function Ou(e) {
|
|
5735
5780
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
5736
5781
|
}
|
|
5737
5782
|
//#endregion
|
|
5738
5783
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
5739
|
-
var
|
|
5740
|
-
function
|
|
5784
|
+
var ku = d(() => import("./index.js").then((e) => e.n)), Au = d(() => import("./DocumentViewer-DesrL_6B.js").then((e) => e.n));
|
|
5785
|
+
function ju(e) {
|
|
5741
5786
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
5742
5787
|
return C(t === "pdf" ? ue : t === "doc" || t === "docx" ? fe : le, { className: "v1-file-chip__icon" });
|
|
5743
5788
|
}
|
|
5744
|
-
function
|
|
5789
|
+
function Mu({ field: e, recordMeta: t }) {
|
|
5745
5790
|
let n = e?.linkedModule, r = e?.linkedFileField, i = m(() => {
|
|
5746
|
-
let r =
|
|
5791
|
+
let r = uc(n, t);
|
|
5747
5792
|
if (r) return r;
|
|
5748
5793
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
5749
5794
|
return a ? String(a) : "";
|
|
@@ -5777,7 +5822,7 @@ function Eu({ field: e, recordMeta: t }) {
|
|
|
5777
5822
|
r,
|
|
5778
5823
|
f
|
|
5779
5824
|
]);
|
|
5780
|
-
let v = m(() =>
|
|
5825
|
+
let v = m(() => ho(a.fileValue), [a.fileValue])[0], y = !!v, b = e?.label ?? "File", x = Y(n) || "record";
|
|
5781
5826
|
if (!i) return /* @__PURE__ */ C("div", {
|
|
5782
5827
|
className: "v1-linked-file v1-linked-file--empty",
|
|
5783
5828
|
children: /* @__PURE__ */ C("span", { children: e?.unlinkedText ?? `Not available until the ${x} is set.` })
|
|
@@ -5805,7 +5850,7 @@ function Eu({ field: e, recordMeta: t }) {
|
|
|
5805
5850
|
onClick: () => y && c(!0),
|
|
5806
5851
|
title: y ? `Preview or download ${v.name}` : ie,
|
|
5807
5852
|
children: [
|
|
5808
|
-
y ?
|
|
5853
|
+
y ? ju(v.name) : /* @__PURE__ */ C(le, { className: "v1-file-chip__icon" }),
|
|
5809
5854
|
/* @__PURE__ */ C("span", {
|
|
5810
5855
|
className: "v1-file-chip__name",
|
|
5811
5856
|
children: y ? v.name : ie
|
|
@@ -5829,7 +5874,7 @@ function Eu({ field: e, recordMeta: t }) {
|
|
|
5829
5874
|
}),
|
|
5830
5875
|
s && te && /* @__PURE__ */ C(u, {
|
|
5831
5876
|
fallback: null,
|
|
5832
|
-
children: /* @__PURE__ */ C(
|
|
5877
|
+
children: /* @__PURE__ */ C(Au, {
|
|
5833
5878
|
open: s,
|
|
5834
5879
|
onClose: () => c(!1),
|
|
5835
5880
|
documents: [te]
|
|
@@ -5860,7 +5905,7 @@ function Eu({ field: e, recordMeta: t }) {
|
|
|
5860
5905
|
},
|
|
5861
5906
|
children: /* @__PURE__ */ C(ne, {})
|
|
5862
5907
|
}),
|
|
5863
|
-
children: /* @__PURE__ */ C(
|
|
5908
|
+
children: /* @__PURE__ */ C(ku, {
|
|
5864
5909
|
moduleName: n,
|
|
5865
5910
|
recordId: i,
|
|
5866
5911
|
embedded: !0,
|
|
@@ -5874,7 +5919,7 @@ function Eu({ field: e, recordMeta: t }) {
|
|
|
5874
5919
|
})
|
|
5875
5920
|
] });
|
|
5876
5921
|
}
|
|
5877
|
-
|
|
5922
|
+
Mu.propTypes = {
|
|
5878
5923
|
field: E.shape({
|
|
5879
5924
|
label: E.string,
|
|
5880
5925
|
linkedModule: E.string,
|
|
@@ -5886,8 +5931,8 @@ Eu.propTypes = {
|
|
|
5886
5931
|
reuploadWarning: E.string
|
|
5887
5932
|
}).isRequired,
|
|
5888
5933
|
recordMeta: E.object
|
|
5889
|
-
},
|
|
5934
|
+
}, Mu.defaultProps = { recordMeta: void 0 };
|
|
5890
5935
|
//#endregion
|
|
5891
|
-
export {
|
|
5936
|
+
export { Lc as $, rr as $n, wt as $r, uo as $t, Pl as A, Gt as Ai, ci as An, Qt as Ar, ys as At, Dl as B, xn as Bi, Wr as Bn, Wt as Br, qo as Bt, eu as C, at as Ci, wi as Cn, et as Cr, Fs as Ct, tu as D, an as Di, pi as Dn, _n as Dr, js as Dt, Vl as E, Ve as Ei, fi as En, St as Er, As as Et, Cl as F, gn as Fi, ii as Fn, Xe as Fr, cs as Ft, $c as G, on as Gi, Or as Gn, vt as Gr, Do as Gt, il as H, jt as Hi, Ir as Hn, sn as Hr, Go as Ht, al as I, fn as Ii, $r as In, Ye as Ir, _s as It, Wc as J, nr as Jn, it as Jr, q as Jt, Jc as K, I as Kn, cn as Kr, Eo as Kt, cl as L, In as Li, Qr as Ln, dt as Lr, Jo as Lt, Nl as M, Ct as Mi, ti as Mn, Mn as Mr, fs as Mt, jl as N, $e as Ni, li as Nn, ot as Nr, ds as Nt, Bl as O, ze as Oi, di as On, pn as Or, Cs as Ot, ul as P, Tn as Pi, ri as Pn, Jt as Pr, ns as Pt, Rc as Q, mr as Qn, yt as Qr, eo as Qt, ol as R, Zt as Ri, Zr as Rn, Dt as Rr, Zo as Rt, nu as S, _t as Si, zi as Sn, An as Sr, Ls as St, Ul as T, xt as Ti, Oi as Tn, En as Tr, Y as Tt, nl as U, Ut as Ui, Fr as Un, He as Ur, Uo as Ut, Sl as V, jn as Vi, Kr as Vn, ln as Vr, Ko as Vt, Qc as W, qt as Wi, Pr as Wn, gt as Wr, Wo as Wt, Uc as X, sr as Xn, Kt as Xr, $a as Xt, qc as Y, ir as Yn, ct as Yr, _o as Yt, Vc as Z, P as Zn, bt as Zr, Qa as Zt, cu as _, Re as _i, ga as _n, wn as _r, rc as _t, Tu as a, Le as ai, La as an, N as ar, Sc as at, $l as b, tt as bi, Ni as bn, Fn as br, ec as bt, vu as c, Ze as ci, K as cn, Yn as cr, uc as ct, gu as d, Nt as di, Oa as dn, Vn as dr, fc as dt, $t as ei, ho as en, dr as er, wc as et, uu as f, Pt as fi, oa as fn, Bn as fr, gc as ft, fu as g, Yt as gi, Pa as gn, Qe as gr, ic as gt, hu as h, Ft as hi, Sa as hn, Tt as hr, ac as ht, Eu as i, Pn as ii, Ha as in, Xn as ir, bc as it, Fl as j, mt as ji, ni as jn, Be as jr, vs as jt, zl as k, Ht as ki, ui as kn, Ln as kr, Es as kt, yu as l, Vt as li, ka as ln, Rn as lr, pc as lt, pu as m, kn as mi, G as mn, nt as mr, sc as mt, Ou as n, mn as ni, Za as nn, Un as nr, Dc as nt, Cu as o, Ue as oi, Ra as on, Qn as or, _c as ot, du as p, bn as pi, B as pn, Hn as pr, hc as pt, Zc as q, F as qn, Cn as qr, bo as qt, Du as r, un as ri, Va as rn, Zn as rr, yc as rt, bu as s, rn as si, za as sn, Kn as sr, dc as st, Mu as t, en as ti, qa as tn, ar as tr, Oc as tt, mu as u, j as ui, Fa as un, zn as ur, mc as ut, su as v, tn as vi, ha as vn, hn as vr, nc as vt, Hl as w, lt as wi, ki as wn, pt as wr, Ns as wt, Xl as x, ft as xi, Li as xn, Xt as xr, Qs as xt, ou as y, nn as yi, Ki as yn, dn as yr, tc as yt, wl as z, Rt as zi, Ur as zn, At as zr, Xo as zt };
|
|
5892
5937
|
|
|
5893
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
5938
|
+
//# sourceMappingURL=LinkedRecordFileField-BmenMK75.js.map
|