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