@realtek/core-theme-live 0.0.453 → 0.0.455
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-CkcsIdCx.js → LinkedRecordFileField-4vCdXlj4.js} +838 -825
- package/dist-lib/LinkedRecordFileField-4vCdXlj4.js.map +1 -0
- package/dist-lib/{LinkedRecordFileField-Bu_vUm9l.cjs → LinkedRecordFileField-6mf81qoS.cjs} +3 -3
- package/dist-lib/LinkedRecordFileField-6mf81qoS.cjs.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +8182 -8166
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-Bu_vUm9l.cjs.map +0 -1
- package/dist-lib/LinkedRecordFileField-CkcsIdCx.js.map +0 -1
|
@@ -2106,38 +2106,51 @@ async function ui(e) {
|
|
|
2106
2106
|
return !1;
|
|
2107
2107
|
}
|
|
2108
2108
|
}
|
|
2109
|
+
function di() {
|
|
2110
|
+
let e = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0").slice(0, 8), t = /* @__PURE__ */ new Uint8Array(8);
|
|
2111
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
2112
|
+
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
2113
|
+
return `${e}${Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
2114
|
+
}
|
|
2115
|
+
function fi(e) {
|
|
2116
|
+
return (Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []).map((e) => String(e?.id ?? e?._id ?? "").trim()).filter(Boolean);
|
|
2117
|
+
}
|
|
2118
|
+
async function pi(e = []) {
|
|
2119
|
+
let t = Array.from(new Set((e || []).map((e) => String(e || "").trim()).filter(Boolean)));
|
|
2120
|
+
t.length !== 0 && await Promise.allSettled(t.map((e) => ui(e)));
|
|
2121
|
+
}
|
|
2109
2122
|
//#endregion
|
|
2110
2123
|
//#region src/services/detailedViewApi.js
|
|
2111
|
-
var
|
|
2124
|
+
var mi = {
|
|
2112
2125
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2113
2126
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2114
2127
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2115
2128
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2116
2129
|
};
|
|
2117
|
-
async function
|
|
2130
|
+
async function hi(e, t) {
|
|
2118
2131
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2119
2132
|
if (n === "job" || n === "jobs") {
|
|
2120
2133
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2121
2134
|
return e(t);
|
|
2122
2135
|
}
|
|
2123
|
-
if (n === "candidate" || n === "candidates") return
|
|
2136
|
+
if (n === "candidate" || n === "candidates") return _i(n === "candidate" ? "candidate" : "candidates", t);
|
|
2124
2137
|
let r = new URLSearchParams({
|
|
2125
2138
|
module: String(e ?? ""),
|
|
2126
2139
|
id: String(t)
|
|
2127
2140
|
});
|
|
2128
2141
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2129
2142
|
}
|
|
2130
|
-
async function
|
|
2143
|
+
async function gi(e) {
|
|
2131
2144
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2132
2145
|
return {
|
|
2133
2146
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2134
2147
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2135
2148
|
};
|
|
2136
2149
|
}
|
|
2137
|
-
async function
|
|
2150
|
+
async function _i(e, t) {
|
|
2138
2151
|
if (!e) throw Error("module is required");
|
|
2139
2152
|
if (!t) throw Error("id is required");
|
|
2140
|
-
let n =
|
|
2153
|
+
let n = mi[e];
|
|
2141
2154
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2142
2155
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2143
2156
|
method: "GET",
|
|
@@ -2150,7 +2163,7 @@ async function mi(e, t) {
|
|
|
2150
2163
|
let o = await a.json();
|
|
2151
2164
|
return o.data ?? o;
|
|
2152
2165
|
}
|
|
2153
|
-
async function
|
|
2166
|
+
async function vi(e, t, n, i = []) {
|
|
2154
2167
|
if (!e) throw Error("module is required");
|
|
2155
2168
|
if (!t) throw Error("id is required");
|
|
2156
2169
|
let a = await r(), o = new FormData();
|
|
@@ -2163,15 +2176,15 @@ async function hi(e, t, n, i = []) {
|
|
|
2163
2176
|
if (!c.ok) {
|
|
2164
2177
|
let e = await c.text();
|
|
2165
2178
|
console.error("[updateRecord] Error response:", e);
|
|
2166
|
-
let t = Error(
|
|
2167
|
-
throw t.status = c.status, t.response =
|
|
2179
|
+
let t = Error(bi(e) || `API ${c.status}: ${c.statusText}`);
|
|
2180
|
+
throw t.status = c.status, t.response = yi(e), t;
|
|
2168
2181
|
}
|
|
2169
2182
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2170
2183
|
l();
|
|
2171
2184
|
let u = await c.json();
|
|
2172
2185
|
return u.data ?? u;
|
|
2173
2186
|
}
|
|
2174
|
-
function
|
|
2187
|
+
function yi(e) {
|
|
2175
2188
|
let t = String(e ?? "").trim();
|
|
2176
2189
|
if (!t.startsWith("{")) return null;
|
|
2177
2190
|
try {
|
|
@@ -2180,7 +2193,7 @@ function gi(e) {
|
|
|
2180
2193
|
return null;
|
|
2181
2194
|
}
|
|
2182
2195
|
}
|
|
2183
|
-
function
|
|
2196
|
+
function bi(e) {
|
|
2184
2197
|
let t = String(e ?? "").trim();
|
|
2185
2198
|
if (!t.startsWith("{")) return t;
|
|
2186
2199
|
try {
|
|
@@ -2190,22 +2203,22 @@ function _i(e) {
|
|
|
2190
2203
|
return t;
|
|
2191
2204
|
}
|
|
2192
2205
|
}
|
|
2193
|
-
var
|
|
2194
|
-
async function
|
|
2206
|
+
var xi = (e) => e?.data ?? e;
|
|
2207
|
+
async function Si(e, t) {
|
|
2195
2208
|
if (!e || !t) return [];
|
|
2196
2209
|
let n = new URLSearchParams({
|
|
2197
2210
|
module: e,
|
|
2198
2211
|
id: String(t)
|
|
2199
|
-
}), r =
|
|
2212
|
+
}), r = xi(await a(s, `/module-activity?${n.toString()}`));
|
|
2200
2213
|
return Array.isArray(r) ? r : [];
|
|
2201
2214
|
}
|
|
2202
|
-
async function
|
|
2215
|
+
async function Ci(e) {
|
|
2203
2216
|
if (!e) return [];
|
|
2204
|
-
let t =
|
|
2217
|
+
let t = xi(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2205
2218
|
return Array.isArray(t) ? t : [];
|
|
2206
2219
|
}
|
|
2207
|
-
async function
|
|
2208
|
-
return
|
|
2220
|
+
async function wi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2221
|
+
return xi(await a(s, "/notes", {
|
|
2209
2222
|
method: "POST",
|
|
2210
2223
|
body: JSON.stringify({
|
|
2211
2224
|
relatedId: e,
|
|
@@ -2217,29 +2230,29 @@ async function xi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2217
2230
|
}
|
|
2218
2231
|
//#endregion
|
|
2219
2232
|
//#region src/components/form/formDateInputFormat.js
|
|
2220
|
-
var
|
|
2221
|
-
function
|
|
2233
|
+
var Ti = d(void 0);
|
|
2234
|
+
function Ei(e, t) {
|
|
2222
2235
|
return (typeof e == "string" ? e.trim() : "") || nr(t) || tr();
|
|
2223
2236
|
}
|
|
2224
|
-
function
|
|
2225
|
-
let e = m(
|
|
2226
|
-
return
|
|
2237
|
+
function Di() {
|
|
2238
|
+
let e = m(Ti);
|
|
2239
|
+
return Ei(e?.override, e?.moduleName);
|
|
2227
2240
|
}
|
|
2228
2241
|
//#endregion
|
|
2229
2242
|
//#region src/utils/roleFormPermissionGate.js
|
|
2230
|
-
function
|
|
2243
|
+
function Oi(e, t) {
|
|
2231
2244
|
if (!e) return !0;
|
|
2232
2245
|
let n = e.find((e) => e.name === t);
|
|
2233
2246
|
return !n || n.enabled !== !1;
|
|
2234
2247
|
}
|
|
2235
|
-
function
|
|
2248
|
+
function ki(e, t, n) {
|
|
2236
2249
|
if (!e) return !0;
|
|
2237
2250
|
let r = e.find((e) => e.name === t);
|
|
2238
2251
|
if (!r) return !0;
|
|
2239
2252
|
let i = r.fields?.find((e) => e.field === n);
|
|
2240
2253
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2241
2254
|
}
|
|
2242
|
-
function
|
|
2255
|
+
function Ai(e, t, n) {
|
|
2243
2256
|
if (!e) return !0;
|
|
2244
2257
|
let r = e.find((e) => e.name === t);
|
|
2245
2258
|
if (!r) return !0;
|
|
@@ -2249,7 +2262,7 @@ function Di(e, t, n) {
|
|
|
2249
2262
|
}
|
|
2250
2263
|
//#endregion
|
|
2251
2264
|
//#region src/components/form/inputSecurity.js
|
|
2252
|
-
var
|
|
2265
|
+
var ji = [
|
|
2253
2266
|
"p",
|
|
2254
2267
|
"br",
|
|
2255
2268
|
"strong",
|
|
@@ -2271,12 +2284,12 @@ var Oi = [
|
|
|
2271
2284
|
"a",
|
|
2272
2285
|
"code",
|
|
2273
2286
|
"pre"
|
|
2274
|
-
],
|
|
2287
|
+
], Mi = [
|
|
2275
2288
|
"href",
|
|
2276
2289
|
"title",
|
|
2277
2290
|
"target",
|
|
2278
2291
|
"rel"
|
|
2279
|
-
],
|
|
2292
|
+
], Ni = /[\u200B-\u200D\u2060\uFEFF]/g, Pi = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, Fi = /^[\p{L}\p{M}\p{N} .'-]+$/u, Ii = /^\+?[0-9 ()-]+$/, Li = /^-?(?:\d+|\d*\.\d+)$/, Ri = [
|
|
2280
2293
|
{
|
|
2281
2294
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2282
2295
|
message: "HTML/script content is not allowed"
|
|
@@ -2303,12 +2316,12 @@ var Oi = [
|
|
|
2303
2316
|
plainOnly: !0
|
|
2304
2317
|
}
|
|
2305
2318
|
];
|
|
2306
|
-
function
|
|
2319
|
+
function zi(e) {
|
|
2307
2320
|
if (typeof document > "u") return e;
|
|
2308
2321
|
let t = document.createElement("textarea");
|
|
2309
2322
|
return t.innerHTML = e, t.value;
|
|
2310
2323
|
}
|
|
2311
|
-
function
|
|
2324
|
+
function Bi(e) {
|
|
2312
2325
|
let t = String(e ?? "");
|
|
2313
2326
|
for (let e = 0; e < 2; e += 1) try {
|
|
2314
2327
|
let e = decodeURIComponent(t);
|
|
@@ -2317,12 +2330,12 @@ function Li(e) {
|
|
|
2317
2330
|
} catch {
|
|
2318
2331
|
break;
|
|
2319
2332
|
}
|
|
2320
|
-
return t =
|
|
2333
|
+
return t = zi(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2321
2334
|
}
|
|
2322
|
-
function
|
|
2335
|
+
function Vi(e) {
|
|
2323
2336
|
return je.sanitize(String(e ?? ""), {
|
|
2324
|
-
ALLOWED_TAGS:
|
|
2325
|
-
ALLOWED_ATTR:
|
|
2337
|
+
ALLOWED_TAGS: ji,
|
|
2338
|
+
ALLOWED_ATTR: Mi,
|
|
2326
2339
|
ALLOW_DATA_ATTR: !1,
|
|
2327
2340
|
FORBID_TAGS: [
|
|
2328
2341
|
"script",
|
|
@@ -2342,35 +2355,35 @@ function Ri(e) {
|
|
|
2342
2355
|
]
|
|
2343
2356
|
});
|
|
2344
2357
|
}
|
|
2345
|
-
function
|
|
2358
|
+
function Hi(e) {
|
|
2346
2359
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2347
2360
|
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
2348
2361
|
}
|
|
2349
|
-
function
|
|
2362
|
+
function Ui(e) {
|
|
2350
2363
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2351
2364
|
}
|
|
2352
|
-
function
|
|
2365
|
+
function Wi(e, t = {}) {
|
|
2353
2366
|
if (typeof e != "string") return e;
|
|
2354
|
-
if (t.type === "text-editor") return
|
|
2355
|
-
let n = e.normalize("NFC").replace(
|
|
2356
|
-
return n =
|
|
2367
|
+
if (t.type === "text-editor") return Vi(e.normalize("NFC"));
|
|
2368
|
+
let n = e.normalize("NFC").replace(Ni, "").replace(/\u00A0/g, " ").replace(Pi, "");
|
|
2369
|
+
return n = Ui(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2357
2370
|
}
|
|
2358
|
-
function
|
|
2371
|
+
function Gi(e, t = {}) {
|
|
2359
2372
|
if (typeof e != "string" || e === "") return null;
|
|
2360
|
-
let n = t.label || t.field || "Field", r =
|
|
2373
|
+
let n = t.label || t.field || "Field", r = Bi(e);
|
|
2361
2374
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2362
|
-
let i = t.type === "text-editor", a =
|
|
2375
|
+
let i = t.type === "text-editor", a = Ri.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2363
2376
|
if (a) return `${n}: ${a.message}`;
|
|
2364
|
-
let o =
|
|
2365
|
-
return [...o].length >
|
|
2377
|
+
let o = Wi(e, t);
|
|
2378
|
+
return [...o].length > Hi(t) ? `${n} is too long` : t.formatter === "name" && o && !Fi.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !Ii.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !Li.test(o) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && o && !/^https?:\/\//i.test(o) ? `${n} must use http:// or https://` : null;
|
|
2366
2379
|
}
|
|
2367
|
-
function
|
|
2380
|
+
function Ki(e) {
|
|
2368
2381
|
return { validator: (t, n) => {
|
|
2369
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2382
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Gi(t, e)).find(Boolean);
|
|
2370
2383
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2371
2384
|
} };
|
|
2372
2385
|
}
|
|
2373
|
-
function
|
|
2386
|
+
function qi(e = []) {
|
|
2374
2387
|
let t = /* @__PURE__ */ new Map();
|
|
2375
2388
|
return e.forEach((e) => {
|
|
2376
2389
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2382,12 +2395,12 @@ function Wi(e = []) {
|
|
|
2382
2395
|
});
|
|
2383
2396
|
}), t;
|
|
2384
2397
|
}
|
|
2385
|
-
function
|
|
2386
|
-
let n =
|
|
2398
|
+
function Ji(e, t = []) {
|
|
2399
|
+
let n = qi(t), r = (e, t = "") => {
|
|
2387
2400
|
if (typeof e == "string") {
|
|
2388
|
-
let r = n.get(t) ?? {}, i =
|
|
2401
|
+
let r = n.get(t) ?? {}, i = Gi(e, r);
|
|
2389
2402
|
if (i) throw Error(i);
|
|
2390
|
-
return
|
|
2403
|
+
return Wi(e, r);
|
|
2391
2404
|
}
|
|
2392
2405
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2393
2406
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2399,23 +2412,23 @@ function Gi(e, t = []) {
|
|
|
2399
2412
|
}
|
|
2400
2413
|
//#endregion
|
|
2401
2414
|
//#region src/components/form/validationOverride.js
|
|
2402
|
-
var
|
|
2403
|
-
function
|
|
2415
|
+
var Yi = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2416
|
+
function Xi(e) {
|
|
2404
2417
|
let t = e?.overrideCheckbox;
|
|
2405
|
-
return !t || typeof t != "object" ? null :
|
|
2418
|
+
return !t || typeof t != "object" ? null : Qi(e).size > 0 ? t : null;
|
|
2406
2419
|
}
|
|
2407
|
-
function
|
|
2420
|
+
function Zi(e) {
|
|
2408
2421
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2409
2422
|
}
|
|
2410
|
-
function
|
|
2423
|
+
function Qi(e) {
|
|
2411
2424
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2412
2425
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2413
2426
|
}
|
|
2414
|
-
function
|
|
2427
|
+
function $i(e) {
|
|
2415
2428
|
return e?.overrideCheckbox?.store !== !1;
|
|
2416
2429
|
}
|
|
2417
|
-
function
|
|
2418
|
-
let r =
|
|
2430
|
+
function ea(e, t, n) {
|
|
2431
|
+
let r = Zi(e);
|
|
2419
2432
|
if (typeof n == "function") {
|
|
2420
2433
|
let e = n(r);
|
|
2421
2434
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2426,27 +2439,27 @@ function Zi(e, t, n) {
|
|
|
2426
2439
|
r
|
|
2427
2440
|
] : [r];
|
|
2428
2441
|
}
|
|
2429
|
-
function
|
|
2442
|
+
function ta(e, t) {
|
|
2430
2443
|
return (n) => {
|
|
2431
2444
|
let r = !1;
|
|
2432
2445
|
try {
|
|
2433
|
-
r =
|
|
2446
|
+
r = Yi(n?.getFieldValue?.(t));
|
|
2434
2447
|
} catch {
|
|
2435
2448
|
r = !1;
|
|
2436
2449
|
}
|
|
2437
2450
|
return r ? {} : e;
|
|
2438
2451
|
};
|
|
2439
2452
|
}
|
|
2440
|
-
function
|
|
2441
|
-
if (!
|
|
2442
|
-
let i =
|
|
2453
|
+
function na(e, t, n, r) {
|
|
2454
|
+
if (!Xi(e)) return r;
|
|
2455
|
+
let i = Qi(e), a = ea(e, t, n);
|
|
2443
2456
|
return (e) => {
|
|
2444
2457
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2445
|
-
return i.has(n) ?
|
|
2458
|
+
return i.has(n) ? ta(t, a) : t;
|
|
2446
2459
|
};
|
|
2447
2460
|
}
|
|
2448
|
-
function
|
|
2449
|
-
let t =
|
|
2461
|
+
function ra(e) {
|
|
2462
|
+
let t = Xi(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2450
2463
|
return {
|
|
2451
2464
|
tone: t.tone ?? "overwrite",
|
|
2452
2465
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2457,12 +2470,12 @@ function ea(e) {
|
|
|
2457
2470
|
}
|
|
2458
2471
|
//#endregion
|
|
2459
2472
|
//#region src/components/form/optionMatching.js
|
|
2460
|
-
function
|
|
2473
|
+
function ia(e) {
|
|
2461
2474
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2462
2475
|
}
|
|
2463
|
-
function
|
|
2476
|
+
function aa(e) {
|
|
2464
2477
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2465
|
-
let r =
|
|
2478
|
+
let r = ia(e);
|
|
2466
2479
|
r && !t.has(r) && t.set(r, n);
|
|
2467
2480
|
};
|
|
2468
2481
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2470,40 +2483,40 @@ function na(e) {
|
|
|
2470
2483
|
let t = typeof e == "object" ? e.value : e;
|
|
2471
2484
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2472
2485
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2473
|
-
let i = t.get(
|
|
2486
|
+
let i = t.get(ia(r));
|
|
2474
2487
|
i !== void 0 && n(e, i);
|
|
2475
2488
|
}), t;
|
|
2476
2489
|
}
|
|
2477
|
-
var
|
|
2478
|
-
function
|
|
2490
|
+
var oa = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2491
|
+
function sa(e, t) {
|
|
2479
2492
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2480
|
-
let n = e.get(
|
|
2493
|
+
let n = e.get(ia(t));
|
|
2481
2494
|
return n === void 0 ? t : n;
|
|
2482
2495
|
}
|
|
2483
|
-
function
|
|
2484
|
-
if (!
|
|
2485
|
-
let n =
|
|
2486
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2496
|
+
function ca(e, t) {
|
|
2497
|
+
if (!oa(e)) return t;
|
|
2498
|
+
let n = aa(e);
|
|
2499
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => sa(n, e)) : sa(n, t);
|
|
2487
2500
|
}
|
|
2488
2501
|
//#endregion
|
|
2489
2502
|
//#region src/components/form/mountDefaultValue.js
|
|
2490
|
-
function
|
|
2503
|
+
function la(e = {}) {
|
|
2491
2504
|
let t = e?.defaultValue;
|
|
2492
2505
|
if (t === void 0 || t === "") return;
|
|
2493
|
-
if (e?.type === "time") return
|
|
2494
|
-
if (e?.type === "date") return
|
|
2506
|
+
if (e?.type === "time") return fa(t);
|
|
2507
|
+
if (e?.type === "date") return ha(t);
|
|
2495
2508
|
if (e?.type !== "checkbox") return t;
|
|
2496
2509
|
let n = Array.isArray(e.options) ? e.options : [];
|
|
2497
2510
|
if (!n.length) return t;
|
|
2498
2511
|
let r = n.map((e) => String(e && typeof e == "object" ? e.value : e));
|
|
2499
2512
|
return (Array.isArray(t) ? t : [t]).some((e) => r.includes(String(e))) ? t : void 0;
|
|
2500
2513
|
}
|
|
2501
|
-
var
|
|
2502
|
-
function
|
|
2514
|
+
var ua = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i, da = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
2515
|
+
function fa(e) {
|
|
2503
2516
|
if (e == null || e === "") return;
|
|
2504
2517
|
if (E.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2505
2518
|
if (typeof e != "string") return;
|
|
2506
|
-
let t = e.trim(), n = t.match(
|
|
2519
|
+
let t = e.trim(), n = t.match(ua);
|
|
2507
2520
|
if (n) {
|
|
2508
2521
|
let e = Number(n[1]), t = Number(n[2]), r = Number(n[3] ?? 0), i = n[4]?.replace(/[.\s]/g, "").toLowerCase();
|
|
2509
2522
|
if (i) {
|
|
@@ -2512,13 +2525,13 @@ function la(e) {
|
|
|
2512
2525
|
}
|
|
2513
2526
|
return e > 23 || t > 59 || r > 59 ? void 0 : E().hour(e).minute(t).second(r).millisecond(0);
|
|
2514
2527
|
}
|
|
2515
|
-
if (
|
|
2528
|
+
if (da.test(t)) {
|
|
2516
2529
|
let e = E(t);
|
|
2517
2530
|
return e.isValid() ? e : void 0;
|
|
2518
2531
|
}
|
|
2519
2532
|
}
|
|
2520
|
-
var
|
|
2521
|
-
function
|
|
2533
|
+
var pa = /^today\s*(?:([+-])\s*(\d{1,4}))?$/i, ma = /^\d{4}-\d{2}-\d{2}(?:[T ].*)?$/;
|
|
2534
|
+
function ha(e, t = E()) {
|
|
2522
2535
|
if (e == null || e === "") return;
|
|
2523
2536
|
if (E.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2524
2537
|
if (e instanceof Date) {
|
|
@@ -2526,47 +2539,47 @@ function fa(e, t = E()) {
|
|
|
2526
2539
|
return t.isValid() ? t : void 0;
|
|
2527
2540
|
}
|
|
2528
2541
|
if (typeof e != "string") return;
|
|
2529
|
-
let n = e.trim(), r = n.match(
|
|
2542
|
+
let n = e.trim(), r = n.match(pa);
|
|
2530
2543
|
if (r) {
|
|
2531
2544
|
let e = r[2] ? Number(r[2]) * (r[1] === "-" ? -1 : 1) : 0;
|
|
2532
2545
|
return E(t).startOf("day").add(e, "day");
|
|
2533
2546
|
}
|
|
2534
|
-
if (
|
|
2547
|
+
if (ma.test(n)) {
|
|
2535
2548
|
let e = E(n);
|
|
2536
2549
|
return e.isValid() ? e : void 0;
|
|
2537
2550
|
}
|
|
2538
2551
|
}
|
|
2539
2552
|
//#endregion
|
|
2540
2553
|
//#region src/components/form/csvTags.js
|
|
2541
|
-
var
|
|
2542
|
-
function
|
|
2554
|
+
var ga = "csvTags", _a = (e) => e.toLowerCase();
|
|
2555
|
+
function va(e) {
|
|
2543
2556
|
let t = Array.isArray(e) ? e : [e], n = [], r = /* @__PURE__ */ new Set();
|
|
2544
2557
|
return t.forEach((e) => {
|
|
2545
2558
|
e != null && typeof e != "object" && String(e).split(",").forEach((e) => {
|
|
2546
2559
|
let t = e.trim().replace(/\s+/g, " ");
|
|
2547
|
-
!t || r.has(
|
|
2560
|
+
!t || r.has(_a(t)) || (r.add(_a(t)), n.push(t));
|
|
2548
2561
|
});
|
|
2549
2562
|
}), n;
|
|
2550
2563
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2564
|
+
function ya(e, t = ", ") {
|
|
2565
|
+
return va(e).join(t || ", ");
|
|
2553
2566
|
}
|
|
2554
2567
|
//#endregion
|
|
2555
2568
|
//#region src/components/form/payloadTransformer.js
|
|
2556
|
-
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2557
|
-
function
|
|
2569
|
+
var V = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, ba = (e) => e === !0 || e === 1 || e === "1", H = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !xa(e);
|
|
2570
|
+
function xa(e) {
|
|
2558
2571
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2559
2572
|
}
|
|
2560
|
-
function
|
|
2561
|
-
return
|
|
2573
|
+
function Sa(e) {
|
|
2574
|
+
return xa(e) || e instanceof Date;
|
|
2562
2575
|
}
|
|
2563
|
-
function
|
|
2564
|
-
return e instanceof Date ? e.toISOString() :
|
|
2576
|
+
function Ca(e) {
|
|
2577
|
+
return e instanceof Date ? e.toISOString() : xa(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2565
2578
|
}
|
|
2566
|
-
function
|
|
2567
|
-
if (!pr(t)) return
|
|
2579
|
+
function wa(e, t) {
|
|
2580
|
+
if (!pr(t)) return Ca(e);
|
|
2568
2581
|
let n = mr(e);
|
|
2569
|
-
return n ? n.toISOString() :
|
|
2582
|
+
return n ? n.toISOString() : Ca(e);
|
|
2570
2583
|
}
|
|
2571
2584
|
function U(e, t) {
|
|
2572
2585
|
if (!t) return;
|
|
@@ -2591,7 +2604,7 @@ function K(e, t, n) {
|
|
|
2591
2604
|
}
|
|
2592
2605
|
return i[r[r.length - 1]] = n, e;
|
|
2593
2606
|
}
|
|
2594
|
-
function
|
|
2607
|
+
function Ta(e, t, n) {
|
|
2595
2608
|
let r = String(t).split("."), i = e;
|
|
2596
2609
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2597
2610
|
let t = r[e];
|
|
@@ -2603,24 +2616,24 @@ function Sa(e, t, n) {
|
|
|
2603
2616
|
...i[a]
|
|
2604
2617
|
} : n, e;
|
|
2605
2618
|
}
|
|
2606
|
-
function
|
|
2619
|
+
function Ea(e) {
|
|
2607
2620
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2608
2621
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2609
2622
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2610
2623
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2611
2624
|
}
|
|
2612
|
-
function
|
|
2625
|
+
function Da(e, t) {
|
|
2613
2626
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2614
|
-
H(n) && H(e[t]) ?
|
|
2627
|
+
H(n) && H(e[t]) ? Da(e[t], n) : e[t] = n;
|
|
2615
2628
|
}), e;
|
|
2616
2629
|
}
|
|
2617
|
-
function
|
|
2630
|
+
function Oa(e, t) {
|
|
2618
2631
|
let n = e.options ?? e.values ?? [];
|
|
2619
2632
|
for (let e of n) if (typeof e == "string") {
|
|
2620
2633
|
if (e === t) return e;
|
|
2621
2634
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2622
2635
|
}
|
|
2623
|
-
function
|
|
2636
|
+
function ka(e, t) {
|
|
2624
2637
|
if (H(e)) {
|
|
2625
2638
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2626
2639
|
return {
|
|
@@ -2630,10 +2643,10 @@ function Ea(e, t) {
|
|
|
2630
2643
|
}
|
|
2631
2644
|
return {
|
|
2632
2645
|
value: e,
|
|
2633
|
-
label:
|
|
2646
|
+
label: Oa(t, e) ?? e
|
|
2634
2647
|
};
|
|
2635
2648
|
}
|
|
2636
|
-
function
|
|
2649
|
+
function Aa(e = {}) {
|
|
2637
2650
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2638
2651
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2639
2652
|
if (e.type === "csvTags") return "csv";
|
|
@@ -2645,17 +2658,17 @@ function Da(e = {}) {
|
|
|
2645
2658
|
}
|
|
2646
2659
|
}
|
|
2647
2660
|
function q(e, t, n = {}) {
|
|
2648
|
-
if (
|
|
2649
|
-
if (t === "string") return
|
|
2661
|
+
if (Sa(e)) {
|
|
2662
|
+
if (t === "string") return wa(e, n);
|
|
2650
2663
|
if (t === "number") {
|
|
2651
|
-
let t =
|
|
2664
|
+
let t = xa(e) ? e.valueOf() : e.getTime();
|
|
2652
2665
|
return Number.isNaN(t) ? null : t;
|
|
2653
2666
|
}
|
|
2654
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2667
|
+
if (t === "date" || t === "auto" || !t) return wa(e, n);
|
|
2655
2668
|
}
|
|
2656
2669
|
switch (t) {
|
|
2657
2670
|
case "string": return e == null ? "" : String(e);
|
|
2658
|
-
case "csv": return
|
|
2671
|
+
case "csv": return ya(e, n.csvSeparator);
|
|
2659
2672
|
case "number": {
|
|
2660
2673
|
if (V(e)) return null;
|
|
2661
2674
|
let t = Number(e);
|
|
@@ -2667,14 +2680,14 @@ function q(e, t, n = {}) {
|
|
|
2667
2680
|
return t = Array.isArray(e) ? e : V(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => q(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2668
2681
|
}
|
|
2669
2682
|
case "object": return H(e), e;
|
|
2670
|
-
case "date": return
|
|
2683
|
+
case "date": return wa(e, n);
|
|
2671
2684
|
case "custom":
|
|
2672
2685
|
case "auto":
|
|
2673
2686
|
case void 0:
|
|
2674
2687
|
default: return e;
|
|
2675
2688
|
}
|
|
2676
2689
|
}
|
|
2677
|
-
var
|
|
2690
|
+
var ja = {
|
|
2678
2691
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2679
2692
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2680
2693
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2682,11 +2695,11 @@ var Oa = {
|
|
|
2682
2695
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2683
2696
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2684
2697
|
};
|
|
2685
|
-
function
|
|
2698
|
+
function Ma(e, t) {
|
|
2686
2699
|
if (!t) return e;
|
|
2687
2700
|
let n = t;
|
|
2688
2701
|
if (typeof n == "string") {
|
|
2689
|
-
if (
|
|
2702
|
+
if (ja[n]) return ja[n](e);
|
|
2690
2703
|
try {
|
|
2691
2704
|
n = JSON.parse(n);
|
|
2692
2705
|
} catch {
|
|
@@ -2694,14 +2707,14 @@ function ka(e, t) {
|
|
|
2694
2707
|
}
|
|
2695
2708
|
}
|
|
2696
2709
|
let r = e;
|
|
2697
|
-
if (n.name &&
|
|
2710
|
+
if (n.name && ja[n.name] && (r = ja[n.name](r)), n.map && typeof n.map == "object") {
|
|
2698
2711
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2699
2712
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2700
2713
|
}
|
|
2701
2714
|
return r;
|
|
2702
2715
|
}
|
|
2703
|
-
var
|
|
2704
|
-
function
|
|
2716
|
+
var Na = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2717
|
+
function Pa(e, t) {
|
|
2705
2718
|
let [n, ...r] = e.split("."), i;
|
|
2706
2719
|
if (n === "value") i = t.value;
|
|
2707
2720
|
else if (n === "label") i = t.label;
|
|
@@ -2709,24 +2722,24 @@ function ja(e, t) {
|
|
|
2709
2722
|
else return;
|
|
2710
2723
|
return r.length ? U(i, r.join(".")) : i;
|
|
2711
2724
|
}
|
|
2712
|
-
function
|
|
2725
|
+
function Fa(e, t) {
|
|
2713
2726
|
if (typeof e == "string") {
|
|
2714
2727
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2715
|
-
return n ?
|
|
2716
|
-
let r =
|
|
2728
|
+
return n ? Pa(n[1], t) : e.replace(Na, (e, n) => {
|
|
2729
|
+
let r = Pa(n, t);
|
|
2717
2730
|
return r == null ? "" : String(r);
|
|
2718
2731
|
});
|
|
2719
2732
|
}
|
|
2720
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2733
|
+
if (Array.isArray(e)) return e.map((e) => Fa(e, t));
|
|
2721
2734
|
if (H(e)) {
|
|
2722
2735
|
let n = {};
|
|
2723
2736
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2724
|
-
n[e] =
|
|
2737
|
+
n[e] = Fa(r, t);
|
|
2725
2738
|
}), n;
|
|
2726
2739
|
}
|
|
2727
2740
|
return e;
|
|
2728
2741
|
}
|
|
2729
|
-
function
|
|
2742
|
+
function Ia(e) {
|
|
2730
2743
|
if (!e) return null;
|
|
2731
2744
|
if (typeof e == "string") try {
|
|
2732
2745
|
return JSON.parse(e);
|
|
@@ -2735,8 +2748,8 @@ function Na(e) {
|
|
|
2735
2748
|
}
|
|
2736
2749
|
return e;
|
|
2737
2750
|
}
|
|
2738
|
-
function
|
|
2739
|
-
let n = e.payloadMode || "auto", r =
|
|
2751
|
+
function La(e, t) {
|
|
2752
|
+
let n = e.payloadMode || "auto", r = Aa(e), { value: i, label: a } = ka(t, e);
|
|
2740
2753
|
switch (n) {
|
|
2741
2754
|
case "value": return {
|
|
2742
2755
|
kind: "scalar",
|
|
@@ -2758,12 +2771,12 @@ function Pa(e, t) {
|
|
|
2758
2771
|
}
|
|
2759
2772
|
case "custom":
|
|
2760
2773
|
case "template": {
|
|
2761
|
-
let n =
|
|
2774
|
+
let n = Ia(e.payloadTemplate);
|
|
2762
2775
|
if (!n) return {
|
|
2763
2776
|
kind: "scalar",
|
|
2764
2777
|
out: q(i, r, e)
|
|
2765
2778
|
};
|
|
2766
|
-
let o =
|
|
2779
|
+
let o = Fa(n, {
|
|
2767
2780
|
value: q(i, e.elementType || "auto", {}),
|
|
2768
2781
|
label: a,
|
|
2769
2782
|
raw: t
|
|
@@ -2779,23 +2792,23 @@ function Pa(e, t) {
|
|
|
2779
2792
|
};
|
|
2780
2793
|
}
|
|
2781
2794
|
}
|
|
2782
|
-
function
|
|
2795
|
+
function Ra(e = {}) {
|
|
2783
2796
|
let t = e.defaultValue;
|
|
2784
|
-
if (t !== void 0 && t !== "") return e.type === "time" ?
|
|
2797
|
+
if (t !== void 0 && t !== "") return e.type === "time" ? fa(t) : e.type === "date" ? ha(t) : t;
|
|
2785
2798
|
}
|
|
2786
|
-
function
|
|
2799
|
+
function za(e, t) {
|
|
2787
2800
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2788
2801
|
let n = t;
|
|
2789
2802
|
if (V(n)) {
|
|
2790
|
-
let t =
|
|
2803
|
+
let t = Ra(e);
|
|
2791
2804
|
t !== void 0 && (n = t);
|
|
2792
2805
|
}
|
|
2793
|
-
return n =
|
|
2806
|
+
return n = Ma(n, e.transformRule), V(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Aa(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2794
2807
|
kind: "scalar",
|
|
2795
|
-
out: n.map((t) =>
|
|
2796
|
-
} :
|
|
2808
|
+
out: n.map((t) => La(e, t).out)
|
|
2809
|
+
} : La(e, n);
|
|
2797
2810
|
}
|
|
2798
|
-
function
|
|
2811
|
+
function Ba(e = {}) {
|
|
2799
2812
|
return !!e.richValue || [
|
|
2800
2813
|
"label",
|
|
2801
2814
|
"object",
|
|
@@ -2803,8 +2816,8 @@ function La(e = {}) {
|
|
|
2803
2816
|
"template"
|
|
2804
2817
|
].includes(e.payloadMode);
|
|
2805
2818
|
}
|
|
2806
|
-
function
|
|
2807
|
-
if (!
|
|
2819
|
+
function Va(e, t, n = []) {
|
|
2820
|
+
if (!Ba(e) || t == null) return t;
|
|
2808
2821
|
let r = (e) => {
|
|
2809
2822
|
if (H(e) && e.value !== void 0) return e;
|
|
2810
2823
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2815,7 +2828,7 @@ function Ra(e, t, n = []) {
|
|
|
2815
2828
|
};
|
|
2816
2829
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2817
2830
|
}
|
|
2818
|
-
function
|
|
2831
|
+
function Ha(e, t, n) {
|
|
2819
2832
|
if (!e?.field) return !0;
|
|
2820
2833
|
let r = G(t, e.field) ? W(t, e.field) : W(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2821
2834
|
switch (e.operator) {
|
|
@@ -2829,49 +2842,49 @@ function za(e, t, n) {
|
|
|
2829
2842
|
default: return !0;
|
|
2830
2843
|
}
|
|
2831
2844
|
}
|
|
2832
|
-
function
|
|
2845
|
+
function Ua(e) {
|
|
2833
2846
|
let t = [];
|
|
2834
2847
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2835
2848
|
e?.field && t.push(e.field);
|
|
2836
2849
|
}), t;
|
|
2837
2850
|
}
|
|
2838
|
-
function
|
|
2851
|
+
function Wa(e, t, n) {
|
|
2839
2852
|
if (!e) return !0;
|
|
2840
2853
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2841
2854
|
if (r.length) {
|
|
2842
|
-
let i = r.map((e) =>
|
|
2855
|
+
let i = r.map((e) => Ha(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2843
2856
|
if (e.field) {
|
|
2844
|
-
let r =
|
|
2857
|
+
let r = Ha(e, t, n);
|
|
2845
2858
|
o = a ? o || r : o && r;
|
|
2846
2859
|
}
|
|
2847
2860
|
return o;
|
|
2848
2861
|
}
|
|
2849
|
-
return
|
|
2862
|
+
return Ha(e, t, n);
|
|
2850
2863
|
}
|
|
2851
|
-
function
|
|
2852
|
-
let a =
|
|
2853
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2864
|
+
function Ga(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2865
|
+
let a = Ua(e?.showIf);
|
|
2866
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Wa(e.showIf, t, n) ? a.every((e) => {
|
|
2854
2867
|
let a = r?.get?.(e);
|
|
2855
|
-
return !a ||
|
|
2868
|
+
return !a || Ga(a, t, n, r, i);
|
|
2856
2869
|
}) : !1);
|
|
2857
2870
|
}
|
|
2858
|
-
function
|
|
2871
|
+
function Ka(e = []) {
|
|
2859
2872
|
let t = /* @__PURE__ */ new Map();
|
|
2860
2873
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2861
2874
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2862
2875
|
})), t;
|
|
2863
2876
|
}
|
|
2864
|
-
function
|
|
2877
|
+
function qa(e = {}, { editing: t = !1 } = {}) {
|
|
2865
2878
|
let n = {};
|
|
2866
2879
|
return (e.fields ?? []).forEach((e) => {
|
|
2867
|
-
if (!(!e.field ||
|
|
2880
|
+
if (!(!e.field || Xa(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2868
2881
|
if (e.type === "time") {
|
|
2869
|
-
let t =
|
|
2882
|
+
let t = fa(e.defaultValue);
|
|
2870
2883
|
t !== void 0 && (n[e.field] = t);
|
|
2871
2884
|
return;
|
|
2872
2885
|
}
|
|
2873
2886
|
if (e.type === "date") {
|
|
2874
|
-
let t =
|
|
2887
|
+
let t = ha(e.defaultValue);
|
|
2875
2888
|
t !== void 0 && (n[e.field] = t);
|
|
2876
2889
|
return;
|
|
2877
2890
|
}
|
|
@@ -2879,7 +2892,7 @@ function Wa(e = {}, { editing: t = !1 } = {}) {
|
|
|
2879
2892
|
}
|
|
2880
2893
|
}), n;
|
|
2881
2894
|
}
|
|
2882
|
-
function
|
|
2895
|
+
function Ja(e = []) {
|
|
2883
2896
|
let t = [];
|
|
2884
2897
|
return e.forEach((e) => {
|
|
2885
2898
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2890,27 +2903,27 @@ function Ga(e = []) {
|
|
|
2890
2903
|
});
|
|
2891
2904
|
}), t;
|
|
2892
2905
|
}
|
|
2893
|
-
var
|
|
2906
|
+
var Ya = [
|
|
2894
2907
|
"file",
|
|
2895
2908
|
"document",
|
|
2896
2909
|
"image",
|
|
2897
2910
|
"upload",
|
|
2898
2911
|
"attachment"
|
|
2899
2912
|
];
|
|
2900
|
-
function
|
|
2901
|
-
return
|
|
2913
|
+
function Xa(e) {
|
|
2914
|
+
return Ya.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2902
2915
|
}
|
|
2903
|
-
function
|
|
2904
|
-
return
|
|
2916
|
+
function Za(e = []) {
|
|
2917
|
+
return Ja(e).map(({ field: e }) => e).filter(Xa);
|
|
2905
2918
|
}
|
|
2906
|
-
function
|
|
2919
|
+
function Qa(e) {
|
|
2907
2920
|
return String(e ?? "").trim().toLowerCase();
|
|
2908
2921
|
}
|
|
2909
|
-
function
|
|
2910
|
-
return !!t &&
|
|
2922
|
+
function $a(e, t) {
|
|
2923
|
+
return !!t && Qa(e.moduleName) === t;
|
|
2911
2924
|
}
|
|
2912
|
-
function
|
|
2913
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2925
|
+
function eo(e, t = [], n = {}) {
|
|
2926
|
+
let r = [], i = n.scope ?? "all", a = Qa(n.module), o = (e, t) => {
|
|
2914
2927
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2915
2928
|
let n = t?.originFileObj || t;
|
|
2916
2929
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2920,9 +2933,9 @@ function Za(e, t = [], n = {}) {
|
|
|
2920
2933
|
});
|
|
2921
2934
|
};
|
|
2922
2935
|
return (t ?? []).forEach((t) => {
|
|
2923
|
-
let r = (t.fields ?? []).filter(
|
|
2936
|
+
let r = (t.fields ?? []).filter(Xa);
|
|
2924
2937
|
if (!r.length) return;
|
|
2925
|
-
let s = t.moduleName &&
|
|
2938
|
+
let s = t.moduleName && !$a(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2926
2939
|
if (t.addRow) {
|
|
2927
2940
|
if (i === "flat") return;
|
|
2928
2941
|
let a = e[t.name];
|
|
@@ -2942,12 +2955,12 @@ function Za(e, t = [], n = {}) {
|
|
|
2942
2955
|
});
|
|
2943
2956
|
}), r;
|
|
2944
2957
|
}
|
|
2945
|
-
function
|
|
2958
|
+
function to(e, t, n = {}) {
|
|
2946
2959
|
let r = H(n.base) ? structuredClone(n.base) : {};
|
|
2947
|
-
|
|
2948
|
-
(e.payloadKey || e.field) && (
|
|
2960
|
+
Za(t).forEach((e) => {
|
|
2961
|
+
(e.payloadKey || e.field) && (io(r, e.payloadKey || e.field), io(r, e.field));
|
|
2949
2962
|
});
|
|
2950
|
-
let i =
|
|
2963
|
+
let i = Qa(n.module), a = Ka(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || $a(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2951
2964
|
return (t ?? []).forEach((t) => {
|
|
2952
2965
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && G(e, t.toggleField) ? !!W(e, t.toggleField) : !1;
|
|
2953
2966
|
if (t.toggleEnabled && t.toggleField && G(e, t.toggleField) && (K(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2957,29 +2970,29 @@ function Qa(e, t, n = {}) {
|
|
|
2957
2970
|
if (t.addRow) {
|
|
2958
2971
|
let i = e[t.name];
|
|
2959
2972
|
if (!Array.isArray(i)) return;
|
|
2960
|
-
K(n, t.payloadKey || t.name, i.map((t) =>
|
|
2973
|
+
K(n, t.payloadKey || t.name, i.map((t) => ro(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2961
2974
|
return;
|
|
2962
2975
|
}
|
|
2963
|
-
r.forEach((t) =>
|
|
2976
|
+
r.forEach((t) => no(t, e, n, e, a));
|
|
2964
2977
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2965
2978
|
moduleName: e,
|
|
2966
2979
|
data: t
|
|
2967
|
-
}))),
|
|
2980
|
+
}))), Ji(r, t);
|
|
2968
2981
|
}
|
|
2969
|
-
function
|
|
2970
|
-
if (
|
|
2971
|
-
let r =
|
|
2982
|
+
function no(e, t, n, r, i) {
|
|
2983
|
+
if (Xi(e) && $i(e)) {
|
|
2984
|
+
let r = Zi(e);
|
|
2972
2985
|
G(t, r) && K(n, r, !!W(t, r));
|
|
2973
2986
|
}
|
|
2974
|
-
if (
|
|
2975
|
-
let i =
|
|
2987
|
+
if (Xa(e)) {
|
|
2988
|
+
let i = Ea(W(t, e.field));
|
|
2976
2989
|
if (i !== void 0) {
|
|
2977
2990
|
let a = r !== void 0 && r !== t;
|
|
2978
|
-
|
|
2991
|
+
Ta(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2979
2992
|
}
|
|
2980
2993
|
return;
|
|
2981
2994
|
}
|
|
2982
|
-
if (
|
|
2995
|
+
if (Ua(e.showIf).length && !Ga(e, t, r, i)) {
|
|
2983
2996
|
(r === void 0 || r === t) && G(t, e.field) && K(n, e.payloadKey || e.field, null);
|
|
2984
2997
|
return;
|
|
2985
2998
|
}
|
|
@@ -2987,30 +3000,30 @@ function $a(e, t, n, r, i) {
|
|
|
2987
3000
|
if (!G(t, e.field)) return;
|
|
2988
3001
|
let a = W(t, e.field);
|
|
2989
3002
|
if (!Array.isArray(a)) return;
|
|
2990
|
-
let o = a.map((t) =>
|
|
3003
|
+
let o = a.map((t) => ro(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2991
3004
|
K(n, e.payloadKey || e.field, o);
|
|
2992
3005
|
return;
|
|
2993
3006
|
}
|
|
2994
3007
|
if (!G(t, e.field)) return;
|
|
2995
|
-
if (
|
|
2996
|
-
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a =
|
|
3008
|
+
if (ba(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
3009
|
+
let r = W(t, e.field), i = Array.isArray(r) ? r : V(r) ? [] : [r], a = oo(e), o = i.map((e) => za(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2997
3010
|
K(n, e.payloadKey || e.field, o);
|
|
2998
3011
|
return;
|
|
2999
3012
|
}
|
|
3000
|
-
let a =
|
|
3013
|
+
let a = za(e, W(t, e.field));
|
|
3001
3014
|
if (a.kind !== "skip") {
|
|
3002
3015
|
if (a.kind === "spread" && H(a.out)) {
|
|
3003
|
-
|
|
3016
|
+
Da(n, a.out);
|
|
3004
3017
|
return;
|
|
3005
3018
|
}
|
|
3006
3019
|
K(n, e.payloadKey || e.field, a.out);
|
|
3007
3020
|
}
|
|
3008
3021
|
}
|
|
3009
|
-
function
|
|
3022
|
+
function ro(e, t, n, r) {
|
|
3010
3023
|
let i = {};
|
|
3011
|
-
return e.forEach((e) =>
|
|
3024
|
+
return e.forEach((e) => no(e, t, i, n ?? t, r)), i;
|
|
3012
3025
|
}
|
|
3013
|
-
function
|
|
3026
|
+
function io(e, t) {
|
|
3014
3027
|
let n = String(t).split("."), r = e;
|
|
3015
3028
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
3016
3029
|
if (!H(r[n[e]])) return;
|
|
@@ -3018,7 +3031,7 @@ function to(e, t) {
|
|
|
3018
3031
|
}
|
|
3019
3032
|
delete r[n[n.length - 1]];
|
|
3020
3033
|
}
|
|
3021
|
-
var
|
|
3034
|
+
var ao = /* @__PURE__ */ new Set([
|
|
3022
3035
|
"text",
|
|
3023
3036
|
"textarea",
|
|
3024
3037
|
"email",
|
|
@@ -3031,22 +3044,22 @@ var no = /* @__PURE__ */ new Set([
|
|
|
3031
3044
|
"password"
|
|
3032
3045
|
]);
|
|
3033
3046
|
function J(e, t) {
|
|
3034
|
-
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ?
|
|
3047
|
+
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ? Ra(e) : void 0;
|
|
3035
3048
|
if (t == null) return r() ?? t;
|
|
3036
3049
|
if (n(t) || V(t) && r() !== void 0) return r();
|
|
3037
|
-
if (
|
|
3050
|
+
if (ao.has(e.type) && H(t)) {
|
|
3038
3051
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
3039
3052
|
if (r === void 0 || H(r)) return;
|
|
3040
3053
|
t = r;
|
|
3041
3054
|
}
|
|
3042
|
-
if (e.type === "csvTags") return
|
|
3055
|
+
if (e.type === "csvTags") return va(t);
|
|
3043
3056
|
if (e.type === "date" || e.type === "time") {
|
|
3044
3057
|
if (!t || t === "0001-01-01T00:00:00Z") return null;
|
|
3045
3058
|
let e = E(t);
|
|
3046
3059
|
return e.isValid() ? e : null;
|
|
3047
3060
|
}
|
|
3048
|
-
t =
|
|
3049
|
-
let i = (t) => H(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
3061
|
+
t = ca(e, t);
|
|
3062
|
+
let i = (t) => H(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && Aa(e) === "array", o = (t) => {
|
|
3050
3063
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
3051
3064
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
3052
3065
|
return n ? n.value : t;
|
|
@@ -3058,7 +3071,7 @@ function J(e, t) {
|
|
|
3058
3071
|
}
|
|
3059
3072
|
return t;
|
|
3060
3073
|
}
|
|
3061
|
-
function
|
|
3074
|
+
function oo(e = {}) {
|
|
3062
3075
|
return {
|
|
3063
3076
|
...e,
|
|
3064
3077
|
addRow: !1,
|
|
@@ -3067,14 +3080,14 @@ function ro(e = {}) {
|
|
|
3067
3080
|
dataType: void 0
|
|
3068
3081
|
};
|
|
3069
3082
|
}
|
|
3070
|
-
function
|
|
3083
|
+
function so(e, t) {
|
|
3071
3084
|
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;
|
|
3072
3085
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
3073
3086
|
let i = [];
|
|
3074
3087
|
Array.isArray(t) && (i = t.map((t) => {
|
|
3075
3088
|
let n = {};
|
|
3076
3089
|
return e.subFields.forEach((e) => {
|
|
3077
|
-
if (!e.field ||
|
|
3090
|
+
if (!e.field || Xa(e)) return;
|
|
3078
3091
|
let r = U(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
3079
3092
|
r != null && (n[e.field] = J(e, r));
|
|
3080
3093
|
}), n;
|
|
@@ -3083,7 +3096,7 @@ function io(e, t) {
|
|
|
3083
3096
|
for (; i.length < a;) i.push({});
|
|
3084
3097
|
return i;
|
|
3085
3098
|
}
|
|
3086
|
-
let i =
|
|
3099
|
+
let i = oo(e), a = [];
|
|
3087
3100
|
if (Array.isArray(t)) a = t.map((e) => J(i, e)).filter((e) => e != null && e !== "");
|
|
3088
3101
|
else if (t != null && t !== "") {
|
|
3089
3102
|
let e = J(i, t);
|
|
@@ -3095,12 +3108,12 @@ function io(e, t) {
|
|
|
3095
3108
|
}
|
|
3096
3109
|
//#endregion
|
|
3097
3110
|
//#region src/components/form/linkedAddRowGroups.js
|
|
3098
|
-
var
|
|
3099
|
-
function
|
|
3111
|
+
var co = (e) => e === !0 || e === 1 || e === "1";
|
|
3112
|
+
function lo(e = []) {
|
|
3100
3113
|
let t = /* @__PURE__ */ new Map();
|
|
3101
3114
|
e.forEach((e) => {
|
|
3102
3115
|
let n = e?.linkGroup;
|
|
3103
|
-
!
|
|
3116
|
+
!co(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
3104
3117
|
});
|
|
3105
3118
|
let n = /* @__PURE__ */ new Map();
|
|
3106
3119
|
return t.forEach((e, t) => {
|
|
@@ -3110,11 +3123,11 @@ function oo(e = []) {
|
|
|
3110
3123
|
});
|
|
3111
3124
|
}), n;
|
|
3112
3125
|
}
|
|
3113
|
-
function
|
|
3126
|
+
function uo(e, t) {
|
|
3114
3127
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3115
3128
|
return null;
|
|
3116
3129
|
}
|
|
3117
|
-
function
|
|
3130
|
+
function fo(e, t = {}) {
|
|
3118
3131
|
let n = { ...t };
|
|
3119
3132
|
return e.forEach(({ memberNames: e }) => {
|
|
3120
3133
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3126,7 +3139,7 @@ function co(e, t = {}) {
|
|
|
3126
3139
|
}
|
|
3127
3140
|
//#endregion
|
|
3128
3141
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3129
|
-
var
|
|
3142
|
+
var po = {
|
|
3130
3143
|
duplicate: {
|
|
3131
3144
|
className: "fdd-tone-amber",
|
|
3132
3145
|
Icon: ve
|
|
@@ -3144,8 +3157,8 @@ var lo = {
|
|
|
3144
3157
|
Icon: me
|
|
3145
3158
|
}
|
|
3146
3159
|
};
|
|
3147
|
-
function
|
|
3148
|
-
let { className: l, Icon: u } =
|
|
3160
|
+
function mo({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c } = {}) {
|
|
3161
|
+
let { className: l, Icon: u } = po[e] ?? po.suggestion, d = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3149
3162
|
return new Promise((e) => {
|
|
3150
3163
|
let r = !1, f = (t) => {
|
|
3151
3164
|
r || (r = !0, e(t));
|
|
@@ -3209,8 +3222,8 @@ function uo({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3209
3222
|
});
|
|
3210
3223
|
});
|
|
3211
3224
|
}
|
|
3212
|
-
function
|
|
3213
|
-
let { className: a, Icon: o } =
|
|
3225
|
+
function ho({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3226
|
+
let { className: a, Icon: o } = po[e] ?? po.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3214
3227
|
return new Promise((e) => {
|
|
3215
3228
|
ne.warning({
|
|
3216
3229
|
icon: null,
|
|
@@ -3252,7 +3265,7 @@ function fo({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3252
3265
|
}
|
|
3253
3266
|
//#endregion
|
|
3254
3267
|
//#region src/services/aiActionApi.js
|
|
3255
|
-
async function
|
|
3268
|
+
async function go({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3256
3269
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3257
3270
|
let c = await r(), l = new FormData();
|
|
3258
3271
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3278,17 +3291,17 @@ async function po({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3278
3291
|
}
|
|
3279
3292
|
//#endregion
|
|
3280
3293
|
//#region src/components/detail/phoneDisplay.js
|
|
3281
|
-
var
|
|
3282
|
-
function
|
|
3294
|
+
var _o = (e) => e == null || e === "";
|
|
3295
|
+
function vo(e, t) {
|
|
3283
3296
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3284
3297
|
}
|
|
3285
|
-
function
|
|
3298
|
+
function yo(e) {
|
|
3286
3299
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3287
3300
|
if (!t) return "";
|
|
3288
3301
|
let n = t.replace(/^\+/, "");
|
|
3289
3302
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3290
3303
|
}
|
|
3291
|
-
function
|
|
3304
|
+
function bo(e) {
|
|
3292
3305
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3293
3306
|
return [
|
|
3294
3307
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3301,15 +3314,15 @@ function _o(e) {
|
|
|
3301
3314
|
"isdCode"
|
|
3302
3315
|
];
|
|
3303
3316
|
}
|
|
3304
|
-
function
|
|
3305
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3317
|
+
function xo(e, t, n = "") {
|
|
3318
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...bo(e)] : bo(e);
|
|
3306
3319
|
for (let e of i) {
|
|
3307
|
-
let n =
|
|
3320
|
+
let n = yo(vo(t, e));
|
|
3308
3321
|
if (n) return n;
|
|
3309
3322
|
}
|
|
3310
|
-
return
|
|
3323
|
+
return yo(n);
|
|
3311
3324
|
}
|
|
3312
|
-
function
|
|
3325
|
+
function So(e) {
|
|
3313
3326
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3314
3327
|
return n ? {
|
|
3315
3328
|
code: n[1],
|
|
@@ -3319,17 +3332,17 @@ function yo(e) {
|
|
|
3319
3332
|
rest: t
|
|
3320
3333
|
};
|
|
3321
3334
|
}
|
|
3322
|
-
function
|
|
3323
|
-
if (
|
|
3324
|
-
let { code: n, rest: r } =
|
|
3335
|
+
function Co(e, t = "") {
|
|
3336
|
+
if (_o(e)) return "";
|
|
3337
|
+
let { code: n, rest: r } = So(e), i = n || yo(t), a = Qn(r) || r;
|
|
3325
3338
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3326
3339
|
}
|
|
3327
|
-
function
|
|
3328
|
-
return
|
|
3340
|
+
function wo(e, t, n) {
|
|
3341
|
+
return Co(t, xo(e, n, Xn()));
|
|
3329
3342
|
}
|
|
3330
3343
|
//#endregion
|
|
3331
3344
|
//#region src/components/detail/renderConfig.js
|
|
3332
|
-
var
|
|
3345
|
+
var To = [
|
|
3333
3346
|
{
|
|
3334
3347
|
value: "auto",
|
|
3335
3348
|
label: "Default (auto)"
|
|
@@ -3386,7 +3399,7 @@ var So = [
|
|
|
3386
3399
|
value: "html",
|
|
3387
3400
|
label: "HTML"
|
|
3388
3401
|
}
|
|
3389
|
-
],
|
|
3402
|
+
], Eo = [
|
|
3390
3403
|
{
|
|
3391
3404
|
value: "preview",
|
|
3392
3405
|
label: "Preview (viewer)"
|
|
@@ -3407,7 +3420,7 @@ var So = [
|
|
|
3407
3420
|
value: "text",
|
|
3408
3421
|
label: "Text (filename)"
|
|
3409
3422
|
}
|
|
3410
|
-
],
|
|
3423
|
+
], Do = [
|
|
3411
3424
|
{
|
|
3412
3425
|
value: "none",
|
|
3413
3426
|
label: "None"
|
|
@@ -3424,76 +3437,76 @@ var So = [
|
|
|
3424
3437
|
value: "title",
|
|
3425
3438
|
label: "Title Case"
|
|
3426
3439
|
}
|
|
3427
|
-
],
|
|
3440
|
+
], Oo = [
|
|
3428
3441
|
"location",
|
|
3429
3442
|
"path",
|
|
3430
3443
|
"url",
|
|
3431
3444
|
"key"
|
|
3432
|
-
],
|
|
3445
|
+
], ko = [
|
|
3433
3446
|
"location",
|
|
3434
3447
|
"filepath",
|
|
3435
3448
|
"path",
|
|
3436
3449
|
"url",
|
|
3437
3450
|
"key"
|
|
3438
|
-
],
|
|
3451
|
+
], Ao = [
|
|
3439
3452
|
"uploadedfilename",
|
|
3440
3453
|
"uploadname",
|
|
3441
3454
|
"originalname",
|
|
3442
3455
|
"displayname",
|
|
3443
3456
|
"documentname",
|
|
3444
3457
|
"filename"
|
|
3445
|
-
],
|
|
3446
|
-
function
|
|
3458
|
+
], jo = ["name"], Mo = (e) => String(e).toLowerCase(), No = (e) => e == null || e === "";
|
|
3459
|
+
function Po(e, t) {
|
|
3447
3460
|
for (let n of t) {
|
|
3448
3461
|
let t = e[n];
|
|
3449
3462
|
if (typeof t == "string" && t) return t;
|
|
3450
3463
|
}
|
|
3451
3464
|
return "";
|
|
3452
3465
|
}
|
|
3453
|
-
function
|
|
3454
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3466
|
+
function Fo(e, t) {
|
|
3467
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Mo(t).endsWith(n)) return r;
|
|
3455
3468
|
return "";
|
|
3456
3469
|
}
|
|
3457
|
-
function
|
|
3470
|
+
function Io(e) {
|
|
3458
3471
|
if (!e) return "";
|
|
3459
3472
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3460
3473
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3461
3474
|
}
|
|
3462
|
-
function
|
|
3475
|
+
function Lo(e) {
|
|
3463
3476
|
if (!e) return "";
|
|
3464
3477
|
let t = String(e);
|
|
3465
3478
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3466
3479
|
}
|
|
3467
|
-
function
|
|
3480
|
+
function Ro(e) {
|
|
3468
3481
|
let t = String(e ?? "").trim();
|
|
3469
3482
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3470
3483
|
}
|
|
3471
|
-
function
|
|
3472
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3484
|
+
function zo(e) {
|
|
3485
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Po(e, Oo) || Fo(e, ko);
|
|
3473
3486
|
}
|
|
3474
|
-
function
|
|
3475
|
-
return e ? typeof e == "string" ?
|
|
3487
|
+
function Bo(e) {
|
|
3488
|
+
return e ? typeof e == "string" ? Io(e) || e : typeof e == "object" && (Po(e, I().documentNameOrder ?? []) || Fo(e, Ao) || Io(zo(e)) || Fo(e, jo)) || "Document" : "Document";
|
|
3476
3489
|
}
|
|
3477
|
-
function
|
|
3478
|
-
if (
|
|
3490
|
+
function Vo(e) {
|
|
3491
|
+
if (No(e)) return [];
|
|
3479
3492
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3480
|
-
for (let e of t) if (!
|
|
3493
|
+
for (let e of t) if (!No(e)) {
|
|
3481
3494
|
if (typeof e == "string") {
|
|
3482
3495
|
let t = e.includes("/") ? e : "";
|
|
3483
3496
|
n.push({
|
|
3484
3497
|
location: t,
|
|
3485
|
-
name:
|
|
3486
|
-
url:
|
|
3487
|
-
needsAuthFetch:
|
|
3498
|
+
name: Io(e) || e,
|
|
3499
|
+
url: Lo(t),
|
|
3500
|
+
needsAuthFetch: Ro(t)
|
|
3488
3501
|
});
|
|
3489
3502
|
} else if (typeof e == "object") {
|
|
3490
|
-
let t =
|
|
3503
|
+
let t = zo(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3491
3504
|
n.push({
|
|
3492
3505
|
location: t,
|
|
3493
|
-
name:
|
|
3494
|
-
url: r ||
|
|
3506
|
+
name: Bo(e),
|
|
3507
|
+
url: r || Lo(t),
|
|
3495
3508
|
documentId: e.id || e._id || e.documentId || "",
|
|
3496
|
-
needsAuthFetch: !r &&
|
|
3509
|
+
needsAuthFetch: !r && Ro(t)
|
|
3497
3510
|
});
|
|
3498
3511
|
}
|
|
3499
3512
|
}
|
|
@@ -3501,24 +3514,24 @@ function Ro(e) {
|
|
|
3501
3514
|
}
|
|
3502
3515
|
//#endregion
|
|
3503
3516
|
//#region src/components/form/repeatableRowShape.js
|
|
3504
|
-
function
|
|
3517
|
+
function Ho(e) {
|
|
3505
3518
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3506
3519
|
}
|
|
3507
|
-
function
|
|
3520
|
+
function Uo(e, t) {
|
|
3508
3521
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3509
|
-
let n =
|
|
3522
|
+
let n = Ho(e);
|
|
3510
3523
|
if (!n) return t;
|
|
3511
3524
|
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 }));
|
|
3512
3525
|
return r ? i : t;
|
|
3513
3526
|
}
|
|
3514
3527
|
//#endregion
|
|
3515
3528
|
//#region src/components/form/applyGroupValues.js
|
|
3516
|
-
var
|
|
3517
|
-
function
|
|
3529
|
+
var Wo = (e) => e === !0 || e === 1 || e === "1", Go = (e) => e == null || e === "";
|
|
3530
|
+
function Ko(e) {
|
|
3518
3531
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3519
3532
|
}
|
|
3520
3533
|
function Y(e, t, n) {
|
|
3521
|
-
let r = Array.isArray(t) ? t :
|
|
3534
|
+
let r = Array.isArray(t) ? t : Ko(t);
|
|
3522
3535
|
if (!r.length) return e;
|
|
3523
3536
|
let i = e;
|
|
3524
3537
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3527,23 +3540,23 @@ function Y(e, t, n) {
|
|
|
3527
3540
|
}
|
|
3528
3541
|
return i[r[r.length - 1]] = n, e;
|
|
3529
3542
|
}
|
|
3530
|
-
function
|
|
3543
|
+
function qo(e, t = []) {
|
|
3531
3544
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3532
3545
|
if (!n) continue;
|
|
3533
3546
|
let t = U(e, n);
|
|
3534
|
-
if (!
|
|
3547
|
+
if (!Go(t)) return t;
|
|
3535
3548
|
}
|
|
3536
3549
|
}
|
|
3537
|
-
function
|
|
3550
|
+
function Jo(e, t) {
|
|
3538
3551
|
if (!e || typeof e != "object") return;
|
|
3539
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3552
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Go(n));
|
|
3540
3553
|
if (r) return r[1];
|
|
3541
3554
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3542
|
-
let n =
|
|
3543
|
-
if (!
|
|
3555
|
+
let n = Jo(e, t);
|
|
3556
|
+
if (!Go(n)) return n;
|
|
3544
3557
|
}
|
|
3545
3558
|
}
|
|
3546
|
-
function
|
|
3559
|
+
function Yo(e, t) {
|
|
3547
3560
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3548
3561
|
if (!n.length) return;
|
|
3549
3562
|
let r = n.map((e, n) => {
|
|
@@ -3553,9 +3566,9 @@ function Ko(e, t) {
|
|
|
3553
3566
|
status: "done"
|
|
3554
3567
|
};
|
|
3555
3568
|
if (!e || typeof e != "object") return null;
|
|
3556
|
-
let r =
|
|
3569
|
+
let r = qo(e, [t.fileUrlKey, t.locationKey]) ?? Jo(e, /(location|url|path)$/i) ?? "", i = qo(e, [t.fileNameKey]) ?? Jo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3557
3570
|
if (!r && !i) return null;
|
|
3558
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3571
|
+
let a = r && !String(r).startsWith("http") ? Lo(r) : r;
|
|
3559
3572
|
return {
|
|
3560
3573
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3561
3574
|
name: i || "file",
|
|
@@ -3567,11 +3580,11 @@ function Ko(e, t) {
|
|
|
3567
3580
|
}).filter(Boolean);
|
|
3568
3581
|
return r.length ? r : void 0;
|
|
3569
3582
|
}
|
|
3570
|
-
function
|
|
3583
|
+
function Xo(e, t) {
|
|
3571
3584
|
if (!e || typeof e != "object") return;
|
|
3572
|
-
let n =
|
|
3585
|
+
let n = qo(e, [t.fileNameKey, t.field]) ?? Jo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = qo(e, [t.fileUrlKey, t.locationKey]) ?? Jo(e, /(location|url|path)$/i) ?? "";
|
|
3573
3586
|
if (!n && !r) return;
|
|
3574
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3587
|
+
let i = r && !String(r).startsWith("http") ? Lo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3575
3588
|
return [{
|
|
3576
3589
|
uid: String(a),
|
|
3577
3590
|
name: n ?? "file",
|
|
@@ -3580,7 +3593,7 @@ function qo(e, t) {
|
|
|
3580
3593
|
url: i || void 0
|
|
3581
3594
|
}];
|
|
3582
3595
|
}
|
|
3583
|
-
function
|
|
3596
|
+
function Zo(e, t, n, r) {
|
|
3584
3597
|
(e.fields ?? []).forEach((e) => {
|
|
3585
3598
|
e?.verifyAction && [
|
|
3586
3599
|
e.verifyResultField,
|
|
@@ -3593,8 +3606,8 @@ function Jo(e, t, n, r) {
|
|
|
3593
3606
|
});
|
|
3594
3607
|
});
|
|
3595
3608
|
}
|
|
3596
|
-
function
|
|
3597
|
-
let t = Array.isArray(e.rows) ?
|
|
3609
|
+
function Qo(e) {
|
|
3610
|
+
let t = Array.isArray(e.rows) ? Uo(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3598
3611
|
let i = {};
|
|
3599
3612
|
return (e.fields ?? []).forEach((e) => {
|
|
3600
3613
|
if (!e.field) return;
|
|
@@ -3605,30 +3618,30 @@ function Yo(e) {
|
|
|
3605
3618
|
}
|
|
3606
3619
|
let a = r(t, e);
|
|
3607
3620
|
if (a == null) {
|
|
3608
|
-
let t = e.defaultOnEdit ?
|
|
3621
|
+
let t = e.defaultOnEdit ? Ra(e) : void 0;
|
|
3609
3622
|
t !== void 0 && Y(i, e.field, t);
|
|
3610
3623
|
return;
|
|
3611
3624
|
}
|
|
3612
|
-
Y(i, e.field,
|
|
3613
|
-
}),
|
|
3614
|
-
}, i =
|
|
3625
|
+
Y(i, e.field, Wo(e.addRow) ? so(e, a) : J(e, a));
|
|
3626
|
+
}), Zo(e, t, i, r), i;
|
|
3627
|
+
}, i = qa(e, { editing: !0 });
|
|
3615
3628
|
if (t && t.length > 0) {
|
|
3616
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3629
|
+
let e = t.map((e) => r(e, (e, t) => Xo(e, t), (e, t) => U(e, t.field)));
|
|
3617
3630
|
for (; e.length < n;) e.push({ ...i });
|
|
3618
3631
|
return e;
|
|
3619
3632
|
}
|
|
3620
|
-
let a = r(e, (e, t) =>
|
|
3633
|
+
let a = r(e, (e, t) => Yo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3621
3634
|
for (; o.length < n;) o.push({ ...i });
|
|
3622
3635
|
return o;
|
|
3623
3636
|
}
|
|
3624
|
-
function
|
|
3637
|
+
function $o(e, t = []) {
|
|
3625
3638
|
let n = {};
|
|
3626
3639
|
return t.forEach((e) => {
|
|
3627
3640
|
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3628
3641
|
if (!e.field || e.addRow) return;
|
|
3629
3642
|
let t = e.value, r = e.field;
|
|
3630
3643
|
if (e.type === "file") {
|
|
3631
|
-
let i =
|
|
3644
|
+
let i = Yo(t, e);
|
|
3632
3645
|
i && Y(n, r, i);
|
|
3633
3646
|
return;
|
|
3634
3647
|
}
|
|
@@ -3638,12 +3651,12 @@ function Xo(e, t = []) {
|
|
|
3638
3651
|
if (i) {
|
|
3639
3652
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3640
3653
|
Y(n, r, e ? [e[0]] : []);
|
|
3641
|
-
} else Y(n, r,
|
|
3654
|
+
} else Y(n, r, ca(e, Array.isArray(t) ? t : [t]));
|
|
3642
3655
|
return;
|
|
3643
3656
|
}
|
|
3644
3657
|
let i = e.splitDialCodeInto;
|
|
3645
3658
|
if (i && typeof t == "string") {
|
|
3646
|
-
let { code: a, rest: o } =
|
|
3659
|
+
let { code: a, rest: o } = So(t), s = yo(a);
|
|
3647
3660
|
s && Y(n, i, s), Y(n, r, J(e, o || t));
|
|
3648
3661
|
return;
|
|
3649
3662
|
}
|
|
@@ -3653,27 +3666,27 @@ function Xo(e, t = []) {
|
|
|
3653
3666
|
}
|
|
3654
3667
|
//#endregion
|
|
3655
3668
|
//#region src/components/form/useAiActions.js
|
|
3656
|
-
function
|
|
3669
|
+
function es(e) {
|
|
3657
3670
|
let t = document.createElement("div");
|
|
3658
3671
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3659
3672
|
}
|
|
3660
|
-
function
|
|
3661
|
-
return t && t === "stripHtml" ?
|
|
3673
|
+
function ts(e, t) {
|
|
3674
|
+
return t && t === "stripHtml" ? es(e) : e;
|
|
3662
3675
|
}
|
|
3663
|
-
function
|
|
3676
|
+
function ns(e) {
|
|
3664
3677
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3665
3678
|
}
|
|
3666
|
-
function
|
|
3679
|
+
function rs(e) {
|
|
3667
3680
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3668
3681
|
}
|
|
3669
|
-
function
|
|
3682
|
+
function is(e, t) {
|
|
3670
3683
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3671
|
-
let n =
|
|
3684
|
+
let n = ts(t, e.transform), r = String(n ?? "").trim();
|
|
3672
3685
|
if (!r) return !1;
|
|
3673
3686
|
let i = Number(e.minWords) || 0;
|
|
3674
|
-
return i > 0 ?
|
|
3687
|
+
return i > 0 ? ns(r) >= i : !0;
|
|
3675
3688
|
}
|
|
3676
|
-
function
|
|
3689
|
+
function as(e, t) {
|
|
3677
3690
|
let n = e.inputs || [];
|
|
3678
3691
|
if (n.length === 0) return !0;
|
|
3679
3692
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3681,10 +3694,10 @@ function ns(e, t) {
|
|
|
3681
3694
|
let n = e.group || `__solo_${t}`;
|
|
3682
3695
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3683
3696
|
});
|
|
3684
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3697
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => is(e, t(e.sourceField)))) return !1;
|
|
3685
3698
|
return !0;
|
|
3686
3699
|
}
|
|
3687
|
-
function
|
|
3700
|
+
function os(e = []) {
|
|
3688
3701
|
let t = [];
|
|
3689
3702
|
return e.forEach((e) => {
|
|
3690
3703
|
if (e?.addRow) {
|
|
@@ -3697,32 +3710,32 @@ function rs(e = []) {
|
|
|
3697
3710
|
});
|
|
3698
3711
|
}), t;
|
|
3699
3712
|
}
|
|
3700
|
-
function
|
|
3701
|
-
return
|
|
3713
|
+
function ss(e, t) {
|
|
3714
|
+
return os(t).some((t) => {
|
|
3702
3715
|
let n = e.getFieldValue(t);
|
|
3703
|
-
return Array.isArray(n) ? n.some(
|
|
3716
|
+
return Array.isArray(n) ? n.some(rs) : n != null && n !== "";
|
|
3704
3717
|
});
|
|
3705
3718
|
}
|
|
3706
|
-
function
|
|
3719
|
+
function cs(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3707
3720
|
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;
|
|
3708
3721
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3709
|
-
if (!(i.has(e) || !a(e) || !
|
|
3722
|
+
if (!(i.has(e) || !a(e) || !ls(t))) {
|
|
3710
3723
|
if (Array.isArray(t)) {
|
|
3711
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3724
|
+
o += t.filter((e) => e && typeof e == "object" ? rs(e) : !!e).length;
|
|
3712
3725
|
return;
|
|
3713
3726
|
}
|
|
3714
3727
|
o += 1;
|
|
3715
3728
|
}
|
|
3716
3729
|
}), o;
|
|
3717
3730
|
}
|
|
3718
|
-
function
|
|
3719
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3731
|
+
function ls(e) {
|
|
3732
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? rs(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
3720
3733
|
}
|
|
3721
|
-
function
|
|
3734
|
+
function us(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3722
3735
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
3723
|
-
return n ? a.some((e) =>
|
|
3736
|
+
return n ? a.some((e) => ls(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && ls(r[t])) : a.some((e) => ls(r[e]));
|
|
3724
3737
|
}
|
|
3725
|
-
function
|
|
3738
|
+
function ds(e = []) {
|
|
3726
3739
|
let t = {};
|
|
3727
3740
|
return (e ?? []).forEach((e) => {
|
|
3728
3741
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3733,38 +3746,38 @@ function cs(e = []) {
|
|
|
3733
3746
|
});
|
|
3734
3747
|
}), t;
|
|
3735
3748
|
}
|
|
3736
|
-
function
|
|
3749
|
+
function fs(e, t, n) {
|
|
3737
3750
|
let r = e?.confirmWhen ?? "never";
|
|
3738
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3751
|
+
return r === "never" ? !1 : r === "always" || ss(t, n);
|
|
3739
3752
|
}
|
|
3740
|
-
var
|
|
3753
|
+
var ps = [
|
|
3741
3754
|
"top-left",
|
|
3742
3755
|
"top-center",
|
|
3743
3756
|
"top-right",
|
|
3744
3757
|
"bottom-left",
|
|
3745
3758
|
"bottom-center",
|
|
3746
3759
|
"bottom-right"
|
|
3747
|
-
],
|
|
3748
|
-
function
|
|
3760
|
+
], ms = "bottom-left";
|
|
3761
|
+
function hs(e = []) {
|
|
3749
3762
|
let t = {};
|
|
3750
3763
|
return e.forEach((e) => {
|
|
3751
|
-
let n =
|
|
3764
|
+
let n = ps.includes(e.position) ? e.position : ms;
|
|
3752
3765
|
(t[n] ??= []).push(e);
|
|
3753
3766
|
}), t;
|
|
3754
3767
|
}
|
|
3755
|
-
function
|
|
3756
|
-
let [o, s] = v(null), [c, l] = v(""), u = S.useWatch((e) => e, e), d = p((e) =>
|
|
3768
|
+
function gs({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3769
|
+
let [o, s] = v(null), [c, l] = v(""), u = S.useWatch((e) => e, e), d = p((e) => as(e, (e) => (u || {})[e]), [u]), f = p((t) => {
|
|
3757
3770
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3758
|
-
let n =
|
|
3771
|
+
let n = $o(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3759
3772
|
return t.forEach((t) => {
|
|
3760
3773
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3761
|
-
let n =
|
|
3774
|
+
let n = Qo(t);
|
|
3762
3775
|
if (n.length === 0) return;
|
|
3763
3776
|
r = !0;
|
|
3764
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3777
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(rs);
|
|
3765
3778
|
if (a.length) {
|
|
3766
3779
|
let e = t.label || t.name;
|
|
3767
|
-
|
|
3780
|
+
mo({
|
|
3768
3781
|
tone: "overwrite",
|
|
3769
3782
|
title: `Replace what's in ${e}?`,
|
|
3770
3783
|
facts: [
|
|
@@ -3794,9 +3807,9 @@ function ps({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3794
3807
|
return {
|
|
3795
3808
|
runAction: p(async (t, o, c, u) => {
|
|
3796
3809
|
let d = c?.confirmWhen ?? "never";
|
|
3797
|
-
if (c?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
3798
|
-
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
3799
|
-
if (!await
|
|
3810
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || us(e, [o?.field], { includeUntouched: a }))) {
|
|
3811
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = cs(e, [o?.field], { includeUntouched: a });
|
|
3812
|
+
if (!await mo({
|
|
3800
3813
|
tone: "overwrite",
|
|
3801
3814
|
title: t.title || "Read this file and fill the form in?",
|
|
3802
3815
|
facts: [{
|
|
@@ -3820,12 +3833,12 @@ function ps({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3820
3833
|
r && (s[t.param] = r);
|
|
3821
3834
|
} else {
|
|
3822
3835
|
let n = e.getFieldValue(t.sourceField);
|
|
3823
|
-
n != null && n !== "" && (a[t.param] =
|
|
3836
|
+
n != null && n !== "" && (a[t.param] = ts(n, t.transform));
|
|
3824
3837
|
}
|
|
3825
3838
|
}), (c.inputs || []).forEach((e) => {
|
|
3826
3839
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3827
3840
|
});
|
|
3828
|
-
let l = await
|
|
3841
|
+
let l = await go({
|
|
3829
3842
|
module: n,
|
|
3830
3843
|
group: t,
|
|
3831
3844
|
field: o.field,
|
|
@@ -3833,9 +3846,9 @@ function ps({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3833
3846
|
inputs: a,
|
|
3834
3847
|
files: s
|
|
3835
3848
|
}), d = c.label || "AI action", p = l?.groups;
|
|
3836
|
-
if (c?.trigger !== "upload" &&
|
|
3837
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3838
|
-
if (!await
|
|
3849
|
+
if (c?.trigger !== "upload" && fs(c, e, p)) {
|
|
3850
|
+
let e = c.confirmMessages ?? {}, t = os(p).length;
|
|
3851
|
+
if (!await mo({
|
|
3839
3852
|
tone: "overwrite",
|
|
3840
3853
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3841
3854
|
facts: [{
|
|
@@ -3856,7 +3869,7 @@ function ps({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3856
3869
|
field: o,
|
|
3857
3870
|
groupName: t,
|
|
3858
3871
|
responseGroups: p,
|
|
3859
|
-
payload:
|
|
3872
|
+
payload: ds(p)
|
|
3860
3873
|
});
|
|
3861
3874
|
if (e === !1 || e === "abort") return l;
|
|
3862
3875
|
}
|
|
@@ -3888,7 +3901,7 @@ function ps({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3888
3901
|
}
|
|
3889
3902
|
//#endregion
|
|
3890
3903
|
//#region src/components/form/AiActionButtons.jsx
|
|
3891
|
-
function
|
|
3904
|
+
function _s({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3892
3905
|
if (!t || t.length === 0) return null;
|
|
3893
3906
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3894
3907
|
return /* @__PURE__ */ w(re, {
|
|
@@ -3909,18 +3922,18 @@ function ms({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3909
3922
|
}
|
|
3910
3923
|
//#endregion
|
|
3911
3924
|
//#region src/components/form/emailValidator.js
|
|
3912
|
-
function
|
|
3925
|
+
function vs(e) {
|
|
3913
3926
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3914
3927
|
if (!n) return !1;
|
|
3915
3928
|
let [, r, i] = n;
|
|
3916
3929
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3917
3930
|
}
|
|
3918
|
-
function
|
|
3919
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3931
|
+
function ys(e = "Email", t) {
|
|
3932
|
+
return { validator: (n, r) => r == null || r === "" || vs(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3920
3933
|
}
|
|
3921
3934
|
//#endregion
|
|
3922
3935
|
//#region src/components/form/inputValidator.js
|
|
3923
|
-
var
|
|
3936
|
+
var bs = [
|
|
3924
3937
|
{
|
|
3925
3938
|
label: "Only Numbers",
|
|
3926
3939
|
value: "onlyNumber"
|
|
@@ -3993,7 +4006,7 @@ var _s = [
|
|
|
3993
4006
|
label: "Website URL",
|
|
3994
4007
|
value: "websiteUrl"
|
|
3995
4008
|
}
|
|
3996
|
-
],
|
|
4009
|
+
], xs = {
|
|
3997
4010
|
onlyNumber: /^[0-9]$/,
|
|
3998
4011
|
experience: /^[0-9]$/,
|
|
3999
4012
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -4009,10 +4022,10 @@ var _s = [
|
|
|
4009
4022
|
decimalRange: /^[0-9.]$/,
|
|
4010
4023
|
contactNumber: /^[0-9()\-+\s]$/
|
|
4011
4024
|
};
|
|
4012
|
-
function
|
|
4013
|
-
return
|
|
4025
|
+
function Ss(e) {
|
|
4026
|
+
return xs[e] ?? null;
|
|
4014
4027
|
}
|
|
4015
|
-
function
|
|
4028
|
+
function Cs(e, t = {}, n = "change") {
|
|
4016
4029
|
if (!t?.type || e == null) return {
|
|
4017
4030
|
cleaned: e ?? "",
|
|
4018
4031
|
error: null
|
|
@@ -4095,7 +4108,7 @@ function bs(e, t = {}, n = "change") {
|
|
|
4095
4108
|
break;
|
|
4096
4109
|
}
|
|
4097
4110
|
case "email":
|
|
4098
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4111
|
+
c = n === "blur" ? r.trim() : r, c && !vs(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
4099
4112
|
break;
|
|
4100
4113
|
case "websiteUrl":
|
|
4101
4114
|
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.`);
|
|
@@ -4107,21 +4120,21 @@ function bs(e, t = {}, n = "change") {
|
|
|
4107
4120
|
error: l
|
|
4108
4121
|
};
|
|
4109
4122
|
}
|
|
4110
|
-
var
|
|
4111
|
-
function
|
|
4123
|
+
var ws = "This value is already present";
|
|
4124
|
+
function Ts(e) {
|
|
4112
4125
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
4113
4126
|
}
|
|
4114
|
-
function
|
|
4115
|
-
if (
|
|
4127
|
+
function Es(e) {
|
|
4128
|
+
if (Ts(e) !== "unique") return null;
|
|
4116
4129
|
if (typeof e == "string") return {
|
|
4117
|
-
message:
|
|
4130
|
+
message: ws,
|
|
4118
4131
|
normalizer: "trim",
|
|
4119
4132
|
skipBlank: !0,
|
|
4120
4133
|
validateOn: "blur"
|
|
4121
4134
|
};
|
|
4122
4135
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4123
4136
|
return {
|
|
4124
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4137
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : ws,
|
|
4125
4138
|
collectionField: t.collectionField ?? "",
|
|
4126
4139
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4127
4140
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4132,20 +4145,20 @@ function Cs(e) {
|
|
|
4132
4145
|
].includes(n) ? n : "blur"
|
|
4133
4146
|
};
|
|
4134
4147
|
}
|
|
4135
|
-
function
|
|
4148
|
+
function Ds(e) {
|
|
4136
4149
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4137
4150
|
if (!Array.isArray(t)) return null;
|
|
4138
4151
|
for (let e of t) {
|
|
4139
|
-
let t =
|
|
4152
|
+
let t = Es(e);
|
|
4140
4153
|
if (t) return t;
|
|
4141
4154
|
}
|
|
4142
4155
|
return null;
|
|
4143
4156
|
}
|
|
4144
|
-
function
|
|
4157
|
+
function Os(e = []) {
|
|
4145
4158
|
let t = [];
|
|
4146
4159
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4147
4160
|
(e?.fields ?? []).forEach((e) => {
|
|
4148
|
-
let n =
|
|
4161
|
+
let n = Ds(e);
|
|
4149
4162
|
!n || !e?.field || t.push({
|
|
4150
4163
|
field: e.field,
|
|
4151
4164
|
label: e.label ?? e.field,
|
|
@@ -4154,10 +4167,10 @@ function Ts(e = []) {
|
|
|
4154
4167
|
});
|
|
4155
4168
|
}), t;
|
|
4156
4169
|
}
|
|
4157
|
-
function
|
|
4170
|
+
function ks(e) {
|
|
4158
4171
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4159
4172
|
}
|
|
4160
|
-
function
|
|
4173
|
+
function As(e, t = "trim") {
|
|
4161
4174
|
if (e == null) return "";
|
|
4162
4175
|
let n = String(e);
|
|
4163
4176
|
switch (String(t)) {
|
|
@@ -4169,10 +4182,10 @@ function Ds(e, t = "trim") {
|
|
|
4169
4182
|
default: return n.trim();
|
|
4170
4183
|
}
|
|
4171
4184
|
}
|
|
4172
|
-
function
|
|
4173
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4185
|
+
function js(e, t) {
|
|
4186
|
+
return !(!e || e.skipBlank !== !1 && ks(t));
|
|
4174
4187
|
}
|
|
4175
|
-
function
|
|
4188
|
+
function Ms(e) {
|
|
4176
4189
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4177
4190
|
}
|
|
4178
4191
|
var X = {
|
|
@@ -4182,21 +4195,21 @@ var X = {
|
|
|
4182
4195
|
STALE: "stale",
|
|
4183
4196
|
ERROR: "error"
|
|
4184
4197
|
};
|
|
4185
|
-
function
|
|
4198
|
+
function Ns({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4186
4199
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4187
4200
|
}
|
|
4188
|
-
function
|
|
4201
|
+
function Ps({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4189
4202
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4190
4203
|
function o(e) {
|
|
4191
4204
|
a = e, typeof t == "function" && t(a);
|
|
4192
4205
|
}
|
|
4193
4206
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4194
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4195
|
-
let p =
|
|
4207
|
+
if (!c || !t || !s || typeof e != "function" || !js(c, l)) return { status: X.SKIPPED };
|
|
4208
|
+
let p = Ns({
|
|
4196
4209
|
module: t,
|
|
4197
4210
|
field: s,
|
|
4198
4211
|
recordId: u,
|
|
4199
|
-
normalized:
|
|
4212
|
+
normalized: As(l, c.normalizer)
|
|
4200
4213
|
});
|
|
4201
4214
|
if (n.has(p)) return n.get(p);
|
|
4202
4215
|
i += 1;
|
|
@@ -4214,7 +4227,7 @@ function js({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4214
4227
|
if (r.get(s) !== m) return { status: X.STALE };
|
|
4215
4228
|
let a = i?.available === !1 ? {
|
|
4216
4229
|
status: X.DUPLICATE,
|
|
4217
|
-
message:
|
|
4230
|
+
message: Fs(i) || c.message || ws
|
|
4218
4231
|
} : { status: X.AVAILABLE };
|
|
4219
4232
|
return n.set(p, a), a;
|
|
4220
4233
|
} catch (e) {
|
|
@@ -4235,17 +4248,17 @@ function js({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4235
4248
|
}
|
|
4236
4249
|
};
|
|
4237
4250
|
}
|
|
4238
|
-
function
|
|
4251
|
+
function Fs(e) {
|
|
4239
4252
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4240
4253
|
}
|
|
4241
|
-
var
|
|
4242
|
-
function
|
|
4243
|
-
let r =
|
|
4254
|
+
var Is = "__uniqueRule";
|
|
4255
|
+
function Ls({ field: e, validation: t, context: n }) {
|
|
4256
|
+
let r = Es(t);
|
|
4244
4257
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4245
4258
|
let i = e?.field ?? "";
|
|
4246
4259
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4247
|
-
[
|
|
4248
|
-
validateTrigger:
|
|
4260
|
+
[Is]: r,
|
|
4261
|
+
validateTrigger: Ms(r),
|
|
4249
4262
|
validator: async (e, t) => {
|
|
4250
4263
|
let a = await n.checker.check({
|
|
4251
4264
|
module: n.module,
|
|
@@ -4260,22 +4273,22 @@ function Ps({ field: e, validation: t, context: n }) {
|
|
|
4260
4273
|
}
|
|
4261
4274
|
};
|
|
4262
4275
|
}
|
|
4263
|
-
function
|
|
4276
|
+
function Rs(e = []) {
|
|
4264
4277
|
let t = Array.isArray(e) ? e : [];
|
|
4265
|
-
if (!t.some((e) => e && e[
|
|
4266
|
-
let n = t.filter((e) => e && !e[
|
|
4278
|
+
if (!t.some((e) => e && e[Is])) return t;
|
|
4279
|
+
let n = t.filter((e) => e && !e[Is] && !e.warningOnly);
|
|
4267
4280
|
return t.map((e) => {
|
|
4268
|
-
if (!e || !e[
|
|
4281
|
+
if (!e || !e[Is]) return e;
|
|
4269
4282
|
let t = e.validator;
|
|
4270
4283
|
return {
|
|
4271
4284
|
...e,
|
|
4272
|
-
validator: async (e, r) => await
|
|
4285
|
+
validator: async (e, r) => await zs(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4273
4286
|
};
|
|
4274
4287
|
});
|
|
4275
4288
|
}
|
|
4276
|
-
async function
|
|
4289
|
+
async function zs(e = [], t, n = {}) {
|
|
4277
4290
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4278
|
-
if (r.required &&
|
|
4291
|
+
if (r.required && ks(t) || !ks(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;
|
|
4279
4292
|
if (typeof r.validator == "function") try {
|
|
4280
4293
|
await r.validator(n, t);
|
|
4281
4294
|
} catch {
|
|
@@ -4284,7 +4297,7 @@ async function Is(e = [], t, n = {}) {
|
|
|
4284
4297
|
}
|
|
4285
4298
|
return !1;
|
|
4286
4299
|
}
|
|
4287
|
-
function
|
|
4300
|
+
function Bs(e) {
|
|
4288
4301
|
let t = String(e ?? "").trim();
|
|
4289
4302
|
if (!t.startsWith("{")) return null;
|
|
4290
4303
|
try {
|
|
@@ -4293,19 +4306,19 @@ function Ls(e) {
|
|
|
4293
4306
|
return null;
|
|
4294
4307
|
}
|
|
4295
4308
|
}
|
|
4296
|
-
function
|
|
4309
|
+
function Vs(e) {
|
|
4297
4310
|
if (!e) return null;
|
|
4298
|
-
if (typeof e == "string") return
|
|
4311
|
+
if (typeof e == "string") return Bs(e);
|
|
4299
4312
|
let t = [
|
|
4300
4313
|
e.data,
|
|
4301
4314
|
e.response,
|
|
4302
4315
|
e,
|
|
4303
|
-
|
|
4316
|
+
Bs(e.message)
|
|
4304
4317
|
];
|
|
4305
4318
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4306
4319
|
return null;
|
|
4307
4320
|
}
|
|
4308
|
-
function
|
|
4321
|
+
function Hs({ field: e, group: t, rowIndex: n }) {
|
|
4309
4322
|
let r = String(e ?? ""), i = Number(n);
|
|
4310
4323
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4311
4324
|
String(t),
|
|
@@ -4313,14 +4326,14 @@ function zs({ field: e, group: t, rowIndex: n }) {
|
|
|
4313
4326
|
...r.split(".")
|
|
4314
4327
|
] : r;
|
|
4315
4328
|
}
|
|
4316
|
-
function
|
|
4317
|
-
let n =
|
|
4329
|
+
function Us(e, { uniqueRules: t = [] } = {}) {
|
|
4330
|
+
let n = Vs(e);
|
|
4318
4331
|
if (n) {
|
|
4319
4332
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4320
4333
|
let t = {
|
|
4321
4334
|
field: e.field,
|
|
4322
|
-
name:
|
|
4323
|
-
message: e.message || n.message ||
|
|
4335
|
+
name: Hs(e),
|
|
4336
|
+
message: e.message || n.message || ws
|
|
4324
4337
|
};
|
|
4325
4338
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4326
4339
|
});
|
|
@@ -4337,29 +4350,29 @@ function Bs(e, { uniqueRules: t = [] } = {}) {
|
|
|
4337
4350
|
}
|
|
4338
4351
|
//#endregion
|
|
4339
4352
|
//#region src/components/form/patternRule.js
|
|
4340
|
-
var
|
|
4341
|
-
function
|
|
4342
|
-
return !!(e && typeof e == "object" &&
|
|
4353
|
+
var Ws = (e) => e === !0 || e === 1 || e === "1" || typeof e == "string" && e.trim().toLowerCase() === "true";
|
|
4354
|
+
function Gs(e) {
|
|
4355
|
+
return !!(e && typeof e == "object" && Ws(e.warningOnly));
|
|
4343
4356
|
}
|
|
4344
|
-
function
|
|
4357
|
+
function Ks({ label: e, message: t, rule: n }) {
|
|
4345
4358
|
let r = {
|
|
4346
4359
|
pattern: new RegExp(n.pattern ?? n.value, n.flags),
|
|
4347
4360
|
message: t ?? `Enter valid ${e}`
|
|
4348
4361
|
};
|
|
4349
|
-
return
|
|
4362
|
+
return Gs(n) && (r.warningOnly = !0), r;
|
|
4350
4363
|
}
|
|
4351
|
-
function
|
|
4352
|
-
return
|
|
4364
|
+
function qs(e) {
|
|
4365
|
+
return Gs(e);
|
|
4353
4366
|
}
|
|
4354
|
-
function
|
|
4367
|
+
function Js(e, t) {
|
|
4355
4368
|
return e?.type === "pattern" && t?.warningOnly === !0 && (e.warningOnly = !0), e;
|
|
4356
4369
|
}
|
|
4357
|
-
function
|
|
4370
|
+
function Ys(e) {
|
|
4358
4371
|
return typeof e == "string" ? e.toUpperCase() : e;
|
|
4359
4372
|
}
|
|
4360
4373
|
//#endregion
|
|
4361
4374
|
//#region src/services/uniqueValidationApi.js
|
|
4362
|
-
async function
|
|
4375
|
+
async function Xs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4363
4376
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4364
4377
|
let c = {
|
|
4365
4378
|
field: t,
|
|
@@ -4393,7 +4406,7 @@ async function qs({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4393
4406
|
throw e;
|
|
4394
4407
|
}
|
|
4395
4408
|
}
|
|
4396
|
-
async function
|
|
4409
|
+
async function Zs({ module: e, payload: t, excludeId: n } = {}) {
|
|
4397
4410
|
if (!e || !t) return { duplicate: !1 };
|
|
4398
4411
|
try {
|
|
4399
4412
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4411,7 +4424,7 @@ async function Js({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4411
4424
|
}
|
|
4412
4425
|
//#endregion
|
|
4413
4426
|
//#region src/components/form/uploadAccept.js
|
|
4414
|
-
var
|
|
4427
|
+
var Qs = [
|
|
4415
4428
|
"jpg",
|
|
4416
4429
|
"jpeg",
|
|
4417
4430
|
"png",
|
|
@@ -4420,18 +4433,18 @@ var Ys = [
|
|
|
4420
4433
|
"bmp",
|
|
4421
4434
|
"svg",
|
|
4422
4435
|
"avif"
|
|
4423
|
-
],
|
|
4436
|
+
], $s = [
|
|
4424
4437
|
"mp4",
|
|
4425
4438
|
"webm",
|
|
4426
4439
|
"ogg",
|
|
4427
4440
|
"ogv",
|
|
4428
4441
|
"mov",
|
|
4429
4442
|
"m4v"
|
|
4430
|
-
],
|
|
4443
|
+
], ec = [
|
|
4431
4444
|
"pdf",
|
|
4432
4445
|
"doc",
|
|
4433
4446
|
"docx"
|
|
4434
|
-
],
|
|
4447
|
+
], tc = [
|
|
4435
4448
|
{
|
|
4436
4449
|
label: "Any file",
|
|
4437
4450
|
value: "any"
|
|
@@ -4456,45 +4469,45 @@ var Ys = [
|
|
|
4456
4469
|
label: "Images & Videos",
|
|
4457
4470
|
value: "imagesAndVideos"
|
|
4458
4471
|
}
|
|
4459
|
-
],
|
|
4472
|
+
], nc = {
|
|
4460
4473
|
resume: {
|
|
4461
|
-
exts:
|
|
4474
|
+
exts: ec,
|
|
4462
4475
|
maxSizeMB: 2,
|
|
4463
4476
|
hint: "PDF, DOC or DOCX",
|
|
4464
4477
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4465
4478
|
},
|
|
4466
4479
|
documents: {
|
|
4467
|
-
exts: [...
|
|
4480
|
+
exts: [...ec, ...Qs],
|
|
4468
4481
|
hint: "PDF, DOC or image files",
|
|
4469
4482
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4470
4483
|
},
|
|
4471
4484
|
images: {
|
|
4472
|
-
exts:
|
|
4485
|
+
exts: Qs,
|
|
4473
4486
|
hint: "Image files",
|
|
4474
4487
|
error: "Only image files are allowed"
|
|
4475
4488
|
},
|
|
4476
4489
|
videos: {
|
|
4477
|
-
exts:
|
|
4490
|
+
exts: $s,
|
|
4478
4491
|
hint: "Video files",
|
|
4479
4492
|
error: "Only video files are allowed"
|
|
4480
4493
|
},
|
|
4481
4494
|
imagesAndVideos: {
|
|
4482
|
-
exts: [...
|
|
4495
|
+
exts: [...Qs, ...$s],
|
|
4483
4496
|
hint: "Image or video files",
|
|
4484
4497
|
error: "Only image or video files are allowed"
|
|
4485
4498
|
}
|
|
4486
4499
|
};
|
|
4487
|
-
function
|
|
4500
|
+
function rc(e) {
|
|
4488
4501
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4489
4502
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4490
4503
|
}
|
|
4491
|
-
function
|
|
4504
|
+
function ic(e) {
|
|
4492
4505
|
let t = String(e?.accept ?? "").trim();
|
|
4493
|
-
return t && t !== "any" ?
|
|
4506
|
+
return t && t !== "any" ? nc[t] ?? null : !t && rc(e) ? nc.resume : nc[t] ?? null;
|
|
4494
4507
|
}
|
|
4495
4508
|
//#endregion
|
|
4496
4509
|
//#region src/components/form/quickActionLabels.js
|
|
4497
|
-
var
|
|
4510
|
+
var ac = /* @__PURE__ */ new Set([
|
|
4498
4511
|
"of",
|
|
4499
4512
|
"and",
|
|
4500
4513
|
"the",
|
|
@@ -4503,7 +4516,7 @@ var nc = /* @__PURE__ */ new Set([
|
|
|
4503
4516
|
"in",
|
|
4504
4517
|
"a",
|
|
4505
4518
|
"an"
|
|
4506
|
-
]),
|
|
4519
|
+
]), oc = {
|
|
4507
4520
|
addresses: "address",
|
|
4508
4521
|
branches: "branch",
|
|
4509
4522
|
batches: "batch",
|
|
@@ -4514,43 +4527,43 @@ var nc = /* @__PURE__ */ new Set([
|
|
|
4514
4527
|
people: "person",
|
|
4515
4528
|
statuses: "status"
|
|
4516
4529
|
};
|
|
4517
|
-
function
|
|
4530
|
+
function sc(e) {
|
|
4518
4531
|
let t = String(e ?? "").trim();
|
|
4519
4532
|
if (!t) return "";
|
|
4520
4533
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4521
4534
|
let n = t.toLowerCase();
|
|
4522
|
-
return
|
|
4535
|
+
return oc[n] ? oc[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;
|
|
4523
4536
|
}
|
|
4524
|
-
function
|
|
4537
|
+
function cc(e) {
|
|
4525
4538
|
let t = String(e ?? "").trim();
|
|
4526
4539
|
if (!t) return "";
|
|
4527
4540
|
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);
|
|
4528
4541
|
if (!n.length) return "";
|
|
4529
|
-
let r =
|
|
4542
|
+
let r = sc(n[n.length - 1]);
|
|
4530
4543
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4531
4544
|
let n = e.toLowerCase();
|
|
4532
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4545
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && ac.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4533
4546
|
}).join(" ");
|
|
4534
4547
|
}
|
|
4535
|
-
function
|
|
4548
|
+
function lc(e, t) {
|
|
4536
4549
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4537
4550
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4538
|
-
let r =
|
|
4551
|
+
let r = cc(e?.quickCreateModule || t);
|
|
4539
4552
|
return r ? `Add New ${r}` : "Add New";
|
|
4540
4553
|
}
|
|
4541
|
-
function
|
|
4554
|
+
function uc(e, t) {
|
|
4542
4555
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4543
4556
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4544
|
-
let r =
|
|
4557
|
+
let r = cc(e?.quickEditModule || t);
|
|
4545
4558
|
return r ? `Edit ${r}` : "Edit";
|
|
4546
4559
|
}
|
|
4547
|
-
function
|
|
4548
|
-
let r =
|
|
4549
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4560
|
+
function dc(e, t, n) {
|
|
4561
|
+
let r = cc((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4562
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : lc(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : uc(t, n));
|
|
4550
4563
|
}
|
|
4551
4564
|
//#endregion
|
|
4552
4565
|
//#region src/components/AppButton.jsx
|
|
4553
|
-
function
|
|
4566
|
+
function fc({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4554
4567
|
let o = /* @__PURE__ */ w(x, {
|
|
4555
4568
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4556
4569
|
icon: n,
|
|
@@ -4565,13 +4578,13 @@ function lc({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4565
4578
|
}
|
|
4566
4579
|
//#endregion
|
|
4567
4580
|
//#region src/components/detail/userNames.js
|
|
4568
|
-
function
|
|
4581
|
+
function pc(e) {
|
|
4569
4582
|
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 || "";
|
|
4570
4583
|
}
|
|
4571
|
-
function
|
|
4584
|
+
function mc(e) {
|
|
4572
4585
|
let t = {};
|
|
4573
4586
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4574
|
-
let n =
|
|
4587
|
+
let n = pc(e);
|
|
4575
4588
|
n && [
|
|
4576
4589
|
e.legacyUserId,
|
|
4577
4590
|
e.userId,
|
|
@@ -4585,16 +4598,16 @@ function dc(e) {
|
|
|
4585
4598
|
});
|
|
4586
4599
|
}), t;
|
|
4587
4600
|
}
|
|
4588
|
-
var
|
|
4589
|
-
function
|
|
4601
|
+
var hc = /* @__PURE__ */ new Map();
|
|
4602
|
+
function gc(e) {
|
|
4590
4603
|
let t = String(e ?? "").trim();
|
|
4591
4604
|
if (!t) return Promise.resolve("");
|
|
4592
|
-
if (
|
|
4593
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4594
|
-
return
|
|
4605
|
+
if (hc.has(t)) return hc.get(t);
|
|
4606
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => pc(e?.data ?? e ?? null)).catch(() => "");
|
|
4607
|
+
return hc.set(t, n), n;
|
|
4595
4608
|
}
|
|
4596
4609
|
var Z = (e) => e == null ? "" : String(e).trim();
|
|
4597
|
-
function
|
|
4610
|
+
function _c(e) {
|
|
4598
4611
|
let t = e?.quickCreateNotice;
|
|
4599
4612
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4600
4613
|
enabled: !0,
|
|
@@ -4607,7 +4620,7 @@ function mc(e) {
|
|
|
4607
4620
|
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
4608
4621
|
};
|
|
4609
4622
|
}
|
|
4610
|
-
var
|
|
4623
|
+
var vc = [
|
|
4611
4624
|
"clientName",
|
|
4612
4625
|
"companyName",
|
|
4613
4626
|
"name",
|
|
@@ -4617,24 +4630,24 @@ var hc = [
|
|
|
4617
4630
|
"label",
|
|
4618
4631
|
"employerName",
|
|
4619
4632
|
"vendorName"
|
|
4620
|
-
],
|
|
4633
|
+
], yc = (e, t) => {
|
|
4621
4634
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4622
|
-
},
|
|
4623
|
-
function
|
|
4635
|
+
}, bc = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4636
|
+
function xc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4624
4637
|
if (!e || typeof e != "object") return "";
|
|
4625
4638
|
for (let r of [
|
|
4626
4639
|
t,
|
|
4627
4640
|
n,
|
|
4628
|
-
...
|
|
4641
|
+
...vc
|
|
4629
4642
|
]) {
|
|
4630
4643
|
if (!r) continue;
|
|
4631
|
-
let t =
|
|
4644
|
+
let t = bc(yc(e, r));
|
|
4632
4645
|
if (t) return t;
|
|
4633
4646
|
}
|
|
4634
4647
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4635
4648
|
return r ? Z(e[r]) : "";
|
|
4636
4649
|
}
|
|
4637
|
-
function
|
|
4650
|
+
function Sc(e) {
|
|
4638
4651
|
if (!e || typeof e != "object") return "";
|
|
4639
4652
|
let t = [
|
|
4640
4653
|
e.createdBy,
|
|
@@ -4656,67 +4669,67 @@ function yc(e) {
|
|
|
4656
4669
|
}
|
|
4657
4670
|
return "";
|
|
4658
4671
|
}
|
|
4659
|
-
function
|
|
4672
|
+
function Cc(e = i) {
|
|
4660
4673
|
try {
|
|
4661
|
-
return
|
|
4674
|
+
return pc(e()) || "";
|
|
4662
4675
|
} catch {
|
|
4663
4676
|
return "";
|
|
4664
4677
|
}
|
|
4665
4678
|
}
|
|
4666
|
-
var
|
|
4679
|
+
var wc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4667
4680
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4668
4681
|
return Array.isArray(t) ? t[0] : t;
|
|
4669
4682
|
});
|
|
4670
|
-
async function
|
|
4671
|
-
let { fetchRecord: o =
|
|
4683
|
+
async function Tc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4684
|
+
let { fetchRecord: o = wc, fetchUserNameFn: s = gc, getUser: c = i } = a, l = null;
|
|
4672
4685
|
if (e && t) try {
|
|
4673
4686
|
l = await o(e, t);
|
|
4674
4687
|
} catch {
|
|
4675
4688
|
l = null;
|
|
4676
4689
|
}
|
|
4677
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4690
|
+
let u = n?.showRecordName === !1 ? "" : xc(l, {
|
|
4678
4691
|
recordNameField: n?.recordNameField,
|
|
4679
4692
|
displayField: r
|
|
4680
4693
|
}), d = "";
|
|
4681
4694
|
if (n?.showCreator !== !1) {
|
|
4682
|
-
let e =
|
|
4695
|
+
let e = Sc(l);
|
|
4683
4696
|
if (e) try {
|
|
4684
4697
|
d = Z(await s(e));
|
|
4685
4698
|
} catch {
|
|
4686
4699
|
d = "";
|
|
4687
4700
|
}
|
|
4688
|
-
d ||=
|
|
4701
|
+
d ||= Cc(c);
|
|
4689
4702
|
}
|
|
4690
4703
|
return {
|
|
4691
4704
|
recordName: u,
|
|
4692
4705
|
creatorName: d
|
|
4693
4706
|
};
|
|
4694
4707
|
}
|
|
4695
|
-
var
|
|
4696
|
-
function
|
|
4708
|
+
var Ec = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
4709
|
+
function Dc(e) {
|
|
4697
4710
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
4698
4711
|
}
|
|
4699
|
-
var
|
|
4700
|
-
function
|
|
4701
|
-
let n =
|
|
4702
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
4712
|
+
var Oc = (e) => Dc(e).toLowerCase();
|
|
4713
|
+
function kc(e, t) {
|
|
4714
|
+
let n = Oc(e);
|
|
4715
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => Oc(e?.label) === n) ?? null;
|
|
4703
4716
|
}
|
|
4704
|
-
function
|
|
4705
|
-
return t || n ? !1 :
|
|
4717
|
+
function Ac({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
4718
|
+
return t || n ? !1 : Dc(e).length >= 3;
|
|
4706
4719
|
}
|
|
4707
4720
|
//#endregion
|
|
4708
4721
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4709
|
-
var
|
|
4710
|
-
function
|
|
4722
|
+
var jc = f(() => import("./index.js").then((e) => e.i)), Mc = f(() => import("./index.js").then((e) => e.n)), Nc = (e) => e == null || e === "", Pc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4723
|
+
function Fc(e, t, n, r, i) {
|
|
4711
4724
|
let a = e.quickEditIdFrom;
|
|
4712
4725
|
if (a) {
|
|
4713
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4714
|
-
return
|
|
4726
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Pc(a)] : Pc(a), i = t?.getFieldValue?.(e);
|
|
4727
|
+
return Nc(i) && (i = r?.[a]), Nc(i) ? null : i;
|
|
4715
4728
|
}
|
|
4716
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4729
|
+
return i && typeof i == "object" ? i.value ?? null : Nc(i) ? null : i;
|
|
4717
4730
|
}
|
|
4718
|
-
function
|
|
4719
|
-
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ?
|
|
4731
|
+
function Ic({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4732
|
+
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ? Fc(e, t, n, i, a) : null, [
|
|
4720
4733
|
p,
|
|
4721
4734
|
e,
|
|
4722
4735
|
t,
|
|
@@ -4730,7 +4743,7 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4730
4743
|
openCreateWith: null,
|
|
4731
4744
|
isModalOpen: !1
|
|
4732
4745
|
};
|
|
4733
|
-
let y =
|
|
4746
|
+
let y = Ec(e, r), b = () => c(null), ee = () => {
|
|
4734
4747
|
if (e?.quickCreateOnClick) {
|
|
4735
4748
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
4736
4749
|
return;
|
|
@@ -4754,12 +4767,12 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4754
4767
|
module: h,
|
|
4755
4768
|
recordId: String(_)
|
|
4756
4769
|
}), ae = (t) => {
|
|
4757
|
-
let n =
|
|
4770
|
+
let n = _c(e);
|
|
4758
4771
|
n && (d({
|
|
4759
4772
|
...n,
|
|
4760
4773
|
recordName: "",
|
|
4761
4774
|
creatorName: ""
|
|
4762
|
-
}),
|
|
4775
|
+
}), Tc({
|
|
4763
4776
|
module: m,
|
|
4764
4777
|
recordId: t,
|
|
4765
4778
|
notice: n,
|
|
@@ -4789,20 +4802,20 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4789
4802
|
icon: /* @__PURE__ */ w(_e, {}),
|
|
4790
4803
|
onClick: ee,
|
|
4791
4804
|
style: { paddingLeft: 0 },
|
|
4792
|
-
children:
|
|
4805
|
+
children: lc(e, m)
|
|
4793
4806
|
}), p && /* @__PURE__ */ w(x, {
|
|
4794
4807
|
type: "link",
|
|
4795
4808
|
size: "small",
|
|
4796
4809
|
icon: /* @__PURE__ */ w(le, {}),
|
|
4797
4810
|
onClick: S,
|
|
4798
4811
|
disabled: !_,
|
|
4799
|
-
title: _ ? void 0 : `Choose a ${
|
|
4800
|
-
children:
|
|
4812
|
+
title: _ ? void 0 : `Choose a ${cc(h) || "record"} above first, then edit it here`,
|
|
4813
|
+
children: uc(e, h)
|
|
4801
4814
|
})]
|
|
4802
4815
|
})
|
|
4803
4816
|
}), ce = s ? /* @__PURE__ */ w(ne, {
|
|
4804
4817
|
open: !0,
|
|
4805
|
-
title:
|
|
4818
|
+
title: dc(s.mode, e, s.mode === "create" ? m : h),
|
|
4806
4819
|
width: "min(1080px, 96vw)",
|
|
4807
4820
|
footer: null,
|
|
4808
4821
|
destroyOnClose: !0,
|
|
@@ -4820,7 +4833,7 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4820
4833
|
},
|
|
4821
4834
|
children: /* @__PURE__ */ w(ie, {})
|
|
4822
4835
|
}),
|
|
4823
|
-
children: s.mode === "create" ? /* @__PURE__ */ w(
|
|
4836
|
+
children: s.mode === "create" ? /* @__PURE__ */ w(jc, {
|
|
4824
4837
|
moduleName: s.module,
|
|
4825
4838
|
embedded: !0,
|
|
4826
4839
|
breadcrumbItems: [],
|
|
@@ -4829,7 +4842,7 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4829
4842
|
onSuccess: (e) => {
|
|
4830
4843
|
b(), ae(e), o?.("create", e);
|
|
4831
4844
|
}
|
|
4832
|
-
}) : /* @__PURE__ */ w(
|
|
4845
|
+
}) : /* @__PURE__ */ w(Mc, {
|
|
4833
4846
|
moduleName: s.module,
|
|
4834
4847
|
recordId: s.recordId,
|
|
4835
4848
|
embedded: !0,
|
|
@@ -4853,7 +4866,7 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4853
4866
|
width: "min(520px, 94vw)",
|
|
4854
4867
|
maskClosable: !1,
|
|
4855
4868
|
onCancel: () => d(null),
|
|
4856
|
-
footer: /* @__PURE__ */ w(
|
|
4869
|
+
footer: /* @__PURE__ */ w(fc, {
|
|
4857
4870
|
variant: "primary",
|
|
4858
4871
|
type: "primary",
|
|
4859
4872
|
onClick: () => d(null),
|
|
@@ -4892,8 +4905,8 @@ function Nc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4892
4905
|
}
|
|
4893
4906
|
//#endregion
|
|
4894
4907
|
//#region src/components/form/crossFieldRules.js
|
|
4895
|
-
var
|
|
4896
|
-
function
|
|
4908
|
+
var Lc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4909
|
+
function Rc(e, t, n) {
|
|
4897
4910
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4898
4911
|
if (typeof n == "function") {
|
|
4899
4912
|
let e = n(t);
|
|
@@ -4901,23 +4914,23 @@ function Fc(e, t, n) {
|
|
|
4901
4914
|
}
|
|
4902
4915
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4903
4916
|
}
|
|
4904
|
-
function
|
|
4917
|
+
function zc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4905
4918
|
let s = n.field ?? n.compareField ?? r;
|
|
4906
4919
|
return { validator: async (n, r) => {
|
|
4907
|
-
if (!s ||
|
|
4908
|
-
let c = i?.getFieldValue?.(
|
|
4909
|
-
if (
|
|
4920
|
+
if (!s || Lc(r)) return Promise.resolve();
|
|
4921
|
+
let c = i?.getFieldValue?.(Rc(a, s, o));
|
|
4922
|
+
if (Lc(c)) return Promise.resolve();
|
|
4910
4923
|
let l = Number(c), u = Number(r);
|
|
4911
4924
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4912
4925
|
} };
|
|
4913
4926
|
}
|
|
4914
|
-
function
|
|
4927
|
+
function Bc(e = {}, t, n) {
|
|
4915
4928
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4916
|
-
return r ?
|
|
4929
|
+
return r ? Rc(t, r, n) : null;
|
|
4917
4930
|
}
|
|
4918
4931
|
//#endregion
|
|
4919
4932
|
//#region src/components/form/maxCeiling.js
|
|
4920
|
-
function
|
|
4933
|
+
function Vc(e, t) {
|
|
4921
4934
|
let n = String(t).split(".").filter(Boolean);
|
|
4922
4935
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4923
4936
|
if (n.length > 1) {
|
|
@@ -4930,14 +4943,14 @@ function Rc(e, t) {
|
|
|
4930
4943
|
let r = [...e];
|
|
4931
4944
|
return r[r.length - 1] = n[0], r;
|
|
4932
4945
|
}
|
|
4933
|
-
function
|
|
4934
|
-
let r = e?.getFieldValue?.(
|
|
4946
|
+
function Hc(e, t, n) {
|
|
4947
|
+
let r = e?.getFieldValue?.(Vc(t, n));
|
|
4935
4948
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4936
4949
|
}
|
|
4937
|
-
function
|
|
4950
|
+
function Uc(e) {
|
|
4938
4951
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4939
4952
|
}
|
|
4940
|
-
function
|
|
4953
|
+
function Wc(e, t) {
|
|
4941
4954
|
for (let n of e ?? []) {
|
|
4942
4955
|
let e = t(n);
|
|
4943
4956
|
if (e == null || e === "") continue;
|
|
@@ -4949,14 +4962,14 @@ function Vc(e, t) {
|
|
|
4949
4962
|
}
|
|
4950
4963
|
return null;
|
|
4951
4964
|
}
|
|
4952
|
-
function
|
|
4965
|
+
function Gc({ input: e, compareFields: t, readValue: n }) {
|
|
4953
4966
|
let r = {
|
|
4954
4967
|
ok: !0,
|
|
4955
4968
|
field: null,
|
|
4956
4969
|
maximum: null
|
|
4957
4970
|
};
|
|
4958
4971
|
if (e == null || e === "") return r;
|
|
4959
|
-
let i =
|
|
4972
|
+
let i = Wc(t, n);
|
|
4960
4973
|
if (!i) return r;
|
|
4961
4974
|
let a = Number(e);
|
|
4962
4975
|
return Number.isFinite(a) ? {
|
|
@@ -4967,39 +4980,39 @@ function Hc({ input: e, compareFields: t, readValue: n }) {
|
|
|
4967
4980
|
}
|
|
4968
4981
|
//#endregion
|
|
4969
4982
|
//#region src/components/form/contextPrefill.js
|
|
4970
|
-
var
|
|
4971
|
-
function
|
|
4983
|
+
var Kc = { candidates: ["applicantId"] };
|
|
4984
|
+
function qc(e) {
|
|
4972
4985
|
let t = String(e ?? "").trim();
|
|
4973
4986
|
if (!t) return [];
|
|
4974
4987
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4975
4988
|
return [.../* @__PURE__ */ new Set([
|
|
4976
4989
|
`${n}Id`,
|
|
4977
4990
|
`${t}Id`,
|
|
4978
|
-
...
|
|
4991
|
+
...Kc[t] ?? []
|
|
4979
4992
|
])];
|
|
4980
4993
|
}
|
|
4981
|
-
function
|
|
4994
|
+
function Jc(e, t) {
|
|
4982
4995
|
if (!t) return "";
|
|
4983
4996
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4984
|
-
for (let r of
|
|
4997
|
+
for (let r of qc(e)) {
|
|
4985
4998
|
let e = String(n(t[r]) || "");
|
|
4986
4999
|
if (e) return e;
|
|
4987
5000
|
}
|
|
4988
5001
|
return "";
|
|
4989
5002
|
}
|
|
4990
|
-
function
|
|
5003
|
+
function Yc(e, t) {
|
|
4991
5004
|
let n = /* @__PURE__ */ new Set();
|
|
4992
5005
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4993
5006
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4994
5007
|
})), [...n];
|
|
4995
5008
|
}
|
|
4996
|
-
function
|
|
5009
|
+
function Xc(e) {
|
|
4997
5010
|
return e?.payloadMode === "skip";
|
|
4998
5011
|
}
|
|
4999
|
-
function
|
|
5012
|
+
function Zc(e) {
|
|
5000
5013
|
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 : [];
|
|
5001
5014
|
}
|
|
5002
|
-
function
|
|
5015
|
+
function Qc(e) {
|
|
5003
5016
|
let t = {};
|
|
5004
5017
|
return (e ?? []).forEach((e) => {
|
|
5005
5018
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -5007,7 +5020,7 @@ function Yc(e) {
|
|
|
5007
5020
|
});
|
|
5008
5021
|
}), t;
|
|
5009
5022
|
}
|
|
5010
|
-
function
|
|
5023
|
+
function $c(e, t) {
|
|
5011
5024
|
if (!e || !t) return;
|
|
5012
5025
|
let n = e;
|
|
5013
5026
|
for (let e of String(t).split(".")) {
|
|
@@ -5022,7 +5035,7 @@ function Xc(e, t) {
|
|
|
5022
5035
|
}
|
|
5023
5036
|
return n;
|
|
5024
5037
|
}
|
|
5025
|
-
function
|
|
5038
|
+
function el(e, t) {
|
|
5026
5039
|
if (!(!e || !t)) for (let n of [
|
|
5027
5040
|
t.prefillFrom,
|
|
5028
5041
|
t.field,
|
|
@@ -5030,13 +5043,13 @@ function Zc(e, t) {
|
|
|
5030
5043
|
]) {
|
|
5031
5044
|
if (!n) continue;
|
|
5032
5045
|
let t = e[n];
|
|
5033
|
-
if (t ??= U(e, n), t ??=
|
|
5046
|
+
if (t ??= U(e, n), t ??= $c(e, n), t != null) return t;
|
|
5034
5047
|
}
|
|
5035
5048
|
}
|
|
5036
5049
|
//#endregion
|
|
5037
5050
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
5038
|
-
function
|
|
5039
|
-
let a =
|
|
5051
|
+
function tl({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
5052
|
+
let a = Xi(t), o = S.useWatch(n, e);
|
|
5040
5053
|
if (!a) return null;
|
|
5041
5054
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
5042
5055
|
setTimeout(() => {
|
|
@@ -5047,7 +5060,7 @@ function Qc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5047
5060
|
e.setFieldValue(n, !1), c();
|
|
5048
5061
|
return;
|
|
5049
5062
|
}
|
|
5050
|
-
let i = await
|
|
5063
|
+
let i = await mo(ra(t));
|
|
5051
5064
|
e.setFieldValue(n, !!i), c();
|
|
5052
5065
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
5053
5066
|
return /* @__PURE__ */ w(ae, {
|
|
@@ -5066,52 +5079,52 @@ function Qc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
5066
5079
|
}
|
|
5067
5080
|
//#endregion
|
|
5068
5081
|
//#region src/components/form/prefillWhenRules.js
|
|
5069
|
-
var
|
|
5070
|
-
function
|
|
5082
|
+
var nl = (e) => String(e ?? "");
|
|
5083
|
+
function rl(e) {
|
|
5071
5084
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5072
5085
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5073
5086
|
let r = e?.field;
|
|
5074
5087
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
5075
5088
|
}), n;
|
|
5076
5089
|
}
|
|
5077
|
-
function
|
|
5078
|
-
return
|
|
5090
|
+
function il(e, t, n, r) {
|
|
5091
|
+
return rl(e).map((e) => ({
|
|
5079
5092
|
field: e,
|
|
5080
5093
|
path: n(t, e, r)
|
|
5081
5094
|
}));
|
|
5082
5095
|
}
|
|
5083
|
-
function
|
|
5084
|
-
return !e || !e.field ? !1 :
|
|
5096
|
+
function al(e, t = {}) {
|
|
5097
|
+
return !e || !e.field ? !1 : nl(t[e.field]) === nl(e.value);
|
|
5085
5098
|
}
|
|
5086
|
-
function
|
|
5087
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
5099
|
+
function ol({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
5100
|
+
let o = (Array.isArray(e) ? e : []).find((e) => al(e, t));
|
|
5088
5101
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
5089
5102
|
action: "set",
|
|
5090
5103
|
value: o.setValue
|
|
5091
|
-
} : i && r !== void 0 &&
|
|
5104
|
+
} : i && r !== void 0 && nl(n) === nl(r) ? { action: "clear" } : { action: "none" };
|
|
5092
5105
|
}
|
|
5093
5106
|
//#endregion
|
|
5094
5107
|
//#region src/components/form/computeFromRules.js
|
|
5095
|
-
var
|
|
5096
|
-
function
|
|
5097
|
-
return !!(e &&
|
|
5108
|
+
var sl = ["daysUntil"], cl = (e) => e == null || e === "", ll = (e) => String(e ?? "");
|
|
5109
|
+
function ul(e) {
|
|
5110
|
+
return !!(e && sl.includes(e.type) && e.field);
|
|
5098
5111
|
}
|
|
5099
|
-
function
|
|
5100
|
-
if (
|
|
5112
|
+
function dl(e) {
|
|
5113
|
+
if (cl(e)) return null;
|
|
5101
5114
|
let t = E.isDayjs(e) ? e : E(e?.$date ?? e);
|
|
5102
5115
|
return t.isValid() ? t.format("YYYY-MM-DD") : null;
|
|
5103
5116
|
}
|
|
5104
|
-
function
|
|
5105
|
-
let n =
|
|
5117
|
+
function fl(e, t) {
|
|
5118
|
+
let n = dl(e), r = dl(t ?? E());
|
|
5106
5119
|
if (!(!n || !r)) return Math.max(0, E(n).diff(E(r), "day"));
|
|
5107
5120
|
}
|
|
5108
|
-
function
|
|
5109
|
-
if (
|
|
5110
|
-
case "daysUntil": return
|
|
5121
|
+
function pl(e, t, n) {
|
|
5122
|
+
if (ul(e)) switch (e.type) {
|
|
5123
|
+
case "daysUntil": return fl(t, n);
|
|
5111
5124
|
default: return;
|
|
5112
5125
|
}
|
|
5113
5126
|
}
|
|
5114
|
-
function
|
|
5127
|
+
function ml(e, t, n, r) {
|
|
5115
5128
|
let i = Object.entries(e?.setFields || {}).filter(([e]) => !!e).map(([e, i]) => ({
|
|
5116
5129
|
field: e,
|
|
5117
5130
|
path: n(t, e, r),
|
|
@@ -5122,28 +5135,28 @@ function dl(e, t, n, r) {
|
|
|
5122
5135
|
setFields: i
|
|
5123
5136
|
};
|
|
5124
5137
|
}
|
|
5125
|
-
function
|
|
5126
|
-
if (!
|
|
5127
|
-
let o =
|
|
5138
|
+
function hl({ cfg: e, sourceValue: t, previousSource: n, current: r, lastApplied: i, today: a } = {}) {
|
|
5139
|
+
if (!ul(e) || cl(t) || dl(t) === dl(n)) return { action: "none" };
|
|
5140
|
+
let o = pl(e, t, a);
|
|
5128
5141
|
if (o === void 0) return { action: "none" };
|
|
5129
|
-
if (
|
|
5130
|
-
let e = i !== void 0 &&
|
|
5131
|
-
if (!
|
|
5142
|
+
if (cl(n)) {
|
|
5143
|
+
let e = i !== void 0 && ll(r) === ll(i);
|
|
5144
|
+
if (!cl(r) && !e) return { action: "none" };
|
|
5132
5145
|
}
|
|
5133
|
-
return
|
|
5146
|
+
return ll(r) === ll(o) ? { action: "none" } : {
|
|
5134
5147
|
action: "set",
|
|
5135
5148
|
value: o
|
|
5136
5149
|
};
|
|
5137
5150
|
}
|
|
5138
5151
|
//#endregion
|
|
5139
5152
|
//#region src/components/form/ComputeFromWatcher.jsx
|
|
5140
|
-
function
|
|
5153
|
+
function gl({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [] }) {
|
|
5141
5154
|
let a = S.useWatch(n, {
|
|
5142
5155
|
form: e,
|
|
5143
5156
|
preserve: !0
|
|
5144
5157
|
}), o = _(void 0), s = _(void 0), c = a?.format ? a.format("YYYY-MM-DD") : String(a ?? "");
|
|
5145
5158
|
return h(() => {
|
|
5146
|
-
let n =
|
|
5159
|
+
let n = hl({
|
|
5147
5160
|
cfg: t,
|
|
5148
5161
|
sourceValue: a,
|
|
5149
5162
|
previousSource: o.current,
|
|
@@ -5157,7 +5170,7 @@ function pl({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [
|
|
|
5157
5170
|
//#endregion
|
|
5158
5171
|
//#region src/components/form/optionConstraints.js
|
|
5159
5172
|
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
5160
|
-
function
|
|
5173
|
+
function _l(e) {
|
|
5161
5174
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
5162
5175
|
return t.forEach((e) => {
|
|
5163
5176
|
if (e != null && e !== "") {
|
|
@@ -5177,42 +5190,42 @@ function ml(e) {
|
|
|
5177
5190
|
}
|
|
5178
5191
|
}), n;
|
|
5179
5192
|
}
|
|
5180
|
-
function
|
|
5181
|
-
let n =
|
|
5193
|
+
function vl(e = [], t) {
|
|
5194
|
+
let n = _l(t);
|
|
5182
5195
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5183
5196
|
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(Q(e.value)) || r.has(Q(e.label)) : r.has(Q(e)));
|
|
5184
5197
|
return i.length > 0 ? i : e;
|
|
5185
5198
|
}
|
|
5186
|
-
function
|
|
5199
|
+
function yl(e) {
|
|
5187
5200
|
let t = [];
|
|
5188
5201
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
5189
5202
|
e != null && e !== "" && t.push(Q(e));
|
|
5190
5203
|
}), t;
|
|
5191
5204
|
}
|
|
5192
|
-
function
|
|
5205
|
+
function bl(e, t = {}) {
|
|
5193
5206
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5194
5207
|
return n.forEach((e) => {
|
|
5195
5208
|
if (!e || e.clearValue) return;
|
|
5196
|
-
let n =
|
|
5209
|
+
let n = yl(e);
|
|
5197
5210
|
if (!n.length) return;
|
|
5198
|
-
let a =
|
|
5211
|
+
let a = al(e, t) ? i : r;
|
|
5199
5212
|
n.forEach((e) => a.add(e));
|
|
5200
5213
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
5201
5214
|
}
|
|
5202
|
-
function
|
|
5203
|
-
let r =
|
|
5215
|
+
function xl(e = [], t, n) {
|
|
5216
|
+
let r = bl(t, n);
|
|
5204
5217
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5205
5218
|
let i = new Set(r);
|
|
5206
5219
|
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
5207
5220
|
}
|
|
5208
|
-
function
|
|
5221
|
+
function Sl(e, t = {}, n) {
|
|
5209
5222
|
let r = Array.isArray(e) ? e : [];
|
|
5210
5223
|
if (n == null || n === "") return [];
|
|
5211
5224
|
let i = Q(n), a = [], o = /* @__PURE__ */ new Set();
|
|
5212
5225
|
return r.forEach((e) => {
|
|
5213
5226
|
if (!e || e.clearValue) return;
|
|
5214
5227
|
let { setValue: n, setValueLabel: r } = e;
|
|
5215
|
-
n != null && n !== "" && r && Q(n) === i &&
|
|
5228
|
+
n != null && n !== "" && r && Q(n) === i && al(e, t) && (o.has(Q(n)) || (o.add(Q(n)), a.push({
|
|
5216
5229
|
value: n,
|
|
5217
5230
|
label: r
|
|
5218
5231
|
})));
|
|
@@ -5220,27 +5233,27 @@ function yl(e, t = {}, n) {
|
|
|
5220
5233
|
}
|
|
5221
5234
|
//#endregion
|
|
5222
5235
|
//#region src/components/form/optionMembership.js
|
|
5223
|
-
var
|
|
5236
|
+
var Cl = /* @__PURE__ */ new Set([
|
|
5224
5237
|
"select",
|
|
5225
5238
|
"radio",
|
|
5226
5239
|
"checkbox"
|
|
5227
|
-
]),
|
|
5228
|
-
function
|
|
5240
|
+
]), wl = 3e5, Tl = 1e4, El = (e) => e === !1 || e === 0 || e === "0" || e === "false", Dl = (e) => e === !0 || e === 1 || e === "1" || e === "true", Ol = (e) => e == null || e === "";
|
|
5241
|
+
function kl(e) {
|
|
5229
5242
|
let t = e?.options ?? e?.values;
|
|
5230
5243
|
return Array.isArray(t) ? t : [];
|
|
5231
5244
|
}
|
|
5232
|
-
function
|
|
5245
|
+
function Al(e) {
|
|
5233
5246
|
return String(e?.dataSource ?? "").trim().toLowerCase();
|
|
5234
5247
|
}
|
|
5235
|
-
function
|
|
5236
|
-
if (!e || !
|
|
5237
|
-
let t =
|
|
5238
|
-
return t === "master" ? !0 : t === "" || t === "static" ?
|
|
5248
|
+
function jl(e) {
|
|
5249
|
+
if (!e || !Cl.has(e.type) || El(e.enforceOptions) || Dl(e.allowCustomValues) || e.mode === "tags") return !1;
|
|
5250
|
+
let t = Al(e);
|
|
5251
|
+
return t === "master" ? !0 : t === "" || t === "static" ? kl(e).length > 0 : !1;
|
|
5239
5252
|
}
|
|
5240
|
-
function
|
|
5241
|
-
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.id ?? e.label : e).filter((e) => !
|
|
5253
|
+
function Ml(e) {
|
|
5254
|
+
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.id ?? e.label : e).filter((e) => !Ol(e) && typeof e != "object" && typeof e != "boolean");
|
|
5242
5255
|
}
|
|
5243
|
-
function
|
|
5256
|
+
function Nl(e) {
|
|
5244
5257
|
return e == null ? null : typeof e == "object" ? {
|
|
5245
5258
|
label: e.label ?? e.name ?? e.value,
|
|
5246
5259
|
value: e.value ?? e.id ?? e.name ?? e.label
|
|
@@ -5249,8 +5262,8 @@ function Al(e) {
|
|
|
5249
5262
|
value: e
|
|
5250
5263
|
};
|
|
5251
5264
|
}
|
|
5252
|
-
var
|
|
5253
|
-
function
|
|
5265
|
+
var Pl = /* @__PURE__ */ new Map();
|
|
5266
|
+
function Fl(e, t) {
|
|
5254
5267
|
return [
|
|
5255
5268
|
t,
|
|
5256
5269
|
e.field,
|
|
@@ -5258,50 +5271,50 @@ function Ml(e, t) {
|
|
|
5258
5271
|
e.groupName
|
|
5259
5272
|
].map((e) => e ?? "").join("|");
|
|
5260
5273
|
}
|
|
5261
|
-
async function
|
|
5262
|
-
let n =
|
|
5263
|
-
if (r && Date.now() - r.at <
|
|
5264
|
-
let i = Promise.resolve(ei(t, e.field, "",
|
|
5274
|
+
async function Il(e, t) {
|
|
5275
|
+
let n = Fl(e, t), r = Pl.get(n);
|
|
5276
|
+
if (r && Date.now() - r.at < wl) return r.promise;
|
|
5277
|
+
let i = Promise.resolve(ei(t, e.field, "", Tl, 0, {
|
|
5265
5278
|
dataSource: "master",
|
|
5266
5279
|
masterName: e.masterName,
|
|
5267
5280
|
groupName: e.groupName
|
|
5268
5281
|
})).then((e) => {
|
|
5269
5282
|
let t = Array.isArray(e) ? e : e?.data ?? [];
|
|
5270
|
-
return (Array.isArray(t) ? t : []).map(
|
|
5283
|
+
return (Array.isArray(t) ? t : []).map(Nl).filter(Boolean);
|
|
5271
5284
|
});
|
|
5272
|
-
return
|
|
5285
|
+
return Pl.set(n, {
|
|
5273
5286
|
at: Date.now(),
|
|
5274
5287
|
promise: i
|
|
5275
|
-
}), i.catch(() =>
|
|
5288
|
+
}), i.catch(() => Pl.delete(n)), i;
|
|
5276
5289
|
}
|
|
5277
|
-
async function
|
|
5278
|
-
return
|
|
5290
|
+
async function Ll(e, { moduleName: t } = {}) {
|
|
5291
|
+
return Al(e) === "master" ? Il(e, t) : kl(e).map(Nl).filter(Boolean);
|
|
5279
5292
|
}
|
|
5280
|
-
function
|
|
5293
|
+
function Rl(e) {
|
|
5281
5294
|
let t = /* @__PURE__ */ new Map();
|
|
5282
5295
|
return e.forEach((e) => {
|
|
5283
5296
|
[[e.label, e.label], [e.value, e.value]].forEach(([e, n]) => {
|
|
5284
|
-
let r =
|
|
5297
|
+
let r = ia(e);
|
|
5285
5298
|
r && !t.has(r) && t.set(r, n);
|
|
5286
5299
|
});
|
|
5287
5300
|
}), t;
|
|
5288
5301
|
}
|
|
5289
|
-
async function
|
|
5290
|
-
let i =
|
|
5302
|
+
async function zl(e, t, { moduleName: n, constraintValue: r } = {}) {
|
|
5303
|
+
let i = Ml(t);
|
|
5291
5304
|
if (!i.length) return {
|
|
5292
5305
|
offList: [],
|
|
5293
5306
|
snaps: /* @__PURE__ */ new Map(),
|
|
5294
5307
|
options: []
|
|
5295
5308
|
};
|
|
5296
|
-
let a = await
|
|
5297
|
-
e.optionsFromField && (a =
|
|
5298
|
-
let o =
|
|
5309
|
+
let a = await Ll(e, { moduleName: n });
|
|
5310
|
+
e.optionsFromField && (a = vl(a, r));
|
|
5311
|
+
let o = Al(e) === "master", s = o ? Rl(a) : aa({
|
|
5299
5312
|
options: a,
|
|
5300
5313
|
optionAliases: e.optionAliases
|
|
5301
5314
|
}), c = new Set(a.flatMap((e) => o ? [String(e.value), String(e.label)] : [String(e.value)])), l = [], u = /* @__PURE__ */ new Map();
|
|
5302
5315
|
return i.forEach((e) => {
|
|
5303
5316
|
if (c.has(String(e))) return;
|
|
5304
|
-
let t = s.get(
|
|
5317
|
+
let t = s.get(ia(e));
|
|
5305
5318
|
t === void 0 ? l.push(String(e)) : u.set(e, t);
|
|
5306
5319
|
}), {
|
|
5307
5320
|
offList: l,
|
|
@@ -5309,32 +5322,32 @@ async function Il(e, t, { moduleName: n, constraintValue: r } = {}) {
|
|
|
5309
5322
|
options: a
|
|
5310
5323
|
};
|
|
5311
5324
|
}
|
|
5312
|
-
function
|
|
5325
|
+
function Bl(e, t) {
|
|
5313
5326
|
let n = e.label || e.field || "this field";
|
|
5314
5327
|
if (e.optionsMismatchMessage) return e.optionsMismatchMessage;
|
|
5315
5328
|
let r = t.map((e) => `"${e}"`).join(", ");
|
|
5316
5329
|
return t.length === 1 ? `${r} is not in the ${n} list. Please choose an option from the dropdown.` : `${r} are not in the ${n} list. Please choose options from the dropdown.`;
|
|
5317
5330
|
}
|
|
5318
|
-
function
|
|
5331
|
+
function Vl(e = [], t = []) {
|
|
5319
5332
|
let n = t[0];
|
|
5320
5333
|
return e.find((e) => e?.name === n || e?.payloadKey === n) ?? e.find((e) => (e?.fields ?? []).some((e) => e?.field === n));
|
|
5321
5334
|
}
|
|
5322
|
-
var
|
|
5323
|
-
function
|
|
5324
|
-
let t =
|
|
5335
|
+
var Hl = /* @__PURE__ */ new WeakMap();
|
|
5336
|
+
function Ul(e) {
|
|
5337
|
+
let t = Hl.get(e);
|
|
5325
5338
|
return t || (t = {
|
|
5326
5339
|
entries: /* @__PURE__ */ new Map(),
|
|
5327
5340
|
listeners: /* @__PURE__ */ new Set(),
|
|
5328
5341
|
snapshot: []
|
|
5329
|
-
},
|
|
5342
|
+
}, Hl.set(e, t)), t;
|
|
5330
5343
|
}
|
|
5331
|
-
var
|
|
5332
|
-
function
|
|
5344
|
+
var Wl = (e) => JSON.stringify(Array.isArray(e) ? e : [e]);
|
|
5345
|
+
function Gl(e) {
|
|
5333
5346
|
e.snapshot = [...e.entries.values()], e.listeners.forEach((e) => e());
|
|
5334
5347
|
}
|
|
5335
|
-
function
|
|
5348
|
+
function Kl(e, t, n) {
|
|
5336
5349
|
if (!e) return;
|
|
5337
|
-
let r =
|
|
5350
|
+
let r = Ul(e), i = Wl(t);
|
|
5338
5351
|
if (n) {
|
|
5339
5352
|
let e = r.entries.get(i);
|
|
5340
5353
|
if (e && e.message === n.message) return;
|
|
@@ -5344,19 +5357,19 @@ function Ul(e, t, n) {
|
|
|
5344
5357
|
});
|
|
5345
5358
|
} else if (r.entries.has(i)) r.entries.delete(i);
|
|
5346
5359
|
else return;
|
|
5347
|
-
|
|
5360
|
+
Gl(r);
|
|
5348
5361
|
}
|
|
5349
|
-
function
|
|
5350
|
-
return e ?
|
|
5362
|
+
function ql(e) {
|
|
5363
|
+
return e ? Ul(e).snapshot : [];
|
|
5351
5364
|
}
|
|
5352
|
-
function
|
|
5365
|
+
function Jl(e) {
|
|
5353
5366
|
return y((t) => {
|
|
5354
5367
|
if (!e) return () => {};
|
|
5355
|
-
let n =
|
|
5368
|
+
let n = Ul(e);
|
|
5356
5369
|
return n.listeners.add(t), () => n.listeners.delete(t);
|
|
5357
|
-
}, () =>
|
|
5370
|
+
}, () => ql(e), () => ql(e));
|
|
5358
5371
|
}
|
|
5359
|
-
function
|
|
5372
|
+
function Yl(e, t, n) {
|
|
5360
5373
|
if (!n) return;
|
|
5361
5374
|
let r = String(n).split(".").map((e) => e.trim()).filter(Boolean);
|
|
5362
5375
|
if (Array.isArray(t) && t.length >= 3 && typeof t[1] == "number") {
|
|
@@ -5365,32 +5378,32 @@ function Kl(e, t, n) {
|
|
|
5365
5378
|
t[1],
|
|
5366
5379
|
...r
|
|
5367
5380
|
]);
|
|
5368
|
-
if (!
|
|
5381
|
+
if (!Ol(n)) return n;
|
|
5369
5382
|
}
|
|
5370
5383
|
return e.getFieldValue(r);
|
|
5371
5384
|
}
|
|
5372
|
-
function
|
|
5385
|
+
function Xl({ field: e, form: t, name: n, moduleName: r }) {
|
|
5373
5386
|
return { validator: async (i, a) => {
|
|
5374
|
-
if (!
|
|
5375
|
-
|
|
5387
|
+
if (!Ml(a).length) {
|
|
5388
|
+
Kl(t, n, null);
|
|
5376
5389
|
return;
|
|
5377
5390
|
}
|
|
5378
5391
|
let o;
|
|
5379
5392
|
try {
|
|
5380
|
-
o = await
|
|
5393
|
+
o = await zl(e, a, {
|
|
5381
5394
|
moduleName: r,
|
|
5382
|
-
constraintValue:
|
|
5395
|
+
constraintValue: Yl(t, n, e.optionsFromField)
|
|
5383
5396
|
});
|
|
5384
5397
|
} catch (r) {
|
|
5385
|
-
console.warn(`[optionMembership] could not load options for "${e.field}"`, r),
|
|
5398
|
+
console.warn(`[optionMembership] could not load options for "${e.field}"`, r), Kl(t, n, null);
|
|
5386
5399
|
return;
|
|
5387
5400
|
}
|
|
5388
5401
|
if (!o.offList.length) {
|
|
5389
|
-
|
|
5402
|
+
Kl(t, n, null);
|
|
5390
5403
|
return;
|
|
5391
5404
|
}
|
|
5392
|
-
let s =
|
|
5393
|
-
throw
|
|
5405
|
+
let s = Bl(e, o.offList);
|
|
5406
|
+
throw Kl(t, n, {
|
|
5394
5407
|
field: e.field,
|
|
5395
5408
|
label: e.label || e.field,
|
|
5396
5409
|
values: o.offList,
|
|
@@ -5398,7 +5411,7 @@ function ql({ field: e, form: t, name: n, moduleName: r }) {
|
|
|
5398
5411
|
}), Error(s);
|
|
5399
5412
|
} };
|
|
5400
5413
|
}
|
|
5401
|
-
function
|
|
5414
|
+
function Zl(e, t, { labeled: n = !1, options: r = [] } = {}) {
|
|
5402
5415
|
if (!t?.size) return;
|
|
5403
5416
|
let i = (e) => r.find((t) => String(t.value) === String(e)) ?? r.find((t) => String(t.label) === String(e)), a = (e) => {
|
|
5404
5417
|
let r = e && typeof e == "object" ? e.value : e;
|
|
@@ -5413,18 +5426,18 @@ function Jl(e, t, { labeled: n = !1, options: r = [] } = {}) {
|
|
|
5413
5426
|
};
|
|
5414
5427
|
return Array.isArray(e) ? e.map(a) : a(e);
|
|
5415
5428
|
}
|
|
5416
|
-
function
|
|
5417
|
-
let s = !!(o && t && n !== void 0 &&
|
|
5429
|
+
function Ql({ field: e, form: t, name: n, moduleName: r, value: i, constraintValue: a, enabled: o = !0 }) {
|
|
5430
|
+
let s = !!(o && t && n !== void 0 && jl(e)), c = s ? JSON.stringify(Ml(i)) : "[]", l = s && e.optionsFromField ? JSON.stringify(a ?? null) : "", u = Wl(n);
|
|
5418
5431
|
h(() => {
|
|
5419
5432
|
if (!s || c === "[]") return;
|
|
5420
5433
|
let i = !1;
|
|
5421
|
-
return
|
|
5434
|
+
return zl(e, t.getFieldValue(n), {
|
|
5422
5435
|
moduleName: r,
|
|
5423
5436
|
constraintValue: a
|
|
5424
5437
|
}).then(({ offList: r, snaps: a, options: o }) => {
|
|
5425
5438
|
if (i) return;
|
|
5426
|
-
let s =
|
|
5427
|
-
labeled:
|
|
5439
|
+
let s = Zl(t.getFieldValue(n), a, {
|
|
5440
|
+
labeled: Ba(e),
|
|
5428
5441
|
options: o
|
|
5429
5442
|
});
|
|
5430
5443
|
s !== void 0 && t.setFieldValue(n, s), (r.length || s !== void 0 || t.getFieldError(n).length) && t.validateFields([n]).catch(() => {});
|
|
@@ -5439,7 +5452,7 @@ function Yl({ field: e, form: t, name: n, moduleName: r, value: i, constraintVal
|
|
|
5439
5452
|
r,
|
|
5440
5453
|
t
|
|
5441
5454
|
]), h(() => {
|
|
5442
|
-
if (s) return () =>
|
|
5455
|
+
if (s) return () => Kl(t, n, null);
|
|
5443
5456
|
}, [
|
|
5444
5457
|
s,
|
|
5445
5458
|
u,
|
|
@@ -5448,12 +5461,12 @@ function Yl({ field: e, form: t, name: n, moduleName: r, value: i, constraintVal
|
|
|
5448
5461
|
}
|
|
5449
5462
|
//#endregion
|
|
5450
5463
|
//#region src/components/form/OptionMismatchBanner.jsx
|
|
5451
|
-
function
|
|
5452
|
-
let n =
|
|
5464
|
+
function $l(e, t) {
|
|
5465
|
+
let n = Vl(e, t), r = n?.label || n?.name, i = t.length >= 3 && typeof t[1] == "number";
|
|
5453
5466
|
return r ? i ? `${r} #${t[1] + 1}` : r : "";
|
|
5454
5467
|
}
|
|
5455
|
-
function
|
|
5456
|
-
let r =
|
|
5468
|
+
function eu({ form: e, groups: t, onJump: n }) {
|
|
5469
|
+
let r = Jl(e);
|
|
5457
5470
|
if (!r.length) return null;
|
|
5458
5471
|
let i = r.length;
|
|
5459
5472
|
return /* @__PURE__ */ w(b, {
|
|
@@ -5471,7 +5484,7 @@ function Zl({ form: e, groups: t, onJump: n }) {
|
|
|
5471
5484
|
paddingInlineStart: 18
|
|
5472
5485
|
},
|
|
5473
5486
|
children: r.map((e) => {
|
|
5474
|
-
let r =
|
|
5487
|
+
let r = $l(t, e.path);
|
|
5475
5488
|
return /* @__PURE__ */ T("li", { children: [
|
|
5476
5489
|
/* @__PURE__ */ T(oe.Link, {
|
|
5477
5490
|
onClick: () => n?.(e.path),
|
|
@@ -5486,8 +5499,8 @@ function Zl({ form: e, groups: t, onJump: n }) {
|
|
|
5486
5499
|
}
|
|
5487
5500
|
//#endregion
|
|
5488
5501
|
//#region src/components/form/optionRowFilters.js
|
|
5489
|
-
var
|
|
5490
|
-
function
|
|
5502
|
+
var tu = 64;
|
|
5503
|
+
function nu(e) {
|
|
5491
5504
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5492
5505
|
try {
|
|
5493
5506
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5495,34 +5508,34 @@ function $l(e) {
|
|
|
5495
5508
|
return "";
|
|
5496
5509
|
}
|
|
5497
5510
|
}
|
|
5498
|
-
var
|
|
5499
|
-
function
|
|
5511
|
+
var ru = (e) => String(e ?? "").trim().toLowerCase(), iu = (e) => e != null && String(e).trim() !== "";
|
|
5512
|
+
function au(e) {
|
|
5500
5513
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5501
|
-
return new Set(t.map(
|
|
5514
|
+
return new Set(t.map(ru).filter((e) => e !== ""));
|
|
5502
5515
|
}
|
|
5503
|
-
function
|
|
5504
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5516
|
+
function ou(e, t) {
|
|
5517
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => iu(e?.extraData?.[t]));
|
|
5505
5518
|
}
|
|
5506
|
-
function
|
|
5519
|
+
function su(e, t, n) {
|
|
5507
5520
|
let r = e?.extraData?.[t];
|
|
5508
|
-
if (!
|
|
5509
|
-
let i =
|
|
5510
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5521
|
+
if (!iu(n)) return r === !0;
|
|
5522
|
+
let i = au(n);
|
|
5523
|
+
return i.size === 0 ? r === !0 : i.has(ru(r));
|
|
5511
5524
|
}
|
|
5512
|
-
function
|
|
5525
|
+
function cu(e, t) {
|
|
5513
5526
|
let n = /* @__PURE__ */ new Map();
|
|
5514
5527
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5515
|
-
let r =
|
|
5516
|
-
r && n.set(r,
|
|
5528
|
+
let r = ru(e?.value);
|
|
5529
|
+
r && n.set(r, ru(e?.extraData?.[t]));
|
|
5517
5530
|
}), n;
|
|
5518
5531
|
}
|
|
5519
|
-
function
|
|
5520
|
-
let r =
|
|
5532
|
+
function lu(e, t, n) {
|
|
5533
|
+
let r = ru(n);
|
|
5521
5534
|
if (!r) return !1;
|
|
5522
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5535
|
+
let i = /* @__PURE__ */ new Set(), a = ru(e);
|
|
5523
5536
|
if (!a) return !1;
|
|
5524
5537
|
i.add(a);
|
|
5525
|
-
for (let e = 0; e <
|
|
5538
|
+
for (let e = 0; e < tu; e += 1) {
|
|
5526
5539
|
let e = t.get(a);
|
|
5527
5540
|
if (!e) return !1;
|
|
5528
5541
|
if (e === r) return !0;
|
|
@@ -5531,74 +5544,74 @@ function ou(e, t, n) {
|
|
|
5531
5544
|
}
|
|
5532
5545
|
return !1;
|
|
5533
5546
|
}
|
|
5534
|
-
function
|
|
5547
|
+
function uu(e = {}) {
|
|
5535
5548
|
let t = [], n = (e) => {
|
|
5536
5549
|
let n = String(e ?? "").trim();
|
|
5537
5550
|
n && !t.includes(n) && t.push(n);
|
|
5538
5551
|
};
|
|
5539
5552
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5540
5553
|
}
|
|
5541
|
-
function
|
|
5554
|
+
function du(e, t = {}, n = {}) {
|
|
5542
5555
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5543
5556
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5544
5557
|
typeof console < "u" && console.warn(e);
|
|
5545
5558
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5546
|
-
s && (
|
|
5559
|
+
s && (ou(o, s) ? o = o.filter((e) => su(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".`));
|
|
5547
5560
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5548
5561
|
if (c) {
|
|
5549
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5562
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = nu(n);
|
|
5550
5563
|
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.`);
|
|
5551
|
-
else if (!
|
|
5564
|
+
else if (!ou(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".`);
|
|
5552
5565
|
else {
|
|
5553
|
-
let t =
|
|
5554
|
-
o = o.filter((e) =>
|
|
5566
|
+
let t = cu(e, c);
|
|
5567
|
+
o = o.filter((e) => lu(e?.value, t, s));
|
|
5555
5568
|
}
|
|
5556
5569
|
}
|
|
5557
5570
|
return o;
|
|
5558
5571
|
}
|
|
5559
5572
|
//#endregion
|
|
5560
5573
|
//#region src/components/form/fieldTooltip.js
|
|
5561
|
-
var
|
|
5562
|
-
function
|
|
5563
|
-
return
|
|
5574
|
+
var fu = (e) => e == null || String(e).trim() === "", pu = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5575
|
+
function mu(e) {
|
|
5576
|
+
return fu(e?.tooltip) ? pu(e?.infoEnabled) && !fu(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5564
5577
|
}
|
|
5565
5578
|
//#endregion
|
|
5566
5579
|
//#region src/components/form/autofillValue.js
|
|
5567
|
-
var
|
|
5568
|
-
function
|
|
5580
|
+
var hu = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5581
|
+
function gu(e, t = {}, n = () => void 0) {
|
|
5569
5582
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5570
|
-
return
|
|
5583
|
+
return hu(i) && a != null && a !== "" ? a : i;
|
|
5571
5584
|
}
|
|
5572
5585
|
//#endregion
|
|
5573
5586
|
//#region src/components/form/dependentLookupReset.js
|
|
5574
|
-
var
|
|
5575
|
-
function
|
|
5576
|
-
return !(!r || e ===
|
|
5587
|
+
var _u = Symbol("parentFilterUnseen"), vu = (e) => e == null || e === "", yu = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5588
|
+
function bu({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5589
|
+
return !(!r || e === _u || yu(e, t) || vu(e) || vu(n));
|
|
5577
5590
|
}
|
|
5578
5591
|
//#endregion
|
|
5579
5592
|
//#region src/utils/roleAllowsAction.js
|
|
5580
|
-
function
|
|
5581
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5593
|
+
function xu(e) {
|
|
5594
|
+
return e == null ? !0 : typeof e == "object" ? xu(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5582
5595
|
}
|
|
5583
|
-
function
|
|
5596
|
+
function Su(e, t) {
|
|
5584
5597
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5585
5598
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5586
5599
|
let e = String(t).trim().toLowerCase();
|
|
5587
5600
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5588
5601
|
}
|
|
5589
5602
|
}
|
|
5590
|
-
function
|
|
5603
|
+
function Cu(e, t) {
|
|
5591
5604
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5592
5605
|
let n = `${t}Access`;
|
|
5593
5606
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5594
5607
|
}
|
|
5595
|
-
function
|
|
5608
|
+
function wu(e, t) {
|
|
5596
5609
|
if (!e) return !0;
|
|
5597
5610
|
try {
|
|
5598
5611
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5599
5612
|
for (let e of o) {
|
|
5600
|
-
let t =
|
|
5601
|
-
if (t) return
|
|
5613
|
+
let t = Su(n, e);
|
|
5614
|
+
if (t) return xu(Cu(t, a));
|
|
5602
5615
|
}
|
|
5603
5616
|
return !0;
|
|
5604
5617
|
} catch {
|
|
@@ -5607,10 +5620,10 @@ function xu(e, t) {
|
|
|
5607
5620
|
}
|
|
5608
5621
|
//#endregion
|
|
5609
5622
|
//#region src/utils/afterSubmitNav.js
|
|
5610
|
-
function
|
|
5623
|
+
function Tu(e) {
|
|
5611
5624
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5612
5625
|
}
|
|
5613
|
-
function
|
|
5626
|
+
function Eu(e, t, n) {
|
|
5614
5627
|
let r = String(e ?? "").trim();
|
|
5615
5628
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5616
5629
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5619,50 +5632,50 @@ function Cu(e, t, n) {
|
|
|
5619
5632
|
}
|
|
5620
5633
|
//#endregion
|
|
5621
5634
|
//#region src/utils/backNav.js
|
|
5622
|
-
function
|
|
5635
|
+
function Du(e = typeof window < "u" ? window : void 0) {
|
|
5623
5636
|
let t = e?.history?.state?.idx;
|
|
5624
5637
|
return typeof t == "number" && t > 0;
|
|
5625
5638
|
}
|
|
5626
|
-
function
|
|
5627
|
-
return t && e ? { path: e } :
|
|
5639
|
+
function Ou({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5640
|
+
return t && e ? { path: e } : Du(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5628
5641
|
}
|
|
5629
|
-
function
|
|
5630
|
-
let n =
|
|
5642
|
+
function ku(e, t = {}) {
|
|
5643
|
+
let n = Ou(t);
|
|
5631
5644
|
return n.back ? e(-1) : e(n.path), n;
|
|
5632
5645
|
}
|
|
5633
5646
|
//#endregion
|
|
5634
5647
|
//#region src/components/form/educationRules.js
|
|
5635
|
-
var
|
|
5636
|
-
function
|
|
5648
|
+
var Au = (e) => e == null ? "" : String(e).trim();
|
|
5649
|
+
function ju(e, t) {
|
|
5637
5650
|
let n = e?.regionRules;
|
|
5638
5651
|
if (!n || typeof n != "object") return e ?? {};
|
|
5639
|
-
let r =
|
|
5652
|
+
let r = Au(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5640
5653
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5641
5654
|
...e,
|
|
5642
5655
|
...i
|
|
5643
5656
|
};
|
|
5644
5657
|
}
|
|
5645
|
-
function
|
|
5658
|
+
function Mu(e) {
|
|
5646
5659
|
return e?.allowInProgress !== !1;
|
|
5647
5660
|
}
|
|
5648
|
-
function
|
|
5649
|
-
return
|
|
5661
|
+
function Nu(e) {
|
|
5662
|
+
return Mu(e) ? "" : Iu(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.";
|
|
5650
5663
|
}
|
|
5651
|
-
function
|
|
5652
|
-
return
|
|
5664
|
+
function Pu(e) {
|
|
5665
|
+
return Mu(e) ? "allow" : Au(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5653
5666
|
}
|
|
5654
|
-
function
|
|
5655
|
-
return
|
|
5667
|
+
function Fu(e) {
|
|
5668
|
+
return Pu(e) === "block";
|
|
5656
5669
|
}
|
|
5657
|
-
function
|
|
5658
|
-
return
|
|
5670
|
+
function Iu(e) {
|
|
5671
|
+
return Pu(e) === "warn";
|
|
5659
5672
|
}
|
|
5660
|
-
function
|
|
5661
|
-
if (!
|
|
5662
|
-
let t =
|
|
5673
|
+
function Lu(e) {
|
|
5674
|
+
if (!Fu(e)) return null;
|
|
5675
|
+
let t = Nu(e);
|
|
5663
5676
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5664
5677
|
}
|
|
5665
|
-
function
|
|
5678
|
+
function Ru(e, t = {}) {
|
|
5666
5679
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5667
5680
|
for (let t of [n, r]) {
|
|
5668
5681
|
let n = e?.[t];
|
|
@@ -5672,50 +5685,50 @@ function Fu(e, t = {}) {
|
|
|
5672
5685
|
}
|
|
5673
5686
|
return null;
|
|
5674
5687
|
}
|
|
5675
|
-
function
|
|
5688
|
+
function zu(e, t = {}) {
|
|
5676
5689
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5677
5690
|
return !!e?.[n];
|
|
5678
5691
|
}
|
|
5679
|
-
function
|
|
5692
|
+
function Bu(e = [], t = {}) {
|
|
5680
5693
|
let n = (t.direction ?? "desc") === "desc";
|
|
5681
5694
|
return e.map((e, n) => ({
|
|
5682
5695
|
index: n,
|
|
5683
|
-
key:
|
|
5684
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5696
|
+
key: Ru(e, t),
|
|
5697
|
+
ongoing: t.inProgressFirst !== !1 && zu(e, t)
|
|
5685
5698
|
})).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);
|
|
5686
5699
|
}
|
|
5687
|
-
function
|
|
5700
|
+
function Vu(e, t, n = {}) {
|
|
5688
5701
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5689
|
-
let r =
|
|
5702
|
+
let r = Bu(e, n).indexOf(t);
|
|
5690
5703
|
return r === -1 || r === t ? null : {
|
|
5691
5704
|
from: t,
|
|
5692
5705
|
to: r,
|
|
5693
|
-
reason:
|
|
5706
|
+
reason: zu(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5694
5707
|
};
|
|
5695
5708
|
}
|
|
5696
|
-
var
|
|
5709
|
+
var Hu = Object.freeze({
|
|
5697
5710
|
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.",
|
|
5698
5711
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5699
5712
|
ok: "Yes, move it up",
|
|
5700
5713
|
keep: "No, leave it here"
|
|
5701
5714
|
});
|
|
5702
|
-
function
|
|
5715
|
+
function Uu(e, t = {}) {
|
|
5703
5716
|
let n = {
|
|
5704
|
-
...
|
|
5717
|
+
...Hu,
|
|
5705
5718
|
...t.messages ?? {}
|
|
5706
5719
|
};
|
|
5707
5720
|
return n[e] ?? n.outOfOrder;
|
|
5708
5721
|
}
|
|
5709
|
-
function
|
|
5710
|
-
let n = t.levelField ?? "qualification", r =
|
|
5722
|
+
function Wu(e, t = {}) {
|
|
5723
|
+
let n = t.levelField ?? "qualification", r = Au(e?.[n]);
|
|
5711
5724
|
if (!r) return null;
|
|
5712
5725
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5713
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5726
|
+
return Number.isFinite(Number(a)) ? Number(a) : Gu(r, t);
|
|
5714
5727
|
}
|
|
5715
|
-
function
|
|
5728
|
+
function Gu(e, t) {
|
|
5716
5729
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5717
5730
|
for (let e of n) {
|
|
5718
|
-
let t =
|
|
5731
|
+
let t = Au(e?.match);
|
|
5719
5732
|
if (!t) continue;
|
|
5720
5733
|
let n;
|
|
5721
5734
|
try {
|
|
@@ -5727,14 +5740,14 @@ function Hu(e, t) {
|
|
|
5727
5740
|
}
|
|
5728
5741
|
return null;
|
|
5729
5742
|
}
|
|
5730
|
-
function
|
|
5731
|
-
return
|
|
5743
|
+
function Ku(e, t = {}) {
|
|
5744
|
+
return Au((t?.levelLabels ?? {})[e]) || Au(e);
|
|
5732
5745
|
}
|
|
5733
|
-
function
|
|
5746
|
+
function qu(e = [], t = {}) {
|
|
5734
5747
|
if (!t || t.requireBelow === !1) return [];
|
|
5735
5748
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5736
5749
|
if (!r.length) return [];
|
|
5737
|
-
let i = e.map((e) =>
|
|
5750
|
+
let i = e.map((e) => Wu(e, t)).filter((e) => e !== null);
|
|
5738
5751
|
if (!i.length) return [];
|
|
5739
5752
|
let a = Math.max(...i), o = [];
|
|
5740
5753
|
return r.forEach((e) => {
|
|
@@ -5742,43 +5755,43 @@ function Wu(e = [], t = {}) {
|
|
|
5742
5755
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5743
5756
|
}), o;
|
|
5744
5757
|
}
|
|
5745
|
-
function
|
|
5746
|
-
let n =
|
|
5758
|
+
function Ju(e, t = {}) {
|
|
5759
|
+
let n = qu(e, t);
|
|
5747
5760
|
if (!n.length) return "";
|
|
5748
|
-
let r = n.map((e) =>
|
|
5761
|
+
let r = n.map((e) => Ku(e, t)).join(", ");
|
|
5749
5762
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5750
5763
|
}
|
|
5751
|
-
async function
|
|
5764
|
+
async function Yu({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5752
5765
|
let a = e?.orderBy;
|
|
5753
5766
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5754
|
-
let o =
|
|
5767
|
+
let o = Vu(t, n, a);
|
|
5755
5768
|
if (!o) return !1;
|
|
5756
5769
|
let s = {
|
|
5757
|
-
...
|
|
5770
|
+
...Hu,
|
|
5758
5771
|
...a.messages ?? {}
|
|
5759
5772
|
};
|
|
5760
5773
|
return await i({
|
|
5761
5774
|
reason: o.reason,
|
|
5762
5775
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5763
|
-
body:
|
|
5776
|
+
body: Uu(o.reason, a),
|
|
5764
5777
|
okText: s.ok,
|
|
5765
5778
|
cancelText: s.keep,
|
|
5766
5779
|
from: o.from,
|
|
5767
5780
|
to: o.to
|
|
5768
5781
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5769
5782
|
}
|
|
5770
|
-
function
|
|
5771
|
-
let n =
|
|
5783
|
+
function Xu(e, t) {
|
|
5784
|
+
let n = ju(e, t), r = n?.orderBy?.inProgressField;
|
|
5772
5785
|
return r ? {
|
|
5773
5786
|
name: n.name,
|
|
5774
5787
|
label: n.label ?? n.name,
|
|
5775
5788
|
rowsKey: n.payloadKey || n.name,
|
|
5776
5789
|
inProgressField: r,
|
|
5777
|
-
severity:
|
|
5778
|
-
message:
|
|
5790
|
+
severity: Pu(n),
|
|
5791
|
+
message: Nu(n)
|
|
5779
5792
|
} : null;
|
|
5780
5793
|
}
|
|
5781
|
-
function
|
|
5794
|
+
function Zu(e = [], t, n) {
|
|
5782
5795
|
if (!n) return {
|
|
5783
5796
|
severity: "allow",
|
|
5784
5797
|
message: "",
|
|
@@ -5786,8 +5799,8 @@ function Ju(e = [], t, n) {
|
|
|
5786
5799
|
};
|
|
5787
5800
|
let r = null;
|
|
5788
5801
|
for (let i of e) {
|
|
5789
|
-
let e =
|
|
5790
|
-
if (!(!e || e.severity === "allow") &&
|
|
5802
|
+
let e = Xu(i, t);
|
|
5803
|
+
if (!(!e || e.severity === "allow") && Qu(n, e.rowsKey).some((t) => zu(t, e))) {
|
|
5791
5804
|
if (e.severity === "block") return {
|
|
5792
5805
|
severity: "block",
|
|
5793
5806
|
message: e.message,
|
|
@@ -5806,23 +5819,23 @@ function Ju(e = [], t, n) {
|
|
|
5806
5819
|
group: null
|
|
5807
5820
|
};
|
|
5808
5821
|
}
|
|
5809
|
-
function
|
|
5822
|
+
function Qu(e, t) {
|
|
5810
5823
|
let n = e?.[t];
|
|
5811
5824
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5812
5825
|
}
|
|
5813
|
-
function
|
|
5826
|
+
function $u(e) {
|
|
5814
5827
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5815
5828
|
}
|
|
5816
|
-
function
|
|
5829
|
+
function ed(e = [], t = {}) {
|
|
5817
5830
|
let n = null;
|
|
5818
5831
|
for (let r of e) {
|
|
5819
5832
|
let e = r?.levelRule;
|
|
5820
5833
|
if (!e) continue;
|
|
5821
|
-
let i =
|
|
5834
|
+
let i = td(t, r);
|
|
5822
5835
|
if (!i.length) continue;
|
|
5823
|
-
let a =
|
|
5836
|
+
let a = Ju(i, e);
|
|
5824
5837
|
if (a) {
|
|
5825
|
-
if (
|
|
5838
|
+
if ($u(e) === "block") return {
|
|
5826
5839
|
severity: "block",
|
|
5827
5840
|
message: a,
|
|
5828
5841
|
group: r
|
|
@@ -5840,7 +5853,7 @@ function Zu(e = [], t = {}) {
|
|
|
5840
5853
|
group: null
|
|
5841
5854
|
};
|
|
5842
5855
|
}
|
|
5843
|
-
function
|
|
5856
|
+
function td(e, t) {
|
|
5844
5857
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5845
5858
|
if (!n) continue;
|
|
5846
5859
|
let t = e?.[n];
|
|
@@ -5850,10 +5863,10 @@ function Qu(e, t) {
|
|
|
5850
5863
|
}
|
|
5851
5864
|
//#endregion
|
|
5852
5865
|
//#region src/components/form/clearGroupOnChange.js
|
|
5853
|
-
function
|
|
5866
|
+
function nd(e, t) {
|
|
5854
5867
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5855
5868
|
}
|
|
5856
|
-
function
|
|
5869
|
+
function rd(e, t) {
|
|
5857
5870
|
let n = e?.field, r = [];
|
|
5858
5871
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5859
5872
|
e && e !== n && r.push(e);
|
|
@@ -5863,24 +5876,24 @@ function ed(e, t) {
|
|
|
5863
5876
|
e && e !== n && r.push(e);
|
|
5864
5877
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5865
5878
|
}
|
|
5866
|
-
function
|
|
5867
|
-
let i =
|
|
5879
|
+
function id(e, t, n, r) {
|
|
5880
|
+
let i = rd(t, r).map((e) => nd(n, e));
|
|
5868
5881
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5869
5882
|
}
|
|
5870
5883
|
//#endregion
|
|
5871
5884
|
//#region src/components/form/resolveStoredOptions.js
|
|
5872
|
-
function
|
|
5885
|
+
function ad(e) {
|
|
5873
5886
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5874
5887
|
}
|
|
5875
|
-
function
|
|
5888
|
+
function od(e, t = []) {
|
|
5876
5889
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5877
|
-
for (let t of
|
|
5890
|
+
for (let t of ad(e)) {
|
|
5878
5891
|
let e = String(t);
|
|
5879
5892
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5880
5893
|
}
|
|
5881
5894
|
return r;
|
|
5882
5895
|
}
|
|
5883
|
-
async function
|
|
5896
|
+
async function sd(e, t) {
|
|
5884
5897
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5885
5898
|
let n = new URLSearchParams({
|
|
5886
5899
|
collection: e.lookupCollection,
|
|
@@ -5892,7 +5905,7 @@ async function id(e, t) {
|
|
|
5892
5905
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5893
5906
|
return Array.isArray(i) ? i : [];
|
|
5894
5907
|
}
|
|
5895
|
-
function
|
|
5908
|
+
function cd(e = [], t = []) {
|
|
5896
5909
|
if (!t.length) return e;
|
|
5897
5910
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5898
5911
|
...e,
|
|
@@ -5902,25 +5915,25 @@ function ad(e = [], t = []) {
|
|
|
5902
5915
|
}
|
|
5903
5916
|
//#endregion
|
|
5904
5917
|
//#region src/components/form/requireAnyOf.js
|
|
5905
|
-
var
|
|
5906
|
-
function
|
|
5918
|
+
var ld = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5919
|
+
function ud(e) {
|
|
5907
5920
|
let t = e?.requireAnyOf;
|
|
5908
5921
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5909
5922
|
}
|
|
5910
|
-
function
|
|
5911
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5923
|
+
function dd(e) {
|
|
5924
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !ld(e));
|
|
5912
5925
|
}
|
|
5913
|
-
function
|
|
5914
|
-
let n =
|
|
5926
|
+
function fd({ field: e, getRow: t }) {
|
|
5927
|
+
let n = ud(e);
|
|
5915
5928
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5916
5929
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5917
5930
|
return { validator: async () => {
|
|
5918
5931
|
let e = t?.() ?? {};
|
|
5919
|
-
return
|
|
5932
|
+
return dd(e) ? n.some((t) => !ld(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5920
5933
|
} };
|
|
5921
5934
|
}
|
|
5922
|
-
function
|
|
5923
|
-
let n =
|
|
5935
|
+
function pd(e, t = []) {
|
|
5936
|
+
let n = ud(e);
|
|
5924
5937
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5925
5938
|
...t,
|
|
5926
5939
|
requireAnyOf: n,
|
|
@@ -5929,8 +5942,8 @@ function ud(e, t = []) {
|
|
|
5929
5942
|
}
|
|
5930
5943
|
//#endregion
|
|
5931
5944
|
//#region src/components/form/dateRules.js
|
|
5932
|
-
var
|
|
5933
|
-
function
|
|
5945
|
+
var md = (e) => e == null || e === "";
|
|
5946
|
+
function hd(e) {
|
|
5934
5947
|
if (!e) return null;
|
|
5935
5948
|
if (typeof e.valueOf == "function") {
|
|
5936
5949
|
let t = e.valueOf();
|
|
@@ -5944,12 +5957,12 @@ function $(e) {
|
|
|
5944
5957
|
let t = E(e);
|
|
5945
5958
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5946
5959
|
}
|
|
5947
|
-
function
|
|
5960
|
+
function gd(e) {
|
|
5948
5961
|
if (!e) return null;
|
|
5949
5962
|
let t = E(e);
|
|
5950
5963
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5951
5964
|
}
|
|
5952
|
-
var
|
|
5965
|
+
var _d = {
|
|
5953
5966
|
d: "day",
|
|
5954
5967
|
day: "day",
|
|
5955
5968
|
days: "day",
|
|
@@ -5965,13 +5978,13 @@ var md = {
|
|
|
5965
5978
|
year: "year",
|
|
5966
5979
|
years: "year"
|
|
5967
5980
|
};
|
|
5968
|
-
function
|
|
5981
|
+
function vd(e) {
|
|
5969
5982
|
if (e == null || e === "") return null;
|
|
5970
5983
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5971
5984
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5972
5985
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5973
5986
|
value: t,
|
|
5974
|
-
unit:
|
|
5987
|
+
unit: _d[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5975
5988
|
};
|
|
5976
5989
|
}
|
|
5977
5990
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5981,49 +5994,49 @@ function hd(e) {
|
|
|
5981
5994
|
let r = Number(n[1]);
|
|
5982
5995
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5983
5996
|
value: r,
|
|
5984
|
-
unit:
|
|
5997
|
+
unit: _d[n[2]] ?? "month"
|
|
5985
5998
|
};
|
|
5986
5999
|
}
|
|
5987
|
-
function
|
|
6000
|
+
function yd(e, t) {
|
|
5988
6001
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5989
6002
|
if (n && typeof t == "function") {
|
|
5990
|
-
let e =
|
|
6003
|
+
let e = vd(t(n));
|
|
5991
6004
|
if (e) return e;
|
|
5992
6005
|
}
|
|
5993
|
-
return
|
|
6006
|
+
return vd(e?.minGap);
|
|
5994
6007
|
}
|
|
5995
|
-
function
|
|
6008
|
+
function bd(e, t, n, r) {
|
|
5996
6009
|
if (t === null) return null;
|
|
5997
|
-
let i =
|
|
6010
|
+
let i = yd(n, r), a = E(t);
|
|
5998
6011
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5999
6012
|
}
|
|
6000
|
-
function
|
|
6013
|
+
function xd(e, t, n, r, i) {
|
|
6001
6014
|
if (t === null || n === null) return !1;
|
|
6002
|
-
let a =
|
|
6015
|
+
let a = bd(e, n, r, i);
|
|
6003
6016
|
if (a === null) return !1;
|
|
6004
|
-
let o = !!r?.strict && !
|
|
6017
|
+
let o = !!r?.strict && !yd(r, i);
|
|
6005
6018
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
6006
6019
|
}
|
|
6007
|
-
function
|
|
6020
|
+
function Sd(e, t, n, r) {
|
|
6008
6021
|
if (n?.message) return n.message;
|
|
6009
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
6022
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = yd(n, r);
|
|
6010
6023
|
if (a) {
|
|
6011
6024
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
6012
6025
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
6013
6026
|
}
|
|
6014
6027
|
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}`;
|
|
6015
6028
|
}
|
|
6016
|
-
function
|
|
6029
|
+
function Cd({ type: e, label: t, rule: n, readSibling: r }) {
|
|
6017
6030
|
return { validator: async (i, a) => {
|
|
6018
6031
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
6019
|
-
if (!o ||
|
|
6032
|
+
if (!o || md(a)) return Promise.resolve();
|
|
6020
6033
|
let s = r(o);
|
|
6021
|
-
if (
|
|
6034
|
+
if (md(s)) return Promise.resolve();
|
|
6022
6035
|
let c = $(a), l = $(s);
|
|
6023
|
-
return c === null || l === null ? Promise.resolve() :
|
|
6036
|
+
return c === null || l === null ? Promise.resolve() : xd(e, c, l, n, r) ? Promise.reject(Error(Sd(e, t, n, r))) : Promise.resolve();
|
|
6024
6037
|
} };
|
|
6025
6038
|
}
|
|
6026
|
-
function
|
|
6039
|
+
function wd(e, t, { rows: n, rowIndex: r } = {}) {
|
|
6027
6040
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
6028
6041
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
6029
6042
|
if (o) {
|
|
@@ -6037,11 +6050,11 @@ function xd(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
6037
6050
|
}
|
|
6038
6051
|
return !1;
|
|
6039
6052
|
}
|
|
6040
|
-
function
|
|
6053
|
+
function Td(e, t = "above", n = void 0) {
|
|
6041
6054
|
let r = e?.messages ?? {}, i = t === "below";
|
|
6042
6055
|
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.");
|
|
6043
6056
|
}
|
|
6044
|
-
function
|
|
6057
|
+
function Ed({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = sr }) {
|
|
6045
6058
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
6046
6059
|
for (let e of a) {
|
|
6047
6060
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -6055,17 +6068,17 @@ function Cd({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = sr }) {
|
|
|
6055
6068
|
o.push((i) => {
|
|
6056
6069
|
if (!i) return !1;
|
|
6057
6070
|
let a = t(e);
|
|
6058
|
-
return !
|
|
6071
|
+
return !md(a) && xd(r, $(i), $(a), n, t);
|
|
6059
6072
|
});
|
|
6060
6073
|
}
|
|
6061
6074
|
}
|
|
6062
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
6075
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? wd($(t), e.rowHierarchy, {
|
|
6063
6076
|
rows: n,
|
|
6064
6077
|
rowIndex: r
|
|
6065
6078
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
6066
6079
|
}
|
|
6067
|
-
function
|
|
6068
|
-
if (!
|
|
6080
|
+
function Dd(e, t = sr, n = void 0, r = void 0) {
|
|
6081
|
+
if (!md(n) && $(n) !== null) return;
|
|
6069
6082
|
let i, a = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
6070
6083
|
for (let e of a) {
|
|
6071
6084
|
let n = typeof e == "string" ? { type: e } : e;
|
|
@@ -6079,10 +6092,10 @@ function wd(e, t = sr, n = void 0, r = void 0) {
|
|
|
6079
6092
|
}
|
|
6080
6093
|
}
|
|
6081
6094
|
if (typeof r != "function") return i;
|
|
6082
|
-
let o = E(i ?? t()), s =
|
|
6095
|
+
let o = E(i ?? t()), s = Od(o, r);
|
|
6083
6096
|
return !s || s.isSame(o, "month") ? i : s;
|
|
6084
6097
|
}
|
|
6085
|
-
function
|
|
6098
|
+
function Od(e, t, n = 240) {
|
|
6086
6099
|
let r = E(e).startOf("day");
|
|
6087
6100
|
if (!r.isValid() || typeof t != "function") return null;
|
|
6088
6101
|
let i = (e) => {
|
|
@@ -6110,7 +6123,7 @@ function Td(e, t, n = 240) {
|
|
|
6110
6123
|
}
|
|
6111
6124
|
return null;
|
|
6112
6125
|
}
|
|
6113
|
-
function
|
|
6126
|
+
function kd({ field: e, name: t, rows: n }) {
|
|
6114
6127
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
6115
6128
|
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 ?? [];
|
|
6116
6129
|
for (let e of o) {
|
|
@@ -6139,44 +6152,44 @@ function Ed({ field: e, name: t, rows: n }) {
|
|
|
6139
6152
|
]));
|
|
6140
6153
|
return u;
|
|
6141
6154
|
}
|
|
6142
|
-
function
|
|
6155
|
+
function Ad({ field: e, rows: t, rowIndex: n }) {
|
|
6143
6156
|
let r = e?.rowHierarchy;
|
|
6144
6157
|
return { validator: async (i, a) => {
|
|
6145
|
-
if (!r ||
|
|
6158
|
+
if (!r || md(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
6146
6159
|
let o = $(a);
|
|
6147
|
-
if (o === null || !
|
|
6160
|
+
if (o === null || !wd(o, r, {
|
|
6148
6161
|
rows: t,
|
|
6149
6162
|
rowIndex: n
|
|
6150
6163
|
})) return Promise.resolve();
|
|
6151
6164
|
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;
|
|
6152
|
-
return Promise.reject(Error(
|
|
6165
|
+
return Promise.reject(Error(Td(r, u, p)));
|
|
6153
6166
|
} };
|
|
6154
6167
|
}
|
|
6155
6168
|
//#endregion
|
|
6156
6169
|
//#region src/utils/submitMessages.js
|
|
6157
|
-
function
|
|
6170
|
+
function jd(e) {
|
|
6158
6171
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
6159
6172
|
}
|
|
6160
|
-
function
|
|
6173
|
+
function Md(e) {
|
|
6161
6174
|
let t = String(e ?? "").trim();
|
|
6162
6175
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
6163
6176
|
}
|
|
6164
|
-
function
|
|
6165
|
-
return String(e).replaceAll("${module}",
|
|
6177
|
+
function Nd(e, t) {
|
|
6178
|
+
return String(e).replaceAll("${module}", Md(t)).replaceAll("${moduleName}", Md(t));
|
|
6166
6179
|
}
|
|
6167
|
-
function
|
|
6168
|
-
let r =
|
|
6180
|
+
function Pd(e, t, n) {
|
|
6181
|
+
let r = jd(e);
|
|
6169
6182
|
if (r?.suppress) return null;
|
|
6170
6183
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
6171
|
-
return i && String(i).trim() ?
|
|
6184
|
+
return i && String(i).trim() ? Nd(i, t) : n === "edit" ? `${Md(t)} has Updated successfully` : `${Md(t)} has added successfully`;
|
|
6172
6185
|
}
|
|
6173
|
-
function
|
|
6174
|
-
let i =
|
|
6175
|
-
return a && String(a).trim() ?
|
|
6186
|
+
function Fd(e, t, n, r) {
|
|
6187
|
+
let i = jd(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
6188
|
+
return a && String(a).trim() ? Nd(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${Md(t)}` : `Failed to create ${Md(t)}`;
|
|
6176
6189
|
}
|
|
6177
6190
|
//#endregion
|
|
6178
6191
|
//#region src/utils/scrollToFirstFormError.js
|
|
6179
|
-
function
|
|
6192
|
+
function Id({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
6180
6193
|
if (!e?.length) return;
|
|
6181
6194
|
let r = e[0]?.name;
|
|
6182
6195
|
setTimeout(() => {
|
|
@@ -6201,10 +6214,10 @@ function Nd({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
6201
6214
|
}
|
|
6202
6215
|
//#endregion
|
|
6203
6216
|
//#region src/components/form/conditionalFieldLabel.js
|
|
6204
|
-
function
|
|
6217
|
+
function Ld(e) {
|
|
6205
6218
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
6206
6219
|
}
|
|
6207
|
-
function
|
|
6220
|
+
function Rd(e, t) {
|
|
6208
6221
|
if (!e?.field) return !1;
|
|
6209
6222
|
switch (e.operator ?? "eq") {
|
|
6210
6223
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -6212,58 +6225,58 @@ function Fd(e, t) {
|
|
|
6212
6225
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
6213
6226
|
case "falsy": return t == null || t === "" || t === !1;
|
|
6214
6227
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
6215
|
-
case "in": return
|
|
6216
|
-
case "notIn": return !
|
|
6228
|
+
case "in": return Ld(e.value).includes(String(t ?? ""));
|
|
6229
|
+
case "notIn": return !Ld(e.value).includes(String(t ?? ""));
|
|
6217
6230
|
default: return !1;
|
|
6218
6231
|
}
|
|
6219
6232
|
}
|
|
6220
|
-
function
|
|
6233
|
+
function zd(e, t, n = !1) {
|
|
6221
6234
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
6222
|
-
return
|
|
6235
|
+
return Rd(i, t) && i?.label ? i.label : r;
|
|
6223
6236
|
}
|
|
6224
|
-
function
|
|
6237
|
+
function Bd(e) {
|
|
6225
6238
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
6226
6239
|
}
|
|
6227
|
-
function
|
|
6228
|
-
let n =
|
|
6240
|
+
function Vd(e, t) {
|
|
6241
|
+
let n = Bd(e);
|
|
6229
6242
|
if (!n.length) return !0;
|
|
6230
|
-
let r = n.map((e) =>
|
|
6243
|
+
let r = n.map((e) => Rd(e, t(e.field)));
|
|
6231
6244
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
6232
6245
|
}
|
|
6233
|
-
function
|
|
6246
|
+
function Hd(e) {
|
|
6234
6247
|
let t = e?.colWhen;
|
|
6235
6248
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
6236
6249
|
}
|
|
6237
|
-
function
|
|
6238
|
-
for (let t of
|
|
6250
|
+
function Ud(e, t, n) {
|
|
6251
|
+
for (let t of Hd(e)) if (Rd(t, n(t))) return Number(t.col);
|
|
6239
6252
|
return t;
|
|
6240
6253
|
}
|
|
6241
|
-
function
|
|
6254
|
+
function Wd(e, t) {
|
|
6242
6255
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
6243
6256
|
}
|
|
6244
6257
|
//#endregion
|
|
6245
6258
|
//#region src/components/form/conditionalRequired.js
|
|
6246
|
-
function
|
|
6259
|
+
function Gd(e, t) {
|
|
6247
6260
|
return (n) => {
|
|
6248
6261
|
if (!e || !n) return;
|
|
6249
6262
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
6250
6263
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
6251
6264
|
};
|
|
6252
6265
|
}
|
|
6253
|
-
function
|
|
6266
|
+
function Kd(e, t, n) {
|
|
6254
6267
|
let r = e?.requiredWhen;
|
|
6255
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
6268
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : Vd(r, Gd(t, n));
|
|
6256
6269
|
}
|
|
6257
|
-
function
|
|
6270
|
+
function qd(e, t, n) {
|
|
6258
6271
|
return { validator: (r, i) => {
|
|
6259
|
-
if (!
|
|
6272
|
+
if (!Kd(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
6260
6273
|
let a = e?.label ?? e?.field ?? "This field";
|
|
6261
6274
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
6262
6275
|
} };
|
|
6263
6276
|
}
|
|
6264
6277
|
//#endregion
|
|
6265
6278
|
//#region src/components/Breadcrumb.jsx
|
|
6266
|
-
function
|
|
6279
|
+
function Jd({ items: e = [] }) {
|
|
6267
6280
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(Nr, {
|
|
6268
6281
|
variant: "body",
|
|
6269
6282
|
weight: "medium",
|
|
@@ -6281,34 +6294,34 @@ function Gd({ items: e = [] }) {
|
|
|
6281
6294
|
}
|
|
6282
6295
|
//#endregion
|
|
6283
6296
|
//#region src/components/form/canonicalOption.js
|
|
6284
|
-
var
|
|
6285
|
-
function
|
|
6297
|
+
var Yd = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
6298
|
+
function Xd(e = []) {
|
|
6286
6299
|
let t = /* @__PURE__ */ new Map();
|
|
6287
6300
|
for (let n of e) {
|
|
6288
6301
|
if (n == null) continue;
|
|
6289
6302
|
let e = typeof n == "object" ? n.value : n;
|
|
6290
6303
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
6291
|
-
let n =
|
|
6304
|
+
let n = Yd(r);
|
|
6292
6305
|
n && !t.has(n) && t.set(n, e);
|
|
6293
6306
|
}
|
|
6294
6307
|
}
|
|
6295
6308
|
return t;
|
|
6296
6309
|
}
|
|
6297
|
-
function
|
|
6310
|
+
function Zd(e, t) {
|
|
6298
6311
|
if (!Array.isArray(e)) {
|
|
6299
|
-
let n =
|
|
6312
|
+
let n = Zd([e], t);
|
|
6300
6313
|
return n.length ? n[0] : e;
|
|
6301
6314
|
}
|
|
6302
|
-
let n =
|
|
6315
|
+
let n = Xd(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
6303
6316
|
for (let t of e) {
|
|
6304
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
6317
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(Yd(e)) ?? e, o = Yd(a);
|
|
6305
6318
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
6306
6319
|
}
|
|
6307
6320
|
return i;
|
|
6308
6321
|
}
|
|
6309
6322
|
//#endregion
|
|
6310
6323
|
//#region src/components/form/dependencyBusy.js
|
|
6311
|
-
function
|
|
6324
|
+
function Qd(e, t = []) {
|
|
6312
6325
|
if (!e) return [];
|
|
6313
6326
|
let n = /* @__PURE__ */ new Set();
|
|
6314
6327
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -6318,16 +6331,16 @@ function Yd(e, t = []) {
|
|
|
6318
6331
|
}
|
|
6319
6332
|
return n.delete(e), [...n];
|
|
6320
6333
|
}
|
|
6321
|
-
function
|
|
6322
|
-
return e?.blockWhileResolving ?
|
|
6334
|
+
function $d(e, t = []) {
|
|
6335
|
+
return e?.blockWhileResolving ? Qd(e.field, t).length > 0 : !1;
|
|
6323
6336
|
}
|
|
6324
|
-
function
|
|
6337
|
+
function ef(e) {
|
|
6325
6338
|
let t = String(e?.label ?? "").trim();
|
|
6326
6339
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
6327
6340
|
}
|
|
6328
|
-
function
|
|
6341
|
+
function tf(e, t = []) {
|
|
6329
6342
|
if (!e?.field) return [];
|
|
6330
|
-
let n = new Set(
|
|
6343
|
+
let n = new Set(Qd(e.field, t));
|
|
6331
6344
|
if (n.size === 0) return [];
|
|
6332
6345
|
let r = [];
|
|
6333
6346
|
for (let e of t) {
|
|
@@ -6336,19 +6349,19 @@ function Qd(e, t = []) {
|
|
|
6336
6349
|
}
|
|
6337
6350
|
return r;
|
|
6338
6351
|
}
|
|
6339
|
-
function
|
|
6352
|
+
function nf(e) {
|
|
6340
6353
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
6341
6354
|
}
|
|
6342
6355
|
//#endregion
|
|
6343
6356
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
6344
|
-
var
|
|
6345
|
-
function
|
|
6357
|
+
var rf = f(() => import("./index.js").then((e) => e.n)), af = f(() => import("./DocumentViewer-DcgKxqov.js").then((e) => e.n));
|
|
6358
|
+
function of(e) {
|
|
6346
6359
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
6347
6360
|
return w(t === "pdf" ? pe : t === "doc" || t === "docx" ? he : fe, { className: "v1-file-chip__icon" });
|
|
6348
6361
|
}
|
|
6349
|
-
function
|
|
6362
|
+
function sf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
6350
6363
|
let r = e?.linkedModule, i = e?.linkedFileField, a = g(() => {
|
|
6351
|
-
let n =
|
|
6364
|
+
let n = Jc(r, t);
|
|
6352
6365
|
if (n) return n;
|
|
6353
6366
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
6354
6367
|
return a ? String(a) : "";
|
|
@@ -6382,7 +6395,7 @@ function rf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6382
6395
|
i,
|
|
6383
6396
|
p
|
|
6384
6397
|
]);
|
|
6385
|
-
let _ = g(() =>
|
|
6398
|
+
let _ = g(() => Vo(o.fileValue), [o.fileValue])[0], y = !!_, ee = e?.label ?? "File", x = cc(r) || "record";
|
|
6386
6399
|
if (!a) return /* @__PURE__ */ w("div", {
|
|
6387
6400
|
className: "v1-linked-file v1-linked-file--empty",
|
|
6388
6401
|
children: /* @__PURE__ */ w("span", { children: e?.unlinkedText ?? `Not available until the ${x} is set.` })
|
|
@@ -6410,7 +6423,7 @@ function rf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6410
6423
|
onClick: () => y && l(!0),
|
|
6411
6424
|
title: y ? `Preview or download ${_.name}` : re,
|
|
6412
6425
|
children: [
|
|
6413
|
-
y ?
|
|
6426
|
+
y ? of(_.name) : /* @__PURE__ */ w(fe, { className: "v1-file-chip__icon" }),
|
|
6414
6427
|
/* @__PURE__ */ w("span", {
|
|
6415
6428
|
className: "v1-file-chip__name",
|
|
6416
6429
|
children: y ? _.name : re
|
|
@@ -6434,7 +6447,7 @@ function rf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6434
6447
|
}),
|
|
6435
6448
|
c && te && /* @__PURE__ */ w(u, {
|
|
6436
6449
|
fallback: null,
|
|
6437
|
-
children: /* @__PURE__ */ w(
|
|
6450
|
+
children: /* @__PURE__ */ w(af, {
|
|
6438
6451
|
open: c,
|
|
6439
6452
|
onClose: () => l(!1),
|
|
6440
6453
|
documents: [te]
|
|
@@ -6465,7 +6478,7 @@ function rf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6465
6478
|
},
|
|
6466
6479
|
children: /* @__PURE__ */ w(ie, {})
|
|
6467
6480
|
}),
|
|
6468
|
-
children: /* @__PURE__ */ w(
|
|
6481
|
+
children: /* @__PURE__ */ w(rf, {
|
|
6469
6482
|
moduleName: r,
|
|
6470
6483
|
recordId: a,
|
|
6471
6484
|
embedded: !0,
|
|
@@ -6479,7 +6492,7 @@ function rf({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6479
6492
|
})
|
|
6480
6493
|
] });
|
|
6481
6494
|
}
|
|
6482
|
-
|
|
6495
|
+
sf.propTypes = {
|
|
6483
6496
|
field: D.shape({
|
|
6484
6497
|
label: D.string,
|
|
6485
6498
|
linkedModule: D.string,
|
|
@@ -6492,11 +6505,11 @@ rf.propTypes = {
|
|
|
6492
6505
|
}).isRequired,
|
|
6493
6506
|
recordMeta: D.object,
|
|
6494
6507
|
onLinkedRecordUpdated: D.func
|
|
6495
|
-
},
|
|
6508
|
+
}, sf.defaultProps = {
|
|
6496
6509
|
recordMeta: void 0,
|
|
6497
6510
|
onLinkedRecordUpdated: void 0
|
|
6498
6511
|
};
|
|
6499
6512
|
//#endregion
|
|
6500
|
-
export {
|
|
6513
|
+
export { uu as $, dt as $i, hi as $n, On as $r, Us as $t, sd as A, gn as Ai, U as An, $n as Ar, Ic as At, ed as B, Ft as Bi, ea as Bn, Hn as Br, uc as Bt, Dd as C, ut as Ci, uo as Cn, fr as Cr, Gc as Ct, kd as D, Et as Di, so as Dn, gr as Dr, Bc as Dt, md as E, xt as Ei, to as En, cr as Er, Vc as Et, Xu as F, on as Fi, Ba as Fn, Jn as Fr, gc as Ft, Eu as G, Zt as Gi, ki as Gn, En as Gr, Ks as Gt, ju as H, Sn as Hi, Vi as Hn, it as Hr, ic as Ht, Mu as I, $e as Ii, ga as In, Zn as Ir, mc as It, _u as J, an as Ji, Ti as Jn, Ln as Jr, Ys as Jt, xu as K, ze as Ki, Ai as Kn, _n as Kr, qs as Kt, Fu as L, Xe as Li, va as Ln, Bn as Lr, fc as Lt, od as M, In as Mi, qa as Mn, tr as Mr, kc as Mt, id as N, Re as Ni, oo as Nn, I as Nr, Ec as Nt, pd as O, tn as Oi, eo as On, ur as Or, zc as Ot, Lu as P, We as Pi, Va as Pn, rr as Pr, Dc as Pt, du as Q, st as Qi, gi as Qn, ht as Qr, Ps as Qt, Nu as R, Ut as Ri, la as Rn, Vn as Rr, cc as Rt, Ad as S, ot as Si, lo as Sn, lr as Sr, $c as St, gd as T, St as Ti, J as Tn, yr as Tr, Hc as Tt, ku as U, jn as Ui, Ki as Un, Dt as Ur, Zs as Ut, Yu as V, It as Vi, na as Vn, Wn as Vr, tc as Vt, Tu as W, Lt as Wi, Gi as Wn, et as Wr, Xs as Wt, gu as X, mt as Xi, wi as Xn, Mn as Xr, Ls as Xt, bu as Y, rt as Yi, Di as Yn, Qt as Yr, Rs as Yt, mu as Z, yt as Zi, Si as Zn, nt as Zr, Os as Zt, Id as _, Nn as _a, Ue as _i, Vo as _n, zr as _r, Jc as _t, $d as a, Wt as aa, Ve as ai, _s as an, di as ar, Jl as at, Ed as b, Yt as ba, un as bi, mo as bn, R as br, Xc as bt, Kd as c, Tt as ca, Xt as ci, $o as cn, ci as cr, xl as ct, Wd as d, vn as da, pt as di, Y as dn, ri as dr, ul as dt, Ct as ea, wt as ei, bs as en, Ci as er, eu as et, Rd as f, mn as fa, kt as fi, Uo as fn, qr as fr, rl as ft, Bd as g, Cn as ga, ln as gi, Lo as gn, Ur as gr, Yc as gt, Ud as h, Bt as ha, dn as hi, Do as hn, Wr as hr, tl as ht, ef as i, Ze as ia, en as ii, vs as in, fi as ir, Ql as it, cd as j, fn as ji, Xa as jn, Qn as jr, Ac as jt, fd as k, nn as ki, Aa as kn, Gn as kr, Rc as kt, qd as l, tt as la, Qe as li, Qo as ln, ei as lr, gl as lt, Vd as m, $t as ma, Kt as mi, To as mn, Gr as mr, ol as mt, nf as n, sn as na, hn as ni, Ss as nn, vi as nr, Xl as nt, Zd as o, qt as oa, Pn as oi, hs as on, li as or, vl as ot, zd as p, Rn as pa, Mt as pi, Eo as pn, Kr as pr, il as pt, wu as q, rn as qi, Oi as qn, pn as qr, Js as qt, tf as r, Be as ra, zn as ri, ys as rn, ui as rr, jl as rt, Jd as s, gt as sa, ct as si, gs as sn, pi as sr, Sl as st, sf as t, He as ta, yn as ti, Cs as tn, _i as tr, Vl as tt, Hd as u, Dn as ua, Ye as ui, Ko as un, ti as ur, ml as ut, Fd as v, Nt as va, vt as vi, bo as vn, Nr as vr, Zc as vt, hd as w, Jt as wi, fo as wn, L as wr, Uc as wt, Cd as x, cn as xa, Tn as xi, ho as xn, sr as xr, el as xt, Pd as y, Gt as ya, bt as yi, wo as yn, z as yr, Qc as yt, Zu as z, P as zi, Xi as zn, Un as zr, lc as zt };
|
|
6501
6514
|
|
|
6502
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
6515
|
+
//# sourceMappingURL=LinkedRecordFileField-4vCdXlj4.js.map
|