@realtek/core-theme-live 0.0.439 → 0.0.444
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-D-rT7qNC.js → LinkedRecordFileField-BD3KkJt_.js} +1034 -901
- package/dist-lib/LinkedRecordFileField-BD3KkJt_.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-Bl-KLNrJ.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-Bl-KLNrJ.cjs.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +9860 -9499
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-D-rT7qNC.js.map +0 -1
- package/dist-lib/LinkedRecordFileField-_-0O1dKp.cjs +0 -5
- package/dist-lib/LinkedRecordFileField-_-0O1dKp.cjs.map +0 -1
|
@@ -16,7 +16,7 @@ import { Table as Ee, TableCell as De, TableHeader as Oe, TableRow as ke } from
|
|
|
16
16
|
import D from "prop-types";
|
|
17
17
|
import Ae from "dompurify";
|
|
18
18
|
//#region src/services/adminApi.js
|
|
19
|
-
var
|
|
19
|
+
var je = "/admin/field-config", O = [
|
|
20
20
|
{
|
|
21
21
|
key: "clients",
|
|
22
22
|
apiModule: "clients"
|
|
@@ -46,17 +46,17 @@ var O = "/admin/field-config", k = [
|
|
|
46
46
|
apiModule: "payroll"
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
|
-
function
|
|
49
|
+
function k(...e) {
|
|
50
50
|
return e.find(Array.isArray) ?? [];
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function A(e, t, n) {
|
|
53
53
|
return t.map((t) => e?.[t]).find((e) => e != null && e !== "") ?? n;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Me(e, t) {
|
|
56
56
|
return e?.total ?? e?.totalCount ?? e?.count ?? e?.recordsTotal ?? e?.meta?.total ?? e?.pagination?.total ?? t.length;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let n =
|
|
58
|
+
function Ne(e, t) {
|
|
59
|
+
let n = A(e, [
|
|
60
60
|
"label",
|
|
61
61
|
"Label",
|
|
62
62
|
"fieldName",
|
|
@@ -64,7 +64,7 @@ function Me(e, t) {
|
|
|
64
64
|
"name",
|
|
65
65
|
"fieldLabel",
|
|
66
66
|
"value"
|
|
67
|
-
], `Field ${t + 1}`), r =
|
|
67
|
+
], `Field ${t + 1}`), r = A(e, [
|
|
68
68
|
"field",
|
|
69
69
|
"Field",
|
|
70
70
|
"fieldKey",
|
|
@@ -73,7 +73,7 @@ function Me(e, t) {
|
|
|
73
73
|
"value",
|
|
74
74
|
"fieldName",
|
|
75
75
|
"name"
|
|
76
|
-
], n), i =
|
|
76
|
+
], n), i = A(e, [
|
|
77
77
|
"isVisible",
|
|
78
78
|
"is_visible",
|
|
79
79
|
"visible",
|
|
@@ -81,14 +81,14 @@ function Me(e, t) {
|
|
|
81
81
|
"is_show",
|
|
82
82
|
"isShow",
|
|
83
83
|
"enabled"
|
|
84
|
-
], !0), a =
|
|
84
|
+
], !0), a = A(e, [
|
|
85
85
|
"ismandatory",
|
|
86
86
|
"isMandatory",
|
|
87
87
|
"is_mandatory",
|
|
88
88
|
"mandatory",
|
|
89
89
|
"required",
|
|
90
90
|
"req"
|
|
91
|
-
], !1), o =
|
|
91
|
+
], !1), o = A(e, [
|
|
92
92
|
"order",
|
|
93
93
|
"Order",
|
|
94
94
|
"sortOrder",
|
|
@@ -98,7 +98,7 @@ function Me(e, t) {
|
|
|
98
98
|
...e,
|
|
99
99
|
fieldKey: r,
|
|
100
100
|
fieldName: n,
|
|
101
|
-
type:
|
|
101
|
+
type: A(e, ["type", "Type"], "text"),
|
|
102
102
|
isVisible: typeof i == "string" ? ![
|
|
103
103
|
"false",
|
|
104
104
|
"0",
|
|
@@ -150,12 +150,12 @@ function Me(e, t) {
|
|
|
150
150
|
filterArrayValueField: e.filterArrayValueField ?? ""
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Pe(e) {
|
|
154
154
|
if (typeof e == "string") return {
|
|
155
155
|
key: e,
|
|
156
156
|
apiModule: e
|
|
157
157
|
};
|
|
158
|
-
let t =
|
|
158
|
+
let t = A(e, [
|
|
159
159
|
"key",
|
|
160
160
|
"moduleKey",
|
|
161
161
|
"value",
|
|
@@ -167,7 +167,7 @@ function Ne(e) {
|
|
|
167
167
|
], "");
|
|
168
168
|
return t ? {
|
|
169
169
|
key: t,
|
|
170
|
-
apiModule:
|
|
170
|
+
apiModule: A(e, [
|
|
171
171
|
"apiModule",
|
|
172
172
|
"api_module",
|
|
173
173
|
"module",
|
|
@@ -179,38 +179,38 @@ function Ne(e) {
|
|
|
179
179
|
], t)
|
|
180
180
|
} : null;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
let t = Array.isArray(e) && e.length ? e :
|
|
184
|
-
return t.map(
|
|
182
|
+
function Fe(e = O) {
|
|
183
|
+
let t = Array.isArray(e) && e.length ? e : O, n = /* @__PURE__ */ new Set();
|
|
184
|
+
return t.map(Pe).filter(Boolean).filter((e) => !n.has(e.key) && (n.add(e.key), !0));
|
|
185
185
|
}
|
|
186
|
-
var
|
|
187
|
-
async function
|
|
188
|
-
let e = await a(s,
|
|
186
|
+
var Ie = "/admin/modules";
|
|
187
|
+
async function Le() {
|
|
188
|
+
let e = await a(s, Ie), t = e?.data;
|
|
189
189
|
return Array.isArray(t) ? t : Array.isArray(e) ? e : [];
|
|
190
190
|
}
|
|
191
|
-
async function
|
|
192
|
-
let t = await a(s, `${
|
|
191
|
+
async function Re(e) {
|
|
192
|
+
let t = await a(s, `${Ie}/${encodeURIComponent(e)}/automations`), n = t?.data ?? t ?? {};
|
|
193
193
|
return {
|
|
194
194
|
gateway: n.gateway ?? null,
|
|
195
195
|
strategies: n.strategies ?? null
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
async function
|
|
198
|
+
async function ze(e) {
|
|
199
199
|
let t = await a(s, `/admin/platform/${e}`), n = t?.data ?? t;
|
|
200
200
|
return Array.isArray(n) ? n : [];
|
|
201
201
|
}
|
|
202
|
-
async function
|
|
202
|
+
async function Be(e, t) {
|
|
203
203
|
return a(s, `/admin/platform/${e}`, {
|
|
204
204
|
method: "POST",
|
|
205
205
|
headers: { "Content-Type": "application/json" },
|
|
206
206
|
body: JSON.stringify(t)
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
async function
|
|
209
|
+
async function Ve(e, t) {
|
|
210
210
|
return a(s, `/admin/platform/${e}/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
211
211
|
}
|
|
212
|
-
async function
|
|
213
|
-
return a(s, `${
|
|
212
|
+
async function He(e, { gateway: t, strategies: n }) {
|
|
213
|
+
return a(s, `${Ie}/${encodeURIComponent(e)}/automations`, {
|
|
214
214
|
method: "PUT",
|
|
215
215
|
headers: { "Content-Type": "application/json" },
|
|
216
216
|
body: JSON.stringify({
|
|
@@ -219,7 +219,7 @@ async function Ve(e, { gateway: t, strategies: n }) {
|
|
|
219
219
|
})
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
async function
|
|
222
|
+
async function Ue() {
|
|
223
223
|
let e = [];
|
|
224
224
|
try {
|
|
225
225
|
e = await dn();
|
|
@@ -227,12 +227,12 @@ async function He() {
|
|
|
227
227
|
e = [];
|
|
228
228
|
}
|
|
229
229
|
let t = (Array.isArray(e) ? e : []).filter((e) => e?.isDeleted !== !0 && String(e?.status ?? "active").toLowerCase() !== "inactive" && String(e?.status ?? "active").toLowerCase() !== "disabled");
|
|
230
|
-
return t.length > 0 ? t :
|
|
230
|
+
return t.length > 0 ? t : Le();
|
|
231
231
|
}
|
|
232
|
-
async function
|
|
232
|
+
async function We() {
|
|
233
233
|
let e;
|
|
234
234
|
try {
|
|
235
|
-
e = await
|
|
235
|
+
e = await Le();
|
|
236
236
|
} catch {
|
|
237
237
|
return {};
|
|
238
238
|
}
|
|
@@ -250,25 +250,25 @@ async function Ue() {
|
|
|
250
250
|
}
|
|
251
251
|
return t;
|
|
252
252
|
}
|
|
253
|
-
var
|
|
254
|
-
function
|
|
253
|
+
var Ge = "/admin/form-groups", Ke = "/admin/config-defaults", qe = "000000000000000000000000";
|
|
254
|
+
function Je(e) {
|
|
255
255
|
let t = String(e ?? "").trim();
|
|
256
|
-
return t === "" || t ===
|
|
256
|
+
return t === "" || t === qe;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Ye(e = {}) {
|
|
259
259
|
let t = new URLSearchParams();
|
|
260
260
|
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
261
261
|
let n = t.toString();
|
|
262
262
|
return n ? `?${n}` : "";
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
265
|
-
let n = `${
|
|
264
|
+
async function Xe(e = "", t = {}) {
|
|
265
|
+
let n = `${Ge}${Ye({
|
|
266
266
|
...t,
|
|
267
267
|
module: e || t.module || ""
|
|
268
268
|
})}`, r = await a(s, n), i = r?.data;
|
|
269
269
|
return Array.isArray(i) ? i : i && Array.isArray(i.groups) ? i.groups : Array.isArray(r) ? r : r && Array.isArray(r.groups) ? r.groups : [];
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function Ze({ offset: e = 0, limit: t = 100, sortBy: n = "new", searchvalue: r = "" } = {}) {
|
|
272
272
|
let i = new URLSearchParams({
|
|
273
273
|
offset: String(e),
|
|
274
274
|
limit: String(t),
|
|
@@ -279,29 +279,29 @@ async function Xe({ offset: e = 0, limit: t = 100, sortBy: n = "new", searchvalu
|
|
|
279
279
|
let u = await a(s, `/client/view?${i.toString()}`), d = u?.data ?? u;
|
|
280
280
|
return d?.clients ?? d?.Clients ?? d?.items ?? [];
|
|
281
281
|
}
|
|
282
|
-
async function
|
|
282
|
+
async function Qe(e) {
|
|
283
283
|
let t = await a(s, `/filter-dropdown-fields?module=${encodeURIComponent(e)}`), n = t?.data ?? t;
|
|
284
284
|
return Array.isArray(n) ? n : [];
|
|
285
285
|
}
|
|
286
|
-
async function
|
|
287
|
-
return a(s, `${
|
|
286
|
+
async function $e(e, t = {}) {
|
|
287
|
+
return a(s, `${Ge}${Ye(t)}`, {
|
|
288
288
|
method: "POST",
|
|
289
289
|
headers: { "Content-Type": "application/json" },
|
|
290
290
|
body: JSON.stringify(e)
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
async function
|
|
294
|
-
return a(s, `${
|
|
293
|
+
async function et(e, t, n = {}) {
|
|
294
|
+
return a(s, `${Ge}/${e}${Ye(n)}`, {
|
|
295
295
|
method: "PUT",
|
|
296
296
|
headers: { "Content-Type": "application/json" },
|
|
297
297
|
body: JSON.stringify(t)
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
async function
|
|
301
|
-
return a(s, `${
|
|
300
|
+
async function tt(e, t = {}) {
|
|
301
|
+
return a(s, `${Ge}/${e}${Ye(t)}`, { method: "DELETE" });
|
|
302
302
|
}
|
|
303
|
-
async function
|
|
304
|
-
return a(s, `${
|
|
303
|
+
async function nt(e, t) {
|
|
304
|
+
return a(s, `${Ke}/request-otp`, {
|
|
305
305
|
method: "POST",
|
|
306
306
|
body: JSON.stringify({
|
|
307
307
|
scope: e,
|
|
@@ -309,8 +309,8 @@ async function tt(e, t) {
|
|
|
309
309
|
})
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
|
-
async function
|
|
313
|
-
return a(s, `${
|
|
312
|
+
async function rt(e, t, n) {
|
|
313
|
+
return a(s, `${Ke}/apply`, {
|
|
314
314
|
method: "POST",
|
|
315
315
|
body: JSON.stringify({
|
|
316
316
|
scope: e,
|
|
@@ -319,23 +319,23 @@ async function nt(e, t, n) {
|
|
|
319
319
|
})
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
async function
|
|
324
|
-
let n =
|
|
322
|
+
var it = "/admin/detail-config";
|
|
323
|
+
async function at(e, t = {}) {
|
|
324
|
+
let n = Ye({
|
|
325
325
|
module: e,
|
|
326
326
|
clientId: t.clientId
|
|
327
|
-
}), r = await a(s, `${
|
|
327
|
+
}), r = await a(s, `${it}${n}`), i = r?.data ?? r ?? {};
|
|
328
328
|
return {
|
|
329
329
|
module: i.module ?? e,
|
|
330
|
-
clientId:
|
|
330
|
+
clientId: Je(i.clientId) ? "" : String(i.clientId),
|
|
331
331
|
fields: Array.isArray(i.fields) ? i.fields : [],
|
|
332
332
|
merges: Array.isArray(i.merges) ? i.merges : [],
|
|
333
333
|
sourceFields: Array.isArray(i.sourceFields) ? i.sourceFields : [],
|
|
334
334
|
groups: Array.isArray(i.groups) ? i.groups : []
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
async function
|
|
338
|
-
return a(s,
|
|
337
|
+
async function ot({ module: e, fields: t = [], merges: n = [], sourceFields: r = [], groups: i = [], clientId: o = "" }) {
|
|
338
|
+
return a(s, it, {
|
|
339
339
|
method: "POST",
|
|
340
340
|
headers: { "Content-Type": "application/json" },
|
|
341
341
|
body: JSON.stringify({
|
|
@@ -348,8 +348,8 @@ async function at({ module: e, fields: t = [], merges: n = [], sourceFields: r =
|
|
|
348
348
|
})
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
352
|
-
return a(s, `${
|
|
351
|
+
async function st({ module: e, clientId: t = "", otp: n }) {
|
|
352
|
+
return a(s, `${it}/discover-fields`, {
|
|
353
353
|
method: "POST",
|
|
354
354
|
headers: { "Content-Type": "application/json" },
|
|
355
355
|
body: JSON.stringify({
|
|
@@ -359,35 +359,35 @@ async function ot({ module: e, clientId: t = "", otp: n }) {
|
|
|
359
359
|
})
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
var
|
|
363
|
-
async function
|
|
364
|
-
let e = await a(s,
|
|
362
|
+
var ct = "/admin/detail-defaults";
|
|
363
|
+
async function lt() {
|
|
364
|
+
let e = await a(s, ct);
|
|
365
365
|
return e?.data ?? e ?? {};
|
|
366
366
|
}
|
|
367
|
-
async function
|
|
368
|
-
return a(s,
|
|
367
|
+
async function ut(e) {
|
|
368
|
+
return a(s, ct, {
|
|
369
369
|
method: "POST",
|
|
370
370
|
headers: { "Content-Type": "application/json" },
|
|
371
371
|
body: JSON.stringify(e)
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
var
|
|
375
|
-
async function
|
|
376
|
-
let e = await a(s,
|
|
374
|
+
var dt = "/admin/ai-service-config";
|
|
375
|
+
async function ft() {
|
|
376
|
+
let e = await a(s, dt);
|
|
377
377
|
return e?.data ?? e ?? [];
|
|
378
378
|
}
|
|
379
|
-
async function
|
|
380
|
-
return a(s,
|
|
379
|
+
async function pt(e) {
|
|
380
|
+
return a(s, dt, {
|
|
381
381
|
method: "POST",
|
|
382
382
|
headers: { "Content-Type": "application/json" },
|
|
383
383
|
body: JSON.stringify(e)
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
async function
|
|
387
|
-
return a(s, `${
|
|
386
|
+
async function mt(e) {
|
|
387
|
+
return a(s, `${dt}?serviceKey=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
388
388
|
}
|
|
389
|
-
async function
|
|
390
|
-
let r = await a(s, `${
|
|
389
|
+
async function ht({ baseUrl: e, authHeader: t, authValue: n }) {
|
|
390
|
+
let r = await a(s, `${dt}/test`, {
|
|
391
391
|
method: "POST",
|
|
392
392
|
headers: { "Content-Type": "application/json" },
|
|
393
393
|
body: JSON.stringify({
|
|
@@ -398,61 +398,61 @@ async function mt({ baseUrl: e, authHeader: t, authValue: n }) {
|
|
|
398
398
|
});
|
|
399
399
|
return r?.data ?? r;
|
|
400
400
|
}
|
|
401
|
-
var
|
|
402
|
-
async function
|
|
403
|
-
let e = await a(s,
|
|
401
|
+
var gt = "/admin/bgc-integration-config";
|
|
402
|
+
async function _t() {
|
|
403
|
+
let e = await a(s, gt);
|
|
404
404
|
return e?.data ?? e ?? {
|
|
405
405
|
updateMethod: "MANUAL",
|
|
406
406
|
enabled: !0
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
async function
|
|
410
|
-
return a(s,
|
|
409
|
+
async function vt(e) {
|
|
410
|
+
return a(s, gt, {
|
|
411
411
|
method: "PUT",
|
|
412
412
|
headers: { "Content-Type": "application/json" },
|
|
413
413
|
body: JSON.stringify(e)
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
async function
|
|
416
|
+
async function yt() {
|
|
417
417
|
let e = await a(s, "/integration-config/bgc/summary");
|
|
418
418
|
return e?.data ?? e ?? {
|
|
419
419
|
updateMethod: "MANUAL",
|
|
420
420
|
enabled: !0
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
var
|
|
424
|
-
async function
|
|
425
|
-
let e = await a(s,
|
|
423
|
+
var j = "/admin/integration-config";
|
|
424
|
+
async function bt() {
|
|
425
|
+
let e = await a(s, j);
|
|
426
426
|
return e?.data ?? e ?? [];
|
|
427
427
|
}
|
|
428
|
-
async function
|
|
429
|
-
let t = await a(s, `${
|
|
428
|
+
async function xt(e) {
|
|
429
|
+
let t = await a(s, `${j}/${encodeURIComponent(e)}`);
|
|
430
430
|
return t?.data ?? t;
|
|
431
431
|
}
|
|
432
|
-
async function
|
|
433
|
-
let t = e?.integrationKey, n = t ? `${
|
|
432
|
+
async function St(e) {
|
|
433
|
+
let t = e?.integrationKey, n = t ? `${j}/${encodeURIComponent(t)}` : j;
|
|
434
434
|
return a(s, n, {
|
|
435
435
|
method: t ? "PUT" : "POST",
|
|
436
436
|
headers: { "Content-Type": "application/json" },
|
|
437
437
|
body: JSON.stringify(e)
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
async function St(e) {
|
|
441
|
-
return a(s, `${M}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
442
|
-
}
|
|
443
440
|
async function Ct(e) {
|
|
444
|
-
|
|
441
|
+
return a(s, `${j}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
442
|
+
}
|
|
443
|
+
async function wt(e) {
|
|
444
|
+
let t = await a(s, `${j}/test`, {
|
|
445
445
|
method: "POST",
|
|
446
446
|
headers: { "Content-Type": "application/json" },
|
|
447
447
|
body: JSON.stringify(e)
|
|
448
448
|
});
|
|
449
449
|
return t?.data ?? t;
|
|
450
450
|
}
|
|
451
|
-
async function
|
|
451
|
+
async function Tt(e) {
|
|
452
452
|
let t = await a(s, `/integration-config/${encodeURIComponent(e)}/summary`);
|
|
453
453
|
return t?.data ?? t;
|
|
454
454
|
}
|
|
455
|
-
async function
|
|
455
|
+
async function Et(e, t, n) {
|
|
456
456
|
let r = await a(s, `/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(t)}`, {
|
|
457
457
|
method: "POST",
|
|
458
458
|
headers: { "Content-Type": "application/json" },
|
|
@@ -460,7 +460,7 @@ async function Tt(e, t, n) {
|
|
|
460
460
|
});
|
|
461
461
|
return r?.data ?? r;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Dt(e) {
|
|
464
464
|
return {
|
|
465
465
|
key: e.role_id ?? e.id,
|
|
466
466
|
roleId: e.role_id ?? e.id,
|
|
@@ -471,11 +471,11 @@ function Et(e) {
|
|
|
471
471
|
raw: e
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function M(e) {
|
|
475
475
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
476
476
|
}
|
|
477
477
|
async function Ot() {
|
|
478
|
-
let e = await a(s, "/get-roles"), t = e.data ?? e, n =
|
|
478
|
+
let e = await a(s, "/get-roles"), t = e.data ?? e, n = k(t?.zinnext_default).map(Dt), r = k(t?.custom_roles).map(Dt), i = [...n, ...r];
|
|
479
479
|
return {
|
|
480
480
|
roles: i,
|
|
481
481
|
total: i.length
|
|
@@ -489,8 +489,8 @@ function kt(e) {
|
|
|
489
489
|
manager: e.reportingManager ?? "N/A",
|
|
490
490
|
managerId: e.reportingManagerId ?? 0,
|
|
491
491
|
memberCount: e.noOfTeamMembers ?? 0,
|
|
492
|
-
members:
|
|
493
|
-
memberIds:
|
|
492
|
+
members: k(e.teamMembers),
|
|
493
|
+
memberIds: k(e.teamMembersIds),
|
|
494
494
|
raw: e
|
|
495
495
|
};
|
|
496
496
|
}
|
|
@@ -503,7 +503,7 @@ async function jt({ offset: e = 0, limit: t = 10, sortBy: n = "new", search: r =
|
|
|
503
503
|
sortBy: n,
|
|
504
504
|
limit: String(t),
|
|
505
505
|
offset: String(e)
|
|
506
|
-
}), o = await a(s, `/get-teams?${i}`), c = o.data ?? o, l =
|
|
506
|
+
}), o = await a(s, `/get-teams?${i}`), c = o.data ?? o, l = k(c?.teams, c, o?.teams), u = c?.totalCount ?? c?.total ?? l.length;
|
|
507
507
|
return {
|
|
508
508
|
teams: l.map(kt),
|
|
509
509
|
total: u
|
|
@@ -529,28 +529,28 @@ async function Nt(e, t, n, r = "listView", i = !1) {
|
|
|
529
529
|
configType: r
|
|
530
530
|
});
|
|
531
531
|
i && (!r || r === "listView") && o.set("includeMeta", "1");
|
|
532
|
-
let c = await a(s, `${
|
|
532
|
+
let c = await a(s, `${je}?${o}`), l = c.data ?? c, u = k(l, l?.visibleFields, c?.visibleFields);
|
|
533
533
|
return i ? {
|
|
534
534
|
fields: u,
|
|
535
535
|
dataVisibilityMode: l?.dataVisibilityMode ?? c?.dataVisibilityMode ?? "all",
|
|
536
536
|
dataOwnerField: l?.dataOwnerField ?? c?.dataOwnerField ?? "createdBy"
|
|
537
537
|
} : u;
|
|
538
538
|
}
|
|
539
|
-
async function Pt(e, t = "listView", n =
|
|
540
|
-
let r =
|
|
541
|
-
...
|
|
539
|
+
async function Pt(e, t = "listView", n = O) {
|
|
540
|
+
let r = M(e), i = Fe(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await Nt(n, "roleId", r, t)).map((t, i) => ({
|
|
541
|
+
...Ne(t, i),
|
|
542
542
|
module: e,
|
|
543
543
|
apiModule: n,
|
|
544
544
|
roleId: r
|
|
545
545
|
}))]));
|
|
546
546
|
return Object.fromEntries(a);
|
|
547
547
|
}
|
|
548
|
-
async function Ft(e, t = "listView", n =
|
|
549
|
-
let r =
|
|
548
|
+
async function Ft(e, t = "listView", n = O) {
|
|
549
|
+
let r = M(e), i = Fe(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => {
|
|
550
550
|
let i = await Nt(n, "roleId", r, t, !0);
|
|
551
551
|
return [e, {
|
|
552
552
|
fields: i.fields.map((t, i) => ({
|
|
553
|
-
...
|
|
553
|
+
...Ne(t, i),
|
|
554
554
|
module: e,
|
|
555
555
|
apiModule: n,
|
|
556
556
|
roleId: r
|
|
@@ -562,8 +562,8 @@ async function Ft(e, t = "listView", n = k) {
|
|
|
562
562
|
return Object.fromEntries(a);
|
|
563
563
|
}
|
|
564
564
|
async function It(e, t = "listView") {
|
|
565
|
-
let n = At(e), r = await Promise.all(
|
|
566
|
-
...
|
|
565
|
+
let n = At(e), r = await Promise.all(O.map(async ({ key: e, apiModule: r }) => [e, (await Nt(r, "teamId", n, t)).map((t, i) => ({
|
|
566
|
+
...Ne(t, i),
|
|
567
567
|
module: e,
|
|
568
568
|
apiModule: r,
|
|
569
569
|
teamId: n
|
|
@@ -623,9 +623,9 @@ function Rt(e, t) {
|
|
|
623
623
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
|
-
async function zt(e, t, n, r = "listView", i =
|
|
627
|
-
let u =
|
|
628
|
-
return a(s, `${
|
|
626
|
+
async function zt(e, t, n, r = "listView", i = O, o = "", c = "createdBy", l = !1) {
|
|
627
|
+
let u = M(e), d = Fe(i).find((e) => e.key === t)?.apiModule ?? t;
|
|
628
|
+
return a(s, `${je}/role`, {
|
|
629
629
|
method: "PUT",
|
|
630
630
|
body: JSON.stringify({
|
|
631
631
|
module: d,
|
|
@@ -645,7 +645,7 @@ function Vt(e) {
|
|
|
645
645
|
return `__group__:${e}`;
|
|
646
646
|
}
|
|
647
647
|
async function Ht(e, t, n = {}) {
|
|
648
|
-
let r =
|
|
648
|
+
let r = M(e), i = new URLSearchParams({
|
|
649
649
|
module: t,
|
|
650
650
|
roleId: String(r ?? "")
|
|
651
651
|
});
|
|
@@ -654,7 +654,7 @@ async function Ht(e, t, n = {}) {
|
|
|
654
654
|
return Array.isArray(c) ? c : [];
|
|
655
655
|
}
|
|
656
656
|
async function Ut(e, t, n) {
|
|
657
|
-
let r =
|
|
657
|
+
let r = M(e), i = [], o = 0;
|
|
658
658
|
for (let e of n) {
|
|
659
659
|
e.locked || i.push({
|
|
660
660
|
label: e.label,
|
|
@@ -671,7 +671,7 @@ async function Ut(e, t, n) {
|
|
|
671
671
|
order: o++
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
-
return a(s, `${
|
|
674
|
+
return a(s, `${je}/role`, {
|
|
675
675
|
method: "PUT",
|
|
676
676
|
body: JSON.stringify({
|
|
677
677
|
module: t,
|
|
@@ -682,8 +682,8 @@ async function Ut(e, t, n) {
|
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
684
|
async function Wt(e, t, n, r = "listView") {
|
|
685
|
-
let i = At(e), o =
|
|
686
|
-
return a(s, `${
|
|
685
|
+
let i = At(e), o = O.find((e) => e.key === t)?.apiModule ?? t;
|
|
686
|
+
return a(s, `${je}/team`, {
|
|
687
687
|
method: "PUT",
|
|
688
688
|
body: JSON.stringify({
|
|
689
689
|
module: o,
|
|
@@ -700,24 +700,24 @@ async function Gt({ offset: e = 0, limit: t = 10, sortBy: n = "new", searchQuery
|
|
|
700
700
|
sortBy: n
|
|
701
701
|
});
|
|
702
702
|
r && i.set("searchquery", r);
|
|
703
|
-
let o = await a(s, `/get-all-users?${i}`), c = o.data ?? o, l =
|
|
703
|
+
let o = await a(s, `/get-all-users?${i}`), c = o.data ?? o, l = k(c, o.users, o.rows, o.items, o.records, c?.users, c?.data, c?.rows, c?.items, c?.records, c?.docs, c?.result, c?.results);
|
|
704
704
|
return {
|
|
705
705
|
users: l,
|
|
706
|
-
total:
|
|
706
|
+
total: Me({
|
|
707
707
|
...o,
|
|
708
708
|
...c
|
|
709
709
|
}, l)
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
async function Kt(e = []) {
|
|
713
|
-
return a(s, `${
|
|
713
|
+
return a(s, `${je}/seed`, {
|
|
714
714
|
method: "POST",
|
|
715
715
|
headers: { "Content-Type": "application/json" },
|
|
716
716
|
body: JSON.stringify({ collections: e })
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
719
|
async function qt() {
|
|
720
|
-
let e = await a(s, `${
|
|
720
|
+
let e = await a(s, `${je}/seed-status`), t = e?.data ?? e ?? {};
|
|
721
721
|
return {
|
|
722
722
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
723
723
|
seededModules: t.seededModules ?? {}
|
|
@@ -740,7 +740,7 @@ async function Jt(e) {
|
|
|
740
740
|
}
|
|
741
741
|
async function Yt() {
|
|
742
742
|
let [e, t, n] = await Promise.all([
|
|
743
|
-
|
|
743
|
+
Ue().catch(() => []),
|
|
744
744
|
cn().catch(() => []),
|
|
745
745
|
An().catch(() => [])
|
|
746
746
|
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
@@ -876,7 +876,7 @@ async function un(e, t) {
|
|
|
876
876
|
}
|
|
877
877
|
async function dn() {
|
|
878
878
|
let e = await a(s, "/admin/menu-modules");
|
|
879
|
-
return
|
|
879
|
+
return k(e.data, e);
|
|
880
880
|
}
|
|
881
881
|
async function fn({ menuName: e, apiUrl: t = "", menuType: n = "menu", parentMenuId: r = 0, displayOrder: i = 0 }) {
|
|
882
882
|
let o = await a(s, "/admin/menu-modules", {
|
|
@@ -904,7 +904,7 @@ async function mn(e) {
|
|
|
904
904
|
}
|
|
905
905
|
async function hn() {
|
|
906
906
|
let e = await a(s, "/admin/menu-actions");
|
|
907
|
-
return
|
|
907
|
+
return k(e.data, e);
|
|
908
908
|
}
|
|
909
909
|
async function gn({ permissionName: e, permissionKey: t }) {
|
|
910
910
|
let n = await a(s, "/admin/menu-actions", {
|
|
@@ -1198,7 +1198,7 @@ function tr(e) {
|
|
|
1198
1198
|
return i ? t[i] : void 0;
|
|
1199
1199
|
}
|
|
1200
1200
|
function nr(e = !1) {
|
|
1201
|
-
return Gn && !e || (Gn = Promise.resolve().then(() =>
|
|
1201
|
+
return Gn && !e || (Gn = Promise.resolve().then(() => lt()).then((e) => Qn(e)).catch(() => N)), Gn;
|
|
1202
1202
|
}
|
|
1203
1203
|
E.extend(ve), E.extend(ye);
|
|
1204
1204
|
var rr = null;
|
|
@@ -1813,8 +1813,40 @@ function Rr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1813
1813
|
});
|
|
1814
1814
|
}
|
|
1815
1815
|
//#endregion
|
|
1816
|
+
//#region src/components/form/optionsApi.js
|
|
1817
|
+
var zr = /\{([A-Za-z0-9_.]+)\}/g, Br = (e) => e == null || e === "" || e === "_";
|
|
1818
|
+
function Vr(e) {
|
|
1819
|
+
return !!(e && typeof e.path == "string" && e.path.trim());
|
|
1820
|
+
}
|
|
1821
|
+
function Hr(e, t, n = {}) {
|
|
1822
|
+
if (!Vr(e)) return null;
|
|
1823
|
+
let r = n[String(e.service || "core").toLowerCase()];
|
|
1824
|
+
if (!r) return null;
|
|
1825
|
+
let i = !1, a = e.path.trim().replace(zr, (e, n) => {
|
|
1826
|
+
let r = typeof t == "function" ? t(n) : void 0;
|
|
1827
|
+
return Br(r) ? (i = !0, "") : encodeURIComponent(String(r));
|
|
1828
|
+
});
|
|
1829
|
+
return i ? null : {
|
|
1830
|
+
base: r,
|
|
1831
|
+
path: a.startsWith("/") ? a : `/${a}`
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
function Ur(e, t) {
|
|
1835
|
+
let n = e && typeof e == "object" && "data" in e ? e.data : e;
|
|
1836
|
+
return String(t || "").split(".").filter(Boolean).forEach((e) => {
|
|
1837
|
+
n = n == null ? n : n[e];
|
|
1838
|
+
}), Array.isArray(n) ? n : [];
|
|
1839
|
+
}
|
|
1840
|
+
function Wr({ routeParams: e = {}, searchParams: t, getFormValue: n } = {}) {
|
|
1841
|
+
return (r) => {
|
|
1842
|
+
if (!Br(e[r])) return e[r];
|
|
1843
|
+
let i = t?.get ? t.get(r) : void 0;
|
|
1844
|
+
return Br(i) ? typeof n == "function" ? n(r) : void 0 : i;
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
//#endregion
|
|
1816
1848
|
//#region src/utils/modulePath.js
|
|
1817
|
-
function
|
|
1849
|
+
function Gr(e) {
|
|
1818
1850
|
let t = String(e ?? "").trim();
|
|
1819
1851
|
if (!t) return {
|
|
1820
1852
|
baseModule: "",
|
|
@@ -1826,35 +1858,35 @@ function zr(e) {
|
|
|
1826
1858
|
nestedPath: r.map((e) => e.trim()).filter(Boolean).join(".")
|
|
1827
1859
|
};
|
|
1828
1860
|
}
|
|
1829
|
-
function
|
|
1830
|
-
return
|
|
1861
|
+
function Kr(e) {
|
|
1862
|
+
return Gr(e).baseModule;
|
|
1831
1863
|
}
|
|
1832
1864
|
//#endregion
|
|
1833
1865
|
//#region src/services/moduleDataApi.js
|
|
1834
|
-
var
|
|
1835
|
-
function
|
|
1866
|
+
var qr = "test-flows", Jr = "lms-flows";
|
|
1867
|
+
function Yr(e) {
|
|
1836
1868
|
let t = (Array.isArray(e) ? e : [e]).flat().map((e) => e && typeof e == "object" ? e.value ?? e.label ?? e.name ?? "" : e).map((e) => String(e ?? "").trim().toLowerCase()).filter(Boolean);
|
|
1837
1869
|
return t.includes("dice") ? "dice" : t.includes("internal") ? "internal" : t[0] || "";
|
|
1838
1870
|
}
|
|
1839
|
-
function
|
|
1871
|
+
function Xr(...e) {
|
|
1840
1872
|
for (let t of e) {
|
|
1841
1873
|
let e = Number(t);
|
|
1842
1874
|
if (Number.isFinite(e)) return e;
|
|
1843
1875
|
}
|
|
1844
1876
|
}
|
|
1845
|
-
function
|
|
1877
|
+
function Zr(e, t, n, r = "") {
|
|
1846
1878
|
let i = e?.count, a = t?.count, o = String(r ?? "").trim().toLowerCase();
|
|
1847
1879
|
if (i && typeof i == "object") {
|
|
1848
|
-
let e =
|
|
1880
|
+
let e = Xr(o ? i[o] : void 0, i.total, i.searchCount, i.count);
|
|
1849
1881
|
if (e !== void 0) return e;
|
|
1850
1882
|
}
|
|
1851
1883
|
if (a && typeof a == "object") {
|
|
1852
|
-
let e =
|
|
1884
|
+
let e = Xr(o ? a[o] : void 0, a.total, a.searchCount, a.count);
|
|
1853
1885
|
if (e !== void 0) return e;
|
|
1854
1886
|
}
|
|
1855
|
-
return
|
|
1887
|
+
return Xr(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, t?.total, typeof a == "object" ? void 0 : a, t?.totalCount, n.length) ?? 0;
|
|
1856
1888
|
}
|
|
1857
|
-
function
|
|
1889
|
+
function Qr(e, t) {
|
|
1858
1890
|
let n = {};
|
|
1859
1891
|
return [e?.count, t?.count].forEach((e) => {
|
|
1860
1892
|
!e || typeof e != "object" || Object.entries(e).forEach(([e, t]) => {
|
|
@@ -1863,9 +1895,9 @@ function Kr(e, t) {
|
|
|
1863
1895
|
});
|
|
1864
1896
|
}), n;
|
|
1865
1897
|
}
|
|
1866
|
-
async function
|
|
1898
|
+
async function $r(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
1867
1899
|
let c = new URLSearchParams({
|
|
1868
|
-
module:
|
|
1900
|
+
module: Kr(e),
|
|
1869
1901
|
field: t,
|
|
1870
1902
|
value: n,
|
|
1871
1903
|
limit: String(r),
|
|
@@ -1873,9 +1905,9 @@ async function qr(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
|
1873
1905
|
});
|
|
1874
1906
|
return a.dataSource && c.set("dataSource", a.dataSource), a.masterName && c.set("masterName", a.masterName), a.groupName && c.set("groupName", a.groupName), a.scope && c.set("scope", a.scope), a.arrayLabelField && c.set("arrayLabelField", a.arrayLabelField), a.arrayValueField && c.set("arrayValueField", a.arrayValueField), o(s, `/filter-dropdown-values?${c}`);
|
|
1875
1907
|
}
|
|
1876
|
-
async function
|
|
1908
|
+
async function ei(e, t = 10, n = 0, r = {}) {
|
|
1877
1909
|
let { scope: i = "", sort: o = "", sortDir: c = "", filters: l = [] } = r;
|
|
1878
|
-
if (e ===
|
|
1910
|
+
if (e === qr) {
|
|
1879
1911
|
let { getTestFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1880
1912
|
limit: t,
|
|
1881
1913
|
offset: n
|
|
@@ -1892,7 +1924,7 @@ async function Jr(e, t = 10, n = 0, r = {}) {
|
|
|
1892
1924
|
}]
|
|
1893
1925
|
};
|
|
1894
1926
|
}
|
|
1895
|
-
if (e ===
|
|
1927
|
+
if (e === Jr) {
|
|
1896
1928
|
let { getLmsFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1897
1929
|
limit: t,
|
|
1898
1930
|
offset: n
|
|
@@ -1910,13 +1942,13 @@ async function Jr(e, t = 10, n = 0, r = {}) {
|
|
|
1910
1942
|
};
|
|
1911
1943
|
}
|
|
1912
1944
|
let u = new URLSearchParams({
|
|
1913
|
-
module:
|
|
1945
|
+
module: Kr(e),
|
|
1914
1946
|
limit: String(t),
|
|
1915
1947
|
offset: String(n)
|
|
1916
1948
|
}), d = String(i ?? "").trim();
|
|
1917
1949
|
return d && u.set("scope", d), o && u.set("sort", o), c && u.set("sortDir", c), Array.isArray(l) && l.some((e) => e?.field) && u.set("filters", JSON.stringify(l)), a(s, `/module-data-list?${u.toString()}`);
|
|
1918
1950
|
}
|
|
1919
|
-
async function
|
|
1951
|
+
async function ti(e, t) {
|
|
1920
1952
|
if (!e || !t) return null;
|
|
1921
1953
|
try {
|
|
1922
1954
|
let n = await a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`), r = n?.data?.data ?? n?.data ?? n, i = Array.isArray(r) ? r[0] : r;
|
|
@@ -1925,14 +1957,14 @@ async function Yr(e, t) {
|
|
|
1925
1957
|
return null;
|
|
1926
1958
|
}
|
|
1927
1959
|
}
|
|
1928
|
-
async function
|
|
1929
|
-
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f =
|
|
1930
|
-
p.append("module",
|
|
1960
|
+
async function ni(e, t = {}, n = {}, r = {}) {
|
|
1961
|
+
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f = Yr(u || String(t.selectedSource ?? "").split(",")), p = new URLSearchParams();
|
|
1962
|
+
p.append("module", Kr(e)), p.append("limit", String(i)), p.append("offset", String(o)), f && (p.set("scope", f), console.log("[searchModuleData] Adding scope to query:", f)), c && p.set("sort", c), l && p.set("sortDir", l), Array.isArray(d) && d.some((e) => e?.field) && p.set("filters", JSON.stringify(d)), console.log("[searchModuleData] Final query string:", p.toString()), Object.entries(t).forEach(([e, t]) => {
|
|
1931
1963
|
if (t == null || t === "") return;
|
|
1932
1964
|
let n = t;
|
|
1933
1965
|
n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), p.append(e, n);
|
|
1934
1966
|
});
|
|
1935
|
-
let m = await a(s, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ =
|
|
1967
|
+
let m = await a(s, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ = Zr(m, h, g, f), v = Qr(m, h);
|
|
1936
1968
|
f && v[f] === void 0 && Number.isFinite(_) && (v[f] = _);
|
|
1937
1969
|
let ee = g.some((e) => [
|
|
1938
1970
|
e?.sourceType,
|
|
@@ -1945,9 +1977,9 @@ async function Xr(e, t = {}, n = {}, r = {}) {
|
|
|
1945
1977
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
1946
1978
|
y = e(m, m)?.data?.data ?? g;
|
|
1947
1979
|
} catch (e) {
|
|
1948
|
-
console.error("[searchModuleData] Dice transformation failed:", e), y = g.map(
|
|
1980
|
+
console.error("[searchModuleData] Dice transformation failed:", e), y = g.map(ai);
|
|
1949
1981
|
}
|
|
1950
|
-
else y = Array.isArray(g) ? g.map(
|
|
1982
|
+
else y = Array.isArray(g) ? g.map(ai) : [];
|
|
1951
1983
|
return {
|
|
1952
1984
|
rows: y,
|
|
1953
1985
|
total: Number(_) || 0,
|
|
@@ -1960,10 +1992,10 @@ async function Xr(e, t = {}, n = {}, r = {}) {
|
|
|
1960
1992
|
columnActions: h?.columnActions ?? []
|
|
1961
1993
|
};
|
|
1962
1994
|
}
|
|
1963
|
-
function
|
|
1995
|
+
function ri(e, t) {
|
|
1964
1996
|
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
1965
1997
|
}
|
|
1966
|
-
function
|
|
1998
|
+
function ii(e, t, n) {
|
|
1967
1999
|
let r = String(t).split(".").filter(Boolean);
|
|
1968
2000
|
if (!r.length) return e;
|
|
1969
2001
|
let i = { ...e }, a = i, o = e;
|
|
@@ -1972,7 +2004,7 @@ function Qr(e, t, n) {
|
|
|
1972
2004
|
a[e] = n, a = n, o = t;
|
|
1973
2005
|
}), a[r[r.length - 1]] = n, i;
|
|
1974
2006
|
}
|
|
1975
|
-
function
|
|
2007
|
+
function ai(e) {
|
|
1976
2008
|
if (!e || typeof e != "object") return e;
|
|
1977
2009
|
let t = [
|
|
1978
2010
|
"skills",
|
|
@@ -1982,11 +2014,11 @@ function $r(e) {
|
|
|
1982
2014
|
"customFields.diceProfileData.skills"
|
|
1983
2015
|
], n = e, r = null;
|
|
1984
2016
|
if (t.forEach((e) => {
|
|
1985
|
-
let t =
|
|
2017
|
+
let t = ri(n, e);
|
|
1986
2018
|
if (t == null) return;
|
|
1987
2019
|
let i = c(t);
|
|
1988
|
-
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n =
|
|
1989
|
-
}), r &&
|
|
2020
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = ii(n, e, i));
|
|
2021
|
+
}), r && ri(n, "skills") === void 0 && (n = ii(n, "skills", r)), [
|
|
1990
2022
|
n?.sourceType,
|
|
1991
2023
|
n?.profileSource,
|
|
1992
2024
|
n?.selectedSource,
|
|
@@ -2005,10 +2037,10 @@ function $r(e) {
|
|
|
2005
2037
|
}
|
|
2006
2038
|
//#endregion
|
|
2007
2039
|
//#region src/services/documentApi.js
|
|
2008
|
-
function
|
|
2040
|
+
function oi(e) {
|
|
2009
2041
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
2010
2042
|
}
|
|
2011
|
-
async function
|
|
2043
|
+
async function si(e, t, n = [], i = {}) {
|
|
2012
2044
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
2013
2045
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
2014
2046
|
if (!n.length) return {
|
|
@@ -2018,7 +2050,7 @@ async function ti(e, t, n = [], i = {}) {
|
|
|
2018
2050
|
let a = await r(), o = new FormData();
|
|
2019
2051
|
n.forEach(({ formKey: e, file: t }) => {
|
|
2020
2052
|
let n = t?.name ?? void 0;
|
|
2021
|
-
o.append(
|
|
2053
|
+
o.append(oi(e), t, n);
|
|
2022
2054
|
}), i && Object.keys(i).length > 0 && o.append("metadata", JSON.stringify(i));
|
|
2023
2055
|
let c = new URLSearchParams({
|
|
2024
2056
|
module: e,
|
|
@@ -2034,7 +2066,7 @@ async function ti(e, t, n = [], i = {}) {
|
|
|
2034
2066
|
}
|
|
2035
2067
|
return u?.data ?? u;
|
|
2036
2068
|
}
|
|
2037
|
-
async function
|
|
2069
|
+
async function ci(e, t, n = "") {
|
|
2038
2070
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
2039
2071
|
if (!t) throw Error("refId is required to fetch documents");
|
|
2040
2072
|
let r = new URLSearchParams({
|
|
@@ -2048,7 +2080,7 @@ async function ni(e, t, n = "") {
|
|
|
2048
2080
|
total: o?.total ?? 0
|
|
2049
2081
|
};
|
|
2050
2082
|
}
|
|
2051
|
-
async function
|
|
2083
|
+
async function li(e) {
|
|
2052
2084
|
if (!e) return !1;
|
|
2053
2085
|
try {
|
|
2054
2086
|
return await a(s, `/documents/${encodeURIComponent(String(e))}`, { method: "DELETE" }), !0;
|
|
@@ -2058,36 +2090,36 @@ async function ri(e) {
|
|
|
2058
2090
|
}
|
|
2059
2091
|
//#endregion
|
|
2060
2092
|
//#region src/services/detailedViewApi.js
|
|
2061
|
-
var
|
|
2093
|
+
var ui = {
|
|
2062
2094
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2063
2095
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2064
2096
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2065
2097
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2066
2098
|
};
|
|
2067
|
-
async function
|
|
2099
|
+
async function di(e, t) {
|
|
2068
2100
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2069
2101
|
if (n === "job" || n === "jobs") {
|
|
2070
2102
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2071
2103
|
return e(t);
|
|
2072
2104
|
}
|
|
2073
|
-
if (n === "candidate" || n === "candidates") return
|
|
2105
|
+
if (n === "candidate" || n === "candidates") return pi(n === "candidate" ? "candidate" : "candidates", t);
|
|
2074
2106
|
let r = new URLSearchParams({
|
|
2075
2107
|
module: String(e ?? ""),
|
|
2076
2108
|
id: String(t)
|
|
2077
2109
|
});
|
|
2078
2110
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2079
2111
|
}
|
|
2080
|
-
async function
|
|
2112
|
+
async function fi(e) {
|
|
2081
2113
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2082
2114
|
return {
|
|
2083
2115
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2084
2116
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2085
2117
|
};
|
|
2086
2118
|
}
|
|
2087
|
-
async function
|
|
2119
|
+
async function pi(e, t) {
|
|
2088
2120
|
if (!e) throw Error("module is required");
|
|
2089
2121
|
if (!t) throw Error("id is required");
|
|
2090
|
-
let n =
|
|
2122
|
+
let n = ui[e];
|
|
2091
2123
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2092
2124
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2093
2125
|
method: "GET",
|
|
@@ -2100,7 +2132,7 @@ async function si(e, t) {
|
|
|
2100
2132
|
let o = await a.json();
|
|
2101
2133
|
return o.data ?? o;
|
|
2102
2134
|
}
|
|
2103
|
-
async function
|
|
2135
|
+
async function mi(e, t, n, i = []) {
|
|
2104
2136
|
if (!e) throw Error("module is required");
|
|
2105
2137
|
if (!t) throw Error("id is required");
|
|
2106
2138
|
let a = await r(), o = new FormData();
|
|
@@ -2113,15 +2145,15 @@ async function ci(e, t, n, i = []) {
|
|
|
2113
2145
|
if (!c.ok) {
|
|
2114
2146
|
let e = await c.text();
|
|
2115
2147
|
console.error("[updateRecord] Error response:", e);
|
|
2116
|
-
let t = Error(
|
|
2117
|
-
throw t.status = c.status, t.response =
|
|
2148
|
+
let t = Error(gi(e) || `API ${c.status}: ${c.statusText}`);
|
|
2149
|
+
throw t.status = c.status, t.response = hi(e), t;
|
|
2118
2150
|
}
|
|
2119
2151
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2120
2152
|
l();
|
|
2121
2153
|
let u = await c.json();
|
|
2122
2154
|
return u.data ?? u;
|
|
2123
2155
|
}
|
|
2124
|
-
function
|
|
2156
|
+
function hi(e) {
|
|
2125
2157
|
let t = String(e ?? "").trim();
|
|
2126
2158
|
if (!t.startsWith("{")) return null;
|
|
2127
2159
|
try {
|
|
@@ -2130,7 +2162,7 @@ function li(e) {
|
|
|
2130
2162
|
return null;
|
|
2131
2163
|
}
|
|
2132
2164
|
}
|
|
2133
|
-
function
|
|
2165
|
+
function gi(e) {
|
|
2134
2166
|
let t = String(e ?? "").trim();
|
|
2135
2167
|
if (!t.startsWith("{")) return t;
|
|
2136
2168
|
try {
|
|
@@ -2140,22 +2172,22 @@ function ui(e) {
|
|
|
2140
2172
|
return t;
|
|
2141
2173
|
}
|
|
2142
2174
|
}
|
|
2143
|
-
var
|
|
2144
|
-
async function
|
|
2175
|
+
var _i = (e) => e?.data ?? e;
|
|
2176
|
+
async function vi(e, t) {
|
|
2145
2177
|
if (!e || !t) return [];
|
|
2146
2178
|
let n = new URLSearchParams({
|
|
2147
2179
|
module: e,
|
|
2148
2180
|
id: String(t)
|
|
2149
|
-
}), r =
|
|
2181
|
+
}), r = _i(await a(s, `/module-activity?${n.toString()}`));
|
|
2150
2182
|
return Array.isArray(r) ? r : [];
|
|
2151
2183
|
}
|
|
2152
|
-
async function
|
|
2184
|
+
async function yi(e) {
|
|
2153
2185
|
if (!e) return [];
|
|
2154
|
-
let t =
|
|
2186
|
+
let t = _i(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2155
2187
|
return Array.isArray(t) ? t : [];
|
|
2156
2188
|
}
|
|
2157
|
-
async function
|
|
2158
|
-
return
|
|
2189
|
+
async function bi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2190
|
+
return _i(await a(s, "/notes", {
|
|
2159
2191
|
method: "POST",
|
|
2160
2192
|
body: JSON.stringify({
|
|
2161
2193
|
relatedId: e,
|
|
@@ -2167,29 +2199,29 @@ async function mi({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2167
2199
|
}
|
|
2168
2200
|
//#endregion
|
|
2169
2201
|
//#region src/components/form/formDateInputFormat.js
|
|
2170
|
-
var
|
|
2171
|
-
function
|
|
2202
|
+
var xi = d(void 0);
|
|
2203
|
+
function Si(e, t) {
|
|
2172
2204
|
return (typeof e == "string" ? e.trim() : "") || tr(t) || er();
|
|
2173
2205
|
}
|
|
2174
|
-
function
|
|
2175
|
-
let e = m(
|
|
2176
|
-
return
|
|
2206
|
+
function Ci() {
|
|
2207
|
+
let e = m(xi);
|
|
2208
|
+
return Si(e?.override, e?.moduleName);
|
|
2177
2209
|
}
|
|
2178
2210
|
//#endregion
|
|
2179
2211
|
//#region src/utils/roleFormPermissionGate.js
|
|
2180
|
-
function
|
|
2212
|
+
function wi(e, t) {
|
|
2181
2213
|
if (!e) return !0;
|
|
2182
2214
|
let n = e.find((e) => e.name === t);
|
|
2183
2215
|
return !n || n.enabled !== !1;
|
|
2184
2216
|
}
|
|
2185
|
-
function
|
|
2217
|
+
function Ti(e, t, n) {
|
|
2186
2218
|
if (!e) return !0;
|
|
2187
2219
|
let r = e.find((e) => e.name === t);
|
|
2188
2220
|
if (!r) return !0;
|
|
2189
2221
|
let i = r.fields?.find((e) => e.field === n);
|
|
2190
2222
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2191
2223
|
}
|
|
2192
|
-
function
|
|
2224
|
+
function Ei(e, t, n) {
|
|
2193
2225
|
if (!e) return !0;
|
|
2194
2226
|
let r = e.find((e) => e.name === t);
|
|
2195
2227
|
if (!r) return !0;
|
|
@@ -2199,7 +2231,7 @@ function bi(e, t, n) {
|
|
|
2199
2231
|
}
|
|
2200
2232
|
//#endregion
|
|
2201
2233
|
//#region src/components/form/inputSecurity.js
|
|
2202
|
-
var
|
|
2234
|
+
var Di = [
|
|
2203
2235
|
"p",
|
|
2204
2236
|
"br",
|
|
2205
2237
|
"strong",
|
|
@@ -2221,12 +2253,12 @@ var xi = [
|
|
|
2221
2253
|
"a",
|
|
2222
2254
|
"code",
|
|
2223
2255
|
"pre"
|
|
2224
|
-
],
|
|
2256
|
+
], Oi = [
|
|
2225
2257
|
"href",
|
|
2226
2258
|
"title",
|
|
2227
2259
|
"target",
|
|
2228
2260
|
"rel"
|
|
2229
|
-
],
|
|
2261
|
+
], ki = /[\u200B-\u200D\u2060\uFEFF]/g, Ai = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, ji = /^[\p{L}\p{M}\p{N} .'-]+$/u, Mi = /^\+?[0-9 ()-]+$/, Ni = /^-?(?:\d+|\d*\.\d+)$/, Pi = [
|
|
2230
2262
|
{
|
|
2231
2263
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2232
2264
|
message: "HTML/script content is not allowed"
|
|
@@ -2253,12 +2285,12 @@ var xi = [
|
|
|
2253
2285
|
plainOnly: !0
|
|
2254
2286
|
}
|
|
2255
2287
|
];
|
|
2256
|
-
function
|
|
2288
|
+
function Fi(e) {
|
|
2257
2289
|
if (typeof document > "u") return e;
|
|
2258
2290
|
let t = document.createElement("textarea");
|
|
2259
2291
|
return t.innerHTML = e, t.value;
|
|
2260
2292
|
}
|
|
2261
|
-
function
|
|
2293
|
+
function Ii(e) {
|
|
2262
2294
|
let t = String(e ?? "");
|
|
2263
2295
|
for (let e = 0; e < 2; e += 1) try {
|
|
2264
2296
|
let e = decodeURIComponent(t);
|
|
@@ -2267,12 +2299,12 @@ function Ai(e) {
|
|
|
2267
2299
|
} catch {
|
|
2268
2300
|
break;
|
|
2269
2301
|
}
|
|
2270
|
-
return t =
|
|
2302
|
+
return t = Fi(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2271
2303
|
}
|
|
2272
|
-
function
|
|
2304
|
+
function Li(e) {
|
|
2273
2305
|
return Ae.sanitize(String(e ?? ""), {
|
|
2274
|
-
ALLOWED_TAGS:
|
|
2275
|
-
ALLOWED_ATTR:
|
|
2306
|
+
ALLOWED_TAGS: Di,
|
|
2307
|
+
ALLOWED_ATTR: Oi,
|
|
2276
2308
|
ALLOW_DATA_ATTR: !1,
|
|
2277
2309
|
FORBID_TAGS: [
|
|
2278
2310
|
"script",
|
|
@@ -2292,35 +2324,35 @@ function ji(e) {
|
|
|
2292
2324
|
]
|
|
2293
2325
|
});
|
|
2294
2326
|
}
|
|
2295
|
-
function
|
|
2327
|
+
function Ri(e) {
|
|
2296
2328
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2297
2329
|
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);
|
|
2298
2330
|
}
|
|
2299
|
-
function
|
|
2331
|
+
function zi(e) {
|
|
2300
2332
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2301
2333
|
}
|
|
2302
|
-
function
|
|
2334
|
+
function Bi(e, t = {}) {
|
|
2303
2335
|
if (typeof e != "string") return e;
|
|
2304
|
-
if (t.type === "text-editor") return
|
|
2305
|
-
let n = e.normalize("NFC").replace(
|
|
2306
|
-
return n =
|
|
2336
|
+
if (t.type === "text-editor") return Li(e.normalize("NFC"));
|
|
2337
|
+
let n = e.normalize("NFC").replace(ki, "").replace(/\u00A0/g, " ").replace(Ai, "");
|
|
2338
|
+
return n = zi(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2307
2339
|
}
|
|
2308
|
-
function
|
|
2340
|
+
function Vi(e, t = {}) {
|
|
2309
2341
|
if (typeof e != "string" || e === "") return null;
|
|
2310
|
-
let n = t.label || t.field || "Field", r =
|
|
2342
|
+
let n = t.label || t.field || "Field", r = Ii(e);
|
|
2311
2343
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2312
|
-
let i = t.type === "text-editor", a =
|
|
2344
|
+
let i = t.type === "text-editor", a = Pi.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2313
2345
|
if (a) return `${n}: ${a.message}`;
|
|
2314
|
-
let o =
|
|
2315
|
-
return [...o].length >
|
|
2346
|
+
let o = Bi(e, t);
|
|
2347
|
+
return [...o].length > Ri(t) ? `${n} is too long` : t.formatter === "name" && o && !ji.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !Mi.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !Ni.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;
|
|
2316
2348
|
}
|
|
2317
|
-
function
|
|
2349
|
+
function Hi(e) {
|
|
2318
2350
|
return { validator: (t, n) => {
|
|
2319
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2351
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Vi(t, e)).find(Boolean);
|
|
2320
2352
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2321
2353
|
} };
|
|
2322
2354
|
}
|
|
2323
|
-
function
|
|
2355
|
+
function Ui(e = []) {
|
|
2324
2356
|
let t = /* @__PURE__ */ new Map();
|
|
2325
2357
|
return e.forEach((e) => {
|
|
2326
2358
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2332,12 +2364,12 @@ function Li(e = []) {
|
|
|
2332
2364
|
});
|
|
2333
2365
|
}), t;
|
|
2334
2366
|
}
|
|
2335
|
-
function
|
|
2336
|
-
let n =
|
|
2367
|
+
function Wi(e, t = []) {
|
|
2368
|
+
let n = Ui(t), r = (e, t = "") => {
|
|
2337
2369
|
if (typeof e == "string") {
|
|
2338
|
-
let r = n.get(t) ?? {}, i =
|
|
2370
|
+
let r = n.get(t) ?? {}, i = Vi(e, r);
|
|
2339
2371
|
if (i) throw Error(i);
|
|
2340
|
-
return
|
|
2372
|
+
return Bi(e, r);
|
|
2341
2373
|
}
|
|
2342
2374
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2343
2375
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2349,23 +2381,23 @@ function Ri(e, t = []) {
|
|
|
2349
2381
|
}
|
|
2350
2382
|
//#endregion
|
|
2351
2383
|
//#region src/components/form/validationOverride.js
|
|
2352
|
-
var
|
|
2353
|
-
function
|
|
2384
|
+
var Gi = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2385
|
+
function Ki(e) {
|
|
2354
2386
|
let t = e?.overrideCheckbox;
|
|
2355
|
-
return !t || typeof t != "object" ? null :
|
|
2387
|
+
return !t || typeof t != "object" ? null : Ji(e).size > 0 ? t : null;
|
|
2356
2388
|
}
|
|
2357
|
-
function
|
|
2389
|
+
function qi(e) {
|
|
2358
2390
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2359
2391
|
}
|
|
2360
|
-
function
|
|
2392
|
+
function Ji(e) {
|
|
2361
2393
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2362
2394
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2363
2395
|
}
|
|
2364
|
-
function
|
|
2396
|
+
function Yi(e) {
|
|
2365
2397
|
return e?.overrideCheckbox?.store !== !1;
|
|
2366
2398
|
}
|
|
2367
|
-
function
|
|
2368
|
-
let r =
|
|
2399
|
+
function Xi(e, t, n) {
|
|
2400
|
+
let r = qi(e);
|
|
2369
2401
|
if (typeof n == "function") {
|
|
2370
2402
|
let e = n(r);
|
|
2371
2403
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2376,27 +2408,27 @@ function Wi(e, t, n) {
|
|
|
2376
2408
|
r
|
|
2377
2409
|
] : [r];
|
|
2378
2410
|
}
|
|
2379
|
-
function
|
|
2411
|
+
function Zi(e, t) {
|
|
2380
2412
|
return (n) => {
|
|
2381
2413
|
let r = !1;
|
|
2382
2414
|
try {
|
|
2383
|
-
r =
|
|
2415
|
+
r = Gi(n?.getFieldValue?.(t));
|
|
2384
2416
|
} catch {
|
|
2385
2417
|
r = !1;
|
|
2386
2418
|
}
|
|
2387
2419
|
return r ? {} : e;
|
|
2388
2420
|
};
|
|
2389
2421
|
}
|
|
2390
|
-
function
|
|
2391
|
-
if (!
|
|
2392
|
-
let i =
|
|
2422
|
+
function Qi(e, t, n, r) {
|
|
2423
|
+
if (!Ki(e)) return r;
|
|
2424
|
+
let i = Ji(e), a = Xi(e, t, n);
|
|
2393
2425
|
return (e) => {
|
|
2394
2426
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2395
|
-
return i.has(n) ?
|
|
2427
|
+
return i.has(n) ? Zi(t, a) : t;
|
|
2396
2428
|
};
|
|
2397
2429
|
}
|
|
2398
|
-
function
|
|
2399
|
-
let t =
|
|
2430
|
+
function $i(e) {
|
|
2431
|
+
let t = Ki(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2400
2432
|
return {
|
|
2401
2433
|
tone: t.tone ?? "overwrite",
|
|
2402
2434
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2407,12 +2439,12 @@ function qi(e) {
|
|
|
2407
2439
|
}
|
|
2408
2440
|
//#endregion
|
|
2409
2441
|
//#region src/components/form/optionMatching.js
|
|
2410
|
-
function
|
|
2442
|
+
function ea(e) {
|
|
2411
2443
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2412
2444
|
}
|
|
2413
|
-
function
|
|
2445
|
+
function ta(e) {
|
|
2414
2446
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2415
|
-
let r =
|
|
2447
|
+
let r = ea(e);
|
|
2416
2448
|
r && !t.has(r) && t.set(r, n);
|
|
2417
2449
|
};
|
|
2418
2450
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2420,40 +2452,40 @@ function Yi(e) {
|
|
|
2420
2452
|
let t = typeof e == "object" ? e.value : e;
|
|
2421
2453
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2422
2454
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2423
|
-
let i = t.get(
|
|
2455
|
+
let i = t.get(ea(r));
|
|
2424
2456
|
i !== void 0 && n(e, i);
|
|
2425
2457
|
}), t;
|
|
2426
2458
|
}
|
|
2427
|
-
var
|
|
2428
|
-
function
|
|
2459
|
+
var na = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2460
|
+
function ra(e, t) {
|
|
2429
2461
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2430
|
-
let n = e.get(
|
|
2462
|
+
let n = e.get(ea(t));
|
|
2431
2463
|
return n === void 0 ? t : n;
|
|
2432
2464
|
}
|
|
2433
|
-
function
|
|
2434
|
-
if (!
|
|
2435
|
-
let n =
|
|
2436
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2465
|
+
function ia(e, t) {
|
|
2466
|
+
if (!na(e)) return t;
|
|
2467
|
+
let n = ta(e);
|
|
2468
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => ra(n, e)) : ra(n, t);
|
|
2437
2469
|
}
|
|
2438
2470
|
//#endregion
|
|
2439
2471
|
//#region src/components/form/mountDefaultValue.js
|
|
2440
|
-
function
|
|
2472
|
+
function aa(e = {}) {
|
|
2441
2473
|
let t = e?.defaultValue;
|
|
2442
2474
|
if (t === void 0 || t === "") return;
|
|
2443
|
-
if (e?.type === "time") return
|
|
2444
|
-
if (e?.type === "date") return
|
|
2475
|
+
if (e?.type === "time") return ca(t);
|
|
2476
|
+
if (e?.type === "date") return da(t);
|
|
2445
2477
|
if (e?.type !== "checkbox") return t;
|
|
2446
2478
|
let n = Array.isArray(e.options) ? e.options : [];
|
|
2447
2479
|
if (!n.length) return t;
|
|
2448
2480
|
let r = n.map((e) => String(e && typeof e == "object" ? e.value : e));
|
|
2449
2481
|
return (Array.isArray(t) ? t : [t]).some((e) => r.includes(String(e))) ? t : void 0;
|
|
2450
2482
|
}
|
|
2451
|
-
var
|
|
2452
|
-
function
|
|
2483
|
+
var oa = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i, sa = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
2484
|
+
function ca(e) {
|
|
2453
2485
|
if (e == null || e === "") return;
|
|
2454
2486
|
if (E.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2455
2487
|
if (typeof e != "string") return;
|
|
2456
|
-
let t = e.trim(), n = t.match(
|
|
2488
|
+
let t = e.trim(), n = t.match(oa);
|
|
2457
2489
|
if (n) {
|
|
2458
2490
|
let e = Number(n[1]), t = Number(n[2]), r = Number(n[3] ?? 0), i = n[4]?.replace(/[.\s]/g, "").toLowerCase();
|
|
2459
2491
|
if (i) {
|
|
@@ -2462,13 +2494,13 @@ function na(e) {
|
|
|
2462
2494
|
}
|
|
2463
2495
|
return e > 23 || t > 59 || r > 59 ? void 0 : E().hour(e).minute(t).second(r).millisecond(0);
|
|
2464
2496
|
}
|
|
2465
|
-
if (
|
|
2497
|
+
if (sa.test(t)) {
|
|
2466
2498
|
let e = E(t);
|
|
2467
2499
|
return e.isValid() ? e : void 0;
|
|
2468
2500
|
}
|
|
2469
2501
|
}
|
|
2470
|
-
var
|
|
2471
|
-
function
|
|
2502
|
+
var la = /^today\s*(?:([+-])\s*(\d{1,4}))?$/i, ua = /^\d{4}-\d{2}-\d{2}(?:[T ].*)?$/;
|
|
2503
|
+
function da(e, t = E()) {
|
|
2472
2504
|
if (e == null || e === "") return;
|
|
2473
2505
|
if (E.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
2474
2506
|
if (e instanceof Date) {
|
|
@@ -2476,32 +2508,32 @@ function aa(e, t = E()) {
|
|
|
2476
2508
|
return t.isValid() ? t : void 0;
|
|
2477
2509
|
}
|
|
2478
2510
|
if (typeof e != "string") return;
|
|
2479
|
-
let n = e.trim(), r = n.match(
|
|
2511
|
+
let n = e.trim(), r = n.match(la);
|
|
2480
2512
|
if (r) {
|
|
2481
2513
|
let e = r[2] ? Number(r[2]) * (r[1] === "-" ? -1 : 1) : 0;
|
|
2482
2514
|
return E(t).startOf("day").add(e, "day");
|
|
2483
2515
|
}
|
|
2484
|
-
if (
|
|
2516
|
+
if (ua.test(n)) {
|
|
2485
2517
|
let e = E(n);
|
|
2486
2518
|
return e.isValid() ? e : void 0;
|
|
2487
2519
|
}
|
|
2488
2520
|
}
|
|
2489
2521
|
//#endregion
|
|
2490
2522
|
//#region src/components/form/payloadTransformer.js
|
|
2491
|
-
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0,
|
|
2492
|
-
function
|
|
2523
|
+
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, fa = (e) => e === !0 || e === 1 || e === "1", B = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !pa(e);
|
|
2524
|
+
function pa(e) {
|
|
2493
2525
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2494
2526
|
}
|
|
2495
|
-
function
|
|
2496
|
-
return
|
|
2527
|
+
function ma(e) {
|
|
2528
|
+
return pa(e) || e instanceof Date;
|
|
2497
2529
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return e instanceof Date ? e.toISOString() :
|
|
2530
|
+
function ha(e) {
|
|
2531
|
+
return e instanceof Date ? e.toISOString() : pa(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2500
2532
|
}
|
|
2501
|
-
function
|
|
2502
|
-
if (!fr(t)) return
|
|
2533
|
+
function ga(e, t) {
|
|
2534
|
+
if (!fr(t)) return ha(e);
|
|
2503
2535
|
let n = pr(e);
|
|
2504
|
-
return n ? n.toISOString() :
|
|
2536
|
+
return n ? n.toISOString() : ha(e);
|
|
2505
2537
|
}
|
|
2506
2538
|
function V(e, t) {
|
|
2507
2539
|
if (!t) return;
|
|
@@ -2526,7 +2558,7 @@ function W(e, t, n) {
|
|
|
2526
2558
|
}
|
|
2527
2559
|
return i[r[r.length - 1]] = n, e;
|
|
2528
2560
|
}
|
|
2529
|
-
function
|
|
2561
|
+
function _a(e, t, n) {
|
|
2530
2562
|
let r = String(t).split("."), i = e;
|
|
2531
2563
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2532
2564
|
let t = r[e];
|
|
@@ -2538,24 +2570,24 @@ function da(e, t, n) {
|
|
|
2538
2570
|
...i[a]
|
|
2539
2571
|
} : n, e;
|
|
2540
2572
|
}
|
|
2541
|
-
function
|
|
2573
|
+
function va(e) {
|
|
2542
2574
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2543
2575
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2544
2576
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2545
2577
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2546
2578
|
}
|
|
2547
|
-
function
|
|
2579
|
+
function ya(e, t) {
|
|
2548
2580
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2549
|
-
B(n) && B(e[t]) ?
|
|
2581
|
+
B(n) && B(e[t]) ? ya(e[t], n) : e[t] = n;
|
|
2550
2582
|
}), e;
|
|
2551
2583
|
}
|
|
2552
|
-
function
|
|
2584
|
+
function ba(e, t) {
|
|
2553
2585
|
let n = e.options ?? e.values ?? [];
|
|
2554
2586
|
for (let e of n) if (typeof e == "string") {
|
|
2555
2587
|
if (e === t) return e;
|
|
2556
2588
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2557
2589
|
}
|
|
2558
|
-
function
|
|
2590
|
+
function xa(e, t) {
|
|
2559
2591
|
if (B(e)) {
|
|
2560
2592
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2561
2593
|
return {
|
|
@@ -2565,10 +2597,10 @@ function ha(e, t) {
|
|
|
2565
2597
|
}
|
|
2566
2598
|
return {
|
|
2567
2599
|
value: e,
|
|
2568
|
-
label:
|
|
2600
|
+
label: ba(t, e) ?? e
|
|
2569
2601
|
};
|
|
2570
2602
|
}
|
|
2571
|
-
function
|
|
2603
|
+
function Sa(e = {}) {
|
|
2572
2604
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2573
2605
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2574
2606
|
switch (e.type) {
|
|
@@ -2579,13 +2611,13 @@ function ga(e = {}) {
|
|
|
2579
2611
|
}
|
|
2580
2612
|
}
|
|
2581
2613
|
function G(e, t, n = {}) {
|
|
2582
|
-
if (
|
|
2583
|
-
if (t === "string") return
|
|
2614
|
+
if (ma(e)) {
|
|
2615
|
+
if (t === "string") return ga(e, n);
|
|
2584
2616
|
if (t === "number") {
|
|
2585
|
-
let t =
|
|
2617
|
+
let t = pa(e) ? e.valueOf() : e.getTime();
|
|
2586
2618
|
return Number.isNaN(t) ? null : t;
|
|
2587
2619
|
}
|
|
2588
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2620
|
+
if (t === "date" || t === "auto" || !t) return ga(e, n);
|
|
2589
2621
|
}
|
|
2590
2622
|
switch (t) {
|
|
2591
2623
|
case "string": return e == null ? "" : String(e);
|
|
@@ -2600,14 +2632,14 @@ function G(e, t, n = {}) {
|
|
|
2600
2632
|
return t = Array.isArray(e) ? e : z(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => G(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2601
2633
|
}
|
|
2602
2634
|
case "object": return B(e), e;
|
|
2603
|
-
case "date": return
|
|
2635
|
+
case "date": return ga(e, n);
|
|
2604
2636
|
case "custom":
|
|
2605
2637
|
case "auto":
|
|
2606
2638
|
case void 0:
|
|
2607
2639
|
default: return e;
|
|
2608
2640
|
}
|
|
2609
2641
|
}
|
|
2610
|
-
var
|
|
2642
|
+
var Ca = {
|
|
2611
2643
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2612
2644
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2613
2645
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2615,11 +2647,11 @@ var _a = {
|
|
|
2615
2647
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2616
2648
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2617
2649
|
};
|
|
2618
|
-
function
|
|
2650
|
+
function wa(e, t) {
|
|
2619
2651
|
if (!t) return e;
|
|
2620
2652
|
let n = t;
|
|
2621
2653
|
if (typeof n == "string") {
|
|
2622
|
-
if (
|
|
2654
|
+
if (Ca[n]) return Ca[n](e);
|
|
2623
2655
|
try {
|
|
2624
2656
|
n = JSON.parse(n);
|
|
2625
2657
|
} catch {
|
|
@@ -2627,14 +2659,14 @@ function va(e, t) {
|
|
|
2627
2659
|
}
|
|
2628
2660
|
}
|
|
2629
2661
|
let r = e;
|
|
2630
|
-
if (n.name &&
|
|
2662
|
+
if (n.name && Ca[n.name] && (r = Ca[n.name](r)), n.map && typeof n.map == "object") {
|
|
2631
2663
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2632
2664
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2633
2665
|
}
|
|
2634
2666
|
return r;
|
|
2635
2667
|
}
|
|
2636
|
-
var
|
|
2637
|
-
function
|
|
2668
|
+
var Ta = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2669
|
+
function Ea(e, t) {
|
|
2638
2670
|
let [n, ...r] = e.split("."), i;
|
|
2639
2671
|
if (n === "value") i = t.value;
|
|
2640
2672
|
else if (n === "label") i = t.label;
|
|
@@ -2642,24 +2674,24 @@ function ba(e, t) {
|
|
|
2642
2674
|
else return;
|
|
2643
2675
|
return r.length ? V(i, r.join(".")) : i;
|
|
2644
2676
|
}
|
|
2645
|
-
function
|
|
2677
|
+
function Da(e, t) {
|
|
2646
2678
|
if (typeof e == "string") {
|
|
2647
2679
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2648
|
-
return n ?
|
|
2649
|
-
let r =
|
|
2680
|
+
return n ? Ea(n[1], t) : e.replace(Ta, (e, n) => {
|
|
2681
|
+
let r = Ea(n, t);
|
|
2650
2682
|
return r == null ? "" : String(r);
|
|
2651
2683
|
});
|
|
2652
2684
|
}
|
|
2653
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2685
|
+
if (Array.isArray(e)) return e.map((e) => Da(e, t));
|
|
2654
2686
|
if (B(e)) {
|
|
2655
2687
|
let n = {};
|
|
2656
2688
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2657
|
-
n[e] =
|
|
2689
|
+
n[e] = Da(r, t);
|
|
2658
2690
|
}), n;
|
|
2659
2691
|
}
|
|
2660
2692
|
return e;
|
|
2661
2693
|
}
|
|
2662
|
-
function
|
|
2694
|
+
function Oa(e) {
|
|
2663
2695
|
if (!e) return null;
|
|
2664
2696
|
if (typeof e == "string") try {
|
|
2665
2697
|
return JSON.parse(e);
|
|
@@ -2668,8 +2700,8 @@ function Sa(e) {
|
|
|
2668
2700
|
}
|
|
2669
2701
|
return e;
|
|
2670
2702
|
}
|
|
2671
|
-
function
|
|
2672
|
-
let n = e.payloadMode || "auto", r =
|
|
2703
|
+
function ka(e, t) {
|
|
2704
|
+
let n = e.payloadMode || "auto", r = Sa(e), { value: i, label: a } = xa(t, e);
|
|
2673
2705
|
switch (n) {
|
|
2674
2706
|
case "value": return {
|
|
2675
2707
|
kind: "scalar",
|
|
@@ -2691,12 +2723,12 @@ function Ca(e, t) {
|
|
|
2691
2723
|
}
|
|
2692
2724
|
case "custom":
|
|
2693
2725
|
case "template": {
|
|
2694
|
-
let n =
|
|
2726
|
+
let n = Oa(e.payloadTemplate);
|
|
2695
2727
|
if (!n) return {
|
|
2696
2728
|
kind: "scalar",
|
|
2697
2729
|
out: G(i, r, e)
|
|
2698
2730
|
};
|
|
2699
|
-
let o =
|
|
2731
|
+
let o = Da(n, {
|
|
2700
2732
|
value: G(i, e.elementType || "auto", {}),
|
|
2701
2733
|
label: a,
|
|
2702
2734
|
raw: t
|
|
@@ -2712,23 +2744,23 @@ function Ca(e, t) {
|
|
|
2712
2744
|
};
|
|
2713
2745
|
}
|
|
2714
2746
|
}
|
|
2715
|
-
function
|
|
2747
|
+
function Aa(e = {}) {
|
|
2716
2748
|
let t = e.defaultValue;
|
|
2717
|
-
if (t !== void 0 && t !== "") return e.type === "time" ?
|
|
2749
|
+
if (t !== void 0 && t !== "") return e.type === "time" ? ca(t) : e.type === "date" ? da(t) : t;
|
|
2718
2750
|
}
|
|
2719
|
-
function
|
|
2751
|
+
function ja(e, t) {
|
|
2720
2752
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2721
2753
|
let n = t;
|
|
2722
2754
|
if (z(n)) {
|
|
2723
|
-
let t =
|
|
2755
|
+
let t = Aa(e);
|
|
2724
2756
|
t !== void 0 && (n = t);
|
|
2725
2757
|
}
|
|
2726
|
-
return n =
|
|
2758
|
+
return n = wa(n, e.transformRule), z(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Sa(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2727
2759
|
kind: "scalar",
|
|
2728
|
-
out: n.map((t) =>
|
|
2729
|
-
} :
|
|
2760
|
+
out: n.map((t) => ka(e, t).out)
|
|
2761
|
+
} : ka(e, n);
|
|
2730
2762
|
}
|
|
2731
|
-
function
|
|
2763
|
+
function Ma(e = {}) {
|
|
2732
2764
|
return !!e.richValue || [
|
|
2733
2765
|
"label",
|
|
2734
2766
|
"object",
|
|
@@ -2736,8 +2768,8 @@ function Ea(e = {}) {
|
|
|
2736
2768
|
"template"
|
|
2737
2769
|
].includes(e.payloadMode);
|
|
2738
2770
|
}
|
|
2739
|
-
function
|
|
2740
|
-
if (!
|
|
2771
|
+
function Na(e, t, n = []) {
|
|
2772
|
+
if (!Ma(e) || t == null) return t;
|
|
2741
2773
|
let r = (e) => {
|
|
2742
2774
|
if (B(e) && e.value !== void 0) return e;
|
|
2743
2775
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
@@ -2748,7 +2780,7 @@ function Da(e, t, n = []) {
|
|
|
2748
2780
|
};
|
|
2749
2781
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2750
2782
|
}
|
|
2751
|
-
function
|
|
2783
|
+
function Pa(e, t, n) {
|
|
2752
2784
|
if (!e?.field) return !0;
|
|
2753
2785
|
let r = U(t, e.field) ? H(t, e.field) : H(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2754
2786
|
switch (e.operator) {
|
|
@@ -2762,49 +2794,49 @@ function Oa(e, t, n) {
|
|
|
2762
2794
|
default: return !0;
|
|
2763
2795
|
}
|
|
2764
2796
|
}
|
|
2765
|
-
function
|
|
2797
|
+
function Fa(e) {
|
|
2766
2798
|
let t = [];
|
|
2767
2799
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2768
2800
|
e?.field && t.push(e.field);
|
|
2769
2801
|
}), t;
|
|
2770
2802
|
}
|
|
2771
|
-
function
|
|
2803
|
+
function Ia(e, t, n) {
|
|
2772
2804
|
if (!e) return !0;
|
|
2773
2805
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2774
2806
|
if (r.length) {
|
|
2775
|
-
let i = r.map((e) =>
|
|
2807
|
+
let i = r.map((e) => Pa(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2776
2808
|
if (e.field) {
|
|
2777
|
-
let r =
|
|
2809
|
+
let r = Pa(e, t, n);
|
|
2778
2810
|
o = a ? o || r : o && r;
|
|
2779
2811
|
}
|
|
2780
2812
|
return o;
|
|
2781
2813
|
}
|
|
2782
|
-
return
|
|
2814
|
+
return Pa(e, t, n);
|
|
2783
2815
|
}
|
|
2784
|
-
function
|
|
2785
|
-
let a =
|
|
2786
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2816
|
+
function La(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2817
|
+
let a = Fa(e?.showIf);
|
|
2818
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Ia(e.showIf, t, n) ? a.every((e) => {
|
|
2787
2819
|
let a = r?.get?.(e);
|
|
2788
|
-
return !a ||
|
|
2820
|
+
return !a || La(a, t, n, r, i);
|
|
2789
2821
|
}) : !1);
|
|
2790
2822
|
}
|
|
2791
|
-
function
|
|
2823
|
+
function Ra(e = []) {
|
|
2792
2824
|
let t = /* @__PURE__ */ new Map();
|
|
2793
2825
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2794
2826
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2795
2827
|
})), t;
|
|
2796
2828
|
}
|
|
2797
|
-
function
|
|
2829
|
+
function za(e = {}, { editing: t = !1 } = {}) {
|
|
2798
2830
|
let n = {};
|
|
2799
2831
|
return (e.fields ?? []).forEach((e) => {
|
|
2800
2832
|
if (!(!e.field || K(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2801
2833
|
if (e.type === "time") {
|
|
2802
|
-
let t =
|
|
2834
|
+
let t = ca(e.defaultValue);
|
|
2803
2835
|
t !== void 0 && (n[e.field] = t);
|
|
2804
2836
|
return;
|
|
2805
2837
|
}
|
|
2806
2838
|
if (e.type === "date") {
|
|
2807
|
-
let t =
|
|
2839
|
+
let t = da(e.defaultValue);
|
|
2808
2840
|
t !== void 0 && (n[e.field] = t);
|
|
2809
2841
|
return;
|
|
2810
2842
|
}
|
|
@@ -2812,7 +2844,7 @@ function Na(e = {}, { editing: t = !1 } = {}) {
|
|
|
2812
2844
|
}
|
|
2813
2845
|
}), n;
|
|
2814
2846
|
}
|
|
2815
|
-
function
|
|
2847
|
+
function Ba(e = []) {
|
|
2816
2848
|
let t = [];
|
|
2817
2849
|
return e.forEach((e) => {
|
|
2818
2850
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2823,7 +2855,7 @@ function Pa(e = []) {
|
|
|
2823
2855
|
});
|
|
2824
2856
|
}), t;
|
|
2825
2857
|
}
|
|
2826
|
-
var
|
|
2858
|
+
var Va = [
|
|
2827
2859
|
"file",
|
|
2828
2860
|
"document",
|
|
2829
2861
|
"image",
|
|
@@ -2831,19 +2863,19 @@ var Fa = [
|
|
|
2831
2863
|
"attachment"
|
|
2832
2864
|
];
|
|
2833
2865
|
function K(e) {
|
|
2834
|
-
return
|
|
2866
|
+
return Va.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2835
2867
|
}
|
|
2836
|
-
function
|
|
2837
|
-
return
|
|
2868
|
+
function Ha(e = []) {
|
|
2869
|
+
return Ba(e).map(({ field: e }) => e).filter(K);
|
|
2838
2870
|
}
|
|
2839
|
-
function
|
|
2871
|
+
function Ua(e) {
|
|
2840
2872
|
return String(e ?? "").trim().toLowerCase();
|
|
2841
2873
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return !!t &&
|
|
2874
|
+
function Wa(e, t) {
|
|
2875
|
+
return !!t && Ua(e.moduleName) === t;
|
|
2844
2876
|
}
|
|
2845
|
-
function
|
|
2846
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2877
|
+
function Ga(e, t = [], n = {}) {
|
|
2878
|
+
let r = [], i = n.scope ?? "all", a = Ua(n.module), o = (e, t) => {
|
|
2847
2879
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2848
2880
|
let n = t?.originFileObj || t;
|
|
2849
2881
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2855,7 +2887,7 @@ function za(e, t = [], n = {}) {
|
|
|
2855
2887
|
return (t ?? []).forEach((t) => {
|
|
2856
2888
|
let r = (t.fields ?? []).filter(K);
|
|
2857
2889
|
if (!r.length) return;
|
|
2858
|
-
let s = t.moduleName && !
|
|
2890
|
+
let s = t.moduleName && !Wa(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2859
2891
|
if (t.addRow) {
|
|
2860
2892
|
if (i === "flat") return;
|
|
2861
2893
|
let a = e[t.name];
|
|
@@ -2875,12 +2907,12 @@ function za(e, t = [], n = {}) {
|
|
|
2875
2907
|
});
|
|
2876
2908
|
}), r;
|
|
2877
2909
|
}
|
|
2878
|
-
function
|
|
2910
|
+
function Ka(e, t, n = {}) {
|
|
2879
2911
|
let r = B(n.base) ? structuredClone(n.base) : {};
|
|
2880
|
-
|
|
2881
|
-
(e.payloadKey || e.field) && (
|
|
2912
|
+
Ha(t).forEach((e) => {
|
|
2913
|
+
(e.payloadKey || e.field) && (Ya(r, e.payloadKey || e.field), Ya(r, e.field));
|
|
2882
2914
|
});
|
|
2883
|
-
let i =
|
|
2915
|
+
let i = Ua(n.module), a = Ra(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Wa(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2884
2916
|
return (t ?? []).forEach((t) => {
|
|
2885
2917
|
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && U(e, t.toggleField) ? !!H(e, t.toggleField) : !1;
|
|
2886
2918
|
if (t.toggleEnabled && t.toggleField && U(e, t.toggleField) && (W(n, t.toggleField, i), i && t.addRow)) {
|
|
@@ -2890,29 +2922,29 @@ function Ba(e, t, n = {}) {
|
|
|
2890
2922
|
if (t.addRow) {
|
|
2891
2923
|
let i = e[t.name];
|
|
2892
2924
|
if (!Array.isArray(i)) return;
|
|
2893
|
-
W(n, t.payloadKey || t.name, i.map((t) =>
|
|
2925
|
+
W(n, t.payloadKey || t.name, i.map((t) => Ja(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2894
2926
|
return;
|
|
2895
2927
|
}
|
|
2896
|
-
r.forEach((t) =>
|
|
2928
|
+
r.forEach((t) => qa(t, e, n, e, a));
|
|
2897
2929
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2898
2930
|
moduleName: e,
|
|
2899
2931
|
data: t
|
|
2900
|
-
}))),
|
|
2932
|
+
}))), Wi(r, t);
|
|
2901
2933
|
}
|
|
2902
|
-
function
|
|
2903
|
-
if (
|
|
2904
|
-
let r =
|
|
2934
|
+
function qa(e, t, n, r, i) {
|
|
2935
|
+
if (Ki(e) && Yi(e)) {
|
|
2936
|
+
let r = qi(e);
|
|
2905
2937
|
U(t, r) && W(n, r, !!H(t, r));
|
|
2906
2938
|
}
|
|
2907
2939
|
if (K(e)) {
|
|
2908
|
-
let i =
|
|
2940
|
+
let i = va(H(t, e.field));
|
|
2909
2941
|
if (i !== void 0) {
|
|
2910
2942
|
let a = r !== void 0 && r !== t;
|
|
2911
|
-
|
|
2943
|
+
_a(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2912
2944
|
}
|
|
2913
2945
|
return;
|
|
2914
2946
|
}
|
|
2915
|
-
if (
|
|
2947
|
+
if (Fa(e.showIf).length && !La(e, t, r, i)) {
|
|
2916
2948
|
(r === void 0 || r === t) && U(t, e.field) && W(n, e.payloadKey || e.field, null);
|
|
2917
2949
|
return;
|
|
2918
2950
|
}
|
|
@@ -2920,30 +2952,30 @@ function Va(e, t, n, r, i) {
|
|
|
2920
2952
|
if (!U(t, e.field)) return;
|
|
2921
2953
|
let a = H(t, e.field);
|
|
2922
2954
|
if (!Array.isArray(a)) return;
|
|
2923
|
-
let o = a.map((t) =>
|
|
2955
|
+
let o = a.map((t) => Ja(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2924
2956
|
W(n, e.payloadKey || e.field, o);
|
|
2925
2957
|
return;
|
|
2926
2958
|
}
|
|
2927
2959
|
if (!U(t, e.field)) return;
|
|
2928
|
-
if (
|
|
2929
|
-
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a =
|
|
2960
|
+
if (fa(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2961
|
+
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a = Za(e), o = i.map((e) => ja(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2930
2962
|
W(n, e.payloadKey || e.field, o);
|
|
2931
2963
|
return;
|
|
2932
2964
|
}
|
|
2933
|
-
let a =
|
|
2965
|
+
let a = ja(e, H(t, e.field));
|
|
2934
2966
|
if (a.kind !== "skip") {
|
|
2935
2967
|
if (a.kind === "spread" && B(a.out)) {
|
|
2936
|
-
|
|
2968
|
+
ya(n, a.out);
|
|
2937
2969
|
return;
|
|
2938
2970
|
}
|
|
2939
2971
|
W(n, e.payloadKey || e.field, a.out);
|
|
2940
2972
|
}
|
|
2941
2973
|
}
|
|
2942
|
-
function
|
|
2974
|
+
function Ja(e, t, n, r) {
|
|
2943
2975
|
let i = {};
|
|
2944
|
-
return e.forEach((e) =>
|
|
2976
|
+
return e.forEach((e) => qa(e, t, i, n ?? t, r)), i;
|
|
2945
2977
|
}
|
|
2946
|
-
function
|
|
2978
|
+
function Ya(e, t) {
|
|
2947
2979
|
let n = String(t).split("."), r = e;
|
|
2948
2980
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2949
2981
|
if (!B(r[n[e]])) return;
|
|
@@ -2951,7 +2983,7 @@ function Ua(e, t) {
|
|
|
2951
2983
|
}
|
|
2952
2984
|
delete r[n[n.length - 1]];
|
|
2953
2985
|
}
|
|
2954
|
-
var
|
|
2986
|
+
var Xa = /* @__PURE__ */ new Set([
|
|
2955
2987
|
"text",
|
|
2956
2988
|
"textarea",
|
|
2957
2989
|
"email",
|
|
@@ -2964,10 +2996,10 @@ var Wa = /* @__PURE__ */ new Set([
|
|
|
2964
2996
|
"password"
|
|
2965
2997
|
]);
|
|
2966
2998
|
function q(e, t) {
|
|
2967
|
-
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ?
|
|
2999
|
+
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ? Aa(e) : void 0;
|
|
2968
3000
|
if (t == null) return r() ?? t;
|
|
2969
3001
|
if (n(t) || z(t) && r() !== void 0) return r();
|
|
2970
|
-
if (
|
|
3002
|
+
if (Xa.has(e.type) && B(t)) {
|
|
2971
3003
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2972
3004
|
if (r === void 0 || B(r)) return;
|
|
2973
3005
|
t = r;
|
|
@@ -2977,8 +3009,8 @@ function q(e, t) {
|
|
|
2977
3009
|
let e = E(t);
|
|
2978
3010
|
return e.isValid() ? e : null;
|
|
2979
3011
|
}
|
|
2980
|
-
t =
|
|
2981
|
-
let i = (t) => B(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" &&
|
|
3012
|
+
t = ia(e, t);
|
|
3013
|
+
let i = (t) => B(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && Sa(e) === "array", o = (t) => {
|
|
2982
3014
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2983
3015
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2984
3016
|
return n ? n.value : t;
|
|
@@ -2990,7 +3022,7 @@ function q(e, t) {
|
|
|
2990
3022
|
}
|
|
2991
3023
|
return t;
|
|
2992
3024
|
}
|
|
2993
|
-
function
|
|
3025
|
+
function Za(e = {}) {
|
|
2994
3026
|
return {
|
|
2995
3027
|
...e,
|
|
2996
3028
|
addRow: !1,
|
|
@@ -2999,7 +3031,7 @@ function Ga(e = {}) {
|
|
|
2999
3031
|
dataType: void 0
|
|
3000
3032
|
};
|
|
3001
3033
|
}
|
|
3002
|
-
function
|
|
3034
|
+
function Qa(e, t) {
|
|
3003
3035
|
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;
|
|
3004
3036
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
3005
3037
|
let i = [];
|
|
@@ -3015,7 +3047,7 @@ function Ka(e, t) {
|
|
|
3015
3047
|
for (; i.length < a;) i.push({});
|
|
3016
3048
|
return i;
|
|
3017
3049
|
}
|
|
3018
|
-
let i =
|
|
3050
|
+
let i = Za(e), a = [];
|
|
3019
3051
|
if (Array.isArray(t)) a = t.map((e) => q(i, e)).filter((e) => e != null && e !== "");
|
|
3020
3052
|
else if (t != null && t !== "") {
|
|
3021
3053
|
let e = q(i, t);
|
|
@@ -3027,12 +3059,12 @@ function Ka(e, t) {
|
|
|
3027
3059
|
}
|
|
3028
3060
|
//#endregion
|
|
3029
3061
|
//#region src/components/form/linkedAddRowGroups.js
|
|
3030
|
-
var
|
|
3031
|
-
function
|
|
3062
|
+
var $a = (e) => e === !0 || e === 1 || e === "1";
|
|
3063
|
+
function eo(e = []) {
|
|
3032
3064
|
let t = /* @__PURE__ */ new Map();
|
|
3033
3065
|
e.forEach((e) => {
|
|
3034
3066
|
let n = e?.linkGroup;
|
|
3035
|
-
|
|
3067
|
+
!$a(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
3036
3068
|
});
|
|
3037
3069
|
let n = /* @__PURE__ */ new Map();
|
|
3038
3070
|
return t.forEach((e, t) => {
|
|
@@ -3042,11 +3074,11 @@ function Ja(e = []) {
|
|
|
3042
3074
|
});
|
|
3043
3075
|
}), n;
|
|
3044
3076
|
}
|
|
3045
|
-
function
|
|
3077
|
+
function to(e, t) {
|
|
3046
3078
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
3047
3079
|
return null;
|
|
3048
3080
|
}
|
|
3049
|
-
function
|
|
3081
|
+
function no(e, t = {}) {
|
|
3050
3082
|
let n = { ...t };
|
|
3051
3083
|
return e.forEach(({ memberNames: e }) => {
|
|
3052
3084
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -3058,7 +3090,7 @@ function Xa(e, t = {}) {
|
|
|
3058
3090
|
}
|
|
3059
3091
|
//#endregion
|
|
3060
3092
|
//#region src/components/form/formDecisionDialog.jsx
|
|
3061
|
-
var
|
|
3093
|
+
var ro = {
|
|
3062
3094
|
duplicate: {
|
|
3063
3095
|
className: "fdd-tone-amber",
|
|
3064
3096
|
Icon: _e
|
|
@@ -3076,8 +3108,8 @@ var Za = {
|
|
|
3076
3108
|
Icon: pe
|
|
3077
3109
|
}
|
|
3078
3110
|
};
|
|
3079
|
-
function
|
|
3080
|
-
let { className: l, Icon: u } =
|
|
3111
|
+
function io({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText: i = "Continue", cancelText: a = "Cancel", danger: o = !1, footnote: s, altText: c } = {}) {
|
|
3112
|
+
let { className: l, Icon: u } = ro[e] ?? ro.suggestion, d = r.filter((e) => e && e.value !== void 0 && e.value !== null && String(e.value).trim() !== "");
|
|
3081
3113
|
return new Promise((e) => {
|
|
3082
3114
|
let r = !1, f = (t) => {
|
|
3083
3115
|
r || (r = !0, e(t));
|
|
@@ -3141,8 +3173,8 @@ function Qa({ tone: e = "suggestion", title: t, body: n, facts: r = [], okText:
|
|
|
3141
3173
|
});
|
|
3142
3174
|
});
|
|
3143
3175
|
}
|
|
3144
|
-
function
|
|
3145
|
-
let { className: a, Icon: o } =
|
|
3176
|
+
function ao({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i = "Go back" } = {}) {
|
|
3177
|
+
let { className: a, Icon: o } = ro[e] ?? ro.suggestion, s = r.filter((e) => e && String(e.value ?? "").trim() !== "");
|
|
3146
3178
|
return new Promise((e) => {
|
|
3147
3179
|
ne.warning({
|
|
3148
3180
|
icon: null,
|
|
@@ -3184,7 +3216,7 @@ function $a({ tone: e = "duplicate", title: t, body: n, facts: r = [], okText: i
|
|
|
3184
3216
|
}
|
|
3185
3217
|
//#endregion
|
|
3186
3218
|
//#region src/services/aiActionApi.js
|
|
3187
|
-
async function
|
|
3219
|
+
async function oo({ module: e, group: t, field: n, actionKey: i, inputs: a = {}, files: o = {} }) {
|
|
3188
3220
|
if (!e || !t || !n || !i) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
3189
3221
|
let c = await r(), l = new FormData();
|
|
3190
3222
|
l.append("json", JSON.stringify({ inputs: a })), Object.entries(o).forEach(([e, t]) => {
|
|
@@ -3210,17 +3242,17 @@ async function eo({ module: e, group: t, field: n, actionKey: i, inputs: a = {},
|
|
|
3210
3242
|
}
|
|
3211
3243
|
//#endregion
|
|
3212
3244
|
//#region src/components/detail/phoneDisplay.js
|
|
3213
|
-
var
|
|
3214
|
-
function
|
|
3245
|
+
var so = (e) => e == null || e === "";
|
|
3246
|
+
function co(e, t) {
|
|
3215
3247
|
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
3216
3248
|
}
|
|
3217
|
-
function
|
|
3249
|
+
function lo(e) {
|
|
3218
3250
|
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
3219
3251
|
if (!t) return "";
|
|
3220
3252
|
let n = t.replace(/^\+/, "");
|
|
3221
3253
|
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
3222
3254
|
}
|
|
3223
|
-
function
|
|
3255
|
+
function uo(e) {
|
|
3224
3256
|
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
3225
3257
|
return [
|
|
3226
3258
|
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
@@ -3233,15 +3265,15 @@ function io(e) {
|
|
|
3233
3265
|
"isdCode"
|
|
3234
3266
|
];
|
|
3235
3267
|
}
|
|
3236
|
-
function
|
|
3237
|
-
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...
|
|
3268
|
+
function fo(e, t, n = "") {
|
|
3269
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...uo(e)] : uo(e);
|
|
3238
3270
|
for (let e of i) {
|
|
3239
|
-
let n =
|
|
3271
|
+
let n = lo(co(t, e));
|
|
3240
3272
|
if (n) return n;
|
|
3241
3273
|
}
|
|
3242
|
-
return
|
|
3274
|
+
return lo(n);
|
|
3243
3275
|
}
|
|
3244
|
-
function
|
|
3276
|
+
function po(e) {
|
|
3245
3277
|
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
3246
3278
|
return n ? {
|
|
3247
3279
|
code: n[1],
|
|
@@ -3251,17 +3283,17 @@ function oo(e) {
|
|
|
3251
3283
|
rest: t
|
|
3252
3284
|
};
|
|
3253
3285
|
}
|
|
3254
|
-
function
|
|
3255
|
-
if (
|
|
3256
|
-
let { code: n, rest: r } =
|
|
3286
|
+
function mo(e, t = "") {
|
|
3287
|
+
if (so(e)) return "";
|
|
3288
|
+
let { code: n, rest: r } = po(e), i = n || lo(t), a = Zn(r) || r;
|
|
3257
3289
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3258
3290
|
}
|
|
3259
|
-
function
|
|
3260
|
-
return
|
|
3291
|
+
function ho(e, t, n) {
|
|
3292
|
+
return mo(t, fo(e, n, Yn()));
|
|
3261
3293
|
}
|
|
3262
3294
|
//#endregion
|
|
3263
3295
|
//#region src/components/detail/renderConfig.js
|
|
3264
|
-
var
|
|
3296
|
+
var go = [
|
|
3265
3297
|
{
|
|
3266
3298
|
value: "auto",
|
|
3267
3299
|
label: "Default (auto)"
|
|
@@ -3318,7 +3350,7 @@ var lo = [
|
|
|
3318
3350
|
value: "html",
|
|
3319
3351
|
label: "HTML"
|
|
3320
3352
|
}
|
|
3321
|
-
],
|
|
3353
|
+
], _o = [
|
|
3322
3354
|
{
|
|
3323
3355
|
value: "preview",
|
|
3324
3356
|
label: "Preview (viewer)"
|
|
@@ -3339,7 +3371,7 @@ var lo = [
|
|
|
3339
3371
|
value: "text",
|
|
3340
3372
|
label: "Text (filename)"
|
|
3341
3373
|
}
|
|
3342
|
-
],
|
|
3374
|
+
], vo = [
|
|
3343
3375
|
{
|
|
3344
3376
|
value: "none",
|
|
3345
3377
|
label: "None"
|
|
@@ -3356,76 +3388,76 @@ var lo = [
|
|
|
3356
3388
|
value: "title",
|
|
3357
3389
|
label: "Title Case"
|
|
3358
3390
|
}
|
|
3359
|
-
],
|
|
3391
|
+
], yo = [
|
|
3360
3392
|
"location",
|
|
3361
3393
|
"path",
|
|
3362
3394
|
"url",
|
|
3363
3395
|
"key"
|
|
3364
|
-
],
|
|
3396
|
+
], bo = [
|
|
3365
3397
|
"location",
|
|
3366
3398
|
"filepath",
|
|
3367
3399
|
"path",
|
|
3368
3400
|
"url",
|
|
3369
3401
|
"key"
|
|
3370
|
-
],
|
|
3402
|
+
], xo = [
|
|
3371
3403
|
"uploadedfilename",
|
|
3372
3404
|
"uploadname",
|
|
3373
3405
|
"originalname",
|
|
3374
3406
|
"displayname",
|
|
3375
3407
|
"documentname",
|
|
3376
3408
|
"filename"
|
|
3377
|
-
],
|
|
3378
|
-
function
|
|
3409
|
+
], So = ["name"], Co = (e) => String(e).toLowerCase(), wo = (e) => e == null || e === "";
|
|
3410
|
+
function To(e, t) {
|
|
3379
3411
|
for (let n of t) {
|
|
3380
3412
|
let t = e[n];
|
|
3381
3413
|
if (typeof t == "string" && t) return t;
|
|
3382
3414
|
}
|
|
3383
3415
|
return "";
|
|
3384
3416
|
}
|
|
3385
|
-
function
|
|
3386
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3417
|
+
function Eo(e, t) {
|
|
3418
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Co(t).endsWith(n)) return r;
|
|
3387
3419
|
return "";
|
|
3388
3420
|
}
|
|
3389
|
-
function
|
|
3421
|
+
function Do(e) {
|
|
3390
3422
|
if (!e) return "";
|
|
3391
3423
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3392
3424
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3393
3425
|
}
|
|
3394
|
-
function
|
|
3426
|
+
function Oo(e) {
|
|
3395
3427
|
if (!e) return "";
|
|
3396
3428
|
let t = String(e);
|
|
3397
3429
|
return /^https?:\/\//i.test(t) ? t : "";
|
|
3398
3430
|
}
|
|
3399
|
-
function
|
|
3431
|
+
function ko(e) {
|
|
3400
3432
|
let t = String(e ?? "").trim();
|
|
3401
3433
|
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
3402
3434
|
}
|
|
3403
|
-
function
|
|
3404
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3435
|
+
function Ao(e) {
|
|
3436
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : To(e, yo) || Eo(e, bo);
|
|
3405
3437
|
}
|
|
3406
|
-
function
|
|
3407
|
-
return e ? typeof e == "string" ?
|
|
3438
|
+
function jo(e) {
|
|
3439
|
+
return e ? typeof e == "string" ? Do(e) || e : typeof e == "object" && (To(e, P().documentNameOrder ?? []) || Eo(e, xo) || Do(Ao(e)) || Eo(e, So)) || "Document" : "Document";
|
|
3408
3440
|
}
|
|
3409
|
-
function
|
|
3410
|
-
if (
|
|
3441
|
+
function Mo(e) {
|
|
3442
|
+
if (wo(e)) return [];
|
|
3411
3443
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3412
|
-
for (let e of t) if (!
|
|
3444
|
+
for (let e of t) if (!wo(e)) {
|
|
3413
3445
|
if (typeof e == "string") {
|
|
3414
3446
|
let t = e.includes("/") ? e : "";
|
|
3415
3447
|
n.push({
|
|
3416
3448
|
location: t,
|
|
3417
|
-
name:
|
|
3418
|
-
url:
|
|
3419
|
-
needsAuthFetch:
|
|
3449
|
+
name: Do(e) || e,
|
|
3450
|
+
url: Oo(t),
|
|
3451
|
+
needsAuthFetch: ko(t)
|
|
3420
3452
|
});
|
|
3421
3453
|
} else if (typeof e == "object") {
|
|
3422
|
-
let t =
|
|
3454
|
+
let t = Ao(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3423
3455
|
n.push({
|
|
3424
3456
|
location: t,
|
|
3425
|
-
name:
|
|
3426
|
-
url: r ||
|
|
3457
|
+
name: jo(e),
|
|
3458
|
+
url: r || Oo(t),
|
|
3427
3459
|
documentId: e.id || e._id || e.documentId || "",
|
|
3428
|
-
needsAuthFetch: !r &&
|
|
3460
|
+
needsAuthFetch: !r && ko(t)
|
|
3429
3461
|
});
|
|
3430
3462
|
}
|
|
3431
3463
|
}
|
|
@@ -3433,24 +3465,24 @@ function Eo(e) {
|
|
|
3433
3465
|
}
|
|
3434
3466
|
//#endregion
|
|
3435
3467
|
//#region src/components/form/repeatableRowShape.js
|
|
3436
|
-
function
|
|
3468
|
+
function No(e) {
|
|
3437
3469
|
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
3438
3470
|
}
|
|
3439
|
-
function
|
|
3471
|
+
function Po(e, t) {
|
|
3440
3472
|
if (!Array.isArray(t) || t.length === 0) return t;
|
|
3441
|
-
let n =
|
|
3473
|
+
let n = No(e);
|
|
3442
3474
|
if (!n) return t;
|
|
3443
3475
|
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 }));
|
|
3444
3476
|
return r ? i : t;
|
|
3445
3477
|
}
|
|
3446
3478
|
//#endregion
|
|
3447
3479
|
//#region src/components/form/applyGroupValues.js
|
|
3448
|
-
var
|
|
3449
|
-
function
|
|
3480
|
+
var Fo = (e) => e === !0 || e === 1 || e === "1", Io = (e) => e == null || e === "";
|
|
3481
|
+
function Lo(e) {
|
|
3450
3482
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3451
3483
|
}
|
|
3452
3484
|
function J(e, t, n) {
|
|
3453
|
-
let r = Array.isArray(t) ? t :
|
|
3485
|
+
let r = Array.isArray(t) ? t : Lo(t);
|
|
3454
3486
|
if (!r.length) return e;
|
|
3455
3487
|
let i = e;
|
|
3456
3488
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3459,23 +3491,23 @@ function J(e, t, n) {
|
|
|
3459
3491
|
}
|
|
3460
3492
|
return i[r[r.length - 1]] = n, e;
|
|
3461
3493
|
}
|
|
3462
|
-
function
|
|
3494
|
+
function Ro(e, t = []) {
|
|
3463
3495
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3464
3496
|
if (!n) continue;
|
|
3465
3497
|
let t = V(e, n);
|
|
3466
|
-
if (!
|
|
3498
|
+
if (!Io(t)) return t;
|
|
3467
3499
|
}
|
|
3468
3500
|
}
|
|
3469
|
-
function
|
|
3501
|
+
function zo(e, t) {
|
|
3470
3502
|
if (!e || typeof e != "object") return;
|
|
3471
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3503
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Io(n));
|
|
3472
3504
|
if (r) return r[1];
|
|
3473
3505
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3474
|
-
let n =
|
|
3475
|
-
if (!
|
|
3506
|
+
let n = zo(e, t);
|
|
3507
|
+
if (!Io(n)) return n;
|
|
3476
3508
|
}
|
|
3477
3509
|
}
|
|
3478
|
-
function
|
|
3510
|
+
function Bo(e, t) {
|
|
3479
3511
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3480
3512
|
if (!n.length) return;
|
|
3481
3513
|
let r = n.map((e, n) => {
|
|
@@ -3485,9 +3517,9 @@ function Po(e, t) {
|
|
|
3485
3517
|
status: "done"
|
|
3486
3518
|
};
|
|
3487
3519
|
if (!e || typeof e != "object") return null;
|
|
3488
|
-
let r =
|
|
3520
|
+
let r = Ro(e, [t.fileUrlKey, t.locationKey]) ?? zo(e, /(location|url|path)$/i) ?? "", i = Ro(e, [t.fileNameKey]) ?? zo(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3489
3521
|
if (!r && !i) return null;
|
|
3490
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3522
|
+
let a = r && !String(r).startsWith("http") ? Oo(r) : r;
|
|
3491
3523
|
return {
|
|
3492
3524
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3493
3525
|
name: i || "file",
|
|
@@ -3499,11 +3531,11 @@ function Po(e, t) {
|
|
|
3499
3531
|
}).filter(Boolean);
|
|
3500
3532
|
return r.length ? r : void 0;
|
|
3501
3533
|
}
|
|
3502
|
-
function
|
|
3534
|
+
function Vo(e, t) {
|
|
3503
3535
|
if (!e || typeof e != "object") return;
|
|
3504
|
-
let n =
|
|
3536
|
+
let n = Ro(e, [t.fileNameKey, t.field]) ?? zo(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Ro(e, [t.fileUrlKey, t.locationKey]) ?? zo(e, /(location|url|path)$/i) ?? "";
|
|
3505
3537
|
if (!n && !r) return;
|
|
3506
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3538
|
+
let i = r && !String(r).startsWith("http") ? Oo(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3507
3539
|
return [{
|
|
3508
3540
|
uid: String(a),
|
|
3509
3541
|
name: n ?? "file",
|
|
@@ -3512,7 +3544,7 @@ function Fo(e, t) {
|
|
|
3512
3544
|
url: i || void 0
|
|
3513
3545
|
}];
|
|
3514
3546
|
}
|
|
3515
|
-
function
|
|
3547
|
+
function Ho(e, t, n, r) {
|
|
3516
3548
|
(e.fields ?? []).forEach((e) => {
|
|
3517
3549
|
e?.verifyAction && [
|
|
3518
3550
|
e.verifyResultField,
|
|
@@ -3525,8 +3557,8 @@ function Io(e, t, n, r) {
|
|
|
3525
3557
|
});
|
|
3526
3558
|
});
|
|
3527
3559
|
}
|
|
3528
|
-
function
|
|
3529
|
-
let t = Array.isArray(e.rows) ?
|
|
3560
|
+
function Uo(e) {
|
|
3561
|
+
let t = Array.isArray(e.rows) ? Po(e, e.rows) : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3530
3562
|
let i = {};
|
|
3531
3563
|
return (e.fields ?? []).forEach((e) => {
|
|
3532
3564
|
if (!e.field) return;
|
|
@@ -3537,30 +3569,30 @@ function Lo(e) {
|
|
|
3537
3569
|
}
|
|
3538
3570
|
let a = r(t, e);
|
|
3539
3571
|
if (a == null) {
|
|
3540
|
-
let t = e.defaultOnEdit ?
|
|
3572
|
+
let t = e.defaultOnEdit ? Aa(e) : void 0;
|
|
3541
3573
|
t !== void 0 && J(i, e.field, t);
|
|
3542
3574
|
return;
|
|
3543
3575
|
}
|
|
3544
|
-
J(i, e.field,
|
|
3545
|
-
}),
|
|
3546
|
-
}, i =
|
|
3576
|
+
J(i, e.field, Fo(e.addRow) ? Qa(e, a) : q(e, a));
|
|
3577
|
+
}), Ho(e, t, i, r), i;
|
|
3578
|
+
}, i = za(e, { editing: !0 });
|
|
3547
3579
|
if (t && t.length > 0) {
|
|
3548
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3580
|
+
let e = t.map((e) => r(e, (e, t) => Vo(e, t), (e, t) => V(e, t.field)));
|
|
3549
3581
|
for (; e.length < n;) e.push({ ...i });
|
|
3550
3582
|
return e;
|
|
3551
3583
|
}
|
|
3552
|
-
let a = r(e, (e, t) =>
|
|
3584
|
+
let a = r(e, (e, t) => Bo(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3553
3585
|
for (; o.length < n;) o.push({ ...i });
|
|
3554
3586
|
return o;
|
|
3555
3587
|
}
|
|
3556
|
-
function
|
|
3588
|
+
function Wo(e, t = []) {
|
|
3557
3589
|
let n = {};
|
|
3558
3590
|
return t.forEach((e) => {
|
|
3559
3591
|
e.toggleEnabled && e.toggleField && J(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3560
3592
|
if (!e.field || e.addRow) return;
|
|
3561
3593
|
let t = e.value, r = e.field;
|
|
3562
3594
|
if (e.type === "file") {
|
|
3563
|
-
let i =
|
|
3595
|
+
let i = Bo(t, e);
|
|
3564
3596
|
i && J(n, r, i);
|
|
3565
3597
|
return;
|
|
3566
3598
|
}
|
|
@@ -3570,12 +3602,12 @@ function Ro(e, t = []) {
|
|
|
3570
3602
|
if (i) {
|
|
3571
3603
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3572
3604
|
J(n, r, e ? [e[0]] : []);
|
|
3573
|
-
} else J(n, r,
|
|
3605
|
+
} else J(n, r, ia(e, Array.isArray(t) ? t : [t]));
|
|
3574
3606
|
return;
|
|
3575
3607
|
}
|
|
3576
3608
|
let i = e.splitDialCodeInto;
|
|
3577
3609
|
if (i && typeof t == "string") {
|
|
3578
|
-
let { code: a, rest: o } =
|
|
3610
|
+
let { code: a, rest: o } = po(t), s = lo(a);
|
|
3579
3611
|
s && J(n, i, s), J(n, r, q(e, o || t));
|
|
3580
3612
|
return;
|
|
3581
3613
|
}
|
|
@@ -3585,27 +3617,27 @@ function Ro(e, t = []) {
|
|
|
3585
3617
|
}
|
|
3586
3618
|
//#endregion
|
|
3587
3619
|
//#region src/components/form/useAiActions.js
|
|
3588
|
-
function
|
|
3620
|
+
function Go(e) {
|
|
3589
3621
|
let t = document.createElement("div");
|
|
3590
3622
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3591
3623
|
}
|
|
3592
|
-
function
|
|
3593
|
-
return t && t === "stripHtml" ?
|
|
3624
|
+
function Ko(e, t) {
|
|
3625
|
+
return t && t === "stripHtml" ? Go(e) : e;
|
|
3594
3626
|
}
|
|
3595
|
-
function
|
|
3627
|
+
function qo(e) {
|
|
3596
3628
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3597
3629
|
}
|
|
3598
|
-
function
|
|
3630
|
+
function Jo(e) {
|
|
3599
3631
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3600
3632
|
}
|
|
3601
|
-
function
|
|
3633
|
+
function Yo(e, t) {
|
|
3602
3634
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3603
|
-
let n =
|
|
3635
|
+
let n = Ko(t, e.transform), r = String(n ?? "").trim();
|
|
3604
3636
|
if (!r) return !1;
|
|
3605
3637
|
let i = Number(e.minWords) || 0;
|
|
3606
|
-
return i > 0 ?
|
|
3638
|
+
return i > 0 ? qo(r) >= i : !0;
|
|
3607
3639
|
}
|
|
3608
|
-
function
|
|
3640
|
+
function Xo(e, t) {
|
|
3609
3641
|
let n = e.inputs || [];
|
|
3610
3642
|
if (n.length === 0) return !0;
|
|
3611
3643
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3613,10 +3645,10 @@ function Wo(e, t) {
|
|
|
3613
3645
|
let n = e.group || `__solo_${t}`;
|
|
3614
3646
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3615
3647
|
});
|
|
3616
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3648
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => Yo(e, t(e.sourceField)))) return !1;
|
|
3617
3649
|
return !0;
|
|
3618
3650
|
}
|
|
3619
|
-
function
|
|
3651
|
+
function Zo(e = []) {
|
|
3620
3652
|
let t = [];
|
|
3621
3653
|
return e.forEach((e) => {
|
|
3622
3654
|
if (e?.addRow) {
|
|
@@ -3629,32 +3661,32 @@ function Go(e = []) {
|
|
|
3629
3661
|
});
|
|
3630
3662
|
}), t;
|
|
3631
3663
|
}
|
|
3632
|
-
function
|
|
3633
|
-
return
|
|
3664
|
+
function Qo(e, t) {
|
|
3665
|
+
return Zo(t).some((t) => {
|
|
3634
3666
|
let n = e.getFieldValue(t);
|
|
3635
|
-
return Array.isArray(n) ? n.some(
|
|
3667
|
+
return Array.isArray(n) ? n.some(Jo) : n != null && n !== "";
|
|
3636
3668
|
});
|
|
3637
3669
|
}
|
|
3638
|
-
function
|
|
3670
|
+
function $o(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3639
3671
|
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;
|
|
3640
3672
|
return Object.entries(r).forEach(([e, t]) => {
|
|
3641
|
-
if (!(i.has(e) || !a(e) || !
|
|
3673
|
+
if (!(i.has(e) || !a(e) || !es(t))) {
|
|
3642
3674
|
if (Array.isArray(t)) {
|
|
3643
|
-
o += t.filter((e) => e && typeof e == "object" ?
|
|
3675
|
+
o += t.filter((e) => e && typeof e == "object" ? Jo(e) : !!e).length;
|
|
3644
3676
|
return;
|
|
3645
3677
|
}
|
|
3646
3678
|
o += 1;
|
|
3647
3679
|
}
|
|
3648
3680
|
}), o;
|
|
3649
3681
|
}
|
|
3650
|
-
function
|
|
3651
|
-
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ?
|
|
3682
|
+
function es(e) {
|
|
3683
|
+
return e == null || e === "" ? !1 : Array.isArray(e) ? e.some((e) => e && typeof e == "object" ? Jo(e) : !!e) : typeof e != "object" || Object.values(e).some((e) => e != null && e !== "");
|
|
3652
3684
|
}
|
|
3653
|
-
function
|
|
3685
|
+
function ts(e, t = [], { includeUntouched: n = !1 } = {}) {
|
|
3654
3686
|
let r = e.getFieldsValue(!0) ?? {}, i = new Set([t].flat().filter(Boolean)), a = Object.keys(r).filter((e) => !i.has(e));
|
|
3655
|
-
return n ? a.some((e) =>
|
|
3687
|
+
return n ? a.some((e) => es(r[e])) : typeof e.isFieldTouched == "function" ? a.some((t) => e.isFieldTouched(t) && es(r[t])) : a.some((e) => es(r[e]));
|
|
3656
3688
|
}
|
|
3657
|
-
function
|
|
3689
|
+
function ns(e = []) {
|
|
3658
3690
|
let t = {};
|
|
3659
3691
|
return (e ?? []).forEach((e) => {
|
|
3660
3692
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -3665,38 +3697,38 @@ function Xo(e = []) {
|
|
|
3665
3697
|
});
|
|
3666
3698
|
}), t;
|
|
3667
3699
|
}
|
|
3668
|
-
function
|
|
3700
|
+
function rs(e, t, n) {
|
|
3669
3701
|
let r = e?.confirmWhen ?? "never";
|
|
3670
|
-
return r === "never" ? !1 : r === "always" ||
|
|
3702
|
+
return r === "never" ? !1 : r === "always" || Qo(t, n);
|
|
3671
3703
|
}
|
|
3672
|
-
var
|
|
3704
|
+
var is = [
|
|
3673
3705
|
"top-left",
|
|
3674
3706
|
"top-center",
|
|
3675
3707
|
"top-right",
|
|
3676
3708
|
"bottom-left",
|
|
3677
3709
|
"bottom-center",
|
|
3678
3710
|
"bottom-right"
|
|
3679
|
-
],
|
|
3680
|
-
function
|
|
3711
|
+
], as = "bottom-left";
|
|
3712
|
+
function os(e = []) {
|
|
3681
3713
|
let t = {};
|
|
3682
3714
|
return e.forEach((e) => {
|
|
3683
|
-
let n =
|
|
3715
|
+
let n = is.includes(e.position) ? e.position : as;
|
|
3684
3716
|
(t[n] ??= []).push(e);
|
|
3685
3717
|
}), t;
|
|
3686
3718
|
}
|
|
3687
|
-
function
|
|
3688
|
-
let [o, s] = v(null), [c, l] = v(""), u = te.useWatch((e) => e, e), d = p((e) =>
|
|
3719
|
+
function ss({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPrefilledAsData: a = !1 }) {
|
|
3720
|
+
let [o, s] = v(null), [c, l] = v(""), u = te.useWatch((e) => e, e), d = p((e) => Xo(e, (e) => (u || {})[e]), [u]), f = p((t) => {
|
|
3689
3721
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3690
|
-
let n =
|
|
3722
|
+
let n = Wo(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3691
3723
|
return t.forEach((t) => {
|
|
3692
3724
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3693
|
-
let n =
|
|
3725
|
+
let n = Uo(t);
|
|
3694
3726
|
if (n.length === 0) return;
|
|
3695
3727
|
r = !0;
|
|
3696
|
-
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(
|
|
3728
|
+
let i = () => e.setFieldsValue({ [t.name]: n }), a = (e.getFieldValue(t.name) || []).filter(Jo);
|
|
3697
3729
|
if (a.length) {
|
|
3698
3730
|
let e = t.label || t.name;
|
|
3699
|
-
|
|
3731
|
+
io({
|
|
3700
3732
|
tone: "overwrite",
|
|
3701
3733
|
title: `Replace what's in ${e}?`,
|
|
3702
3734
|
facts: [
|
|
@@ -3726,9 +3758,9 @@ function ts({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3726
3758
|
return {
|
|
3727
3759
|
runAction: p(async (t, o, c, u) => {
|
|
3728
3760
|
let d = c?.confirmWhen ?? "never";
|
|
3729
|
-
if (c?.trigger === "upload" && d !== "never" && (d === "always" ||
|
|
3730
|
-
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r =
|
|
3731
|
-
if (!await
|
|
3761
|
+
if (c?.trigger === "upload" && d !== "never" && (d === "always" || ts(e, [o?.field], { includeUntouched: a }))) {
|
|
3762
|
+
let t = c.confirmMessages ?? {}, n = u?.name || e.getFieldValue(o?.field)?.slice?.(-1)?.[0]?.name, r = $o(e, [o?.field], { includeUntouched: a });
|
|
3763
|
+
if (!await io({
|
|
3732
3764
|
tone: "overwrite",
|
|
3733
3765
|
title: t.title || "Read this file and fill the form in?",
|
|
3734
3766
|
facts: [{
|
|
@@ -3752,12 +3784,12 @@ function ts({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3752
3784
|
r && (s[t.param] = r);
|
|
3753
3785
|
} else {
|
|
3754
3786
|
let n = e.getFieldValue(t.sourceField);
|
|
3755
|
-
n != null && n !== "" && (a[t.param] =
|
|
3787
|
+
n != null && n !== "" && (a[t.param] = Ko(n, t.transform));
|
|
3756
3788
|
}
|
|
3757
3789
|
}), (c.inputs || []).forEach((e) => {
|
|
3758
3790
|
!e.group || e.kind !== "text" || (c.inputs || []).some((t) => t.group === e.group && t.kind === "file" && s[t.param]) && delete a[e.param];
|
|
3759
3791
|
});
|
|
3760
|
-
let l = await
|
|
3792
|
+
let l = await oo({
|
|
3761
3793
|
module: n,
|
|
3762
3794
|
group: t,
|
|
3763
3795
|
field: o.field,
|
|
@@ -3765,9 +3797,9 @@ function ts({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3765
3797
|
inputs: a,
|
|
3766
3798
|
files: s
|
|
3767
3799
|
}), d = c.label || "AI action", p = l?.groups;
|
|
3768
|
-
if (c?.trigger !== "upload" &&
|
|
3769
|
-
let e = c.confirmMessages ?? {}, t =
|
|
3770
|
-
if (!await
|
|
3800
|
+
if (c?.trigger !== "upload" && rs(c, e, p)) {
|
|
3801
|
+
let e = c.confirmMessages ?? {}, t = Zo(p).length;
|
|
3802
|
+
if (!await io({
|
|
3771
3803
|
tone: "overwrite",
|
|
3772
3804
|
title: e.title || `Fill the form in from ${d}?`,
|
|
3773
3805
|
facts: [{
|
|
@@ -3788,7 +3820,7 @@ function ts({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3788
3820
|
field: o,
|
|
3789
3821
|
groupName: t,
|
|
3790
3822
|
responseGroups: p,
|
|
3791
|
-
payload:
|
|
3823
|
+
payload: ns(p)
|
|
3792
3824
|
});
|
|
3793
3825
|
if (e === !1 || e === "abort") return l;
|
|
3794
3826
|
}
|
|
@@ -3820,7 +3852,7 @@ function ts({ form: e, groups: t, module: n, onApplied: r, onParsed: i, treatPre
|
|
|
3820
3852
|
}
|
|
3821
3853
|
//#endregion
|
|
3822
3854
|
//#region src/components/form/AiActionButtons.jsx
|
|
3823
|
-
function
|
|
3855
|
+
function cs({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3824
3856
|
if (!t || t.length === 0) return null;
|
|
3825
3857
|
let a = e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start";
|
|
3826
3858
|
return /* @__PURE__ */ w(re, {
|
|
@@ -3841,18 +3873,18 @@ function ns({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3841
3873
|
}
|
|
3842
3874
|
//#endregion
|
|
3843
3875
|
//#region src/components/form/emailValidator.js
|
|
3844
|
-
function
|
|
3876
|
+
function ls(e) {
|
|
3845
3877
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3846
3878
|
if (!n) return !1;
|
|
3847
3879
|
let [, r, i] = n;
|
|
3848
3880
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3849
3881
|
}
|
|
3850
|
-
function
|
|
3851
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3882
|
+
function us(e = "Email", t) {
|
|
3883
|
+
return { validator: (n, r) => r == null || r === "" || ls(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3852
3884
|
}
|
|
3853
3885
|
//#endregion
|
|
3854
3886
|
//#region src/components/form/inputValidator.js
|
|
3855
|
-
var
|
|
3887
|
+
var ds = [
|
|
3856
3888
|
{
|
|
3857
3889
|
label: "Only Numbers",
|
|
3858
3890
|
value: "onlyNumber"
|
|
@@ -3925,7 +3957,7 @@ var as = [
|
|
|
3925
3957
|
label: "Website URL",
|
|
3926
3958
|
value: "websiteUrl"
|
|
3927
3959
|
}
|
|
3928
|
-
],
|
|
3960
|
+
], fs = {
|
|
3929
3961
|
onlyNumber: /^[0-9]$/,
|
|
3930
3962
|
experience: /^[0-9]$/,
|
|
3931
3963
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3941,10 +3973,10 @@ var as = [
|
|
|
3941
3973
|
decimalRange: /^[0-9.]$/,
|
|
3942
3974
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3943
3975
|
};
|
|
3944
|
-
function
|
|
3945
|
-
return
|
|
3976
|
+
function ps(e) {
|
|
3977
|
+
return fs[e] ?? null;
|
|
3946
3978
|
}
|
|
3947
|
-
function
|
|
3979
|
+
function ms(e, t = {}, n = "change") {
|
|
3948
3980
|
if (!t?.type || e == null) return {
|
|
3949
3981
|
cleaned: e ?? "",
|
|
3950
3982
|
error: null
|
|
@@ -4027,7 +4059,7 @@ function cs(e, t = {}, n = "change") {
|
|
|
4027
4059
|
break;
|
|
4028
4060
|
}
|
|
4029
4061
|
case "email":
|
|
4030
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
4062
|
+
c = n === "blur" ? r.trim() : r, c && !ls(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
4031
4063
|
break;
|
|
4032
4064
|
case "websiteUrl":
|
|
4033
4065
|
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.`);
|
|
@@ -4039,21 +4071,21 @@ function cs(e, t = {}, n = "change") {
|
|
|
4039
4071
|
error: l
|
|
4040
4072
|
};
|
|
4041
4073
|
}
|
|
4042
|
-
var
|
|
4043
|
-
function
|
|
4074
|
+
var hs = "This value is already present";
|
|
4075
|
+
function gs(e) {
|
|
4044
4076
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
4045
4077
|
}
|
|
4046
|
-
function
|
|
4047
|
-
if (
|
|
4078
|
+
function _s(e) {
|
|
4079
|
+
if (gs(e) !== "unique") return null;
|
|
4048
4080
|
if (typeof e == "string") return {
|
|
4049
|
-
message:
|
|
4081
|
+
message: hs,
|
|
4050
4082
|
normalizer: "trim",
|
|
4051
4083
|
skipBlank: !0,
|
|
4052
4084
|
validateOn: "blur"
|
|
4053
4085
|
};
|
|
4054
4086
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
4055
4087
|
return {
|
|
4056
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
4088
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : hs,
|
|
4057
4089
|
collectionField: t.collectionField ?? "",
|
|
4058
4090
|
normalizer: String(t.normalizer ?? "trim"),
|
|
4059
4091
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -4064,20 +4096,20 @@ function ds(e) {
|
|
|
4064
4096
|
].includes(n) ? n : "blur"
|
|
4065
4097
|
};
|
|
4066
4098
|
}
|
|
4067
|
-
function
|
|
4099
|
+
function vs(e) {
|
|
4068
4100
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
4069
4101
|
if (!Array.isArray(t)) return null;
|
|
4070
4102
|
for (let e of t) {
|
|
4071
|
-
let t =
|
|
4103
|
+
let t = _s(e);
|
|
4072
4104
|
if (t) return t;
|
|
4073
4105
|
}
|
|
4074
4106
|
return null;
|
|
4075
4107
|
}
|
|
4076
|
-
function
|
|
4108
|
+
function ys(e = []) {
|
|
4077
4109
|
let t = [];
|
|
4078
4110
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4079
4111
|
(e?.fields ?? []).forEach((e) => {
|
|
4080
|
-
let n =
|
|
4112
|
+
let n = vs(e);
|
|
4081
4113
|
!n || !e?.field || t.push({
|
|
4082
4114
|
field: e.field,
|
|
4083
4115
|
label: e.label ?? e.field,
|
|
@@ -4086,10 +4118,10 @@ function ps(e = []) {
|
|
|
4086
4118
|
});
|
|
4087
4119
|
}), t;
|
|
4088
4120
|
}
|
|
4089
|
-
function
|
|
4121
|
+
function bs(e) {
|
|
4090
4122
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
4091
4123
|
}
|
|
4092
|
-
function
|
|
4124
|
+
function xs(e, t = "trim") {
|
|
4093
4125
|
if (e == null) return "";
|
|
4094
4126
|
let n = String(e);
|
|
4095
4127
|
switch (String(t)) {
|
|
@@ -4101,10 +4133,10 @@ function hs(e, t = "trim") {
|
|
|
4101
4133
|
default: return n.trim();
|
|
4102
4134
|
}
|
|
4103
4135
|
}
|
|
4104
|
-
function
|
|
4105
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
4136
|
+
function Ss(e, t) {
|
|
4137
|
+
return !(!e || e.skipBlank !== !1 && bs(t));
|
|
4106
4138
|
}
|
|
4107
|
-
function
|
|
4139
|
+
function Cs(e) {
|
|
4108
4140
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
4109
4141
|
}
|
|
4110
4142
|
var Y = {
|
|
@@ -4114,21 +4146,21 @@ var Y = {
|
|
|
4114
4146
|
STALE: "stale",
|
|
4115
4147
|
ERROR: "error"
|
|
4116
4148
|
};
|
|
4117
|
-
function
|
|
4149
|
+
function ws({ module: e, field: t, recordId: n, normalized: r }) {
|
|
4118
4150
|
return `${e}${t}${n ?? ""}${r}`;
|
|
4119
4151
|
}
|
|
4120
|
-
function
|
|
4152
|
+
function Ts({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
4121
4153
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4122
4154
|
function o(e) {
|
|
4123
4155
|
a = e, typeof t == "function" && t(a);
|
|
4124
4156
|
}
|
|
4125
4157
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
4126
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
4127
|
-
let p =
|
|
4158
|
+
if (!c || !t || !s || typeof e != "function" || !Ss(c, l)) return { status: Y.SKIPPED };
|
|
4159
|
+
let p = ws({
|
|
4128
4160
|
module: t,
|
|
4129
4161
|
field: s,
|
|
4130
4162
|
recordId: u,
|
|
4131
|
-
normalized:
|
|
4163
|
+
normalized: xs(l, c.normalizer)
|
|
4132
4164
|
});
|
|
4133
4165
|
if (n.has(p)) return n.get(p);
|
|
4134
4166
|
i += 1;
|
|
@@ -4146,7 +4178,7 @@ function ys({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4146
4178
|
if (r.get(s) !== m) return { status: Y.STALE };
|
|
4147
4179
|
let a = i?.available === !1 ? {
|
|
4148
4180
|
status: Y.DUPLICATE,
|
|
4149
|
-
message:
|
|
4181
|
+
message: Es(i) || c.message || hs
|
|
4150
4182
|
} : { status: Y.AVAILABLE };
|
|
4151
4183
|
return n.set(p, a), a;
|
|
4152
4184
|
} catch (e) {
|
|
@@ -4167,17 +4199,17 @@ function ys({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
4167
4199
|
}
|
|
4168
4200
|
};
|
|
4169
4201
|
}
|
|
4170
|
-
function
|
|
4202
|
+
function Es(e) {
|
|
4171
4203
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
4172
4204
|
}
|
|
4173
|
-
var
|
|
4174
|
-
function
|
|
4175
|
-
let r =
|
|
4205
|
+
var Ds = "__uniqueRule";
|
|
4206
|
+
function Os({ field: e, validation: t, context: n }) {
|
|
4207
|
+
let r = _s(t);
|
|
4176
4208
|
if (!r) return { validator: () => Promise.resolve() };
|
|
4177
4209
|
let i = e?.field ?? "";
|
|
4178
4210
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
4179
|
-
[
|
|
4180
|
-
validateTrigger:
|
|
4211
|
+
[Ds]: r,
|
|
4212
|
+
validateTrigger: Cs(r),
|
|
4181
4213
|
validator: async (e, t) => {
|
|
4182
4214
|
let a = await n.checker.check({
|
|
4183
4215
|
module: n.module,
|
|
@@ -4192,22 +4224,22 @@ function Ss({ field: e, validation: t, context: n }) {
|
|
|
4192
4224
|
}
|
|
4193
4225
|
};
|
|
4194
4226
|
}
|
|
4195
|
-
function
|
|
4227
|
+
function ks(e = []) {
|
|
4196
4228
|
let t = Array.isArray(e) ? e : [];
|
|
4197
|
-
if (!t.some((e) => e && e[
|
|
4198
|
-
let n = t.filter((e) => e && !e[
|
|
4229
|
+
if (!t.some((e) => e && e[Ds])) return t;
|
|
4230
|
+
let n = t.filter((e) => e && !e[Ds] && !e.warningOnly);
|
|
4199
4231
|
return t.map((e) => {
|
|
4200
|
-
if (!e || !e[
|
|
4232
|
+
if (!e || !e[Ds]) return e;
|
|
4201
4233
|
let t = e.validator;
|
|
4202
4234
|
return {
|
|
4203
4235
|
...e,
|
|
4204
|
-
validator: async (e, r) => await
|
|
4236
|
+
validator: async (e, r) => await As(n, r, e) ? Promise.resolve() : t(e, r)
|
|
4205
4237
|
};
|
|
4206
4238
|
});
|
|
4207
4239
|
}
|
|
4208
|
-
async function
|
|
4240
|
+
async function As(e = [], t, n = {}) {
|
|
4209
4241
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
4210
|
-
if (r.required &&
|
|
4242
|
+
if (r.required && bs(t) || !bs(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;
|
|
4211
4243
|
if (typeof r.validator == "function") try {
|
|
4212
4244
|
await r.validator(n, t);
|
|
4213
4245
|
} catch {
|
|
@@ -4216,7 +4248,7 @@ async function ws(e = [], t, n = {}) {
|
|
|
4216
4248
|
}
|
|
4217
4249
|
return !1;
|
|
4218
4250
|
}
|
|
4219
|
-
function
|
|
4251
|
+
function js(e) {
|
|
4220
4252
|
let t = String(e ?? "").trim();
|
|
4221
4253
|
if (!t.startsWith("{")) return null;
|
|
4222
4254
|
try {
|
|
@@ -4225,19 +4257,19 @@ function Ts(e) {
|
|
|
4225
4257
|
return null;
|
|
4226
4258
|
}
|
|
4227
4259
|
}
|
|
4228
|
-
function
|
|
4260
|
+
function Ms(e) {
|
|
4229
4261
|
if (!e) return null;
|
|
4230
|
-
if (typeof e == "string") return
|
|
4262
|
+
if (typeof e == "string") return js(e);
|
|
4231
4263
|
let t = [
|
|
4232
4264
|
e.data,
|
|
4233
4265
|
e.response,
|
|
4234
4266
|
e,
|
|
4235
|
-
|
|
4267
|
+
js(e.message)
|
|
4236
4268
|
];
|
|
4237
4269
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
4238
4270
|
return null;
|
|
4239
4271
|
}
|
|
4240
|
-
function
|
|
4272
|
+
function Ns({ field: e, group: t, rowIndex: n }) {
|
|
4241
4273
|
let r = String(e ?? ""), i = Number(n);
|
|
4242
4274
|
return t && Number.isInteger(i) && i >= 0 ? [
|
|
4243
4275
|
String(t),
|
|
@@ -4245,14 +4277,14 @@ function Ds({ field: e, group: t, rowIndex: n }) {
|
|
|
4245
4277
|
...r.split(".")
|
|
4246
4278
|
] : r;
|
|
4247
4279
|
}
|
|
4248
|
-
function
|
|
4249
|
-
let n =
|
|
4280
|
+
function Ps(e, { uniqueRules: t = [] } = {}) {
|
|
4281
|
+
let n = Ms(e);
|
|
4250
4282
|
if (n) {
|
|
4251
4283
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => {
|
|
4252
4284
|
let t = {
|
|
4253
4285
|
field: e.field,
|
|
4254
|
-
name:
|
|
4255
|
-
message: e.message || n.message ||
|
|
4286
|
+
name: Ns(e),
|
|
4287
|
+
message: e.message || n.message || hs
|
|
4256
4288
|
};
|
|
4257
4289
|
return Array.isArray(t.name) && (t.group = String(e.group), t.rowIndex = Number(e.rowIndex)), t;
|
|
4258
4290
|
});
|
|
@@ -4269,29 +4301,29 @@ function Os(e, { uniqueRules: t = [] } = {}) {
|
|
|
4269
4301
|
}
|
|
4270
4302
|
//#endregion
|
|
4271
4303
|
//#region src/components/form/patternRule.js
|
|
4272
|
-
var
|
|
4273
|
-
function
|
|
4274
|
-
return !!(e && typeof e == "object" &&
|
|
4304
|
+
var Fs = (e) => e === !0 || e === 1 || e === "1" || typeof e == "string" && e.trim().toLowerCase() === "true";
|
|
4305
|
+
function Is(e) {
|
|
4306
|
+
return !!(e && typeof e == "object" && Fs(e.warningOnly));
|
|
4275
4307
|
}
|
|
4276
|
-
function
|
|
4308
|
+
function Ls({ label: e, message: t, rule: n }) {
|
|
4277
4309
|
let r = {
|
|
4278
4310
|
pattern: new RegExp(n.pattern ?? n.value, n.flags),
|
|
4279
4311
|
message: t ?? `Enter valid ${e}`
|
|
4280
4312
|
};
|
|
4281
|
-
return
|
|
4313
|
+
return Is(n) && (r.warningOnly = !0), r;
|
|
4282
4314
|
}
|
|
4283
|
-
function
|
|
4284
|
-
return
|
|
4315
|
+
function Rs(e) {
|
|
4316
|
+
return Is(e);
|
|
4285
4317
|
}
|
|
4286
|
-
function
|
|
4318
|
+
function zs(e, t) {
|
|
4287
4319
|
return e?.type === "pattern" && t?.warningOnly === !0 && (e.warningOnly = !0), e;
|
|
4288
4320
|
}
|
|
4289
|
-
function
|
|
4321
|
+
function Bs(e) {
|
|
4290
4322
|
return typeof e == "string" ? e.toUpperCase() : e;
|
|
4291
4323
|
}
|
|
4292
4324
|
//#endregion
|
|
4293
4325
|
//#region src/services/uniqueValidationApi.js
|
|
4294
|
-
async function
|
|
4326
|
+
async function Vs({ module: e, field: t, value: n, recordId: r, clientId: i, region: o } = {}) {
|
|
4295
4327
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
4296
4328
|
let c = {
|
|
4297
4329
|
field: t,
|
|
@@ -4325,7 +4357,7 @@ async function Fs({ module: e, field: t, value: n, recordId: r, clientId: i, reg
|
|
|
4325
4357
|
throw e;
|
|
4326
4358
|
}
|
|
4327
4359
|
}
|
|
4328
|
-
async function
|
|
4360
|
+
async function Hs({ module: e, payload: t, excludeId: n } = {}) {
|
|
4329
4361
|
if (!e || !t) return { duplicate: !1 };
|
|
4330
4362
|
try {
|
|
4331
4363
|
let r = await a(s, `/module/duplicate-check?module=${encodeURIComponent(e)}`, {
|
|
@@ -4343,7 +4375,7 @@ async function Is({ module: e, payload: t, excludeId: n } = {}) {
|
|
|
4343
4375
|
}
|
|
4344
4376
|
//#endregion
|
|
4345
4377
|
//#region src/components/form/uploadAccept.js
|
|
4346
|
-
var
|
|
4378
|
+
var Us = [
|
|
4347
4379
|
"jpg",
|
|
4348
4380
|
"jpeg",
|
|
4349
4381
|
"png",
|
|
@@ -4352,18 +4384,18 @@ var Ls = [
|
|
|
4352
4384
|
"bmp",
|
|
4353
4385
|
"svg",
|
|
4354
4386
|
"avif"
|
|
4355
|
-
],
|
|
4387
|
+
], Ws = [
|
|
4356
4388
|
"mp4",
|
|
4357
4389
|
"webm",
|
|
4358
4390
|
"ogg",
|
|
4359
4391
|
"ogv",
|
|
4360
4392
|
"mov",
|
|
4361
4393
|
"m4v"
|
|
4362
|
-
],
|
|
4394
|
+
], Gs = [
|
|
4363
4395
|
"pdf",
|
|
4364
4396
|
"doc",
|
|
4365
4397
|
"docx"
|
|
4366
|
-
],
|
|
4398
|
+
], Ks = [
|
|
4367
4399
|
{
|
|
4368
4400
|
label: "Any file",
|
|
4369
4401
|
value: "any"
|
|
@@ -4388,45 +4420,45 @@ var Ls = [
|
|
|
4388
4420
|
label: "Images & Videos",
|
|
4389
4421
|
value: "imagesAndVideos"
|
|
4390
4422
|
}
|
|
4391
|
-
],
|
|
4423
|
+
], qs = {
|
|
4392
4424
|
resume: {
|
|
4393
|
-
exts:
|
|
4425
|
+
exts: Gs,
|
|
4394
4426
|
maxSizeMB: 2,
|
|
4395
4427
|
hint: "PDF, DOC or DOCX",
|
|
4396
4428
|
error: "Only PDF, DOC, and DOCX resume files are supported."
|
|
4397
4429
|
},
|
|
4398
4430
|
documents: {
|
|
4399
|
-
exts: [...
|
|
4431
|
+
exts: [...Gs, ...Us],
|
|
4400
4432
|
hint: "PDF, DOC or image files",
|
|
4401
4433
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
4402
4434
|
},
|
|
4403
4435
|
images: {
|
|
4404
|
-
exts:
|
|
4436
|
+
exts: Us,
|
|
4405
4437
|
hint: "Image files",
|
|
4406
4438
|
error: "Only image files are allowed"
|
|
4407
4439
|
},
|
|
4408
4440
|
videos: {
|
|
4409
|
-
exts:
|
|
4441
|
+
exts: Ws,
|
|
4410
4442
|
hint: "Video files",
|
|
4411
4443
|
error: "Only video files are allowed"
|
|
4412
4444
|
},
|
|
4413
4445
|
imagesAndVideos: {
|
|
4414
|
-
exts: [...
|
|
4446
|
+
exts: [...Us, ...Ws],
|
|
4415
4447
|
hint: "Image or video files",
|
|
4416
4448
|
error: "Only image or video files are allowed"
|
|
4417
4449
|
}
|
|
4418
4450
|
};
|
|
4419
|
-
function
|
|
4451
|
+
function Js(e) {
|
|
4420
4452
|
let t = String(e?.field ?? e?.payloadKey ?? "").toLowerCase();
|
|
4421
4453
|
return t ? t.includes("resume") || t.includes("cv") || t.includes("curriculumvitae") : !1;
|
|
4422
4454
|
}
|
|
4423
|
-
function
|
|
4455
|
+
function Ys(e) {
|
|
4424
4456
|
let t = String(e?.accept ?? "").trim();
|
|
4425
|
-
return t && t !== "any" ?
|
|
4457
|
+
return t && t !== "any" ? qs[t] ?? null : !t && Js(e) ? qs.resume : qs[t] ?? null;
|
|
4426
4458
|
}
|
|
4427
4459
|
//#endregion
|
|
4428
4460
|
//#region src/components/form/quickActionLabels.js
|
|
4429
|
-
var
|
|
4461
|
+
var Xs = /* @__PURE__ */ new Set([
|
|
4430
4462
|
"of",
|
|
4431
4463
|
"and",
|
|
4432
4464
|
"the",
|
|
@@ -4435,7 +4467,7 @@ var Ws = /* @__PURE__ */ new Set([
|
|
|
4435
4467
|
"in",
|
|
4436
4468
|
"a",
|
|
4437
4469
|
"an"
|
|
4438
|
-
]),
|
|
4470
|
+
]), Zs = {
|
|
4439
4471
|
addresses: "address",
|
|
4440
4472
|
branches: "branch",
|
|
4441
4473
|
batches: "batch",
|
|
@@ -4446,43 +4478,43 @@ var Ws = /* @__PURE__ */ new Set([
|
|
|
4446
4478
|
people: "person",
|
|
4447
4479
|
statuses: "status"
|
|
4448
4480
|
};
|
|
4449
|
-
function
|
|
4481
|
+
function Qs(e) {
|
|
4450
4482
|
let t = String(e ?? "").trim();
|
|
4451
4483
|
if (!t) return "";
|
|
4452
4484
|
if (t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t)) return t;
|
|
4453
4485
|
let n = t.toLowerCase();
|
|
4454
|
-
return
|
|
4486
|
+
return Zs[n] ? Zs[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;
|
|
4455
4487
|
}
|
|
4456
|
-
function
|
|
4488
|
+
function X(e) {
|
|
4457
4489
|
let t = String(e ?? "").trim();
|
|
4458
4490
|
if (!t) return "";
|
|
4459
4491
|
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);
|
|
4460
4492
|
if (!n.length) return "";
|
|
4461
|
-
let r =
|
|
4493
|
+
let r = Qs(n[n.length - 1]);
|
|
4462
4494
|
return [...n.slice(0, -1), r].map((e, t) => {
|
|
4463
4495
|
let n = e.toLowerCase();
|
|
4464
|
-
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 &&
|
|
4496
|
+
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && Xs.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4465
4497
|
}).join(" ");
|
|
4466
4498
|
}
|
|
4467
|
-
function
|
|
4499
|
+
function $s(e, t) {
|
|
4468
4500
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4469
4501
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4470
|
-
let r =
|
|
4502
|
+
let r = X(e?.quickCreateModule || t);
|
|
4471
4503
|
return r ? `Add New ${r}` : "Add New";
|
|
4472
4504
|
}
|
|
4473
|
-
function
|
|
4505
|
+
function ec(e, t) {
|
|
4474
4506
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4475
4507
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4476
|
-
let r =
|
|
4508
|
+
let r = X(e?.quickEditModule || t);
|
|
4477
4509
|
return r ? `Edit ${r}` : "Edit";
|
|
4478
4510
|
}
|
|
4479
|
-
function
|
|
4480
|
-
let r =
|
|
4481
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4511
|
+
function tc(e, t, n) {
|
|
4512
|
+
let r = X((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4513
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : $s(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : ec(t, n));
|
|
4482
4514
|
}
|
|
4483
4515
|
//#endregion
|
|
4484
4516
|
//#region src/components/AppButton.jsx
|
|
4485
|
-
function
|
|
4517
|
+
function nc({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4486
4518
|
let o = /* @__PURE__ */ w(b, {
|
|
4487
4519
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4488
4520
|
icon: n,
|
|
@@ -4497,13 +4529,13 @@ function Zs({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4497
4529
|
}
|
|
4498
4530
|
//#endregion
|
|
4499
4531
|
//#region src/components/detail/userNames.js
|
|
4500
|
-
function
|
|
4532
|
+
function rc(e) {
|
|
4501
4533
|
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 || "";
|
|
4502
4534
|
}
|
|
4503
|
-
function
|
|
4535
|
+
function ic(e) {
|
|
4504
4536
|
let t = {};
|
|
4505
4537
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4506
|
-
let n =
|
|
4538
|
+
let n = rc(e);
|
|
4507
4539
|
n && [
|
|
4508
4540
|
e.legacyUserId,
|
|
4509
4541
|
e.userId,
|
|
@@ -4517,29 +4549,29 @@ function $s(e) {
|
|
|
4517
4549
|
});
|
|
4518
4550
|
}), t;
|
|
4519
4551
|
}
|
|
4520
|
-
var
|
|
4521
|
-
function
|
|
4552
|
+
var ac = /* @__PURE__ */ new Map();
|
|
4553
|
+
function oc(e) {
|
|
4522
4554
|
let t = String(e ?? "").trim();
|
|
4523
4555
|
if (!t) return Promise.resolve("");
|
|
4524
|
-
if (
|
|
4525
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4526
|
-
return
|
|
4556
|
+
if (ac.has(t)) return ac.get(t);
|
|
4557
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => rc(e?.data ?? e ?? null)).catch(() => "");
|
|
4558
|
+
return ac.set(t, n), n;
|
|
4527
4559
|
}
|
|
4528
|
-
var
|
|
4529
|
-
function
|
|
4560
|
+
var Z = (e) => e == null ? "" : String(e).trim();
|
|
4561
|
+
function sc(e) {
|
|
4530
4562
|
let t = e?.quickCreateNotice;
|
|
4531
4563
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4532
4564
|
enabled: !0,
|
|
4533
|
-
title:
|
|
4534
|
-
message:
|
|
4565
|
+
title: Z(t.title) || "New record created",
|
|
4566
|
+
message: Z(t.message) || "A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.",
|
|
4535
4567
|
showCreator: t.showCreator !== !1,
|
|
4536
4568
|
showRecordName: t.showRecordName !== !1,
|
|
4537
|
-
recordNameField:
|
|
4538
|
-
recordLabel:
|
|
4539
|
-
creatorLabel:
|
|
4569
|
+
recordNameField: Z(t.recordNameField),
|
|
4570
|
+
recordLabel: Z(t.recordLabel) || "Record name",
|
|
4571
|
+
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
4540
4572
|
};
|
|
4541
4573
|
}
|
|
4542
|
-
var
|
|
4574
|
+
var cc = [
|
|
4543
4575
|
"clientName",
|
|
4544
4576
|
"companyName",
|
|
4545
4577
|
"name",
|
|
@@ -4549,24 +4581,24 @@ var rc = [
|
|
|
4549
4581
|
"label",
|
|
4550
4582
|
"employerName",
|
|
4551
4583
|
"vendorName"
|
|
4552
|
-
],
|
|
4584
|
+
], lc = (e, t) => {
|
|
4553
4585
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4554
|
-
},
|
|
4555
|
-
function
|
|
4586
|
+
}, uc = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4587
|
+
function dc(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4556
4588
|
if (!e || typeof e != "object") return "";
|
|
4557
4589
|
for (let r of [
|
|
4558
4590
|
t,
|
|
4559
4591
|
n,
|
|
4560
|
-
...
|
|
4592
|
+
...cc
|
|
4561
4593
|
]) {
|
|
4562
4594
|
if (!r) continue;
|
|
4563
|
-
let t =
|
|
4595
|
+
let t = uc(lc(e, r));
|
|
4564
4596
|
if (t) return t;
|
|
4565
4597
|
}
|
|
4566
4598
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4567
|
-
return r ?
|
|
4599
|
+
return r ? Z(e[r]) : "";
|
|
4568
4600
|
}
|
|
4569
|
-
function
|
|
4601
|
+
function fc(e) {
|
|
4570
4602
|
if (!e || typeof e != "object") return "";
|
|
4571
4603
|
let t = [
|
|
4572
4604
|
e.createdBy,
|
|
@@ -4579,76 +4611,76 @@ function sc(e) {
|
|
|
4579
4611
|
for (let e of t) {
|
|
4580
4612
|
if (e == null || e === "") continue;
|
|
4581
4613
|
if (typeof e == "object") {
|
|
4582
|
-
let t =
|
|
4614
|
+
let t = Z(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
4583
4615
|
if (t) return t;
|
|
4584
4616
|
continue;
|
|
4585
4617
|
}
|
|
4586
|
-
let t =
|
|
4618
|
+
let t = Z(e);
|
|
4587
4619
|
if (t) return t;
|
|
4588
4620
|
}
|
|
4589
4621
|
return "";
|
|
4590
4622
|
}
|
|
4591
|
-
function
|
|
4623
|
+
function pc(e = i) {
|
|
4592
4624
|
try {
|
|
4593
|
-
return
|
|
4625
|
+
return rc(e()) || "";
|
|
4594
4626
|
} catch {
|
|
4595
4627
|
return "";
|
|
4596
4628
|
}
|
|
4597
4629
|
}
|
|
4598
|
-
var
|
|
4630
|
+
var mc = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4599
4631
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4600
4632
|
return Array.isArray(t) ? t[0] : t;
|
|
4601
4633
|
});
|
|
4602
|
-
async function
|
|
4603
|
-
let { fetchRecord: o =
|
|
4634
|
+
async function hc({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4635
|
+
let { fetchRecord: o = mc, fetchUserNameFn: s = oc, getUser: c = i } = a, l = null;
|
|
4604
4636
|
if (e && t) try {
|
|
4605
4637
|
l = await o(e, t);
|
|
4606
4638
|
} catch {
|
|
4607
4639
|
l = null;
|
|
4608
4640
|
}
|
|
4609
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4641
|
+
let u = n?.showRecordName === !1 ? "" : dc(l, {
|
|
4610
4642
|
recordNameField: n?.recordNameField,
|
|
4611
4643
|
displayField: r
|
|
4612
4644
|
}), d = "";
|
|
4613
4645
|
if (n?.showCreator !== !1) {
|
|
4614
|
-
let e =
|
|
4646
|
+
let e = fc(l);
|
|
4615
4647
|
if (e) try {
|
|
4616
|
-
d =
|
|
4648
|
+
d = Z(await s(e));
|
|
4617
4649
|
} catch {
|
|
4618
4650
|
d = "";
|
|
4619
4651
|
}
|
|
4620
|
-
d ||=
|
|
4652
|
+
d ||= pc(c);
|
|
4621
4653
|
}
|
|
4622
4654
|
return {
|
|
4623
4655
|
recordName: u,
|
|
4624
4656
|
creatorName: d
|
|
4625
4657
|
};
|
|
4626
4658
|
}
|
|
4627
|
-
var
|
|
4628
|
-
function
|
|
4659
|
+
var gc = (e, t) => e?.quickCreate ? e.quickCreateOnType === !0 || e.quickCreateOnType !== !1 && t === "submissions" && e.quickCreateModule === "employers" : !1;
|
|
4660
|
+
function _c(e) {
|
|
4629
4661
|
return String(e ?? "").trim().replace(/\s+/g, " ");
|
|
4630
4662
|
}
|
|
4631
|
-
var
|
|
4632
|
-
function
|
|
4633
|
-
let n =
|
|
4634
|
-
return !n || !Array.isArray(t) ? null : t.find((e) =>
|
|
4663
|
+
var vc = (e) => _c(e).toLowerCase();
|
|
4664
|
+
function yc(e, t) {
|
|
4665
|
+
let n = vc(e);
|
|
4666
|
+
return !n || !Array.isArray(t) ? null : t.find((e) => vc(e?.label) === n) ?? null;
|
|
4635
4667
|
}
|
|
4636
|
-
function
|
|
4637
|
-
return t || n ? !1 :
|
|
4668
|
+
function bc({ text: e, disabled: t = !1, modalOpen: n = !1 }) {
|
|
4669
|
+
return t || n ? !1 : _c(e).length >= 3;
|
|
4638
4670
|
}
|
|
4639
4671
|
//#endregion
|
|
4640
4672
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4641
|
-
var
|
|
4642
|
-
function
|
|
4673
|
+
var xc = f(() => import("./index.js").then((e) => e.i)), Sc = f(() => import("./index.js").then((e) => e.n)), Cc = (e) => e == null || e === "", wc = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4674
|
+
function Tc(e, t, n, r, i) {
|
|
4643
4675
|
let a = e.quickEditIdFrom;
|
|
4644
4676
|
if (a) {
|
|
4645
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4646
|
-
return
|
|
4677
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...wc(a)] : wc(a), i = t?.getFieldValue?.(e);
|
|
4678
|
+
return Cc(i) && (i = r?.[a]), Cc(i) ? null : i;
|
|
4647
4679
|
}
|
|
4648
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4680
|
+
return i && typeof i == "object" ? i.value ?? null : Cc(i) ? null : i;
|
|
4649
4681
|
}
|
|
4650
|
-
function
|
|
4651
|
-
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 ?
|
|
4682
|
+
function Ec({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4683
|
+
let [s, c] = v(null), [l, d] = v(null), f = !!e?.quickCreate, p = !!e?.quickEdit, m = e?.quickCreateModule || e?.lookupCollection || "", h = e?.quickEditModule || e?.lookupCollection || "", _ = g(() => p ? Tc(e, t, n, i, a) : null, [
|
|
4652
4684
|
p,
|
|
4653
4685
|
e,
|
|
4654
4686
|
t,
|
|
@@ -4662,7 +4694,7 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4662
4694
|
openCreateWith: null,
|
|
4663
4695
|
isModalOpen: !1
|
|
4664
4696
|
};
|
|
4665
|
-
let ee =
|
|
4697
|
+
let ee = gc(e, r), y = () => c(null), x = () => {
|
|
4666
4698
|
if (e?.quickCreateOnClick) {
|
|
4667
4699
|
e.quickCreateOnClick(), document.activeElement?.blur?.();
|
|
4668
4700
|
return;
|
|
@@ -4686,12 +4718,12 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4686
4718
|
module: h,
|
|
4687
4719
|
recordId: String(_)
|
|
4688
4720
|
}), oe = (t) => {
|
|
4689
|
-
let n =
|
|
4721
|
+
let n = sc(e);
|
|
4690
4722
|
n && (d({
|
|
4691
4723
|
...n,
|
|
4692
4724
|
recordName: "",
|
|
4693
4725
|
creatorName: ""
|
|
4694
|
-
}),
|
|
4726
|
+
}), hc({
|
|
4695
4727
|
module: m,
|
|
4696
4728
|
recordId: t,
|
|
4697
4729
|
notice: n,
|
|
@@ -4721,20 +4753,20 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4721
4753
|
icon: /* @__PURE__ */ w(ge, {}),
|
|
4722
4754
|
onClick: x,
|
|
4723
4755
|
style: { paddingLeft: 0 },
|
|
4724
|
-
children:
|
|
4756
|
+
children: $s(e, m)
|
|
4725
4757
|
}), p && /* @__PURE__ */ w(b, {
|
|
4726
4758
|
type: "link",
|
|
4727
4759
|
size: "small",
|
|
4728
4760
|
icon: /* @__PURE__ */ w(ce, {}),
|
|
4729
4761
|
onClick: ae,
|
|
4730
4762
|
disabled: !_,
|
|
4731
|
-
title: _ ? void 0 : `Choose a ${
|
|
4732
|
-
children:
|
|
4763
|
+
title: _ ? void 0 : `Choose a ${X(h) || "record"} above first, then edit it here`,
|
|
4764
|
+
children: ec(e, h)
|
|
4733
4765
|
})]
|
|
4734
4766
|
})
|
|
4735
4767
|
}), ue = s ? /* @__PURE__ */ w(ne, {
|
|
4736
4768
|
open: !0,
|
|
4737
|
-
title:
|
|
4769
|
+
title: tc(s.mode, e, s.mode === "create" ? m : h),
|
|
4738
4770
|
width: "min(1080px, 96vw)",
|
|
4739
4771
|
footer: null,
|
|
4740
4772
|
destroyOnClose: !0,
|
|
@@ -4752,7 +4784,7 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4752
4784
|
},
|
|
4753
4785
|
children: /* @__PURE__ */ w(ie, {})
|
|
4754
4786
|
}),
|
|
4755
|
-
children: s.mode === "create" ? /* @__PURE__ */ w(
|
|
4787
|
+
children: s.mode === "create" ? /* @__PURE__ */ w(xc, {
|
|
4756
4788
|
moduleName: s.module,
|
|
4757
4789
|
embedded: !0,
|
|
4758
4790
|
breadcrumbItems: [],
|
|
@@ -4761,7 +4793,7 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4761
4793
|
onSuccess: (e) => {
|
|
4762
4794
|
y(), oe(e), o?.("create", e);
|
|
4763
4795
|
}
|
|
4764
|
-
}) : /* @__PURE__ */ w(
|
|
4796
|
+
}) : /* @__PURE__ */ w(Sc, {
|
|
4765
4797
|
moduleName: s.module,
|
|
4766
4798
|
recordId: s.recordId,
|
|
4767
4799
|
embedded: !0,
|
|
@@ -4785,7 +4817,7 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4785
4817
|
width: "min(520px, 94vw)",
|
|
4786
4818
|
maskClosable: !1,
|
|
4787
4819
|
onCancel: () => d(null),
|
|
4788
|
-
footer: /* @__PURE__ */ w(
|
|
4820
|
+
footer: /* @__PURE__ */ w(nc, {
|
|
4789
4821
|
variant: "primary",
|
|
4790
4822
|
type: "primary",
|
|
4791
4823
|
onClick: () => d(null),
|
|
@@ -4824,8 +4856,8 @@ function xc({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4824
4856
|
}
|
|
4825
4857
|
//#endregion
|
|
4826
4858
|
//#region src/components/form/crossFieldRules.js
|
|
4827
|
-
var
|
|
4828
|
-
function
|
|
4859
|
+
var Dc = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4860
|
+
function Oc(e, t, n) {
|
|
4829
4861
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4830
4862
|
if (typeof n == "function") {
|
|
4831
4863
|
let e = n(t);
|
|
@@ -4833,23 +4865,23 @@ function Cc(e, t, n) {
|
|
|
4833
4865
|
}
|
|
4834
4866
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4835
4867
|
}
|
|
4836
|
-
function
|
|
4868
|
+
function kc({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4837
4869
|
let s = n.field ?? n.compareField ?? r;
|
|
4838
4870
|
return { validator: async (n, r) => {
|
|
4839
|
-
if (!s ||
|
|
4840
|
-
let c = i?.getFieldValue?.(
|
|
4841
|
-
if (
|
|
4871
|
+
if (!s || Dc(r)) return Promise.resolve();
|
|
4872
|
+
let c = i?.getFieldValue?.(Oc(a, s, o));
|
|
4873
|
+
if (Dc(c)) return Promise.resolve();
|
|
4842
4874
|
let l = Number(c), u = Number(r);
|
|
4843
4875
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4844
4876
|
} };
|
|
4845
4877
|
}
|
|
4846
|
-
function
|
|
4878
|
+
function Ac(e = {}, t, n) {
|
|
4847
4879
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4848
|
-
return r ?
|
|
4880
|
+
return r ? Oc(t, r, n) : null;
|
|
4849
4881
|
}
|
|
4850
4882
|
//#endregion
|
|
4851
4883
|
//#region src/components/form/maxCeiling.js
|
|
4852
|
-
function
|
|
4884
|
+
function jc(e, t) {
|
|
4853
4885
|
let n = String(t).split(".").filter(Boolean);
|
|
4854
4886
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4855
4887
|
if (n.length > 1) {
|
|
@@ -4862,14 +4894,14 @@ function Ec(e, t) {
|
|
|
4862
4894
|
let r = [...e];
|
|
4863
4895
|
return r[r.length - 1] = n[0], r;
|
|
4864
4896
|
}
|
|
4865
|
-
function
|
|
4866
|
-
let r = e?.getFieldValue?.(
|
|
4897
|
+
function Mc(e, t, n) {
|
|
4898
|
+
let r = e?.getFieldValue?.(jc(t, n));
|
|
4867
4899
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4868
4900
|
}
|
|
4869
|
-
function
|
|
4901
|
+
function Nc(e) {
|
|
4870
4902
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4871
4903
|
}
|
|
4872
|
-
function
|
|
4904
|
+
function Pc(e, t) {
|
|
4873
4905
|
for (let n of e ?? []) {
|
|
4874
4906
|
let e = t(n);
|
|
4875
4907
|
if (e == null || e === "") continue;
|
|
@@ -4881,14 +4913,14 @@ function kc(e, t) {
|
|
|
4881
4913
|
}
|
|
4882
4914
|
return null;
|
|
4883
4915
|
}
|
|
4884
|
-
function
|
|
4916
|
+
function Fc({ input: e, compareFields: t, readValue: n }) {
|
|
4885
4917
|
let r = {
|
|
4886
4918
|
ok: !0,
|
|
4887
4919
|
field: null,
|
|
4888
4920
|
maximum: null
|
|
4889
4921
|
};
|
|
4890
4922
|
if (e == null || e === "") return r;
|
|
4891
|
-
let i =
|
|
4923
|
+
let i = Pc(t, n);
|
|
4892
4924
|
if (!i) return r;
|
|
4893
4925
|
let a = Number(e);
|
|
4894
4926
|
return Number.isFinite(a) ? {
|
|
@@ -4899,39 +4931,39 @@ function Ac({ input: e, compareFields: t, readValue: n }) {
|
|
|
4899
4931
|
}
|
|
4900
4932
|
//#endregion
|
|
4901
4933
|
//#region src/components/form/contextPrefill.js
|
|
4902
|
-
var
|
|
4903
|
-
function
|
|
4934
|
+
var Ic = { candidates: ["applicantId"] };
|
|
4935
|
+
function Lc(e) {
|
|
4904
4936
|
let t = String(e ?? "").trim();
|
|
4905
4937
|
if (!t) return [];
|
|
4906
4938
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4907
4939
|
return [.../* @__PURE__ */ new Set([
|
|
4908
4940
|
`${n}Id`,
|
|
4909
4941
|
`${t}Id`,
|
|
4910
|
-
...
|
|
4942
|
+
...Ic[t] ?? []
|
|
4911
4943
|
])];
|
|
4912
4944
|
}
|
|
4913
|
-
function
|
|
4945
|
+
function Rc(e, t) {
|
|
4914
4946
|
if (!t) return "";
|
|
4915
4947
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4916
|
-
for (let r of
|
|
4948
|
+
for (let r of Lc(e)) {
|
|
4917
4949
|
let e = String(n(t[r]) || "");
|
|
4918
4950
|
if (e) return e;
|
|
4919
4951
|
}
|
|
4920
4952
|
return "";
|
|
4921
4953
|
}
|
|
4922
|
-
function
|
|
4954
|
+
function zc(e, t) {
|
|
4923
4955
|
let n = /* @__PURE__ */ new Set();
|
|
4924
4956
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4925
4957
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4926
4958
|
})), [...n];
|
|
4927
4959
|
}
|
|
4928
|
-
function
|
|
4960
|
+
function Bc(e) {
|
|
4929
4961
|
return e?.payloadMode === "skip";
|
|
4930
4962
|
}
|
|
4931
|
-
function
|
|
4963
|
+
function Vc(e) {
|
|
4932
4964
|
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 : [];
|
|
4933
4965
|
}
|
|
4934
|
-
function
|
|
4966
|
+
function Hc(e) {
|
|
4935
4967
|
let t = {};
|
|
4936
4968
|
return (e ?? []).forEach((e) => {
|
|
4937
4969
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4939,7 +4971,7 @@ function Lc(e) {
|
|
|
4939
4971
|
});
|
|
4940
4972
|
}), t;
|
|
4941
4973
|
}
|
|
4942
|
-
function
|
|
4974
|
+
function Uc(e, t) {
|
|
4943
4975
|
if (!e || !t) return;
|
|
4944
4976
|
let n = e;
|
|
4945
4977
|
for (let e of String(t).split(".")) {
|
|
@@ -4954,7 +4986,7 @@ function Rc(e, t) {
|
|
|
4954
4986
|
}
|
|
4955
4987
|
return n;
|
|
4956
4988
|
}
|
|
4957
|
-
function
|
|
4989
|
+
function Wc(e, t) {
|
|
4958
4990
|
if (!(!e || !t)) for (let n of [
|
|
4959
4991
|
t.prefillFrom,
|
|
4960
4992
|
t.field,
|
|
@@ -4962,13 +4994,13 @@ function zc(e, t) {
|
|
|
4962
4994
|
]) {
|
|
4963
4995
|
if (!n) continue;
|
|
4964
4996
|
let t = e[n];
|
|
4965
|
-
if (t ??= V(e, n), t ??=
|
|
4997
|
+
if (t ??= V(e, n), t ??= Uc(e, n), t != null) return t;
|
|
4966
4998
|
}
|
|
4967
4999
|
}
|
|
4968
5000
|
//#endregion
|
|
4969
5001
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
4970
|
-
function
|
|
4971
|
-
let a =
|
|
5002
|
+
function Gc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
5003
|
+
let a = Ki(t), o = te.useWatch(n, e);
|
|
4972
5004
|
if (!a) return null;
|
|
4973
5005
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
4974
5006
|
setTimeout(() => {
|
|
@@ -4979,7 +5011,7 @@ function Bc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4979
5011
|
e.setFieldValue(n, !1), c();
|
|
4980
5012
|
return;
|
|
4981
5013
|
}
|
|
4982
|
-
let i = await
|
|
5014
|
+
let i = await io($i(t));
|
|
4983
5015
|
e.setFieldValue(n, !!i), c();
|
|
4984
5016
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
4985
5017
|
return /* @__PURE__ */ w(ae, {
|
|
@@ -4998,34 +5030,98 @@ function Bc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4998
5030
|
}
|
|
4999
5031
|
//#endregion
|
|
5000
5032
|
//#region src/components/form/prefillWhenRules.js
|
|
5001
|
-
var
|
|
5002
|
-
function
|
|
5033
|
+
var Kc = (e) => String(e ?? "");
|
|
5034
|
+
function qc(e) {
|
|
5003
5035
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5004
5036
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5005
5037
|
let r = e?.field;
|
|
5006
5038
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
5007
5039
|
}), n;
|
|
5008
5040
|
}
|
|
5009
|
-
function
|
|
5010
|
-
return
|
|
5041
|
+
function Jc(e, t, n, r) {
|
|
5042
|
+
return qc(e).map((e) => ({
|
|
5011
5043
|
field: e,
|
|
5012
5044
|
path: n(t, e, r)
|
|
5013
5045
|
}));
|
|
5014
5046
|
}
|
|
5015
|
-
function
|
|
5016
|
-
return !e || !e.field ? !1 :
|
|
5047
|
+
function Yc(e, t = {}) {
|
|
5048
|
+
return !e || !e.field ? !1 : Kc(t[e.field]) === Kc(e.value);
|
|
5017
5049
|
}
|
|
5018
|
-
function
|
|
5019
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
5050
|
+
function Xc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
5051
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Yc(e, t));
|
|
5020
5052
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
5021
5053
|
action: "set",
|
|
5022
5054
|
value: o.setValue
|
|
5023
|
-
} : i && r !== void 0 &&
|
|
5055
|
+
} : i && r !== void 0 && Kc(n) === Kc(r) ? { action: "clear" } : { action: "none" };
|
|
5056
|
+
}
|
|
5057
|
+
//#endregion
|
|
5058
|
+
//#region src/components/form/computeFromRules.js
|
|
5059
|
+
var Zc = ["daysUntil"], Qc = (e) => e == null || e === "", $c = (e) => String(e ?? "");
|
|
5060
|
+
function el(e) {
|
|
5061
|
+
return !!(e && Zc.includes(e.type) && e.field);
|
|
5062
|
+
}
|
|
5063
|
+
function tl(e) {
|
|
5064
|
+
if (Qc(e)) return null;
|
|
5065
|
+
let t = E.isDayjs(e) ? e : E(e?.$date ?? e);
|
|
5066
|
+
return t.isValid() ? t.format("YYYY-MM-DD") : null;
|
|
5067
|
+
}
|
|
5068
|
+
function nl(e, t) {
|
|
5069
|
+
let n = tl(e), r = tl(t ?? E());
|
|
5070
|
+
if (!(!n || !r)) return Math.max(0, E(n).diff(E(r), "day"));
|
|
5071
|
+
}
|
|
5072
|
+
function rl(e, t, n) {
|
|
5073
|
+
if (el(e)) switch (e.type) {
|
|
5074
|
+
case "daysUntil": return nl(t, n);
|
|
5075
|
+
default: return;
|
|
5076
|
+
}
|
|
5077
|
+
}
|
|
5078
|
+
function il(e, t, n, r) {
|
|
5079
|
+
let i = Object.entries(e?.setFields || {}).filter(([e]) => !!e).map(([e, i]) => ({
|
|
5080
|
+
field: e,
|
|
5081
|
+
path: n(t, e, r),
|
|
5082
|
+
value: i
|
|
5083
|
+
}));
|
|
5084
|
+
return {
|
|
5085
|
+
source: n(t, e.field, r),
|
|
5086
|
+
setFields: i
|
|
5087
|
+
};
|
|
5088
|
+
}
|
|
5089
|
+
function al({ cfg: e, sourceValue: t, previousSource: n, current: r, lastApplied: i, today: a } = {}) {
|
|
5090
|
+
if (!el(e) || Qc(t) || tl(t) === tl(n)) return { action: "none" };
|
|
5091
|
+
let o = rl(e, t, a);
|
|
5092
|
+
if (o === void 0) return { action: "none" };
|
|
5093
|
+
if (Qc(n)) {
|
|
5094
|
+
let e = i !== void 0 && $c(r) === $c(i);
|
|
5095
|
+
if (!Qc(r) && !e) return { action: "none" };
|
|
5096
|
+
}
|
|
5097
|
+
return $c(r) === $c(o) ? { action: "none" } : {
|
|
5098
|
+
action: "set",
|
|
5099
|
+
value: o
|
|
5100
|
+
};
|
|
5101
|
+
}
|
|
5102
|
+
//#endregion
|
|
5103
|
+
//#region src/components/form/ComputeFromWatcher.jsx
|
|
5104
|
+
function ol({ form: e, config: t, sourcePath: n, targetPath: r, setFields: i = [] }) {
|
|
5105
|
+
let a = te.useWatch(n, {
|
|
5106
|
+
form: e,
|
|
5107
|
+
preserve: !0
|
|
5108
|
+
}), o = _(void 0), s = _(void 0), c = a?.format ? a.format("YYYY-MM-DD") : String(a ?? "");
|
|
5109
|
+
return h(() => {
|
|
5110
|
+
let n = al({
|
|
5111
|
+
cfg: t,
|
|
5112
|
+
sourceValue: a,
|
|
5113
|
+
previousSource: o.current,
|
|
5114
|
+
current: e.getFieldValue(r),
|
|
5115
|
+
lastApplied: s.current,
|
|
5116
|
+
today: or()
|
|
5117
|
+
});
|
|
5118
|
+
o.current = a, n.action === "set" && (e.setFieldValue(r, n.value), s.current = n.value, i.forEach(({ path: t, value: n }) => e.setFieldValue(t, n)));
|
|
5119
|
+
}, [c]), null;
|
|
5024
5120
|
}
|
|
5025
5121
|
//#endregion
|
|
5026
5122
|
//#region src/components/form/optionConstraints.js
|
|
5027
|
-
var
|
|
5028
|
-
function
|
|
5123
|
+
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
5124
|
+
function sl(e) {
|
|
5029
5125
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
5030
5126
|
return t.forEach((e) => {
|
|
5031
5127
|
if (e != null && e !== "") {
|
|
@@ -5037,50 +5133,50 @@ function Kc(e) {
|
|
|
5037
5133
|
e.label,
|
|
5038
5134
|
e.name
|
|
5039
5135
|
].forEach((e) => {
|
|
5040
|
-
e != null && e !== "" && n.push(
|
|
5136
|
+
e != null && e !== "" && n.push(Q(e));
|
|
5041
5137
|
});
|
|
5042
5138
|
return;
|
|
5043
5139
|
}
|
|
5044
|
-
n.push(
|
|
5140
|
+
n.push(Q(e));
|
|
5045
5141
|
}
|
|
5046
5142
|
}), n;
|
|
5047
5143
|
}
|
|
5048
|
-
function
|
|
5049
|
-
let n =
|
|
5144
|
+
function cl(e = [], t) {
|
|
5145
|
+
let n = sl(t);
|
|
5050
5146
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5051
|
-
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(
|
|
5147
|
+
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)));
|
|
5052
5148
|
return i.length > 0 ? i : e;
|
|
5053
5149
|
}
|
|
5054
|
-
function
|
|
5150
|
+
function ll(e) {
|
|
5055
5151
|
let t = [];
|
|
5056
5152
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
5057
|
-
e != null && e !== "" && t.push(
|
|
5153
|
+
e != null && e !== "" && t.push(Q(e));
|
|
5058
5154
|
}), t;
|
|
5059
5155
|
}
|
|
5060
|
-
function
|
|
5156
|
+
function ul(e, t = {}) {
|
|
5061
5157
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
5062
5158
|
return n.forEach((e) => {
|
|
5063
5159
|
if (!e || e.clearValue) return;
|
|
5064
|
-
let n =
|
|
5160
|
+
let n = ll(e);
|
|
5065
5161
|
if (!n.length) return;
|
|
5066
|
-
let a =
|
|
5162
|
+
let a = Yc(e, t) ? i : r;
|
|
5067
5163
|
n.forEach((e) => a.add(e));
|
|
5068
5164
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
5069
5165
|
}
|
|
5070
|
-
function
|
|
5071
|
-
let r =
|
|
5166
|
+
function dl(e = [], t, n) {
|
|
5167
|
+
let r = ul(t, n);
|
|
5072
5168
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
5073
5169
|
let i = new Set(r);
|
|
5074
|
-
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(
|
|
5170
|
+
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
5075
5171
|
}
|
|
5076
|
-
function
|
|
5172
|
+
function fl(e, t = {}, n) {
|
|
5077
5173
|
let r = Array.isArray(e) ? e : [];
|
|
5078
5174
|
if (n == null || n === "") return [];
|
|
5079
|
-
let i =
|
|
5175
|
+
let i = Q(n), a = [], o = /* @__PURE__ */ new Set();
|
|
5080
5176
|
return r.forEach((e) => {
|
|
5081
5177
|
if (!e || e.clearValue) return;
|
|
5082
5178
|
let { setValue: n, setValueLabel: r } = e;
|
|
5083
|
-
n != null && n !== "" && r &&
|
|
5179
|
+
n != null && n !== "" && r && Q(n) === i && Yc(e, t) && (o.has(Q(n)) || (o.add(Q(n)), a.push({
|
|
5084
5180
|
value: n,
|
|
5085
5181
|
label: r
|
|
5086
5182
|
})));
|
|
@@ -5088,8 +5184,8 @@ function Zc(e, t = {}, n) {
|
|
|
5088
5184
|
}
|
|
5089
5185
|
//#endregion
|
|
5090
5186
|
//#region src/components/form/optionRowFilters.js
|
|
5091
|
-
var
|
|
5092
|
-
function
|
|
5187
|
+
var pl = 64;
|
|
5188
|
+
function ml(e) {
|
|
5093
5189
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
5094
5190
|
try {
|
|
5095
5191
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -5097,34 +5193,34 @@ function $c(e) {
|
|
|
5097
5193
|
return "";
|
|
5098
5194
|
}
|
|
5099
5195
|
}
|
|
5100
|
-
var
|
|
5101
|
-
function
|
|
5196
|
+
var hl = (e) => String(e ?? "").trim().toLowerCase(), gl = (e) => e != null && String(e).trim() !== "";
|
|
5197
|
+
function _l(e) {
|
|
5102
5198
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
5103
|
-
return new Set(t.map(
|
|
5199
|
+
return new Set(t.map(hl).filter((e) => e !== ""));
|
|
5104
5200
|
}
|
|
5105
|
-
function
|
|
5106
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
5201
|
+
function vl(e, t) {
|
|
5202
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => gl(e?.extraData?.[t]));
|
|
5107
5203
|
}
|
|
5108
|
-
function
|
|
5204
|
+
function yl(e, t, n) {
|
|
5109
5205
|
let r = e?.extraData?.[t];
|
|
5110
|
-
if (!
|
|
5111
|
-
let i =
|
|
5112
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
5206
|
+
if (!gl(n)) return r === !0;
|
|
5207
|
+
let i = _l(n);
|
|
5208
|
+
return i.size === 0 ? r === !0 : i.has(hl(r));
|
|
5113
5209
|
}
|
|
5114
|
-
function
|
|
5210
|
+
function bl(e, t) {
|
|
5115
5211
|
let n = /* @__PURE__ */ new Map();
|
|
5116
5212
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
5117
|
-
let r =
|
|
5118
|
-
r && n.set(r,
|
|
5213
|
+
let r = hl(e?.value);
|
|
5214
|
+
r && n.set(r, hl(e?.extraData?.[t]));
|
|
5119
5215
|
}), n;
|
|
5120
5216
|
}
|
|
5121
|
-
function
|
|
5122
|
-
let r =
|
|
5217
|
+
function xl(e, t, n) {
|
|
5218
|
+
let r = hl(n);
|
|
5123
5219
|
if (!r) return !1;
|
|
5124
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
5220
|
+
let i = /* @__PURE__ */ new Set(), a = hl(e);
|
|
5125
5221
|
if (!a) return !1;
|
|
5126
5222
|
i.add(a);
|
|
5127
|
-
for (let e = 0; e <
|
|
5223
|
+
for (let e = 0; e < pl; e += 1) {
|
|
5128
5224
|
let e = t.get(a);
|
|
5129
5225
|
if (!e) return !1;
|
|
5130
5226
|
if (e === r) return !0;
|
|
@@ -5133,74 +5229,74 @@ function al(e, t, n) {
|
|
|
5133
5229
|
}
|
|
5134
5230
|
return !1;
|
|
5135
5231
|
}
|
|
5136
|
-
function
|
|
5232
|
+
function Sl(e = {}) {
|
|
5137
5233
|
let t = [], n = (e) => {
|
|
5138
5234
|
let n = String(e ?? "").trim();
|
|
5139
5235
|
n && !t.includes(n) && t.push(n);
|
|
5140
5236
|
};
|
|
5141
5237
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
5142
5238
|
}
|
|
5143
|
-
function
|
|
5239
|
+
function Cl(e, t = {}, n = {}) {
|
|
5144
5240
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
5145
5241
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
5146
5242
|
typeof console < "u" && console.warn(e);
|
|
5147
5243
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
5148
|
-
s && (
|
|
5244
|
+
s && (vl(o, s) ? o = o.filter((e) => yl(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".`));
|
|
5149
5245
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
5150
5246
|
if (c) {
|
|
5151
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
5247
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = ml(n);
|
|
5152
5248
|
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.`);
|
|
5153
|
-
else if (!
|
|
5249
|
+
else if (!vl(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".`);
|
|
5154
5250
|
else {
|
|
5155
|
-
let t =
|
|
5156
|
-
o = o.filter((e) =>
|
|
5251
|
+
let t = bl(e, c);
|
|
5252
|
+
o = o.filter((e) => xl(e?.value, t, s));
|
|
5157
5253
|
}
|
|
5158
5254
|
}
|
|
5159
5255
|
return o;
|
|
5160
5256
|
}
|
|
5161
5257
|
//#endregion
|
|
5162
5258
|
//#region src/components/form/fieldTooltip.js
|
|
5163
|
-
var
|
|
5164
|
-
function
|
|
5165
|
-
return
|
|
5259
|
+
var wl = (e) => e == null || String(e).trim() === "", Tl = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
5260
|
+
function El(e) {
|
|
5261
|
+
return wl(e?.tooltip) ? Tl(e?.infoEnabled) && !wl(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
5166
5262
|
}
|
|
5167
5263
|
//#endregion
|
|
5168
5264
|
//#region src/components/form/autofillValue.js
|
|
5169
|
-
var
|
|
5170
|
-
function
|
|
5265
|
+
var Dl = (e) => e == null || typeof e == "string" && e.trim() === "";
|
|
5266
|
+
function Ol(e, t = {}, n = () => void 0) {
|
|
5171
5267
|
let { optionKey: r } = t, i = (e ? n(e, r) : void 0) ?? e?.extraData?.[r] ?? null, { fallback: a } = t;
|
|
5172
|
-
return
|
|
5268
|
+
return Dl(i) && a != null && a !== "" ? a : i;
|
|
5173
5269
|
}
|
|
5174
5270
|
//#endregion
|
|
5175
5271
|
//#region src/components/form/dependentLookupReset.js
|
|
5176
|
-
var
|
|
5177
|
-
function
|
|
5178
|
-
return !(!r || e ===
|
|
5272
|
+
var kl = Symbol("parentFilterUnseen"), Al = (e) => e == null || e === "", jl = (e, t) => String(e ?? "") === String(t ?? "");
|
|
5273
|
+
function Ml({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
5274
|
+
return !(!r || e === kl || jl(e, t) || Al(e) || Al(n));
|
|
5179
5275
|
}
|
|
5180
5276
|
//#endregion
|
|
5181
5277
|
//#region src/utils/roleAllowsAction.js
|
|
5182
|
-
function
|
|
5183
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
5278
|
+
function Nl(e) {
|
|
5279
|
+
return e == null ? !0 : typeof e == "object" ? Nl(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
5184
5280
|
}
|
|
5185
|
-
function
|
|
5281
|
+
function Pl(e, t) {
|
|
5186
5282
|
let n = String(t ?? "").trim().toLowerCase();
|
|
5187
5283
|
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
5188
5284
|
let e = String(t).trim().toLowerCase();
|
|
5189
5285
|
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
5190
5286
|
}
|
|
5191
5287
|
}
|
|
5192
|
-
function
|
|
5288
|
+
function Fl(e, t) {
|
|
5193
5289
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
5194
5290
|
let n = `${t}Access`;
|
|
5195
5291
|
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
5196
5292
|
}
|
|
5197
|
-
function
|
|
5293
|
+
function Il(e, t) {
|
|
5198
5294
|
if (!e) return !0;
|
|
5199
5295
|
try {
|
|
5200
5296
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
5201
5297
|
for (let e of o) {
|
|
5202
|
-
let t =
|
|
5203
|
-
if (t) return
|
|
5298
|
+
let t = Pl(n, e);
|
|
5299
|
+
if (t) return Nl(Fl(t, a));
|
|
5204
5300
|
}
|
|
5205
5301
|
return !0;
|
|
5206
5302
|
} catch {
|
|
@@ -5209,10 +5305,10 @@ function bl(e, t) {
|
|
|
5209
5305
|
}
|
|
5210
5306
|
//#endregion
|
|
5211
5307
|
//#region src/utils/afterSubmitNav.js
|
|
5212
|
-
function
|
|
5308
|
+
function Ll(e) {
|
|
5213
5309
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
5214
5310
|
}
|
|
5215
|
-
function
|
|
5311
|
+
function Rl(e, t, n) {
|
|
5216
5312
|
let r = String(e ?? "").trim();
|
|
5217
5313
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
5218
5314
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -5221,50 +5317,50 @@ function Sl(e, t, n) {
|
|
|
5221
5317
|
}
|
|
5222
5318
|
//#endregion
|
|
5223
5319
|
//#region src/utils/backNav.js
|
|
5224
|
-
function
|
|
5320
|
+
function zl(e = typeof window < "u" ? window : void 0) {
|
|
5225
5321
|
let t = e?.history?.state?.idx;
|
|
5226
5322
|
return typeof t == "number" && t > 0;
|
|
5227
5323
|
}
|
|
5228
|
-
function
|
|
5229
|
-
return t && e ? { path: e } :
|
|
5324
|
+
function Bl({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5325
|
+
return t && e ? { path: e } : zl(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5230
5326
|
}
|
|
5231
|
-
function
|
|
5232
|
-
let n =
|
|
5327
|
+
function Vl(e, t = {}) {
|
|
5328
|
+
let n = Bl(t);
|
|
5233
5329
|
return n.back ? e(-1) : e(n.path), n;
|
|
5234
5330
|
}
|
|
5235
5331
|
//#endregion
|
|
5236
5332
|
//#region src/components/form/educationRules.js
|
|
5237
|
-
var
|
|
5238
|
-
function
|
|
5333
|
+
var Hl = (e) => e == null ? "" : String(e).trim();
|
|
5334
|
+
function Ul(e, t) {
|
|
5239
5335
|
let n = e?.regionRules;
|
|
5240
5336
|
if (!n || typeof n != "object") return e ?? {};
|
|
5241
|
-
let r =
|
|
5337
|
+
let r = Hl(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5242
5338
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5243
5339
|
...e,
|
|
5244
5340
|
...i
|
|
5245
5341
|
};
|
|
5246
5342
|
}
|
|
5247
|
-
function
|
|
5343
|
+
function Wl(e) {
|
|
5248
5344
|
return e?.allowInProgress !== !1;
|
|
5249
5345
|
}
|
|
5250
|
-
function
|
|
5251
|
-
return
|
|
5346
|
+
function Gl(e) {
|
|
5347
|
+
return Wl(e) ? "" : Jl(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.";
|
|
5252
5348
|
}
|
|
5253
|
-
function
|
|
5254
|
-
return
|
|
5349
|
+
function Kl(e) {
|
|
5350
|
+
return Wl(e) ? "allow" : Hl(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5255
5351
|
}
|
|
5256
|
-
function
|
|
5257
|
-
return
|
|
5352
|
+
function ql(e) {
|
|
5353
|
+
return Kl(e) === "block";
|
|
5258
5354
|
}
|
|
5259
|
-
function
|
|
5260
|
-
return
|
|
5355
|
+
function Jl(e) {
|
|
5356
|
+
return Kl(e) === "warn";
|
|
5261
5357
|
}
|
|
5262
|
-
function
|
|
5263
|
-
if (!
|
|
5264
|
-
let t =
|
|
5358
|
+
function Yl(e) {
|
|
5359
|
+
if (!ql(e)) return null;
|
|
5360
|
+
let t = Gl(e);
|
|
5265
5361
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5266
5362
|
}
|
|
5267
|
-
function
|
|
5363
|
+
function Xl(e, t = {}) {
|
|
5268
5364
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5269
5365
|
for (let t of [n, r]) {
|
|
5270
5366
|
let n = e?.[t];
|
|
@@ -5274,50 +5370,50 @@ function Pl(e, t = {}) {
|
|
|
5274
5370
|
}
|
|
5275
5371
|
return null;
|
|
5276
5372
|
}
|
|
5277
|
-
function
|
|
5373
|
+
function Zl(e, t = {}) {
|
|
5278
5374
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5279
5375
|
return !!e?.[n];
|
|
5280
5376
|
}
|
|
5281
|
-
function
|
|
5377
|
+
function Ql(e = [], t = {}) {
|
|
5282
5378
|
let n = (t.direction ?? "desc") === "desc";
|
|
5283
5379
|
return e.map((e, n) => ({
|
|
5284
5380
|
index: n,
|
|
5285
|
-
key:
|
|
5286
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5381
|
+
key: Xl(e, t),
|
|
5382
|
+
ongoing: t.inProgressFirst !== !1 && Zl(e, t)
|
|
5287
5383
|
})).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);
|
|
5288
5384
|
}
|
|
5289
|
-
function
|
|
5385
|
+
function $l(e, t, n = {}) {
|
|
5290
5386
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5291
|
-
let r =
|
|
5387
|
+
let r = Ql(e, n).indexOf(t);
|
|
5292
5388
|
return r === -1 || r === t ? null : {
|
|
5293
5389
|
from: t,
|
|
5294
5390
|
to: r,
|
|
5295
|
-
reason:
|
|
5391
|
+
reason: Zl(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5296
5392
|
};
|
|
5297
5393
|
}
|
|
5298
|
-
var
|
|
5394
|
+
var eu = Object.freeze({
|
|
5299
5395
|
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.",
|
|
5300
5396
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5301
5397
|
ok: "Yes, move it up",
|
|
5302
5398
|
keep: "No, leave it here"
|
|
5303
5399
|
});
|
|
5304
|
-
function
|
|
5400
|
+
function tu(e, t = {}) {
|
|
5305
5401
|
let n = {
|
|
5306
|
-
...
|
|
5402
|
+
...eu,
|
|
5307
5403
|
...t.messages ?? {}
|
|
5308
5404
|
};
|
|
5309
5405
|
return n[e] ?? n.outOfOrder;
|
|
5310
5406
|
}
|
|
5311
|
-
function
|
|
5312
|
-
let n = t.levelField ?? "qualification", r =
|
|
5407
|
+
function nu(e, t = {}) {
|
|
5408
|
+
let n = t.levelField ?? "qualification", r = Hl(e?.[n]);
|
|
5313
5409
|
if (!r) return null;
|
|
5314
5410
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5315
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5411
|
+
return Number.isFinite(Number(a)) ? Number(a) : ru(r, t);
|
|
5316
5412
|
}
|
|
5317
|
-
function
|
|
5413
|
+
function ru(e, t) {
|
|
5318
5414
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5319
5415
|
for (let e of n) {
|
|
5320
|
-
let t =
|
|
5416
|
+
let t = Hl(e?.match);
|
|
5321
5417
|
if (!t) continue;
|
|
5322
5418
|
let n;
|
|
5323
5419
|
try {
|
|
@@ -5329,14 +5425,14 @@ function Vl(e, t) {
|
|
|
5329
5425
|
}
|
|
5330
5426
|
return null;
|
|
5331
5427
|
}
|
|
5332
|
-
function
|
|
5333
|
-
return
|
|
5428
|
+
function iu(e, t = {}) {
|
|
5429
|
+
return Hl((t?.levelLabels ?? {})[e]) || Hl(e);
|
|
5334
5430
|
}
|
|
5335
|
-
function
|
|
5431
|
+
function au(e = [], t = {}) {
|
|
5336
5432
|
if (!t || t.requireBelow === !1) return [];
|
|
5337
5433
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5338
5434
|
if (!r.length) return [];
|
|
5339
|
-
let i = e.map((e) =>
|
|
5435
|
+
let i = e.map((e) => nu(e, t)).filter((e) => e !== null);
|
|
5340
5436
|
if (!i.length) return [];
|
|
5341
5437
|
let a = Math.max(...i), o = [];
|
|
5342
5438
|
return r.forEach((e) => {
|
|
@@ -5344,43 +5440,43 @@ function Ul(e = [], t = {}) {
|
|
|
5344
5440
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5345
5441
|
}), o;
|
|
5346
5442
|
}
|
|
5347
|
-
function
|
|
5348
|
-
let n =
|
|
5443
|
+
function ou(e, t = {}) {
|
|
5444
|
+
let n = au(e, t);
|
|
5349
5445
|
if (!n.length) return "";
|
|
5350
|
-
let r = n.map((e) =>
|
|
5446
|
+
let r = n.map((e) => iu(e, t)).join(", ");
|
|
5351
5447
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5352
5448
|
}
|
|
5353
|
-
async function
|
|
5449
|
+
async function su({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5354
5450
|
let a = e?.orderBy;
|
|
5355
5451
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5356
|
-
let o =
|
|
5452
|
+
let o = $l(t, n, a);
|
|
5357
5453
|
if (!o) return !1;
|
|
5358
5454
|
let s = {
|
|
5359
|
-
...
|
|
5455
|
+
...eu,
|
|
5360
5456
|
...a.messages ?? {}
|
|
5361
5457
|
};
|
|
5362
5458
|
return await i({
|
|
5363
5459
|
reason: o.reason,
|
|
5364
5460
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5365
|
-
body:
|
|
5461
|
+
body: tu(o.reason, a),
|
|
5366
5462
|
okText: s.ok,
|
|
5367
5463
|
cancelText: s.keep,
|
|
5368
5464
|
from: o.from,
|
|
5369
5465
|
to: o.to
|
|
5370
5466
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5371
5467
|
}
|
|
5372
|
-
function
|
|
5373
|
-
let n =
|
|
5468
|
+
function cu(e, t) {
|
|
5469
|
+
let n = Ul(e, t), r = n?.orderBy?.inProgressField;
|
|
5374
5470
|
return r ? {
|
|
5375
5471
|
name: n.name,
|
|
5376
5472
|
label: n.label ?? n.name,
|
|
5377
5473
|
rowsKey: n.payloadKey || n.name,
|
|
5378
5474
|
inProgressField: r,
|
|
5379
|
-
severity:
|
|
5380
|
-
message:
|
|
5475
|
+
severity: Kl(n),
|
|
5476
|
+
message: Gl(n)
|
|
5381
5477
|
} : null;
|
|
5382
5478
|
}
|
|
5383
|
-
function
|
|
5479
|
+
function lu(e = [], t, n) {
|
|
5384
5480
|
if (!n) return {
|
|
5385
5481
|
severity: "allow",
|
|
5386
5482
|
message: "",
|
|
@@ -5388,8 +5484,8 @@ function ql(e = [], t, n) {
|
|
|
5388
5484
|
};
|
|
5389
5485
|
let r = null;
|
|
5390
5486
|
for (let i of e) {
|
|
5391
|
-
let e =
|
|
5392
|
-
if (!(!e || e.severity === "allow") &&
|
|
5487
|
+
let e = cu(i, t);
|
|
5488
|
+
if (!(!e || e.severity === "allow") && uu(n, e.rowsKey).some((t) => Zl(t, e))) {
|
|
5393
5489
|
if (e.severity === "block") return {
|
|
5394
5490
|
severity: "block",
|
|
5395
5491
|
message: e.message,
|
|
@@ -5408,23 +5504,23 @@ function ql(e = [], t, n) {
|
|
|
5408
5504
|
group: null
|
|
5409
5505
|
};
|
|
5410
5506
|
}
|
|
5411
|
-
function
|
|
5507
|
+
function uu(e, t) {
|
|
5412
5508
|
let n = e?.[t];
|
|
5413
5509
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5414
5510
|
}
|
|
5415
|
-
function
|
|
5511
|
+
function du(e) {
|
|
5416
5512
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5417
5513
|
}
|
|
5418
|
-
function
|
|
5514
|
+
function fu(e = [], t = {}) {
|
|
5419
5515
|
let n = null;
|
|
5420
5516
|
for (let r of e) {
|
|
5421
5517
|
let e = r?.levelRule;
|
|
5422
5518
|
if (!e) continue;
|
|
5423
|
-
let i =
|
|
5519
|
+
let i = pu(t, r);
|
|
5424
5520
|
if (!i.length) continue;
|
|
5425
|
-
let a =
|
|
5521
|
+
let a = ou(i, e);
|
|
5426
5522
|
if (a) {
|
|
5427
|
-
if (
|
|
5523
|
+
if (du(e) === "block") return {
|
|
5428
5524
|
severity: "block",
|
|
5429
5525
|
message: a,
|
|
5430
5526
|
group: r
|
|
@@ -5442,7 +5538,7 @@ function Xl(e = [], t = {}) {
|
|
|
5442
5538
|
group: null
|
|
5443
5539
|
};
|
|
5444
5540
|
}
|
|
5445
|
-
function
|
|
5541
|
+
function pu(e, t) {
|
|
5446
5542
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5447
5543
|
if (!n) continue;
|
|
5448
5544
|
let t = e?.[n];
|
|
@@ -5452,10 +5548,10 @@ function Zl(e, t) {
|
|
|
5452
5548
|
}
|
|
5453
5549
|
//#endregion
|
|
5454
5550
|
//#region src/components/form/clearGroupOnChange.js
|
|
5455
|
-
function
|
|
5551
|
+
function mu(e, t) {
|
|
5456
5552
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5457
5553
|
}
|
|
5458
|
-
function
|
|
5554
|
+
function hu(e, t) {
|
|
5459
5555
|
let n = e?.field, r = [];
|
|
5460
5556
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5461
5557
|
e && e !== n && r.push(e);
|
|
@@ -5465,24 +5561,24 @@ function $l(e, t) {
|
|
|
5465
5561
|
e && e !== n && r.push(e);
|
|
5466
5562
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5467
5563
|
}
|
|
5468
|
-
function
|
|
5469
|
-
let i =
|
|
5564
|
+
function gu(e, t, n, r) {
|
|
5565
|
+
let i = hu(t, r).map((e) => mu(n, e));
|
|
5470
5566
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5471
5567
|
}
|
|
5472
5568
|
//#endregion
|
|
5473
5569
|
//#region src/components/form/resolveStoredOptions.js
|
|
5474
|
-
function
|
|
5570
|
+
function _u(e) {
|
|
5475
5571
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5476
5572
|
}
|
|
5477
|
-
function
|
|
5573
|
+
function vu(e, t = []) {
|
|
5478
5574
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5479
|
-
for (let t of
|
|
5575
|
+
for (let t of _u(e)) {
|
|
5480
5576
|
let e = String(t);
|
|
5481
5577
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5482
5578
|
}
|
|
5483
5579
|
return r;
|
|
5484
5580
|
}
|
|
5485
|
-
async function
|
|
5581
|
+
async function yu(e, t) {
|
|
5486
5582
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5487
5583
|
let n = new URLSearchParams({
|
|
5488
5584
|
collection: e.lookupCollection,
|
|
@@ -5494,7 +5590,7 @@ async function ru(e, t) {
|
|
|
5494
5590
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5495
5591
|
return Array.isArray(i) ? i : [];
|
|
5496
5592
|
}
|
|
5497
|
-
function
|
|
5593
|
+
function bu(e = [], t = []) {
|
|
5498
5594
|
if (!t.length) return e;
|
|
5499
5595
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5500
5596
|
...e,
|
|
@@ -5504,25 +5600,25 @@ function iu(e = [], t = []) {
|
|
|
5504
5600
|
}
|
|
5505
5601
|
//#endregion
|
|
5506
5602
|
//#region src/components/form/requireAnyOf.js
|
|
5507
|
-
var
|
|
5508
|
-
function
|
|
5603
|
+
var xu = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5604
|
+
function Su(e) {
|
|
5509
5605
|
let t = e?.requireAnyOf;
|
|
5510
5606
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5511
5607
|
}
|
|
5512
|
-
function
|
|
5513
|
-
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !
|
|
5608
|
+
function Cu(e) {
|
|
5609
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !xu(e));
|
|
5514
5610
|
}
|
|
5515
|
-
function
|
|
5516
|
-
let n =
|
|
5611
|
+
function wu({ field: e, getRow: t }) {
|
|
5612
|
+
let n = Su(e);
|
|
5517
5613
|
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5518
5614
|
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5519
5615
|
return { validator: async () => {
|
|
5520
5616
|
let e = t?.() ?? {};
|
|
5521
|
-
return
|
|
5617
|
+
return Cu(e) ? n.some((t) => !xu(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5522
5618
|
} };
|
|
5523
5619
|
}
|
|
5524
|
-
function
|
|
5525
|
-
let n =
|
|
5620
|
+
function Tu(e, t = []) {
|
|
5621
|
+
let n = Su(e);
|
|
5526
5622
|
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5527
5623
|
...t,
|
|
5528
5624
|
requireAnyOf: n,
|
|
@@ -5531,8 +5627,8 @@ function lu(e, t = []) {
|
|
|
5531
5627
|
}
|
|
5532
5628
|
//#endregion
|
|
5533
5629
|
//#region src/components/form/dateRules.js
|
|
5534
|
-
var
|
|
5535
|
-
function
|
|
5630
|
+
var Eu = (e) => e == null || e === "";
|
|
5631
|
+
function Du(e) {
|
|
5536
5632
|
if (!e) return null;
|
|
5537
5633
|
if (typeof e.valueOf == "function") {
|
|
5538
5634
|
let t = e.valueOf();
|
|
@@ -5546,12 +5642,12 @@ function $(e) {
|
|
|
5546
5642
|
let t = E(e);
|
|
5547
5643
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5548
5644
|
}
|
|
5549
|
-
function
|
|
5645
|
+
function Ou(e) {
|
|
5550
5646
|
if (!e) return null;
|
|
5551
5647
|
let t = E(e);
|
|
5552
5648
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5553
5649
|
}
|
|
5554
|
-
var
|
|
5650
|
+
var ku = {
|
|
5555
5651
|
d: "day",
|
|
5556
5652
|
day: "day",
|
|
5557
5653
|
days: "day",
|
|
@@ -5567,13 +5663,13 @@ var pu = {
|
|
|
5567
5663
|
year: "year",
|
|
5568
5664
|
years: "year"
|
|
5569
5665
|
};
|
|
5570
|
-
function
|
|
5666
|
+
function Au(e) {
|
|
5571
5667
|
if (e == null || e === "") return null;
|
|
5572
5668
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5573
5669
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5574
5670
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5575
5671
|
value: t,
|
|
5576
|
-
unit:
|
|
5672
|
+
unit: ku[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5577
5673
|
};
|
|
5578
5674
|
}
|
|
5579
5675
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5583,49 +5679,49 @@ function mu(e) {
|
|
|
5583
5679
|
let r = Number(n[1]);
|
|
5584
5680
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5585
5681
|
value: r,
|
|
5586
|
-
unit:
|
|
5682
|
+
unit: ku[n[2]] ?? "month"
|
|
5587
5683
|
};
|
|
5588
5684
|
}
|
|
5589
|
-
function
|
|
5685
|
+
function ju(e, t) {
|
|
5590
5686
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5591
5687
|
if (n && typeof t == "function") {
|
|
5592
|
-
let e =
|
|
5688
|
+
let e = Au(t(n));
|
|
5593
5689
|
if (e) return e;
|
|
5594
5690
|
}
|
|
5595
|
-
return
|
|
5691
|
+
return Au(e?.minGap);
|
|
5596
5692
|
}
|
|
5597
|
-
function
|
|
5693
|
+
function Mu(e, t, n, r) {
|
|
5598
5694
|
if (t === null) return null;
|
|
5599
|
-
let i =
|
|
5695
|
+
let i = ju(n, r), a = E(t);
|
|
5600
5696
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5601
5697
|
}
|
|
5602
|
-
function
|
|
5698
|
+
function Nu(e, t, n, r, i) {
|
|
5603
5699
|
if (t === null || n === null) return !1;
|
|
5604
|
-
let a =
|
|
5700
|
+
let a = Mu(e, n, r, i);
|
|
5605
5701
|
if (a === null) return !1;
|
|
5606
|
-
let o = !!r?.strict && !
|
|
5702
|
+
let o = !!r?.strict && !ju(r, i);
|
|
5607
5703
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5608
5704
|
}
|
|
5609
|
-
function
|
|
5705
|
+
function Pu(e, t, n, r) {
|
|
5610
5706
|
if (n?.message) return n.message;
|
|
5611
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5707
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = ju(n, r);
|
|
5612
5708
|
if (a) {
|
|
5613
5709
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5614
5710
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5615
5711
|
}
|
|
5616
5712
|
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}`;
|
|
5617
5713
|
}
|
|
5618
|
-
function
|
|
5714
|
+
function Fu({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5619
5715
|
return { validator: async (i, a) => {
|
|
5620
5716
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5621
|
-
if (!o ||
|
|
5717
|
+
if (!o || Eu(a)) return Promise.resolve();
|
|
5622
5718
|
let s = r(o);
|
|
5623
|
-
if (
|
|
5719
|
+
if (Eu(s)) return Promise.resolve();
|
|
5624
5720
|
let c = $(a), l = $(s);
|
|
5625
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5721
|
+
return c === null || l === null ? Promise.resolve() : Nu(e, c, l, n, r) ? Promise.reject(Error(Pu(e, t, n, r))) : Promise.resolve();
|
|
5626
5722
|
} };
|
|
5627
5723
|
}
|
|
5628
|
-
function
|
|
5724
|
+
function Iu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5629
5725
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5630
5726
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5631
5727
|
if (o) {
|
|
@@ -5639,11 +5735,11 @@ function bu(e, t, { rows: n, rowIndex: r } = {}) {
|
|
|
5639
5735
|
}
|
|
5640
5736
|
return !1;
|
|
5641
5737
|
}
|
|
5642
|
-
function
|
|
5738
|
+
function Lu(e, t = "above", n = void 0) {
|
|
5643
5739
|
let r = e?.messages ?? {}, i = t === "below";
|
|
5644
5740
|
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.");
|
|
5645
5741
|
}
|
|
5646
|
-
function
|
|
5742
|
+
function Ru({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
5647
5743
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5648
5744
|
for (let e of a) {
|
|
5649
5745
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
@@ -5657,25 +5753,62 @@ function Su({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = or }) {
|
|
|
5657
5753
|
o.push((i) => {
|
|
5658
5754
|
if (!i) return !1;
|
|
5659
5755
|
let a = t(e);
|
|
5660
|
-
return !
|
|
5756
|
+
return !Eu(a) && Nu(r, $(i), $(a), n, t);
|
|
5661
5757
|
});
|
|
5662
5758
|
}
|
|
5663
5759
|
}
|
|
5664
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5760
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? Iu($(t), e.rowHierarchy, {
|
|
5665
5761
|
rows: n,
|
|
5666
5762
|
rowIndex: r
|
|
5667
5763
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5668
5764
|
}
|
|
5669
|
-
function
|
|
5670
|
-
if (!
|
|
5671
|
-
let
|
|
5672
|
-
for (let e of
|
|
5765
|
+
function zu(e, t = or, n = void 0, r = void 0) {
|
|
5766
|
+
if (!Eu(n) && $(n) !== null) return;
|
|
5767
|
+
let i, a = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5768
|
+
for (let e of a) {
|
|
5673
5769
|
let n = typeof e == "string" ? { type: e } : e;
|
|
5674
|
-
if (n?.type === "minAge")
|
|
5675
|
-
|
|
5770
|
+
if (n?.type === "minAge") {
|
|
5771
|
+
i = t().subtract(Number(n?.value ?? 18), "year");
|
|
5772
|
+
break;
|
|
5773
|
+
}
|
|
5774
|
+
if (n?.type === "noFutureDate" || n?.type === "noPastDate") {
|
|
5775
|
+
i = t();
|
|
5776
|
+
break;
|
|
5777
|
+
}
|
|
5676
5778
|
}
|
|
5779
|
+
if (typeof r != "function") return i;
|
|
5780
|
+
let o = E(i ?? t()), s = Bu(o, r);
|
|
5781
|
+
return !s || s.isSame(o, "month") ? i : s;
|
|
5677
5782
|
}
|
|
5678
|
-
function
|
|
5783
|
+
function Bu(e, t, n = 240) {
|
|
5784
|
+
let r = E(e).startOf("day");
|
|
5785
|
+
if (!r.isValid() || typeof t != "function") return null;
|
|
5786
|
+
let i = (e) => {
|
|
5787
|
+
try {
|
|
5788
|
+
return !t(e);
|
|
5789
|
+
} catch {
|
|
5790
|
+
return !1;
|
|
5791
|
+
}
|
|
5792
|
+
}, a = (e) => {
|
|
5793
|
+
let t = null, n = Infinity, a = e.startOf("month"), o = a.daysInMonth();
|
|
5794
|
+
for (let e = 0; e < o; e += 1) {
|
|
5795
|
+
let o = a.add(e, "day");
|
|
5796
|
+
if (!i(o)) continue;
|
|
5797
|
+
let s = Math.abs(o.diff(r, "day"));
|
|
5798
|
+
s < n && (t = o, n = s);
|
|
5799
|
+
}
|
|
5800
|
+
return t ? {
|
|
5801
|
+
day: t,
|
|
5802
|
+
gap: n
|
|
5803
|
+
} : null;
|
|
5804
|
+
};
|
|
5805
|
+
for (let e = 0; e <= n; e += 1) {
|
|
5806
|
+
let t = (e === 0 ? [a(r)] : [a(r.subtract(e, "month")), a(r.add(e, "month"))]).filter(Boolean);
|
|
5807
|
+
if (t.length) return t.reduce((e, t) => t.gap < e.gap ? t : e).day;
|
|
5808
|
+
}
|
|
5809
|
+
return null;
|
|
5810
|
+
}
|
|
5811
|
+
function Vu({ field: e, name: t, rows: n }) {
|
|
5679
5812
|
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5680
5813
|
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 ?? [];
|
|
5681
5814
|
for (let e of o) {
|
|
@@ -5704,44 +5837,44 @@ function wu({ field: e, name: t, rows: n }) {
|
|
|
5704
5837
|
]));
|
|
5705
5838
|
return u;
|
|
5706
5839
|
}
|
|
5707
|
-
function
|
|
5840
|
+
function Hu({ field: e, rows: t, rowIndex: n }) {
|
|
5708
5841
|
let r = e?.rowHierarchy;
|
|
5709
5842
|
return { validator: async (i, a) => {
|
|
5710
|
-
if (!r ||
|
|
5843
|
+
if (!r || Eu(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5711
5844
|
let o = $(a);
|
|
5712
|
-
if (o === null || !
|
|
5845
|
+
if (o === null || !Iu(o, r, {
|
|
5713
5846
|
rows: t,
|
|
5714
5847
|
rowIndex: n
|
|
5715
5848
|
})) return Promise.resolve();
|
|
5716
5849
|
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;
|
|
5717
|
-
return Promise.reject(Error(
|
|
5850
|
+
return Promise.reject(Error(Lu(r, u, p)));
|
|
5718
5851
|
} };
|
|
5719
5852
|
}
|
|
5720
5853
|
//#endregion
|
|
5721
5854
|
//#region src/utils/submitMessages.js
|
|
5722
|
-
function
|
|
5855
|
+
function Uu(e) {
|
|
5723
5856
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5724
5857
|
}
|
|
5725
|
-
function
|
|
5858
|
+
function Wu(e) {
|
|
5726
5859
|
let t = String(e ?? "").trim();
|
|
5727
5860
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5728
5861
|
}
|
|
5729
|
-
function
|
|
5730
|
-
return String(e).replaceAll("${module}",
|
|
5862
|
+
function Gu(e, t) {
|
|
5863
|
+
return String(e).replaceAll("${module}", Wu(t)).replaceAll("${moduleName}", Wu(t));
|
|
5731
5864
|
}
|
|
5732
|
-
function
|
|
5733
|
-
let r =
|
|
5865
|
+
function Ku(e, t, n) {
|
|
5866
|
+
let r = Uu(e);
|
|
5734
5867
|
if (r?.suppress) return null;
|
|
5735
5868
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5736
|
-
return i && String(i).trim() ?
|
|
5869
|
+
return i && String(i).trim() ? Gu(i, t) : n === "edit" ? `${Wu(t)} has Updated successfully` : `${Wu(t)} has added successfully`;
|
|
5737
5870
|
}
|
|
5738
|
-
function
|
|
5739
|
-
let i =
|
|
5740
|
-
return a && String(a).trim() ?
|
|
5871
|
+
function qu(e, t, n, r) {
|
|
5872
|
+
let i = Uu(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5873
|
+
return a && String(a).trim() ? Gu(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${Wu(t)}` : `Failed to create ${Wu(t)}`;
|
|
5741
5874
|
}
|
|
5742
5875
|
//#endregion
|
|
5743
5876
|
//#region src/utils/scrollToFirstFormError.js
|
|
5744
|
-
function
|
|
5877
|
+
function Ju({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5745
5878
|
if (!e?.length) return;
|
|
5746
5879
|
let r = e[0]?.name;
|
|
5747
5880
|
setTimeout(() => {
|
|
@@ -5766,10 +5899,10 @@ function ju({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5766
5899
|
}
|
|
5767
5900
|
//#endregion
|
|
5768
5901
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5769
|
-
function
|
|
5902
|
+
function Yu(e) {
|
|
5770
5903
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5771
5904
|
}
|
|
5772
|
-
function
|
|
5905
|
+
function Xu(e, t) {
|
|
5773
5906
|
if (!e?.field) return !1;
|
|
5774
5907
|
switch (e.operator ?? "eq") {
|
|
5775
5908
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5777,58 +5910,58 @@ function Nu(e, t) {
|
|
|
5777
5910
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5778
5911
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5779
5912
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5780
|
-
case "in": return
|
|
5781
|
-
case "notIn": return !
|
|
5913
|
+
case "in": return Yu(e.value).includes(String(t ?? ""));
|
|
5914
|
+
case "notIn": return !Yu(e.value).includes(String(t ?? ""));
|
|
5782
5915
|
default: return !1;
|
|
5783
5916
|
}
|
|
5784
5917
|
}
|
|
5785
|
-
function
|
|
5918
|
+
function Zu(e, t, n = !1) {
|
|
5786
5919
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5787
|
-
return
|
|
5920
|
+
return Xu(i, t) && i?.label ? i.label : r;
|
|
5788
5921
|
}
|
|
5789
|
-
function
|
|
5922
|
+
function Qu(e) {
|
|
5790
5923
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5791
5924
|
}
|
|
5792
|
-
function
|
|
5793
|
-
let n =
|
|
5925
|
+
function $u(e, t) {
|
|
5926
|
+
let n = Qu(e);
|
|
5794
5927
|
if (!n.length) return !0;
|
|
5795
|
-
let r = n.map((e) =>
|
|
5928
|
+
let r = n.map((e) => Xu(e, t(e.field)));
|
|
5796
5929
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5797
5930
|
}
|
|
5798
|
-
function
|
|
5931
|
+
function ed(e) {
|
|
5799
5932
|
let t = e?.colWhen;
|
|
5800
5933
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5801
5934
|
}
|
|
5802
|
-
function
|
|
5803
|
-
for (let t of
|
|
5935
|
+
function td(e, t, n) {
|
|
5936
|
+
for (let t of ed(e)) if (Xu(t, n(t))) return Number(t.col);
|
|
5804
5937
|
return t;
|
|
5805
5938
|
}
|
|
5806
|
-
function
|
|
5939
|
+
function nd(e, t) {
|
|
5807
5940
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5808
5941
|
}
|
|
5809
5942
|
//#endregion
|
|
5810
5943
|
//#region src/components/form/conditionalRequired.js
|
|
5811
|
-
function
|
|
5944
|
+
function rd(e, t) {
|
|
5812
5945
|
return (n) => {
|
|
5813
5946
|
if (!e || !n) return;
|
|
5814
5947
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5815
5948
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5816
5949
|
};
|
|
5817
5950
|
}
|
|
5818
|
-
function
|
|
5951
|
+
function id(e, t, n) {
|
|
5819
5952
|
let r = e?.requiredWhen;
|
|
5820
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
5953
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : $u(r, rd(t, n));
|
|
5821
5954
|
}
|
|
5822
|
-
function
|
|
5955
|
+
function ad(e, t, n) {
|
|
5823
5956
|
return { validator: (r, i) => {
|
|
5824
|
-
if (!
|
|
5957
|
+
if (!id(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5825
5958
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5826
5959
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5827
5960
|
} };
|
|
5828
5961
|
}
|
|
5829
5962
|
//#endregion
|
|
5830
5963
|
//#region src/components/Breadcrumb.jsx
|
|
5831
|
-
function
|
|
5964
|
+
function od({ items: e = [] }) {
|
|
5832
5965
|
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ w(Mr, {
|
|
5833
5966
|
variant: "body",
|
|
5834
5967
|
weight: "medium",
|
|
@@ -5846,34 +5979,34 @@ function Uu({ items: e = [] }) {
|
|
|
5846
5979
|
}
|
|
5847
5980
|
//#endregion
|
|
5848
5981
|
//#region src/components/form/canonicalOption.js
|
|
5849
|
-
var
|
|
5850
|
-
function
|
|
5982
|
+
var sd = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
5983
|
+
function cd(e = []) {
|
|
5851
5984
|
let t = /* @__PURE__ */ new Map();
|
|
5852
5985
|
for (let n of e) {
|
|
5853
5986
|
if (n == null) continue;
|
|
5854
5987
|
let e = typeof n == "object" ? n.value : n;
|
|
5855
5988
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5856
|
-
let n =
|
|
5989
|
+
let n = sd(r);
|
|
5857
5990
|
n && !t.has(n) && t.set(n, e);
|
|
5858
5991
|
}
|
|
5859
5992
|
}
|
|
5860
5993
|
return t;
|
|
5861
5994
|
}
|
|
5862
|
-
function
|
|
5995
|
+
function ld(e, t) {
|
|
5863
5996
|
if (!Array.isArray(e)) {
|
|
5864
|
-
let n =
|
|
5997
|
+
let n = ld([e], t);
|
|
5865
5998
|
return n.length ? n[0] : e;
|
|
5866
5999
|
}
|
|
5867
|
-
let n =
|
|
6000
|
+
let n = cd(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
5868
6001
|
for (let t of e) {
|
|
5869
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
6002
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(sd(e)) ?? e, o = sd(a);
|
|
5870
6003
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
5871
6004
|
}
|
|
5872
6005
|
return i;
|
|
5873
6006
|
}
|
|
5874
6007
|
//#endregion
|
|
5875
6008
|
//#region src/components/form/dependencyBusy.js
|
|
5876
|
-
function
|
|
6009
|
+
function ud(e, t = []) {
|
|
5877
6010
|
if (!e) return [];
|
|
5878
6011
|
let n = /* @__PURE__ */ new Set();
|
|
5879
6012
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -5883,16 +6016,16 @@ function qu(e, t = []) {
|
|
|
5883
6016
|
}
|
|
5884
6017
|
return n.delete(e), [...n];
|
|
5885
6018
|
}
|
|
5886
|
-
function
|
|
5887
|
-
return e?.blockWhileResolving ?
|
|
6019
|
+
function dd(e, t = []) {
|
|
6020
|
+
return e?.blockWhileResolving ? ud(e.field, t).length > 0 : !1;
|
|
5888
6021
|
}
|
|
5889
|
-
function
|
|
6022
|
+
function fd(e) {
|
|
5890
6023
|
let t = String(e?.label ?? "").trim();
|
|
5891
6024
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
5892
6025
|
}
|
|
5893
|
-
function
|
|
6026
|
+
function pd(e, t = []) {
|
|
5894
6027
|
if (!e?.field) return [];
|
|
5895
|
-
let n = new Set(
|
|
6028
|
+
let n = new Set(ud(e.field, t));
|
|
5896
6029
|
if (n.size === 0) return [];
|
|
5897
6030
|
let r = [];
|
|
5898
6031
|
for (let e of t) {
|
|
@@ -5901,19 +6034,19 @@ function Xu(e, t = []) {
|
|
|
5901
6034
|
}
|
|
5902
6035
|
return r;
|
|
5903
6036
|
}
|
|
5904
|
-
function
|
|
6037
|
+
function md(e) {
|
|
5905
6038
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
5906
6039
|
}
|
|
5907
6040
|
//#endregion
|
|
5908
6041
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
5909
|
-
var
|
|
5910
|
-
function
|
|
6042
|
+
var hd = f(() => import("./index.js").then((e) => e.n)), gd = f(() => import("./DocumentViewer-DcgKxqov.js").then((e) => e.n));
|
|
6043
|
+
function _d(e) {
|
|
5911
6044
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
5912
6045
|
return w(t === "pdf" ? fe : t === "doc" || t === "docx" ? me : de, { className: "v1-file-chip__icon" });
|
|
5913
6046
|
}
|
|
5914
|
-
function
|
|
6047
|
+
function vd({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
5915
6048
|
let r = e?.linkedModule, i = e?.linkedFileField, a = g(() => {
|
|
5916
|
-
let n =
|
|
6049
|
+
let n = Rc(r, t);
|
|
5917
6050
|
if (n) return n;
|
|
5918
6051
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
5919
6052
|
return a ? String(a) : "";
|
|
@@ -5933,7 +6066,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
5933
6066
|
...e,
|
|
5934
6067
|
loading: !0
|
|
5935
6068
|
}));
|
|
5936
|
-
}),
|
|
6069
|
+
}), ti(r, a).then((t) => {
|
|
5937
6070
|
e || s({
|
|
5938
6071
|
loading: !1,
|
|
5939
6072
|
fileValue: t?.[i] ?? null
|
|
@@ -5947,7 +6080,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
5947
6080
|
i,
|
|
5948
6081
|
p
|
|
5949
6082
|
]);
|
|
5950
|
-
let _ = g(() =>
|
|
6083
|
+
let _ = g(() => Mo(o.fileValue), [o.fileValue])[0], y = !!_, b = e?.label ?? "File", x = X(r) || "record";
|
|
5951
6084
|
if (!a) return /* @__PURE__ */ w("div", {
|
|
5952
6085
|
className: "v1-linked-file v1-linked-file--empty",
|
|
5953
6086
|
children: /* @__PURE__ */ w("span", { children: e?.unlinkedText ?? `Not available until the ${x} is set.` })
|
|
@@ -5975,7 +6108,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
5975
6108
|
onClick: () => y && l(!0),
|
|
5976
6109
|
title: y ? `Preview or download ${_.name}` : ae,
|
|
5977
6110
|
children: [
|
|
5978
|
-
y ?
|
|
6111
|
+
y ? _d(_.name) : /* @__PURE__ */ w(de, { className: "v1-file-chip__icon" }),
|
|
5979
6112
|
/* @__PURE__ */ w("span", {
|
|
5980
6113
|
className: "v1-file-chip__name",
|
|
5981
6114
|
children: y ? _.name : ae
|
|
@@ -5999,7 +6132,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
5999
6132
|
}),
|
|
6000
6133
|
c && te && /* @__PURE__ */ w(u, {
|
|
6001
6134
|
fallback: null,
|
|
6002
|
-
children: /* @__PURE__ */ w(
|
|
6135
|
+
children: /* @__PURE__ */ w(gd, {
|
|
6003
6136
|
open: c,
|
|
6004
6137
|
onClose: () => l(!1),
|
|
6005
6138
|
documents: [te]
|
|
@@ -6030,7 +6163,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6030
6163
|
},
|
|
6031
6164
|
children: /* @__PURE__ */ w(ie, {})
|
|
6032
6165
|
}),
|
|
6033
|
-
children: /* @__PURE__ */ w(
|
|
6166
|
+
children: /* @__PURE__ */ w(hd, {
|
|
6034
6167
|
moduleName: r,
|
|
6035
6168
|
recordId: a,
|
|
6036
6169
|
embedded: !0,
|
|
@@ -6044,7 +6177,7 @@ function td({ field: e, recordMeta: t, onLinkedRecordUpdated: n }) {
|
|
|
6044
6177
|
})
|
|
6045
6178
|
] });
|
|
6046
6179
|
}
|
|
6047
|
-
|
|
6180
|
+
vd.propTypes = {
|
|
6048
6181
|
field: D.shape({
|
|
6049
6182
|
label: D.string,
|
|
6050
6183
|
linkedModule: D.string,
|
|
@@ -6057,11 +6190,11 @@ td.propTypes = {
|
|
|
6057
6190
|
}).isRequired,
|
|
6058
6191
|
recordMeta: D.object,
|
|
6059
6192
|
onLinkedRecordUpdated: D.func
|
|
6060
|
-
},
|
|
6193
|
+
}, vd.defaultProps = {
|
|
6061
6194
|
recordMeta: void 0,
|
|
6062
6195
|
onLinkedRecordUpdated: void 0
|
|
6063
6196
|
};
|
|
6064
6197
|
//#endregion
|
|
6065
|
-
export {
|
|
6198
|
+
export { Sl as $, pn as $i, ei as $n, Xe as $r, cs as $t, yu as A, xn as Ai, aa as An, Un as Ar, ic as At, fu as B, ot as Bi, xi as Bn, tt as Br, Rs as Bt, zu as C, We as Ci, Sa as Cn, nr as Cr, Oc as Ct, Vu as D, M as Di, Za as Dn, Bn as Dr, gc as Dt, Eu as E, Ht as Ei, za as En, zn as Er, yc as Et, cu as F, nn as Fi, Hi as Fn, gn as Fr, Ks as Ft, Rl as G, Be as Gi, di as Gn, mn as Gr, ys as Gt, Ul as H, St as Hi, bi as Hn, Dn as Hr, Bs as Ht, Wl as I, rn as Ii, Vi as In, fn as Ir, Ys as It, kl as J, ht as Ji, mi as Jn, Ve as Jr, ds as Jt, Nl as K, Ut as Ki, yi as Kn, Rn as Kr, Ts as Kt, ql as L, nt as Li, Ti as Ln, In as Lr, Hs as Lt, vu as M, It as Mi, Xi as Mn, Et as Mr, X as Mt, gu as N, Xt as Ni, Qi as Nn, $e as Nr, $s as Nt, Tu as O, Pt as Oi, Na as On, Hn as Or, _c as Ot, Yl as P, ze as Pi, Li as Pn, Tn as Pr, ec as Pt, Cl as Q, _n as Qi, $r as Qn, Ze as Qr, ls as Qt, Gl as R, pt as Ri, Ei as Rn, Zt as Rr, Vs as Rt, Hu as S, Re as Si, Ga as Sn, P as Sr, kc as St, Ou as T, Qe as Ti, K as Tn, Xn as Tr, bc as Tt, Vl as U, He as Ui, vi as Un, Ct as Ur, ks as Ut, su as V, ut as Vi, Ci as Vn, mt as Vr, zs as Vt, Ll as W, on as Wi, fi as Wn, vn as Wr, Os as Wt, Ol as X, et as Xi, ci as Xn, st as Xr, ps as Xt, Ml as Y, wt as Yi, li as Yn, Nn as Yr, ms as Yt, El as Z, En as Zi, si as Zn, Yt as Zr, us as Zt, Ju as _, en as _i, to as _n, lr as _r, Fc as _t, dd as a, Mt as aa, cn as ai, J as an, Hr as ar, el as at, Ru as b, dn as bi, Ka as bn, Zn as br, jc as bt, id as c, sn as ca, yt as ci, go as cn, L as cr, Xc as ct, nd as d, at as di, Mo as dn, cr as dr, Rc as dt, Ln as ea, ft as ei, os as en, ni as er, cl as et, Xu as f, lt as fi, uo as fn, dr as fr, Vc as ft, Qu as g, Tt as gi, eo as gn, hr as gr, Uc as gt, td as h, bt as hi, ao as hn, sr as hr, Wc as ht, fd as i, Mn as ia, un as ii, Lo as in, Ur as ir, il as it, bu as j, An as ji, Ki as jn, rt as jr, nc as jt, wu as k, Ft as ki, Ma as kn, Vn as kr, oc as kt, ad as l, ln as li, vo as ln, I as lr, Gc as lt, $u as m, xt as mi, io as mn, vr as mr, Bc as mt, md as n, zt as na, jt as ni, Wo as nn, Gr as nr, dl as nt, ld as o, Wt as oa, Ue as oi, Po as on, Rr as or, qc as ot, Zu as p, qt as pi, ho as pn, F as pr, Hc as pt, Il as q, Kt as qi, pi as qn, $t as qr, Ps as qt, pd as r, Sn as ra, Gt as ri, Uo as rn, Wr as rr, ol as rt, od as s, Jt as sa, _t as si, _o as sn, Mr as sr, Jc as st, vd as t, Qt as ta, Ot as ti, ss as tn, Kr as tr, fl as tt, ed as u, wn as ui, Oo as un, or as ur, zc as ut, qu as v, tn as vi, no as vn, Wn as vr, Nc as vt, Du as w, an as wi, V as wn, qn as wr, Ec as wt, Fu as x, Fn as xi, Qa as xn, er as xr, Ac as xt, Ku as y, hn as yi, q as yn, Qn as yr, Mc as yt, lu as z, vt as zi, wi as zn, jn as zr, Ls as zt };
|
|
6066
6199
|
|
|
6067
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
6200
|
+
//# sourceMappingURL=LinkedRecordFileField-BD3KkJt_.js.map
|