@object-ui/plugin-detail 13.2.0 → 14.0.0
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/CHANGELOG.md +49 -0
- package/dist/DetailSection.d.ts.map +1 -1
- package/dist/RecordDetailDrawer.d.ts.map +1 -1
- package/dist/index.js +472 -446
- package/dist/index.umd.cjs +3 -3
- package/dist/renderers/record-alert.d.ts.map +1 -1
- package/dist/renderers/record-details.d.ts.map +1 -1
- package/dist/renderers/record-quick-actions.d.ts.map +1 -1
- package/dist/renderers/record-related-list.d.ts.map +1 -1
- package/dist/systemFields.d.ts +22 -0
- package/dist/systemFields.d.ts.map +1 -0
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -8,10 +8,10 @@ import { BooleanField as yt, CapabilityMultiSelectField as bt, LookupField as xt
|
|
|
8
8
|
import { Link as At, useParams as jt } from "react-router-dom";
|
|
9
9
|
import { Fragment as Mt, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
10
10
|
import { useFieldPermissions as Nt, usePermissions as Pt } from "@object-ui/permissions";
|
|
11
|
-
import {
|
|
12
|
-
import { deriveFieldGroupLayout as
|
|
11
|
+
import { pickLocalized as Ft, resolveFieldCurrency as It, useLocalization as Lt, useObjectTranslation as Rt } from "@object-ui/i18n";
|
|
12
|
+
import { deriveFieldGroupLayout as zt } from "@objectstack/spec/data";
|
|
13
13
|
//#region src/autoLayout.ts
|
|
14
|
-
var
|
|
14
|
+
var Bt = /* @__PURE__ */ new Set([
|
|
15
15
|
"textarea",
|
|
16
16
|
"markdown",
|
|
17
17
|
"html",
|
|
@@ -23,33 +23,33 @@ var Rt = /* @__PURE__ */ new Set([
|
|
|
23
23
|
"field:grid",
|
|
24
24
|
"field:rich-text"
|
|
25
25
|
]);
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function Vt(e) {
|
|
27
|
+
return Bt.has(e);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Ht(e, t) {
|
|
30
30
|
let n;
|
|
31
31
|
return n = e <= 3 ? 1 : e <= 8 ? 2 : e <= 15 ? 3 : 4, t !== void 0 && t < 640 ? Math.min(n, 1) : n;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type &&
|
|
33
|
+
function Ut(e, t) {
|
|
34
|
+
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type && Vt(e.type) ? {
|
|
35
35
|
...e,
|
|
36
36
|
span: t
|
|
37
37
|
} : e);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Wt(e, t, n) {
|
|
40
40
|
if (t !== void 0) return {
|
|
41
|
-
fields:
|
|
41
|
+
fields: Ut(e, t),
|
|
42
42
|
columns: t
|
|
43
43
|
};
|
|
44
|
-
let r =
|
|
44
|
+
let r = Ht(e.length, n);
|
|
45
45
|
return {
|
|
46
|
-
fields:
|
|
46
|
+
fields: Ut(e, r),
|
|
47
47
|
columns: r
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/useDetailTranslation.ts
|
|
52
|
-
function
|
|
52
|
+
function Gt(e, t) {
|
|
53
53
|
return function() {
|
|
54
54
|
try {
|
|
55
55
|
let n = mt();
|
|
@@ -67,7 +67,7 @@ function Ut(e, t) {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
var
|
|
70
|
+
var Kt = {
|
|
71
71
|
"detail.back": "Back",
|
|
72
72
|
"detail.edit": "Edit",
|
|
73
73
|
"detail.editInline": "Edit",
|
|
@@ -194,10 +194,10 @@ var Wt = {
|
|
|
194
194
|
"detail.concurrentUpdateReload": "Reload latest",
|
|
195
195
|
"detail.concurrentUpdateOverwrite": "Overwrite anyway",
|
|
196
196
|
"detail.concurrentUpdateCancel": "Cancel"
|
|
197
|
-
}, $ =
|
|
197
|
+
}, $ = Gt(Kt, "detail.back");
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/renderers/PermissionFacetLink.tsx
|
|
200
|
-
function
|
|
200
|
+
function qt(e) {
|
|
201
201
|
if (typeof e == "string") {
|
|
202
202
|
let t = e.trim();
|
|
203
203
|
if (!t) return null;
|
|
@@ -209,12 +209,12 @@ function Gt(e) {
|
|
|
209
209
|
}
|
|
210
210
|
return e ?? null;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
let t =
|
|
212
|
+
function Jt(e) {
|
|
213
|
+
let t = qt(e);
|
|
214
214
|
return t == null || t === "" ? 0 : Array.isArray(t) ? t.length : typeof t == "object" ? Object.keys(t).length : 1;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
let { t: n } = $(), r = ht(), { appName: i } = jt(), a = t?.name || "", o = r?.data?.name, s = i && o ? `/apps/${i}/metadata/permission/${encodeURIComponent(String(o))}` : null, c =
|
|
216
|
+
function Yt({ value: e, field: t }) {
|
|
217
|
+
let { t: n } = $(), r = ht(), { appName: i } = jt(), a = t?.name || "", o = r?.data?.name, s = i && o ? `/apps/${i}/metadata/permission/${encodeURIComponent(String(o))}` : null, c = Jt(e), l = c === 0;
|
|
218
218
|
return /* @__PURE__ */ Q("span", {
|
|
219
219
|
className: "inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",
|
|
220
220
|
children: [(() => {
|
|
@@ -274,26 +274,46 @@ function qt({ value: e, field: t }) {
|
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
//#endregion
|
|
277
|
+
//#region src/systemFields.ts
|
|
278
|
+
var Xt = /* @__PURE__ */ new Set([
|
|
279
|
+
"id",
|
|
280
|
+
"_id",
|
|
281
|
+
"__v",
|
|
282
|
+
"created",
|
|
283
|
+
"created_at",
|
|
284
|
+
"createdAt",
|
|
285
|
+
"created_by",
|
|
286
|
+
"modified",
|
|
287
|
+
"modified_by",
|
|
288
|
+
"updated_at",
|
|
289
|
+
"updatedAt",
|
|
290
|
+
"updated_by",
|
|
291
|
+
"deleted_at",
|
|
292
|
+
"is_deleted",
|
|
293
|
+
"deleted",
|
|
294
|
+
"instance_state"
|
|
295
|
+
]);
|
|
296
|
+
//#endregion
|
|
277
297
|
//#region src/DetailSection.tsx
|
|
278
|
-
function
|
|
298
|
+
function Zt(e, t) {
|
|
279
299
|
return !e || e <= 1 || t <= 1 ? "" : t === 2 ? e >= 2 ? "md:col-span-2" : "" : t === 3 ? e === 2 ? "md:col-span-2" : e >= 3 ? "md:col-span-2 lg:col-span-3" : "" : e === 2 ? "md:col-span-2" : e === 3 ? "md:col-span-2 lg:col-span-3" : e >= 4 ? "md:col-span-2 lg:col-span-3 xl:col-span-4" : "";
|
|
280
300
|
}
|
|
281
|
-
var
|
|
301
|
+
var Qt = /* @__PURE__ */ new Set([
|
|
282
302
|
"formula",
|
|
283
303
|
"summary",
|
|
284
304
|
"rollup",
|
|
285
305
|
"auto_number"
|
|
286
306
|
]);
|
|
287
|
-
function
|
|
307
|
+
function $t(e) {
|
|
288
308
|
if (e == null) return e;
|
|
289
|
-
if (Array.isArray(e)) return e.map(
|
|
309
|
+
if (Array.isArray(e)) return e.map($t);
|
|
290
310
|
if (typeof e == "object") {
|
|
291
311
|
let t = e;
|
|
292
312
|
return t.id ?? t._id ?? t.value ?? "";
|
|
293
313
|
}
|
|
294
314
|
return e;
|
|
295
315
|
}
|
|
296
|
-
var
|
|
316
|
+
var en = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, isEditing: o = !1, onFieldChange: s, onEnterInlineEdit: c, autoFocusField: l, dataSource: u, virtualScroll: d }) => {
|
|
297
317
|
let [f, p] = i.useState(e.defaultCollapsed ?? !1), [m, h] = i.useState(null), [g, _] = i.useState(void 0), [v, y] = i.useState(!1), { t: b } = $(), { fieldLabel: k, translateOptions: A } = vt(), j = i.useCallback((e, t) => {
|
|
298
318
|
let n = t == null ? "" : String(t);
|
|
299
319
|
navigator.clipboard.writeText(n).then(() => {
|
|
@@ -302,7 +322,7 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
302
322
|
}, []), M = i.useCallback((e) => {
|
|
303
323
|
let n = t?.[e.name] ?? e.value;
|
|
304
324
|
return n == null || n === "";
|
|
305
|
-
}, [t]), N = i.useMemo(() => e.fields.filter(M).length, [e.fields, M]), P = oe(), F = P ? 3 : 4, ee = P ? .2 : .25, te = e.fields.length - N, ne = !e.hideEmpty && !o && e.fields.length >= F && N / e.fields.length >= ee && te > 0, re = !v && (e.hideEmpty || ne) ? e.fields.filter((e) => !M(e)) : e.fields, { fields: ie, columns: I } =
|
|
325
|
+
}, [t]), N = i.useMemo(() => e.fields.filter(M).length, [e.fields, M]), P = oe(), F = P ? 3 : 4, ee = P ? .2 : .25, te = e.fields.length - N, ne = !e.hideEmpty && !o && e.fields.length >= F && N / e.fields.length >= ee && te > 0, re = !v && (e.hideEmpty || ne) ? e.fields.filter((e) => !M(e)) : e.fields, { fields: ie, columns: I } = Wt(re, e.columns), L = Math.min(I, Math.max(1, re.length)), R = (e) => {
|
|
306
326
|
let n = t?.[e.name] ?? e.value;
|
|
307
327
|
if (e.render) return /* @__PURE__ */ Z(ot, {
|
|
308
328
|
schema: e.render,
|
|
@@ -311,15 +331,15 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
311
331
|
value: n
|
|
312
332
|
}
|
|
313
333
|
});
|
|
314
|
-
let i =
|
|
334
|
+
let i = Zt(e.span, L), d = r?.fields?.[e.name], f = { ...e };
|
|
315
335
|
if (d) {
|
|
316
336
|
!e.type && d.type && (f.type = d.type), d.options && !f.options && (f.options = d.options), d.currency && !f.currency && (f.currency = d.currency), d.precision !== void 0 && f.precision === void 0 && (f.precision = d.precision), d.scale !== void 0 && f.scale === void 0 && (f.scale = d.scale), d.format && !f.format && (f.format = d.format), d.widget && !f.widget && (f.widget = d.widget);
|
|
317
337
|
let t = d.reference_to || d.reference;
|
|
318
338
|
t && !f.reference_to && (f.reference_to = t), d.reference_field && !f.reference_field && (f.reference_field = d.reference_field), d.dueLike !== void 0 && f.dueLike === void 0 && (f.dueLike = d.dueLike);
|
|
319
339
|
}
|
|
320
340
|
a && Array.isArray(f.options) && f.options.length > 0 && (f.options = A(a, e.name, f.options));
|
|
321
|
-
let p = f.type || e.type, h =
|
|
322
|
-
if ((f.widget || e.widget) === "permission-facet-link") return /* @__PURE__ */ Z(
|
|
341
|
+
let p = f.type || e.type, h = Qt.has(p), g = e.readonly === !0 || d?.readonly === !0, _ = Xt.has(e.name), v = !g && !h && !_, y = v && !!c, S = (() => {
|
|
342
|
+
if ((f.widget || e.widget) === "permission-facet-link") return /* @__PURE__ */ Z(Yt, {
|
|
323
343
|
value: n,
|
|
324
344
|
field: f
|
|
325
345
|
});
|
|
@@ -338,32 +358,32 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
338
358
|
});
|
|
339
359
|
}
|
|
340
360
|
return String(n);
|
|
341
|
-
})(),
|
|
342
|
-
return P && !(o &&
|
|
343
|
-
className: G("flex items-baseline justify-between gap-4 py-2.5 min-h-[44px] group",
|
|
344
|
-
onClick:
|
|
345
|
-
onKeyDown:
|
|
361
|
+
})(), C = n != null && n !== "", w = C && !y, T = m === e.name, E = k(a || "", e.name, e.label || e.name);
|
|
362
|
+
return P && !(o && v) ? /* @__PURE__ */ Q("div", {
|
|
363
|
+
className: G("flex items-baseline justify-between gap-4 py-2.5 min-h-[44px] group", C && "cursor-pointer active:bg-muted/40 transition-colors"),
|
|
364
|
+
onClick: C ? () => j(e.name, n) : void 0,
|
|
365
|
+
onKeyDown: C ? (t) => {
|
|
346
366
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), j(e.name, n));
|
|
347
367
|
} : void 0,
|
|
348
|
-
role:
|
|
349
|
-
tabIndex:
|
|
368
|
+
role: C ? "button" : void 0,
|
|
369
|
+
tabIndex: C ? 0 : void 0,
|
|
350
370
|
children: [/* @__PURE__ */ Z("span", {
|
|
351
371
|
className: "text-[15px] text-muted-foreground shrink-0",
|
|
352
|
-
children:
|
|
372
|
+
children: E
|
|
353
373
|
}), /* @__PURE__ */ Z("span", {
|
|
354
374
|
className: "text-[15px] text-foreground text-right break-words min-w-0 leading-snug",
|
|
355
|
-
children:
|
|
375
|
+
children: S
|
|
356
376
|
})]
|
|
357
377
|
}, e.name) : /* @__PURE__ */ Q("div", {
|
|
358
378
|
className: G("space-y-1.5 group min-w-0", i),
|
|
359
379
|
children: [/* @__PURE__ */ Z("div", {
|
|
360
380
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
361
381
|
children: k(a || "", e.name, e.label || e.name)
|
|
362
|
-
}), o &&
|
|
382
|
+
}), o && v ? /* @__PURE__ */ Z("div", {
|
|
363
383
|
className: "min-h-[44px] sm:min-h-0",
|
|
364
384
|
children: (() => {
|
|
365
385
|
let t = f.type || e.type, r = f.widget || e.widget;
|
|
366
|
-
if (r === "permission-facet-link") return /* @__PURE__ */ Z(
|
|
386
|
+
if (r === "permission-facet-link") return /* @__PURE__ */ Z(Yt, {
|
|
367
387
|
value: n,
|
|
368
388
|
field: f
|
|
369
389
|
});
|
|
@@ -383,10 +403,10 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
383
403
|
value: !!n,
|
|
384
404
|
onChange: (t) => s?.(e.name, t)
|
|
385
405
|
});
|
|
386
|
-
let i = t === "user" || t === "owner", a = t === "lookup" || t === "master_detail" || t === "tree" || !!f.reference_to && !
|
|
406
|
+
let i = t === "user" || t === "owner", a = t === "lookup" || t === "master_detail" || t === "tree" || !!f.reference_to && !Qt.has(t);
|
|
387
407
|
if (i || a) return /* @__PURE__ */ Z(i ? wt : xt, {
|
|
388
408
|
field: f,
|
|
389
|
-
value:
|
|
409
|
+
value: $t(n),
|
|
390
410
|
onChange: (t) => s?.(e.name, t),
|
|
391
411
|
dataSource: u
|
|
392
412
|
});
|
|
@@ -411,19 +431,19 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
411
431
|
});
|
|
412
432
|
})()
|
|
413
433
|
}) : /* @__PURE__ */ Q("div", {
|
|
414
|
-
className: G("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md",
|
|
415
|
-
onClick:
|
|
416
|
-
onDoubleClick:
|
|
417
|
-
onKeyDown:
|
|
434
|
+
className: G("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md", w && "cursor-pointer active:bg-muted/60 transition-colors", y && "cursor-pointer hover:bg-muted/40 transition-colors -mx-1.5 px-1.5"),
|
|
435
|
+
onClick: w ? () => j(e.name, n) : void 0,
|
|
436
|
+
onDoubleClick: y ? () => c?.(e.name) : void 0,
|
|
437
|
+
onKeyDown: w ? (t) => {
|
|
418
438
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), j(e.name, n));
|
|
419
439
|
} : void 0,
|
|
420
|
-
role:
|
|
421
|
-
tabIndex:
|
|
422
|
-
title:
|
|
440
|
+
role: w ? "button" : void 0,
|
|
441
|
+
tabIndex: w ? 0 : void 0,
|
|
442
|
+
title: y ? b("detail.editInlineHint") : void 0,
|
|
423
443
|
children: [/* @__PURE__ */ Z("div", {
|
|
424
444
|
className: "text-sm flex-1 min-w-0 break-words py-1",
|
|
425
|
-
children:
|
|
426
|
-
}),
|
|
445
|
+
children: S
|
|
446
|
+
}), y ? /* @__PURE__ */ Z(ae, { children: /* @__PURE__ */ Q(V, { children: [/* @__PURE__ */ Z(U, {
|
|
427
447
|
asChild: !0,
|
|
428
448
|
children: /* @__PURE__ */ Z(x, {
|
|
429
449
|
variant: "ghost",
|
|
@@ -435,7 +455,7 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
435
455
|
},
|
|
436
456
|
children: /* @__PURE__ */ Z(We, { className: "h-3 w-3" })
|
|
437
457
|
})
|
|
438
|
-
}), /* @__PURE__ */ Z(H, { children: b("detail.editInlineHint") })] }) }) :
|
|
458
|
+
}), /* @__PURE__ */ Z(H, { children: b("detail.editInlineHint") })] }) }) : C ? /* @__PURE__ */ Z(ae, { children: /* @__PURE__ */ Q(V, { children: [/* @__PURE__ */ Z(U, {
|
|
439
459
|
asChild: !0,
|
|
440
460
|
children: /* @__PURE__ */ Z(x, {
|
|
441
461
|
variant: "ghost",
|
|
@@ -444,9 +464,9 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
444
464
|
onClick: (t) => {
|
|
445
465
|
t.stopPropagation(), j(e.name, n);
|
|
446
466
|
},
|
|
447
|
-
children:
|
|
467
|
+
children: T ? /* @__PURE__ */ Z(he, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(we, { className: "h-3 w-3" })
|
|
448
468
|
})
|
|
449
|
-
}), /* @__PURE__ */ Z(H, { children: b(
|
|
469
|
+
}), /* @__PURE__ */ Z(H, { children: b(T ? "detail.copied" : "detail.copyToClipboard") })] }) }) : null]
|
|
450
470
|
})]
|
|
451
471
|
}, e.name);
|
|
452
472
|
}, z = d?.enabled === !0, B = d?.batchSize ?? 20;
|
|
@@ -541,7 +561,7 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
541
561
|
children: K
|
|
542
562
|
})]
|
|
543
563
|
});
|
|
544
|
-
},
|
|
564
|
+
}, tn = ({ tabs: e, data: t, className: n }) => {
|
|
545
565
|
let [r, a] = i.useState(e[0]?.key), o = e.filter((e) => typeof e.visible == "boolean" ? e.visible : (e.visible, !0));
|
|
546
566
|
return /* @__PURE__ */ Q(L, {
|
|
547
567
|
value: r,
|
|
@@ -586,13 +606,13 @@ var Zt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
586
606
|
};
|
|
587
607
|
//#endregion
|
|
588
608
|
//#region src/RelatedList.tsx
|
|
589
|
-
function
|
|
609
|
+
function nn(e) {
|
|
590
610
|
return e && at[e.split(/[-_\s]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] || X;
|
|
591
611
|
}
|
|
592
|
-
var
|
|
612
|
+
var rn = ({ action: e, onToolbarAction: t }) => {
|
|
593
613
|
let n = e.visible, r = lt(st(n));
|
|
594
614
|
if (n && !r) return null;
|
|
595
|
-
let i = e.icon ?
|
|
615
|
+
let i = e.icon ? nn(e.icon) : null;
|
|
596
616
|
return /* @__PURE__ */ Q(x, {
|
|
597
617
|
variant: e.variant === "primary" ? "default" : "outline",
|
|
598
618
|
size: "sm",
|
|
@@ -603,7 +623,7 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
603
623
|
"data-testid": `related-toolbar-action-${e.name}`,
|
|
604
624
|
children: [i && /* @__PURE__ */ Z(i, { className: "h-3.5 w-3.5" }), e.label || e.name]
|
|
605
625
|
});
|
|
606
|
-
},
|
|
626
|
+
}, an = ({ title: e, type: t, api: n, data: r, schema: a, columns: o, className: s, dataSource: g, objectName: _, onNew: v, onViewAll: y, onRowEdit: E, onRowDelete: D, onRowClick: O, rowActions: k, onRowAction: j, toolbarActions: M, onToolbarAction: N, add: P, maxColumns: F = 6, pageSize: ee, sortable: te = !1, filterable: ne = !1, collapsible: re = !1, defaultCollapsed: ie = !1, referenceField: I, parentId: L, icon: R }) => {
|
|
607
627
|
let z = r !== void 0, B = r ?? [], [V, H] = i.useState(B), [ae, U] = i.useState(() => !!n && !z), [W, se] = i.useState(0), [K, ce] = i.useState(null), [q, le] = i.useState("asc"), [de, fe] = i.useState(""), [J, pe] = i.useState(null), [me, he] = i.useState(ie), [ge, be] = i.useState(!1), [xe, Se] = i.useState(!1), [Ce, we] = i.useState(null), [Te, De] = i.useState(0), [Oe, ke] = i.useState({}), { t: Y } = $(), { fieldLabel: Ae } = vt();
|
|
608
628
|
i.useEffect(() => {
|
|
609
629
|
z && H(r ?? []);
|
|
@@ -765,10 +785,10 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
765
785
|
]), Ve = Pt(), He = i.useMemo(() => {
|
|
766
786
|
let e = _ || n || "", t = (t) => !Ve?.isLoaded || !e ? t : t.filter((t) => {
|
|
767
787
|
let n = t?.accessorKey || t?.field || t?.name;
|
|
768
|
-
return n
|
|
788
|
+
return !n || Ve.checkField(e, String(n), "read");
|
|
769
789
|
}), r = (e) => I ? e.filter((e) => (e?.accessorKey || e?.field || e?.name) !== I) : e, a = (e) => e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0, s = (e) => V.length ? e.filter((e) => {
|
|
770
790
|
let t = e?.accessorKey || e?.field || e?.name;
|
|
771
|
-
return t
|
|
791
|
+
return !t || V.some((e) => !a(e?.[t]));
|
|
772
792
|
}) : e, c = (e, t) => {
|
|
773
793
|
if (!t?.type) return;
|
|
774
794
|
let n = Et(kt({
|
|
@@ -933,7 +953,7 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
933
953
|
O,
|
|
934
954
|
Ge,
|
|
935
955
|
n
|
|
936
|
-
]), Je = re ? "cursor-pointer select-none" : void 0, Ye = re ? () => he((e) => !e) : void 0, Xe =
|
|
956
|
+
]), Je = re ? "cursor-pointer select-none" : void 0, Ye = re ? () => he((e) => !e) : void 0, Xe = nn(R), Ze = !ae && V.length === 0, Qe = ne;
|
|
937
957
|
return /* @__PURE__ */ Q(S, {
|
|
938
958
|
className: G("shadow-none border-border/60 bg-transparent", Ze && "bg-muted/10", s),
|
|
939
959
|
children: [
|
|
@@ -968,7 +988,7 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
968
988
|
}), /* @__PURE__ */ Q("div", {
|
|
969
989
|
className: "flex items-center gap-1 shrink-0",
|
|
970
990
|
children: [
|
|
971
|
-
N && (M ?? []).map((e) => /* @__PURE__ */ Z(
|
|
991
|
+
N && (M ?? []).map((e) => /* @__PURE__ */ Z(rn, {
|
|
972
992
|
action: e,
|
|
973
993
|
onToolbarAction: N
|
|
974
994
|
}, e.name)),
|
|
@@ -1101,10 +1121,10 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
1101
1121
|
})
|
|
1102
1122
|
]
|
|
1103
1123
|
});
|
|
1104
|
-
},
|
|
1124
|
+
}, on = ({ group: e, data: t, className: n, objectSchema: r, objectName: a, isEditing: o = !1, onFieldChange: s, onEnterInlineEdit: c, autoFocusField: l, dataSource: u }) => {
|
|
1105
1125
|
let d = e.collapsible ?? !0, [f, p] = i.useState(e.defaultCollapsed ?? !1), m = /* @__PURE__ */ Z("div", {
|
|
1106
1126
|
className: "space-y-3 sm:space-y-4",
|
|
1107
|
-
children: e.sections.map((e, n) => /* @__PURE__ */ Z(
|
|
1127
|
+
children: e.sections.map((e, n) => /* @__PURE__ */ Z(en, {
|
|
1108
1128
|
section: e,
|
|
1109
1129
|
data: t,
|
|
1110
1130
|
objectSchema: r,
|
|
@@ -1167,7 +1187,7 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
1167
1187
|
m
|
|
1168
1188
|
]
|
|
1169
1189
|
});
|
|
1170
|
-
},
|
|
1190
|
+
}, sn = ({ fields: e, data: t, className: n, objectName: r, objectSchema: i }) => {
|
|
1171
1191
|
let { fieldLabel: a } = vt();
|
|
1172
1192
|
if (!e.length || !t) return null;
|
|
1173
1193
|
let o = e.filter((e) => {
|
|
@@ -1222,7 +1242,7 @@ var en = ({ action: e, onToolbarAction: t }) => {
|
|
|
1222
1242
|
};
|
|
1223
1243
|
//#endregion
|
|
1224
1244
|
//#region src/RecordComments.tsx
|
|
1225
|
-
function
|
|
1245
|
+
function cn(e) {
|
|
1226
1246
|
try {
|
|
1227
1247
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
1228
1248
|
if (r < 1) return "just now";
|
|
@@ -1235,7 +1255,7 @@ function an(e) {
|
|
|
1235
1255
|
return e;
|
|
1236
1256
|
}
|
|
1237
1257
|
}
|
|
1238
|
-
var
|
|
1258
|
+
var ln = ({ comments: e, onAddComment: t, onTogglePin: n, searchable: r = !1, className: a }) => {
|
|
1239
1259
|
let { t: o } = $(), [s, c] = i.useState(""), [l, u] = i.useState(!1), [d, f] = i.useState(""), p = i.useCallback(async () => {
|
|
1240
1260
|
let e = s.trim();
|
|
1241
1261
|
if (!(!e || !t)) {
|
|
@@ -1341,7 +1361,7 @@ var on = ({ comments: e, onAddComment: t, onTogglePin: n, searchable: r = !1, cl
|
|
|
1341
1361
|
}),
|
|
1342
1362
|
/* @__PURE__ */ Z("span", {
|
|
1343
1363
|
className: "text-xs text-muted-foreground",
|
|
1344
|
-
children:
|
|
1364
|
+
children: cn(e.createdAt)
|
|
1345
1365
|
}),
|
|
1346
1366
|
e.pinned && /* @__PURE__ */ Q("span", {
|
|
1347
1367
|
className: "text-xs text-amber-600 flex items-center gap-0.5",
|
|
@@ -1367,20 +1387,20 @@ var on = ({ comments: e, onAddComment: t, onTogglePin: n, searchable: r = !1, cl
|
|
|
1367
1387
|
]
|
|
1368
1388
|
})]
|
|
1369
1389
|
});
|
|
1370
|
-
},
|
|
1390
|
+
}, un = {
|
|
1371
1391
|
field_change: Te,
|
|
1372
1392
|
create: Je,
|
|
1373
1393
|
delete: tt,
|
|
1374
1394
|
comment: ze,
|
|
1375
1395
|
status_change: le
|
|
1376
|
-
},
|
|
1396
|
+
}, dn = {
|
|
1377
1397
|
field_change: "bg-blue-100 text-blue-600",
|
|
1378
1398
|
create: "bg-green-100 text-green-600",
|
|
1379
1399
|
delete: "bg-red-100 text-red-600",
|
|
1380
1400
|
comment: "bg-purple-100 text-purple-600",
|
|
1381
1401
|
status_change: "bg-amber-100 text-amber-600"
|
|
1382
1402
|
};
|
|
1383
|
-
function
|
|
1403
|
+
function fn(e) {
|
|
1384
1404
|
try {
|
|
1385
1405
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
1386
1406
|
if (r < 1) return "just now";
|
|
@@ -1393,17 +1413,17 @@ function ln(e) {
|
|
|
1393
1413
|
return e;
|
|
1394
1414
|
}
|
|
1395
1415
|
}
|
|
1396
|
-
function
|
|
1416
|
+
function pn(e) {
|
|
1397
1417
|
return e.description ? e.description : e.type === "field_change" && e.field ? `Changed ${e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " ")} from "${e.oldValue == null ? "(empty)" : String(e.oldValue)}" to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : e.type === "create" ? "Created this record" : e.type === "delete" ? "Deleted this record" : e.type === "status_change" && e.field ? `Changed status to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : "Updated record";
|
|
1398
1418
|
}
|
|
1399
|
-
var
|
|
1419
|
+
var mn = {
|
|
1400
1420
|
all: "All",
|
|
1401
1421
|
field_change: "Field Changes",
|
|
1402
1422
|
create: "Creates",
|
|
1403
1423
|
delete: "Deletes",
|
|
1404
1424
|
comment: "Comments",
|
|
1405
1425
|
status_change: "Status Changes"
|
|
1406
|
-
},
|
|
1426
|
+
}, hn = ({ activities: e, filterable: t = !1, defaultFilter: n = "all", className: r }) => {
|
|
1407
1427
|
let [a, o] = i.useState(n), s = i.useMemo(() => a === "all" ? e : e.filter((e) => e.type === a), [e, a]);
|
|
1408
1428
|
return /* @__PURE__ */ Q(S, {
|
|
1409
1429
|
className: G("", r),
|
|
@@ -1425,12 +1445,12 @@ var dn = {
|
|
|
1425
1445
|
className: "flex flex-wrap gap-1.5 mb-4",
|
|
1426
1446
|
role: "group",
|
|
1427
1447
|
"aria-label": "Activity type filter",
|
|
1428
|
-
children: Object.keys(
|
|
1448
|
+
children: Object.keys(mn).map((e) => /* @__PURE__ */ Q("button", {
|
|
1429
1449
|
type: "button",
|
|
1430
1450
|
className: G("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors", a === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80"),
|
|
1431
1451
|
onClick: () => o(e),
|
|
1432
1452
|
"aria-pressed": a === e,
|
|
1433
|
-
children: [e !== "all" && i.createElement(
|
|
1453
|
+
children: [e !== "all" && i.createElement(un[e] || Te, { className: "h-3 w-3" }), mn[e]]
|
|
1434
1454
|
}, e))
|
|
1435
1455
|
}), s.length === 0 ? /* @__PURE__ */ Z(k, {
|
|
1436
1456
|
title: "No activity recorded",
|
|
@@ -1440,11 +1460,11 @@ var dn = {
|
|
|
1440
1460
|
children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
|
|
1441
1461
|
className: "space-y-4",
|
|
1442
1462
|
children: s.map((e) => {
|
|
1443
|
-
let t =
|
|
1463
|
+
let t = un[e.type] || Te;
|
|
1444
1464
|
return /* @__PURE__ */ Q("div", {
|
|
1445
1465
|
className: "flex gap-3 relative",
|
|
1446
1466
|
children: [/* @__PURE__ */ Z("div", {
|
|
1447
|
-
className: G("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10",
|
|
1467
|
+
className: G("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", dn[e.type] || "bg-gray-100 text-gray-600"),
|
|
1448
1468
|
children: /* @__PURE__ */ Z(t, { className: "h-3.5 w-3.5" })
|
|
1449
1469
|
}), /* @__PURE__ */ Q("div", {
|
|
1450
1470
|
className: "flex-1 min-w-0 pt-1",
|
|
@@ -1458,12 +1478,12 @@ var dn = {
|
|
|
1458
1478
|
" ",
|
|
1459
1479
|
/* @__PURE__ */ Z("span", {
|
|
1460
1480
|
className: "text-muted-foreground",
|
|
1461
|
-
children:
|
|
1481
|
+
children: pn(e)
|
|
1462
1482
|
})
|
|
1463
1483
|
]
|
|
1464
1484
|
}), /* @__PURE__ */ Z("p", {
|
|
1465
1485
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
1466
|
-
children:
|
|
1486
|
+
children: fn(e.timestamp)
|
|
1467
1487
|
})]
|
|
1468
1488
|
})]
|
|
1469
1489
|
}, e.id);
|
|
@@ -1471,7 +1491,7 @@ var dn = {
|
|
|
1471
1491
|
})]
|
|
1472
1492
|
})] })]
|
|
1473
1493
|
});
|
|
1474
|
-
},
|
|
1494
|
+
}, gn = {
|
|
1475
1495
|
create: "default",
|
|
1476
1496
|
update: "secondary",
|
|
1477
1497
|
delete: "destructive",
|
|
@@ -1483,12 +1503,12 @@ var dn = {
|
|
|
1483
1503
|
export: "outline",
|
|
1484
1504
|
import: "outline"
|
|
1485
1505
|
};
|
|
1486
|
-
function
|
|
1506
|
+
function _n(e) {
|
|
1487
1507
|
if (!e) return "";
|
|
1488
1508
|
let t = e instanceof Date ? e : new Date(e);
|
|
1489
1509
|
return Number.isNaN(t.getTime()) ? String(e) : t.toLocaleString();
|
|
1490
1510
|
}
|
|
1491
|
-
var
|
|
1511
|
+
var vn = [
|
|
1492
1512
|
[60, "second"],
|
|
1493
1513
|
[60, "minute"],
|
|
1494
1514
|
[24, "hour"],
|
|
@@ -1497,27 +1517,27 @@ var hn = [
|
|
|
1497
1517
|
[12, "month"],
|
|
1498
1518
|
[Infinity, "year"]
|
|
1499
1519
|
];
|
|
1500
|
-
function
|
|
1520
|
+
function yn(e, t) {
|
|
1501
1521
|
if (!e) return "";
|
|
1502
1522
|
let n = e instanceof Date ? e : new Date(e);
|
|
1503
1523
|
if (Number.isNaN(n.getTime())) return String(e);
|
|
1504
1524
|
let r = (n.getTime() - Date.now()) / 1e3;
|
|
1505
|
-
for (let [n, i] of
|
|
1525
|
+
for (let [n, i] of vn) {
|
|
1506
1526
|
if (Math.abs(r) < n) try {
|
|
1507
1527
|
return new Intl.RelativeTimeFormat(t, { numeric: "auto" }).format(Math.round(r), i);
|
|
1508
1528
|
} catch {
|
|
1509
|
-
return
|
|
1529
|
+
return _n(e);
|
|
1510
1530
|
}
|
|
1511
1531
|
r /= n;
|
|
1512
1532
|
}
|
|
1513
|
-
return
|
|
1533
|
+
return _n(e);
|
|
1514
1534
|
}
|
|
1515
|
-
function
|
|
1535
|
+
function bn(e) {
|
|
1516
1536
|
if (!e) return "?";
|
|
1517
1537
|
let t = e.trim().split(/\s+/).filter(Boolean).slice(0, 2);
|
|
1518
1538
|
return t.length === 0 ? "?" : t.map((e) => e.charAt(0).toUpperCase()).join("");
|
|
1519
1539
|
}
|
|
1520
|
-
function
|
|
1540
|
+
function xn(e) {
|
|
1521
1541
|
if (e == null || e === "") return "—";
|
|
1522
1542
|
if (typeof e == "string") return e;
|
|
1523
1543
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
@@ -1527,7 +1547,7 @@ function vn(e) {
|
|
|
1527
1547
|
return String(e);
|
|
1528
1548
|
}
|
|
1529
1549
|
}
|
|
1530
|
-
function
|
|
1550
|
+
function Sn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
1531
1551
|
return t ? /* @__PURE__ */ Z("div", {
|
|
1532
1552
|
className: G("space-y-3", r),
|
|
1533
1553
|
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ Q("div", {
|
|
@@ -1545,7 +1565,7 @@ function yn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1545
1565
|
children: /* @__PURE__ */ Z("ol", {
|
|
1546
1566
|
className: G("space-y-4", r),
|
|
1547
1567
|
children: e.map((e, t) => {
|
|
1548
|
-
let n = (e.action ?? "").toLowerCase(), r =
|
|
1568
|
+
let n = (e.action ?? "").toLowerCase(), r = gn[n] ?? "outline", a = typeof e.user_name == "string" && e.user_name.trim() || "Unknown user", o = _n(e.created_at), s = yn(e.created_at, i), c = typeof e.user_avatar == "string" ? e.user_avatar : void 0;
|
|
1549
1569
|
return /* @__PURE__ */ Q("li", {
|
|
1550
1570
|
className: "flex items-start gap-3",
|
|
1551
1571
|
children: [/* @__PURE__ */ Q(_, {
|
|
@@ -1555,7 +1575,7 @@ function yn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1555
1575
|
alt: a
|
|
1556
1576
|
}) : null, /* @__PURE__ */ Z(v, {
|
|
1557
1577
|
className: "text-[10px] font-medium",
|
|
1558
|
-
children:
|
|
1578
|
+
children: bn(e.user_name)
|
|
1559
1579
|
})]
|
|
1560
1580
|
}), /* @__PURE__ */ Q("div", {
|
|
1561
1581
|
className: "min-w-0 flex-1",
|
|
@@ -1606,7 +1626,7 @@ function yn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1606
1626
|
": ",
|
|
1607
1627
|
/* @__PURE__ */ Z("span", {
|
|
1608
1628
|
className: "text-foreground",
|
|
1609
|
-
children:
|
|
1629
|
+
children: xn(e.to)
|
|
1610
1630
|
})
|
|
1611
1631
|
]
|
|
1612
1632
|
}, e.field))
|
|
@@ -1623,12 +1643,12 @@ function yn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1623
1643
|
": ",
|
|
1624
1644
|
/* @__PURE__ */ Z("span", {
|
|
1625
1645
|
className: "line-through opacity-70",
|
|
1626
|
-
children:
|
|
1646
|
+
children: xn(e.from)
|
|
1627
1647
|
}),
|
|
1628
1648
|
" → ",
|
|
1629
1649
|
/* @__PURE__ */ Z("span", {
|
|
1630
1650
|
className: "text-foreground",
|
|
1631
|
-
children:
|
|
1651
|
+
children: xn(e.to)
|
|
1632
1652
|
})
|
|
1633
1653
|
]
|
|
1634
1654
|
}, e.field))
|
|
@@ -1642,13 +1662,13 @@ function yn({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1642
1662
|
}
|
|
1643
1663
|
//#endregion
|
|
1644
1664
|
//#region src/RecordMetaFooter.tsx
|
|
1645
|
-
var
|
|
1665
|
+
var Cn = {
|
|
1646
1666
|
createdAt: "created_at",
|
|
1647
1667
|
createdBy: "created_by",
|
|
1648
1668
|
updatedAt: "updated_at",
|
|
1649
1669
|
updatedBy: "updated_by"
|
|
1650
1670
|
};
|
|
1651
|
-
function
|
|
1671
|
+
function wn(e) {
|
|
1652
1672
|
if (!e) return null;
|
|
1653
1673
|
if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
|
|
1654
1674
|
if (typeof e == "string" || typeof e == "number") {
|
|
@@ -1657,7 +1677,7 @@ function xn(e) {
|
|
|
1657
1677
|
}
|
|
1658
1678
|
return null;
|
|
1659
1679
|
}
|
|
1660
|
-
function
|
|
1680
|
+
function Tn(e, t) {
|
|
1661
1681
|
let n = Date.now() - e.getTime(), r = Math.max(0, Math.floor(n / 1e3));
|
|
1662
1682
|
if (r < 60) return t("detail.justNow");
|
|
1663
1683
|
let i = Math.floor(r / 60);
|
|
@@ -1665,7 +1685,7 @@ function Sn(e, t) {
|
|
|
1665
1685
|
let a = Math.floor(i / 60);
|
|
1666
1686
|
return a < 24 ? t("detail.hoursAgo", { count: a }) : t("detail.daysAgo", { count: Math.floor(a / 24) });
|
|
1667
1687
|
}
|
|
1668
|
-
function
|
|
1688
|
+
function En(e) {
|
|
1669
1689
|
try {
|
|
1670
1690
|
return new Intl.DateTimeFormat(void 0, {
|
|
1671
1691
|
dateStyle: "medium",
|
|
@@ -1675,7 +1695,7 @@ function Cn(e) {
|
|
|
1675
1695
|
return e.toISOString();
|
|
1676
1696
|
}
|
|
1677
1697
|
}
|
|
1678
|
-
var
|
|
1698
|
+
var Dn = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
1679
1699
|
if (e == null || e === "") return null;
|
|
1680
1700
|
let r = t?.fields?.[n], i = r?.reference_to || r?.reference, a = {
|
|
1681
1701
|
name: n,
|
|
@@ -1694,7 +1714,7 @@ var wn = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1694
1714
|
});
|
|
1695
1715
|
}
|
|
1696
1716
|
return /* @__PURE__ */ Z("span", { children: String(e) });
|
|
1697
|
-
},
|
|
1717
|
+
}, On = ({ label: e, user: t, date: n, objectSchema: r, userField: i, t: a }) => {
|
|
1698
1718
|
if (!t && !n) return null;
|
|
1699
1719
|
let o = n ? /* @__PURE__ */ Z(ae, {
|
|
1700
1720
|
delayDuration: 200,
|
|
@@ -1703,11 +1723,11 @@ var wn = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1703
1723
|
children: /* @__PURE__ */ Z("time", {
|
|
1704
1724
|
dateTime: n.toISOString(),
|
|
1705
1725
|
className: "cursor-default underline decoration-dotted decoration-muted-foreground/40 underline-offset-2",
|
|
1706
|
-
children:
|
|
1726
|
+
children: Tn(n, a)
|
|
1707
1727
|
})
|
|
1708
1728
|
}), /* @__PURE__ */ Z(H, {
|
|
1709
1729
|
side: "top",
|
|
1710
|
-
children:
|
|
1730
|
+
children: En(n)
|
|
1711
1731
|
})] })
|
|
1712
1732
|
}) : null;
|
|
1713
1733
|
return /* @__PURE__ */ Q("span", {
|
|
@@ -1717,7 +1737,7 @@ var wn = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1717
1737
|
className: "text-muted-foreground/70",
|
|
1718
1738
|
children: e
|
|
1719
1739
|
}),
|
|
1720
|
-
t ? /* @__PURE__ */ Z(
|
|
1740
|
+
t ? /* @__PURE__ */ Z(Dn, {
|
|
1721
1741
|
value: t,
|
|
1722
1742
|
objectSchema: r,
|
|
1723
1743
|
fieldName: i
|
|
@@ -1729,31 +1749,31 @@ var wn = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1729
1749
|
o
|
|
1730
1750
|
]
|
|
1731
1751
|
});
|
|
1732
|
-
},
|
|
1752
|
+
}, kn = ({ data: e, objectSchema: t, objectName: n, className: r }) => {
|
|
1733
1753
|
let { t: i } = $();
|
|
1734
1754
|
if (!e) return null;
|
|
1735
|
-
let a =
|
|
1755
|
+
let a = wn(e[Cn.createdAt]), o = wn(e[Cn.updatedAt]), s = e[Cn.createdBy], c = e[Cn.updatedBy], l = !!(a || s), u = a && o && Math.abs(o.getTime() - a.getTime()) < 2e3, d = !!(o || c) && !(u && (s != null && c != null && String(s) === String(c) || !c));
|
|
1736
1756
|
return !l && !d ? null : /* @__PURE__ */ Q("div", {
|
|
1737
1757
|
className: G("mt-6 pt-3 border-t border-border/40", "flex flex-wrap items-center gap-x-4 gap-y-1", "text-xs text-muted-foreground", r),
|
|
1738
1758
|
"data-testid": "record-meta-footer",
|
|
1739
|
-
children: [l && /* @__PURE__ */ Z(
|
|
1759
|
+
children: [l && /* @__PURE__ */ Z(On, {
|
|
1740
1760
|
label: i("detail.createdBy"),
|
|
1741
1761
|
user: s,
|
|
1742
1762
|
date: a,
|
|
1743
1763
|
objectSchema: t,
|
|
1744
|
-
userField:
|
|
1764
|
+
userField: Cn.createdBy,
|
|
1745
1765
|
t: i
|
|
1746
|
-
}), d && /* @__PURE__ */ Z(
|
|
1766
|
+
}), d && /* @__PURE__ */ Z(On, {
|
|
1747
1767
|
label: i("detail.updatedBy"),
|
|
1748
1768
|
user: c,
|
|
1749
1769
|
date: o,
|
|
1750
1770
|
objectSchema: t,
|
|
1751
|
-
userField:
|
|
1771
|
+
userField: Cn.updatedBy,
|
|
1752
1772
|
t: i
|
|
1753
1773
|
})]
|
|
1754
1774
|
});
|
|
1755
|
-
},
|
|
1756
|
-
function
|
|
1775
|
+
}, An = 5;
|
|
1776
|
+
function jn(e, t, i, a) {
|
|
1757
1777
|
if (e && typeof e == "object") {
|
|
1758
1778
|
if (t.primaryField) {
|
|
1759
1779
|
let n = e[t.primaryField];
|
|
@@ -1773,8 +1793,8 @@ function On(e, t, i, a) {
|
|
|
1773
1793
|
}
|
|
1774
1794
|
return a;
|
|
1775
1795
|
}
|
|
1776
|
-
var
|
|
1777
|
-
let [g, _] = i.useState(e.data), [v, y] = i.useState(!e.data && !!(e.api && e.resourceId || n && e.objectName && e.resourceId)), [S, C] = i.useState(!1), w = m ?? S, [T, E] = i.useState(!1), [D, O] = i.useState({}), [k, A] = i.useState(!1), [j, M] = i.useState(null), [N, P] = i.useState(null), [F, ee] = i.useState(null), [te, ne] = i.useState(!1), [re, ie] = i.useState(0), W = ut(e.objectName || void 0, e.resourceId == null ? void 0 : String(e.resourceId)), [se, K] = i.useState(!1), { t: q } = $(), { currency: le } =
|
|
1796
|
+
var Mn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l, discussionSlot: u, rightRail: d, objectLabel: f, onDataLoaded: p, isFavorite: m, onToggleFavorite: h }) => {
|
|
1797
|
+
let [g, _] = i.useState(e.data), [v, y] = i.useState(!e.data && !!(e.api && e.resourceId || n && e.objectName && e.resourceId)), [S, C] = i.useState(!1), w = m ?? S, [T, E] = i.useState(!1), [D, O] = i.useState({}), [k, A] = i.useState(!1), [j, M] = i.useState(null), [N, P] = i.useState(null), [F, ee] = i.useState(null), [te, ne] = i.useState(!1), [re, ie] = i.useState(0), W = ut(e.objectName || void 0, e.resourceId == null ? void 0 : String(e.resourceId)), [se, K] = i.useState(!1), { t: q } = $(), { currency: le } = Lt(), { fieldOptionLabel: ue } = vt(), de = oe(), fe = Pt(), J = i.useMemo(() => {
|
|
1778
1798
|
if (!fe?.isLoaded || !e.objectName) return e;
|
|
1779
1799
|
let t = (t) => fe.checkField(e.objectName, t, "read"), n = (e) => e && e.filter((e) => {
|
|
1780
1800
|
let n = typeof e == "string" ? e : e?.name;
|
|
@@ -2094,7 +2114,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2094
2114
|
children: [
|
|
2095
2115
|
/* @__PURE__ */ Z("h1", {
|
|
2096
2116
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
2097
|
-
children:
|
|
2117
|
+
children: jn(g, J, F, q("detail.details"))
|
|
2098
2118
|
}),
|
|
2099
2119
|
me.map((e) => {
|
|
2100
2120
|
let t = g?.[e];
|
|
@@ -2104,7 +2124,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2104
2124
|
if (i === "currency") {
|
|
2105
2125
|
let e = Number(t);
|
|
2106
2126
|
if (!Number.isNaN(e)) {
|
|
2107
|
-
let t =
|
|
2127
|
+
let t = It({
|
|
2108
2128
|
...r,
|
|
2109
2129
|
...n
|
|
2110
2130
|
}, le);
|
|
@@ -2282,7 +2302,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2282
2302
|
schema: J.header,
|
|
2283
2303
|
data: g
|
|
2284
2304
|
}) }),
|
|
2285
|
-
J.highlightFields && J.highlightFields.length > 0 && /* @__PURE__ */ Z(
|
|
2305
|
+
J.highlightFields && J.highlightFields.length > 0 && /* @__PURE__ */ Z(sn, {
|
|
2286
2306
|
fields: J.highlightFields,
|
|
2287
2307
|
data: g,
|
|
2288
2308
|
objectName: J.objectName,
|
|
@@ -2344,7 +2364,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2344
2364
|
], o = J.defaultTab, s = o && a.includes(o) ? o : "details", l = J.onTabChange, d = /* @__PURE__ */ Q("div", {
|
|
2345
2365
|
className: "space-y-3 sm:space-y-4",
|
|
2346
2366
|
children: [
|
|
2347
|
-
J.sectionGroups && J.sectionGroups.length > 0 && J.sectionGroups.map((e, t) => /* @__PURE__ */ Z(
|
|
2367
|
+
J.sectionGroups && J.sectionGroups.length > 0 && J.sectionGroups.map((e, t) => /* @__PURE__ */ Z(on, {
|
|
2348
2368
|
group: e,
|
|
2349
2369
|
data: {
|
|
2350
2370
|
...g,
|
|
@@ -2358,7 +2378,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2358
2378
|
autoFocusField: N,
|
|
2359
2379
|
dataSource: n
|
|
2360
2380
|
}, t)),
|
|
2361
|
-
J.sections && J.sections.length > 0 && J.sections.map((e, t) => /* @__PURE__ */ Z(
|
|
2381
|
+
J.sections && J.sections.length > 0 && J.sections.map((e, t) => /* @__PURE__ */ Z(en, {
|
|
2362
2382
|
section: e,
|
|
2363
2383
|
data: {
|
|
2364
2384
|
...g,
|
|
@@ -2372,7 +2392,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2372
2392
|
autoFocusField: N,
|
|
2373
2393
|
dataSource: n
|
|
2374
2394
|
}, t)),
|
|
2375
|
-
J.fields && J.fields.length > 0 && !J.sections?.length && /* @__PURE__ */ Z(
|
|
2395
|
+
J.fields && J.fields.length > 0 && !J.sections?.length && /* @__PURE__ */ Z(en, {
|
|
2376
2396
|
section: {
|
|
2377
2397
|
fields: J.fields,
|
|
2378
2398
|
columns: J.columns
|
|
@@ -2389,7 +2409,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2389
2409
|
autoFocusField: N,
|
|
2390
2410
|
dataSource: n
|
|
2391
2411
|
}),
|
|
2392
|
-
J.comments && /* @__PURE__ */ Z(
|
|
2412
|
+
J.comments && /* @__PURE__ */ Z(ln, {
|
|
2393
2413
|
comments: J.comments,
|
|
2394
2414
|
onAddComment: J.onAddComment
|
|
2395
2415
|
})
|
|
@@ -2464,7 +2484,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2464
2484
|
className: "mt-4 motion-safe:data-[state=active]:animate-in motion-safe:data-[state=active]:fade-in-0 motion-safe:duration-150",
|
|
2465
2485
|
children: /* @__PURE__ */ Z("div", {
|
|
2466
2486
|
className: "space-y-3",
|
|
2467
|
-
children: Ae.map((e, t) => /* @__PURE__ */ Z(
|
|
2487
|
+
children: Ae.map((e, t) => /* @__PURE__ */ Z(an, {
|
|
2468
2488
|
title: e.title,
|
|
2469
2489
|
type: e.type,
|
|
2470
2490
|
api: e.api,
|
|
@@ -2481,14 +2501,14 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2481
2501
|
onRowDelete: e.onRowDelete,
|
|
2482
2502
|
collapsible: !0,
|
|
2483
2503
|
defaultCollapsed: de && t > 0,
|
|
2484
|
-
pageSize:
|
|
2504
|
+
pageSize: An
|
|
2485
2505
|
}, t))
|
|
2486
2506
|
})
|
|
2487
2507
|
}),
|
|
2488
2508
|
t && /* @__PURE__ */ Z(R, {
|
|
2489
2509
|
value: "activity",
|
|
2490
2510
|
className: "mt-4 motion-safe:data-[state=active]:animate-in motion-safe:data-[state=active]:fade-in-0 motion-safe:duration-150",
|
|
2491
|
-
children: /* @__PURE__ */ Z(
|
|
2511
|
+
children: /* @__PURE__ */ Z(hn, { activities: J.activities })
|
|
2492
2512
|
}),
|
|
2493
2513
|
r && /* @__PURE__ */ Z(R, {
|
|
2494
2514
|
value: "discussion",
|
|
@@ -2498,7 +2518,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2498
2518
|
i && /* @__PURE__ */ Z(R, {
|
|
2499
2519
|
value: "history",
|
|
2500
2520
|
className: "mt-4 motion-safe:data-[state=active]:animate-in motion-safe:data-[state=active]:fade-in-0 motion-safe:duration-150",
|
|
2501
|
-
children: /* @__PURE__ */ Z(
|
|
2521
|
+
children: /* @__PURE__ */ Z(Sn, {
|
|
2502
2522
|
entries: J.history.entries,
|
|
2503
2523
|
loading: J.history.loading,
|
|
2504
2524
|
emptyText: J.history.emptyText ?? q("detail.historyEmpty", { defaultValue: "No history yet" })
|
|
@@ -2509,7 +2529,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2509
2529
|
})() : /* @__PURE__ */ Q(Mt, { children: [
|
|
2510
2530
|
J.sectionGroups && J.sectionGroups.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2511
2531
|
className: "space-y-3 sm:space-y-4",
|
|
2512
|
-
children: J.sectionGroups.map((e, t) => /* @__PURE__ */ Z(
|
|
2532
|
+
children: J.sectionGroups.map((e, t) => /* @__PURE__ */ Z(on, {
|
|
2513
2533
|
group: e,
|
|
2514
2534
|
data: {
|
|
2515
2535
|
...g,
|
|
@@ -2526,7 +2546,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2526
2546
|
}),
|
|
2527
2547
|
J.sections && J.sections.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2528
2548
|
className: "space-y-3 sm:space-y-4",
|
|
2529
|
-
children: J.sections.map((e, t) => /* @__PURE__ */ Z(
|
|
2549
|
+
children: J.sections.map((e, t) => /* @__PURE__ */ Z(en, {
|
|
2530
2550
|
section: e,
|
|
2531
2551
|
data: {
|
|
2532
2552
|
...g,
|
|
@@ -2541,7 +2561,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2541
2561
|
dataSource: n
|
|
2542
2562
|
}, t))
|
|
2543
2563
|
}),
|
|
2544
|
-
J.fields && J.fields.length > 0 && !J.sections?.length && /* @__PURE__ */ Z(
|
|
2564
|
+
J.fields && J.fields.length > 0 && !J.sections?.length && /* @__PURE__ */ Z(en, {
|
|
2545
2565
|
section: {
|
|
2546
2566
|
fields: J.fields,
|
|
2547
2567
|
columns: J.columns
|
|
@@ -2558,7 +2578,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2558
2578
|
autoFocusField: N,
|
|
2559
2579
|
dataSource: n
|
|
2560
2580
|
}),
|
|
2561
|
-
J.tabs && J.tabs.length > 0 && /* @__PURE__ */ Z(
|
|
2581
|
+
J.tabs && J.tabs.length > 0 && /* @__PURE__ */ Z(tn, {
|
|
2562
2582
|
tabs: J.tabs,
|
|
2563
2583
|
data: g
|
|
2564
2584
|
}),
|
|
@@ -2567,7 +2587,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2567
2587
|
children: [/* @__PURE__ */ Z("h2", {
|
|
2568
2588
|
className: "text-lg font-semibold",
|
|
2569
2589
|
children: q("detail.related")
|
|
2570
|
-
}), Ae.map((e, t) => /* @__PURE__ */ Z(
|
|
2590
|
+
}), Ae.map((e, t) => /* @__PURE__ */ Z(an, {
|
|
2571
2591
|
title: e.title,
|
|
2572
2592
|
type: e.type,
|
|
2573
2593
|
api: e.api,
|
|
@@ -2584,16 +2604,16 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2584
2604
|
onRowDelete: e.onRowDelete,
|
|
2585
2605
|
collapsible: !0,
|
|
2586
2606
|
defaultCollapsed: de && t > 0,
|
|
2587
|
-
pageSize:
|
|
2607
|
+
pageSize: An
|
|
2588
2608
|
}, t))]
|
|
2589
2609
|
}),
|
|
2590
|
-
J.comments && /* @__PURE__ */ Z(
|
|
2610
|
+
J.comments && /* @__PURE__ */ Z(ln, {
|
|
2591
2611
|
comments: J.comments,
|
|
2592
2612
|
onAddComment: J.onAddComment
|
|
2593
2613
|
}),
|
|
2594
|
-
J.activities && J.activities.length > 0 && /* @__PURE__ */ Z(
|
|
2614
|
+
J.activities && J.activities.length > 0 && /* @__PURE__ */ Z(hn, { activities: J.activities })
|
|
2595
2615
|
] }),
|
|
2596
|
-
/* @__PURE__ */ Z(
|
|
2616
|
+
/* @__PURE__ */ Z(kn, {
|
|
2597
2617
|
data: {
|
|
2598
2618
|
...g,
|
|
2599
2619
|
...D
|
|
@@ -2607,7 +2627,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2607
2627
|
}) })
|
|
2608
2628
|
]
|
|
2609
2629
|
}) });
|
|
2610
|
-
},
|
|
2630
|
+
}, Nn = (e) => {
|
|
2611
2631
|
if (e == null) return "—";
|
|
2612
2632
|
if (typeof e == "string") return e.length > 0 ? e : "\"\"";
|
|
2613
2633
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
@@ -2616,7 +2636,7 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2616
2636
|
} catch {
|
|
2617
2637
|
return String(e);
|
|
2618
2638
|
}
|
|
2619
|
-
},
|
|
2639
|
+
}, Pn = (e) => {
|
|
2620
2640
|
if (typeof e != "string" || e.length === 0) return null;
|
|
2621
2641
|
let t = /\d{4}-\d{2}-\d{2}[ T]/.test(e) ? e.replace(" ", "T") : e, n = new Date(t);
|
|
2622
2642
|
if (Number.isNaN(n.getTime())) return null;
|
|
@@ -2625,13 +2645,13 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2625
2645
|
} catch {
|
|
2626
2646
|
return n.toISOString();
|
|
2627
2647
|
}
|
|
2628
|
-
},
|
|
2629
|
-
let { t: o } = $(), s = t?.label || t?.field || "", l = t ?
|
|
2648
|
+
}, Fn = ({ open: e, conflict: t, onReload: n, onOverwrite: r, onCancel: i, busy: a = !1 }) => {
|
|
2649
|
+
let { t: o } = $(), s = t?.label || t?.field || "", l = t ? Nn(t.pendingValue) : "", u = t ? Nn(t.currentValue) : "", g = t?.currentRecord ?? {}, _ = (() => {
|
|
2630
2650
|
let e = [g.updated_by_name, g.updated_by_label];
|
|
2631
2651
|
for (let t of e) if (typeof t == "string" && t.length > 0) return t;
|
|
2632
2652
|
let t = g.updated_by;
|
|
2633
2653
|
return typeof t != "string" || t.length === 0 || t.length >= 16 && !/\s/.test(t) && /^[A-Za-z0-9_-]+$/.test(t) ? null : t;
|
|
2634
|
-
})(), v =
|
|
2654
|
+
})(), v = Pn(g.updated_at ?? t?.currentVersion), [y, b] = o("detail.concurrentUpdateDescription", { field: "{{field}}" }).split("{{field}}");
|
|
2635
2655
|
return /* @__PURE__ */ Z(c, {
|
|
2636
2656
|
open: e,
|
|
2637
2657
|
onOpenChange: (e) => {
|
|
@@ -2724,14 +2744,14 @@ var kn = ({ schema: e, dataSource: n, className: r, onEdit: a, onDelete: o, onBa
|
|
|
2724
2744
|
})
|
|
2725
2745
|
});
|
|
2726
2746
|
};
|
|
2727
|
-
function
|
|
2747
|
+
function In(e) {
|
|
2728
2748
|
if (!e || typeof e != "object") return !1;
|
|
2729
2749
|
let t = e;
|
|
2730
2750
|
return t.code === "CONCURRENT_UPDATE" || t.name === "ConcurrentUpdateError";
|
|
2731
2751
|
}
|
|
2732
2752
|
//#endregion
|
|
2733
2753
|
//#region src/renderers/record-details.tsx
|
|
2734
|
-
var
|
|
2754
|
+
var Ln = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name) || null, Rn = (e) => {
|
|
2735
2755
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2736
2756
|
return {
|
|
2737
2757
|
designer: {
|
|
@@ -2741,11 +2761,11 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2741
2761
|
},
|
|
2742
2762
|
rest: i
|
|
2743
2763
|
};
|
|
2744
|
-
},
|
|
2745
|
-
let r = ht(), { designer: i } =
|
|
2764
|
+
}, zn = ({ schema: e = {}, className: t, ...n }) => {
|
|
2765
|
+
let r = ht(), { designer: i } = Rn(n), o = r?.objectName || "", s = Pt(), { readableFields: c } = Nt(o), { sectionLabel: l } = vt(), { language: u } = Rt(), d = ft(), [f, p] = a.useState(null), [m, h] = a.useState(!1), g = a.useCallback((t) => {
|
|
2746
2766
|
let n = [...Array.isArray(e.fields) ? e.fields : [], ...(Array.isArray(e.sections) ? e.sections : []).flatMap((e) => Array.isArray(e?.fields) ? e.fields : [])];
|
|
2747
2767
|
for (let e of n) if ((typeof e == "string" ? e : e?.name || e?.field) === t) return typeof e == "object" ? e?.label : void 0;
|
|
2748
|
-
}, [e.fields, e.sections]),
|
|
2768
|
+
}, [e.fields, e.sections]), _ = a.useCallback(async (e, t) => {
|
|
2749
2769
|
let n = r?.dataSource, i = r?.recordId, a = r?.objectName;
|
|
2750
2770
|
if (!n || !i || !a) return;
|
|
2751
2771
|
let o = typeof r?.data?.updated_at == "string" ? (r?.data).updated_at : void 0, s = o ? { ifMatch: o } : void 0;
|
|
@@ -2759,11 +2779,11 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2759
2779
|
}
|
|
2760
2780
|
typeof r?.refresh == "function" && await r.refresh();
|
|
2761
2781
|
} catch (n) {
|
|
2762
|
-
if (
|
|
2782
|
+
if (In(n)) {
|
|
2763
2783
|
let r = n.currentRecord ?? null;
|
|
2764
|
-
throw
|
|
2784
|
+
throw p({
|
|
2765
2785
|
field: e,
|
|
2766
|
-
label:
|
|
2786
|
+
label: g(e),
|
|
2767
2787
|
pendingValue: t,
|
|
2768
2788
|
currentValue: r ? r[e] : void 0,
|
|
2769
2789
|
currentVersion: n.currentVersion,
|
|
@@ -2778,42 +2798,42 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2778
2798
|
r?.objectName,
|
|
2779
2799
|
r?.data,
|
|
2780
2800
|
r?.refresh,
|
|
2781
|
-
|
|
2782
|
-
]),
|
|
2783
|
-
|
|
2784
|
-
}, []),
|
|
2785
|
-
|
|
2801
|
+
g
|
|
2802
|
+
]), v = a.useCallback(() => {
|
|
2803
|
+
p(null), h(!1);
|
|
2804
|
+
}, []), y = a.useCallback(async () => {
|
|
2805
|
+
h(!0);
|
|
2786
2806
|
try {
|
|
2787
2807
|
typeof r?.refresh == "function" && await r.refresh();
|
|
2788
2808
|
} finally {
|
|
2789
|
-
|
|
2809
|
+
v();
|
|
2790
2810
|
}
|
|
2791
|
-
}, [r?.refresh,
|
|
2792
|
-
if (!
|
|
2793
|
-
|
|
2811
|
+
}, [r?.refresh, v]), b = a.useCallback(async () => {
|
|
2812
|
+
if (!f) {
|
|
2813
|
+
v();
|
|
2794
2814
|
return;
|
|
2795
2815
|
}
|
|
2796
2816
|
let e = r?.dataSource, t = r?.recordId, n = r?.objectName;
|
|
2797
2817
|
if (!e || !t || !n) {
|
|
2798
|
-
|
|
2818
|
+
v();
|
|
2799
2819
|
return;
|
|
2800
2820
|
}
|
|
2801
|
-
|
|
2821
|
+
h(!0);
|
|
2802
2822
|
try {
|
|
2803
|
-
let i =
|
|
2804
|
-
typeof e.update == "function" ? await e.update(n, t, { [
|
|
2823
|
+
let i = f.currentVersion ? { ifMatch: f.currentVersion } : void 0;
|
|
2824
|
+
typeof e.update == "function" ? await e.update(n, t, { [f.field]: f.pendingValue }, i) : typeof e.updateOne == "function" ? await e.updateOne(n, t, { [f.field]: f.pendingValue }, i) : typeof e.patch == "function" && await e.patch(n, t, { [f.field]: f.pendingValue }, i), typeof r?.refresh == "function" && await r.refresh();
|
|
2805
2825
|
} catch (e) {
|
|
2806
2826
|
console.error("[record:details] Overwrite-on-conflict failed", e);
|
|
2807
2827
|
} finally {
|
|
2808
|
-
|
|
2828
|
+
v();
|
|
2809
2829
|
}
|
|
2810
2830
|
}, [
|
|
2811
|
-
|
|
2831
|
+
f,
|
|
2812
2832
|
r?.dataSource,
|
|
2813
2833
|
r?.recordId,
|
|
2814
2834
|
r?.objectName,
|
|
2815
2835
|
r?.refresh,
|
|
2816
|
-
|
|
2836
|
+
v
|
|
2817
2837
|
]);
|
|
2818
2838
|
if (!r) return /* @__PURE__ */ Z("div", {
|
|
2819
2839
|
className: t,
|
|
@@ -2824,8 +2844,8 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2824
2844
|
children: "record:details — bind a record to preview"
|
|
2825
2845
|
})
|
|
2826
2846
|
});
|
|
2827
|
-
let
|
|
2828
|
-
if (
|
|
2847
|
+
let x = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
2848
|
+
if (x.length > 0 && o && !x.every((e) => s.can(o, e))) return /* @__PURE__ */ Z("div", {
|
|
2829
2849
|
className: t,
|
|
2830
2850
|
...i,
|
|
2831
2851
|
role: "status",
|
|
@@ -2835,20 +2855,20 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2835
2855
|
children: "Insufficient permissions to view details."
|
|
2836
2856
|
})
|
|
2837
2857
|
});
|
|
2838
|
-
let
|
|
2839
|
-
if (!e || !
|
|
2840
|
-
let t = e.map(
|
|
2858
|
+
let S = e.layout === "inline" || e.layout === "compact" ? "horizontal" : "vertical", C = e.enforceFieldSecurity === !0, w = Array.isArray(e.redactFields) ? e.redactFields : [], T = (e) => {
|
|
2859
|
+
if (!e || !C && w.length === 0) return e;
|
|
2860
|
+
let t = e.map(Ln).filter((e) => !!e), n = new Set((C && o ? c(t) : t).filter((e) => !w.includes(e)));
|
|
2841
2861
|
return e.filter((e) => {
|
|
2842
|
-
let t =
|
|
2843
|
-
return t
|
|
2862
|
+
let t = Ln(e);
|
|
2863
|
+
return !t || n.has(t);
|
|
2844
2864
|
});
|
|
2845
|
-
},
|
|
2865
|
+
}, E = (e) => typeof e == "string" ? { name: e } : e && typeof e == "object" && !e.name && e.field ? {
|
|
2846
2866
|
...e,
|
|
2847
2867
|
name: e.field
|
|
2848
|
-
} : e,
|
|
2849
|
-
for (let e of
|
|
2850
|
-
let
|
|
2851
|
-
|
|
2868
|
+
} : e, D = (e) => Array.isArray(e) ? e.map(E) : e, O = new Set((Array.isArray(e.hideFields) ? e.hideFields : []).map((e) => typeof e == "string" ? e : Ln(e)).filter((e) => !!e));
|
|
2869
|
+
for (let e of d) O.add(e);
|
|
2870
|
+
let k = r.objectSchema, A = r.data ?? {}, j = [
|
|
2871
|
+
k?.primaryField,
|
|
2852
2872
|
"name",
|
|
2853
2873
|
"full_name",
|
|
2854
2874
|
"title",
|
|
@@ -2856,57 +2876,57 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2856
2876
|
"display_name",
|
|
2857
2877
|
"label"
|
|
2858
2878
|
].filter((e) => typeof e == "string" && e.length > 0);
|
|
2859
|
-
for (let e of
|
|
2860
|
-
|
|
2879
|
+
for (let e of j) if (A[e] !== void 0 && A[e] !== null && A[e] !== "") {
|
|
2880
|
+
O.add(e);
|
|
2861
2881
|
break;
|
|
2862
2882
|
}
|
|
2863
|
-
let
|
|
2864
|
-
let t =
|
|
2865
|
-
return t
|
|
2866
|
-
}),
|
|
2867
|
-
let t = e.title ?? e.label, n = e.name && o ? l(o, e.name,
|
|
2883
|
+
let M = (e) => !e || O.size === 0 ? e : e.filter((e) => {
|
|
2884
|
+
let t = Ln(e);
|
|
2885
|
+
return !t || !O.has(t);
|
|
2886
|
+
}), N = M(D(T(e.fields))), P = Array.isArray(e.sections) ? e.sections.map((e) => {
|
|
2887
|
+
let t = e.title ?? e.label, n = t == null ? void 0 : Ft(t, u), r = e.name && o ? l(o, e.name, n ?? e.name) : n;
|
|
2868
2888
|
return {
|
|
2869
2889
|
...e,
|
|
2870
|
-
title:
|
|
2871
|
-
showBorder: e.showBorder ?? !!
|
|
2890
|
+
title: r,
|
|
2891
|
+
showBorder: e.showBorder ?? !!r,
|
|
2872
2892
|
hideEmpty: e.hideEmpty ?? !0,
|
|
2873
|
-
fields:
|
|
2893
|
+
fields: M(D(T(e.fields)))
|
|
2874
2894
|
};
|
|
2875
|
-
}) : e.sections,
|
|
2895
|
+
}) : e.sections, F = /* @__PURE__ */ new Set([
|
|
2876
2896
|
"system",
|
|
2877
2897
|
"append-only",
|
|
2878
2898
|
"better-auth"
|
|
2879
|
-
]),
|
|
2899
|
+
]), ee = k?.managedBy, te = k?.userActions?.edit ?? !(ee != null && F.has(ee)), ne = (e.inlineEdit ?? !0) && te, re = {
|
|
2880
2900
|
type: "detail-view",
|
|
2881
2901
|
objectName: r.objectName,
|
|
2882
2902
|
resourceId: r.recordId,
|
|
2883
2903
|
data: r.data,
|
|
2884
|
-
layout:
|
|
2904
|
+
layout: S,
|
|
2885
2905
|
columns: e.columns,
|
|
2886
|
-
sections:
|
|
2887
|
-
fields:
|
|
2906
|
+
sections: P,
|
|
2907
|
+
fields: N,
|
|
2888
2908
|
showBack: !1,
|
|
2889
2909
|
showHeader: e.showHeader ?? !1,
|
|
2890
|
-
inlineEdit:
|
|
2910
|
+
inlineEdit: ne
|
|
2891
2911
|
};
|
|
2892
2912
|
return /* @__PURE__ */ Q("div", {
|
|
2893
2913
|
className: t,
|
|
2894
2914
|
...i,
|
|
2895
|
-
children: [/* @__PURE__ */ Z(
|
|
2896
|
-
schema:
|
|
2915
|
+
children: [/* @__PURE__ */ Z(Mn, {
|
|
2916
|
+
schema: re,
|
|
2897
2917
|
dataSource: r.dataSource,
|
|
2898
|
-
inlineEdit:
|
|
2899
|
-
onFieldSave:
|
|
2900
|
-
}), /* @__PURE__ */ Z(
|
|
2901
|
-
open: !!
|
|
2902
|
-
conflict:
|
|
2903
|
-
busy:
|
|
2904
|
-
onCancel:
|
|
2905
|
-
onReload:
|
|
2906
|
-
onOverwrite:
|
|
2918
|
+
inlineEdit: ne,
|
|
2919
|
+
onFieldSave: _
|
|
2920
|
+
}), /* @__PURE__ */ Z(Fn, {
|
|
2921
|
+
open: !!f,
|
|
2922
|
+
conflict: f,
|
|
2923
|
+
busy: m,
|
|
2924
|
+
onCancel: v,
|
|
2925
|
+
onReload: y,
|
|
2926
|
+
onOverwrite: b
|
|
2907
2927
|
})]
|
|
2908
2928
|
});
|
|
2909
|
-
},
|
|
2929
|
+
}, Bn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name || e.key) || null, Vn = (e) => e?.id ?? e?._id ?? null, Hn = (e) => {
|
|
2910
2930
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2911
2931
|
return {
|
|
2912
2932
|
designer: {
|
|
@@ -2916,12 +2936,12 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2916
2936
|
},
|
|
2917
2937
|
rest: i
|
|
2918
2938
|
};
|
|
2919
|
-
},
|
|
2920
|
-
let r = ht(), { designer: i } =
|
|
2921
|
-
name:
|
|
2922
|
-
label: Dt(
|
|
2923
|
-
}) :
|
|
2924
|
-
if (!
|
|
2939
|
+
}, Un = ({ schema: e = {}, className: t, ...n }) => {
|
|
2940
|
+
let r = ht(), { designer: i } = Hn(n), o = vt(), { language: s } = Rt(), c = e.objectName, l = c && o.objectLabel ? o.objectLabel({
|
|
2941
|
+
name: c,
|
|
2942
|
+
label: Dt(c)
|
|
2943
|
+
}) : c ? Dt(c) : "", u = Ft(e.title, s) || l || "Related";
|
|
2944
|
+
if (!c) return /* @__PURE__ */ Z("div", {
|
|
2925
2945
|
className: t,
|
|
2926
2946
|
...i,
|
|
2927
2947
|
children: /* @__PURE__ */ Z("div", {
|
|
@@ -2929,17 +2949,17 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2929
2949
|
children: "record:related_list — missing objectName"
|
|
2930
2950
|
})
|
|
2931
2951
|
});
|
|
2932
|
-
let
|
|
2933
|
-
objectName:
|
|
2952
|
+
let d = Pt(), { readableFields: f } = Nt(c), p = e.relationshipValueField || "id", m = p === "id" ? r?.recordId ?? null : r?.data?.[p] ?? null, h = _t(), g = a.useMemo(() => h?.resolve({
|
|
2953
|
+
objectName: c,
|
|
2934
2954
|
relationshipField: e.relationshipField,
|
|
2935
|
-
parentId:
|
|
2955
|
+
parentId: m
|
|
2936
2956
|
}) ?? null, [
|
|
2937
|
-
|
|
2938
|
-
|
|
2957
|
+
h,
|
|
2958
|
+
c,
|
|
2939
2959
|
e.relationshipField,
|
|
2940
|
-
|
|
2941
|
-
]),
|
|
2942
|
-
if (
|
|
2960
|
+
m
|
|
2961
|
+
]), _ = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
2962
|
+
if (_.length > 0 && !_.every((e) => d.can(c, e))) return /* @__PURE__ */ Z("div", {
|
|
2943
2963
|
className: t,
|
|
2944
2964
|
...i,
|
|
2945
2965
|
role: "status",
|
|
@@ -2949,51 +2969,54 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
2949
2969
|
children: "Insufficient permissions to view related list."
|
|
2950
2970
|
})
|
|
2951
2971
|
});
|
|
2952
|
-
let
|
|
2953
|
-
if (
|
|
2954
|
-
let e =
|
|
2955
|
-
|
|
2956
|
-
let n =
|
|
2957
|
-
return n
|
|
2972
|
+
let v = e.enforceFieldSecurity === !0, y = Array.isArray(e.redactFields) ? e.redactFields : [], b = Array.isArray(e.columns) ? e.columns : [], x = b;
|
|
2973
|
+
if (v || y.length > 0) {
|
|
2974
|
+
let e = b.map(Bn).filter((e) => !!e), t = new Set((v ? f(e) : e).filter((e) => !y.includes(e)));
|
|
2975
|
+
x = b.filter((e) => {
|
|
2976
|
+
let n = Bn(e);
|
|
2977
|
+
return !n || t.has(n);
|
|
2958
2978
|
});
|
|
2959
2979
|
}
|
|
2960
2980
|
return /* @__PURE__ */ Z("div", {
|
|
2961
2981
|
className: t,
|
|
2962
2982
|
...i,
|
|
2963
|
-
children: /* @__PURE__ */ Z(
|
|
2964
|
-
title:
|
|
2983
|
+
children: /* @__PURE__ */ Z(an, {
|
|
2984
|
+
title: u,
|
|
2965
2985
|
type: "table",
|
|
2966
|
-
api:
|
|
2967
|
-
objectName:
|
|
2986
|
+
api: c,
|
|
2987
|
+
objectName: c,
|
|
2968
2988
|
referenceField: e.relationshipField,
|
|
2969
|
-
parentId:
|
|
2970
|
-
columns:
|
|
2989
|
+
parentId: m,
|
|
2990
|
+
columns: x,
|
|
2971
2991
|
pageSize: e.limit,
|
|
2972
2992
|
dataSource: r?.dataSource,
|
|
2973
|
-
add: e.add
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
toolbarActions: h?.toolbarActions,
|
|
2977
|
-
onToolbarAction: h?.onToolbarAction,
|
|
2978
|
-
onNew: h?.onCreate,
|
|
2979
|
-
onRowClick: h?.onView ? (e) => {
|
|
2980
|
-
let t = Rn(e);
|
|
2981
|
-
t != null && h.onView(t, e);
|
|
2993
|
+
add: e.add ? {
|
|
2994
|
+
...e.add,
|
|
2995
|
+
label: Ft(e.add.label, s) || void 0
|
|
2982
2996
|
} : void 0,
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2997
|
+
rowActions: g?.rowActions,
|
|
2998
|
+
onRowAction: g?.onRowAction,
|
|
2999
|
+
toolbarActions: g?.toolbarActions,
|
|
3000
|
+
onToolbarAction: g?.onToolbarAction,
|
|
3001
|
+
onNew: g?.onCreate,
|
|
3002
|
+
onRowClick: g?.onView ? (e) => {
|
|
3003
|
+
let t = Vn(e);
|
|
3004
|
+
t != null && g.onView(t, e);
|
|
2986
3005
|
} : void 0,
|
|
2987
|
-
|
|
2988
|
-
let t =
|
|
2989
|
-
|
|
3006
|
+
onRowEdit: g?.onEdit ? (e) => {
|
|
3007
|
+
let t = Vn(e);
|
|
3008
|
+
t != null && g.onEdit(t, e);
|
|
3009
|
+
} : void 0,
|
|
3010
|
+
onRowDelete: g?.onDelete ? (e) => {
|
|
3011
|
+
let t = Vn(e);
|
|
3012
|
+
if (t != null) return g.onDelete(t, e);
|
|
2990
3013
|
} : e.add && r?.dataSource ? async (e) => {
|
|
2991
3014
|
let t = e?.id ?? e?._id;
|
|
2992
|
-
t != null && await r.dataSource.delete?.(
|
|
3015
|
+
t != null && await r.dataSource.delete?.(c, String(t));
|
|
2993
3016
|
} : void 0
|
|
2994
3017
|
})
|
|
2995
3018
|
});
|
|
2996
|
-
},
|
|
3019
|
+
}, Wn = (e) => {
|
|
2997
3020
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2998
3021
|
return {
|
|
2999
3022
|
designer: {
|
|
@@ -3003,8 +3026,8 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
3003
3026
|
},
|
|
3004
3027
|
rest: i
|
|
3005
3028
|
};
|
|
3006
|
-
},
|
|
3007
|
-
let r = ht(), { designer: i } =
|
|
3029
|
+
}, Gn = ({ schema: e = {}, className: t, ...n }) => {
|
|
3030
|
+
let r = ht(), { designer: i } = Wn(n), o = r?.objectName || "", s = Pt(), { readableFields: c } = Nt(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
3008
3031
|
if (l.length > 0 && o && !l.every((e) => s.can(o, e))) return /* @__PURE__ */ Z("div", {
|
|
3009
3032
|
className: t,
|
|
3010
3033
|
...i,
|
|
@@ -3024,14 +3047,14 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
3024
3047
|
return gt(a.useId(), m.map((e) => e.name)), /* @__PURE__ */ Z("div", {
|
|
3025
3048
|
className: t,
|
|
3026
3049
|
...i,
|
|
3027
|
-
children: /* @__PURE__ */ Z(
|
|
3050
|
+
children: /* @__PURE__ */ Z(sn, {
|
|
3028
3051
|
fields: m,
|
|
3029
3052
|
data: r?.data,
|
|
3030
3053
|
objectName: r?.objectName,
|
|
3031
3054
|
objectSchema: r?.objectSchema
|
|
3032
3055
|
})
|
|
3033
3056
|
});
|
|
3034
|
-
},
|
|
3057
|
+
}, Kn = ({ change: e, className: t }) => {
|
|
3035
3058
|
let n = e.fieldLabel ?? e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " "), r = e.oldDisplayValue ?? (e.oldValue == null ? "(empty)" : String(e.oldValue)), i = e.newDisplayValue ?? (e.newValue == null ? "(empty)" : String(e.newValue));
|
|
3036
3059
|
return /* @__PURE__ */ Q("div", {
|
|
3037
3060
|
className: G("flex items-center gap-1.5 text-sm flex-wrap", t),
|
|
@@ -3051,14 +3074,14 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
3051
3074
|
})
|
|
3052
3075
|
]
|
|
3053
3076
|
});
|
|
3054
|
-
},
|
|
3077
|
+
}, qn = [
|
|
3055
3078
|
"👍",
|
|
3056
3079
|
"❤️",
|
|
3057
3080
|
"🎉",
|
|
3058
3081
|
"😂",
|
|
3059
3082
|
"😮",
|
|
3060
3083
|
"😢"
|
|
3061
|
-
],
|
|
3084
|
+
], Jn = ({ reactions: e, onToggleReaction: t, emojiOptions: n = qn, className: r }) => {
|
|
3062
3085
|
let [a, o] = i.useState(!1), s = i.useCallback((e) => {
|
|
3063
3086
|
t?.(e), o(!1);
|
|
3064
3087
|
}, [t]);
|
|
@@ -3098,7 +3121,7 @@ var Pn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field
|
|
|
3098
3121
|
};
|
|
3099
3122
|
//#endregion
|
|
3100
3123
|
//#region src/ThreadedReplies.tsx
|
|
3101
|
-
function
|
|
3124
|
+
function Yn(e, t) {
|
|
3102
3125
|
try {
|
|
3103
3126
|
let n = new Date(e), r = (/* @__PURE__ */ new Date()).getTime() - n.getTime(), i = Math.floor(r / 6e4);
|
|
3104
3127
|
if (i < 1) return t("detail.justNow");
|
|
@@ -3111,7 +3134,7 @@ function Kn(e, t) {
|
|
|
3111
3134
|
return e;
|
|
3112
3135
|
}
|
|
3113
3136
|
}
|
|
3114
|
-
var
|
|
3137
|
+
var Xn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, className: a }) => {
|
|
3115
3138
|
let { t: o } = $(), [s, c] = i.useState(!1), [l, u] = i.useState(""), [d, f] = i.useState(!1), p = i.useCallback(async () => {
|
|
3116
3139
|
let t = l.trim();
|
|
3117
3140
|
if (!(!t || !n)) {
|
|
@@ -3166,7 +3189,7 @@ var qn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3166
3189
|
children: e.actor
|
|
3167
3190
|
}), /* @__PURE__ */ Z("span", {
|
|
3168
3191
|
className: "text-[10px] text-muted-foreground",
|
|
3169
|
-
children:
|
|
3192
|
+
children: Yn(e.createdAt, o)
|
|
3170
3193
|
})]
|
|
3171
3194
|
}), /* @__PURE__ */ Z("p", {
|
|
3172
3195
|
className: "text-xs whitespace-pre-wrap break-words",
|
|
@@ -3196,7 +3219,7 @@ var qn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3196
3219
|
})
|
|
3197
3220
|
]
|
|
3198
3221
|
});
|
|
3199
|
-
},
|
|
3222
|
+
}, Zn = ({ subscription: e, onToggle: t, className: n }) => {
|
|
3200
3223
|
let { t: r } = $(), [a, o] = i.useState(!1), s = i.useCallback(async () => {
|
|
3201
3224
|
if (t) {
|
|
3202
3225
|
o(!0);
|
|
@@ -3220,11 +3243,11 @@ var qn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3220
3243
|
};
|
|
3221
3244
|
//#endregion
|
|
3222
3245
|
//#region src/RichTextCommentInput.tsx
|
|
3223
|
-
function
|
|
3246
|
+
function Qn(e) {
|
|
3224
3247
|
let t = e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/```([\s\S]*?)```/g, "<pre class=\"bg-muted rounded p-2 text-xs font-mono my-1 overflow-x-auto\">$1</pre>").replace(/`([^`]+)`/g, "<code class=\"bg-muted rounded px-1 py-0.5 text-xs font-mono\">$1</code>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/@(\w+)/g, "<span class=\"text-primary font-medium\">@$1</span>").replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>").replace(/\n/g, "<br/>");
|
|
3225
3248
|
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
3226
3249
|
}
|
|
3227
|
-
var
|
|
3250
|
+
var $n = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], placeholder: a, className: o, disabled: s = !1, extraSlot: c, canSubmitEmpty: l = !1 }) => {
|
|
3228
3251
|
let { t: u } = $(), [d, f] = i.useState(!1), [p, m] = i.useState(!1), [h, g] = i.useState(""), [_, v] = i.useState(0), y = i.useRef(null), b = i.useMemo(() => {
|
|
3229
3252
|
if (!h) return r;
|
|
3230
3253
|
let e = h.toLowerCase();
|
|
@@ -3359,7 +3382,7 @@ var Xn = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], plac
|
|
|
3359
3382
|
className: "relative",
|
|
3360
3383
|
children: d ? /* @__PURE__ */ Z("div", {
|
|
3361
3384
|
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
3362
|
-
dangerouslySetInnerHTML: { __html:
|
|
3385
|
+
dangerouslySetInnerHTML: { __html: Qn(e) }
|
|
3363
3386
|
}) : /* @__PURE__ */ Q(Mt, { children: [/* @__PURE__ */ Z("textarea", {
|
|
3364
3387
|
ref: y,
|
|
3365
3388
|
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
@@ -3396,16 +3419,16 @@ var Xn = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], plac
|
|
|
3396
3419
|
};
|
|
3397
3420
|
//#endregion
|
|
3398
3421
|
//#region src/CommentAttachment.tsx
|
|
3399
|
-
function
|
|
3422
|
+
function er(e) {
|
|
3400
3423
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
3401
3424
|
}
|
|
3402
|
-
function
|
|
3425
|
+
function tr(e) {
|
|
3403
3426
|
return e.startsWith("image/");
|
|
3404
3427
|
}
|
|
3405
|
-
function
|
|
3406
|
-
return
|
|
3428
|
+
function nr(e) {
|
|
3429
|
+
return tr(e) ? Me : e.includes("pdf") || e.includes("document") || e.includes("text") ? Ae : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? Y : ke;
|
|
3407
3430
|
}
|
|
3408
|
-
var
|
|
3431
|
+
var rr = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a = !1 }) => {
|
|
3409
3432
|
let { t: o } = $(), [s, c] = i.useState(!1), l = i.useRef(null), u = i.useCallback((e) => {
|
|
3410
3433
|
e.preventDefault(), e.stopPropagation(), c(!0);
|
|
3411
3434
|
}, []), d = i.useCallback((e) => {
|
|
@@ -3450,7 +3473,7 @@ var er = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a
|
|
|
3450
3473
|
}), /* @__PURE__ */ Z("div", {
|
|
3451
3474
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
3452
3475
|
children: e.map((e) => {
|
|
3453
|
-
let t =
|
|
3476
|
+
let t = tr(e.type), r = nr(e.type);
|
|
3454
3477
|
return /* @__PURE__ */ Q("div", {
|
|
3455
3478
|
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
3456
3479
|
children: [
|
|
@@ -3469,7 +3492,7 @@ var er = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a
|
|
|
3469
3492
|
children: e.name
|
|
3470
3493
|
}), /* @__PURE__ */ Z("p", {
|
|
3471
3494
|
className: "text-[10px] text-muted-foreground",
|
|
3472
|
-
children:
|
|
3495
|
+
children: er(e.size)
|
|
3473
3496
|
})]
|
|
3474
3497
|
}),
|
|
3475
3498
|
n && !a && /* @__PURE__ */ Z(x, {
|
|
@@ -3486,7 +3509,7 @@ var er = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a
|
|
|
3486
3509
|
})]
|
|
3487
3510
|
})]
|
|
3488
3511
|
});
|
|
3489
|
-
},
|
|
3512
|
+
}, ir = {
|
|
3490
3513
|
comment: ze,
|
|
3491
3514
|
field_change: Te,
|
|
3492
3515
|
task: ge,
|
|
@@ -3494,7 +3517,7 @@ var er = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a
|
|
|
3494
3517
|
system: it,
|
|
3495
3518
|
email: Re,
|
|
3496
3519
|
call: Ge
|
|
3497
|
-
},
|
|
3520
|
+
}, ar = {
|
|
3498
3521
|
comment: "bg-purple-100 text-purple-600",
|
|
3499
3522
|
field_change: "bg-blue-100 text-blue-600",
|
|
3500
3523
|
task: "bg-green-100 text-green-600",
|
|
@@ -3503,7 +3526,7 @@ var er = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: a
|
|
|
3503
3526
|
email: "bg-indigo-100 text-indigo-600",
|
|
3504
3527
|
call: "bg-teal-100 text-teal-600"
|
|
3505
3528
|
};
|
|
3506
|
-
function
|
|
3529
|
+
function or(e) {
|
|
3507
3530
|
return [
|
|
3508
3531
|
{
|
|
3509
3532
|
value: "all",
|
|
@@ -3523,7 +3546,7 @@ function rr(e) {
|
|
|
3523
3546
|
}
|
|
3524
3547
|
];
|
|
3525
3548
|
}
|
|
3526
|
-
function
|
|
3549
|
+
function sr(e, t) {
|
|
3527
3550
|
try {
|
|
3528
3551
|
let n = new Date(e), r = (/* @__PURE__ */ new Date()).getTime() - n.getTime(), i = Math.floor(r / 6e4);
|
|
3529
3552
|
if (i < 1) return t("detail.justNow");
|
|
@@ -3536,7 +3559,7 @@ function ir(e, t) {
|
|
|
3536
3559
|
return e;
|
|
3537
3560
|
}
|
|
3538
3561
|
}
|
|
3539
|
-
function
|
|
3562
|
+
function cr(e, t) {
|
|
3540
3563
|
switch (t) {
|
|
3541
3564
|
case "comments_only": return e.filter((e) => e.type === "comment");
|
|
3542
3565
|
case "changes_only": return e.filter((e) => e.type === "field_change");
|
|
@@ -3544,8 +3567,8 @@ function ar(e, t) {
|
|
|
3544
3567
|
default: return e;
|
|
3545
3568
|
}
|
|
3546
3569
|
}
|
|
3547
|
-
var
|
|
3548
|
-
let { t: y } = $(), [b, S] = i.useState("all"), [C, w] = i.useState(""), [T, E] = i.useState(!1), [D, O] = i.useState(!1), [A, j] = i.useState([]), [te, ne] = i.useState(!1), re = n ?? b, ie = t?.showFilterToggle !== !1, I = t?.showCommentInput !== !1 && !!c, L = t?.enableReactions ?? !1, R = t?.enableThreading ?? !1, z = t?.showSubscriptionToggle ?? !1, B = i.useMemo(() =>
|
|
3570
|
+
var lr = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a = !1, onLoadMore: o, loading: s = !1, onAddComment: c, onAddReply: l, onToggleReaction: u, subscription: d, onToggleSubscription: f, collapseWhenEmpty: p = !1, mentionSuggestions: m, onUploadAttachments: h, titleLabel: g, emptyLabel: _, className: v }) => {
|
|
3571
|
+
let { t: y } = $(), [b, S] = i.useState("all"), [C, w] = i.useState(""), [T, E] = i.useState(!1), [D, O] = i.useState(!1), [A, j] = i.useState([]), [te, ne] = i.useState(!1), re = n ?? b, ie = t?.showFilterToggle !== !1, I = t?.showCommentInput !== !1 && !!c, L = t?.enableReactions ?? !1, R = t?.enableThreading ?? !1, z = t?.showSubscriptionToggle ?? !1, B = i.useMemo(() => cr(e, re), [e, re]), V = i.useMemo(() => R ? B.filter((e) => !e.parentId) : B, [B, R]), H = i.useMemo(() => {
|
|
3549
3572
|
if (!R) return /* @__PURE__ */ new Map();
|
|
3550
3573
|
let e = /* @__PURE__ */ new Map();
|
|
3551
3574
|
for (let t of B) if (t.parentId) {
|
|
@@ -3614,7 +3637,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3614
3637
|
]
|
|
3615
3638
|
}), /* @__PURE__ */ Z("div", {
|
|
3616
3639
|
className: "flex items-center gap-1",
|
|
3617
|
-
children: z && d && /* @__PURE__ */ Z(
|
|
3640
|
+
children: z && d && /* @__PURE__ */ Z(Zn, {
|
|
3618
3641
|
subscription: d,
|
|
3619
3642
|
onToggle: f
|
|
3620
3643
|
})
|
|
@@ -3632,13 +3655,13 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3632
3655
|
"aria-label": y("detail.filterActivity"),
|
|
3633
3656
|
className: "h-8 w-auto min-w-[140px] py-1 text-sm",
|
|
3634
3657
|
children: /* @__PURE__ */ Z(ee, {})
|
|
3635
|
-
}), /* @__PURE__ */ Z(N, { children:
|
|
3658
|
+
}), /* @__PURE__ */ Z(N, { children: or(y).map((e) => /* @__PURE__ */ Z(P, {
|
|
3636
3659
|
value: e.value,
|
|
3637
3660
|
children: e.label
|
|
3638
3661
|
}, e.value)) })]
|
|
3639
3662
|
})
|
|
3640
3663
|
}),
|
|
3641
|
-
I && /* @__PURE__ */ Z(
|
|
3664
|
+
I && /* @__PURE__ */ Z($n, {
|
|
3642
3665
|
value: C,
|
|
3643
3666
|
onChange: w,
|
|
3644
3667
|
onSubmit: U,
|
|
@@ -3646,12 +3669,12 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3646
3669
|
placeholder: y("detail.leaveCommentPlaceholder"),
|
|
3647
3670
|
disabled: T,
|
|
3648
3671
|
canSubmitEmpty: A.length > 0,
|
|
3649
|
-
extraSlot: h ? /* @__PURE__ */ Z(
|
|
3672
|
+
extraSlot: h ? /* @__PURE__ */ Z(rr, {
|
|
3650
3673
|
attachments: A,
|
|
3651
3674
|
onUpload: W,
|
|
3652
3675
|
onRemove: oe,
|
|
3653
3676
|
readOnly: T || te
|
|
3654
|
-
}) : A.length > 0 ? /* @__PURE__ */ Z(
|
|
3677
|
+
}) : A.length > 0 ? /* @__PURE__ */ Z(rr, {
|
|
3655
3678
|
attachments: A,
|
|
3656
3679
|
onRemove: oe,
|
|
3657
3680
|
readOnly: T
|
|
@@ -3665,7 +3688,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3665
3688
|
children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
|
|
3666
3689
|
className: "space-y-4",
|
|
3667
3690
|
children: V.map((e) => {
|
|
3668
|
-
let t =
|
|
3691
|
+
let t = ir[e.type] || it, n = ar[e.type] || "bg-gray-100 text-gray-600", r = H.get(e.id) ?? [];
|
|
3669
3692
|
return /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("div", {
|
|
3670
3693
|
className: "flex gap-3 relative",
|
|
3671
3694
|
children: [/* @__PURE__ */ Z("div", {
|
|
@@ -3691,7 +3714,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3691
3714
|
}),
|
|
3692
3715
|
/* @__PURE__ */ Z("span", {
|
|
3693
3716
|
className: "text-xs text-muted-foreground",
|
|
3694
|
-
children:
|
|
3717
|
+
children: sr(e.createdAt, y)
|
|
3695
3718
|
}),
|
|
3696
3719
|
e.edited && /* @__PURE__ */ Z("span", {
|
|
3697
3720
|
className: "text-xs text-muted-foreground italic",
|
|
@@ -3718,25 +3741,25 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3718
3741
|
}),
|
|
3719
3742
|
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ Z("div", {
|
|
3720
3743
|
className: "space-y-1 mt-1",
|
|
3721
|
-
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(
|
|
3744
|
+
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(Kn, { change: e }, t))
|
|
3722
3745
|
}),
|
|
3723
3746
|
L && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ Z("div", {
|
|
3724
3747
|
className: "mt-1.5",
|
|
3725
|
-
children: /* @__PURE__ */ Z(
|
|
3748
|
+
children: /* @__PURE__ */ Z(Jn, {
|
|
3726
3749
|
reactions: e.reactions,
|
|
3727
3750
|
onToggleReaction: u ? (t) => u(e.id, t) : void 0
|
|
3728
3751
|
})
|
|
3729
3752
|
}),
|
|
3730
3753
|
L && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */ Z("div", {
|
|
3731
3754
|
className: "mt-1.5",
|
|
3732
|
-
children: /* @__PURE__ */ Z(
|
|
3755
|
+
children: /* @__PURE__ */ Z(Jn, {
|
|
3733
3756
|
reactions: [],
|
|
3734
3757
|
onToggleReaction: (t) => u(e.id, t)
|
|
3735
3758
|
})
|
|
3736
3759
|
})
|
|
3737
3760
|
]
|
|
3738
3761
|
})]
|
|
3739
|
-
}), R && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(
|
|
3762
|
+
}), R && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(Xn, {
|
|
3740
3763
|
parentItem: e,
|
|
3741
3764
|
replies: r,
|
|
3742
3765
|
onAddReply: l,
|
|
@@ -3759,7 +3782,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3759
3782
|
]
|
|
3760
3783
|
})]
|
|
3761
3784
|
});
|
|
3762
|
-
},
|
|
3785
|
+
}, ur = (e) => {
|
|
3763
3786
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3764
3787
|
return {
|
|
3765
3788
|
designer: {
|
|
@@ -3769,18 +3792,18 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3769
3792
|
},
|
|
3770
3793
|
rest: i
|
|
3771
3794
|
};
|
|
3772
|
-
},
|
|
3795
|
+
}, dr = ({ schema: e = {}, className: t, ...n }) => {
|
|
3773
3796
|
ht();
|
|
3774
|
-
let { designer: r } =
|
|
3797
|
+
let { designer: r } = ur(n);
|
|
3775
3798
|
return /* @__PURE__ */ Z("div", {
|
|
3776
3799
|
className: t,
|
|
3777
3800
|
...r,
|
|
3778
|
-
children: /* @__PURE__ */ Z(
|
|
3801
|
+
children: /* @__PURE__ */ Z(lr, {
|
|
3779
3802
|
items: [],
|
|
3780
3803
|
config: e
|
|
3781
3804
|
})
|
|
3782
3805
|
});
|
|
3783
|
-
},
|
|
3806
|
+
}, fr = ({ config: e, items: t, hasMore: n, onLoadMore: r, loading: a, onAddComment: o, onAddReply: s, onToggleReaction: c, subscription: l, onToggleSubscription: u, filterMode: d, onFilterChange: f, collapseWhenEmpty: p = !1, mentionSuggestions: m, onUploadAttachments: h, className: g }) => {
|
|
3784
3807
|
let _ = e?.position ?? "right", v = e?.width ?? "360px", y = e?.collapsible ?? !0, b = p && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: S } = $(), [C, w] = i.useState(b);
|
|
3785
3808
|
return _ === "right" || _ === "left" ? C && y ? /* @__PURE__ */ Z("div", {
|
|
3786
3809
|
className: G("flex items-start pt-4", _ === "right" ? "border-l" : "border-r", g),
|
|
@@ -3816,7 +3839,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3816
3839
|
})]
|
|
3817
3840
|
}), /* @__PURE__ */ Z("div", {
|
|
3818
3841
|
className: "flex-1 overflow-y-auto",
|
|
3819
|
-
children: /* @__PURE__ */ Z(
|
|
3842
|
+
children: /* @__PURE__ */ Z(lr, {
|
|
3820
3843
|
items: t,
|
|
3821
3844
|
config: e?.feed,
|
|
3822
3845
|
hasMore: n,
|
|
@@ -3858,7 +3881,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3858
3881
|
"aria-label": S("detail.hideDiscussion"),
|
|
3859
3882
|
children: /* @__PURE__ */ Z(Ve, { className: "h-3.5 w-3.5" })
|
|
3860
3883
|
})]
|
|
3861
|
-
}), /* @__PURE__ */ Z(
|
|
3884
|
+
}), /* @__PURE__ */ Z(lr, {
|
|
3862
3885
|
items: t,
|
|
3863
3886
|
config: e?.feed,
|
|
3864
3887
|
hasMore: n,
|
|
@@ -3878,7 +3901,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3878
3901
|
emptyLabel: S("detail.noCommentsYet")
|
|
3879
3902
|
})] })
|
|
3880
3903
|
});
|
|
3881
|
-
},
|
|
3904
|
+
}, pr = (e) => {
|
|
3882
3905
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3883
3906
|
return {
|
|
3884
3907
|
designer: {
|
|
@@ -3888,9 +3911,9 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3888
3911
|
},
|
|
3889
3912
|
rest: i
|
|
3890
3913
|
};
|
|
3891
|
-
},
|
|
3914
|
+
}, mr = ({ schema: e = {}, className: t, ...n }) => {
|
|
3892
3915
|
ht();
|
|
3893
|
-
let r = dt(), { designer: i } =
|
|
3916
|
+
let r = dt(), { designer: i } = pr(n), a = {
|
|
3894
3917
|
position: "bottom",
|
|
3895
3918
|
collapsible: !1,
|
|
3896
3919
|
feed: {
|
|
@@ -3903,7 +3926,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3903
3926
|
return /* @__PURE__ */ Z("div", {
|
|
3904
3927
|
className: t,
|
|
3905
3928
|
...i,
|
|
3906
|
-
children: /* @__PURE__ */ Z(
|
|
3929
|
+
children: /* @__PURE__ */ Z(fr, {
|
|
3907
3930
|
items: r?.items || [],
|
|
3908
3931
|
config: a,
|
|
3909
3932
|
onAddComment: r?.onAddComment,
|
|
@@ -3913,7 +3936,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3913
3936
|
onUploadAttachments: r?.onUploadAttachments
|
|
3914
3937
|
})
|
|
3915
3938
|
});
|
|
3916
|
-
},
|
|
3939
|
+
}, hr = (e) => {
|
|
3917
3940
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3918
3941
|
return {
|
|
3919
3942
|
designer: {
|
|
@@ -3923,8 +3946,8 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
3923
3946
|
},
|
|
3924
3947
|
rest: i
|
|
3925
3948
|
};
|
|
3926
|
-
},
|
|
3927
|
-
let r = ht(), { translateOptions: i } = vt(), { designer: o } =
|
|
3949
|
+
}, gr = ({ schema: e = {}, className: t, ...n }) => {
|
|
3950
|
+
let r = ht(), { translateOptions: i } = vt(), { designer: o } = hr(n), s = Array.isArray(e.stages) ? e.stages : [], c = e.statusField, l = a.useMemo(() => {
|
|
3928
3951
|
if (s.length === 0 || !c || !r?.objectName) return s;
|
|
3929
3952
|
let e = i(r.objectName, c, s);
|
|
3930
3953
|
return Array.isArray(e) && e.length === s.length ? s.map((t, n) => ({
|
|
@@ -4036,7 +4059,7 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
4036
4059
|
})
|
|
4037
4060
|
})]
|
|
4038
4061
|
});
|
|
4039
|
-
},
|
|
4062
|
+
}, _r = (e) => {
|
|
4040
4063
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
4041
4064
|
return {
|
|
4042
4065
|
designer: {
|
|
@@ -4046,12 +4069,12 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
4046
4069
|
},
|
|
4047
4070
|
rest: i
|
|
4048
4071
|
};
|
|
4049
|
-
},
|
|
4050
|
-
let r = ht(), { designer: i } =
|
|
4051
|
-
let e = Array.isArray(
|
|
4052
|
-
return
|
|
4053
|
-
})() : Array.isArray(
|
|
4054
|
-
if (
|
|
4072
|
+
}, vr = ({ schema: e = {}, className: t, ...n }) => {
|
|
4073
|
+
let r = ht(), { designer: i } = _r(n), a = Pt(), { language: o } = Rt(), s = vt(), c = Array.isArray(e.actions) ? e.actions : Array.isArray(e.properties?.actions) ? e.properties.actions : [], l = Array.isArray(e.actionNames) ? e.actionNames : Array.isArray(e.properties?.actionNames) ? e.properties.actionNames : [], u = r?.objectName || "", d = l.length > 0 ? l : Array.isArray(c) && c.every((e) => typeof e == "string") ? c : [], f = d.length > 0 && !!u, { item: p } = pt("object", f ? u : null), m = f ? (() => {
|
|
4074
|
+
let e = Array.isArray(p?.actions) ? p.actions : [], t = new Map(e.map((e) => [e.name, e]));
|
|
4075
|
+
return d.map((e) => t.get(e)).filter((e) => !!e);
|
|
4076
|
+
})() : Array.isArray(c) ? c : [], h = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
4077
|
+
if (h.length > 0 && u && !h.every((e) => a.can(u, e))) return /* @__PURE__ */ Z("div", {
|
|
4055
4078
|
className: t,
|
|
4056
4079
|
...i,
|
|
4057
4080
|
role: "status",
|
|
@@ -4061,15 +4084,15 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
4061
4084
|
children: "Insufficient permissions to view quick actions."
|
|
4062
4085
|
})
|
|
4063
4086
|
});
|
|
4064
|
-
let
|
|
4065
|
-
actions:
|
|
4087
|
+
let g = e.location || "record_header", { getActionsForLocation: _, executeAction: v } = ct({
|
|
4088
|
+
actions: m,
|
|
4066
4089
|
context: {
|
|
4067
4090
|
record: r?.data,
|
|
4068
4091
|
recordId: r?.recordId,
|
|
4069
4092
|
objectName: r?.objectName
|
|
4070
4093
|
}
|
|
4071
|
-
}),
|
|
4072
|
-
if (
|
|
4094
|
+
}), y = m.length > 0 ? _(g) : [];
|
|
4095
|
+
if (y.length === 0) return /* @__PURE__ */ Z("div", {
|
|
4073
4096
|
className: t,
|
|
4074
4097
|
...i,
|
|
4075
4098
|
children: /* @__PURE__ */ Z("div", {
|
|
@@ -4077,25 +4100,28 @@ var or = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: a =
|
|
|
4077
4100
|
children: "record:quick_actions — no actions configured"
|
|
4078
4101
|
})
|
|
4079
4102
|
});
|
|
4080
|
-
let
|
|
4103
|
+
let b = e.align || "end", x = b === "start" ? "justify-start" : b === "center" ? "justify-center" : "justify-end";
|
|
4081
4104
|
return /* @__PURE__ */ Z("div", {
|
|
4082
|
-
className: G("flex flex-wrap items-center gap-2",
|
|
4105
|
+
className: G("flex flex-wrap items-center gap-2", g === "record_header" && !e.inline && "-mt-12 sm:-mt-14 mb-2 relative z-10", x, t),
|
|
4083
4106
|
role: "toolbar",
|
|
4084
4107
|
"aria-label": e.aria?.label || "Quick actions",
|
|
4085
4108
|
...i,
|
|
4086
|
-
children:
|
|
4109
|
+
children: y.map((t, n) => /* @__PURE__ */ Z(yr, {
|
|
4087
4110
|
action: t,
|
|
4088
4111
|
record: r?.data,
|
|
4089
4112
|
variant: t.variant || e.variant || "default",
|
|
4090
4113
|
size: t.size || e.size || "sm",
|
|
4091
|
-
label:
|
|
4114
|
+
label: (() => {
|
|
4115
|
+
let e = Ft(t.label, o) || t.name || `Action ${n + 1}`;
|
|
4116
|
+
return t.name ? s.actionLabel(u || void 0, t.name, e) : e;
|
|
4117
|
+
})(),
|
|
4092
4118
|
onRun: async () => {
|
|
4093
|
-
typeof t.onClick == "function" ? await t.onClick() : t.name && await
|
|
4119
|
+
typeof t.onClick == "function" ? await t.onClick() : t.name && await v(t.name);
|
|
4094
4120
|
}
|
|
4095
4121
|
}, t.name || `qa-${n}`))
|
|
4096
4122
|
});
|
|
4097
4123
|
};
|
|
4098
|
-
function
|
|
4124
|
+
function yr({ action: e, record: t, variant: n, size: r, label: i, onRun: o }) {
|
|
4099
4125
|
let [s, c] = a.useState(!1), l = a.useMemo(() => ({ record: t || {} }), [t]), u = st(e.disabled), d = lt(typeof u == "string" ? u : void 0, l);
|
|
4100
4126
|
return /* @__PURE__ */ Q(x, {
|
|
4101
4127
|
variant: n,
|
|
@@ -4114,7 +4140,7 @@ function gr({ action: e, record: t, variant: n, size: r, label: i, onRun: o }) {
|
|
|
4114
4140
|
}
|
|
4115
4141
|
//#endregion
|
|
4116
4142
|
//#region src/renderers/record-history.tsx
|
|
4117
|
-
var
|
|
4143
|
+
var br = (e) => {
|
|
4118
4144
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
4119
4145
|
return {
|
|
4120
4146
|
designer: {
|
|
@@ -4124,14 +4150,14 @@ var _r = (e) => {
|
|
|
4124
4150
|
},
|
|
4125
4151
|
rest: i
|
|
4126
4152
|
};
|
|
4127
|
-
},
|
|
4153
|
+
}, xr = /* @__PURE__ */ new Set([
|
|
4128
4154
|
"created",
|
|
4129
4155
|
"updated",
|
|
4130
4156
|
"assigned",
|
|
4131
4157
|
"shared",
|
|
4132
4158
|
"deleted"
|
|
4133
|
-
]),
|
|
4134
|
-
let { designer: r } =
|
|
4159
|
+
]), Sr = ({ schema: e = {}, className: t, ...n }) => {
|
|
4160
|
+
let { designer: r } = br(n), i = ht(), o = Array.isArray(e.entries) ? e.entries : Array.isArray(e.properties?.entries) ? e.properties.entries : void 0, s = e.loading ?? e.properties?.loading, c = e.emptyText ?? e.properties?.emptyText, l = Number(e.limit ?? e.properties?.limit ?? 50) || 50, u = i?.objectName, d = i?.data?.id ?? i?.data?._id ?? i?.recordId, f = i?.dataSource, p = o === void 0 && !!f?.find && !!u && d != null, [m, h] = a.useState(null), [g, _] = a.useState(!1);
|
|
4135
4161
|
a.useEffect(() => {
|
|
4136
4162
|
if (!p) return;
|
|
4137
4163
|
let e = !1;
|
|
@@ -4144,7 +4170,7 @@ var _r = (e) => {
|
|
|
4144
4170
|
$top: Math.max(1, l)
|
|
4145
4171
|
})).then((t) => {
|
|
4146
4172
|
if (e) return;
|
|
4147
|
-
let n = (t?.data ?? t?.records ?? []).filter((e) =>
|
|
4173
|
+
let n = (t?.data ?? t?.records ?? []).filter((e) => xr.has(e?.type)).map((e) => {
|
|
4148
4174
|
let t = e.timestamp;
|
|
4149
4175
|
return (!t || t === "NOW()" || Number.isNaN(Date.parse(t))) && (t = e.created_at), {
|
|
4150
4176
|
id: e.id,
|
|
@@ -4174,13 +4200,13 @@ var _r = (e) => {
|
|
|
4174
4200
|
return /* @__PURE__ */ Z("div", {
|
|
4175
4201
|
className: t,
|
|
4176
4202
|
...r,
|
|
4177
|
-
children: /* @__PURE__ */ Z(
|
|
4203
|
+
children: /* @__PURE__ */ Z(Sn, {
|
|
4178
4204
|
entries: v,
|
|
4179
4205
|
loading: y,
|
|
4180
4206
|
emptyText: c
|
|
4181
4207
|
})
|
|
4182
4208
|
});
|
|
4183
|
-
},
|
|
4209
|
+
}, Cr = (e) => {
|
|
4184
4210
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
4185
4211
|
return {
|
|
4186
4212
|
designer: {
|
|
@@ -4190,8 +4216,8 @@ var _r = (e) => {
|
|
|
4190
4216
|
},
|
|
4191
4217
|
rest: i
|
|
4192
4218
|
};
|
|
4193
|
-
},
|
|
4194
|
-
let r = ht(), i = vt(), { t: o } = $(), { designer: s } =
|
|
4219
|
+
}, wr = (e) => e.replace(/[_-]+/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()).trim(), Tr = (e, t) => t && e?.[t] != null && e[t] !== "" ? String(e[t]) : e?.name || e?.title || e?.subject || e?.label || e?.email || e?.username || e?.code || e?.slug || e?.provider_id || e?.user_agent || e?.ip_address || e?.id || "—", Er = ({ schema: e = {}, className: t, ...n }) => {
|
|
4220
|
+
let r = ht(), i = vt(), { t: o } = $(), { designer: s } = Cr(n), c = jt().appName, l = Array.isArray(e.entries) ? e.entries : Array.isArray(e.properties?.entries) ? e.properties.entries : [], u = r?.recordId, d = r?.dataSource, [f, p] = a.useState({}), m = a.useRef(null), [h, g] = a.useState(!1), _ = a.useRef(!0);
|
|
4195
4221
|
a.useEffect(() => (_.current = !0, () => {
|
|
4196
4222
|
_.current = !1;
|
|
4197
4223
|
}), []);
|
|
@@ -4271,8 +4297,8 @@ var _r = (e) => {
|
|
|
4271
4297
|
return x && t && !t.loading && !t.error && t.total === 0;
|
|
4272
4298
|
}).map((e) => e.objectName)), k = l.filter((e) => E || !O.has(e.objectName)), A = l.filter((e) => O.has(e.objectName)).map((e) => e.title || (i?.objectLabel ? i.objectLabel({
|
|
4273
4299
|
name: e.objectName,
|
|
4274
|
-
label:
|
|
4275
|
-
}) :
|
|
4300
|
+
label: wr(e.objectName)
|
|
4301
|
+
}) : wr(e.objectName)));
|
|
4276
4302
|
return /* @__PURE__ */ Q("div", {
|
|
4277
4303
|
ref: m,
|
|
4278
4304
|
className: G("flex flex-col gap-3", e.className, t),
|
|
@@ -4291,8 +4317,8 @@ var _r = (e) => {
|
|
|
4291
4317
|
className: "text-sm font-semibold tracking-tight truncate",
|
|
4292
4318
|
children: e.title || (i?.objectLabel ? i.objectLabel({
|
|
4293
4319
|
name: e.objectName,
|
|
4294
|
-
label:
|
|
4295
|
-
}) :
|
|
4320
|
+
label: wr(e.objectName)
|
|
4321
|
+
}) : wr(e.objectName))
|
|
4296
4322
|
}), /* @__PURE__ */ Q("div", {
|
|
4297
4323
|
className: "flex items-center gap-2 shrink-0",
|
|
4298
4324
|
children: [!n.loading && /* @__PURE__ */ Z(b, {
|
|
@@ -4321,7 +4347,7 @@ var _r = (e) => {
|
|
|
4321
4347
|
}) : /* @__PURE__ */ Z("ul", {
|
|
4322
4348
|
className: "divide-y",
|
|
4323
4349
|
children: n.items.map((t) => {
|
|
4324
|
-
let n = t.id || t._id, r =
|
|
4350
|
+
let n = t.id || t._id, r = Tr(t, e.displayField), i = n ? `../${e.objectName}/record/${encodeURIComponent(String(n))}` : void 0;
|
|
4325
4351
|
return /* @__PURE__ */ Z("li", {
|
|
4326
4352
|
className: "px-4 py-2",
|
|
4327
4353
|
children: i ? /* @__PURE__ */ Q(At, {
|
|
@@ -4358,7 +4384,7 @@ var _r = (e) => {
|
|
|
4358
4384
|
})]
|
|
4359
4385
|
})]
|
|
4360
4386
|
});
|
|
4361
|
-
},
|
|
4387
|
+
}, Dr = {
|
|
4362
4388
|
info: {
|
|
4363
4389
|
wrap: "border-blue-300/60 bg-blue-50 text-blue-900 dark:border-blue-700/40 dark:bg-blue-950/30 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-300",
|
|
4364
4390
|
icon: "Info"
|
|
@@ -4376,74 +4402,74 @@ var _r = (e) => {
|
|
|
4376
4402
|
icon: "CheckCircle2"
|
|
4377
4403
|
}
|
|
4378
4404
|
};
|
|
4379
|
-
function
|
|
4405
|
+
function Or(e) {
|
|
4380
4406
|
let t = e?.properties ?? {};
|
|
4381
4407
|
return {
|
|
4382
4408
|
...e,
|
|
4383
4409
|
...t
|
|
4384
4410
|
};
|
|
4385
4411
|
}
|
|
4386
|
-
var
|
|
4387
|
-
let n =
|
|
4412
|
+
var kr = ({ schema: e = {}, className: t }) => {
|
|
4413
|
+
let n = Or(e), r = ht(), a = r?.data, c = r?.objectName || "", l = r?.recordId ?? a?.id, { language: u } = Rt(), d = Ft(n.title, u), f = Ft(n.body, u), p = Ft(n.action?.label, u), m = [
|
|
4388
4414
|
"info",
|
|
4389
4415
|
"warning",
|
|
4390
4416
|
"error",
|
|
4391
4417
|
"success"
|
|
4392
|
-
].includes(n.severity) ? n.severity : "info",
|
|
4418
|
+
].includes(n.severity) ? n.severity : "info", h = Dr[m], _ = n.icon || h.icon, v = st(n.visible), y = lt(v, { record: a }), b = i.useMemo(() => {
|
|
4393
4419
|
if (!n.dismissible) return null;
|
|
4394
|
-
let e = n.dismissKey || n.title ||
|
|
4420
|
+
let e = n.dismissKey || Ft(n.title, "en") || m;
|
|
4395
4421
|
return `os.record-alert:${c}:${l ?? "_"}:${e}`;
|
|
4396
4422
|
}, [
|
|
4397
4423
|
n.dismissible,
|
|
4398
4424
|
n.dismissKey,
|
|
4399
4425
|
n.title,
|
|
4400
|
-
|
|
4426
|
+
m,
|
|
4401
4427
|
c,
|
|
4402
4428
|
l
|
|
4403
|
-
]), [
|
|
4404
|
-
if (!
|
|
4429
|
+
]), [S, C] = i.useState(() => {
|
|
4430
|
+
if (!b || typeof window > "u") return !1;
|
|
4405
4431
|
try {
|
|
4406
|
-
return window.localStorage.getItem(
|
|
4432
|
+
return window.localStorage.getItem(b) === "1";
|
|
4407
4433
|
} catch {
|
|
4408
4434
|
return !1;
|
|
4409
4435
|
}
|
|
4410
|
-
}),
|
|
4411
|
-
if (!(!
|
|
4412
|
-
}, [
|
|
4413
|
-
actions: i.useMemo(() =>
|
|
4436
|
+
}), w = n.action?.actionName, { item: T } = pt("object", w && c ? c : null), E = i.useMemo(() => {
|
|
4437
|
+
if (!(!w || !T?.actions)) return T.actions.find((e) => e.name === w);
|
|
4438
|
+
}, [w, T]), { executeAction: D } = ct({
|
|
4439
|
+
actions: i.useMemo(() => E ? [E] : [], [E]),
|
|
4414
4440
|
context: {
|
|
4415
4441
|
record: a,
|
|
4416
4442
|
recordId: l,
|
|
4417
4443
|
objectName: c
|
|
4418
4444
|
}
|
|
4419
4445
|
});
|
|
4420
|
-
return
|
|
4421
|
-
className: G("relative pr-12",
|
|
4422
|
-
role:
|
|
4423
|
-
"aria-live":
|
|
4446
|
+
return S || !a || Object.keys(a).length === 0 || v !== void 0 && !y ? null : /* @__PURE__ */ Q(o, {
|
|
4447
|
+
className: G("relative pr-12", h.wrap, t),
|
|
4448
|
+
role: m === "error" ? "alert" : "status",
|
|
4449
|
+
"aria-live": m === "error" ? "assertive" : "polite",
|
|
4424
4450
|
children: [
|
|
4425
4451
|
/* @__PURE__ */ Z(j, {
|
|
4426
|
-
name:
|
|
4452
|
+
name: _,
|
|
4427
4453
|
className: "h-4 w-4",
|
|
4428
4454
|
"aria-hidden": "true"
|
|
4429
4455
|
}),
|
|
4430
|
-
|
|
4431
|
-
|
|
4456
|
+
d ? /* @__PURE__ */ Z(g, { children: d }) : null,
|
|
4457
|
+
f || E ? /* @__PURE__ */ Q(s, { children: [f ? /* @__PURE__ */ Z("p", {
|
|
4432
4458
|
className: "mb-2 last:mb-0",
|
|
4433
|
-
children:
|
|
4434
|
-
}) : null,
|
|
4459
|
+
children: f
|
|
4460
|
+
}) : null, E ? /* @__PURE__ */ Z(x, {
|
|
4435
4461
|
size: "sm",
|
|
4436
|
-
variant: n.action?.variant || (
|
|
4462
|
+
variant: n.action?.variant || (m === "error" ? "destructive" : "default"),
|
|
4437
4463
|
onClick: () => {
|
|
4438
|
-
|
|
4464
|
+
E?.name && D(E.name);
|
|
4439
4465
|
},
|
|
4440
|
-
children:
|
|
4466
|
+
children: p || E.label || E.name
|
|
4441
4467
|
}) : null] }) : null,
|
|
4442
4468
|
n.dismissible ? /* @__PURE__ */ Z("button", {
|
|
4443
4469
|
type: "button",
|
|
4444
4470
|
onClick: () => {
|
|
4445
|
-
if (
|
|
4446
|
-
window.localStorage.setItem(
|
|
4471
|
+
if (C(!0), b) try {
|
|
4472
|
+
window.localStorage.setItem(b, "1");
|
|
4447
4473
|
} catch {}
|
|
4448
4474
|
},
|
|
4449
4475
|
"aria-label": "Dismiss",
|
|
@@ -4456,7 +4482,7 @@ var Er = ({ schema: e = {}, className: t }) => {
|
|
|
4456
4482
|
}) : null
|
|
4457
4483
|
]
|
|
4458
4484
|
});
|
|
4459
|
-
},
|
|
4485
|
+
}, Ar = /* @__PURE__ */ new Set([
|
|
4460
4486
|
"id",
|
|
4461
4487
|
"_id",
|
|
4462
4488
|
"__v",
|
|
@@ -4471,15 +4497,15 @@ var Er = ({ schema: e = {}, className: t }) => {
|
|
|
4471
4497
|
"owner_id",
|
|
4472
4498
|
"deleted_at",
|
|
4473
4499
|
"is_deleted"
|
|
4474
|
-
]),
|
|
4475
|
-
function
|
|
4500
|
+
]), jr = 480, Mr = 95;
|
|
4501
|
+
function Nr({ open: e, onClose: t, title: n, record: r, objectName: i, recordId: o, dataSource: s, objectSchema: c, width: l = "min(960px, 60vw)", columns: u = 2, systemFields: d = Ar, onFieldSave: f, onDelete: p, resizable: m = !0, fullPageHref: h }) {
|
|
4476
4502
|
let { t: g } = $(), _ = `objectui.drawerWidth.${i}`, [v, y] = a.useState(() => {
|
|
4477
4503
|
if (typeof window > "u" || !m) return null;
|
|
4478
4504
|
try {
|
|
4479
4505
|
let e = window.localStorage.getItem(_);
|
|
4480
4506
|
if (e) {
|
|
4481
4507
|
let t = parseInt(e, 10);
|
|
4482
|
-
if (Number.isFinite(t) && t >=
|
|
4508
|
+
if (Number.isFinite(t) && t >= jr) return t;
|
|
4483
4509
|
}
|
|
4484
4510
|
} catch {}
|
|
4485
4511
|
return null;
|
|
@@ -4501,7 +4527,7 @@ function Ar({ open: e, onClose: t, title: n, record: r, objectName: i, recordId:
|
|
|
4501
4527
|
let n = (e) => {
|
|
4502
4528
|
let t = S.current;
|
|
4503
4529
|
if (!t) return;
|
|
4504
|
-
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth *
|
|
4530
|
+
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth * Mr / 100 : 1600, i = Math.min(r, Math.max(jr, t.startWidth + n));
|
|
4505
4531
|
y(Math.round(i));
|
|
4506
4532
|
}, r = () => {
|
|
4507
4533
|
S.current, S.current = null, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", r);
|
|
@@ -4558,15 +4584,15 @@ function Ar({ open: e, onClose: t, title: n, record: r, objectName: i, recordId:
|
|
|
4558
4584
|
}),
|
|
4559
4585
|
/* @__PURE__ */ Z("div", {
|
|
4560
4586
|
className: "px-6 pt-6 pb-6",
|
|
4561
|
-
children: /* @__PURE__ */ Z(
|
|
4587
|
+
children: /* @__PURE__ */ Z(Mn, {
|
|
4562
4588
|
dataSource: s,
|
|
4563
|
-
inlineEdit:
|
|
4589
|
+
inlineEdit: !!f,
|
|
4564
4590
|
schema: {
|
|
4565
4591
|
type: "detail-view",
|
|
4566
4592
|
objectName: i,
|
|
4567
4593
|
resourceId: String(o),
|
|
4568
4594
|
data: r,
|
|
4569
|
-
showDelete:
|
|
4595
|
+
showDelete: !!p,
|
|
4570
4596
|
columns: u,
|
|
4571
4597
|
fields: T,
|
|
4572
4598
|
actions: h ? [{
|
|
@@ -4581,34 +4607,34 @@ function Ar({ open: e, onClose: t, title: n, record: r, objectName: i, recordId:
|
|
|
4581
4607
|
}]
|
|
4582
4608
|
}] : void 0
|
|
4583
4609
|
},
|
|
4584
|
-
onFieldSave: async (e, t) => {
|
|
4610
|
+
onFieldSave: f ? async (e, t) => {
|
|
4585
4611
|
try {
|
|
4586
|
-
await f
|
|
4612
|
+
await f(e, t);
|
|
4587
4613
|
} catch (e) {
|
|
4588
|
-
console.error("[RecordDetailDrawer] inline field save failed:", e);
|
|
4614
|
+
throw console.error("[RecordDetailDrawer] inline field save failed:", e), e;
|
|
4589
4615
|
}
|
|
4590
|
-
},
|
|
4591
|
-
onDelete: async () => {
|
|
4616
|
+
} : void 0,
|
|
4617
|
+
onDelete: p ? async () => {
|
|
4592
4618
|
try {
|
|
4593
|
-
await p
|
|
4619
|
+
await p(), t();
|
|
4594
4620
|
} catch (e) {
|
|
4595
4621
|
console.error("[RecordDetailDrawer] delete failed:", e);
|
|
4596
4622
|
}
|
|
4597
|
-
}
|
|
4623
|
+
} : void 0
|
|
4598
4624
|
})
|
|
4599
4625
|
})
|
|
4600
4626
|
]
|
|
4601
4627
|
})
|
|
4602
4628
|
});
|
|
4603
4629
|
}
|
|
4604
|
-
function
|
|
4630
|
+
function Pr(e, t) {
|
|
4605
4631
|
if (typeof window > "u") return null;
|
|
4606
4632
|
let n = window.location.pathname, r = `/${e}`, i = n.indexOf(r);
|
|
4607
4633
|
return `${i >= 0 ? n.slice(0, i) : n.replace(/\/$/, "")}/${e}/record/${encodeURIComponent(String(t))}`;
|
|
4608
4634
|
}
|
|
4609
4635
|
//#endregion
|
|
4610
4636
|
//#region src/InlineCreateRelated.tsx
|
|
4611
|
-
var
|
|
4637
|
+
var Fr = ({ objectName: e, relationshipField: t, fields: n, onCreateRecord: r, onLinkRecord: a, onSearch: o, existingRecords: s = [], className: c }) => {
|
|
4612
4638
|
let [l, u] = i.useState(!1), [d, f] = i.useState("create"), [p, m] = i.useState({}), [h, g] = i.useState(""), [_, v] = i.useState(s), [y, b] = i.useState(!1), [E, D] = i.useState(!1), O = i.useMemo(() => {
|
|
4613
4639
|
if (!h.trim()) return _;
|
|
4614
4640
|
let e = h.toLowerCase();
|
|
@@ -4782,7 +4808,7 @@ var Mr = ({ objectName: e, relationshipField: t, fields: n, onCreateRecord: r, o
|
|
|
4782
4808
|
};
|
|
4783
4809
|
//#endregion
|
|
4784
4810
|
//#region src/DiffView.tsx
|
|
4785
|
-
function
|
|
4811
|
+
function Ir(e, t) {
|
|
4786
4812
|
if (e == null) return ["(empty)"];
|
|
4787
4813
|
switch (t) {
|
|
4788
4814
|
case "json": try {
|
|
@@ -4801,7 +4827,7 @@ function Nr(e, t) {
|
|
|
4801
4827
|
default: return String(e).split("\n");
|
|
4802
4828
|
}
|
|
4803
4829
|
}
|
|
4804
|
-
function
|
|
4830
|
+
function Lr(e, t) {
|
|
4805
4831
|
let n = [], r = Math.max(e.length, t.length);
|
|
4806
4832
|
for (let i = 0; i < r; i++) {
|
|
4807
4833
|
let r = i < e.length ? e[i] : void 0, a = i < t.length ? t[i] : void 0;
|
|
@@ -4818,16 +4844,16 @@ function Pr(e, t) {
|
|
|
4818
4844
|
}
|
|
4819
4845
|
return n;
|
|
4820
4846
|
}
|
|
4821
|
-
var
|
|
4847
|
+
var Rr = {
|
|
4822
4848
|
added: "bg-green-50 text-green-800 dark:bg-green-950/30 dark:text-green-300",
|
|
4823
4849
|
removed: "bg-red-50 text-red-800 dark:bg-red-950/30 dark:text-red-300",
|
|
4824
4850
|
unchanged: "text-muted-foreground"
|
|
4825
|
-
},
|
|
4851
|
+
}, zr = {
|
|
4826
4852
|
added: "+",
|
|
4827
4853
|
removed: "-",
|
|
4828
4854
|
unchanged: " "
|
|
4829
|
-
},
|
|
4830
|
-
let { t: s } = $(), [c, l] = i.useState(a), u = i.useMemo(() =>
|
|
4855
|
+
}, Br = ({ oldValue: e, newValue: t, fieldName: n, fieldType: r = "string", mode: a = "unified", className: o }) => {
|
|
4856
|
+
let { t: s } = $(), [c, l] = i.useState(a), u = i.useMemo(() => Ir(e, r), [e, r]), d = i.useMemo(() => Ir(t, r), [t, r]), f = i.useMemo(() => Lr(u, d), [u, d]), p = f.some((e) => e.type !== "unchanged"), m = i.useMemo(() => {
|
|
4831
4857
|
if (c !== "side-by-side") return [];
|
|
4832
4858
|
let e = [], t = 0;
|
|
4833
4859
|
for (; t < f.length;) {
|
|
@@ -4885,10 +4911,10 @@ var Fr = {
|
|
|
4885
4911
|
children: p ? c === "unified" ? /* @__PURE__ */ Z("div", {
|
|
4886
4912
|
className: "font-mono text-xs overflow-x-auto",
|
|
4887
4913
|
children: f.map((e, t) => /* @__PURE__ */ Q("div", {
|
|
4888
|
-
className: G("px-4 py-0.5 whitespace-pre-wrap border-l-2",
|
|
4914
|
+
className: G("px-4 py-0.5 whitespace-pre-wrap border-l-2", Rr[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
|
|
4889
4915
|
children: [/* @__PURE__ */ Z("span", {
|
|
4890
4916
|
className: "select-none mr-2 inline-block w-3 text-center opacity-60",
|
|
4891
|
-
children:
|
|
4917
|
+
children: zr[e.type]
|
|
4892
4918
|
}), e.value]
|
|
4893
4919
|
}, t))
|
|
4894
4920
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -4905,10 +4931,10 @@ var Fr = {
|
|
|
4905
4931
|
children: s("detail.currentVersion")
|
|
4906
4932
|
}),
|
|
4907
4933
|
m.map((e, t) => /* @__PURE__ */ Q(i.Fragment, { children: [/* @__PURE__ */ Z("div", {
|
|
4908
|
-
className: G("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ?
|
|
4934
|
+
className: G("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? Rr[e.left.type] : "bg-muted/20"),
|
|
4909
4935
|
children: e.left?.value ?? ""
|
|
4910
4936
|
}), /* @__PURE__ */ Z("div", {
|
|
4911
|
-
className: G("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ?
|
|
4937
|
+
className: G("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? Rr[e.right.type] : "bg-muted/20"),
|
|
4912
4938
|
children: e.right?.value ?? ""
|
|
4913
4939
|
})] }, t))
|
|
4914
4940
|
]
|
|
@@ -4919,7 +4945,7 @@ var Fr = {
|
|
|
4919
4945
|
})
|
|
4920
4946
|
})]
|
|
4921
4947
|
});
|
|
4922
|
-
},
|
|
4948
|
+
}, Vr = ({ currentIndex: e, totalRecords: t, recordIds: n, onNavigate: r, onSearch: a, className: o }) => {
|
|
4923
4949
|
let { t: s } = $(), [c, l] = i.useState(""), [u, d] = i.useState(!1), f = i.useRef(null), p = e > 0, m = e > 0, h = e < t - 1, g = e < t - 1, _ = i.useCallback(() => {
|
|
4924
4950
|
p && r(n[0]);
|
|
4925
4951
|
}, [
|
|
@@ -5052,18 +5078,18 @@ var Fr = {
|
|
|
5052
5078
|
})] })
|
|
5053
5079
|
]
|
|
5054
5080
|
});
|
|
5055
|
-
},
|
|
5081
|
+
}, Hr = 28, Ur = [
|
|
5056
5082
|
"fill-primary stroke-primary",
|
|
5057
5083
|
"fill-blue-500 stroke-blue-500",
|
|
5058
5084
|
"fill-emerald-500 stroke-emerald-500",
|
|
5059
5085
|
"fill-amber-500 stroke-amber-500"
|
|
5060
|
-
],
|
|
5086
|
+
], Wr = [
|
|
5061
5087
|
"fill-primary-foreground",
|
|
5062
5088
|
"fill-white",
|
|
5063
5089
|
"fill-white",
|
|
5064
5090
|
"fill-white"
|
|
5065
5091
|
];
|
|
5066
|
-
function
|
|
5092
|
+
function Gr(e, t, n, r, i) {
|
|
5067
5093
|
let a = [], o = [], s = /* @__PURE__ */ new Set(), c = r / 2, l = i / 2;
|
|
5068
5094
|
a.push({
|
|
5069
5095
|
id: e.id,
|
|
@@ -5127,10 +5153,10 @@ function Hr(e, t, n, r, i) {
|
|
|
5127
5153
|
edges: o
|
|
5128
5154
|
};
|
|
5129
5155
|
}
|
|
5130
|
-
function
|
|
5156
|
+
function Kr(e, t = 6) {
|
|
5131
5157
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
5132
5158
|
}
|
|
5133
|
-
var
|
|
5159
|
+
var qr = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, className: a }) => {
|
|
5134
5160
|
let o = i.useRef(null), [s, c] = i.useState({
|
|
5135
5161
|
width: 500,
|
|
5136
5162
|
height: 400
|
|
@@ -5151,7 +5177,7 @@ var Wr = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
5151
5177
|
});
|
|
5152
5178
|
return n.observe(t), () => n.disconnect();
|
|
5153
5179
|
}, []);
|
|
5154
|
-
let { nodes: d, edges: f } = i.useMemo(() =>
|
|
5180
|
+
let { nodes: d, edges: f } = i.useMemo(() => Gr(e, t, n, s.width, s.height), [
|
|
5155
5181
|
e,
|
|
5156
5182
|
t,
|
|
5157
5183
|
n,
|
|
@@ -5193,7 +5219,7 @@ var Wr = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
5193
5219
|
strokeWidth: 1.5,
|
|
5194
5220
|
strokeOpacity: .5
|
|
5195
5221
|
}, `edge-${t}`)), d.map((e) => {
|
|
5196
|
-
let t = l === e.id, n =
|
|
5222
|
+
let t = l === e.id, n = Ur[Math.min(e.level, Ur.length - 1)], i = Wr[Math.min(e.level, Wr.length - 1)], a = e.level === 0 ? 34 : Hr;
|
|
5197
5223
|
return /* @__PURE__ */ Q("g", {
|
|
5198
5224
|
className: G("cursor-pointer transition-transform", r && "hover:opacity-80"),
|
|
5199
5225
|
onClick: () => r?.(e.id),
|
|
@@ -5215,7 +5241,7 @@ var Wr = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
5215
5241
|
textAnchor: "middle",
|
|
5216
5242
|
dominantBaseline: "central",
|
|
5217
5243
|
className: G("text-[10px] font-medium pointer-events-none", i),
|
|
5218
|
-
children:
|
|
5244
|
+
children: Kr(e.label)
|
|
5219
5245
|
}),
|
|
5220
5246
|
e.type && /* @__PURE__ */ Z("text", {
|
|
5221
5247
|
x: e.x,
|
|
@@ -5249,7 +5275,7 @@ var Wr = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
5249
5275
|
};
|
|
5250
5276
|
//#endregion
|
|
5251
5277
|
//#region src/PointInTimeRestore.tsx
|
|
5252
|
-
function
|
|
5278
|
+
function Jr(e) {
|
|
5253
5279
|
try {
|
|
5254
5280
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
5255
5281
|
if (r < 1) return "just now";
|
|
@@ -5260,7 +5286,7 @@ function Gr(e) {
|
|
|
5260
5286
|
return e;
|
|
5261
5287
|
}
|
|
5262
5288
|
}
|
|
5263
|
-
var
|
|
5289
|
+
var Yr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
5264
5290
|
let [a, o] = i.useState(null), [s, c] = i.useState(!1), [l, u] = i.useState(!1), d = i.useMemo(() => t.find((e) => e.id === a) ?? null, [t, a]), f = i.useCallback(async () => {
|
|
5265
5291
|
if (!(!d || !n)) {
|
|
5266
5292
|
if (!s) {
|
|
@@ -5332,7 +5358,7 @@ var Kr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
|
5332
5358
|
children: e.user
|
|
5333
5359
|
}), /* @__PURE__ */ Z("span", {
|
|
5334
5360
|
className: "text-xs text-muted-foreground",
|
|
5335
|
-
children:
|
|
5361
|
+
children: Jr(e.timestamp)
|
|
5336
5362
|
})]
|
|
5337
5363
|
}), /* @__PURE__ */ Q("p", {
|
|
5338
5364
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
@@ -5405,7 +5431,7 @@ var Kr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
|
5405
5431
|
children: [
|
|
5406
5432
|
"This will restore the record to its state at",
|
|
5407
5433
|
" ",
|
|
5408
|
-
|
|
5434
|
+
Jr(d.timestamp),
|
|
5409
5435
|
". Continue?"
|
|
5410
5436
|
]
|
|
5411
5437
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -5436,7 +5462,7 @@ var Kr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
|
5436
5462
|
})]
|
|
5437
5463
|
}) })]
|
|
5438
5464
|
});
|
|
5439
|
-
},
|
|
5465
|
+
}, Xr = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: n = !1, className: r }) => {
|
|
5440
5466
|
let [a, o] = i.useState(""), [s, c] = i.useState(!1), l = i.useCallback(async () => {
|
|
5441
5467
|
let t = a.trim();
|
|
5442
5468
|
if (t) {
|
|
@@ -5469,7 +5495,7 @@ var Kr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
|
5469
5495
|
children: /* @__PURE__ */ Z(Qe, { className: "h-4 w-4" })
|
|
5470
5496
|
})]
|
|
5471
5497
|
});
|
|
5472
|
-
},
|
|
5498
|
+
}, Zr = ({ query: e, suggestions: t, onSelect: n, visible: r = !0, activeIndex: a = 0, className: o }) => {
|
|
5473
5499
|
let s = i.useMemo(() => {
|
|
5474
5500
|
if (!e) return t;
|
|
5475
5501
|
let n = e.toLowerCase();
|
|
@@ -5511,7 +5537,7 @@ var Kr = ({ recordId: e, revisions: t, onRestore: n, className: r }) => {
|
|
|
5511
5537
|
}, e.id))
|
|
5512
5538
|
});
|
|
5513
5539
|
};
|
|
5514
|
-
function
|
|
5540
|
+
function Qr(e, t, n) {
|
|
5515
5541
|
return {
|
|
5516
5542
|
type: e.type,
|
|
5517
5543
|
id: e.id,
|
|
@@ -5522,7 +5548,7 @@ function Yr(e, t, n) {
|
|
|
5522
5548
|
}
|
|
5523
5549
|
//#endregion
|
|
5524
5550
|
//#region src/extractMentions.ts
|
|
5525
|
-
function
|
|
5551
|
+
function $r(e, t) {
|
|
5526
5552
|
if (!e || !t.length) return [];
|
|
5527
5553
|
let n = [...t].sort((e, t) => t.label.length - e.label.length), r = e, i = /* @__PURE__ */ new Set();
|
|
5528
5554
|
for (let e of n) {
|
|
@@ -5534,10 +5560,10 @@ function Xr(e, t) {
|
|
|
5534
5560
|
}
|
|
5535
5561
|
//#endregion
|
|
5536
5562
|
//#region src/synth/buildDefaultPageSchema.ts
|
|
5537
|
-
function
|
|
5563
|
+
function ei(e) {
|
|
5538
5564
|
return e == null ? [] : Array.isArray(e) ? e.filter((e) => e != null) : [e];
|
|
5539
5565
|
}
|
|
5540
|
-
function
|
|
5566
|
+
function ti(e) {
|
|
5541
5567
|
if (!e) return null;
|
|
5542
5568
|
let t = e.stageField;
|
|
5543
5569
|
if (t === !1) return null;
|
|
@@ -5555,7 +5581,7 @@ function Qr(e) {
|
|
|
5555
5581
|
}
|
|
5556
5582
|
return null;
|
|
5557
5583
|
}
|
|
5558
|
-
function
|
|
5584
|
+
function ni(e, t) {
|
|
5559
5585
|
if (!e || !t) return null;
|
|
5560
5586
|
let n = e.fields?.[t]?.options;
|
|
5561
5587
|
return !Array.isArray(n) || n.length === 0 ? null : n.map((e) => ({
|
|
@@ -5563,7 +5589,7 @@ function $r(e, t) {
|
|
|
5563
5589
|
label: e.label
|
|
5564
5590
|
}));
|
|
5565
5591
|
}
|
|
5566
|
-
function
|
|
5592
|
+
function ri(e, t, n = 4) {
|
|
5567
5593
|
if (!e) return [];
|
|
5568
5594
|
let r = Array.isArray(e.highlightFields) && e.highlightFields.length > 0 ? e.highlightFields : null;
|
|
5569
5595
|
if (r) return r.filter((e) => typeof e == "string" && e.length > 0).slice(0, n);
|
|
@@ -5638,22 +5664,22 @@ function ei(e, t, n = 4) {
|
|
|
5638
5664
|
}
|
|
5639
5665
|
return s;
|
|
5640
5666
|
}
|
|
5641
|
-
function
|
|
5667
|
+
function ii(e, t = {}) {
|
|
5642
5668
|
return {
|
|
5643
5669
|
type: "page:header",
|
|
5644
5670
|
recordChrome: t.recordChrome !== !1,
|
|
5645
5671
|
...Array.isArray(t.actions) && t.actions.length > 0 ? { actions: t.actions } : {}
|
|
5646
5672
|
};
|
|
5647
5673
|
}
|
|
5648
|
-
function
|
|
5674
|
+
function ai(e, t) {
|
|
5649
5675
|
return !Array.isArray(t) || t.length === 0 ? null : {
|
|
5650
5676
|
type: "record:quick_actions",
|
|
5651
5677
|
actions: t,
|
|
5652
5678
|
location: "record_header"
|
|
5653
5679
|
};
|
|
5654
5680
|
}
|
|
5655
|
-
function
|
|
5656
|
-
let n = t.statusField ??
|
|
5681
|
+
function oi(e, t = {}) {
|
|
5682
|
+
let n = t.statusField ?? ti(e), r = t.stages ?? (n ? ni(e, n) : null), i = t.highlightFields ?? ri(e, n), a = [];
|
|
5657
5683
|
return !t.hideHighlights && i.length > 0 && a.push({
|
|
5658
5684
|
type: "record:highlights",
|
|
5659
5685
|
fields: i
|
|
@@ -5663,9 +5689,9 @@ function ri(e, t = {}) {
|
|
|
5663
5689
|
stages: r
|
|
5664
5690
|
}), a;
|
|
5665
5691
|
}
|
|
5666
|
-
function
|
|
5692
|
+
function si(e) {
|
|
5667
5693
|
if (!e) return null;
|
|
5668
|
-
let t =
|
|
5694
|
+
let t = zt(e);
|
|
5669
5695
|
if (!t) return null;
|
|
5670
5696
|
let n = e.fields || {}, r = (e) => {
|
|
5671
5697
|
let t = n[e] || {};
|
|
@@ -5678,7 +5704,7 @@ function ii(e) {
|
|
|
5678
5704
|
...t.reference_field ? { reference_field: t.reference_field } : {},
|
|
5679
5705
|
...t.currency ? { currency: t.currency } : {}
|
|
5680
5706
|
};
|
|
5681
|
-
}, i =
|
|
5707
|
+
}, i = Ht(t.reduce((e, t) => e + t.fields.length, 0));
|
|
5682
5708
|
return t.map((e) => ({
|
|
5683
5709
|
...e.key === void 0 ? {} : {
|
|
5684
5710
|
name: e.key,
|
|
@@ -5690,21 +5716,21 @@ function ii(e) {
|
|
|
5690
5716
|
fields: e.fields.map(r)
|
|
5691
5717
|
}));
|
|
5692
5718
|
}
|
|
5693
|
-
function
|
|
5694
|
-
return Array.isArray(t) && t.length > 0 ? t :
|
|
5719
|
+
function ci(e, t) {
|
|
5720
|
+
return Array.isArray(t) && t.length > 0 ? t : si(e) ?? void 0;
|
|
5695
5721
|
}
|
|
5696
|
-
function
|
|
5722
|
+
function li(e, t, n) {
|
|
5697
5723
|
return {
|
|
5698
5724
|
type: "record:details",
|
|
5699
|
-
sections:
|
|
5725
|
+
sections: ci(e, t),
|
|
5700
5726
|
...n && n.length > 0 ? { hideFields: n } : {}
|
|
5701
5727
|
};
|
|
5702
5728
|
}
|
|
5703
|
-
function
|
|
5704
|
-
let n = t.statusField ??
|
|
5729
|
+
function ui(e, t = {}) {
|
|
5730
|
+
let n = t.statusField ?? ti(e), r = t.highlightFields ?? ri(e, n), i = [{
|
|
5705
5731
|
label: "Details",
|
|
5706
5732
|
value: "details",
|
|
5707
|
-
children: [
|
|
5733
|
+
children: [li(e, t.sections, r)]
|
|
5708
5734
|
}];
|
|
5709
5735
|
if (!t.hideRelatedTab && Array.isArray(t.related) && t.related.length > 0) {
|
|
5710
5736
|
let e = (e) => ({
|
|
@@ -5755,15 +5781,15 @@ function si(e, t = {}) {
|
|
|
5755
5781
|
items: i
|
|
5756
5782
|
};
|
|
5757
5783
|
}
|
|
5758
|
-
function
|
|
5784
|
+
function di() {
|
|
5759
5785
|
return { type: "record:discussion" };
|
|
5760
5786
|
}
|
|
5761
|
-
function
|
|
5787
|
+
function fi(e, t = {}) {
|
|
5762
5788
|
let n = t.slots || {}, r = [];
|
|
5763
|
-
"header" in n && n.header !== void 0 ? r.push(...
|
|
5789
|
+
"header" in n && n.header !== void 0 ? r.push(...ei(n.header)) : r.push(ii(e, {
|
|
5764
5790
|
recordChrome: t.recordChrome,
|
|
5765
5791
|
actions: t.headerActions
|
|
5766
|
-
})), "actions" in n && n.actions !== void 0 && r.push(...
|
|
5792
|
+
})), "actions" in n && n.actions !== void 0 && r.push(...ei(n.actions)), "alerts" in n && n.alerts !== void 0 && r.push(...ei(n.alerts)), "highlights" in n && n.highlights !== void 0 ? r.push(...ei(n.highlights)) : r.push(...oi(e, {
|
|
5767
5793
|
highlightFields: t.highlightFields,
|
|
5768
5794
|
statusField: t.statusField,
|
|
5769
5795
|
stages: t.stages,
|
|
@@ -5771,9 +5797,9 @@ function li(e, t = {}) {
|
|
|
5771
5797
|
hidePath: t.hidePath
|
|
5772
5798
|
}));
|
|
5773
5799
|
let i = t.showReferenceRail === !0 && !t.hideReferenceRail && Array.isArray(t.related) && t.related.length >= 2, a = t.hideRelatedTab ?? i;
|
|
5774
|
-
if ("tabs" in n && n.tabs !== void 0) r.push(...
|
|
5800
|
+
if ("tabs" in n && n.tabs !== void 0) r.push(...ei(n.tabs));
|
|
5775
5801
|
else if ("details" in n && n.details !== void 0) {
|
|
5776
|
-
let i =
|
|
5802
|
+
let i = ei(n.details), o = ui(e, {
|
|
5777
5803
|
sections: t.sections,
|
|
5778
5804
|
related: t.related,
|
|
5779
5805
|
showActivity: t.showActivity,
|
|
@@ -5787,7 +5813,7 @@ function li(e, t = {}) {
|
|
|
5787
5813
|
...o.items[0],
|
|
5788
5814
|
children: i
|
|
5789
5815
|
}), r.push(o);
|
|
5790
|
-
} else r.push(
|
|
5816
|
+
} else r.push(ui(e, {
|
|
5791
5817
|
sections: t.sections,
|
|
5792
5818
|
related: t.related,
|
|
5793
5819
|
showActivity: t.showActivity,
|
|
@@ -5797,12 +5823,12 @@ function li(e, t = {}) {
|
|
|
5797
5823
|
hideRelatedTab: a,
|
|
5798
5824
|
relatedLayout: t.relatedLayout
|
|
5799
5825
|
}));
|
|
5800
|
-
"discussion" in n && n.discussion !== void 0 ? r.push(...
|
|
5826
|
+
"discussion" in n && n.discussion !== void 0 ? r.push(...ei(n.discussion)) : t.hideDiscussion || r.push(di());
|
|
5801
5827
|
let o = [{
|
|
5802
5828
|
name: "main",
|
|
5803
5829
|
width: "full",
|
|
5804
5830
|
components: r
|
|
5805
|
-
}], s =
|
|
5831
|
+
}], s = ei(n.rightRail);
|
|
5806
5832
|
if (i || s.length > 0) {
|
|
5807
5833
|
let e = [];
|
|
5808
5834
|
i && e.push({
|
|
@@ -5830,7 +5856,7 @@ function li(e, t = {}) {
|
|
|
5830
5856
|
regions: o
|
|
5831
5857
|
};
|
|
5832
5858
|
}
|
|
5833
|
-
e.register("detail-view",
|
|
5859
|
+
e.register("detail-view", Mn, {
|
|
5834
5860
|
namespace: "plugin-detail",
|
|
5835
5861
|
label: "Detail View",
|
|
5836
5862
|
category: "Views",
|
|
@@ -5960,7 +5986,7 @@ e.register("detail-view", kn, {
|
|
|
5960
5986
|
tabs: [],
|
|
5961
5987
|
related: []
|
|
5962
5988
|
}
|
|
5963
|
-
}), e.register("detail-section",
|
|
5989
|
+
}), e.register("detail-section", en, {
|
|
5964
5990
|
namespace: "plugin-detail",
|
|
5965
5991
|
label: "Detail Section",
|
|
5966
5992
|
category: "Detail Components",
|
|
@@ -6011,7 +6037,7 @@ e.register("detail-view", kn, {
|
|
|
6011
6037
|
label: "Header Color"
|
|
6012
6038
|
}
|
|
6013
6039
|
]
|
|
6014
|
-
}), e.register("related-list",
|
|
6040
|
+
}), e.register("related-list", an, {
|
|
6015
6041
|
namespace: "plugin-detail",
|
|
6016
6042
|
label: "Related List",
|
|
6017
6043
|
category: "Detail Components",
|
|
@@ -6058,7 +6084,7 @@ e.register("detail-view", kn, {
|
|
|
6058
6084
|
label: "Columns"
|
|
6059
6085
|
}
|
|
6060
6086
|
]
|
|
6061
|
-
}), e.register("detail",
|
|
6087
|
+
}), e.register("detail", Mn, {
|
|
6062
6088
|
namespace: "view",
|
|
6063
6089
|
category: "view",
|
|
6064
6090
|
label: "Detail",
|
|
@@ -6081,7 +6107,7 @@ e.register("detail-view", kn, {
|
|
|
6081
6107
|
label: "Fields"
|
|
6082
6108
|
}
|
|
6083
6109
|
]
|
|
6084
|
-
}), e.register("record:details",
|
|
6110
|
+
}), e.register("record:details", zn, {
|
|
6085
6111
|
namespace: "record",
|
|
6086
6112
|
category: "record",
|
|
6087
6113
|
label: "Record Details",
|
|
@@ -6121,7 +6147,7 @@ e.register("detail-view", kn, {
|
|
|
6121
6147
|
description: "Explicit field list (overrides highlightFields)"
|
|
6122
6148
|
}
|
|
6123
6149
|
]
|
|
6124
|
-
}), e.register("record:related_list",
|
|
6150
|
+
}), e.register("record:related_list", Un, {
|
|
6125
6151
|
namespace: "record",
|
|
6126
6152
|
category: "record",
|
|
6127
6153
|
label: "Related List",
|
|
@@ -6184,7 +6210,7 @@ e.register("detail-view", kn, {
|
|
|
6184
6210
|
description: "Action IDs available for related records"
|
|
6185
6211
|
}
|
|
6186
6212
|
]
|
|
6187
|
-
}), e.register("record:highlights",
|
|
6213
|
+
}), e.register("record:highlights", Gn, {
|
|
6188
6214
|
namespace: "record",
|
|
6189
6215
|
category: "record",
|
|
6190
6216
|
label: "Highlights Panel",
|
|
@@ -6203,22 +6229,22 @@ e.register("detail-view", kn, {
|
|
|
6203
6229
|
defaultValue: "horizontal",
|
|
6204
6230
|
description: "Layout orientation for highlight fields"
|
|
6205
6231
|
}]
|
|
6206
|
-
}), e.register("record:activity",
|
|
6232
|
+
}), e.register("record:activity", dr, {
|
|
6207
6233
|
namespace: "record",
|
|
6208
6234
|
category: "record",
|
|
6209
6235
|
label: "Activity Timeline",
|
|
6210
6236
|
icon: "Activity"
|
|
6211
|
-
}), e.register("record:chatter",
|
|
6237
|
+
}), e.register("record:chatter", mr, {
|
|
6212
6238
|
namespace: "record",
|
|
6213
6239
|
category: "record",
|
|
6214
6240
|
label: "Chatter Feed",
|
|
6215
6241
|
icon: "MessageSquare"
|
|
6216
|
-
}), e.register("record:discussion",
|
|
6242
|
+
}), e.register("record:discussion", mr, {
|
|
6217
6243
|
namespace: "record",
|
|
6218
6244
|
category: "record",
|
|
6219
6245
|
label: "Discussion",
|
|
6220
6246
|
icon: "MessageSquare"
|
|
6221
|
-
}), e.register("record:path",
|
|
6247
|
+
}), e.register("record:path", gr, {
|
|
6222
6248
|
namespace: "record",
|
|
6223
6249
|
category: "record",
|
|
6224
6250
|
label: "Path / Stepper",
|
|
@@ -6235,29 +6261,29 @@ e.register("detail-view", kn, {
|
|
|
6235
6261
|
label: "Stages",
|
|
6236
6262
|
description: "Explicit stage definitions [{ value, label }] (else derived from field metadata)"
|
|
6237
6263
|
}]
|
|
6238
|
-
}), e.register("record:quick_actions",
|
|
6264
|
+
}), e.register("record:quick_actions", vr, {
|
|
6239
6265
|
namespace: "record",
|
|
6240
6266
|
category: "record",
|
|
6241
6267
|
label: "Quick Actions",
|
|
6242
6268
|
icon: "Zap"
|
|
6243
|
-
}), e.register("record:history",
|
|
6269
|
+
}), e.register("record:history", Sr, {
|
|
6244
6270
|
namespace: "record",
|
|
6245
6271
|
category: "record",
|
|
6246
6272
|
label: "History Timeline",
|
|
6247
6273
|
icon: "Clock"
|
|
6248
|
-
}), e.register("record:reference_rail",
|
|
6274
|
+
}), e.register("record:reference_rail", Er, {
|
|
6249
6275
|
namespace: "record",
|
|
6250
6276
|
category: "record",
|
|
6251
6277
|
label: "Reference Rail",
|
|
6252
6278
|
icon: "PanelRight"
|
|
6253
|
-
}), e.register("record:alert",
|
|
6279
|
+
}), e.register("record:alert", kr, {
|
|
6254
6280
|
namespace: "record",
|
|
6255
6281
|
category: "record",
|
|
6256
6282
|
label: "Alert Banner",
|
|
6257
6283
|
icon: "AlertTriangle"
|
|
6258
|
-
}), e.register("permission-facet-link",
|
|
6284
|
+
}), e.register("permission-facet-link", Yt, {
|
|
6259
6285
|
namespace: "field",
|
|
6260
6286
|
skipFallback: !0
|
|
6261
6287
|
});
|
|
6262
6288
|
//#endregion
|
|
6263
|
-
export {
|
|
6289
|
+
export { hn as ActivityTimeline, rr as CommentAttachment, Xr as CommentInput, Fn as ConcurrentUpdateDialog, Kt as DETAIL_DEFAULT_TRANSLATIONS, en as DetailSection, tn as DetailTabs, Mn as DetailView, Br as DiffView, Kn as FieldChangeItem, sn as HeaderHighlight, Sn as HistoryTimeline, Fr as InlineCreateRelated, Zr as MentionAutocomplete, Yr as PointInTimeRestore, Jn as ReactionPicker, dr as RecordActivityRenderer, lr as RecordActivityTimeline, kr as RecordAlertRenderer, fr as RecordChatterPanel, mr as RecordChatterRenderer, ln as RecordComments, Nr as RecordDetailDrawer, zn as RecordDetailsRenderer, Gn as RecordHighlightsRenderer, Sr as RecordHistoryRenderer, kn as RecordMetaFooter, Vr as RecordNavigationEnhanced, gr as RecordPathRenderer, vr as RecordQuickActionsRenderer, Er as RecordReferenceRailRenderer, Un as RecordRelatedListRenderer, an as RelatedList, qr as RelationshipGraph, $n as RichTextCommentInput, on as SectionGroup, Zn as SubscriptionToggle, Xn as ThreadedReplies, Ut as applyAutoSpan, Wt as applyDetailAutoLayout, ai as buildDefaultActions, li as buildDefaultDetails, di as buildDefaultDiscussion, ii as buildDefaultHeader, oi as buildDefaultHighlights, fi as buildDefaultPageSchema, ui as buildDefaultTabs, Qr as createMentionFromSuggestion, Gt as createSafeTranslationHook, si as deriveFieldGroupDetailSections, ri as deriveHighlightFields, Pr as deriveRecordPageHref, ni as deriveStages, ti as detectStatusField, $r as extractMentions, Ht as inferDetailColumns, In as isConcurrentUpdateError, Vt as isWideFieldType, ci as resolveDetailSections, $ as useDetailTranslation };
|