@realtek/core-theme-live 0.0.388 → 0.0.389
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-DjugAY5Z.cjs +5 -0
- package/dist-lib/LinkedRecordFileField-DjugAY5Z.cjs.map +1 -0
- package/dist-lib/{LinkedRecordFileField-CiVlY8m5.js → LinkedRecordFileField-lA8vfeFk.js} +950 -893
- package/dist-lib/LinkedRecordFileField-lA8vfeFk.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +8619 -8573
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/LinkedRecordFileField-BE_T5cc6.cjs +0 -5
- package/dist-lib/LinkedRecordFileField-BE_T5cc6.cjs.map +0 -1
- package/dist-lib/LinkedRecordFileField-CiVlY8m5.js.map +0 -1
|
@@ -16,7 +16,7 @@ import { Table as Te, TableCell as Ee, TableHeader as De, TableRow as Oe } from
|
|
|
16
16
|
import E from "prop-types";
|
|
17
17
|
import ke from "dompurify";
|
|
18
18
|
//#region src/services/adminApi.js
|
|
19
|
-
var
|
|
19
|
+
var D = "/admin/field-config", O = [
|
|
20
20
|
{
|
|
21
21
|
key: "clients",
|
|
22
22
|
apiModule: "clients"
|
|
@@ -46,17 +46,17 @@ var Ae = "/admin/field-config", D = [
|
|
|
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 Ae(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 je(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",
|
|
@@ -148,12 +148,12 @@ function Me(e, t) {
|
|
|
148
148
|
filterGroupSeparator: e.filterGroupSeparator ?? " "
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Me(e) {
|
|
152
152
|
if (typeof e == "string") return {
|
|
153
153
|
key: e,
|
|
154
154
|
apiModule: e
|
|
155
155
|
};
|
|
156
|
-
let t =
|
|
156
|
+
let t = A(e, [
|
|
157
157
|
"key",
|
|
158
158
|
"moduleKey",
|
|
159
159
|
"value",
|
|
@@ -165,7 +165,7 @@ function Ne(e) {
|
|
|
165
165
|
], "");
|
|
166
166
|
return t ? {
|
|
167
167
|
key: t,
|
|
168
|
-
apiModule:
|
|
168
|
+
apiModule: A(e, [
|
|
169
169
|
"apiModule",
|
|
170
170
|
"api_module",
|
|
171
171
|
"module",
|
|
@@ -177,38 +177,38 @@ function Ne(e) {
|
|
|
177
177
|
], t)
|
|
178
178
|
} : null;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
let t = Array.isArray(e) && e.length ? e :
|
|
182
|
-
return t.map(
|
|
180
|
+
function Ne(e = O) {
|
|
181
|
+
let t = Array.isArray(e) && e.length ? e : O, n = /* @__PURE__ */ new Set();
|
|
182
|
+
return t.map(Me).filter(Boolean).filter((e) => !n.has(e.key) && (n.add(e.key), !0));
|
|
183
183
|
}
|
|
184
|
-
var
|
|
185
|
-
async function
|
|
186
|
-
let e = await a(s,
|
|
184
|
+
var Pe = "/admin/modules";
|
|
185
|
+
async function Fe() {
|
|
186
|
+
let e = await a(s, Pe), t = e?.data;
|
|
187
187
|
return Array.isArray(t) ? t : Array.isArray(e) ? e : [];
|
|
188
188
|
}
|
|
189
|
-
async function
|
|
190
|
-
let t = await a(s, `${
|
|
189
|
+
async function Ie(e) {
|
|
190
|
+
let t = await a(s, `${Pe}/${encodeURIComponent(e)}/automations`), n = t?.data ?? t ?? {};
|
|
191
191
|
return {
|
|
192
192
|
gateway: n.gateway ?? null,
|
|
193
193
|
strategies: n.strategies ?? null
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
async function
|
|
196
|
+
async function Le(e) {
|
|
197
197
|
let t = await a(s, `/admin/platform/${e}`), n = t?.data ?? t;
|
|
198
198
|
return Array.isArray(n) ? n : [];
|
|
199
199
|
}
|
|
200
|
-
async function
|
|
200
|
+
async function Re(e, t) {
|
|
201
201
|
return a(s, `/admin/platform/${e}`, {
|
|
202
202
|
method: "POST",
|
|
203
203
|
headers: { "Content-Type": "application/json" },
|
|
204
204
|
body: JSON.stringify(t)
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function ze(e, t) {
|
|
208
208
|
return a(s, `/admin/platform/${e}/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
209
209
|
}
|
|
210
|
-
async function
|
|
211
|
-
return a(s, `${
|
|
210
|
+
async function Be(e, { gateway: t, strategies: n }) {
|
|
211
|
+
return a(s, `${Pe}/${encodeURIComponent(e)}/automations`, {
|
|
212
212
|
method: "PUT",
|
|
213
213
|
headers: { "Content-Type": "application/json" },
|
|
214
214
|
body: JSON.stringify({
|
|
@@ -217,20 +217,20 @@ async function Ve(e, { gateway: t, strategies: n }) {
|
|
|
217
217
|
})
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function Ve() {
|
|
221
221
|
let e = [];
|
|
222
222
|
try {
|
|
223
|
-
e = await
|
|
223
|
+
e = await ln();
|
|
224
224
|
} catch {
|
|
225
225
|
e = [];
|
|
226
226
|
}
|
|
227
227
|
let t = (Array.isArray(e) ? e : []).filter((e) => e?.isDeleted !== !0 && String(e?.status ?? "active").toLowerCase() !== "inactive" && String(e?.status ?? "active").toLowerCase() !== "disabled");
|
|
228
|
-
return t.length > 0 ? t :
|
|
228
|
+
return t.length > 0 ? t : Fe();
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function He() {
|
|
231
231
|
let e;
|
|
232
232
|
try {
|
|
233
|
-
e = await
|
|
233
|
+
e = await Fe();
|
|
234
234
|
} catch {
|
|
235
235
|
return {};
|
|
236
236
|
}
|
|
@@ -248,25 +248,25 @@ async function Ue() {
|
|
|
248
248
|
}
|
|
249
249
|
return t;
|
|
250
250
|
}
|
|
251
|
-
var
|
|
252
|
-
function
|
|
251
|
+
var Ue = "/admin/form-groups", We = "/admin/config-defaults", Ge = "000000000000000000000000";
|
|
252
|
+
function Ke(e) {
|
|
253
253
|
let t = String(e ?? "").trim();
|
|
254
|
-
return t === "" || t ===
|
|
254
|
+
return t === "" || t === Ge;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function qe(e = {}) {
|
|
257
257
|
let t = new URLSearchParams();
|
|
258
258
|
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
259
259
|
let n = t.toString();
|
|
260
260
|
return n ? `?${n}` : "";
|
|
261
261
|
}
|
|
262
|
-
async function
|
|
263
|
-
let n = `${
|
|
262
|
+
async function Je(e = "", t = {}) {
|
|
263
|
+
let n = `${Ue}${qe({
|
|
264
264
|
...t,
|
|
265
265
|
module: e || t.module || ""
|
|
266
266
|
})}`, r = await a(s, n), i = r?.data;
|
|
267
267
|
return Array.isArray(i) ? i : i && Array.isArray(i.groups) ? i.groups : Array.isArray(r) ? r : r && Array.isArray(r.groups) ? r.groups : [];
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function Ye({ offset: e = 0, limit: t = 100, sortBy: n = "new", searchvalue: r = "" } = {}) {
|
|
270
270
|
let i = new URLSearchParams({
|
|
271
271
|
offset: String(e),
|
|
272
272
|
limit: String(t),
|
|
@@ -277,29 +277,29 @@ async function Xe({ offset: e = 0, limit: t = 100, sortBy: n = "new", searchvalu
|
|
|
277
277
|
let u = await a(s, `/client/view?${i.toString()}`), d = u?.data ?? u;
|
|
278
278
|
return d?.clients ?? d?.Clients ?? d?.items ?? [];
|
|
279
279
|
}
|
|
280
|
-
async function
|
|
280
|
+
async function Xe(e) {
|
|
281
281
|
let t = await a(s, `/filter-dropdown-fields?module=${encodeURIComponent(e)}`), n = t?.data ?? t;
|
|
282
282
|
return Array.isArray(n) ? n : [];
|
|
283
283
|
}
|
|
284
|
-
async function
|
|
285
|
-
return a(s, `${
|
|
284
|
+
async function Ze(e, t = {}) {
|
|
285
|
+
return a(s, `${Ue}${qe(t)}`, {
|
|
286
286
|
method: "POST",
|
|
287
287
|
headers: { "Content-Type": "application/json" },
|
|
288
288
|
body: JSON.stringify(e)
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
async function
|
|
292
|
-
return a(s, `${
|
|
291
|
+
async function Qe(e, t, n = {}) {
|
|
292
|
+
return a(s, `${Ue}/${e}${qe(n)}`, {
|
|
293
293
|
method: "PUT",
|
|
294
294
|
headers: { "Content-Type": "application/json" },
|
|
295
295
|
body: JSON.stringify(t)
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
299
|
-
return a(s, `${
|
|
298
|
+
async function $e(e, t = {}) {
|
|
299
|
+
return a(s, `${Ue}/${e}${qe(t)}`, { method: "DELETE" });
|
|
300
300
|
}
|
|
301
|
-
async function
|
|
302
|
-
return a(s, `${
|
|
301
|
+
async function et(e, t) {
|
|
302
|
+
return a(s, `${We}/request-otp`, {
|
|
303
303
|
method: "POST",
|
|
304
304
|
body: JSON.stringify({
|
|
305
305
|
scope: e,
|
|
@@ -307,8 +307,8 @@ async function tt(e, t) {
|
|
|
307
307
|
})
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
async function
|
|
311
|
-
return a(s, `${
|
|
310
|
+
async function tt(e, t, n) {
|
|
311
|
+
return a(s, `${We}/apply`, {
|
|
312
312
|
method: "POST",
|
|
313
313
|
body: JSON.stringify({
|
|
314
314
|
scope: e,
|
|
@@ -317,23 +317,23 @@ async function nt(e, t, n) {
|
|
|
317
317
|
})
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
var
|
|
321
|
-
async function
|
|
322
|
-
let n =
|
|
320
|
+
var nt = "/admin/detail-config";
|
|
321
|
+
async function rt(e, t = {}) {
|
|
322
|
+
let n = qe({
|
|
323
323
|
module: e,
|
|
324
324
|
clientId: t.clientId
|
|
325
|
-
}), r = await a(s, `${
|
|
325
|
+
}), r = await a(s, `${nt}${n}`), i = r?.data ?? r ?? {};
|
|
326
326
|
return {
|
|
327
327
|
module: i.module ?? e,
|
|
328
|
-
clientId:
|
|
328
|
+
clientId: Ke(i.clientId) ? "" : String(i.clientId),
|
|
329
329
|
fields: Array.isArray(i.fields) ? i.fields : [],
|
|
330
330
|
merges: Array.isArray(i.merges) ? i.merges : [],
|
|
331
331
|
sourceFields: Array.isArray(i.sourceFields) ? i.sourceFields : [],
|
|
332
332
|
groups: Array.isArray(i.groups) ? i.groups : []
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
async function
|
|
336
|
-
return a(s,
|
|
335
|
+
async function it({ module: e, fields: t = [], merges: n = [], sourceFields: r = [], groups: i = [], clientId: o = "" }) {
|
|
336
|
+
return a(s, nt, {
|
|
337
337
|
method: "POST",
|
|
338
338
|
headers: { "Content-Type": "application/json" },
|
|
339
339
|
body: JSON.stringify({
|
|
@@ -346,8 +346,8 @@ async function at({ module: e, fields: t = [], merges: n = [], sourceFields: r =
|
|
|
346
346
|
})
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
async function
|
|
350
|
-
return a(s, `${
|
|
349
|
+
async function at({ module: e, clientId: t = "", otp: n }) {
|
|
350
|
+
return a(s, `${nt}/discover-fields`, {
|
|
351
351
|
method: "POST",
|
|
352
352
|
headers: { "Content-Type": "application/json" },
|
|
353
353
|
body: JSON.stringify({
|
|
@@ -357,35 +357,35 @@ async function ot({ module: e, clientId: t = "", otp: n }) {
|
|
|
357
357
|
})
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
|
-
var
|
|
361
|
-
async function
|
|
362
|
-
let e = await a(s,
|
|
360
|
+
var ot = "/admin/detail-defaults";
|
|
361
|
+
async function st() {
|
|
362
|
+
let e = await a(s, ot);
|
|
363
363
|
return e?.data ?? e ?? {};
|
|
364
364
|
}
|
|
365
|
-
async function
|
|
366
|
-
return a(s,
|
|
365
|
+
async function ct(e) {
|
|
366
|
+
return a(s, ot, {
|
|
367
367
|
method: "POST",
|
|
368
368
|
headers: { "Content-Type": "application/json" },
|
|
369
369
|
body: JSON.stringify(e)
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
|
-
var
|
|
373
|
-
async function
|
|
374
|
-
let e = await a(s,
|
|
372
|
+
var lt = "/admin/ai-service-config";
|
|
373
|
+
async function ut() {
|
|
374
|
+
let e = await a(s, lt);
|
|
375
375
|
return e?.data ?? e ?? [];
|
|
376
376
|
}
|
|
377
|
-
async function
|
|
378
|
-
return a(s,
|
|
377
|
+
async function dt(e) {
|
|
378
|
+
return a(s, lt, {
|
|
379
379
|
method: "POST",
|
|
380
380
|
headers: { "Content-Type": "application/json" },
|
|
381
381
|
body: JSON.stringify(e)
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
async function
|
|
385
|
-
return a(s, `${
|
|
384
|
+
async function ft(e) {
|
|
385
|
+
return a(s, `${lt}?serviceKey=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
386
386
|
}
|
|
387
|
-
async function
|
|
388
|
-
let r = await a(s, `${
|
|
387
|
+
async function pt({ baseUrl: e, authHeader: t, authValue: n }) {
|
|
388
|
+
let r = await a(s, `${lt}/test`, {
|
|
389
389
|
method: "POST",
|
|
390
390
|
headers: { "Content-Type": "application/json" },
|
|
391
391
|
body: JSON.stringify({
|
|
@@ -396,61 +396,61 @@ async function mt({ baseUrl: e, authHeader: t, authValue: n }) {
|
|
|
396
396
|
});
|
|
397
397
|
return r?.data ?? r;
|
|
398
398
|
}
|
|
399
|
-
var
|
|
400
|
-
async function
|
|
401
|
-
let e = await a(s,
|
|
399
|
+
var mt = "/admin/bgc-integration-config";
|
|
400
|
+
async function ht() {
|
|
401
|
+
let e = await a(s, mt);
|
|
402
402
|
return e?.data ?? e ?? {
|
|
403
403
|
updateMethod: "MANUAL",
|
|
404
404
|
enabled: !0
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
async function
|
|
408
|
-
return a(s,
|
|
407
|
+
async function gt(e) {
|
|
408
|
+
return a(s, mt, {
|
|
409
409
|
method: "PUT",
|
|
410
410
|
headers: { "Content-Type": "application/json" },
|
|
411
411
|
body: JSON.stringify(e)
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
async function
|
|
414
|
+
async function _t() {
|
|
415
415
|
let e = await a(s, "/integration-config/bgc/summary");
|
|
416
416
|
return e?.data ?? e ?? {
|
|
417
417
|
updateMethod: "MANUAL",
|
|
418
418
|
enabled: !0
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
|
-
var
|
|
422
|
-
async function
|
|
423
|
-
let e = await a(s,
|
|
421
|
+
var j = "/admin/integration-config";
|
|
422
|
+
async function vt() {
|
|
423
|
+
let e = await a(s, j);
|
|
424
424
|
return e?.data ?? e ?? [];
|
|
425
425
|
}
|
|
426
|
-
async function
|
|
427
|
-
let t = await a(s, `${
|
|
426
|
+
async function yt(e) {
|
|
427
|
+
let t = await a(s, `${j}/${encodeURIComponent(e)}`);
|
|
428
428
|
return t?.data ?? t;
|
|
429
429
|
}
|
|
430
|
-
async function
|
|
431
|
-
let t = e?.integrationKey, n = t ? `${
|
|
430
|
+
async function bt(e) {
|
|
431
|
+
let t = e?.integrationKey, n = t ? `${j}/${encodeURIComponent(t)}` : j;
|
|
432
432
|
return a(s, n, {
|
|
433
433
|
method: t ? "PUT" : "POST",
|
|
434
434
|
headers: { "Content-Type": "application/json" },
|
|
435
435
|
body: JSON.stringify(e)
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
-
async function
|
|
439
|
-
return a(s, `${
|
|
438
|
+
async function xt(e) {
|
|
439
|
+
return a(s, `${j}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
440
440
|
}
|
|
441
|
-
async function
|
|
442
|
-
let t = await a(s, `${
|
|
441
|
+
async function St(e) {
|
|
442
|
+
let t = await a(s, `${j}/test`, {
|
|
443
443
|
method: "POST",
|
|
444
444
|
headers: { "Content-Type": "application/json" },
|
|
445
445
|
body: JSON.stringify(e)
|
|
446
446
|
});
|
|
447
447
|
return t?.data ?? t;
|
|
448
448
|
}
|
|
449
|
-
async function
|
|
449
|
+
async function Ct(e) {
|
|
450
450
|
let t = await a(s, `/integration-config/${encodeURIComponent(e)}/summary`);
|
|
451
451
|
return t?.data ?? t;
|
|
452
452
|
}
|
|
453
|
-
async function
|
|
453
|
+
async function wt(e, t, n) {
|
|
454
454
|
let r = await a(s, `/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(t)}`, {
|
|
455
455
|
method: "POST",
|
|
456
456
|
headers: { "Content-Type": "application/json" },
|
|
@@ -458,7 +458,7 @@ async function Tt(e, t, n) {
|
|
|
458
458
|
});
|
|
459
459
|
return r?.data ?? r;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Tt(e) {
|
|
462
462
|
return {
|
|
463
463
|
key: e.role_id ?? e.id,
|
|
464
464
|
roleId: e.role_id ?? e.id,
|
|
@@ -469,17 +469,17 @@ function Et(e) {
|
|
|
469
469
|
raw: e
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function M(e) {
|
|
473
473
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
474
474
|
}
|
|
475
|
-
async function
|
|
476
|
-
let e = await a(s, "/get-roles"), t = e.data ?? e, n =
|
|
475
|
+
async function Et() {
|
|
476
|
+
let e = await a(s, "/get-roles"), t = e.data ?? e, n = k(t?.zinnext_default).map(Tt), r = k(t?.custom_roles).map(Tt), i = [...n, ...r];
|
|
477
477
|
return {
|
|
478
478
|
roles: i,
|
|
479
479
|
total: i.length
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Dt(e) {
|
|
483
483
|
return {
|
|
484
484
|
key: e.teamId,
|
|
485
485
|
teamId: e.teamId,
|
|
@@ -487,28 +487,28 @@ function Ot(e) {
|
|
|
487
487
|
manager: e.reportingManager ?? "N/A",
|
|
488
488
|
managerId: e.reportingManagerId ?? 0,
|
|
489
489
|
memberCount: e.noOfTeamMembers ?? 0,
|
|
490
|
-
members:
|
|
491
|
-
memberIds:
|
|
490
|
+
members: k(e.teamMembers),
|
|
491
|
+
memberIds: k(e.teamMembersIds),
|
|
492
492
|
raw: e
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ot(e) {
|
|
496
496
|
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
497
497
|
}
|
|
498
|
-
async function
|
|
498
|
+
async function kt({ offset: e = 0, limit: t = 10, sortBy: n = "new", search: r = "" } = {}) {
|
|
499
499
|
let i = new URLSearchParams({
|
|
500
500
|
searchquery: r,
|
|
501
501
|
sortBy: n,
|
|
502
502
|
limit: String(t),
|
|
503
503
|
offset: String(e)
|
|
504
|
-
}), o = await a(s, `/get-teams?${i}`), c = o.data ?? o, l =
|
|
504
|
+
}), 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;
|
|
505
505
|
return {
|
|
506
|
-
teams: l.map(
|
|
506
|
+
teams: l.map(Dt),
|
|
507
507
|
total: u
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
async function
|
|
511
|
-
let i =
|
|
510
|
+
async function At(e, { teamName: t, managerId: n, memberIds: r = [] }) {
|
|
511
|
+
let i = Ot(e);
|
|
512
512
|
return a(s, `/team/edit?teamId=${i}`, {
|
|
513
513
|
method: "PUT",
|
|
514
514
|
body: JSON.stringify({
|
|
@@ -519,7 +519,7 @@ async function jt(e, { teamName: t, managerId: n, memberIds: r = [] }) {
|
|
|
519
519
|
})
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
async function
|
|
522
|
+
async function jt(e, t, n, r = "listView", i = !1) {
|
|
523
523
|
let o = new URLSearchParams({
|
|
524
524
|
module: e,
|
|
525
525
|
userId: "0",
|
|
@@ -527,28 +527,28 @@ async function Mt(e, t, n, r = "listView", i = !1) {
|
|
|
527
527
|
configType: r
|
|
528
528
|
});
|
|
529
529
|
i && (!r || r === "listView") && o.set("includeMeta", "1");
|
|
530
|
-
let c = await a(s, `${
|
|
530
|
+
let c = await a(s, `${D}?${o}`), l = c.data ?? c, u = k(l, l?.visibleFields, c?.visibleFields);
|
|
531
531
|
return i ? {
|
|
532
532
|
fields: u,
|
|
533
533
|
dataVisibilityMode: l?.dataVisibilityMode ?? c?.dataVisibilityMode ?? "all",
|
|
534
534
|
dataOwnerField: l?.dataOwnerField ?? c?.dataOwnerField ?? "createdBy"
|
|
535
535
|
} : u;
|
|
536
536
|
}
|
|
537
|
-
async function
|
|
538
|
-
let r =
|
|
539
|
-
...
|
|
537
|
+
async function Mt(e, t = "listView", n = O) {
|
|
538
|
+
let r = M(e), i = Ne(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await jt(n, "roleId", r, t)).map((t, i) => ({
|
|
539
|
+
...je(t, i),
|
|
540
540
|
module: e,
|
|
541
541
|
apiModule: n,
|
|
542
542
|
roleId: r
|
|
543
543
|
}))]));
|
|
544
544
|
return Object.fromEntries(a);
|
|
545
545
|
}
|
|
546
|
-
async function
|
|
547
|
-
let r =
|
|
548
|
-
let i = await
|
|
546
|
+
async function Nt(e, t = "listView", n = O) {
|
|
547
|
+
let r = M(e), i = Ne(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => {
|
|
548
|
+
let i = await jt(n, "roleId", r, t, !0);
|
|
549
549
|
return [e, {
|
|
550
550
|
fields: i.fields.map((t, i) => ({
|
|
551
|
-
...
|
|
551
|
+
...je(t, i),
|
|
552
552
|
module: e,
|
|
553
553
|
apiModule: n,
|
|
554
554
|
roleId: r
|
|
@@ -559,16 +559,16 @@ async function Pt(e, t = "listView", n = D) {
|
|
|
559
559
|
}));
|
|
560
560
|
return Object.fromEntries(a);
|
|
561
561
|
}
|
|
562
|
-
async function
|
|
563
|
-
let n =
|
|
564
|
-
...
|
|
562
|
+
async function Pt(e, t = "listView") {
|
|
563
|
+
let n = Ot(e), r = await Promise.all(O.map(async ({ key: e, apiModule: r }) => [e, (await jt(r, "teamId", n, t)).map((t, i) => ({
|
|
564
|
+
...je(t, i),
|
|
565
565
|
module: e,
|
|
566
566
|
apiModule: r,
|
|
567
567
|
teamId: n
|
|
568
568
|
}))]));
|
|
569
569
|
return Object.fromEntries(r);
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function Ft(e) {
|
|
572
572
|
if (!e?.lookup) return null;
|
|
573
573
|
let t = { ...e.lookup }, n = String(t.localField ?? "").trim() || String(e.fieldKey ?? "").trim(), r = String(t.valueField ?? t.foreignField ?? "").trim() || "_id", i = String(t.displayField ?? t.projectField ?? "").trim(), a = String(t.displayField2 ?? "").trim(), o = Array.isArray(t.projectFields) ? t.projectFields.map((e) => String(e ?? "").trim()).filter(Boolean) : [];
|
|
574
574
|
return o.length === 0 && (o = [i, a].filter(Boolean)), {
|
|
@@ -580,7 +580,7 @@ function It(e) {
|
|
|
580
580
|
projectFields: o
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function It(e, t) {
|
|
584
584
|
let n = !t || t === "listView";
|
|
585
585
|
return e.map((e, r) => {
|
|
586
586
|
let i = {
|
|
@@ -600,7 +600,7 @@ function Lt(e, t) {
|
|
|
600
600
|
secondaryLabel: e.secondaryLabel ?? "",
|
|
601
601
|
secondaryFields: Array.isArray(e.secondaryFields) ? e.secondaryFields : [],
|
|
602
602
|
secondarySeparator: e.secondarySeparator ?? "",
|
|
603
|
-
lookup:
|
|
603
|
+
lookup: Ft(e),
|
|
604
604
|
actionButtons: e.actionButtons ?? [],
|
|
605
605
|
derived: e.derived ?? null,
|
|
606
606
|
computed: e.computed ?? null,
|
|
@@ -621,15 +621,15 @@ function Lt(e, t) {
|
|
|
621
621
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
|
-
async function
|
|
625
|
-
let l =
|
|
626
|
-
return a(s, `${
|
|
624
|
+
async function Lt(e, t, n, r = "listView", i = O, o = "", c = "createdBy") {
|
|
625
|
+
let l = M(e), u = Ne(i).find((e) => e.key === t)?.apiModule ?? t;
|
|
626
|
+
return a(s, `${D}/role`, {
|
|
627
627
|
method: "PUT",
|
|
628
628
|
body: JSON.stringify({
|
|
629
629
|
module: u,
|
|
630
630
|
roleId: l,
|
|
631
631
|
configType: r,
|
|
632
|
-
visibleFields:
|
|
632
|
+
visibleFields: It(n, r),
|
|
633
633
|
...(!r || r === "listView") && o ? {
|
|
634
634
|
dataVisibilityMode: o,
|
|
635
635
|
dataOwnerField: String(c || "createdBy").trim() || "createdBy"
|
|
@@ -637,25 +637,25 @@ async function Rt(e, t, n, r = "listView", i = D, o = "", c = "createdBy") {
|
|
|
637
637
|
})
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
|
-
var
|
|
641
|
-
function
|
|
640
|
+
var Rt = "/admin/role-form-permissions";
|
|
641
|
+
function zt(e) {
|
|
642
642
|
return `__group__:${e}`;
|
|
643
643
|
}
|
|
644
|
-
async function
|
|
645
|
-
let r =
|
|
644
|
+
async function Bt(e, t, n = {}) {
|
|
645
|
+
let r = M(e), i = new URLSearchParams({
|
|
646
646
|
module: t,
|
|
647
647
|
roleId: String(r ?? "")
|
|
648
648
|
});
|
|
649
649
|
n.clientId && i.set("clientId", n.clientId), n.region && i.set("region", n.region);
|
|
650
|
-
let o = await a(s, `${
|
|
650
|
+
let o = await a(s, `${Rt}?${i}`), c = o?.data ?? o;
|
|
651
651
|
return Array.isArray(c) ? c : [];
|
|
652
652
|
}
|
|
653
|
-
async function
|
|
654
|
-
let r =
|
|
653
|
+
async function Vt(e, t, n) {
|
|
654
|
+
let r = M(e), i = [], o = 0;
|
|
655
655
|
for (let e of n) {
|
|
656
656
|
e.locked || i.push({
|
|
657
657
|
label: e.label,
|
|
658
|
-
field:
|
|
658
|
+
field: zt(e.name),
|
|
659
659
|
isVisible: e.enabled,
|
|
660
660
|
isEditable: e.editable !== !1,
|
|
661
661
|
order: o++
|
|
@@ -668,7 +668,7 @@ async function Ht(e, t, n) {
|
|
|
668
668
|
order: o++
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
|
-
return a(s, `${
|
|
671
|
+
return a(s, `${D}/role`, {
|
|
672
672
|
method: "PUT",
|
|
673
673
|
body: JSON.stringify({
|
|
674
674
|
module: t,
|
|
@@ -678,49 +678,49 @@ async function Ht(e, t, n) {
|
|
|
678
678
|
})
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
|
-
async function
|
|
682
|
-
let i =
|
|
683
|
-
return a(s, `${
|
|
681
|
+
async function Ht(e, t, n, r = "listView") {
|
|
682
|
+
let i = Ot(e), o = O.find((e) => e.key === t)?.apiModule ?? t;
|
|
683
|
+
return a(s, `${D}/team`, {
|
|
684
684
|
method: "PUT",
|
|
685
685
|
body: JSON.stringify({
|
|
686
686
|
module: o,
|
|
687
687
|
teamId: i,
|
|
688
688
|
configType: r,
|
|
689
|
-
visibleFields:
|
|
689
|
+
visibleFields: It(n, r)
|
|
690
690
|
})
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
-
async function
|
|
693
|
+
async function Ut({ offset: e = 0, limit: t = 10, sortBy: n = "new", searchQuery: r = "" } = {}) {
|
|
694
694
|
let i = new URLSearchParams({
|
|
695
695
|
offset: String(e),
|
|
696
696
|
limit: String(t),
|
|
697
697
|
sortBy: n
|
|
698
698
|
});
|
|
699
699
|
r && i.set("searchquery", r);
|
|
700
|
-
let o = await a(s, `/get-all-users?${i}`), c = o.data ?? o, l =
|
|
700
|
+
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);
|
|
701
701
|
return {
|
|
702
702
|
users: l,
|
|
703
|
-
total:
|
|
703
|
+
total: Ae({
|
|
704
704
|
...o,
|
|
705
705
|
...c
|
|
706
706
|
}, l)
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
|
-
async function
|
|
710
|
-
return a(s, `${
|
|
709
|
+
async function Wt(e = []) {
|
|
710
|
+
return a(s, `${D}/seed`, {
|
|
711
711
|
method: "POST",
|
|
712
712
|
headers: { "Content-Type": "application/json" },
|
|
713
713
|
body: JSON.stringify({ collections: e })
|
|
714
714
|
});
|
|
715
715
|
}
|
|
716
|
-
async function
|
|
717
|
-
let e = await a(s, `${
|
|
716
|
+
async function Gt() {
|
|
717
|
+
let e = await a(s, `${D}/seed-status`), t = e?.data ?? e ?? {};
|
|
718
718
|
return {
|
|
719
719
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
720
720
|
seededModules: t.seededModules ?? {}
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
|
-
async function
|
|
723
|
+
async function Kt(e) {
|
|
724
724
|
let t = localStorage.getItem("authToken"), n = new FormData();
|
|
725
725
|
n.append("icon", e);
|
|
726
726
|
let r = await fetch(`${s}/admin/field-config/action-icon`, {
|
|
@@ -735,11 +735,11 @@ async function qt(e) {
|
|
|
735
735
|
let i = await r.json();
|
|
736
736
|
return i.data ?? i;
|
|
737
737
|
}
|
|
738
|
-
async function
|
|
738
|
+
async function qt() {
|
|
739
739
|
let [e, t, n] = await Promise.all([
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
Ve().catch(() => []),
|
|
741
|
+
on().catch(() => []),
|
|
742
|
+
On().catch(() => [])
|
|
743
743
|
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
744
744
|
return [
|
|
745
745
|
...r,
|
|
@@ -747,7 +747,7 @@ async function Jt() {
|
|
|
747
747
|
...i
|
|
748
748
|
];
|
|
749
749
|
}
|
|
750
|
-
async function
|
|
750
|
+
async function Jt(e, { page: t = 1, limit: n = 100 } = {}) {
|
|
751
751
|
let r = new URLSearchParams({
|
|
752
752
|
module: e,
|
|
753
753
|
page: String(t),
|
|
@@ -758,24 +758,24 @@ async function Yt(e, { page: t = 1, limit: n = 100 } = {}) {
|
|
|
758
758
|
total: o.pagination?.total ?? 0
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
async function
|
|
761
|
+
async function Yt(e, t) {
|
|
762
762
|
return a(s, `/module/create?module=${encodeURIComponent(e)}`, {
|
|
763
763
|
method: "POST",
|
|
764
764
|
headers: { "Content-Type": "application/json" },
|
|
765
765
|
body: JSON.stringify(t)
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
async function
|
|
768
|
+
async function Xt(e, t, n) {
|
|
769
769
|
return a(s, `/module/update/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, {
|
|
770
770
|
method: "PUT",
|
|
771
771
|
headers: { "Content-Type": "application/json" },
|
|
772
772
|
body: JSON.stringify(n)
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
|
-
async function
|
|
775
|
+
async function Zt(e, t) {
|
|
776
776
|
return a(s, `/module/delete/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
777
777
|
}
|
|
778
|
-
async function
|
|
778
|
+
async function Qt(e = "", t = 50) {
|
|
779
779
|
let n = new URLSearchParams({
|
|
780
780
|
search: e,
|
|
781
781
|
limit: String(t),
|
|
@@ -789,7 +789,7 @@ async function $t(e = "", t = 50) {
|
|
|
789
789
|
};
|
|
790
790
|
}).filter((e) => e.label);
|
|
791
791
|
}
|
|
792
|
-
async function
|
|
792
|
+
async function $t(e, t, n = "_id") {
|
|
793
793
|
let r = new URLSearchParams({
|
|
794
794
|
collection: String(e),
|
|
795
795
|
displayField: String(t),
|
|
@@ -800,7 +800,7 @@ async function en(e, t, n = "_id") {
|
|
|
800
800
|
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
801
801
|
})).filter((e) => e.value && e.label);
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function en(e) {
|
|
804
804
|
if (typeof e == "string") {
|
|
805
805
|
let t = e.trim();
|
|
806
806
|
return t ? {
|
|
@@ -819,18 +819,18 @@ function tn(e) {
|
|
|
819
819
|
forceReq: e.forceReq === !0
|
|
820
820
|
} : null;
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function tn(e) {
|
|
823
823
|
let t = /* @__PURE__ */ new Map();
|
|
824
824
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
825
|
-
let n =
|
|
825
|
+
let n = en(e);
|
|
826
826
|
n && !t.has(n.field) && t.set(n.field, n);
|
|
827
827
|
}), t;
|
|
828
828
|
}
|
|
829
|
-
async function
|
|
829
|
+
async function nn(e) {
|
|
830
830
|
let t = await a(s, `/admin/default-fields?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
831
831
|
return Array.isArray(n.fields) ? n.fields : [];
|
|
832
832
|
}
|
|
833
|
-
async function
|
|
833
|
+
async function rn(e, t, n) {
|
|
834
834
|
return a(s, "/admin/default-fields", {
|
|
835
835
|
method: "PUT",
|
|
836
836
|
headers: { "Content-Type": "application/json" },
|
|
@@ -841,7 +841,7 @@ async function an(e, t, n) {
|
|
|
841
841
|
})
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
async function
|
|
844
|
+
async function an(e) {
|
|
845
845
|
let t = await a(s, "/email-verify", {
|
|
846
846
|
method: "POST",
|
|
847
847
|
headers: { "Content-Type": "application/json" },
|
|
@@ -859,23 +859,23 @@ async function on(e) {
|
|
|
859
859
|
checks: Array.isArray(n.checks) ? n.checks : []
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
|
-
async function
|
|
862
|
+
async function on() {
|
|
863
863
|
let e = await a(s, "/admin/lookup/collections"), t = e.data ?? e;
|
|
864
864
|
return Array.isArray(t) ? t : [];
|
|
865
865
|
}
|
|
866
|
-
async function
|
|
866
|
+
async function sn(e) {
|
|
867
867
|
let t = await a(s, `/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`), n = t.data ?? t;
|
|
868
868
|
return Array.isArray(n) ? n : [];
|
|
869
869
|
}
|
|
870
|
-
async function
|
|
870
|
+
async function cn(e, t) {
|
|
871
871
|
let n = await a(s, `/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(t)}`), r = n.data ?? n;
|
|
872
872
|
return Array.isArray(r?.fields) ? r.fields : [];
|
|
873
873
|
}
|
|
874
|
-
async function
|
|
874
|
+
async function ln() {
|
|
875
875
|
let e = await a(s, "/admin/menu-modules");
|
|
876
|
-
return
|
|
876
|
+
return k(e.data, e);
|
|
877
877
|
}
|
|
878
|
-
async function
|
|
878
|
+
async function un({ menuName: e, apiUrl: t = "", menuType: n = "menu", parentMenuId: r = 0, displayOrder: i = 0 }) {
|
|
879
879
|
let o = await a(s, "/admin/menu-modules", {
|
|
880
880
|
method: "POST",
|
|
881
881
|
body: JSON.stringify({
|
|
@@ -888,22 +888,22 @@ async function dn({ menuName: e, apiUrl: t = "", menuType: n = "menu", parentMen
|
|
|
888
888
|
});
|
|
889
889
|
return o.data ?? o;
|
|
890
890
|
}
|
|
891
|
-
async function
|
|
891
|
+
async function dn(e, { menuName: t }) {
|
|
892
892
|
let n = await a(s, `/admin/menu-modules/${e}`, {
|
|
893
893
|
method: "PUT",
|
|
894
894
|
body: JSON.stringify({ menuName: t })
|
|
895
895
|
});
|
|
896
896
|
return n.data ?? n;
|
|
897
897
|
}
|
|
898
|
-
async function
|
|
898
|
+
async function fn(e) {
|
|
899
899
|
let t = await a(s, `/admin/menu-modules/${e}`, { method: "DELETE" });
|
|
900
900
|
return t.data ?? t;
|
|
901
901
|
}
|
|
902
|
-
async function
|
|
902
|
+
async function pn() {
|
|
903
903
|
let e = await a(s, "/admin/menu-actions");
|
|
904
|
-
return
|
|
904
|
+
return k(e.data, e);
|
|
905
905
|
}
|
|
906
|
-
async function
|
|
906
|
+
async function mn({ permissionName: e, permissionKey: t }) {
|
|
907
907
|
let n = await a(s, "/admin/menu-actions", {
|
|
908
908
|
method: "POST",
|
|
909
909
|
body: JSON.stringify({
|
|
@@ -913,83 +913,83 @@ async function hn({ permissionName: e, permissionKey: t }) {
|
|
|
913
913
|
});
|
|
914
914
|
return n.data ?? n;
|
|
915
915
|
}
|
|
916
|
-
async function
|
|
916
|
+
async function hn(e, { permissionName: t }) {
|
|
917
917
|
let n = await a(s, `/admin/menu-actions/${e}`, {
|
|
918
918
|
method: "PUT",
|
|
919
919
|
body: JSON.stringify({ permissionName: t })
|
|
920
920
|
});
|
|
921
921
|
return n.data ?? n;
|
|
922
922
|
}
|
|
923
|
-
async function
|
|
923
|
+
async function gn(e) {
|
|
924
924
|
let t = await a(s, `/admin/menu-actions/${e}`, { method: "DELETE" });
|
|
925
925
|
return t.data ?? t;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
if (e && typeof e == "object" && !Array.isArray(e)) return
|
|
927
|
+
function _n(e) {
|
|
928
|
+
if (e && typeof e == "object" && !Array.isArray(e)) return _n(e.value ?? e.access_value ?? e.accessValue ?? e.permissionValue ?? e.enabled);
|
|
929
929
|
if (e === !0 || e === 1 || e === "1") return "1";
|
|
930
930
|
let t = String(e ?? "").trim().toLowerCase();
|
|
931
931
|
return t === "true" || t === "yes" || t === "active" ? "1" : "0";
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function vn(e = {}) {
|
|
934
934
|
return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, {
|
|
935
935
|
...t,
|
|
936
936
|
menuId: t?.menuId ?? t?.menu_id ?? 0,
|
|
937
937
|
permissions: Object.fromEntries(Object.entries(t?.permissions ?? {}).map(([e, t]) => [e, {
|
|
938
938
|
...t && typeof t == "object" && !Array.isArray(t) ? t : {},
|
|
939
939
|
id: t?.id ?? t?.permission_id ?? t?.permissionId ?? 0,
|
|
940
|
-
value:
|
|
940
|
+
value: _n(t)
|
|
941
941
|
}]))
|
|
942
942
|
}]));
|
|
943
943
|
}
|
|
944
|
-
async function
|
|
944
|
+
async function yn(e) {
|
|
945
945
|
let t = await a(s, `/get-role-details?roleid=${e}`);
|
|
946
946
|
return t?.data ?? t ?? {};
|
|
947
947
|
}
|
|
948
|
-
async function
|
|
948
|
+
async function bn(e, t) {
|
|
949
949
|
return a(s, "/edit-role-details", {
|
|
950
950
|
method: "PUT",
|
|
951
951
|
headers: { "Content-Type": "application/json" },
|
|
952
952
|
body: JSON.stringify({
|
|
953
953
|
roleId: e,
|
|
954
|
-
menus:
|
|
954
|
+
menus: vn(t)
|
|
955
955
|
})
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
|
-
var
|
|
959
|
-
async function
|
|
958
|
+
var xn = "/admin/custom-forms";
|
|
959
|
+
async function Sn(e = "", t = "", n = "") {
|
|
960
960
|
let r = new URLSearchParams();
|
|
961
961
|
e && r.append("module", e), t && r.append("formType", t), n && r.append("action", n);
|
|
962
|
-
let i = `${
|
|
962
|
+
let i = `${xn}?${r.toString()}`, o = await a(s, i), c = o?.data;
|
|
963
963
|
return Array.isArray(c) ? c : Array.isArray(o) ? o : [];
|
|
964
964
|
}
|
|
965
|
-
async function
|
|
966
|
-
return a(s,
|
|
965
|
+
async function Cn(e) {
|
|
966
|
+
return a(s, xn, {
|
|
967
967
|
method: "POST",
|
|
968
968
|
headers: { "Content-Type": "application/json" },
|
|
969
969
|
body: JSON.stringify(e)
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
|
-
async function
|
|
973
|
-
return a(s, `${
|
|
972
|
+
async function wn(e, t) {
|
|
973
|
+
return a(s, `${xn}/${e}`, {
|
|
974
974
|
method: "PUT",
|
|
975
975
|
headers: { "Content-Type": "application/json" },
|
|
976
976
|
body: JSON.stringify(t)
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
|
-
async function
|
|
980
|
-
return a(s, `${
|
|
979
|
+
async function Tn(e) {
|
|
980
|
+
return a(s, `${xn}/${e}`, { method: "DELETE" });
|
|
981
981
|
}
|
|
982
|
-
var
|
|
983
|
-
function
|
|
982
|
+
var En = "/admin/row-action-config";
|
|
983
|
+
function Dn(e) {
|
|
984
984
|
return String(e ?? "").trim().toLowerCase();
|
|
985
985
|
}
|
|
986
|
-
async function
|
|
987
|
-
let t =
|
|
986
|
+
async function On(e = "") {
|
|
987
|
+
let t = Dn(e), n = t ? `${En}?module=${encodeURIComponent(t)}` : En, r = await a(s, n), i = r?.data;
|
|
988
988
|
return Array.isArray(i) ? i : Array.isArray(r) ? r : [];
|
|
989
989
|
}
|
|
990
|
-
async function
|
|
991
|
-
let r =
|
|
992
|
-
return a(s,
|
|
990
|
+
async function kn({ module: e, roleId: t = 0, rowActions: n = [] }) {
|
|
991
|
+
let r = Dn(e);
|
|
992
|
+
return a(s, En, {
|
|
993
993
|
method: "POST",
|
|
994
994
|
headers: { "Content-Type": "application/json" },
|
|
995
995
|
body: JSON.stringify({
|
|
@@ -999,23 +999,23 @@ async function An({ module: e, roleId: t = 0, rowActions: n = [] }) {
|
|
|
999
999
|
})
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
1002
|
-
async function
|
|
1003
|
-
return a(s, `${
|
|
1002
|
+
async function An(e, t = []) {
|
|
1003
|
+
return a(s, `${En}/${e}`, {
|
|
1004
1004
|
method: "PUT",
|
|
1005
1005
|
headers: { "Content-Type": "application/json" },
|
|
1006
1006
|
body: JSON.stringify({ rowActions: t })
|
|
1007
1007
|
});
|
|
1008
1008
|
}
|
|
1009
|
-
async function
|
|
1010
|
-
return a(s, `${
|
|
1009
|
+
async function jn(e) {
|
|
1010
|
+
return a(s, `${En}/${e}`, { method: "DELETE" });
|
|
1011
1011
|
}
|
|
1012
|
-
var
|
|
1013
|
-
async function
|
|
1014
|
-
let t = await a(s, `${
|
|
1012
|
+
var Mn = "/admin/module-action-rules";
|
|
1013
|
+
async function Nn(e) {
|
|
1014
|
+
let t = await a(s, `${Mn}?module=${encodeURIComponent(e)}`), n = t?.data;
|
|
1015
1015
|
return Array.isArray(n) ? n : Array.isArray(t) ? t : [];
|
|
1016
1016
|
}
|
|
1017
|
-
async function
|
|
1018
|
-
return a(s,
|
|
1017
|
+
async function Pn({ module: e, name: t, description: n = "", conditions: r = [], blockedActions: i = [], disabledActions: o = [], isActive: c = !0 }) {
|
|
1018
|
+
return a(s, Mn, {
|
|
1019
1019
|
method: "POST",
|
|
1020
1020
|
headers: { "Content-Type": "application/json" },
|
|
1021
1021
|
body: JSON.stringify({
|
|
@@ -1029,8 +1029,8 @@ async function Fn({ module: e, name: t, description: n = "", conditions: r = [],
|
|
|
1029
1029
|
})
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
|
-
async function
|
|
1033
|
-
return a(s, `${
|
|
1032
|
+
async function Fn(e, { name: t, description: n = "", conditions: r = [], blockedActions: i = [], disabledActions: o = [], isActive: c = !0 }) {
|
|
1033
|
+
return a(s, `${Mn}/${e}`, {
|
|
1034
1034
|
method: "PUT",
|
|
1035
1035
|
headers: { "Content-Type": "application/json" },
|
|
1036
1036
|
body: JSON.stringify({
|
|
@@ -1043,12 +1043,12 @@ async function In(e, { name: t, description: n = "", conditions: r = [], blocked
|
|
|
1043
1043
|
})
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
|
-
async function
|
|
1047
|
-
return a(s, `${
|
|
1046
|
+
async function In(e) {
|
|
1047
|
+
return a(s, `${Mn}/${e}`, { method: "DELETE" });
|
|
1048
1048
|
}
|
|
1049
1049
|
//#endregion
|
|
1050
1050
|
//#region src/services/detailDefaults.js
|
|
1051
|
-
var
|
|
1051
|
+
var Ln = Object.freeze({
|
|
1052
1052
|
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
1053
1053
|
dateFormat: "DD MMM YYYY",
|
|
1054
1054
|
dateTimeFormat: "MMM DD, YYYY | hh:mm A",
|
|
@@ -1070,28 +1070,28 @@ var Rn = Object.freeze({
|
|
|
1070
1070
|
],
|
|
1071
1071
|
phoneFormat: "3-3-4",
|
|
1072
1072
|
phoneCountryCode: ""
|
|
1073
|
-
}),
|
|
1074
|
-
function
|
|
1075
|
-
return
|
|
1073
|
+
}), N = { ...Ln }, Rn = null;
|
|
1074
|
+
function P() {
|
|
1075
|
+
return N;
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function zn(e) {
|
|
1078
1078
|
if (!e || typeof e != "object") return {};
|
|
1079
1079
|
let t = {};
|
|
1080
1080
|
if (e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.dateTimeFormat && (t.dateTimeFormat = e.dateTimeFormat), typeof e.showTimeZoneLabel == "boolean" && (t.showTimeZoneLabel = e.showTimeZoneLabel), typeof e.timeZone == "string" && (t.timeZone = e.timeZone.trim()), typeof e.region == "string" && (t.region = e.region.trim()), e.timeZoneAliases && typeof e.timeZoneAliases == "object" && !Array.isArray(e.timeZoneAliases) && (t.timeZoneAliases = {
|
|
1081
|
-
...
|
|
1081
|
+
...N.timeZoneAliases,
|
|
1082
1082
|
...e.timeZoneAliases
|
|
1083
1083
|
}), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), e.emptyTexts && typeof e.emptyTexts == "object" && !Array.isArray(e.emptyTexts)) {
|
|
1084
1084
|
let n = {};
|
|
1085
1085
|
Object.entries(e.emptyTexts).forEach(([e, t]) => {
|
|
1086
1086
|
typeof t == "string" && t.trim() !== "" && (n[e] = t.trim());
|
|
1087
1087
|
}), Object.keys(n).length && (t.emptyTexts = {
|
|
1088
|
-
...
|
|
1088
|
+
...N.emptyTexts,
|
|
1089
1089
|
...n
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
return typeof e.separator == "string" && e.separator !== "" && (t.separator = e.separator), typeof e.phoneFormat == "string" && e.phoneFormat.trim() !== "" && (t.phoneFormat = e.phoneFormat.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), t;
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Bn(e = Vn()) {
|
|
1095
1095
|
let t = (String(e).match(/\d+/g) ?? [
|
|
1096
1096
|
"3",
|
|
1097
1097
|
"3",
|
|
@@ -1107,18 +1107,18 @@ function Vn(e = Hn()) {
|
|
|
1107
1107
|
total: r.reduce((e, t) => e + t, 0)
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1110
|
+
function Vn() {
|
|
1111
|
+
return N.phoneFormat || Ln.phoneFormat;
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1113
|
+
function Hn() {
|
|
1114
|
+
return N.phoneCountryCode ?? Ln.phoneCountryCode;
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1117
|
-
let { total: n } =
|
|
1116
|
+
function Un(e, t = Vn()) {
|
|
1117
|
+
let { total: n } = Bn(t);
|
|
1118
1118
|
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1121
|
-
let { groups: n, sep: r } =
|
|
1120
|
+
function Wn(e, t = Vn()) {
|
|
1121
|
+
let { groups: n, sep: r } = Bn(t), i = Un(e, t);
|
|
1122
1122
|
if (!i) return "";
|
|
1123
1123
|
let a = [], o = 0;
|
|
1124
1124
|
for (let e of n) {
|
|
@@ -1127,26 +1127,26 @@ function Gn(e, t = Hn()) {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
return a.join(r);
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return
|
|
1132
|
-
...
|
|
1133
|
-
...
|
|
1134
|
-
},
|
|
1130
|
+
function Gn(e) {
|
|
1131
|
+
return N = {
|
|
1132
|
+
...N,
|
|
1133
|
+
...zn(e)
|
|
1134
|
+
}, N;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1137
|
-
return
|
|
1136
|
+
function Kn(e = !1) {
|
|
1137
|
+
return Rn && !e || (Rn = st().then((e) => Gn(e)).catch(() => N)), Rn;
|
|
1138
1138
|
}
|
|
1139
1139
|
T.extend(_e), T.extend(ve);
|
|
1140
|
-
var
|
|
1141
|
-
function
|
|
1142
|
-
if (
|
|
1143
|
-
|
|
1140
|
+
var qn = null;
|
|
1141
|
+
function Jn() {
|
|
1142
|
+
if (qn === null) try {
|
|
1143
|
+
qn = T.tz.guess() || "UTC";
|
|
1144
1144
|
} catch {
|
|
1145
|
-
|
|
1145
|
+
qn = "UTC";
|
|
1146
1146
|
}
|
|
1147
|
-
return
|
|
1147
|
+
return qn;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function Yn(e) {
|
|
1150
1150
|
let t = String(e ?? "").trim();
|
|
1151
1151
|
if (!t || t !== "UTC" && !t.includes("/")) return !1;
|
|
1152
1152
|
try {
|
|
@@ -1155,30 +1155,30 @@ function Xn(e) {
|
|
|
1155
1155
|
return !1;
|
|
1156
1156
|
}
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function F(e = P()) {
|
|
1159
1159
|
let t = String(e?.timeZone ?? "").trim();
|
|
1160
|
-
return
|
|
1160
|
+
return Yn(t) ? t : Jn();
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return T().tz(
|
|
1162
|
+
function Xn(e) {
|
|
1163
|
+
return T().tz(F(e));
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1165
|
+
function Zn(e, t) {
|
|
1166
1166
|
let n = T(e?.$date ?? e);
|
|
1167
|
-
return n.isValid() ? n.tz(
|
|
1167
|
+
return n.isValid() ? n.tz(F(t)) : n;
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1170
|
-
let r =
|
|
1169
|
+
function Qn(e, t, n = P()) {
|
|
1170
|
+
let r = Zn(e, n);
|
|
1171
1171
|
return r.isValid() ? r.format(t || n?.dateFormat || "DD MMM YYYY") : "";
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
let n =
|
|
1173
|
+
function $n(e = P(), t) {
|
|
1174
|
+
let n = F(e), r = sr(n, e);
|
|
1175
1175
|
if (r && r.includes("/")) {
|
|
1176
|
-
let e =
|
|
1176
|
+
let e = er(n, t);
|
|
1177
1177
|
if (e) return r.split("/").map((e) => e.trim()).find((t) => t.toUpperCase() === e.toUpperCase()) || e;
|
|
1178
1178
|
}
|
|
1179
|
-
return r ||
|
|
1179
|
+
return r || er(n, t) || n;
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function er(e, t) {
|
|
1182
1182
|
try {
|
|
1183
1183
|
let n = t === void 0 ? /* @__PURE__ */ new Date() : new Date(T(t?.$date ?? t).valueOf());
|
|
1184
1184
|
if (Number.isNaN(n.valueOf())) return "";
|
|
@@ -1191,28 +1191,28 @@ function tr(e, t) {
|
|
|
1191
1191
|
return "";
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1195
|
-
let n =
|
|
1194
|
+
function tr(e, t = P()) {
|
|
1195
|
+
let n = Qn(e, t?.dateTimeFormat || "MMM DD, YYYY | hh:mm A", t);
|
|
1196
1196
|
if (!n) return "";
|
|
1197
1197
|
if (t?.showTimeZoneLabel === !1) return n;
|
|
1198
|
-
let r =
|
|
1198
|
+
let r = $n(t, e);
|
|
1199
1199
|
return r ? `${n} ${r}` : n;
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function nr(e) {
|
|
1202
1202
|
if (!e) return !1;
|
|
1203
1203
|
if (e.tzAware === !0) return !0;
|
|
1204
1204
|
if (e.tzAware === !1) return !1;
|
|
1205
1205
|
let t = String(e.type ?? "").toLowerCase();
|
|
1206
1206
|
return t === "datetime" || t === "time" || t === "datetime-local";
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function rr(e, t) {
|
|
1209
1209
|
if (e == null || e === "") return null;
|
|
1210
1210
|
let n = T(e);
|
|
1211
1211
|
if (!n.isValid()) return null;
|
|
1212
|
-
let r =
|
|
1212
|
+
let r = F(t);
|
|
1213
1213
|
return T.tz(n.format("YYYY-MM-DDTHH:mm:ss"), r);
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function ir(e = F()) {
|
|
1216
1216
|
try {
|
|
1217
1217
|
let t = T().tz(e).utcOffset(), n = t < 0 ? "-" : "+", r = Math.abs(t);
|
|
1218
1218
|
return `UTC${n}${String(Math.floor(r / 60)).padStart(2, "0")}:${String(r % 60).padStart(2, "0")}`;
|
|
@@ -1220,11 +1220,11 @@ function ar(e = P()) {
|
|
|
1220
1220
|
return "";
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
let t =
|
|
1225
|
-
return `${
|
|
1223
|
+
function ar(e = P()) {
|
|
1224
|
+
let t = F(e);
|
|
1225
|
+
return `${sr(t, e) || t} (${ir(t)})`;
|
|
1226
1226
|
}
|
|
1227
|
-
var
|
|
1227
|
+
var or = Object.freeze({
|
|
1228
1228
|
UTC: "UTC",
|
|
1229
1229
|
"Asia/Kolkata": "IST",
|
|
1230
1230
|
"Asia/Calcutta": "IST",
|
|
@@ -1239,10 +1239,10 @@ var sr = Object.freeze({
|
|
|
1239
1239
|
"Asia/Tokyo": "JST",
|
|
1240
1240
|
"Australia/Sydney": "AEST/AEDT"
|
|
1241
1241
|
});
|
|
1242
|
-
function
|
|
1243
|
-
return (t?.timeZoneAliases ?? {})[e] ??
|
|
1242
|
+
function sr(e, t = P()) {
|
|
1243
|
+
return (t?.timeZoneAliases ?? {})[e] ?? or[e] ?? "";
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function cr(e = P()) {
|
|
1246
1246
|
let t = [];
|
|
1247
1247
|
try {
|
|
1248
1248
|
t = Intl.supportedValuesOf("timeZone") ?? [];
|
|
@@ -1251,17 +1251,17 @@ function lr(e = N()) {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
let n = [
|
|
1253
1253
|
"UTC",
|
|
1254
|
-
...Object.keys(
|
|
1254
|
+
...Object.keys(or),
|
|
1255
1255
|
...Object.keys(e?.timeZoneAliases ?? {})
|
|
1256
1256
|
];
|
|
1257
|
-
return [.../* @__PURE__ */ new Set([...n, ...t])].filter(
|
|
1257
|
+
return [.../* @__PURE__ */ new Set([...n, ...t])].filter(Yn).map((t) => {
|
|
1258
1258
|
let n = 0;
|
|
1259
1259
|
try {
|
|
1260
1260
|
n = T().tz(t).utcOffset();
|
|
1261
1261
|
} catch {
|
|
1262
1262
|
return null;
|
|
1263
1263
|
}
|
|
1264
|
-
let r =
|
|
1264
|
+
let r = sr(t, e), i = ir(t);
|
|
1265
1265
|
return {
|
|
1266
1266
|
value: t,
|
|
1267
1267
|
alias: r,
|
|
@@ -1273,7 +1273,7 @@ function lr(e = N()) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
//#endregion
|
|
1275
1275
|
//#region src/theme/colors/colors.js
|
|
1276
|
-
var
|
|
1276
|
+
var I = {
|
|
1277
1277
|
brand: "#0053a5",
|
|
1278
1278
|
brandDark: "#1d4ed8",
|
|
1279
1279
|
brandDarker: "#1e40af",
|
|
@@ -1349,8 +1349,8 @@ var F = {
|
|
|
1349
1349
|
avatarGreen: "#10b981",
|
|
1350
1350
|
linkedIn: "#0077b5"
|
|
1351
1351
|
};
|
|
1352
|
-
|
|
1353
|
-
var
|
|
1352
|
+
I.textPrimary, I.textSecondary, I.textMuted, I.textSubtle, I.textInverse, I.textLink, I.danger, I.success, I.danger, I.textLink, I.surfaceSoft, I.textSecondary, I.success, I.warning;
|
|
1353
|
+
var L = {
|
|
1354
1354
|
brand: "var(--color-brand)",
|
|
1355
1355
|
brandDark: "var(--color-brand-dark)",
|
|
1356
1356
|
brandDarker: "var(--color-brand-darker)",
|
|
@@ -1419,7 +1419,7 @@ var I = {
|
|
|
1419
1419
|
avatarPurpleBg: "var(--color-avatar-purple-bg)",
|
|
1420
1420
|
avatarMoreBg: "var(--color-avatar-more-bg)",
|
|
1421
1421
|
avatarMoreText: "var(--color-avatar-more-text)"
|
|
1422
|
-
}, { Text:
|
|
1422
|
+
}, { Text: lr, Title: ur, Paragraph: dr, Link: fr } = ie, pr = {
|
|
1423
1423
|
display: "h1",
|
|
1424
1424
|
h1: "h1",
|
|
1425
1425
|
h2: "h2",
|
|
@@ -1437,7 +1437,7 @@ var I = {
|
|
|
1437
1437
|
metric: "span",
|
|
1438
1438
|
helper: "span",
|
|
1439
1439
|
link: "a"
|
|
1440
|
-
},
|
|
1440
|
+
}, mr = {
|
|
1441
1441
|
xs: "var(--font-size-xs)",
|
|
1442
1442
|
sm: "var(--font-size-sm)",
|
|
1443
1443
|
md: "var(--font-size-md)",
|
|
@@ -1446,58 +1446,58 @@ var I = {
|
|
|
1446
1446
|
"2xl": "var(--font-size-2xl)",
|
|
1447
1447
|
"3xl": "var(--font-size-3xl)",
|
|
1448
1448
|
"4xl": "var(--font-size-4xl)"
|
|
1449
|
-
},
|
|
1449
|
+
}, hr = {
|
|
1450
1450
|
regular: "var(--font-weight-regular)",
|
|
1451
1451
|
medium: "var(--font-weight-medium)",
|
|
1452
1452
|
semibold: "var(--font-weight-semibold)",
|
|
1453
1453
|
bold: "var(--font-weight-bold)",
|
|
1454
1454
|
extrabold: "var(--font-weight-extrabold)"
|
|
1455
|
-
},
|
|
1455
|
+
}, gr = {
|
|
1456
1456
|
tight: "var(--line-height-tight)",
|
|
1457
1457
|
snug: "var(--line-height-snug)",
|
|
1458
1458
|
normal: "var(--line-height-normal)",
|
|
1459
1459
|
relaxed: "var(--line-height-relaxed)"
|
|
1460
|
-
},
|
|
1461
|
-
primary:
|
|
1462
|
-
secondary:
|
|
1463
|
-
muted:
|
|
1464
|
-
subtle:
|
|
1465
|
-
inverse:
|
|
1466
|
-
link:
|
|
1467
|
-
danger:
|
|
1468
|
-
success:
|
|
1460
|
+
}, _r = {
|
|
1461
|
+
primary: L.textPrimary,
|
|
1462
|
+
secondary: L.textSecondary,
|
|
1463
|
+
muted: L.textMuted,
|
|
1464
|
+
subtle: L.textSubtle,
|
|
1465
|
+
inverse: L.textInverse,
|
|
1466
|
+
link: L.textLink,
|
|
1467
|
+
danger: L.danger,
|
|
1468
|
+
success: L.success
|
|
1469
1469
|
};
|
|
1470
|
-
function
|
|
1470
|
+
function vr(...e) {
|
|
1471
1471
|
return e.filter(Boolean).join(" ");
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function yr(e, t) {
|
|
1474
1474
|
if (e != null) return t[e] || e;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return t === "link" || e === "a" ?
|
|
1476
|
+
function br(e, t) {
|
|
1477
|
+
return t === "link" || e === "a" ? fr : e === "p" ? dr : [
|
|
1478
1478
|
"h1",
|
|
1479
1479
|
"h2",
|
|
1480
1480
|
"h3",
|
|
1481
1481
|
"h4",
|
|
1482
1482
|
"h5"
|
|
1483
|
-
].includes(e) ?
|
|
1483
|
+
].includes(e) ? ur : lr;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
let n = e ||
|
|
1485
|
+
function xr(e, t) {
|
|
1486
|
+
let n = e || pr[t];
|
|
1487
1487
|
if (n?.startsWith("h")) return Number(n.slice(1));
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1490
|
-
let m = t || e ||
|
|
1491
|
-
color:
|
|
1492
|
-
fontSize:
|
|
1493
|
-
fontWeight:
|
|
1494
|
-
lineHeight:
|
|
1489
|
+
function Sr({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a, lineHeight: o, align: s, truncate: c = !1, display: l, className: u, style: d, children: f, ...p }) {
|
|
1490
|
+
let m = t || e || pr[n] || "span", h = br(m, n), g = xr(m, n), _ = {
|
|
1491
|
+
color: yr(r, _r),
|
|
1492
|
+
fontSize: yr(i, mr),
|
|
1493
|
+
fontWeight: yr(a, hr),
|
|
1494
|
+
lineHeight: yr(o, gr),
|
|
1495
1495
|
display: l,
|
|
1496
1496
|
...d
|
|
1497
1497
|
};
|
|
1498
1498
|
return /* @__PURE__ */ C(h, {
|
|
1499
1499
|
...g ? { level: g } : {},
|
|
1500
|
-
className:
|
|
1500
|
+
className: vr("app-typography", `app-typography--${n}`, r && _r[r] && `app-typography--${r}`, s && `app-typography--${s}`, c && "app-typography--truncate", u),
|
|
1501
1501
|
style: _,
|
|
1502
1502
|
...p,
|
|
1503
1503
|
children: f
|
|
@@ -1505,13 +1505,13 @@ function Cr({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a,
|
|
|
1505
1505
|
}
|
|
1506
1506
|
//#endregion
|
|
1507
1507
|
//#region src/components/TipTapEditor.jsx
|
|
1508
|
-
var
|
|
1508
|
+
var Cr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?)__$/s, "$1"), wr = (e = []) => e.length > 0 && e.every((e) => /^:?-{3,}:?$/.test(String(e).trim())), Tr = (e = "") => {
|
|
1509
1509
|
let t = String(e || "").replace(/\r\n?/g, "\n").trim();
|
|
1510
1510
|
if (!t) return null;
|
|
1511
1511
|
let n = t.split("\n").filter((e) => e.trim().length > 0);
|
|
1512
1512
|
if (n.length < 2) return null;
|
|
1513
1513
|
if (n.some((e) => e.includes(" "))) {
|
|
1514
|
-
let e = n.map((e) => e.split(" ").map(
|
|
1514
|
+
let e = n.map((e) => e.split(" ").map(Cr)), t = Math.max(...e.map((e) => e.length));
|
|
1515
1515
|
return t < 2 ? null : {
|
|
1516
1516
|
rows: e.map((e) => [...e, ...Array(t - e.length).fill("")]),
|
|
1517
1517
|
hasHeaderRow: !0
|
|
@@ -1519,15 +1519,15 @@ var wr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?
|
|
|
1519
1519
|
}
|
|
1520
1520
|
let r = n.filter((e) => e.includes("|")).map((e) => {
|
|
1521
1521
|
let t = e.trim();
|
|
1522
|
-
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(
|
|
1522
|
+
return t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && (t = t.slice(0, -1)), t.split("|").map(Cr);
|
|
1523
1523
|
});
|
|
1524
1524
|
if (r.length < 2) return null;
|
|
1525
|
-
let i = r.findIndex(
|
|
1525
|
+
let i = r.findIndex(wr), a = r.filter((e, t) => t !== i), o = Math.max(...a.map((e) => e.length));
|
|
1526
1526
|
return a.length < 2 || o < 2 ? null : {
|
|
1527
1527
|
rows: a.map((e) => [...e, ...Array(o - e.length).fill("")]),
|
|
1528
1528
|
hasHeaderRow: i === 1
|
|
1529
1529
|
};
|
|
1530
|
-
},
|
|
1530
|
+
}, Er = (e, t, n) => {
|
|
1531
1531
|
let { table: r, tableRow: i, tableHeader: a, tableCell: o, paragraph: s } = e.nodes;
|
|
1532
1532
|
if (!r || !i || !o || !s) return null;
|
|
1533
1533
|
let c = t.map((t, r) => {
|
|
@@ -1539,7 +1539,7 @@ var wr = (e = "") => e.trim().replace(/^\*\*(.*?)\*\*$/s, "$1").replace(/^__(.*?
|
|
|
1539
1539
|
});
|
|
1540
1540
|
return r.create(null, c);
|
|
1541
1541
|
};
|
|
1542
|
-
function
|
|
1542
|
+
function R({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
1543
1543
|
return /* @__PURE__ */ C("button", {
|
|
1544
1544
|
type: "button",
|
|
1545
1545
|
title: r,
|
|
@@ -1551,28 +1551,28 @@ function L({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
|
1551
1551
|
children: i
|
|
1552
1552
|
});
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function Dr({ editor: e, disabled: t }) {
|
|
1555
1555
|
return e ? /* @__PURE__ */ w("div", {
|
|
1556
1556
|
className: `tte-toolbar${t ? " tte-toolbar--disabled" : ""}`,
|
|
1557
1557
|
children: [
|
|
1558
1558
|
/* @__PURE__ */ w("div", {
|
|
1559
1559
|
className: "tte-toolbar-group",
|
|
1560
1560
|
children: [
|
|
1561
|
-
/* @__PURE__ */ C(
|
|
1561
|
+
/* @__PURE__ */ C(R, {
|
|
1562
1562
|
title: "Bold",
|
|
1563
1563
|
disabled: t,
|
|
1564
1564
|
active: e.isActive("bold"),
|
|
1565
1565
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
1566
1566
|
children: /* @__PURE__ */ C("strong", { children: "B" })
|
|
1567
1567
|
}),
|
|
1568
|
-
/* @__PURE__ */ C(
|
|
1568
|
+
/* @__PURE__ */ C(R, {
|
|
1569
1569
|
title: "Italic",
|
|
1570
1570
|
disabled: t,
|
|
1571
1571
|
active: e.isActive("italic"),
|
|
1572
1572
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
1573
1573
|
children: /* @__PURE__ */ C("em", { children: "I" })
|
|
1574
1574
|
}),
|
|
1575
|
-
/* @__PURE__ */ C(
|
|
1575
|
+
/* @__PURE__ */ C(R, {
|
|
1576
1576
|
title: "Underline",
|
|
1577
1577
|
disabled: t,
|
|
1578
1578
|
active: e.isActive("underline"),
|
|
@@ -1582,7 +1582,7 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1582
1582
|
children: "U"
|
|
1583
1583
|
})
|
|
1584
1584
|
}),
|
|
1585
|
-
/* @__PURE__ */ C(
|
|
1585
|
+
/* @__PURE__ */ C(R, {
|
|
1586
1586
|
title: "Strikethrough",
|
|
1587
1587
|
disabled: t,
|
|
1588
1588
|
active: e.isActive("strike"),
|
|
@@ -1594,13 +1594,13 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1594
1594
|
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
1595
1595
|
/* @__PURE__ */ w("div", {
|
|
1596
1596
|
className: "tte-toolbar-group",
|
|
1597
|
-
children: [/* @__PURE__ */ C(
|
|
1597
|
+
children: [/* @__PURE__ */ C(R, {
|
|
1598
1598
|
title: "Bullet List",
|
|
1599
1599
|
disabled: t,
|
|
1600
1600
|
active: e.isActive("bulletList"),
|
|
1601
1601
|
onClick: () => e.chain().focus().toggleBulletList().run(),
|
|
1602
1602
|
children: "≡"
|
|
1603
|
-
}), /* @__PURE__ */ C(
|
|
1603
|
+
}), /* @__PURE__ */ C(R, {
|
|
1604
1604
|
title: "Ordered List",
|
|
1605
1605
|
disabled: t,
|
|
1606
1606
|
active: e.isActive("orderedList"),
|
|
@@ -1611,7 +1611,7 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1611
1611
|
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
1612
1612
|
/* @__PURE__ */ C("div", {
|
|
1613
1613
|
className: "tte-toolbar-group",
|
|
1614
|
-
children: /* @__PURE__ */ C(
|
|
1614
|
+
children: /* @__PURE__ */ C(R, {
|
|
1615
1615
|
title: "Link",
|
|
1616
1616
|
disabled: t,
|
|
1617
1617
|
active: e.isActive("link"),
|
|
@@ -1629,7 +1629,7 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1629
1629
|
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
1630
1630
|
/* @__PURE__ */ w("div", {
|
|
1631
1631
|
className: "tte-toolbar-group tte-table-tools",
|
|
1632
|
-
children: [/* @__PURE__ */ C(
|
|
1632
|
+
children: [/* @__PURE__ */ C(R, {
|
|
1633
1633
|
title: "Insert 3 × 3 table",
|
|
1634
1634
|
disabled: t,
|
|
1635
1635
|
active: e.isActive("table"),
|
|
@@ -1640,37 +1640,37 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1640
1640
|
}).run(),
|
|
1641
1641
|
children: "▦"
|
|
1642
1642
|
}), e.isActive("table") && /* @__PURE__ */ w(ge, { children: [
|
|
1643
|
-
/* @__PURE__ */ C(
|
|
1643
|
+
/* @__PURE__ */ C(R, {
|
|
1644
1644
|
title: "Add column",
|
|
1645
1645
|
disabled: t || !e.can().addColumnAfter(),
|
|
1646
1646
|
onClick: () => e.chain().focus().addColumnAfter().run(),
|
|
1647
1647
|
children: "C+"
|
|
1648
1648
|
}),
|
|
1649
|
-
/* @__PURE__ */ C(
|
|
1649
|
+
/* @__PURE__ */ C(R, {
|
|
1650
1650
|
title: "Delete column",
|
|
1651
1651
|
disabled: t || !e.can().deleteColumn(),
|
|
1652
1652
|
onClick: () => e.chain().focus().deleteColumn().run(),
|
|
1653
1653
|
children: "C−"
|
|
1654
1654
|
}),
|
|
1655
|
-
/* @__PURE__ */ C(
|
|
1655
|
+
/* @__PURE__ */ C(R, {
|
|
1656
1656
|
title: "Add row",
|
|
1657
1657
|
disabled: t || !e.can().addRowAfter(),
|
|
1658
1658
|
onClick: () => e.chain().focus().addRowAfter().run(),
|
|
1659
1659
|
children: "R+"
|
|
1660
1660
|
}),
|
|
1661
|
-
/* @__PURE__ */ C(
|
|
1661
|
+
/* @__PURE__ */ C(R, {
|
|
1662
1662
|
title: "Delete row",
|
|
1663
1663
|
disabled: t || !e.can().deleteRow(),
|
|
1664
1664
|
onClick: () => e.chain().focus().deleteRow().run(),
|
|
1665
1665
|
children: "R−"
|
|
1666
1666
|
}),
|
|
1667
|
-
/* @__PURE__ */ C(
|
|
1667
|
+
/* @__PURE__ */ C(R, {
|
|
1668
1668
|
title: "Toggle header row",
|
|
1669
1669
|
disabled: t || !e.can().toggleHeaderRow(),
|
|
1670
1670
|
onClick: () => e.chain().focus().toggleHeaderRow().run(),
|
|
1671
1671
|
children: "H"
|
|
1672
1672
|
}),
|
|
1673
|
-
/* @__PURE__ */ C(
|
|
1673
|
+
/* @__PURE__ */ C(R, {
|
|
1674
1674
|
title: "Delete table",
|
|
1675
1675
|
disabled: t || !e.can().deleteTable(),
|
|
1676
1676
|
onClick: () => e.chain().focus().deleteTable().run(),
|
|
@@ -1681,7 +1681,7 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1681
1681
|
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
1682
1682
|
/* @__PURE__ */ C("div", {
|
|
1683
1683
|
className: "tte-toolbar-group",
|
|
1684
|
-
children: /* @__PURE__ */ C(
|
|
1684
|
+
children: /* @__PURE__ */ C(R, {
|
|
1685
1685
|
title: "Clear formatting",
|
|
1686
1686
|
disabled: t,
|
|
1687
1687
|
onClick: () => e.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
@@ -1691,7 +1691,7 @@ function Or({ editor: e, disabled: t }) {
|
|
|
1691
1691
|
]
|
|
1692
1692
|
}) : null;
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
function Or({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = "" }) {
|
|
1695
1695
|
let i = h(e ?? ""), a = xe({
|
|
1696
1696
|
extensions: [
|
|
1697
1697
|
Se,
|
|
@@ -1713,9 +1713,9 @@ function kr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1713
1713
|
editorProps: {
|
|
1714
1714
|
attributes: { class: "tte-content" },
|
|
1715
1715
|
handlePaste: (e, t) => {
|
|
1716
|
-
let n =
|
|
1716
|
+
let n = Tr(t.clipboardData?.getData("text/plain") || "");
|
|
1717
1717
|
if (!n) return !1;
|
|
1718
|
-
let r =
|
|
1718
|
+
let r = Er(e.state.schema, n.rows, n.hasHeaderRow);
|
|
1719
1719
|
if (!r) return !1;
|
|
1720
1720
|
t.preventDefault();
|
|
1721
1721
|
let i = e.state.tr.replaceSelectionWith(r, !1).scrollIntoView();
|
|
@@ -1736,7 +1736,7 @@ function kr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1736
1736
|
}, [n, a]), /* @__PURE__ */ w("div", {
|
|
1737
1737
|
className: `tte-wrapper${n ? " tte-wrapper--disabled" : ""}`,
|
|
1738
1738
|
children: [
|
|
1739
|
-
/* @__PURE__ */ C(
|
|
1739
|
+
/* @__PURE__ */ C(Dr, {
|
|
1740
1740
|
editor: a,
|
|
1741
1741
|
disabled: n
|
|
1742
1742
|
}),
|
|
@@ -1750,7 +1750,7 @@ function kr({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
1750
1750
|
}
|
|
1751
1751
|
//#endregion
|
|
1752
1752
|
//#region src/utils/modulePath.js
|
|
1753
|
-
function
|
|
1753
|
+
function kr(e) {
|
|
1754
1754
|
let t = String(e ?? "").trim();
|
|
1755
1755
|
if (!t) return {
|
|
1756
1756
|
baseModule: "",
|
|
@@ -1762,35 +1762,35 @@ function Ar(e) {
|
|
|
1762
1762
|
nestedPath: r.map((e) => e.trim()).filter(Boolean).join(".")
|
|
1763
1763
|
};
|
|
1764
1764
|
}
|
|
1765
|
-
function
|
|
1766
|
-
return
|
|
1765
|
+
function Ar(e) {
|
|
1766
|
+
return kr(e).baseModule;
|
|
1767
1767
|
}
|
|
1768
1768
|
//#endregion
|
|
1769
1769
|
//#region src/services/moduleDataApi.js
|
|
1770
|
-
var
|
|
1771
|
-
function
|
|
1770
|
+
var jr = "test-flows", Mr = "lms-flows";
|
|
1771
|
+
function Nr(e) {
|
|
1772
1772
|
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);
|
|
1773
1773
|
return t.includes("dice") ? "dice" : t.includes("internal") ? "internal" : t[0] || "";
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1775
|
+
function Pr(...e) {
|
|
1776
1776
|
for (let t of e) {
|
|
1777
1777
|
let e = Number(t);
|
|
1778
1778
|
if (Number.isFinite(e)) return e;
|
|
1779
1779
|
}
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function Fr(e, t, n, r = "") {
|
|
1782
1782
|
let i = e?.count, a = t?.count, o = String(r ?? "").trim().toLowerCase();
|
|
1783
1783
|
if (i && typeof i == "object") {
|
|
1784
|
-
let e =
|
|
1784
|
+
let e = Pr(o ? i[o] : void 0, i.total, i.searchCount, i.count);
|
|
1785
1785
|
if (e !== void 0) return e;
|
|
1786
1786
|
}
|
|
1787
1787
|
if (a && typeof a == "object") {
|
|
1788
|
-
let e =
|
|
1788
|
+
let e = Pr(o ? a[o] : void 0, a.total, a.searchCount, a.count);
|
|
1789
1789
|
if (e !== void 0) return e;
|
|
1790
1790
|
}
|
|
1791
|
-
return
|
|
1791
|
+
return Pr(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, t?.total, typeof a == "object" ? void 0 : a, t?.totalCount, n.length) ?? 0;
|
|
1792
1792
|
}
|
|
1793
|
-
function
|
|
1793
|
+
function Ir(e, t) {
|
|
1794
1794
|
let n = {};
|
|
1795
1795
|
return [e?.count, t?.count].forEach((e) => {
|
|
1796
1796
|
!e || typeof e != "object" || Object.entries(e).forEach(([e, t]) => {
|
|
@@ -1799,9 +1799,9 @@ function Lr(e, t) {
|
|
|
1799
1799
|
});
|
|
1800
1800
|
}), n;
|
|
1801
1801
|
}
|
|
1802
|
-
async function
|
|
1802
|
+
async function Lr(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
1803
1803
|
let c = new URLSearchParams({
|
|
1804
|
-
module:
|
|
1804
|
+
module: Ar(e),
|
|
1805
1805
|
field: t,
|
|
1806
1806
|
value: n,
|
|
1807
1807
|
limit: String(r),
|
|
@@ -1809,9 +1809,9 @@ async function Rr(e, t, n = "", r = 50, i = 0, a = {}) {
|
|
|
1809
1809
|
});
|
|
1810
1810
|
return a.dataSource && c.set("dataSource", a.dataSource), a.masterName && c.set("masterName", a.masterName), a.groupName && c.set("groupName", a.groupName), o(s, `/filter-dropdown-values?${c}`);
|
|
1811
1811
|
}
|
|
1812
|
-
async function
|
|
1812
|
+
async function Rr(e, t = 10, n = 0, r = {}) {
|
|
1813
1813
|
let { scope: i = "", sort: o = "", sortDir: c = "", filters: l = [] } = r;
|
|
1814
|
-
if (e ===
|
|
1814
|
+
if (e === jr) {
|
|
1815
1815
|
let { getTestFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1816
1816
|
limit: t,
|
|
1817
1817
|
offset: n
|
|
@@ -1828,7 +1828,7 @@ async function zr(e, t = 10, n = 0, r = {}) {
|
|
|
1828
1828
|
}]
|
|
1829
1829
|
};
|
|
1830
1830
|
}
|
|
1831
|
-
if (e ===
|
|
1831
|
+
if (e === Mr) {
|
|
1832
1832
|
let { getLmsFlows: e } = await import("./index.js").then((e) => e.t), r = await e({
|
|
1833
1833
|
limit: t,
|
|
1834
1834
|
offset: n
|
|
@@ -1846,13 +1846,13 @@ async function zr(e, t = 10, n = 0, r = {}) {
|
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
1848
|
let u = new URLSearchParams({
|
|
1849
|
-
module:
|
|
1849
|
+
module: Ar(e),
|
|
1850
1850
|
limit: String(t),
|
|
1851
1851
|
offset: String(n)
|
|
1852
1852
|
}), d = String(i ?? "").trim();
|
|
1853
1853
|
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()}`);
|
|
1854
1854
|
}
|
|
1855
|
-
async function
|
|
1855
|
+
async function zr(e, t) {
|
|
1856
1856
|
if (!e || !t) return null;
|
|
1857
1857
|
try {
|
|
1858
1858
|
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;
|
|
@@ -1861,14 +1861,14 @@ async function Br(e, t) {
|
|
|
1861
1861
|
return null;
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
|
-
async function
|
|
1865
|
-
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f =
|
|
1866
|
-
p.append("module",
|
|
1864
|
+
async function Br(e, t = {}, n = {}, r = {}) {
|
|
1865
|
+
let { limit: i = 10, offset: o = 0 } = n, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = r, f = Nr(u || String(t.selectedSource ?? "").split(",")), p = new URLSearchParams();
|
|
1866
|
+
p.append("module", Ar(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]) => {
|
|
1867
1867
|
if (t == null || t === "") return;
|
|
1868
1868
|
let n = t;
|
|
1869
1869
|
n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), p.append(e, n);
|
|
1870
1870
|
});
|
|
1871
|
-
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 ?? [], _ =
|
|
1871
|
+
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 ?? [], _ = Fr(m, h, g, f), v = Ir(m, h);
|
|
1872
1872
|
f && v[f] === void 0 && Number.isFinite(_) && (v[f] = _);
|
|
1873
1873
|
let y = g.some((e) => [
|
|
1874
1874
|
e?.sourceType,
|
|
@@ -1881,9 +1881,9 @@ async function Vr(e, t = {}, n = {}, r = {}) {
|
|
|
1881
1881
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
1882
1882
|
b = e(m, m)?.data?.data ?? g;
|
|
1883
1883
|
} catch (e) {
|
|
1884
|
-
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(
|
|
1884
|
+
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(Ur);
|
|
1885
1885
|
}
|
|
1886
|
-
else b = Array.isArray(g) ? g.map(
|
|
1886
|
+
else b = Array.isArray(g) ? g.map(Ur) : [];
|
|
1887
1887
|
return {
|
|
1888
1888
|
rows: b,
|
|
1889
1889
|
total: Number(_) || 0,
|
|
@@ -1896,10 +1896,10 @@ async function Vr(e, t = {}, n = {}, r = {}) {
|
|
|
1896
1896
|
columnActions: h?.columnActions ?? []
|
|
1897
1897
|
};
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Vr(e, t) {
|
|
1900
1900
|
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function Hr(e, t, n) {
|
|
1903
1903
|
let r = String(t).split(".").filter(Boolean);
|
|
1904
1904
|
if (!r.length) return e;
|
|
1905
1905
|
let i = { ...e }, a = i, o = e;
|
|
@@ -1908,7 +1908,7 @@ function Ur(e, t, n) {
|
|
|
1908
1908
|
a[e] = n, a = n, o = t;
|
|
1909
1909
|
}), a[r[r.length - 1]] = n, i;
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function Ur(e) {
|
|
1912
1912
|
if (!e || typeof e != "object") return e;
|
|
1913
1913
|
let t = [
|
|
1914
1914
|
"skills",
|
|
@@ -1918,11 +1918,11 @@ function Wr(e) {
|
|
|
1918
1918
|
"customFields.diceProfileData.skills"
|
|
1919
1919
|
], n = e, r = null;
|
|
1920
1920
|
if (t.forEach((e) => {
|
|
1921
|
-
let t =
|
|
1921
|
+
let t = Vr(n, e);
|
|
1922
1922
|
if (t == null) return;
|
|
1923
1923
|
let i = c(t);
|
|
1924
|
-
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n =
|
|
1925
|
-
}), r &&
|
|
1924
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = Hr(n, e, i));
|
|
1925
|
+
}), r && Vr(n, "skills") === void 0 && (n = Hr(n, "skills", r)), [
|
|
1926
1926
|
n?.sourceType,
|
|
1927
1927
|
n?.profileSource,
|
|
1928
1928
|
n?.selectedSource,
|
|
@@ -1941,10 +1941,10 @@ function Wr(e) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
//#endregion
|
|
1943
1943
|
//#region src/services/documentApi.js
|
|
1944
|
-
function
|
|
1944
|
+
function Wr(e) {
|
|
1945
1945
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1946
1946
|
}
|
|
1947
|
-
async function
|
|
1947
|
+
async function Gr(e, t, n = [], i = {}) {
|
|
1948
1948
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
1949
1949
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
1950
1950
|
if (!n.length) return {
|
|
@@ -1954,7 +1954,7 @@ async function Kr(e, t, n = [], i = {}) {
|
|
|
1954
1954
|
let a = await r(), o = new FormData();
|
|
1955
1955
|
n.forEach(({ formKey: e, file: t }) => {
|
|
1956
1956
|
let n = t?.name ?? void 0;
|
|
1957
|
-
o.append(
|
|
1957
|
+
o.append(Wr(e), t, n);
|
|
1958
1958
|
}), i && Object.keys(i).length > 0 && o.append("metadata", JSON.stringify(i));
|
|
1959
1959
|
let c = new URLSearchParams({
|
|
1960
1960
|
module: e,
|
|
@@ -1970,7 +1970,7 @@ async function Kr(e, t, n = [], i = {}) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
return u?.data ?? u;
|
|
1972
1972
|
}
|
|
1973
|
-
async function
|
|
1973
|
+
async function Kr(e, t, n = "") {
|
|
1974
1974
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
1975
1975
|
if (!t) throw Error("refId is required to fetch documents");
|
|
1976
1976
|
let r = new URLSearchParams({
|
|
@@ -1984,7 +1984,7 @@ async function qr(e, t, n = "") {
|
|
|
1984
1984
|
total: o?.total ?? 0
|
|
1985
1985
|
};
|
|
1986
1986
|
}
|
|
1987
|
-
async function
|
|
1987
|
+
async function qr(e) {
|
|
1988
1988
|
if (!e) return !1;
|
|
1989
1989
|
try {
|
|
1990
1990
|
return await a(s, `/documents/${encodeURIComponent(String(e))}`, { method: "DELETE" }), !0;
|
|
@@ -1994,36 +1994,36 @@ async function Jr(e) {
|
|
|
1994
1994
|
}
|
|
1995
1995
|
//#endregion
|
|
1996
1996
|
//#region src/services/detailedViewApi.js
|
|
1997
|
-
var
|
|
1997
|
+
var Jr = {
|
|
1998
1998
|
job: { fetchUrl: (e) => `${n}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
1999
1999
|
candidate: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2000
2000
|
candidates: { fetchUrl: (e) => `${t}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2001
2001
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2002
2002
|
};
|
|
2003
|
-
async function
|
|
2003
|
+
async function Yr(e, t) {
|
|
2004
2004
|
let n = String(e ?? "").trim().toLowerCase();
|
|
2005
2005
|
if (n === "job" || n === "jobs") {
|
|
2006
2006
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
2007
2007
|
return e(t);
|
|
2008
2008
|
}
|
|
2009
|
-
if (n === "candidate" || n === "candidates") return
|
|
2009
|
+
if (n === "candidate" || n === "candidates") return Zr(n === "candidate" ? "candidate" : "candidates", t);
|
|
2010
2010
|
let r = new URLSearchParams({
|
|
2011
2011
|
module: String(e ?? ""),
|
|
2012
2012
|
id: String(t)
|
|
2013
2013
|
});
|
|
2014
2014
|
return a(s, `/module-data-detail?${r.toString()}`);
|
|
2015
2015
|
}
|
|
2016
|
-
async function
|
|
2016
|
+
async function Xr(e) {
|
|
2017
2017
|
let t = await a(s, `/module-actions?module=${encodeURIComponent(e)}`), n = t?.data ?? t ?? {};
|
|
2018
2018
|
return {
|
|
2019
2019
|
actions: Array.isArray(n.actions) ? n.actions : [],
|
|
2020
2020
|
actionRules: Array.isArray(n.actionRules) ? n.actionRules : []
|
|
2021
2021
|
};
|
|
2022
2022
|
}
|
|
2023
|
-
async function
|
|
2023
|
+
async function Zr(e, t) {
|
|
2024
2024
|
if (!e) throw Error("module is required");
|
|
2025
2025
|
if (!t) throw Error("id is required");
|
|
2026
|
-
let n =
|
|
2026
|
+
let n = Jr[e];
|
|
2027
2027
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2028
2028
|
let i = await r(), a = await fetch(n.fetchUrl(t), {
|
|
2029
2029
|
method: "GET",
|
|
@@ -2036,7 +2036,7 @@ async function Qr(e, t) {
|
|
|
2036
2036
|
let o = await a.json();
|
|
2037
2037
|
return o.data ?? o;
|
|
2038
2038
|
}
|
|
2039
|
-
async function
|
|
2039
|
+
async function Qr(e, t, n, i = []) {
|
|
2040
2040
|
if (!e) throw Error("module is required");
|
|
2041
2041
|
if (!t) throw Error("id is required");
|
|
2042
2042
|
let a = await r(), o = new FormData();
|
|
@@ -2049,15 +2049,15 @@ async function $r(e, t, n, i = []) {
|
|
|
2049
2049
|
if (!c.ok) {
|
|
2050
2050
|
let e = await c.text();
|
|
2051
2051
|
console.error("[updateRecord] Error response:", e);
|
|
2052
|
-
let t = Error(
|
|
2053
|
-
throw t.status = c.status, t.response =
|
|
2052
|
+
let t = Error(ei(e) || `API ${c.status}: ${c.statusText}`);
|
|
2053
|
+
throw t.status = c.status, t.response = $r(e), t;
|
|
2054
2054
|
}
|
|
2055
2055
|
let { invalidateFormGroupsCache: l } = await import("./formGroupsCache-JeC59oNe.js").then((e) => e.n);
|
|
2056
2056
|
l();
|
|
2057
2057
|
let u = await c.json();
|
|
2058
2058
|
return u.data ?? u;
|
|
2059
2059
|
}
|
|
2060
|
-
function
|
|
2060
|
+
function $r(e) {
|
|
2061
2061
|
let t = String(e ?? "").trim();
|
|
2062
2062
|
if (!t.startsWith("{")) return null;
|
|
2063
2063
|
try {
|
|
@@ -2066,7 +2066,7 @@ function ei(e) {
|
|
|
2066
2066
|
return null;
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function ei(e) {
|
|
2070
2070
|
let t = String(e ?? "").trim();
|
|
2071
2071
|
if (!t.startsWith("{")) return t;
|
|
2072
2072
|
try {
|
|
@@ -2076,22 +2076,22 @@ function ti(e) {
|
|
|
2076
2076
|
return t;
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
|
-
var
|
|
2080
|
-
async function
|
|
2079
|
+
var ti = (e) => e?.data ?? e;
|
|
2080
|
+
async function ni(e, t) {
|
|
2081
2081
|
if (!e || !t) return [];
|
|
2082
2082
|
let n = new URLSearchParams({
|
|
2083
2083
|
module: e,
|
|
2084
2084
|
id: String(t)
|
|
2085
|
-
}), r =
|
|
2085
|
+
}), r = ti(await a(s, `/module-activity?${n.toString()}`));
|
|
2086
2086
|
return Array.isArray(r) ? r : [];
|
|
2087
2087
|
}
|
|
2088
|
-
async function
|
|
2088
|
+
async function ri(e) {
|
|
2089
2089
|
if (!e) return [];
|
|
2090
|
-
let t =
|
|
2090
|
+
let t = ti(await a(s, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2091
2091
|
return Array.isArray(t) ? t : [];
|
|
2092
2092
|
}
|
|
2093
|
-
async function
|
|
2094
|
-
return
|
|
2093
|
+
async function ii({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
2094
|
+
return ti(await a(s, "/notes", {
|
|
2095
2095
|
method: "POST",
|
|
2096
2096
|
body: JSON.stringify({
|
|
2097
2097
|
relatedId: e,
|
|
@@ -2103,19 +2103,19 @@ async function ai({ relatedId: e, notes: t, title: n, notesFor: r }) {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
//#endregion
|
|
2105
2105
|
//#region src/utils/roleFormPermissionGate.js
|
|
2106
|
-
function
|
|
2106
|
+
function ai(e, t) {
|
|
2107
2107
|
if (!e) return !0;
|
|
2108
2108
|
let n = e.find((e) => e.name === t);
|
|
2109
2109
|
return !n || n.enabled !== !1;
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2111
|
+
function oi(e, t, n) {
|
|
2112
2112
|
if (!e) return !0;
|
|
2113
2113
|
let r = e.find((e) => e.name === t);
|
|
2114
2114
|
if (!r) return !0;
|
|
2115
2115
|
let i = r.fields?.find((e) => e.field === n);
|
|
2116
2116
|
return !i || i.locked ? !0 : i.enabled !== !1;
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2118
|
+
function si(e, t, n) {
|
|
2119
2119
|
if (!e) return !0;
|
|
2120
2120
|
let r = e.find((e) => e.name === t);
|
|
2121
2121
|
if (!r) return !0;
|
|
@@ -2125,7 +2125,7 @@ function ci(e, t, n) {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
//#endregion
|
|
2127
2127
|
//#region src/components/form/inputSecurity.js
|
|
2128
|
-
var
|
|
2128
|
+
var ci = [
|
|
2129
2129
|
"p",
|
|
2130
2130
|
"br",
|
|
2131
2131
|
"strong",
|
|
@@ -2147,12 +2147,12 @@ var li = [
|
|
|
2147
2147
|
"a",
|
|
2148
2148
|
"code",
|
|
2149
2149
|
"pre"
|
|
2150
|
-
],
|
|
2150
|
+
], li = [
|
|
2151
2151
|
"href",
|
|
2152
2152
|
"title",
|
|
2153
2153
|
"target",
|
|
2154
2154
|
"rel"
|
|
2155
|
-
],
|
|
2155
|
+
], ui = /[\u200B-\u200D\u2060\uFEFF]/g, di = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, fi = /^[\p{L}\p{M}\p{N} .'-]+$/u, pi = /^\+?[0-9 ()-]+$/, mi = /^-?(?:\d+|\d*\.\d+)$/, hi = [
|
|
2156
2156
|
{
|
|
2157
2157
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
2158
2158
|
message: "HTML/script content is not allowed"
|
|
@@ -2179,12 +2179,12 @@ var li = [
|
|
|
2179
2179
|
plainOnly: !0
|
|
2180
2180
|
}
|
|
2181
2181
|
];
|
|
2182
|
-
function
|
|
2182
|
+
function gi(e) {
|
|
2183
2183
|
if (typeof document > "u") return e;
|
|
2184
2184
|
let t = document.createElement("textarea");
|
|
2185
2185
|
return t.innerHTML = e, t.value;
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function _i(e) {
|
|
2188
2188
|
let t = String(e ?? "");
|
|
2189
2189
|
for (let e = 0; e < 2; e += 1) try {
|
|
2190
2190
|
let e = decodeURIComponent(t);
|
|
@@ -2193,12 +2193,12 @@ function vi(e) {
|
|
|
2193
2193
|
} catch {
|
|
2194
2194
|
break;
|
|
2195
2195
|
}
|
|
2196
|
-
return t =
|
|
2196
|
+
return t = gi(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");
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2198
|
+
function vi(e) {
|
|
2199
2199
|
return ke.sanitize(String(e ?? ""), {
|
|
2200
|
-
ALLOWED_TAGS:
|
|
2201
|
-
ALLOWED_ATTR:
|
|
2200
|
+
ALLOWED_TAGS: ci,
|
|
2201
|
+
ALLOWED_ATTR: li,
|
|
2202
2202
|
ALLOW_DATA_ATTR: !1,
|
|
2203
2203
|
FORBID_TAGS: [
|
|
2204
2204
|
"script",
|
|
@@ -2218,35 +2218,35 @@ function yi(e) {
|
|
|
2218
2218
|
]
|
|
2219
2219
|
});
|
|
2220
2220
|
}
|
|
2221
|
-
function
|
|
2221
|
+
function yi(e) {
|
|
2222
2222
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2223
2223
|
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);
|
|
2224
2224
|
}
|
|
2225
|
-
function
|
|
2225
|
+
function bi(e) {
|
|
2226
2226
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2227
2227
|
}
|
|
2228
|
-
function
|
|
2228
|
+
function xi(e, t = {}) {
|
|
2229
2229
|
if (typeof e != "string") return e;
|
|
2230
|
-
if (t.type === "text-editor") return
|
|
2231
|
-
let n = e.normalize("NFC").replace(
|
|
2232
|
-
return n =
|
|
2230
|
+
if (t.type === "text-editor") return vi(e.normalize("NFC"));
|
|
2231
|
+
let n = e.normalize("NFC").replace(ui, "").replace(/\u00A0/g, " ").replace(di, "");
|
|
2232
|
+
return n = bi(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function Si(e, t = {}) {
|
|
2235
2235
|
if (typeof e != "string" || e === "") return null;
|
|
2236
|
-
let n = t.label || t.field || "Field", r =
|
|
2236
|
+
let n = t.label || t.field || "Field", r = _i(e);
|
|
2237
2237
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2238
|
-
let i = t.type === "text-editor", a =
|
|
2238
|
+
let i = t.type === "text-editor", a = hi.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
2239
2239
|
if (a) return `${n}: ${a.message}`;
|
|
2240
|
-
let o =
|
|
2241
|
-
return [...o].length >
|
|
2240
|
+
let o = xi(e, t);
|
|
2241
|
+
return [...o].length > yi(t) ? `${n} is too long` : t.formatter === "name" && o && !fi.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !pi.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !mi.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;
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2243
|
+
function Ci(e) {
|
|
2244
2244
|
return { validator: (t, n) => {
|
|
2245
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2245
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => Si(t, e)).find(Boolean);
|
|
2246
2246
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2247
2247
|
} };
|
|
2248
2248
|
}
|
|
2249
|
-
function
|
|
2249
|
+
function wi(e = []) {
|
|
2250
2250
|
let t = /* @__PURE__ */ new Map();
|
|
2251
2251
|
return e.forEach((e) => {
|
|
2252
2252
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2258,12 +2258,12 @@ function Ti(e = []) {
|
|
|
2258
2258
|
});
|
|
2259
2259
|
}), t;
|
|
2260
2260
|
}
|
|
2261
|
-
function
|
|
2262
|
-
let n =
|
|
2261
|
+
function Ti(e, t = []) {
|
|
2262
|
+
let n = wi(t), r = (e, t = "") => {
|
|
2263
2263
|
if (typeof e == "string") {
|
|
2264
|
-
let r = n.get(t) ?? {}, i =
|
|
2264
|
+
let r = n.get(t) ?? {}, i = Si(e, r);
|
|
2265
2265
|
if (i) throw Error(i);
|
|
2266
|
-
return
|
|
2266
|
+
return xi(e, r);
|
|
2267
2267
|
}
|
|
2268
2268
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2269
2269
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2275,23 +2275,23 @@ function Ei(e, t = []) {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
//#endregion
|
|
2277
2277
|
//#region src/components/form/validationOverride.js
|
|
2278
|
-
var
|
|
2279
|
-
function
|
|
2278
|
+
var Ei = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
2279
|
+
function Di(e) {
|
|
2280
2280
|
let t = e?.overrideCheckbox;
|
|
2281
|
-
return !t || typeof t != "object" ? null :
|
|
2281
|
+
return !t || typeof t != "object" ? null : ki(e).size > 0 ? t : null;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2283
|
+
function Oi(e) {
|
|
2284
2284
|
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function ki(e) {
|
|
2287
2287
|
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
2288
2288
|
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function Ai(e) {
|
|
2291
2291
|
return e?.overrideCheckbox?.store !== !1;
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2294
|
-
let r =
|
|
2293
|
+
function ji(e, t, n) {
|
|
2294
|
+
let r = Oi(e);
|
|
2295
2295
|
if (typeof n == "function") {
|
|
2296
2296
|
let e = n(r);
|
|
2297
2297
|
if (Array.isArray(e) && e.length) return [...e, r];
|
|
@@ -2302,27 +2302,27 @@ function Mi(e, t, n) {
|
|
|
2302
2302
|
r
|
|
2303
2303
|
] : [r];
|
|
2304
2304
|
}
|
|
2305
|
-
function
|
|
2305
|
+
function Mi(e, t) {
|
|
2306
2306
|
return (n) => {
|
|
2307
2307
|
let r = !1;
|
|
2308
2308
|
try {
|
|
2309
|
-
r =
|
|
2309
|
+
r = Ei(n?.getFieldValue?.(t));
|
|
2310
2310
|
} catch {
|
|
2311
2311
|
r = !1;
|
|
2312
2312
|
}
|
|
2313
2313
|
return r ? {} : e;
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2317
|
-
if (!
|
|
2318
|
-
let i =
|
|
2316
|
+
function Ni(e, t, n, r) {
|
|
2317
|
+
if (!Di(e)) return r;
|
|
2318
|
+
let i = ki(e), a = ji(e, t, n);
|
|
2319
2319
|
return (e) => {
|
|
2320
2320
|
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
2321
|
-
return i.has(n) ?
|
|
2321
|
+
return i.has(n) ? Mi(t, a) : t;
|
|
2322
2322
|
};
|
|
2323
2323
|
}
|
|
2324
|
-
function
|
|
2325
|
-
let t =
|
|
2324
|
+
function Pi(e) {
|
|
2325
|
+
let t = Di(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
2326
2326
|
return {
|
|
2327
2327
|
tone: t.tone ?? "overwrite",
|
|
2328
2328
|
title: t.confirmTitle || "Remove the validation on this field?",
|
|
@@ -2333,12 +2333,12 @@ function Fi(e) {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
//#endregion
|
|
2335
2335
|
//#region src/components/form/optionMatching.js
|
|
2336
|
-
function
|
|
2336
|
+
function Fi(e) {
|
|
2337
2337
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2339
|
+
function Ii(e) {
|
|
2340
2340
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2341
|
-
let r =
|
|
2341
|
+
let r = Fi(e);
|
|
2342
2342
|
r && !t.has(r) && t.set(r, n);
|
|
2343
2343
|
};
|
|
2344
2344
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2346,39 +2346,39 @@ function Li(e) {
|
|
|
2346
2346
|
let t = typeof e == "object" ? e.value : e;
|
|
2347
2347
|
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2348
2348
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2349
|
-
let i = t.get(
|
|
2349
|
+
let i = t.get(Fi(r));
|
|
2350
2350
|
i !== void 0 && n(e, i);
|
|
2351
2351
|
}), t;
|
|
2352
2352
|
}
|
|
2353
|
-
var
|
|
2354
|
-
function
|
|
2353
|
+
var Li = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2354
|
+
function Ri(e, t) {
|
|
2355
2355
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2356
|
-
let n = e.get(
|
|
2356
|
+
let n = e.get(Fi(t));
|
|
2357
2357
|
return n === void 0 ? t : n;
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2360
|
-
if (!
|
|
2361
|
-
let n =
|
|
2362
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2359
|
+
function zi(e, t) {
|
|
2360
|
+
if (!Li(e)) return t;
|
|
2361
|
+
let n = Ii(e);
|
|
2362
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => Ri(n, e)) : Ri(n, t);
|
|
2363
2363
|
}
|
|
2364
2364
|
//#endregion
|
|
2365
2365
|
//#region src/components/form/payloadTransformer.js
|
|
2366
|
-
var
|
|
2367
|
-
function
|
|
2366
|
+
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, Bi = (e) => e === !0 || e === 1 || e === "1", B = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !Vi(e);
|
|
2367
|
+
function Vi(e) {
|
|
2368
2368
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2369
2369
|
}
|
|
2370
|
-
function
|
|
2371
|
-
return
|
|
2370
|
+
function Hi(e) {
|
|
2371
|
+
return Vi(e) || e instanceof Date;
|
|
2372
2372
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return e instanceof Date ? e.toISOString() :
|
|
2373
|
+
function Ui(e) {
|
|
2374
|
+
return e instanceof Date ? e.toISOString() : Vi(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2377
|
-
if (!
|
|
2378
|
-
let n =
|
|
2379
|
-
return n ? n.toISOString() :
|
|
2376
|
+
function Wi(e, t) {
|
|
2377
|
+
if (!nr(t)) return Ui(e);
|
|
2378
|
+
let n = rr(e);
|
|
2379
|
+
return n ? n.toISOString() : Ui(e);
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2381
|
+
function V(e, t) {
|
|
2382
2382
|
if (!t) return;
|
|
2383
2383
|
let n = String(t).split("."), r = e;
|
|
2384
2384
|
for (let e of n) {
|
|
@@ -2387,51 +2387,51 @@ function B(e, t) {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
return r;
|
|
2389
2389
|
}
|
|
2390
|
-
function V(e, t) {
|
|
2391
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : B(e, t);
|
|
2392
|
-
}
|
|
2393
2390
|
function H(e, t) {
|
|
2394
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ?
|
|
2391
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : V(e, t);
|
|
2395
2392
|
}
|
|
2396
|
-
function U(e, t
|
|
2393
|
+
function U(e, t) {
|
|
2394
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 : V(e, t) !== void 0;
|
|
2395
|
+
}
|
|
2396
|
+
function W(e, t, n) {
|
|
2397
2397
|
let r = String(t).split("."), i = e;
|
|
2398
2398
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2399
2399
|
let t = r[e];
|
|
2400
|
-
|
|
2400
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2401
2401
|
}
|
|
2402
2402
|
return i[r[r.length - 1]] = n, e;
|
|
2403
2403
|
}
|
|
2404
|
-
function
|
|
2404
|
+
function Gi(e, t, n) {
|
|
2405
2405
|
let r = String(t).split("."), i = e;
|
|
2406
2406
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2407
2407
|
let t = r[e];
|
|
2408
|
-
|
|
2408
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2409
2409
|
}
|
|
2410
2410
|
let a = r[r.length - 1];
|
|
2411
|
-
return i[a] =
|
|
2411
|
+
return i[a] = B(i[a]) && B(n) ? {
|
|
2412
2412
|
...n,
|
|
2413
2413
|
...i[a]
|
|
2414
2414
|
} : n, e;
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function Ki(e) {
|
|
2417
2417
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2418
2418
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2419
2419
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2420
2420
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2421
2421
|
}
|
|
2422
|
-
function
|
|
2422
|
+
function qi(e, t) {
|
|
2423
2423
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2424
|
-
|
|
2424
|
+
B(n) && B(e[t]) ? qi(e[t], n) : e[t] = n;
|
|
2425
2425
|
}), e;
|
|
2426
2426
|
}
|
|
2427
|
-
function
|
|
2427
|
+
function Ji(e, t) {
|
|
2428
2428
|
let n = e.options ?? e.values ?? [];
|
|
2429
2429
|
for (let e of n) if (typeof e == "string") {
|
|
2430
2430
|
if (e === t) return e;
|
|
2431
2431
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2434
|
-
if (
|
|
2433
|
+
function Yi(e, t) {
|
|
2434
|
+
if (B(e)) {
|
|
2435
2435
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2436
2436
|
return {
|
|
2437
2437
|
value: n,
|
|
@@ -2440,10 +2440,10 @@ function Xi(e, t) {
|
|
|
2440
2440
|
}
|
|
2441
2441
|
return {
|
|
2442
2442
|
value: e,
|
|
2443
|
-
label:
|
|
2443
|
+
label: Ji(t, e) ?? e
|
|
2444
2444
|
};
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2446
|
+
function Xi(e = {}) {
|
|
2447
2447
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2448
2448
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2449
2449
|
switch (e.type) {
|
|
@@ -2453,36 +2453,36 @@ function Zi(e = {}) {
|
|
|
2453
2453
|
default: return "auto";
|
|
2454
2454
|
}
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2457
|
-
if (
|
|
2458
|
-
if (t === "string") return
|
|
2456
|
+
function G(e, t, n = {}) {
|
|
2457
|
+
if (Hi(e)) {
|
|
2458
|
+
if (t === "string") return Wi(e, n);
|
|
2459
2459
|
if (t === "number") {
|
|
2460
|
-
let t =
|
|
2460
|
+
let t = Vi(e) ? e.valueOf() : e.getTime();
|
|
2461
2461
|
return Number.isNaN(t) ? null : t;
|
|
2462
2462
|
}
|
|
2463
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2463
|
+
if (t === "date" || t === "auto" || !t) return Wi(e, n);
|
|
2464
2464
|
}
|
|
2465
2465
|
switch (t) {
|
|
2466
2466
|
case "string": return e == null ? "" : String(e);
|
|
2467
2467
|
case "number": {
|
|
2468
|
-
if (
|
|
2468
|
+
if (z(e)) return null;
|
|
2469
2469
|
let t = Number(e);
|
|
2470
2470
|
return Number.isNaN(t) ? null : t;
|
|
2471
2471
|
}
|
|
2472
2472
|
case "boolean": return e === !0 || e === 1 || e === "1" || e === "true";
|
|
2473
2473
|
case "array": {
|
|
2474
2474
|
let t;
|
|
2475
|
-
return t = Array.isArray(e) ? e :
|
|
2475
|
+
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;
|
|
2476
2476
|
}
|
|
2477
|
-
case "object": return
|
|
2478
|
-
case "date": return
|
|
2477
|
+
case "object": return B(e), e;
|
|
2478
|
+
case "date": return Wi(e, n);
|
|
2479
2479
|
case "custom":
|
|
2480
2480
|
case "auto":
|
|
2481
2481
|
case void 0:
|
|
2482
2482
|
default: return e;
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
var
|
|
2485
|
+
var Zi = {
|
|
2486
2486
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2487
2487
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2488
2488
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2490,11 +2490,11 @@ var Qi = {
|
|
|
2490
2490
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2491
2491
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2492
2492
|
};
|
|
2493
|
-
function
|
|
2493
|
+
function Qi(e, t) {
|
|
2494
2494
|
if (!t) return e;
|
|
2495
2495
|
let n = t;
|
|
2496
2496
|
if (typeof n == "string") {
|
|
2497
|
-
if (
|
|
2497
|
+
if (Zi[n]) return Zi[n](e);
|
|
2498
2498
|
try {
|
|
2499
2499
|
n = JSON.parse(n);
|
|
2500
2500
|
} catch {
|
|
@@ -2502,39 +2502,39 @@ function $i(e, t) {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
2504
|
let r = e;
|
|
2505
|
-
if (n.name &&
|
|
2505
|
+
if (n.name && Zi[n.name] && (r = Zi[n.name](r)), n.map && typeof n.map == "object") {
|
|
2506
2506
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2507
2507
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2508
2508
|
}
|
|
2509
2509
|
return r;
|
|
2510
2510
|
}
|
|
2511
|
-
var
|
|
2512
|
-
function
|
|
2511
|
+
var $i = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2512
|
+
function ea(e, t) {
|
|
2513
2513
|
let [n, ...r] = e.split("."), i;
|
|
2514
2514
|
if (n === "value") i = t.value;
|
|
2515
2515
|
else if (n === "label") i = t.label;
|
|
2516
2516
|
else if (n === "raw") i = t.raw;
|
|
2517
2517
|
else return;
|
|
2518
|
-
return r.length ?
|
|
2518
|
+
return r.length ? V(i, r.join(".")) : i;
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function ta(e, t) {
|
|
2521
2521
|
if (typeof e == "string") {
|
|
2522
2522
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2523
|
-
return n ?
|
|
2524
|
-
let r =
|
|
2523
|
+
return n ? ea(n[1], t) : e.replace($i, (e, n) => {
|
|
2524
|
+
let r = ea(n, t);
|
|
2525
2525
|
return r == null ? "" : String(r);
|
|
2526
2526
|
});
|
|
2527
2527
|
}
|
|
2528
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2529
|
-
if (
|
|
2528
|
+
if (Array.isArray(e)) return e.map((e) => ta(e, t));
|
|
2529
|
+
if (B(e)) {
|
|
2530
2530
|
let n = {};
|
|
2531
2531
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2532
|
-
n[e] =
|
|
2532
|
+
n[e] = ta(r, t);
|
|
2533
2533
|
}), n;
|
|
2534
2534
|
}
|
|
2535
2535
|
return e;
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2537
|
+
function na(e) {
|
|
2538
2538
|
if (!e) return null;
|
|
2539
2539
|
if (typeof e == "string") try {
|
|
2540
2540
|
return JSON.parse(e);
|
|
@@ -2543,36 +2543,36 @@ function ra(e) {
|
|
|
2543
2543
|
}
|
|
2544
2544
|
return e;
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2547
|
-
let n = e.payloadMode || "auto", r =
|
|
2546
|
+
function ra(e, t) {
|
|
2547
|
+
let n = e.payloadMode || "auto", r = Xi(e), { value: i, label: a } = Yi(t, e);
|
|
2548
2548
|
switch (n) {
|
|
2549
2549
|
case "value": return {
|
|
2550
2550
|
kind: "scalar",
|
|
2551
|
-
out:
|
|
2551
|
+
out: G(i, r, e)
|
|
2552
2552
|
};
|
|
2553
2553
|
case "label": return {
|
|
2554
2554
|
kind: "scalar",
|
|
2555
|
-
out:
|
|
2555
|
+
out: G(a, e.dataType || "string", e)
|
|
2556
2556
|
};
|
|
2557
2557
|
case "object": {
|
|
2558
2558
|
let t = e.valueKey || "id", n = e.displayKey || "name";
|
|
2559
2559
|
return {
|
|
2560
2560
|
kind: "scalar",
|
|
2561
2561
|
out: {
|
|
2562
|
-
[t]:
|
|
2562
|
+
[t]: G(i, e.elementType || "auto", {}),
|
|
2563
2563
|
[n]: a
|
|
2564
2564
|
}
|
|
2565
2565
|
};
|
|
2566
2566
|
}
|
|
2567
2567
|
case "custom":
|
|
2568
2568
|
case "template": {
|
|
2569
|
-
let n =
|
|
2569
|
+
let n = na(e.payloadTemplate);
|
|
2570
2570
|
if (!n) return {
|
|
2571
2571
|
kind: "scalar",
|
|
2572
|
-
out:
|
|
2572
|
+
out: G(i, r, e)
|
|
2573
2573
|
};
|
|
2574
|
-
let o =
|
|
2575
|
-
value:
|
|
2574
|
+
let o = ta(n, {
|
|
2575
|
+
value: G(i, e.elementType || "auto", {}),
|
|
2576
2576
|
label: a,
|
|
2577
2577
|
raw: t
|
|
2578
2578
|
});
|
|
@@ -2583,19 +2583,19 @@ function ia(e, t) {
|
|
|
2583
2583
|
}
|
|
2584
2584
|
default: return {
|
|
2585
2585
|
kind: "scalar",
|
|
2586
|
-
out:
|
|
2586
|
+
out: G(i, r, e)
|
|
2587
2587
|
};
|
|
2588
2588
|
}
|
|
2589
2589
|
}
|
|
2590
|
-
function
|
|
2590
|
+
function ia(e, t) {
|
|
2591
2591
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2592
2592
|
let n = t;
|
|
2593
|
-
return
|
|
2593
|
+
return z(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = Qi(n, e.transformRule), z(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Xi(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2594
2594
|
kind: "scalar",
|
|
2595
|
-
out: n.map((t) =>
|
|
2596
|
-
} :
|
|
2595
|
+
out: n.map((t) => ra(e, t).out)
|
|
2596
|
+
} : ra(e, n);
|
|
2597
2597
|
}
|
|
2598
|
-
function
|
|
2598
|
+
function aa(e = {}) {
|
|
2599
2599
|
return !!e.richValue || [
|
|
2600
2600
|
"label",
|
|
2601
2601
|
"object",
|
|
@@ -2603,10 +2603,10 @@ function oa(e = {}) {
|
|
|
2603
2603
|
"template"
|
|
2604
2604
|
].includes(e.payloadMode);
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2607
|
-
if (!
|
|
2606
|
+
function oa(e, t, n = []) {
|
|
2607
|
+
if (!aa(e) || t == null) return t;
|
|
2608
2608
|
let r = (e) => {
|
|
2609
|
-
if (
|
|
2609
|
+
if (B(e) && e.value !== void 0) return e;
|
|
2610
2610
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
2611
2611
|
return {
|
|
2612
2612
|
value: t?.value ?? e,
|
|
@@ -2615,9 +2615,9 @@ function sa(e, t, n = []) {
|
|
|
2615
2615
|
};
|
|
2616
2616
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2617
2617
|
}
|
|
2618
|
-
function
|
|
2618
|
+
function sa(e, t, n) {
|
|
2619
2619
|
if (!e?.field) return !0;
|
|
2620
|
-
let r =
|
|
2620
|
+
let r = U(t, e.field) ? H(t, e.field) : H(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2621
2621
|
switch (e.operator) {
|
|
2622
2622
|
case "eq": return String(r ?? "") === String(e.value ?? "");
|
|
2623
2623
|
case "neq": return String(r ?? "") !== String(e.value ?? "");
|
|
@@ -2629,45 +2629,45 @@ function ca(e, t, n) {
|
|
|
2629
2629
|
default: return !0;
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
2632
|
-
function
|
|
2632
|
+
function ca(e) {
|
|
2633
2633
|
let t = [];
|
|
2634
2634
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2635
2635
|
e?.field && t.push(e.field);
|
|
2636
2636
|
}), t;
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function la(e, t, n) {
|
|
2639
2639
|
if (!e) return !0;
|
|
2640
2640
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2641
2641
|
if (r.length) {
|
|
2642
|
-
let i = r.map((e) =>
|
|
2642
|
+
let i = r.map((e) => sa(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2643
2643
|
if (e.field) {
|
|
2644
|
-
let r =
|
|
2644
|
+
let r = sa(e, t, n);
|
|
2645
2645
|
o = a ? o || r : o && r;
|
|
2646
2646
|
}
|
|
2647
2647
|
return o;
|
|
2648
2648
|
}
|
|
2649
|
-
return
|
|
2649
|
+
return sa(e, t, n);
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2652
|
-
let a =
|
|
2653
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2651
|
+
function ua(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2652
|
+
let a = ca(e?.showIf);
|
|
2653
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), la(e.showIf, t, n) ? a.every((e) => {
|
|
2654
2654
|
let a = r?.get?.(e);
|
|
2655
|
-
return !a ||
|
|
2655
|
+
return !a || ua(a, t, n, r, i);
|
|
2656
2656
|
}) : !1);
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2658
|
+
function da(e = []) {
|
|
2659
2659
|
let t = /* @__PURE__ */ new Map();
|
|
2660
2660
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2661
2661
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2662
2662
|
})), t;
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2664
|
+
function fa(e = {}, { editing: t = !1 } = {}) {
|
|
2665
2665
|
let n = {};
|
|
2666
2666
|
return (e.fields ?? []).forEach((e) => {
|
|
2667
|
-
!e.field ||
|
|
2667
|
+
!e.field || ha(e) || t && !e.defaultOnEdit || e.defaultValue !== void 0 && e.defaultValue !== "" && (n[e.field] = e.defaultValue);
|
|
2668
2668
|
}), n;
|
|
2669
2669
|
}
|
|
2670
|
-
function
|
|
2670
|
+
function pa(e = []) {
|
|
2671
2671
|
let t = [];
|
|
2672
2672
|
return e.forEach((e) => {
|
|
2673
2673
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2678,18 +2678,18 @@ function ma(e = []) {
|
|
|
2678
2678
|
});
|
|
2679
2679
|
}), t;
|
|
2680
2680
|
}
|
|
2681
|
-
var
|
|
2681
|
+
var ma = [
|
|
2682
2682
|
"file",
|
|
2683
2683
|
"document",
|
|
2684
2684
|
"image",
|
|
2685
2685
|
"upload",
|
|
2686
2686
|
"attachment"
|
|
2687
2687
|
];
|
|
2688
|
-
function
|
|
2689
|
-
return
|
|
2688
|
+
function ha(e) {
|
|
2689
|
+
return ma.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2690
2690
|
}
|
|
2691
2691
|
function ga(e = []) {
|
|
2692
|
-
return
|
|
2692
|
+
return pa(e).map(({ field: e }) => e).filter(ha);
|
|
2693
2693
|
}
|
|
2694
2694
|
function _a(e) {
|
|
2695
2695
|
return String(e ?? "").trim().toLowerCase();
|
|
@@ -2708,7 +2708,7 @@ function ya(e, t = [], n = {}) {
|
|
|
2708
2708
|
});
|
|
2709
2709
|
};
|
|
2710
2710
|
return (t ?? []).forEach((t) => {
|
|
2711
|
-
let r = (t.fields ?? []).filter(
|
|
2711
|
+
let r = (t.fields ?? []).filter(ha);
|
|
2712
2712
|
if (!r.length) return;
|
|
2713
2713
|
let s = t.moduleName && !va(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2714
2714
|
if (t.addRow) {
|
|
@@ -2719,79 +2719,79 @@ function ya(e, t = [], n = {}) {
|
|
|
2719
2719
|
let t = e.fileKey ?? String(e.field).split(".")[0];
|
|
2720
2720
|
a.forEach((r, i) => {
|
|
2721
2721
|
let a = c(n.indexed ? `${t}[${i}]` : t);
|
|
2722
|
-
o(a,
|
|
2722
|
+
o(a, H(r, e.field));
|
|
2723
2723
|
});
|
|
2724
2724
|
});
|
|
2725
2725
|
return;
|
|
2726
2726
|
}
|
|
2727
2727
|
i !== "addRow" && r.forEach((t) => {
|
|
2728
2728
|
let n = c(t.fileKey ?? String(t.field).split(".")[0]);
|
|
2729
|
-
o(n,
|
|
2729
|
+
o(n, H(e, t.field));
|
|
2730
2730
|
});
|
|
2731
2731
|
}), r;
|
|
2732
2732
|
}
|
|
2733
2733
|
function ba(e, t, n = {}) {
|
|
2734
|
-
let r =
|
|
2734
|
+
let r = B(n.base) ? structuredClone(n.base) : {};
|
|
2735
2735
|
ga(t).forEach((e) => {
|
|
2736
2736
|
(e.payloadKey || e.field) && (Ca(r, e.payloadKey || e.field), Ca(r, e.field));
|
|
2737
2737
|
});
|
|
2738
|
-
let i = _a(n.module), a =
|
|
2738
|
+
let i = _a(n.module), a = da(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || va(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2739
2739
|
return (t ?? []).forEach((t) => {
|
|
2740
|
-
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField &&
|
|
2741
|
-
if (t.toggleEnabled && t.toggleField &&
|
|
2742
|
-
|
|
2740
|
+
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && U(e, t.toggleField) ? !!H(e, t.toggleField) : !1;
|
|
2741
|
+
if (t.toggleEnabled && t.toggleField && U(e, t.toggleField) && (W(n, t.toggleField, i), i && t.addRow)) {
|
|
2742
|
+
W(n, t.payloadKey || t.name, []);
|
|
2743
2743
|
return;
|
|
2744
2744
|
}
|
|
2745
2745
|
if (t.addRow) {
|
|
2746
2746
|
let i = e[t.name];
|
|
2747
2747
|
if (!Array.isArray(i)) return;
|
|
2748
|
-
|
|
2748
|
+
W(n, t.payloadKey || t.name, i.map((t) => Sa(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2749
2749
|
return;
|
|
2750
2750
|
}
|
|
2751
2751
|
r.forEach((t) => xa(t, e, n, e, a));
|
|
2752
2752
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2753
2753
|
moduleName: e,
|
|
2754
2754
|
data: t
|
|
2755
|
-
}))),
|
|
2755
|
+
}))), Ti(r, t);
|
|
2756
2756
|
}
|
|
2757
2757
|
function xa(e, t, n, r, i) {
|
|
2758
|
-
if (
|
|
2759
|
-
let r =
|
|
2760
|
-
|
|
2758
|
+
if (Di(e) && Ai(e)) {
|
|
2759
|
+
let r = Oi(e);
|
|
2760
|
+
U(t, r) && W(n, r, !!H(t, r));
|
|
2761
2761
|
}
|
|
2762
|
-
if (
|
|
2763
|
-
let i =
|
|
2762
|
+
if (ha(e)) {
|
|
2763
|
+
let i = Ki(H(t, e.field));
|
|
2764
2764
|
if (i !== void 0) {
|
|
2765
2765
|
let a = r !== void 0 && r !== t;
|
|
2766
|
-
|
|
2766
|
+
Gi(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2767
2767
|
}
|
|
2768
2768
|
return;
|
|
2769
2769
|
}
|
|
2770
|
-
if (
|
|
2771
|
-
(r === void 0 || r === t) &&
|
|
2770
|
+
if (ca(e.showIf).length && !ua(e, t, r, i)) {
|
|
2771
|
+
(r === void 0 || r === t) && U(t, e.field) && W(n, e.payloadKey || e.field, null);
|
|
2772
2772
|
return;
|
|
2773
2773
|
}
|
|
2774
2774
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2775
|
-
if (!
|
|
2776
|
-
let a =
|
|
2775
|
+
if (!U(t, e.field)) return;
|
|
2776
|
+
let a = H(t, e.field);
|
|
2777
2777
|
if (!Array.isArray(a)) return;
|
|
2778
2778
|
let o = a.map((t) => Sa(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2779
|
-
|
|
2779
|
+
W(n, e.payloadKey || e.field, o);
|
|
2780
2780
|
return;
|
|
2781
2781
|
}
|
|
2782
|
-
if (!
|
|
2783
|
-
if (
|
|
2784
|
-
let r =
|
|
2785
|
-
|
|
2782
|
+
if (!U(t, e.field)) return;
|
|
2783
|
+
if (Bi(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2784
|
+
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a = Ta(e), o = i.map((e) => ia(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2785
|
+
W(n, e.payloadKey || e.field, o);
|
|
2786
2786
|
return;
|
|
2787
2787
|
}
|
|
2788
|
-
let a =
|
|
2788
|
+
let a = ia(e, H(t, e.field));
|
|
2789
2789
|
if (a.kind !== "skip") {
|
|
2790
|
-
if (a.kind === "spread" &&
|
|
2791
|
-
|
|
2790
|
+
if (a.kind === "spread" && B(a.out)) {
|
|
2791
|
+
qi(n, a.out);
|
|
2792
2792
|
return;
|
|
2793
2793
|
}
|
|
2794
|
-
|
|
2794
|
+
W(n, e.payloadKey || e.field, a.out);
|
|
2795
2795
|
}
|
|
2796
2796
|
}
|
|
2797
2797
|
function Sa(e, t, n, r) {
|
|
@@ -2801,7 +2801,7 @@ function Sa(e, t, n, r) {
|
|
|
2801
2801
|
function Ca(e, t) {
|
|
2802
2802
|
let n = String(t).split("."), r = e;
|
|
2803
2803
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2804
|
-
if (!
|
|
2804
|
+
if (!B(r[n[e]])) return;
|
|
2805
2805
|
r = r[n[e]];
|
|
2806
2806
|
}
|
|
2807
2807
|
delete r[n[n.length - 1]];
|
|
@@ -2822,10 +2822,10 @@ function K(e, t) {
|
|
|
2822
2822
|
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" ? e.defaultValue : void 0;
|
|
2823
2823
|
if (t == null) return r() ?? t;
|
|
2824
2824
|
if (n(t)) return r();
|
|
2825
|
-
if (
|
|
2826
|
-
if (wa.has(e.type) &&
|
|
2825
|
+
if (z(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
2826
|
+
if (wa.has(e.type) && B(t)) {
|
|
2827
2827
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2828
|
-
if (r === void 0 ||
|
|
2828
|
+
if (r === void 0 || B(r)) return;
|
|
2829
2829
|
t = r;
|
|
2830
2830
|
}
|
|
2831
2831
|
if (e.type === "date" || e.type === "time") {
|
|
@@ -2833,8 +2833,8 @@ function K(e, t) {
|
|
|
2833
2833
|
let e = T(t);
|
|
2834
2834
|
return e.isValid() ? e : null;
|
|
2835
2835
|
}
|
|
2836
|
-
t =
|
|
2837
|
-
let i = (t) =>
|
|
2836
|
+
t = zi(e, t);
|
|
2837
|
+
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" && Xi(e) === "array", o = (t) => {
|
|
2838
2838
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2839
2839
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2840
2840
|
return n ? n.value : t;
|
|
@@ -2862,8 +2862,8 @@ function Ea(e, t) {
|
|
|
2862
2862
|
Array.isArray(t) && (i = t.map((t) => {
|
|
2863
2863
|
let n = {};
|
|
2864
2864
|
return e.subFields.forEach((e) => {
|
|
2865
|
-
if (!e.field ||
|
|
2866
|
-
let r =
|
|
2865
|
+
if (!e.field || ha(e)) return;
|
|
2866
|
+
let r = V(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
2867
2867
|
r != null && (n[e.field] = K(e, r));
|
|
2868
2868
|
}), n;
|
|
2869
2869
|
}));
|
|
@@ -3095,11 +3095,11 @@ function Ba(e) {
|
|
|
3095
3095
|
}
|
|
3096
3096
|
function Va(e, t = "") {
|
|
3097
3097
|
if (Fa(e)) return "";
|
|
3098
|
-
let { code: n, rest: r } = Ba(e), i = n || La(t), a =
|
|
3098
|
+
let { code: n, rest: r } = Ba(e), i = n || La(t), a = Wn(r) || r;
|
|
3099
3099
|
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
3100
3100
|
}
|
|
3101
3101
|
function Ha(e, t, n) {
|
|
3102
|
-
return Va(t, za(e, n,
|
|
3102
|
+
return Va(t, za(e, n, Hn()));
|
|
3103
3103
|
}
|
|
3104
3104
|
//#endregion
|
|
3105
3105
|
//#region src/components/detail/renderConfig.js
|
|
@@ -3246,7 +3246,7 @@ function ro(e) {
|
|
|
3246
3246
|
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Qa(e, Ka) || $a(e, qa);
|
|
3247
3247
|
}
|
|
3248
3248
|
function io(e) {
|
|
3249
|
-
return e ? typeof e == "string" ? eo(e) || e : typeof e == "object" && (Qa(e,
|
|
3249
|
+
return e ? typeof e == "string" ? eo(e) || e : typeof e == "object" && (Qa(e, P().documentNameOrder ?? []) || $a(e, Ja) || eo(ro(e)) || $a(e, Ya)) || "Document" : "Document";
|
|
3250
3250
|
}
|
|
3251
3251
|
function ao(e) {
|
|
3252
3252
|
if (Za(e)) return [];
|
|
@@ -3304,7 +3304,7 @@ function q(e, t, n) {
|
|
|
3304
3304
|
function fo(e, t = []) {
|
|
3305
3305
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3306
3306
|
if (!n) continue;
|
|
3307
|
-
let t =
|
|
3307
|
+
let t = V(e, n);
|
|
3308
3308
|
if (!lo(t)) return t;
|
|
3309
3309
|
}
|
|
3310
3310
|
}
|
|
@@ -3361,7 +3361,7 @@ function go(e, t, n, r) {
|
|
|
3361
3361
|
e.verifyTimestampField,
|
|
3362
3362
|
...String(e.verifyLockedWhenFields ?? "").split(/[,\s]+/)
|
|
3363
3363
|
].map((e) => String(e ?? "").trim()).filter(Boolean).forEach((e) => {
|
|
3364
|
-
if (
|
|
3364
|
+
if (V(n, e) !== void 0) return;
|
|
3365
3365
|
let i = r(t, { field: e });
|
|
3366
3366
|
i != null && q(n, e, i);
|
|
3367
3367
|
});
|
|
@@ -3384,9 +3384,9 @@ function _o(e) {
|
|
|
3384
3384
|
}
|
|
3385
3385
|
q(i, e.field, co(e.addRow) ? Ea(e, a) : K(e, a));
|
|
3386
3386
|
}), go(e, t, i, r), i;
|
|
3387
|
-
}, i =
|
|
3387
|
+
}, i = fa(e, { editing: !0 });
|
|
3388
3388
|
if (t && t.length > 0) {
|
|
3389
|
-
let e = t.map((e) => r(e, (e, t) => ho(e, t), (e, t) =>
|
|
3389
|
+
let e = t.map((e) => r(e, (e, t) => ho(e, t), (e, t) => V(e, t.field)));
|
|
3390
3390
|
for (; e.length < n;) e.push({ ...i });
|
|
3391
3391
|
return e;
|
|
3392
3392
|
}
|
|
@@ -3411,7 +3411,7 @@ function vo(e, t = []) {
|
|
|
3411
3411
|
if (i) {
|
|
3412
3412
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3413
3413
|
q(n, r, e ? [e[0]] : []);
|
|
3414
|
-
} else q(n, r,
|
|
3414
|
+
} else q(n, r, zi(e, Array.isArray(t) ? t : [t]));
|
|
3415
3415
|
return;
|
|
3416
3416
|
}
|
|
3417
3417
|
let i = e.splitDialCodeInto;
|
|
@@ -4272,7 +4272,7 @@ function bs(e) {
|
|
|
4272
4272
|
let n = t.toLowerCase();
|
|
4273
4273
|
return ys[n] ? ys[n] : /[^aeiou]ies$/i.test(t) ? t.slice(0, -3) + "y" : /(s|x|z|ch|sh)es$/i.test(t) ? t.slice(0, -2) : /[^s]s$/i.test(t) ? t.slice(0, -1) : t;
|
|
4274
4274
|
}
|
|
4275
|
-
function
|
|
4275
|
+
function xs(e) {
|
|
4276
4276
|
let t = String(e ?? "").trim();
|
|
4277
4277
|
if (!t) return "";
|
|
4278
4278
|
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);
|
|
@@ -4283,25 +4283,25 @@ function Y(e) {
|
|
|
4283
4283
|
return e.length > 1 && e === e.toUpperCase() ? e : t > 0 && vs.has(n) ? n : n.charAt(0).toUpperCase() + n.slice(1);
|
|
4284
4284
|
}).join(" ");
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4286
|
+
function Ss(e, t) {
|
|
4287
4287
|
let n = String(e?.quickCreateLabel ?? "").trim();
|
|
4288
4288
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4289
|
-
let r =
|
|
4289
|
+
let r = xs(e?.quickCreateModule || t);
|
|
4290
4290
|
return r ? `Add New ${r}` : "Add New";
|
|
4291
4291
|
}
|
|
4292
|
-
function
|
|
4292
|
+
function Cs(e, t) {
|
|
4293
4293
|
let n = String(e?.quickEditLabel ?? "").trim();
|
|
4294
4294
|
if (n && n.toLowerCase() !== "add more") return n;
|
|
4295
|
-
let r =
|
|
4295
|
+
let r = xs(e?.quickEditModule || t);
|
|
4296
4296
|
return r ? `Edit ${r}` : "Edit";
|
|
4297
4297
|
}
|
|
4298
|
-
function
|
|
4299
|
-
let r =
|
|
4300
|
-
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` :
|
|
4298
|
+
function ws(e, t, n) {
|
|
4299
|
+
let r = xs((e === "create" ? t?.quickCreateModule : t?.quickEditModule) || n);
|
|
4300
|
+
return e === "create" ? String(t?.quickCreateTitle ?? "").trim() || (r ? `Add New ${r}` : Ss(t, n)) : String(t?.quickEditTitle ?? "").trim() || (r ? `Edit ${r}` : Cs(t, n));
|
|
4301
4301
|
}
|
|
4302
4302
|
//#endregion
|
|
4303
4303
|
//#region src/components/AppButton.jsx
|
|
4304
|
-
function
|
|
4304
|
+
function Ts({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
4305
4305
|
let o = /* @__PURE__ */ C(y, {
|
|
4306
4306
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
4307
4307
|
icon: n,
|
|
@@ -4316,13 +4316,13 @@ function ws({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
4316
4316
|
}
|
|
4317
4317
|
//#endregion
|
|
4318
4318
|
//#region src/components/detail/userNames.js
|
|
4319
|
-
function
|
|
4319
|
+
function Es(e) {
|
|
4320
4320
|
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 || "";
|
|
4321
4321
|
}
|
|
4322
|
-
function
|
|
4322
|
+
function Ds(e) {
|
|
4323
4323
|
let t = {};
|
|
4324
4324
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4325
|
-
let n =
|
|
4325
|
+
let n = Es(e);
|
|
4326
4326
|
n && [
|
|
4327
4327
|
e.legacyUserId,
|
|
4328
4328
|
e.userId,
|
|
@@ -4336,29 +4336,29 @@ function Es(e) {
|
|
|
4336
4336
|
});
|
|
4337
4337
|
}), t;
|
|
4338
4338
|
}
|
|
4339
|
-
var
|
|
4340
|
-
function
|
|
4339
|
+
var Os = /* @__PURE__ */ new Map();
|
|
4340
|
+
function ks(e) {
|
|
4341
4341
|
let t = String(e ?? "").trim();
|
|
4342
4342
|
if (!t) return Promise.resolve("");
|
|
4343
|
-
if (
|
|
4344
|
-
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
4345
|
-
return
|
|
4343
|
+
if (Os.has(t)) return Os.get(t);
|
|
4344
|
+
let n = a(s, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => Es(e?.data ?? e ?? null)).catch(() => "");
|
|
4345
|
+
return Os.set(t, n), n;
|
|
4346
4346
|
}
|
|
4347
|
-
var
|
|
4348
|
-
function
|
|
4347
|
+
var Y = (e) => e == null ? "" : String(e).trim();
|
|
4348
|
+
function As(e) {
|
|
4349
4349
|
let t = e?.quickCreateNotice;
|
|
4350
4350
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
4351
4351
|
enabled: !0,
|
|
4352
|
-
title:
|
|
4353
|
-
message:
|
|
4352
|
+
title: Y(t.title) || "New record created",
|
|
4353
|
+
message: Y(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.",
|
|
4354
4354
|
showCreator: t.showCreator !== !1,
|
|
4355
4355
|
showRecordName: t.showRecordName !== !1,
|
|
4356
|
-
recordNameField:
|
|
4357
|
-
recordLabel:
|
|
4358
|
-
creatorLabel:
|
|
4356
|
+
recordNameField: Y(t.recordNameField),
|
|
4357
|
+
recordLabel: Y(t.recordLabel) || "Record name",
|
|
4358
|
+
creatorLabel: Y(t.creatorLabel) || "Created by"
|
|
4359
4359
|
};
|
|
4360
4360
|
}
|
|
4361
|
-
var
|
|
4361
|
+
var js = [
|
|
4362
4362
|
"clientName",
|
|
4363
4363
|
"companyName",
|
|
4364
4364
|
"name",
|
|
@@ -4368,24 +4368,24 @@ var As = [
|
|
|
4368
4368
|
"label",
|
|
4369
4369
|
"employerName",
|
|
4370
4370
|
"vendorName"
|
|
4371
|
-
],
|
|
4371
|
+
], Ms = (e, t) => {
|
|
4372
4372
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
4373
|
-
},
|
|
4374
|
-
function
|
|
4373
|
+
}, Ns = (e) => typeof e == "string" || typeof e == "number" ? Y(e) : e && typeof e == "object" ? Y(e.label ?? e.name ?? e.title ?? "") : "";
|
|
4374
|
+
function Ps(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
4375
4375
|
if (!e || typeof e != "object") return "";
|
|
4376
4376
|
for (let r of [
|
|
4377
4377
|
t,
|
|
4378
4378
|
n,
|
|
4379
|
-
...
|
|
4379
|
+
...js
|
|
4380
4380
|
]) {
|
|
4381
4381
|
if (!r) continue;
|
|
4382
|
-
let t = Ms(
|
|
4382
|
+
let t = Ns(Ms(e, r));
|
|
4383
4383
|
if (t) return t;
|
|
4384
4384
|
}
|
|
4385
4385
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
4386
|
-
return r ?
|
|
4386
|
+
return r ? Y(e[r]) : "";
|
|
4387
4387
|
}
|
|
4388
|
-
function
|
|
4388
|
+
function Fs(e) {
|
|
4389
4389
|
if (!e || typeof e != "object") return "";
|
|
4390
4390
|
let t = [
|
|
4391
4391
|
e.createdBy,
|
|
@@ -4398,45 +4398,45 @@ function Ps(e) {
|
|
|
4398
4398
|
for (let e of t) {
|
|
4399
4399
|
if (e == null || e === "") continue;
|
|
4400
4400
|
if (typeof e == "object") {
|
|
4401
|
-
let t =
|
|
4401
|
+
let t = Y(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
4402
4402
|
if (t) return t;
|
|
4403
4403
|
continue;
|
|
4404
4404
|
}
|
|
4405
|
-
let t =
|
|
4405
|
+
let t = Y(e);
|
|
4406
4406
|
if (t) return t;
|
|
4407
4407
|
}
|
|
4408
4408
|
return "";
|
|
4409
4409
|
}
|
|
4410
|
-
function
|
|
4410
|
+
function Is(e = i) {
|
|
4411
4411
|
try {
|
|
4412
|
-
return
|
|
4412
|
+
return Es(e()) || "";
|
|
4413
4413
|
} catch {
|
|
4414
4414
|
return "";
|
|
4415
4415
|
}
|
|
4416
4416
|
}
|
|
4417
|
-
var
|
|
4417
|
+
var Ls = (e, t) => a(s, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4418
4418
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4419
4419
|
return Array.isArray(t) ? t[0] : t;
|
|
4420
4420
|
});
|
|
4421
|
-
async function
|
|
4422
|
-
let { fetchRecord: o =
|
|
4421
|
+
async function Rs({ module: e, recordId: t, notice: n, displayField: r = "", deps: a = {} } = {}) {
|
|
4422
|
+
let { fetchRecord: o = Ls, fetchUserNameFn: s = ks, getUser: c = i } = a, l = null;
|
|
4423
4423
|
if (e && t) try {
|
|
4424
4424
|
l = await o(e, t);
|
|
4425
4425
|
} catch {
|
|
4426
4426
|
l = null;
|
|
4427
4427
|
}
|
|
4428
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4428
|
+
let u = n?.showRecordName === !1 ? "" : Ps(l, {
|
|
4429
4429
|
recordNameField: n?.recordNameField,
|
|
4430
4430
|
displayField: r
|
|
4431
4431
|
}), d = "";
|
|
4432
4432
|
if (n?.showCreator !== !1) {
|
|
4433
|
-
let e =
|
|
4433
|
+
let e = Fs(l);
|
|
4434
4434
|
if (e) try {
|
|
4435
|
-
d =
|
|
4435
|
+
d = Y(await s(e));
|
|
4436
4436
|
} catch {
|
|
4437
4437
|
d = "";
|
|
4438
4438
|
}
|
|
4439
|
-
d ||=
|
|
4439
|
+
d ||= Is(c);
|
|
4440
4440
|
}
|
|
4441
4441
|
return {
|
|
4442
4442
|
recordName: u,
|
|
@@ -4445,17 +4445,17 @@ async function Ls({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
4445
4445
|
}
|
|
4446
4446
|
//#endregion
|
|
4447
4447
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4448
|
-
var
|
|
4449
|
-
function
|
|
4448
|
+
var zs = d(() => import("./index.js").then((e) => e.i)), Bs = d(() => import("./index.js").then((e) => e.n)), Vs = (e) => e == null || e === "", Hs = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4449
|
+
function Us(e, t, n, r, i) {
|
|
4450
4450
|
let a = e.quickEditIdFrom;
|
|
4451
4451
|
if (a) {
|
|
4452
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4453
|
-
return
|
|
4452
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Hs(a)] : Hs(a), i = t?.getFieldValue?.(e);
|
|
4453
|
+
return Vs(i) && (i = r?.[a]), Vs(i) ? null : i;
|
|
4454
4454
|
}
|
|
4455
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4455
|
+
return i && typeof i == "object" ? i.value ?? null : Vs(i) ? null : i;
|
|
4456
4456
|
}
|
|
4457
|
-
function
|
|
4458
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", v = m(() => p ?
|
|
4457
|
+
function Ws({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4458
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", v = m(() => p ? Us(e, t, n, i, a) : null, [
|
|
4459
4459
|
p,
|
|
4460
4460
|
e,
|
|
4461
4461
|
t,
|
|
@@ -4485,12 +4485,12 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4485
4485
|
module: _,
|
|
4486
4486
|
recordId: String(v)
|
|
4487
4487
|
}), ie = (t) => {
|
|
4488
|
-
let n =
|
|
4488
|
+
let n = As(e);
|
|
4489
4489
|
n && (d({
|
|
4490
4490
|
...n,
|
|
4491
4491
|
recordName: "",
|
|
4492
4492
|
creatorName: ""
|
|
4493
|
-
}),
|
|
4493
|
+
}), Rs({
|
|
4494
4494
|
module: h,
|
|
4495
4495
|
recordId: t,
|
|
4496
4496
|
notice: n,
|
|
@@ -4520,20 +4520,20 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4520
4520
|
icon: /* @__PURE__ */ C(me, {}),
|
|
4521
4521
|
onClick: x,
|
|
4522
4522
|
style: { paddingLeft: 0 },
|
|
4523
|
-
children:
|
|
4523
|
+
children: Ss(e, h)
|
|
4524
4524
|
}), p && /* @__PURE__ */ C(y, {
|
|
4525
4525
|
type: "link",
|
|
4526
4526
|
size: "small",
|
|
4527
4527
|
icon: /* @__PURE__ */ C(oe, {}),
|
|
4528
4528
|
onClick: re,
|
|
4529
4529
|
disabled: !v,
|
|
4530
|
-
title: v ? void 0 : `Choose a ${
|
|
4531
|
-
children:
|
|
4530
|
+
title: v ? void 0 : `Choose a ${xs(_) || "record"} above first, then edit it here`,
|
|
4531
|
+
children: Cs(e, _)
|
|
4532
4532
|
})]
|
|
4533
4533
|
})
|
|
4534
4534
|
}), ae = s ? /* @__PURE__ */ C(ee, {
|
|
4535
4535
|
open: !0,
|
|
4536
|
-
title:
|
|
4536
|
+
title: ws(s.mode, e, s.mode === "create" ? h : _),
|
|
4537
4537
|
width: "min(1080px, 96vw)",
|
|
4538
4538
|
footer: null,
|
|
4539
4539
|
destroyOnClose: !0,
|
|
@@ -4551,7 +4551,7 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4551
4551
|
},
|
|
4552
4552
|
children: /* @__PURE__ */ C(ne, {})
|
|
4553
4553
|
}),
|
|
4554
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4554
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(zs, {
|
|
4555
4555
|
moduleName: s.module,
|
|
4556
4556
|
embedded: !0,
|
|
4557
4557
|
breadcrumbItems: [],
|
|
@@ -4559,7 +4559,7 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4559
4559
|
onSuccess: (e) => {
|
|
4560
4560
|
b(), ie(e), o?.("create", e);
|
|
4561
4561
|
}
|
|
4562
|
-
}) : /* @__PURE__ */ C(
|
|
4562
|
+
}) : /* @__PURE__ */ C(Bs, {
|
|
4563
4563
|
moduleName: s.module,
|
|
4564
4564
|
recordId: s.recordId,
|
|
4565
4565
|
embedded: !0,
|
|
@@ -4583,7 +4583,7 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4583
4583
|
width: "min(520px, 94vw)",
|
|
4584
4584
|
maskClosable: !1,
|
|
4585
4585
|
onCancel: () => d(null),
|
|
4586
|
-
footer: /* @__PURE__ */ C(
|
|
4586
|
+
footer: /* @__PURE__ */ C(Ts, {
|
|
4587
4587
|
variant: "primary",
|
|
4588
4588
|
type: "primary",
|
|
4589
4589
|
onClick: () => d(null),
|
|
@@ -4620,8 +4620,8 @@ function Us({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4620
4620
|
}
|
|
4621
4621
|
//#endregion
|
|
4622
4622
|
//#region src/components/form/crossFieldRules.js
|
|
4623
|
-
var
|
|
4624
|
-
function
|
|
4623
|
+
var Gs = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4624
|
+
function Ks(e, t, n) {
|
|
4625
4625
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4626
4626
|
if (typeof n == "function") {
|
|
4627
4627
|
let e = n(t);
|
|
@@ -4629,23 +4629,23 @@ function Gs(e, t, n) {
|
|
|
4629
4629
|
}
|
|
4630
4630
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4631
4631
|
}
|
|
4632
|
-
function
|
|
4632
|
+
function qs({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4633
4633
|
let s = n.field ?? n.compareField ?? r;
|
|
4634
4634
|
return { validator: async (n, r) => {
|
|
4635
|
-
if (!s ||
|
|
4636
|
-
let c = i?.getFieldValue?.(
|
|
4637
|
-
if (
|
|
4635
|
+
if (!s || Gs(r)) return Promise.resolve();
|
|
4636
|
+
let c = i?.getFieldValue?.(Ks(a, s, o));
|
|
4637
|
+
if (Gs(c)) return Promise.resolve();
|
|
4638
4638
|
let l = Number(c), u = Number(r);
|
|
4639
4639
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4640
4640
|
} };
|
|
4641
4641
|
}
|
|
4642
|
-
function
|
|
4642
|
+
function Js(e = {}, t, n) {
|
|
4643
4643
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4644
|
-
return r ?
|
|
4644
|
+
return r ? Ks(t, r, n) : null;
|
|
4645
4645
|
}
|
|
4646
4646
|
//#endregion
|
|
4647
4647
|
//#region src/components/form/maxCeiling.js
|
|
4648
|
-
function
|
|
4648
|
+
function Ys(e, t) {
|
|
4649
4649
|
let n = String(t).split(".").filter(Boolean);
|
|
4650
4650
|
if (!Array.isArray(e)) return n.length > 1 ? n : t;
|
|
4651
4651
|
if (n.length > 1) {
|
|
@@ -4658,14 +4658,14 @@ function Js(e, t) {
|
|
|
4658
4658
|
let r = [...e];
|
|
4659
4659
|
return r[r.length - 1] = n[0], r;
|
|
4660
4660
|
}
|
|
4661
|
-
function
|
|
4662
|
-
let r = e?.getFieldValue?.(
|
|
4661
|
+
function Xs(e, t, n) {
|
|
4662
|
+
let r = e?.getFieldValue?.(Ys(t, n));
|
|
4663
4663
|
return r != null && r !== "" ? r : e?.getFieldValue?.(n);
|
|
4664
4664
|
}
|
|
4665
|
-
function
|
|
4665
|
+
function Zs(e) {
|
|
4666
4666
|
return String(e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4667
4667
|
}
|
|
4668
|
-
function
|
|
4668
|
+
function Qs(e, t) {
|
|
4669
4669
|
for (let n of e ?? []) {
|
|
4670
4670
|
let e = t(n);
|
|
4671
4671
|
if (e == null || e === "") continue;
|
|
@@ -4677,14 +4677,14 @@ function Zs(e, t) {
|
|
|
4677
4677
|
}
|
|
4678
4678
|
return null;
|
|
4679
4679
|
}
|
|
4680
|
-
function
|
|
4680
|
+
function $s({ input: e, compareFields: t, readValue: n }) {
|
|
4681
4681
|
let r = {
|
|
4682
4682
|
ok: !0,
|
|
4683
4683
|
field: null,
|
|
4684
4684
|
maximum: null
|
|
4685
4685
|
};
|
|
4686
4686
|
if (e == null || e === "") return r;
|
|
4687
|
-
let i =
|
|
4687
|
+
let i = Qs(t, n);
|
|
4688
4688
|
if (!i) return r;
|
|
4689
4689
|
let a = Number(e);
|
|
4690
4690
|
return Number.isFinite(a) ? {
|
|
@@ -4695,39 +4695,39 @@ function Qs({ input: e, compareFields: t, readValue: n }) {
|
|
|
4695
4695
|
}
|
|
4696
4696
|
//#endregion
|
|
4697
4697
|
//#region src/components/form/contextPrefill.js
|
|
4698
|
-
var
|
|
4699
|
-
function
|
|
4698
|
+
var ec = { candidates: ["applicantId"] };
|
|
4699
|
+
function tc(e) {
|
|
4700
4700
|
let t = String(e ?? "").trim();
|
|
4701
4701
|
if (!t) return [];
|
|
4702
4702
|
let n = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
4703
4703
|
return [.../* @__PURE__ */ new Set([
|
|
4704
4704
|
`${n}Id`,
|
|
4705
4705
|
`${t}Id`,
|
|
4706
|
-
|
|
4706
|
+
...ec[t] ?? []
|
|
4707
4707
|
])];
|
|
4708
4708
|
}
|
|
4709
|
-
function
|
|
4709
|
+
function nc(e, t) {
|
|
4710
4710
|
if (!t) return "";
|
|
4711
4711
|
let n = (e) => e && typeof e == "object" ? e.id ?? e.value ?? "" : e ?? "";
|
|
4712
|
-
for (let r of
|
|
4712
|
+
for (let r of tc(e)) {
|
|
4713
4713
|
let e = String(n(t[r]) || "");
|
|
4714
4714
|
if (e) return e;
|
|
4715
4715
|
}
|
|
4716
4716
|
return "";
|
|
4717
4717
|
}
|
|
4718
|
-
function
|
|
4718
|
+
function rc(e, t) {
|
|
4719
4719
|
let n = /* @__PURE__ */ new Set();
|
|
4720
4720
|
return (e ?? []).forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
4721
4721
|
e?.prefillFromModule && n.add(t(e.prefillFromModule));
|
|
4722
4722
|
})), [...n];
|
|
4723
4723
|
}
|
|
4724
|
-
function
|
|
4724
|
+
function ic(e) {
|
|
4725
4725
|
return e?.payloadMode === "skip";
|
|
4726
4726
|
}
|
|
4727
|
-
function
|
|
4727
|
+
function ac(e) {
|
|
4728
4728
|
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 : [];
|
|
4729
4729
|
}
|
|
4730
|
-
function
|
|
4730
|
+
function oc(e) {
|
|
4731
4731
|
let t = {};
|
|
4732
4732
|
return (e ?? []).forEach((e) => {
|
|
4733
4733
|
e?.addRow || (e?.fields ?? []).forEach((e) => {
|
|
@@ -4735,7 +4735,7 @@ function ac(e) {
|
|
|
4735
4735
|
});
|
|
4736
4736
|
}), t;
|
|
4737
4737
|
}
|
|
4738
|
-
function
|
|
4738
|
+
function sc(e, t) {
|
|
4739
4739
|
if (!e || !t) return;
|
|
4740
4740
|
let n = e;
|
|
4741
4741
|
for (let e of String(t).split(".")) {
|
|
@@ -4750,7 +4750,7 @@ function oc(e, t) {
|
|
|
4750
4750
|
}
|
|
4751
4751
|
return n;
|
|
4752
4752
|
}
|
|
4753
|
-
function
|
|
4753
|
+
function cc(e, t) {
|
|
4754
4754
|
if (!(!e || !t)) for (let n of [
|
|
4755
4755
|
t.prefillFrom,
|
|
4756
4756
|
t.field,
|
|
@@ -4758,13 +4758,13 @@ function sc(e, t) {
|
|
|
4758
4758
|
]) {
|
|
4759
4759
|
if (!n) continue;
|
|
4760
4760
|
let t = e[n];
|
|
4761
|
-
if (t ??=
|
|
4761
|
+
if (t ??= V(e, n), t ??= sc(e, n), t != null) return t;
|
|
4762
4762
|
}
|
|
4763
4763
|
}
|
|
4764
4764
|
//#endregion
|
|
4765
4765
|
//#region src/components/form/ValidationOverrideCheckbox.jsx
|
|
4766
|
-
function
|
|
4767
|
-
let a =
|
|
4766
|
+
function lc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
4767
|
+
let a = Di(t), o = x.useWatch(n, e);
|
|
4768
4768
|
if (!a) return null;
|
|
4769
4769
|
let s = a.label || "Allow beyond the limit", c = () => {
|
|
4770
4770
|
setTimeout(() => {
|
|
@@ -4775,7 +4775,7 @@ function cc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4775
4775
|
e.setFieldValue(n, !1), c();
|
|
4776
4776
|
return;
|
|
4777
4777
|
}
|
|
4778
|
-
let i = await Ma(
|
|
4778
|
+
let i = await Ma(Pi(t));
|
|
4779
4779
|
e.setFieldValue(n, !!i), c();
|
|
4780
4780
|
}, u = a.help ? `${s} — ${a.help}` : s;
|
|
4781
4781
|
return /* @__PURE__ */ C(re, {
|
|
@@ -4794,34 +4794,34 @@ function cc({ form: e, field: t, flagPath: n, fieldPath: r, disabled: i }) {
|
|
|
4794
4794
|
}
|
|
4795
4795
|
//#endregion
|
|
4796
4796
|
//#region src/components/form/prefillWhenRules.js
|
|
4797
|
-
var
|
|
4798
|
-
function
|
|
4797
|
+
var uc = (e) => String(e ?? "");
|
|
4798
|
+
function dc(e) {
|
|
4799
4799
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4800
4800
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4801
4801
|
let r = e?.field;
|
|
4802
4802
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
4803
4803
|
}), n;
|
|
4804
4804
|
}
|
|
4805
|
-
function
|
|
4806
|
-
return
|
|
4805
|
+
function fc(e, t, n, r) {
|
|
4806
|
+
return dc(e).map((e) => ({
|
|
4807
4807
|
field: e,
|
|
4808
4808
|
path: n(t, e, r)
|
|
4809
4809
|
}));
|
|
4810
4810
|
}
|
|
4811
|
-
function
|
|
4812
|
-
return !e || !e.field ? !1 :
|
|
4811
|
+
function pc(e, t = {}) {
|
|
4812
|
+
return !e || !e.field ? !1 : uc(t[e.field]) === uc(e.value);
|
|
4813
4813
|
}
|
|
4814
|
-
function
|
|
4815
|
-
let o = (Array.isArray(e) ? e : []).find((e) =>
|
|
4814
|
+
function mc({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
4815
|
+
let o = (Array.isArray(e) ? e : []).find((e) => pc(e, t));
|
|
4816
4816
|
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
4817
4817
|
action: "set",
|
|
4818
4818
|
value: o.setValue
|
|
4819
|
-
} : i && r !== void 0 &&
|
|
4819
|
+
} : i && r !== void 0 && uc(n) === uc(r) ? { action: "clear" } : { action: "none" };
|
|
4820
4820
|
}
|
|
4821
4821
|
//#endregion
|
|
4822
4822
|
//#region src/components/form/optionConstraints.js
|
|
4823
|
-
var
|
|
4824
|
-
function
|
|
4823
|
+
var X = (e) => String(e ?? "").trim().toLowerCase();
|
|
4824
|
+
function hc(e) {
|
|
4825
4825
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
4826
4826
|
return t.forEach((e) => {
|
|
4827
4827
|
if (e != null && e !== "") {
|
|
@@ -4833,50 +4833,50 @@ function mc(e) {
|
|
|
4833
4833
|
e.label,
|
|
4834
4834
|
e.name
|
|
4835
4835
|
].forEach((e) => {
|
|
4836
|
-
e != null && e !== "" && n.push(
|
|
4836
|
+
e != null && e !== "" && n.push(X(e));
|
|
4837
4837
|
});
|
|
4838
4838
|
return;
|
|
4839
4839
|
}
|
|
4840
|
-
n.push(
|
|
4840
|
+
n.push(X(e));
|
|
4841
4841
|
}
|
|
4842
4842
|
}), n;
|
|
4843
4843
|
}
|
|
4844
|
-
function
|
|
4845
|
-
let n =
|
|
4844
|
+
function gc(e = [], t) {
|
|
4845
|
+
let n = hc(t);
|
|
4846
4846
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4847
|
-
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(
|
|
4847
|
+
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(X(e.value)) || r.has(X(e.label)) : r.has(X(e)));
|
|
4848
4848
|
return i.length > 0 ? i : e;
|
|
4849
4849
|
}
|
|
4850
|
-
function
|
|
4850
|
+
function _c(e) {
|
|
4851
4851
|
let t = [];
|
|
4852
4852
|
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
4853
|
-
e != null && e !== "" && t.push(
|
|
4853
|
+
e != null && e !== "" && t.push(X(e));
|
|
4854
4854
|
}), t;
|
|
4855
4855
|
}
|
|
4856
|
-
function
|
|
4856
|
+
function vc(e, t = {}) {
|
|
4857
4857
|
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
4858
4858
|
return n.forEach((e) => {
|
|
4859
4859
|
if (!e || e.clearValue) return;
|
|
4860
|
-
let n =
|
|
4860
|
+
let n = _c(e);
|
|
4861
4861
|
if (!n.length) return;
|
|
4862
|
-
let a =
|
|
4862
|
+
let a = pc(e, t) ? i : r;
|
|
4863
4863
|
n.forEach((e) => a.add(e));
|
|
4864
4864
|
}), i.forEach((e) => r.delete(e)), [...r];
|
|
4865
4865
|
}
|
|
4866
|
-
function
|
|
4867
|
-
let r =
|
|
4866
|
+
function yc(e = [], t, n) {
|
|
4867
|
+
let r = vc(t, n);
|
|
4868
4868
|
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4869
4869
|
let i = new Set(r);
|
|
4870
|
-
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(
|
|
4870
|
+
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(X(e.value)) || i.has(X(e.label))) : !i.has(X(e)));
|
|
4871
4871
|
}
|
|
4872
|
-
function
|
|
4872
|
+
function bc(e, t = {}, n) {
|
|
4873
4873
|
let r = Array.isArray(e) ? e : [];
|
|
4874
4874
|
if (n == null || n === "") return [];
|
|
4875
|
-
let i =
|
|
4875
|
+
let i = X(n), a = [], o = /* @__PURE__ */ new Set();
|
|
4876
4876
|
return r.forEach((e) => {
|
|
4877
4877
|
if (!e || e.clearValue) return;
|
|
4878
4878
|
let { setValue: n, setValueLabel: r } = e;
|
|
4879
|
-
n != null && n !== "" && r &&
|
|
4879
|
+
n != null && n !== "" && r && X(n) === i && pc(e, t) && (o.has(X(n)) || (o.add(X(n)), a.push({
|
|
4880
4880
|
value: n,
|
|
4881
4881
|
label: r
|
|
4882
4882
|
})));
|
|
@@ -4884,8 +4884,8 @@ function yc(e, t = {}, n) {
|
|
|
4884
4884
|
}
|
|
4885
4885
|
//#endregion
|
|
4886
4886
|
//#region src/components/form/optionRowFilters.js
|
|
4887
|
-
var
|
|
4888
|
-
function
|
|
4887
|
+
var xc = 64;
|
|
4888
|
+
function Sc(e) {
|
|
4889
4889
|
if (String(e ?? "").trim() !== "currentUserId") return "";
|
|
4890
4890
|
try {
|
|
4891
4891
|
return typeof localStorage > "u" ? "" : String(localStorage.getItem("userId") ?? "").trim();
|
|
@@ -4893,34 +4893,34 @@ function xc(e) {
|
|
|
4893
4893
|
return "";
|
|
4894
4894
|
}
|
|
4895
4895
|
}
|
|
4896
|
-
var
|
|
4897
|
-
function
|
|
4896
|
+
var Cc = (e) => String(e ?? "").trim().toLowerCase(), wc = (e) => e != null && String(e).trim() !== "";
|
|
4897
|
+
function Tc(e) {
|
|
4898
4898
|
let t = Array.isArray(e) ? e : String(e ?? "").split(",");
|
|
4899
|
-
return new Set(t.map(
|
|
4899
|
+
return new Set(t.map(Cc).filter((e) => e !== ""));
|
|
4900
4900
|
}
|
|
4901
|
-
function
|
|
4902
|
-
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) =>
|
|
4901
|
+
function Ec(e, t) {
|
|
4902
|
+
return !t || !Array.isArray(e) || e.length === 0 ? !1 : e.some((e) => wc(e?.extraData?.[t]));
|
|
4903
4903
|
}
|
|
4904
|
-
function
|
|
4904
|
+
function Dc(e, t, n) {
|
|
4905
4905
|
let r = e?.extraData?.[t];
|
|
4906
|
-
if (!
|
|
4907
|
-
let i =
|
|
4908
|
-
return i.size === 0 ? r === !0 : i.has(
|
|
4906
|
+
if (!wc(n)) return r === !0;
|
|
4907
|
+
let i = Tc(n);
|
|
4908
|
+
return i.size === 0 ? r === !0 : i.has(Cc(r));
|
|
4909
4909
|
}
|
|
4910
|
-
function
|
|
4910
|
+
function Oc(e, t) {
|
|
4911
4911
|
let n = /* @__PURE__ */ new Map();
|
|
4912
4912
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4913
|
-
let r =
|
|
4914
|
-
r && n.set(r,
|
|
4913
|
+
let r = Cc(e?.value);
|
|
4914
|
+
r && n.set(r, Cc(e?.extraData?.[t]));
|
|
4915
4915
|
}), n;
|
|
4916
4916
|
}
|
|
4917
|
-
function
|
|
4918
|
-
let r =
|
|
4917
|
+
function kc(e, t, n) {
|
|
4918
|
+
let r = Cc(n);
|
|
4919
4919
|
if (!r) return !1;
|
|
4920
|
-
let i = /* @__PURE__ */ new Set(), a =
|
|
4920
|
+
let i = /* @__PURE__ */ new Set(), a = Cc(e);
|
|
4921
4921
|
if (!a) return !1;
|
|
4922
4922
|
i.add(a);
|
|
4923
|
-
for (let e = 0; e <
|
|
4923
|
+
for (let e = 0; e < xc; e += 1) {
|
|
4924
4924
|
let e = t.get(a);
|
|
4925
4925
|
if (!e) return !1;
|
|
4926
4926
|
if (e === r) return !0;
|
|
@@ -4929,63 +4929,63 @@ function Dc(e, t, n) {
|
|
|
4929
4929
|
}
|
|
4930
4930
|
return !1;
|
|
4931
4931
|
}
|
|
4932
|
-
function
|
|
4932
|
+
function Ac(e = {}) {
|
|
4933
4933
|
let t = [], n = (e) => {
|
|
4934
4934
|
let n = String(e ?? "").trim();
|
|
4935
4935
|
n && !t.includes(n) && t.push(n);
|
|
4936
4936
|
};
|
|
4937
4937
|
return (Array.isArray(e.extraFields) ? e.extraFields : []).forEach(n), n(e.optionsRequireExtraField), n(e.optionsHierarchyParentField), t;
|
|
4938
4938
|
}
|
|
4939
|
-
function
|
|
4939
|
+
function jc(e, t = {}, n = {}) {
|
|
4940
4940
|
if (!Array.isArray(e) || e.length === 0) return e;
|
|
4941
4941
|
let r = n.source ? `[${n.source}]` : "[optionRowFilters]", i = t.field ?? t.label ?? "(unnamed field)", a = typeof n.warn == "function" ? n.warn : (e) => {
|
|
4942
4942
|
typeof console < "u" && console.warn(e);
|
|
4943
4943
|
}, o = e, s = String(t.optionsRequireExtraField ?? "").trim();
|
|
4944
|
-
s && (
|
|
4944
|
+
s && (Ec(o, s) ? o = o.filter((e) => Dc(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".`));
|
|
4945
4945
|
let c = String(t.optionsHierarchyParentField ?? "").trim();
|
|
4946
4946
|
if (c) {
|
|
4947
|
-
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s =
|
|
4947
|
+
let n = String(t.optionsHierarchySelfFrom ?? "").trim() || "currentUserId", s = Sc(n);
|
|
4948
4948
|
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.`);
|
|
4949
|
-
else if (!
|
|
4949
|
+
else if (!Ec(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".`);
|
|
4950
4950
|
else {
|
|
4951
|
-
let t =
|
|
4952
|
-
o = o.filter((e) =>
|
|
4951
|
+
let t = Oc(e, c);
|
|
4952
|
+
o = o.filter((e) => kc(e?.value, t, s));
|
|
4953
4953
|
}
|
|
4954
4954
|
}
|
|
4955
4955
|
return o;
|
|
4956
4956
|
}
|
|
4957
4957
|
//#endregion
|
|
4958
4958
|
//#region src/components/form/fieldTooltip.js
|
|
4959
|
-
var
|
|
4960
|
-
function
|
|
4961
|
-
return
|
|
4959
|
+
var Mc = (e) => e == null || String(e).trim() === "", Nc = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
4960
|
+
function Pc(e) {
|
|
4961
|
+
return Mc(e?.tooltip) ? Nc(e?.infoEnabled) && !Mc(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
4962
4962
|
}
|
|
4963
4963
|
//#endregion
|
|
4964
4964
|
//#region src/components/form/dependentLookupReset.js
|
|
4965
|
-
var
|
|
4966
|
-
function
|
|
4967
|
-
return !(!r || e ===
|
|
4965
|
+
var Fc = Symbol("parentFilterUnseen"), Ic = (e) => e == null || e === "", Lc = (e, t) => String(e ?? "") === String(t ?? "");
|
|
4966
|
+
function Rc({ previous: e, next: t, currentValue: n, scoped: r = !0 }) {
|
|
4967
|
+
return !(!r || e === Fc || Lc(e, t) || Ic(e) || Ic(n));
|
|
4968
4968
|
}
|
|
4969
4969
|
//#endregion
|
|
4970
4970
|
//#region src/utils/roleAllowsAction.js
|
|
4971
|
-
function
|
|
4972
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
4971
|
+
function zc(e) {
|
|
4972
|
+
return e == null ? !0 : typeof e == "object" ? zc(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
4973
4973
|
}
|
|
4974
|
-
function
|
|
4974
|
+
function Bc(e, t) {
|
|
4975
4975
|
if (!e) return !0;
|
|
4976
4976
|
try {
|
|
4977
4977
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
4978
|
-
return
|
|
4978
|
+
return zc((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
4979
4979
|
} catch {
|
|
4980
4980
|
return !0;
|
|
4981
4981
|
}
|
|
4982
4982
|
}
|
|
4983
4983
|
//#endregion
|
|
4984
4984
|
//#region src/utils/afterSubmitNav.js
|
|
4985
|
-
function
|
|
4985
|
+
function Vc(e) {
|
|
4986
4986
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
4987
4987
|
}
|
|
4988
|
-
function
|
|
4988
|
+
function Hc(e, t, n) {
|
|
4989
4989
|
let r = String(e ?? "").trim();
|
|
4990
4990
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
4991
4991
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -4994,50 +4994,50 @@ function Bc(e, t, n) {
|
|
|
4994
4994
|
}
|
|
4995
4995
|
//#endregion
|
|
4996
4996
|
//#region src/utils/backNav.js
|
|
4997
|
-
function
|
|
4997
|
+
function Uc(e = typeof window < "u" ? window : void 0) {
|
|
4998
4998
|
let t = e?.history?.state?.idx;
|
|
4999
4999
|
return typeof t == "number" && t > 0;
|
|
5000
5000
|
}
|
|
5001
|
-
function
|
|
5002
|
-
return t && e ? { path: e } :
|
|
5001
|
+
function Wc({ cancelPath: e, cancelPathPriority: t = !1, fallbackPath: n = "/", win: r = typeof window < "u" ? window : void 0 } = {}) {
|
|
5002
|
+
return t && e ? { path: e } : Uc(r) ? { back: !0 } : e ? { path: e } : { path: n };
|
|
5003
5003
|
}
|
|
5004
|
-
function
|
|
5005
|
-
let n =
|
|
5004
|
+
function Gc(e, t = {}) {
|
|
5005
|
+
let n = Wc(t);
|
|
5006
5006
|
return n.back ? e(-1) : e(n.path), n;
|
|
5007
5007
|
}
|
|
5008
5008
|
//#endregion
|
|
5009
5009
|
//#region src/components/form/educationRules.js
|
|
5010
|
-
var
|
|
5011
|
-
function
|
|
5010
|
+
var Z = (e) => e == null ? "" : String(e).trim();
|
|
5011
|
+
function Kc(e, t) {
|
|
5012
5012
|
let n = e?.regionRules;
|
|
5013
5013
|
if (!n || typeof n != "object") return e ?? {};
|
|
5014
|
-
let r =
|
|
5014
|
+
let r = Z(t), i = n[r] ?? n[r.toUpperCase()] ?? n.default;
|
|
5015
5015
|
return !i || typeof i != "object" ? e ?? {} : {
|
|
5016
5016
|
...e,
|
|
5017
5017
|
...i
|
|
5018
5018
|
};
|
|
5019
5019
|
}
|
|
5020
|
-
function Kc(e) {
|
|
5021
|
-
return e?.allowInProgress !== !1;
|
|
5022
|
-
}
|
|
5023
5020
|
function qc(e) {
|
|
5024
|
-
return
|
|
5021
|
+
return e?.allowInProgress !== !1;
|
|
5025
5022
|
}
|
|
5026
5023
|
function Jc(e) {
|
|
5027
|
-
return
|
|
5024
|
+
return qc(e) ? "" : Zc(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.";
|
|
5028
5025
|
}
|
|
5029
5026
|
function Yc(e) {
|
|
5030
|
-
return
|
|
5027
|
+
return qc(e) ? "allow" : Z(e?.inProgressSeverity).toLowerCase() === "warn" ? "warn" : "block";
|
|
5031
5028
|
}
|
|
5032
5029
|
function Xc(e) {
|
|
5033
|
-
return
|
|
5030
|
+
return Yc(e) === "block";
|
|
5034
5031
|
}
|
|
5035
5032
|
function Zc(e) {
|
|
5036
|
-
|
|
5037
|
-
|
|
5033
|
+
return Yc(e) === "warn";
|
|
5034
|
+
}
|
|
5035
|
+
function Qc(e) {
|
|
5036
|
+
if (!Xc(e)) return null;
|
|
5037
|
+
let t = Jc(e);
|
|
5038
5038
|
return { validator: (e, n) => n === !0 ? Promise.reject(Error(t)) : Promise.resolve() };
|
|
5039
5039
|
}
|
|
5040
|
-
function
|
|
5040
|
+
function $c(e, t = {}) {
|
|
5041
5041
|
let n = t.tieBreak ?? "endDate", r = t.field ?? "startDate";
|
|
5042
5042
|
for (let t of [n, r]) {
|
|
5043
5043
|
let n = e?.[t];
|
|
@@ -5047,50 +5047,50 @@ function Qc(e, t = {}) {
|
|
|
5047
5047
|
}
|
|
5048
5048
|
return null;
|
|
5049
5049
|
}
|
|
5050
|
-
function
|
|
5050
|
+
function el(e, t = {}) {
|
|
5051
5051
|
let n = t.inProgressField ?? "currentStudyingHere";
|
|
5052
5052
|
return !!e?.[n];
|
|
5053
5053
|
}
|
|
5054
|
-
function
|
|
5054
|
+
function tl(e = [], t = {}) {
|
|
5055
5055
|
let n = (t.direction ?? "desc") === "desc";
|
|
5056
5056
|
return e.map((e, n) => ({
|
|
5057
5057
|
index: n,
|
|
5058
|
-
key:
|
|
5059
|
-
ongoing: t.inProgressFirst !== !1 &&
|
|
5058
|
+
key: $c(e, t),
|
|
5059
|
+
ongoing: t.inProgressFirst !== !1 && el(e, t)
|
|
5060
5060
|
})).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);
|
|
5061
5061
|
}
|
|
5062
|
-
function
|
|
5062
|
+
function nl(e, t, n = {}) {
|
|
5063
5063
|
if (!Array.isArray(e) || e.length < 2 || t == null || t < 0 || t >= e.length) return null;
|
|
5064
|
-
let r =
|
|
5064
|
+
let r = tl(e, n).indexOf(t);
|
|
5065
5065
|
return r === -1 || r === t ? null : {
|
|
5066
5066
|
from: t,
|
|
5067
5067
|
to: r,
|
|
5068
|
-
reason:
|
|
5068
|
+
reason: el(e[t], n) ? "inProgress" : "outOfOrder"
|
|
5069
5069
|
};
|
|
5070
5070
|
}
|
|
5071
|
-
var
|
|
5071
|
+
var rl = Object.freeze({
|
|
5072
5072
|
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.",
|
|
5073
5073
|
outOfOrder: "These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.",
|
|
5074
5074
|
ok: "Yes, move it up",
|
|
5075
5075
|
keep: "No, leave it here"
|
|
5076
5076
|
});
|
|
5077
|
-
function
|
|
5077
|
+
function il(e, t = {}) {
|
|
5078
5078
|
let n = {
|
|
5079
|
-
...
|
|
5079
|
+
...rl,
|
|
5080
5080
|
...t.messages ?? {}
|
|
5081
5081
|
};
|
|
5082
5082
|
return n[e] ?? n.outOfOrder;
|
|
5083
5083
|
}
|
|
5084
|
-
function
|
|
5085
|
-
let n = t.levelField ?? "qualification", r =
|
|
5084
|
+
function al(e, t = {}) {
|
|
5085
|
+
let n = t.levelField ?? "qualification", r = Z(e?.[n]);
|
|
5086
5086
|
if (!r) return null;
|
|
5087
5087
|
let i = t.levels ?? {}, a = i[r] ?? i[r.toLowerCase()] ?? i[r.toUpperCase()];
|
|
5088
|
-
return Number.isFinite(Number(a)) ? Number(a) :
|
|
5088
|
+
return Number.isFinite(Number(a)) ? Number(a) : ol(r, t);
|
|
5089
5089
|
}
|
|
5090
|
-
function
|
|
5090
|
+
function ol(e, t) {
|
|
5091
5091
|
let n = Array.isArray(t?.levelPatterns) ? t.levelPatterns : [], r = e.toLowerCase();
|
|
5092
5092
|
for (let e of n) {
|
|
5093
|
-
let t =
|
|
5093
|
+
let t = Z(e?.match);
|
|
5094
5094
|
if (!t) continue;
|
|
5095
5095
|
let n;
|
|
5096
5096
|
try {
|
|
@@ -5102,14 +5102,14 @@ function al(e, t) {
|
|
|
5102
5102
|
}
|
|
5103
5103
|
return null;
|
|
5104
5104
|
}
|
|
5105
|
-
function
|
|
5106
|
-
return
|
|
5105
|
+
function sl(e, t = {}) {
|
|
5106
|
+
return Z((t?.levelLabels ?? {})[e]) || Z(e);
|
|
5107
5107
|
}
|
|
5108
|
-
function
|
|
5108
|
+
function cl(e = [], t = {}) {
|
|
5109
5109
|
if (!t || t.requireBelow === !1) return [];
|
|
5110
5110
|
let n = t.levels ?? {}, r = t.requiredLevels ?? [];
|
|
5111
5111
|
if (!r.length) return [];
|
|
5112
|
-
let i = e.map((e) =>
|
|
5112
|
+
let i = e.map((e) => al(e, t)).filter((e) => e !== null);
|
|
5113
5113
|
if (!i.length) return [];
|
|
5114
5114
|
let a = Math.max(...i), o = [];
|
|
5115
5115
|
return r.forEach((e) => {
|
|
@@ -5117,43 +5117,43 @@ function sl(e = [], t = {}) {
|
|
|
5117
5117
|
Number.isFinite(r) && (r >= a || i.includes(r) || o.push(t));
|
|
5118
5118
|
}), o;
|
|
5119
5119
|
}
|
|
5120
|
-
function
|
|
5121
|
-
let n =
|
|
5120
|
+
function ll(e, t = {}) {
|
|
5121
|
+
let n = cl(e, t);
|
|
5122
5122
|
if (!n.length) return "";
|
|
5123
|
-
let r = n.map((e) =>
|
|
5123
|
+
let r = n.map((e) => sl(e, t)).join(", ");
|
|
5124
5124
|
return (t.message || "You’ve added a higher qualification but not the {missing} below it. Please add that too.").replace("{missing}", r);
|
|
5125
5125
|
}
|
|
5126
|
-
async function
|
|
5126
|
+
async function ul({ group: e, rows: t, rowIndex: n, move: r, confirm: i }) {
|
|
5127
5127
|
let a = e?.orderBy;
|
|
5128
5128
|
if (!a || a.confirmMove === !1 || typeof r != "function") return !1;
|
|
5129
|
-
let o =
|
|
5129
|
+
let o = nl(t, n, a);
|
|
5130
5130
|
if (!o) return !1;
|
|
5131
5131
|
let s = {
|
|
5132
|
-
...
|
|
5132
|
+
...rl,
|
|
5133
5133
|
...a.messages ?? {}
|
|
5134
5134
|
};
|
|
5135
5135
|
return await i({
|
|
5136
5136
|
reason: o.reason,
|
|
5137
5137
|
title: o.reason === "inProgress" ? "This looks like the most recent one" : "These dates make this the most recent one",
|
|
5138
|
-
body:
|
|
5138
|
+
body: il(o.reason, a),
|
|
5139
5139
|
okText: s.ok,
|
|
5140
5140
|
cancelText: s.keep,
|
|
5141
5141
|
from: o.from,
|
|
5142
5142
|
to: o.to
|
|
5143
5143
|
}) ? (r(o.from, o.to), !0) : !1;
|
|
5144
5144
|
}
|
|
5145
|
-
function
|
|
5146
|
-
let n =
|
|
5145
|
+
function dl(e, t) {
|
|
5146
|
+
let n = Kc(e, t), r = n?.orderBy?.inProgressField;
|
|
5147
5147
|
return r ? {
|
|
5148
5148
|
name: n.name,
|
|
5149
5149
|
label: n.label ?? n.name,
|
|
5150
5150
|
rowsKey: n.payloadKey || n.name,
|
|
5151
5151
|
inProgressField: r,
|
|
5152
|
-
severity:
|
|
5153
|
-
message:
|
|
5152
|
+
severity: Yc(n),
|
|
5153
|
+
message: Jc(n)
|
|
5154
5154
|
} : null;
|
|
5155
5155
|
}
|
|
5156
|
-
function
|
|
5156
|
+
function fl(e = [], t, n) {
|
|
5157
5157
|
if (!n) return {
|
|
5158
5158
|
severity: "allow",
|
|
5159
5159
|
message: "",
|
|
@@ -5161,8 +5161,8 @@ function dl(e = [], t, n) {
|
|
|
5161
5161
|
};
|
|
5162
5162
|
let r = null;
|
|
5163
5163
|
for (let i of e) {
|
|
5164
|
-
let e =
|
|
5165
|
-
if (!(!e || e.severity === "allow") &&
|
|
5164
|
+
let e = dl(i, t);
|
|
5165
|
+
if (!(!e || e.severity === "allow") && pl(n, e.rowsKey).some((t) => el(t, e))) {
|
|
5166
5166
|
if (e.severity === "block") return {
|
|
5167
5167
|
severity: "block",
|
|
5168
5168
|
message: e.message,
|
|
@@ -5181,23 +5181,23 @@ function dl(e = [], t, n) {
|
|
|
5181
5181
|
group: null
|
|
5182
5182
|
};
|
|
5183
5183
|
}
|
|
5184
|
-
function
|
|
5184
|
+
function pl(e, t) {
|
|
5185
5185
|
let n = e?.[t];
|
|
5186
5186
|
return Array.isArray(n) ? n : Array.isArray(n?.rows) ? n.rows : [];
|
|
5187
5187
|
}
|
|
5188
|
-
function
|
|
5188
|
+
function ml(e) {
|
|
5189
5189
|
return String(e?.severity ?? "").toLowerCase() === "block" ? "block" : "warn";
|
|
5190
5190
|
}
|
|
5191
|
-
function
|
|
5191
|
+
function hl(e = [], t = {}) {
|
|
5192
5192
|
let n = null;
|
|
5193
5193
|
for (let r of e) {
|
|
5194
5194
|
let e = r?.levelRule;
|
|
5195
5195
|
if (!e) continue;
|
|
5196
|
-
let i =
|
|
5196
|
+
let i = gl(t, r);
|
|
5197
5197
|
if (!i.length) continue;
|
|
5198
|
-
let a =
|
|
5198
|
+
let a = ll(i, e);
|
|
5199
5199
|
if (a) {
|
|
5200
|
-
if (
|
|
5200
|
+
if (ml(e) === "block") return {
|
|
5201
5201
|
severity: "block",
|
|
5202
5202
|
message: a,
|
|
5203
5203
|
group: r
|
|
@@ -5215,7 +5215,7 @@ function ml(e = [], t = {}) {
|
|
|
5215
5215
|
group: null
|
|
5216
5216
|
};
|
|
5217
5217
|
}
|
|
5218
|
-
function
|
|
5218
|
+
function gl(e, t) {
|
|
5219
5219
|
for (let n of [t?.name, t?.payloadKey]) {
|
|
5220
5220
|
if (!n) continue;
|
|
5221
5221
|
let t = e?.[n];
|
|
@@ -5225,10 +5225,10 @@ function hl(e, t) {
|
|
|
5225
5225
|
}
|
|
5226
5226
|
//#endregion
|
|
5227
5227
|
//#region src/components/form/clearGroupOnChange.js
|
|
5228
|
-
function
|
|
5228
|
+
function _l(e, t) {
|
|
5229
5229
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), t] : [t];
|
|
5230
5230
|
}
|
|
5231
|
-
function
|
|
5231
|
+
function vl(e, t) {
|
|
5232
5232
|
let n = e?.field, r = [];
|
|
5233
5233
|
e?.clearGroupOnChange && (t instanceof Set ? [...t] : t ?? []).forEach((e) => {
|
|
5234
5234
|
e && e !== n && r.push(e);
|
|
@@ -5238,24 +5238,24 @@ function _l(e, t) {
|
|
|
5238
5238
|
e && e !== n && r.push(e);
|
|
5239
5239
|
}) : typeof i == "string" && i.trim() && i.trim() !== n && r.push(i.trim()), [...new Set(r)];
|
|
5240
5240
|
}
|
|
5241
|
-
function
|
|
5242
|
-
let i =
|
|
5241
|
+
function yl(e, t, n, r) {
|
|
5242
|
+
let i = vl(t, r).map((e) => _l(n, e));
|
|
5243
5243
|
return i.forEach((t) => e.setFieldValue(t, null)), i;
|
|
5244
5244
|
}
|
|
5245
5245
|
//#endregion
|
|
5246
5246
|
//#region src/components/form/resolveStoredOptions.js
|
|
5247
|
-
function
|
|
5247
|
+
function bl(e) {
|
|
5248
5248
|
return (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? e.value ?? e.key ?? e.id : e).filter((e) => e != null && e !== "");
|
|
5249
5249
|
}
|
|
5250
|
-
function
|
|
5250
|
+
function xl(e, t = []) {
|
|
5251
5251
|
let n = new Set((t ?? []).map((e) => String(e?.value))), r = [];
|
|
5252
|
-
for (let t of
|
|
5252
|
+
for (let t of bl(e)) {
|
|
5253
5253
|
let e = String(t);
|
|
5254
5254
|
!n.has(e) && !r.includes(e) && r.push(e);
|
|
5255
5255
|
}
|
|
5256
5256
|
return r;
|
|
5257
5257
|
}
|
|
5258
|
-
async function
|
|
5258
|
+
async function Sl(e, t) {
|
|
5259
5259
|
if (!e?.lookupCollection || !t?.length) return [];
|
|
5260
5260
|
let n = new URLSearchParams({
|
|
5261
5261
|
collection: e.lookupCollection,
|
|
@@ -5267,7 +5267,7 @@ async function xl(e, t) {
|
|
|
5267
5267
|
let r = await a(s, `/admin/lookup-dropdown-values?${n}`), i = r?.data ?? r ?? [];
|
|
5268
5268
|
return Array.isArray(i) ? i : [];
|
|
5269
5269
|
}
|
|
5270
|
-
function
|
|
5270
|
+
function Cl(e = [], t = []) {
|
|
5271
5271
|
if (!t.length) return e;
|
|
5272
5272
|
let n = new Set((e ?? []).map((e) => String(e?.value))), r = t.filter((e) => !n.has(String(e?.value))).map((e) => ({
|
|
5273
5273
|
...e,
|
|
@@ -5276,9 +5276,36 @@ function Sl(e = [], t = []) {
|
|
|
5276
5276
|
return r.length ? [...e, ...r] : e;
|
|
5277
5277
|
}
|
|
5278
5278
|
//#endregion
|
|
5279
|
+
//#region src/components/form/requireAnyOf.js
|
|
5280
|
+
var wl = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || e === !1;
|
|
5281
|
+
function Tl(e) {
|
|
5282
|
+
let t = e?.requireAnyOf;
|
|
5283
|
+
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [];
|
|
5284
|
+
}
|
|
5285
|
+
function El(e) {
|
|
5286
|
+
return !e || typeof e != "object" ? !1 : Object.values(e).some((e) => !wl(e));
|
|
5287
|
+
}
|
|
5288
|
+
function Dl({ field: e, getRow: t }) {
|
|
5289
|
+
let n = Tl(e);
|
|
5290
|
+
if (n.length === 0 || !n.includes(e?.field)) return;
|
|
5291
|
+
let r = e.requireAnyOfMessage || `Select at least one of ${n.join(", ")}.`;
|
|
5292
|
+
return { validator: async () => {
|
|
5293
|
+
let e = t?.() ?? {};
|
|
5294
|
+
return El(e) ? n.some((t) => !wl(e[t])) ? Promise.resolve() : Promise.reject(Error(r)) : Promise.resolve();
|
|
5295
|
+
} };
|
|
5296
|
+
}
|
|
5297
|
+
function Ol(e, t = []) {
|
|
5298
|
+
let n = Tl(e);
|
|
5299
|
+
return n.length === 0 ? t : t.map((t) => n.includes(t?.field) ? {
|
|
5300
|
+
...t,
|
|
5301
|
+
requireAnyOf: n,
|
|
5302
|
+
requireAnyOfMessage: e.requireAnyOfMessage
|
|
5303
|
+
} : t);
|
|
5304
|
+
}
|
|
5305
|
+
//#endregion
|
|
5279
5306
|
//#region src/components/form/dateRules.js
|
|
5280
|
-
var
|
|
5281
|
-
function
|
|
5307
|
+
var kl = (e) => e == null || e === "";
|
|
5308
|
+
function Al(e) {
|
|
5282
5309
|
if (!e) return null;
|
|
5283
5310
|
if (typeof e.valueOf == "function") {
|
|
5284
5311
|
let t = e.valueOf();
|
|
@@ -5287,17 +5314,17 @@ function wl(e) {
|
|
|
5287
5314
|
let t = new Date(e).getTime();
|
|
5288
5315
|
return Number.isNaN(t) ? null : t;
|
|
5289
5316
|
}
|
|
5290
|
-
function
|
|
5317
|
+
function Q(e) {
|
|
5291
5318
|
if (!e) return null;
|
|
5292
5319
|
let t = T(e);
|
|
5293
5320
|
return t.isValid() ? t.startOf("day").valueOf() : null;
|
|
5294
5321
|
}
|
|
5295
|
-
function
|
|
5322
|
+
function jl(e) {
|
|
5296
5323
|
if (!e) return null;
|
|
5297
5324
|
let t = T(e);
|
|
5298
5325
|
return t.isValid() ? t.hour() * 60 + t.minute() : null;
|
|
5299
5326
|
}
|
|
5300
|
-
var
|
|
5327
|
+
var Ml = {
|
|
5301
5328
|
d: "day",
|
|
5302
5329
|
day: "day",
|
|
5303
5330
|
days: "day",
|
|
@@ -5313,13 +5340,13 @@ var El = {
|
|
|
5313
5340
|
year: "year",
|
|
5314
5341
|
years: "year"
|
|
5315
5342
|
};
|
|
5316
|
-
function
|
|
5343
|
+
function Nl(e) {
|
|
5317
5344
|
if (e == null || e === "") return null;
|
|
5318
5345
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5319
5346
|
let t = Number(e.value ?? e.count ?? e.amount);
|
|
5320
5347
|
return !Number.isFinite(t) || t <= 0 ? null : {
|
|
5321
5348
|
value: t,
|
|
5322
|
-
unit:
|
|
5349
|
+
unit: Ml[String(e.unit ?? "month").toLowerCase()] ?? "month"
|
|
5323
5350
|
};
|
|
5324
5351
|
}
|
|
5325
5352
|
let t = String(e).trim().toLowerCase();
|
|
@@ -5329,73 +5356,73 @@ function Dl(e) {
|
|
|
5329
5356
|
let r = Number(n[1]);
|
|
5330
5357
|
return !Number.isFinite(r) || r <= 0 ? null : {
|
|
5331
5358
|
value: r,
|
|
5332
|
-
unit:
|
|
5359
|
+
unit: Ml[n[2]] ?? "month"
|
|
5333
5360
|
};
|
|
5334
5361
|
}
|
|
5335
|
-
function
|
|
5362
|
+
function Pl(e, t) {
|
|
5336
5363
|
let n = e?.minGapFrom ?? e?.gapFrom;
|
|
5337
5364
|
if (n && typeof t == "function") {
|
|
5338
|
-
let e =
|
|
5365
|
+
let e = Nl(t(n));
|
|
5339
5366
|
if (e) return e;
|
|
5340
5367
|
}
|
|
5341
|
-
return
|
|
5368
|
+
return Nl(e?.minGap);
|
|
5342
5369
|
}
|
|
5343
|
-
function
|
|
5370
|
+
function Fl(e, t, n, r) {
|
|
5344
5371
|
if (t === null) return null;
|
|
5345
|
-
let i =
|
|
5372
|
+
let i = Pl(n, r), a = T(t);
|
|
5346
5373
|
return i && (a = e === "dateAfterField" ? a.add(i.value, i.unit) : a.subtract(i.value, i.unit)), a.startOf("day").valueOf();
|
|
5347
5374
|
}
|
|
5348
|
-
function
|
|
5375
|
+
function Il(e, t, n, r, i) {
|
|
5349
5376
|
if (t === null || n === null) return !1;
|
|
5350
|
-
let a =
|
|
5377
|
+
let a = Fl(e, n, r, i);
|
|
5351
5378
|
if (a === null) return !1;
|
|
5352
|
-
let o = !!r?.strict && !
|
|
5379
|
+
let o = !!r?.strict && !Pl(r, i);
|
|
5353
5380
|
return e === "dateAfterField" ? o ? t <= a : t < a : o ? t >= a : t > a;
|
|
5354
5381
|
}
|
|
5355
|
-
function
|
|
5382
|
+
function Ll(e, t, n, r) {
|
|
5356
5383
|
if (n?.message) return n.message;
|
|
5357
|
-
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a =
|
|
5384
|
+
let i = n?.value ?? n?.compareField ?? n?.field ?? "the paired date", a = Pl(n, r);
|
|
5358
5385
|
if (a) {
|
|
5359
5386
|
let n = a.value === 1 ? a.unit : `${a.unit}s`;
|
|
5360
5387
|
return e === "dateAfterField" ? `${t} must be at least ${a.value} ${n} after ${i}` : `${t} must be at least ${a.value} ${n} before ${i}`;
|
|
5361
5388
|
}
|
|
5362
5389
|
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}`;
|
|
5363
5390
|
}
|
|
5364
|
-
function
|
|
5391
|
+
function Rl({ type: e, label: t, rule: n, readSibling: r }) {
|
|
5365
5392
|
return { validator: async (i, a) => {
|
|
5366
5393
|
let o = n?.value ?? n?.compareField ?? n?.field;
|
|
5367
|
-
if (!o ||
|
|
5394
|
+
if (!o || kl(a)) return Promise.resolve();
|
|
5368
5395
|
let s = r(o);
|
|
5369
|
-
if (
|
|
5370
|
-
let c =
|
|
5371
|
-
return c === null || l === null ? Promise.resolve() :
|
|
5396
|
+
if (kl(s)) return Promise.resolve();
|
|
5397
|
+
let c = Q(a), l = Q(s);
|
|
5398
|
+
return c === null || l === null ? Promise.resolve() : Il(e, c, l, n, r) ? Promise.reject(Error(Ll(e, t, n, r))) : Promise.resolve();
|
|
5372
5399
|
} };
|
|
5373
5400
|
}
|
|
5374
|
-
function
|
|
5401
|
+
function zl(e, t, { rows: n, rowIndex: r } = {}) {
|
|
5375
5402
|
if (e === null || !t || !Array.isArray(n) || r == null || (t.mode ?? "newestFirst") !== "newestFirst") return !1;
|
|
5376
5403
|
let i = t.startField ?? "startDate", a = t.endField ?? "endDate", o = n[r - 1];
|
|
5377
5404
|
if (o) {
|
|
5378
|
-
let t =
|
|
5405
|
+
let t = Q(o[i]);
|
|
5379
5406
|
if (t !== null && e >= t) return !0;
|
|
5380
5407
|
}
|
|
5381
5408
|
let s = n[r + 1];
|
|
5382
5409
|
if (s) {
|
|
5383
|
-
let t =
|
|
5410
|
+
let t = Q(s[a]) ?? Q(s[i]);
|
|
5384
5411
|
if (t !== null && e <= t) return !0;
|
|
5385
5412
|
}
|
|
5386
5413
|
return !1;
|
|
5387
5414
|
}
|
|
5388
|
-
function
|
|
5389
|
-
let
|
|
5390
|
-
return
|
|
5415
|
+
function Bl(e, t = "above", n = void 0) {
|
|
5416
|
+
let r = e?.messages ?? {}, i = t === "below";
|
|
5417
|
+
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.");
|
|
5391
5418
|
}
|
|
5392
|
-
function
|
|
5419
|
+
function Vl({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = Xn }) {
|
|
5393
5420
|
let a = e?.validations ?? e?.validation ?? e?.rules ?? [], o = [];
|
|
5394
5421
|
for (let e of a) {
|
|
5395
5422
|
let n = typeof e == "string" ? { type: e } : e, r = n?.type;
|
|
5396
|
-
if (r === "noPastDate" && o.push((e) => e ?
|
|
5423
|
+
if (r === "noPastDate" && o.push((e) => e ? Q(e) < i().startOf("day").valueOf() : !1), r === "noFutureDate" && o.push((e) => e ? Q(e) > i().startOf("day").valueOf() : !1), r === "minAge") {
|
|
5397
5424
|
let e = Number(n?.value ?? 18);
|
|
5398
|
-
o.push((t) => t ?
|
|
5425
|
+
o.push((t) => t ? Q(t) > i().subtract(e, "year").startOf("day").valueOf() : !1);
|
|
5399
5426
|
}
|
|
5400
5427
|
if (r === "dateAfterField" || r === "dateBeforeField") {
|
|
5401
5428
|
let e = n?.value ?? n?.compareField ?? n?.field;
|
|
@@ -5403,61 +5430,91 @@ function Fl({ field: e, readSibling: t, rows: n, rowIndex: r, now: i = Zn }) {
|
|
|
5403
5430
|
o.push((i) => {
|
|
5404
5431
|
if (!i) return !1;
|
|
5405
5432
|
let a = t(e);
|
|
5406
|
-
return !
|
|
5433
|
+
return !kl(a) && Il(r, Q(i), Q(a), n, t);
|
|
5407
5434
|
});
|
|
5408
5435
|
}
|
|
5409
5436
|
}
|
|
5410
|
-
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ?
|
|
5437
|
+
return e?.rowHierarchy && Array.isArray(n) && r != null && o.push((t) => t ? zl(Q(t), e.rowHierarchy, {
|
|
5411
5438
|
rows: n,
|
|
5412
5439
|
rowIndex: r
|
|
5413
5440
|
}) : !1), o.length ? (e) => o.some((t) => t(e)) : void 0;
|
|
5414
5441
|
}
|
|
5415
|
-
function
|
|
5416
|
-
|
|
5417
|
-
|
|
5442
|
+
function Hl(e, t = Xn, n = void 0) {
|
|
5443
|
+
if (!kl(n) && Q(n) !== null) return;
|
|
5444
|
+
let r = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
5445
|
+
for (let e of r) {
|
|
5418
5446
|
let n = typeof e == "string" ? { type: e } : e;
|
|
5419
5447
|
if (n?.type === "minAge") return t().subtract(Number(n?.value ?? 18), "year");
|
|
5420
5448
|
if (n?.type === "noFutureDate" || n?.type === "noPastDate") return t();
|
|
5421
5449
|
}
|
|
5422
5450
|
}
|
|
5423
|
-
function
|
|
5451
|
+
function Ul({ field: e, name: t, rows: n }) {
|
|
5452
|
+
if (!Array.isArray(t) || t.length === 0) return [];
|
|
5453
|
+
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 ?? [];
|
|
5454
|
+
for (let e of o) {
|
|
5455
|
+
let t = typeof e == "string" ? { type: e } : e;
|
|
5456
|
+
if (t?.type === "dateBeforeField" || t?.type === "dateAfterField") {
|
|
5457
|
+
let e = t?.value ?? t?.compareField ?? t?.field;
|
|
5458
|
+
e && a.add(e);
|
|
5459
|
+
}
|
|
5460
|
+
}
|
|
5461
|
+
let s = e?.rowHierarchy, c = s?.startField ?? "startDate", l = s?.endField ?? "endDate";
|
|
5462
|
+
s && (a.add(c), a.add(l));
|
|
5463
|
+
let u = [];
|
|
5464
|
+
for (let e of a) e !== r && u.push(i ? [
|
|
5465
|
+
t[0],
|
|
5466
|
+
t[1],
|
|
5467
|
+
e
|
|
5468
|
+
] : [...t.slice(0, -1), e]);
|
|
5469
|
+
if (s && i && Array.isArray(n)) for (let e of [t[1] - 1, t[1] + 1]) e < 0 || e >= n.length || (u.push([
|
|
5470
|
+
t[0],
|
|
5471
|
+
e,
|
|
5472
|
+
c
|
|
5473
|
+
]), u.push([
|
|
5474
|
+
t[0],
|
|
5475
|
+
e,
|
|
5476
|
+
l
|
|
5477
|
+
]));
|
|
5478
|
+
return u;
|
|
5479
|
+
}
|
|
5480
|
+
function Wl({ field: e, rows: t, rowIndex: n }) {
|
|
5424
5481
|
let r = e?.rowHierarchy;
|
|
5425
|
-
return { validator: async (
|
|
5426
|
-
if (!r ||
|
|
5427
|
-
let
|
|
5428
|
-
if (
|
|
5482
|
+
return { validator: async (i, a) => {
|
|
5483
|
+
if (!r || kl(a) || !Array.isArray(t) || n == null) return Promise.resolve();
|
|
5484
|
+
let o = Q(a);
|
|
5485
|
+
if (o === null || !zl(o, r, {
|
|
5429
5486
|
rows: t,
|
|
5430
5487
|
rowIndex: n
|
|
5431
5488
|
})) return Promise.resolve();
|
|
5432
|
-
let
|
|
5433
|
-
return Promise.reject(Error(
|
|
5489
|
+
let s = r.startField ?? "startDate", c = t[n - 1], l = c ? Q(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;
|
|
5490
|
+
return Promise.reject(Error(Bl(r, u, p)));
|
|
5434
5491
|
} };
|
|
5435
5492
|
}
|
|
5436
5493
|
//#endregion
|
|
5437
5494
|
//#region src/utils/submitMessages.js
|
|
5438
|
-
function
|
|
5495
|
+
function Gl(e) {
|
|
5439
5496
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
5440
5497
|
}
|
|
5441
|
-
function
|
|
5498
|
+
function $(e) {
|
|
5442
5499
|
let t = String(e ?? "").trim();
|
|
5443
5500
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
5444
5501
|
}
|
|
5445
|
-
function
|
|
5446
|
-
return String(e).replaceAll("${module}",
|
|
5502
|
+
function Kl(e, t) {
|
|
5503
|
+
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
5447
5504
|
}
|
|
5448
|
-
function
|
|
5449
|
-
let r =
|
|
5505
|
+
function ql(e, t, n) {
|
|
5506
|
+
let r = Gl(e);
|
|
5450
5507
|
if (r?.suppress) return null;
|
|
5451
5508
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
5452
|
-
return i && String(i).trim() ?
|
|
5509
|
+
return i && String(i).trim() ? Kl(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
5453
5510
|
}
|
|
5454
|
-
function
|
|
5455
|
-
let i =
|
|
5456
|
-
return a && String(a).trim() ?
|
|
5511
|
+
function Jl(e, t, n, r) {
|
|
5512
|
+
let i = Gl(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
5513
|
+
return a && String(a).trim() ? Kl(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
5457
5514
|
}
|
|
5458
5515
|
//#endregion
|
|
5459
5516
|
//#region src/utils/scrollToFirstFormError.js
|
|
5460
|
-
function
|
|
5517
|
+
function Yl({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
5461
5518
|
if (!e?.length) return;
|
|
5462
5519
|
let r = e[0]?.name;
|
|
5463
5520
|
setTimeout(() => {
|
|
@@ -5482,10 +5539,10 @@ function Ul({ errorFields: e } = {}, t, { root: n = document } = {}) {
|
|
|
5482
5539
|
}
|
|
5483
5540
|
//#endregion
|
|
5484
5541
|
//#region src/components/form/conditionalFieldLabel.js
|
|
5485
|
-
function
|
|
5542
|
+
function Xl(e) {
|
|
5486
5543
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
5487
5544
|
}
|
|
5488
|
-
function
|
|
5545
|
+
function Zl(e, t) {
|
|
5489
5546
|
if (!e?.field) return !1;
|
|
5490
5547
|
switch (e.operator ?? "eq") {
|
|
5491
5548
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -5493,66 +5550,66 @@ function Gl(e, t) {
|
|
|
5493
5550
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
5494
5551
|
case "falsy": return t == null || t === "" || t === !1;
|
|
5495
5552
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
5496
|
-
case "in": return
|
|
5497
|
-
case "notIn": return !
|
|
5553
|
+
case "in": return Xl(e.value).includes(String(t ?? ""));
|
|
5554
|
+
case "notIn": return !Xl(e.value).includes(String(t ?? ""));
|
|
5498
5555
|
default: return !1;
|
|
5499
5556
|
}
|
|
5500
5557
|
}
|
|
5501
|
-
function
|
|
5558
|
+
function Ql(e, t, n = !1) {
|
|
5502
5559
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
5503
|
-
return
|
|
5560
|
+
return Zl(i, t) && i?.label ? i.label : r;
|
|
5504
5561
|
}
|
|
5505
|
-
function
|
|
5562
|
+
function $l(e) {
|
|
5506
5563
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
5507
5564
|
}
|
|
5508
|
-
function
|
|
5509
|
-
let n =
|
|
5565
|
+
function eu(e, t) {
|
|
5566
|
+
let n = $l(e);
|
|
5510
5567
|
if (!n.length) return !0;
|
|
5511
|
-
let r = n.map((e) =>
|
|
5568
|
+
let r = n.map((e) => Zl(e, t(e.field)));
|
|
5512
5569
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
5513
5570
|
}
|
|
5514
|
-
function
|
|
5571
|
+
function tu(e) {
|
|
5515
5572
|
let t = e?.colWhen;
|
|
5516
5573
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
5517
5574
|
}
|
|
5518
|
-
function
|
|
5519
|
-
for (let t of
|
|
5575
|
+
function nu(e, t, n) {
|
|
5576
|
+
for (let t of tu(e)) if (Zl(t, n(t))) return Number(t.col);
|
|
5520
5577
|
return t;
|
|
5521
5578
|
}
|
|
5522
|
-
function
|
|
5579
|
+
function ru(e, t) {
|
|
5523
5580
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
5524
5581
|
}
|
|
5525
5582
|
//#endregion
|
|
5526
5583
|
//#region src/components/form/conditionalRequired.js
|
|
5527
|
-
function
|
|
5584
|
+
function iu(e, t) {
|
|
5528
5585
|
return (n) => {
|
|
5529
5586
|
if (!e || !n) return;
|
|
5530
5587
|
let r = Array.isArray(t) && t.length > 1 ? [...t.slice(0, -1), n] : [n], i = e.getFieldValue(r);
|
|
5531
5588
|
return i === void 0 ? e.getFieldValue([n]) : i;
|
|
5532
5589
|
};
|
|
5533
5590
|
}
|
|
5534
|
-
function
|
|
5591
|
+
function au(e, t, n) {
|
|
5535
5592
|
let r = e?.requiredWhen;
|
|
5536
|
-
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 :
|
|
5593
|
+
return !r || !t || !r.field && !(r.conditions ?? []).some((e) => e?.field) ? !1 : eu(r, iu(t, n));
|
|
5537
5594
|
}
|
|
5538
|
-
function
|
|
5595
|
+
function ou(e, t, n) {
|
|
5539
5596
|
return { validator: (r, i) => {
|
|
5540
|
-
if (
|
|
5597
|
+
if (!au(e, t, n) || !(i == null || i === "" || Array.isArray(i) && i.length === 0)) return Promise.resolve();
|
|
5541
5598
|
let a = e?.label ?? e?.field ?? "This field";
|
|
5542
5599
|
return Promise.reject(Error(e?.requiredWhen?.message ?? `${a} is required`));
|
|
5543
5600
|
} };
|
|
5544
5601
|
}
|
|
5545
5602
|
//#endregion
|
|
5546
5603
|
//#region src/components/Breadcrumb.jsx
|
|
5547
|
-
function
|
|
5548
|
-
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(
|
|
5604
|
+
function su({ items: e = [] }) {
|
|
5605
|
+
let t = e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Sr, {
|
|
5549
5606
|
variant: "body",
|
|
5550
5607
|
weight: "medium",
|
|
5551
5608
|
color: "link",
|
|
5552
5609
|
children: t.label
|
|
5553
5610
|
}) : /* @__PURE__ */ w(ye, {
|
|
5554
5611
|
to: t.href,
|
|
5555
|
-
children: [/* @__PURE__ */ C(
|
|
5612
|
+
children: [/* @__PURE__ */ C(Sr, {
|
|
5556
5613
|
variant: "body",
|
|
5557
5614
|
color: "secondary",
|
|
5558
5615
|
children: t.label
|
|
@@ -5562,34 +5619,34 @@ function tu({ items: e = [] }) {
|
|
|
5562
5619
|
}
|
|
5563
5620
|
//#endregion
|
|
5564
5621
|
//#region src/components/form/canonicalOption.js
|
|
5565
|
-
var
|
|
5566
|
-
function
|
|
5622
|
+
var cu = (e) => String(e ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
5623
|
+
function lu(e = []) {
|
|
5567
5624
|
let t = /* @__PURE__ */ new Map();
|
|
5568
5625
|
for (let n of e) {
|
|
5569
5626
|
if (n == null) continue;
|
|
5570
5627
|
let e = typeof n == "object" ? n.value : n;
|
|
5571
5628
|
if (e != null && e !== "") for (let r of [n?.label, e]) {
|
|
5572
|
-
let n =
|
|
5629
|
+
let n = cu(r);
|
|
5573
5630
|
n && !t.has(n) && t.set(n, e);
|
|
5574
5631
|
}
|
|
5575
5632
|
}
|
|
5576
5633
|
return t;
|
|
5577
5634
|
}
|
|
5578
|
-
function
|
|
5635
|
+
function uu(e, t) {
|
|
5579
5636
|
if (!Array.isArray(e)) {
|
|
5580
|
-
let n =
|
|
5637
|
+
let n = uu([e], t);
|
|
5581
5638
|
return n.length ? n[0] : e;
|
|
5582
5639
|
}
|
|
5583
|
-
let n =
|
|
5640
|
+
let n = lu(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
5584
5641
|
for (let t of e) {
|
|
5585
|
-
let e = typeof t == "object" && t ? t.value : t, a = n.get(
|
|
5642
|
+
let e = typeof t == "object" && t ? t.value : t, a = n.get(cu(e)) ?? e, o = cu(a);
|
|
5586
5643
|
o && r.has(o) || (o && r.add(o), i.push(a));
|
|
5587
5644
|
}
|
|
5588
5645
|
return i;
|
|
5589
5646
|
}
|
|
5590
5647
|
//#endregion
|
|
5591
5648
|
//#region src/components/form/dependencyBusy.js
|
|
5592
|
-
function
|
|
5649
|
+
function du(e, t = []) {
|
|
5593
5650
|
if (!e) return [];
|
|
5594
5651
|
let n = /* @__PURE__ */ new Set();
|
|
5595
5652
|
for (let r of t) for (let t of r?.fields ?? []) if (t?.field) {
|
|
@@ -5599,16 +5656,16 @@ function au(e, t = []) {
|
|
|
5599
5656
|
}
|
|
5600
5657
|
return n.delete(e), [...n];
|
|
5601
5658
|
}
|
|
5602
|
-
function
|
|
5603
|
-
return e?.blockWhileResolving ?
|
|
5659
|
+
function fu(e, t = []) {
|
|
5660
|
+
return e?.blockWhileResolving ? du(e.field, t).length > 0 : !1;
|
|
5604
5661
|
}
|
|
5605
|
-
function
|
|
5662
|
+
function pu(e) {
|
|
5606
5663
|
let t = String(e?.label ?? "").trim();
|
|
5607
5664
|
return t ? `Applying ${t}…` : "Applying your selection…";
|
|
5608
5665
|
}
|
|
5609
|
-
function
|
|
5666
|
+
function mu(e, t = []) {
|
|
5610
5667
|
if (!e?.field) return [];
|
|
5611
|
-
let n = new Set(
|
|
5668
|
+
let n = new Set(du(e.field, t));
|
|
5612
5669
|
if (n.size === 0) return [];
|
|
5613
5670
|
let r = [];
|
|
5614
5671
|
for (let e of t) {
|
|
@@ -5617,19 +5674,19 @@ function cu(e, t = []) {
|
|
|
5617
5674
|
}
|
|
5618
5675
|
return r;
|
|
5619
5676
|
}
|
|
5620
|
-
function
|
|
5677
|
+
function hu(e) {
|
|
5621
5678
|
return String(e?.blockScope ?? "").toLowerCase() === "group";
|
|
5622
5679
|
}
|
|
5623
5680
|
//#endregion
|
|
5624
5681
|
//#region src/components/form/LinkedRecordFileField.jsx
|
|
5625
|
-
var
|
|
5626
|
-
function
|
|
5682
|
+
var gu = d(() => import("./index.js").then((e) => e.n)), _u = d(() => import("./DocumentViewer-DA2IOO5w.js").then((e) => e.n));
|
|
5683
|
+
function vu(e) {
|
|
5627
5684
|
let t = String(e ?? "").split(".").pop()?.toLowerCase();
|
|
5628
5685
|
return C(t === "pdf" ? ue : t === "doc" || t === "docx" ? fe : le, { className: "v1-file-chip__icon" });
|
|
5629
5686
|
}
|
|
5630
|
-
function
|
|
5687
|
+
function yu({ field: e, recordMeta: t }) {
|
|
5631
5688
|
let n = e?.linkedModule, r = e?.linkedFileField, i = m(() => {
|
|
5632
|
-
let r =
|
|
5689
|
+
let r = nc(n, t);
|
|
5633
5690
|
if (r) return r;
|
|
5634
5691
|
let i = e?.linkedIdField, a = i ? t?.[i] : "";
|
|
5635
5692
|
return a ? String(a) : "";
|
|
@@ -5649,7 +5706,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5649
5706
|
...e,
|
|
5650
5707
|
loading: !0
|
|
5651
5708
|
}));
|
|
5652
|
-
}),
|
|
5709
|
+
}), zr(n, i).then((t) => {
|
|
5653
5710
|
e || o({
|
|
5654
5711
|
loading: !1,
|
|
5655
5712
|
fileValue: t?.[r] ?? null
|
|
@@ -5663,7 +5720,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5663
5720
|
r,
|
|
5664
5721
|
f
|
|
5665
5722
|
]);
|
|
5666
|
-
let v = m(() => ao(a.fileValue), [a.fileValue])[0], y = !!v, b = e?.label ?? "File", x =
|
|
5723
|
+
let v = m(() => ao(a.fileValue), [a.fileValue])[0], y = !!v, b = e?.label ?? "File", x = xs(n) || "record";
|
|
5667
5724
|
if (!i) return /* @__PURE__ */ C("div", {
|
|
5668
5725
|
className: "v1-linked-file v1-linked-file--empty",
|
|
5669
5726
|
children: /* @__PURE__ */ C("span", { children: e?.unlinkedText ?? `Not available until the ${x} is set.` })
|
|
@@ -5691,7 +5748,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5691
5748
|
onClick: () => y && c(!0),
|
|
5692
5749
|
title: y ? `Preview or download ${v.name}` : ie,
|
|
5693
5750
|
children: [
|
|
5694
|
-
y ?
|
|
5751
|
+
y ? vu(v.name) : /* @__PURE__ */ C(le, { className: "v1-file-chip__icon" }),
|
|
5695
5752
|
/* @__PURE__ */ C("span", {
|
|
5696
5753
|
className: "v1-file-chip__name",
|
|
5697
5754
|
children: y ? v.name : ie
|
|
@@ -5715,7 +5772,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5715
5772
|
}),
|
|
5716
5773
|
s && te && /* @__PURE__ */ C(u, {
|
|
5717
5774
|
fallback: null,
|
|
5718
|
-
children: /* @__PURE__ */ C(
|
|
5775
|
+
children: /* @__PURE__ */ C(_u, {
|
|
5719
5776
|
open: s,
|
|
5720
5777
|
onClose: () => c(!1),
|
|
5721
5778
|
documents: [te]
|
|
@@ -5746,7 +5803,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5746
5803
|
},
|
|
5747
5804
|
children: /* @__PURE__ */ C(ne, {})
|
|
5748
5805
|
}),
|
|
5749
|
-
children: /* @__PURE__ */ C(
|
|
5806
|
+
children: /* @__PURE__ */ C(gu, {
|
|
5750
5807
|
moduleName: n,
|
|
5751
5808
|
recordId: i,
|
|
5752
5809
|
embedded: !0,
|
|
@@ -5760,7 +5817,7 @@ function pu({ field: e, recordMeta: t }) {
|
|
|
5760
5817
|
})
|
|
5761
5818
|
] });
|
|
5762
5819
|
}
|
|
5763
|
-
|
|
5820
|
+
yu.propTypes = {
|
|
5764
5821
|
field: E.shape({
|
|
5765
5822
|
label: E.string,
|
|
5766
5823
|
linkedModule: E.string,
|
|
@@ -5772,8 +5829,8 @@ pu.propTypes = {
|
|
|
5772
5829
|
reuploadWarning: E.string
|
|
5773
5830
|
}).isRequired,
|
|
5774
5831
|
recordMeta: E.object
|
|
5775
|
-
},
|
|
5832
|
+
}, yu.defaultProps = { recordMeta: void 0 };
|
|
5776
5833
|
//#endregion
|
|
5777
|
-
export {
|
|
5834
|
+
export { gc as $, Ln as $n, nn as $r, Ra as $t, Sl as A, Xt as Ai, ri as An, Et as Ar, ls as At, hl as B, kr as Bn, rt as Br, Lo as Bt, Hl as C, pt as Ci, oi as Cn, ze as Cr, Ts as Ct, Ul as D, hn as Di, ni as Dn, Ye as Dr, ms as Dt, kl as E, wn as Ei, ii as En, qt as Er, Cs as Et, dl as F, Ht as Fi, Gr as Fn, Ve as Fr, cs as Ft, Hc as G, Xn as Gn, Ct as Gr, _o as Gt, Kc as H, Sr as Hn, Gt as Hr, Po as Ht, qc as I, Kt as Ii, Lr as In, ht as Ir, zo as It, Fc as J, F as Jn, pn as Jr, Wa as Jt, zc as K, Qn as Kn, Qt as Kr, uo as Kt, Xc as L, an as Li, Rr as Ln, _t as Lr, Ho as Lt, xl as M, bn as Mi, Qr as Mn, Ut as Mr, ns as Mt, yl as N, An as Ni, qr as Nn, cn as Nr, qo as Nt, Ol as O, dn as Oi, Xr as On, Je as Or, _s as Ot, Qc as P, At as Pi, Kr as Pn, on as Pr, $o as Pt, Ac as Q, $n as Qn, He as Qr, ao as Qt, Jc as R, Br as Rn, sn as Rr, Vo as Rt, Wl as S, Wt as Si, Si as Sn, Zt as Sr, Ds as St, jl as T, Qe as Ti, ai as Tn, at as Tr, Ss as Tt, Gc as U, L as Un, yt as Ur, Fo as Ut, ul as V, Or as Vn, st as Vr, Io as Vt, Vc as W, I as Wn, vt as Wr, vo as Wt, Pc as X, Zn as Xn, Nn as Xr, Ga as Xt, Rc as Y, cr as Yn, ln as Yr, Ua as Yt, jc as Z, ar as Zn, Ie as Zr, to as Zt, Yl as _, bt as _i, Di as _n, Tn as _r, Js as _t, fu as a, yn as ai, Aa as an, Un as ar, lc as at, Vl as b, Re as bi, vi as bn, fn as br, Ws as bt, au as c, Jt as ci, Ea as cn, Ze as cr, ac as ct, ru as d, tn as di, V as dn, un as dr, cc as dt, Xe as ei, Ha as en, Gn as er, bc as et, Zl as f, et as fi, ha as fn, Pn as fr, sc as ft, $l as g, ct as gi, aa as gn, ft as gr, Ys as gt, nu as h, it as hi, oa as hn, $e as hr, Xs as ht, pu as i, Nt as ii, ka as in, Bn as ir, mc as it, Cl as j, Lt as ji, Zr as jn, kt as jr, rs as jt, Dl as k, Fn as ki, Yr as kn, ut as kr, us as kt, ou as l, Le as li, ya as ln, Cn as lr, oc as lt, eu as m, gt as mi, Ta as mn, kn as mr, Zs as mt, hu as n, M as ni, Na as nn, P as nr, dc as nt, uu as o, On as oi, K as on, tt as or, rc as ot, Ql as p, dt as pi, fa as pn, Yt as pr, $s as pt, Bc as q, tr as qn, $t as qr, q as qt, mu as r, Mt as ri, Oa as rn, Kn as rr, fc as rt, su as s, Pt as si, ba as sn, wt as sr, nc as st, yu as t, Bt as ti, Ma as tn, Wn as tr, yc as tt, tu as u, en as ui, Xi as un, mn as ur, ic as ut, Jl as v, Be as vi, ji as vn, xt as vr, qs as vt, Al as w, St as wi, si as wn, jn as wr, xs as wt, Rl as x, Vt as xi, Ci as xn, In as xr, ks as xt, ql as y, rn as yi, Ni as yn, gn as yr, Ks as yt, fl as z, Ar as zn, Sn as zr, Ro as zt };
|
|
5778
5835
|
|
|
5779
|
-
//# sourceMappingURL=LinkedRecordFileField-
|
|
5836
|
+
//# sourceMappingURL=LinkedRecordFileField-lA8vfeFk.js.map
|