@object-ui/plugin-detail 3.1.5 → 3.3.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/.turbo/turbo-build.log +50 -47
- package/CHANGELOG.md +20 -0
- package/dist/{AddressField-DBkEyMcG.js → AddressField-CDLSeyNx.js} +1 -1
- package/dist/{AutoNumberField-Baa191z-.js → AutoNumberField-CtE7suf5.js} +1 -1
- package/dist/{AvatarField-YGj51ozd.js → AvatarField-Xuieq0ZI.js} +1 -1
- package/dist/{BooleanField-CaA898Tk.js → BooleanField-DwfMKknK.js} +1 -1
- package/dist/{CodeField-BU51nl1L.js → CodeField-CfwgRxx2.js} +1 -1
- package/dist/{ColorField-Cnf6ZM7c.js → ColorField-YKHA7dBD.js} +1 -1
- package/dist/{CurrencyField-Wg-XOId2.js → CurrencyField-tvS3fPAF.js} +1 -1
- package/dist/{DateField-Cth1ky_m.js → DateField-BKqXpkOh.js} +1 -1
- package/dist/{DateTimeField-B0m6FhHL.js → DateTimeField-CR-nJCE7.js} +1 -1
- package/dist/{EmailField-Do7qT_L_.js → EmailField-CgvW1Qal.js} +1 -1
- package/dist/{FileField-aRJAdbQb.js → FileField-BVAme2ML.js} +1 -1
- package/dist/{FormulaField-DTMkagFx.js → FormulaField-DamJ2VaG.js} +1 -1
- package/dist/{GeolocationField-RqpHWTEv.js → GeolocationField-C99z7ZBM.js} +1 -1
- package/dist/{GridField-D4IH0cpo.js → GridField-C9JbpTx_.js} +1 -1
- package/dist/{ImageField-BYCFajjr.js → ImageField-CDANtgVV.js} +1 -1
- package/dist/{LocationField-Bi_ew9sd.js → LocationField-ZSyZ0O-h.js} +1 -1
- package/dist/{LookupField-BjwlDPtt.js → LookupField-B3hQJt95.js} +307 -306
- package/dist/LookupField-D00z6gn_.js +2 -0
- package/dist/{MasterDetailField-I1A9oEGC.js → MasterDetailField-B0HTmmD7.js} +1 -1
- package/dist/{NumberField-D_NucQlp.js → NumberField-DL2QAL7X.js} +1 -1
- package/dist/{ObjectField-CG-LaM65.js → ObjectField-JYvUnuRO.js} +1 -1
- package/dist/{PasswordField-DBtluGJ1.js → PasswordField-DVTimsc3.js} +1 -1
- package/dist/{PercentField-B6sO_J3i.js → PercentField-DjR6BSpw.js} +1 -1
- package/dist/{PhoneField-CcQAWwR6.js → PhoneField-CX1JL-jp.js} +1 -1
- package/dist/{QRCodeField-CEjWs-J5.js → QRCodeField-CH_1pU6R.js} +1 -1
- package/dist/{RatingField-B_Mnr63i.js → RatingField-rRi_P0N0.js} +1 -1
- package/dist/{RichTextField-qOEJl5Ai.js → RichTextField-CJqLWlrb.js} +1 -1
- package/dist/SelectField-DGoDoRM_.js +30 -0
- package/dist/SelectField-XBVI50AD.js +2 -0
- package/dist/{SignatureField-CddhEK9u.js → SignatureField-2CnhcWI0.js} +1 -1
- package/dist/{SliderField-Df5hMzNc.js → SliderField-DEpMVXko.js} +1 -1
- package/dist/{SummaryField-DgiFm-Cr.js → SummaryField-7ch9aqAu.js} +1 -1
- package/dist/{TextAreaField-DuriTqsD.js → TextAreaField-Cmw1oXcw.js} +1 -1
- package/dist/{TextField-CGNSl7RU.js → TextField-OTLa3p51.js} +1 -1
- package/dist/{TimeField-YO58ctFg.js → TimeField-DKPoNWoR.js} +1 -1
- package/dist/{UrlField-1-BMM1jn.js → UrlField-CxbmzP9f.js} +1 -1
- package/dist/{UserField-B6GqxP_S.js → UserField-ChvwUkMK.js} +1 -1
- package/dist/{VectorField-BkEjbSt0.js → VectorField-BVClL8Vw.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1252 -1199
- package/dist/index.umd.cjs +47 -46
- package/dist/packages/plugin-detail/src/ActivityTimeline.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/CommentAttachment.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/CommentInput.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DetailSection.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DetailTabs.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DetailView.stories.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DiffView.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/FieldChangeItem.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/HeaderHighlight.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/InlineCreateRelated.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/MentionAutocomplete.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/PointInTimeRestore.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/ReactionPicker.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RecordActivityTimeline.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RecordChatterPanel.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RecordComments.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RecordNavigationEnhanced.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RelatedList.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RelationshipGraph.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/RichTextCommentInput.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/SectionGroup.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/SubscriptionToggle.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/ThreadedReplies.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/autoLayout.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/index.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -0
- package/dist/plugin-detail.css +1 -1
- package/dist/{src-CXr1-vVl.js → src-C56Ly5uG.js} +35777 -35335
- package/dist/useFieldTranslation-CkxqyB82.js +9 -0
- package/package.json +10 -10
- package/src/CommentAttachment.tsx +5 -3
- package/src/DiffView.tsx +7 -5
- package/src/RecordActivityTimeline.tsx +21 -17
- package/src/RecordChatterPanel.tsx +9 -7
- package/src/RecordComments.tsx +11 -9
- package/src/RecordNavigationEnhanced.tsx +9 -7
- package/src/RichTextCommentInput.tsx +11 -9
- package/src/SubscriptionToggle.tsx +4 -2
- package/src/ThreadedReplies.tsx +4 -2
- package/src/__tests__/RecordActivityTimeline.test.tsx +9 -9
- package/src/__tests__/RecordChatterPanel.test.tsx +6 -6
- package/src/__tests__/RecordCommentsPinSearch.test.tsx +6 -6
- package/src/useDetailTranslation.ts +69 -0
- package/vite.config.ts +1 -0
- package/dist/SelectField-C8hWu3gm.js +0 -30
- package/dist/src/ActivityTimeline.d.ts.map +0 -1
- package/dist/src/CommentAttachment.d.ts.map +0 -1
- package/dist/src/CommentInput.d.ts.map +0 -1
- package/dist/src/DetailSection.d.ts.map +0 -1
- package/dist/src/DetailTabs.d.ts.map +0 -1
- package/dist/src/DetailView.d.ts.map +0 -1
- package/dist/src/DetailView.stories.d.ts.map +0 -1
- package/dist/src/DiffView.d.ts.map +0 -1
- package/dist/src/FieldChangeItem.d.ts.map +0 -1
- package/dist/src/HeaderHighlight.d.ts.map +0 -1
- package/dist/src/InlineCreateRelated.d.ts.map +0 -1
- package/dist/src/MentionAutocomplete.d.ts.map +0 -1
- package/dist/src/PointInTimeRestore.d.ts.map +0 -1
- package/dist/src/ReactionPicker.d.ts.map +0 -1
- package/dist/src/RecordActivityTimeline.d.ts.map +0 -1
- package/dist/src/RecordChatterPanel.d.ts.map +0 -1
- package/dist/src/RecordComments.d.ts.map +0 -1
- package/dist/src/RecordNavigationEnhanced.d.ts.map +0 -1
- package/dist/src/RelatedList.d.ts.map +0 -1
- package/dist/src/RelationshipGraph.d.ts.map +0 -1
- package/dist/src/RichTextCommentInput.d.ts.map +0 -1
- package/dist/src/SectionGroup.d.ts.map +0 -1
- package/dist/src/SubscriptionToggle.d.ts.map +0 -1
- package/dist/src/ThreadedReplies.d.ts.map +0 -1
- package/dist/src/autoLayout.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/useDetailTranslation.d.ts.map +0 -1
- /package/dist/{src → packages/plugin-detail/src}/ActivityTimeline.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/CommentAttachment.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/CommentInput.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/DetailSection.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/DetailTabs.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/DetailView.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/DetailView.stories.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/DiffView.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/FieldChangeItem.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/HeaderHighlight.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/InlineCreateRelated.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/MentionAutocomplete.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/PointInTimeRestore.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/ReactionPicker.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RecordActivityTimeline.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RecordChatterPanel.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RecordComments.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RecordNavigationEnhanced.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RelatedList.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RelationshipGraph.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/RichTextCommentInput.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/SectionGroup.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/SubscriptionToggle.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/ThreadedReplies.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/autoLayout.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/index.d.ts +0 -0
- /package/dist/{src → packages/plugin-detail/src}/useDetailTranslation.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { $ as e, $t as t, A as n, At as r, B as i, D as a, Dt as o, Et as s, G as c, H as l, Ht as u, It as d, J as f, Jt as p, K as m, Kt as h, M as g, Mt as _, N as v, Nt as y, Ot as b, Pt as x, Q as S, Qt as C, Rt as w, St as T, Tt as E, U as D, Ut as O, V as k, Vt as A, W as j, Wt as
|
|
2
|
-
import "./TextField-
|
|
3
|
-
import "./NumberField-
|
|
4
|
-
import "./BooleanField-
|
|
5
|
-
import "./SelectField-
|
|
6
|
-
import "./DateField-
|
|
7
|
-
import "./EmailField-
|
|
8
|
-
import "./PhoneField-
|
|
9
|
-
import "./UrlField-
|
|
10
|
-
import "./CurrencyField-
|
|
11
|
-
import "./TextAreaField-
|
|
12
|
-
import "./RichTextField-
|
|
13
|
-
import { n as
|
|
14
|
-
import "./DateTimeField-
|
|
15
|
-
import "./TimeField-
|
|
16
|
-
import "./PercentField-
|
|
17
|
-
import "./PasswordField-
|
|
18
|
-
import "./FileField-
|
|
19
|
-
import "./ImageField-
|
|
20
|
-
import "./LocationField-
|
|
21
|
-
import "./FormulaField-
|
|
22
|
-
import "./SummaryField-
|
|
23
|
-
import "./AutoNumberField-
|
|
24
|
-
import "./UserField-
|
|
25
|
-
import "./ObjectField-
|
|
26
|
-
import "./VectorField-
|
|
27
|
-
import "./GridField-
|
|
28
|
-
import "./ColorField-
|
|
29
|
-
import "./SliderField-
|
|
30
|
-
import "./RatingField-
|
|
31
|
-
import "./CodeField-
|
|
32
|
-
import "./AvatarField-
|
|
33
|
-
import "./AddressField-
|
|
34
|
-
import "./GeolocationField-
|
|
35
|
-
import "./SignatureField-
|
|
36
|
-
import "./QRCodeField-
|
|
37
|
-
import "./MasterDetailField-
|
|
38
|
-
import * as
|
|
39
|
-
import
|
|
40
|
-
import { Fragment as
|
|
1
|
+
import { $ as e, $t as t, A as n, At as r, B as i, D as a, Dt as o, Et as s, G as c, H as l, Ht as u, It as d, J as f, Jt as p, K as m, Kt as h, M as g, Mt as _, N as v, Nt as y, Ot as b, Pt as x, Q as S, Qt as C, Rt as w, St as T, Tt as E, U as D, Ut as O, V as k, Vt as A, W as j, Wt as ee, Xt as te, Y as M, Yt as N, Z as P, Zt as F, _ as I, _t as ne, a as L, an as re, at as R, bt as z, dt as ie, en as B, et as ae, fn as oe, ft as se, g as V, gt as ce, h as H, hn as le, ht as ue, i as de, in as fe, it as pe, j as U, jt as me, k as he, kt as ge, ln as _e, lt as ve, m as W, n as ye, nn as be, on as xe, ot as Se, pn as Ce, pt as we, q as G, qt as Te, r as Ee, rt as De, sn as Oe, st as ke, tn as Ae, tt as je, un as K, ut as Me, v as Ne, vt as Pe, wt as Fe, xt as Ie, yt as Le, z as Re, zt as ze } from "./src-C56Ly5uG.js";
|
|
2
|
+
import "./TextField-OTLa3p51.js";
|
|
3
|
+
import "./NumberField-DL2QAL7X.js";
|
|
4
|
+
import "./BooleanField-DwfMKknK.js";
|
|
5
|
+
import "./SelectField-DGoDoRM_.js";
|
|
6
|
+
import "./DateField-BKqXpkOh.js";
|
|
7
|
+
import "./EmailField-CgvW1Qal.js";
|
|
8
|
+
import "./PhoneField-CX1JL-jp.js";
|
|
9
|
+
import "./UrlField-CxbmzP9f.js";
|
|
10
|
+
import "./CurrencyField-tvS3fPAF.js";
|
|
11
|
+
import "./TextAreaField-Cmw1oXcw.js";
|
|
12
|
+
import "./RichTextField-CJqLWlrb.js";
|
|
13
|
+
import { n as Be } from "./LookupField-B3hQJt95.js";
|
|
14
|
+
import "./DateTimeField-CR-nJCE7.js";
|
|
15
|
+
import "./TimeField-DKPoNWoR.js";
|
|
16
|
+
import "./PercentField-DjR6BSpw.js";
|
|
17
|
+
import "./PasswordField-DVTimsc3.js";
|
|
18
|
+
import "./FileField-BVAme2ML.js";
|
|
19
|
+
import "./ImageField-CDANtgVV.js";
|
|
20
|
+
import "./LocationField-ZSyZ0O-h.js";
|
|
21
|
+
import "./FormulaField-DamJ2VaG.js";
|
|
22
|
+
import "./SummaryField-7ch9aqAu.js";
|
|
23
|
+
import "./AutoNumberField-CtE7suf5.js";
|
|
24
|
+
import "./UserField-ChvwUkMK.js";
|
|
25
|
+
import "./ObjectField-JYvUnuRO.js";
|
|
26
|
+
import "./VectorField-BVClL8Vw.js";
|
|
27
|
+
import "./GridField-C9JbpTx_.js";
|
|
28
|
+
import "./ColorField-YKHA7dBD.js";
|
|
29
|
+
import "./SliderField-DEpMVXko.js";
|
|
30
|
+
import "./RatingField-rRi_P0N0.js";
|
|
31
|
+
import "./CodeField-CfwgRxx2.js";
|
|
32
|
+
import "./AvatarField-Xuieq0ZI.js";
|
|
33
|
+
import "./AddressField-CDLSeyNx.js";
|
|
34
|
+
import "./GeolocationField-C99z7ZBM.js";
|
|
35
|
+
import "./SignatureField-2CnhcWI0.js";
|
|
36
|
+
import "./QRCodeField-CH_1pU6R.js";
|
|
37
|
+
import "./MasterDetailField-B0HTmmD7.js";
|
|
38
|
+
import * as q from "react";
|
|
39
|
+
import Ve from "react";
|
|
40
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
41
41
|
//#region ../core/src/utils/expand-fields.ts
|
|
42
|
-
function
|
|
42
|
+
function He(e, t) {
|
|
43
43
|
if (!e || typeof e != "object") return [];
|
|
44
44
|
let n = [];
|
|
45
45
|
for (let [t, r] of Object.entries(e)) r && typeof r == "object" && (r.type === "lookup" || r.type === "master_detail") && n.push(t);
|
|
@@ -57,7 +57,7 @@ function Ve(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region ../i18n/dist/useObjectLabel.js
|
|
60
|
-
var
|
|
60
|
+
var Ue = new Set([
|
|
61
61
|
"common",
|
|
62
62
|
"validation",
|
|
63
63
|
"form",
|
|
@@ -74,11 +74,11 @@ var He = new Set([
|
|
|
74
74
|
"errors",
|
|
75
75
|
"detail"
|
|
76
76
|
]);
|
|
77
|
-
function
|
|
78
|
-
let { t: e, i18n: t } =
|
|
77
|
+
function We() {
|
|
78
|
+
let { t: e, i18n: t } = oe(), n = () => {
|
|
79
79
|
if (!t || typeof t.getResourceBundle != "function") return [];
|
|
80
80
|
let e = t.language || "en", n = t.getResourceBundle(e, "translation");
|
|
81
|
-
return n ? Object.keys(n).filter((e) => !
|
|
81
|
+
return n ? Object.keys(n).filter((e) => !Ue.has(e) && n[e] && typeof n[e] == "object" && (n[e].objects || n[e].fields)) : [];
|
|
82
82
|
}, r = (t, r) => {
|
|
83
83
|
try {
|
|
84
84
|
let r = n();
|
|
@@ -97,9 +97,9 @@ function Ue() {
|
|
|
97
97
|
fieldLabel: (e, t, n) => r(`fields.${e}.${t}`, n)
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Ge() {
|
|
101
101
|
try {
|
|
102
|
-
let { fieldLabel: e } =
|
|
102
|
+
let { fieldLabel: e } = We();
|
|
103
103
|
return { fieldLabel: e };
|
|
104
104
|
} catch {
|
|
105
105
|
return { fieldLabel: (e, t, n) => n };
|
|
@@ -107,7 +107,7 @@ function We() {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region ../fields/src/index.tsx
|
|
110
|
-
function
|
|
110
|
+
function Z(e) {
|
|
111
111
|
if (e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
|
|
112
112
|
if (e instanceof Date) return e.toISOString();
|
|
113
113
|
if (Array.isArray(e)) return e.map((e) => {
|
|
@@ -123,7 +123,7 @@ function Q(e) {
|
|
|
123
123
|
}
|
|
124
124
|
return String(e);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Ke(e, t = "USD") {
|
|
127
127
|
try {
|
|
128
128
|
return new Intl.NumberFormat("en-US", {
|
|
129
129
|
style: "currency",
|
|
@@ -133,13 +133,13 @@ function Ge(e, t = "USD") {
|
|
|
133
133
|
return `${t} ${e.toFixed(2)}`;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function qe(e, t = 0) {
|
|
137
137
|
return `${(e > -1 && e < 1 ? e * 100 : e).toFixed(t)}%`;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Je(e) {
|
|
140
140
|
return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Ye(e) {
|
|
143
143
|
if (!e) return "-";
|
|
144
144
|
let t = typeof e == "string" ? new Date(e) : e;
|
|
145
145
|
if (isNaN(t.getTime())) return "-";
|
|
@@ -149,33 +149,33 @@ function Je(e) {
|
|
|
149
149
|
if (a === -1) return "Yesterday";
|
|
150
150
|
if (a < -1) {
|
|
151
151
|
let e = Math.abs(a);
|
|
152
|
-
return e <= 7 ? `Overdue ${e}d` :
|
|
152
|
+
return e <= 7 ? `Overdue ${e}d` : Xe(t);
|
|
153
153
|
}
|
|
154
|
-
return a > 1 && a <= 7 ? `In ${a} days` :
|
|
154
|
+
return a > 1 && a <= 7 ? `In ${a} days` : Xe(t);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Xe(e, t) {
|
|
157
157
|
if (!e) return "-";
|
|
158
158
|
let n = typeof e == "string" ? new Date(e) : e;
|
|
159
|
-
return isNaN(n.getTime()) ? "-" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ?
|
|
159
|
+
return isNaN(n.getTime()) ? "-" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ? Ye(n) : n.toLocaleDateString(void 0, {
|
|
160
160
|
year: "numeric",
|
|
161
161
|
month: "short",
|
|
162
162
|
day: "numeric"
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
let t =
|
|
167
|
-
return /* @__PURE__ */
|
|
165
|
+
function Q({ value: e }) {
|
|
166
|
+
let t = Z(e);
|
|
167
|
+
return /* @__PURE__ */ Y("span", {
|
|
168
168
|
className: "truncate",
|
|
169
169
|
children: t != null && t !== "" ? String(t) : "-"
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
if (e == null) return /* @__PURE__ */
|
|
172
|
+
function Ze({ value: e, field: t }) {
|
|
173
|
+
if (e == null) return /* @__PURE__ */ Y("span", {
|
|
174
174
|
className: "text-muted-foreground",
|
|
175
175
|
children: "-"
|
|
176
176
|
});
|
|
177
|
-
let n =
|
|
178
|
-
return /* @__PURE__ */
|
|
177
|
+
let n = Z(e), r = t.precision ?? 0, i = Number(n);
|
|
178
|
+
return /* @__PURE__ */ Y("span", {
|
|
179
179
|
className: "tabular-nums",
|
|
180
180
|
children: isNaN(i) ? String(n) : new Intl.NumberFormat("en-US", {
|
|
181
181
|
minimumFractionDigits: r,
|
|
@@ -183,48 +183,48 @@ function Xe({ value: e, field: t }) {
|
|
|
183
183
|
}).format(i)
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
if (e == null) return /* @__PURE__ */
|
|
186
|
+
function Qe({ value: e, field: t }) {
|
|
187
|
+
if (e == null) return /* @__PURE__ */ Y("span", {
|
|
188
188
|
className: "text-muted-foreground",
|
|
189
189
|
children: "-"
|
|
190
190
|
});
|
|
191
|
-
let n =
|
|
192
|
-
return /* @__PURE__ */
|
|
191
|
+
let n = Z(e), r = t.currency || "USD", i = Number(n);
|
|
192
|
+
return /* @__PURE__ */ Y("span", {
|
|
193
193
|
className: "tabular-nums font-medium whitespace-nowrap",
|
|
194
|
-
children: isNaN(i) ? String(n) :
|
|
194
|
+
children: isNaN(i) ? String(n) : Ke(i, r)
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
var
|
|
198
|
-
function
|
|
199
|
-
if (e == null) return /* @__PURE__ */
|
|
197
|
+
var $e = /progress|completion/;
|
|
198
|
+
function et({ value: e, field: t }) {
|
|
199
|
+
if (e == null) return /* @__PURE__ */ Y("span", {
|
|
200
200
|
className: "text-muted-foreground",
|
|
201
201
|
children: "-"
|
|
202
202
|
});
|
|
203
|
-
let n =
|
|
204
|
-
if (isNaN(i)) return /* @__PURE__ */
|
|
203
|
+
let n = Z(e), r = t.precision ?? 0, i = Number(n);
|
|
204
|
+
if (isNaN(i)) return /* @__PURE__ */ Y("span", {
|
|
205
205
|
className: "tabular-nums whitespace-nowrap",
|
|
206
206
|
children: String(n)
|
|
207
207
|
});
|
|
208
|
-
let a =
|
|
209
|
-
return /* @__PURE__ */
|
|
208
|
+
let a = $e.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : qe(i, r), c = Math.max(0, Math.min(100, o));
|
|
209
|
+
return /* @__PURE__ */ X("div", {
|
|
210
210
|
className: "flex items-center gap-2",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
212
212
|
className: "h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",
|
|
213
213
|
role: "progressbar",
|
|
214
214
|
"aria-valuenow": c,
|
|
215
215
|
"aria-valuemin": 0,
|
|
216
216
|
"aria-valuemax": 100,
|
|
217
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ Y("div", {
|
|
218
218
|
className: "h-full rounded-full bg-primary transition-all",
|
|
219
219
|
style: { width: `${c}%` }
|
|
220
220
|
})
|
|
221
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ Y("span", {
|
|
222
222
|
className: "tabular-nums whitespace-nowrap",
|
|
223
223
|
children: s
|
|
224
224
|
})]
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var tt = new Set([
|
|
228
228
|
"active",
|
|
229
229
|
"is_active",
|
|
230
230
|
"enabled",
|
|
@@ -232,61 +232,61 @@ var et = new Set([
|
|
|
232
232
|
"verified",
|
|
233
233
|
"is_verified"
|
|
234
234
|
]);
|
|
235
|
-
function
|
|
236
|
-
if (e == null) return /* @__PURE__ */
|
|
235
|
+
function nt({ value: e, field: t }) {
|
|
236
|
+
if (e == null) return /* @__PURE__ */ Y("span", {
|
|
237
237
|
className: "text-muted-foreground/50 text-xs italic flex items-center justify-center",
|
|
238
238
|
children: "—"
|
|
239
239
|
});
|
|
240
240
|
let n = t?.name?.toLowerCase() || "";
|
|
241
|
-
return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */
|
|
241
|
+
return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ Y("div", {
|
|
242
242
|
className: "flex items-center justify-center",
|
|
243
|
-
children: e ? /* @__PURE__ */
|
|
243
|
+
children: e ? /* @__PURE__ */ Y("div", {
|
|
244
244
|
className: "size-5 rounded-full bg-green-500 flex items-center justify-center",
|
|
245
245
|
role: "img",
|
|
246
246
|
"aria-label": "Completed",
|
|
247
247
|
"data-testid": "completion-indicator",
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
}) : /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ Y(F, { className: "size-3 text-white" })
|
|
249
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
250
250
|
className: "size-5 rounded-full border-2 border-muted-foreground/30",
|
|
251
251
|
role: "img",
|
|
252
252
|
"aria-label": "Not completed",
|
|
253
253
|
"data-testid": "completion-indicator"
|
|
254
254
|
})
|
|
255
|
-
}) :
|
|
255
|
+
}) : tt.has(n) && !e ? /* @__PURE__ */ X(G, {
|
|
256
256
|
variant: "destructive",
|
|
257
257
|
className: "text-xs",
|
|
258
258
|
"data-testid": "boolean-warning-badge",
|
|
259
|
-
children: [t?.label ||
|
|
260
|
-
}) : /* @__PURE__ */
|
|
259
|
+
children: [t?.label || Je(n), " — Off"]
|
|
260
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
261
261
|
className: "flex items-center justify-center",
|
|
262
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ Y(l, {
|
|
263
263
|
checked: !!e,
|
|
264
264
|
disabled: !0,
|
|
265
265
|
className: "pointer-events-none"
|
|
266
266
|
})
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
if (!e) return /* @__PURE__ */
|
|
269
|
+
function rt({ value: e, field: t }) {
|
|
270
|
+
if (!e) return /* @__PURE__ */ Y("span", {
|
|
271
271
|
className: "text-muted-foreground",
|
|
272
272
|
children: "-"
|
|
273
273
|
});
|
|
274
|
-
let n =
|
|
274
|
+
let n = Z(e), r = Xe(n, t.format || "relative"), i = typeof n == "string" ? new Date(n) : n, a = i instanceof Date && !isNaN(i.getTime()), o = /* @__PURE__ */ new Date();
|
|
275
275
|
o.setHours(0, 0, 0, 0);
|
|
276
276
|
let s = a && i < o, c = a ? i.toISOString() : String(n);
|
|
277
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ Y("span", {
|
|
278
278
|
className: `tabular-nums${s ? " text-red-600" : ""}`,
|
|
279
279
|
title: c,
|
|
280
280
|
children: r
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
if (!e) return /* @__PURE__ */
|
|
283
|
+
function it({ value: e }) {
|
|
284
|
+
if (!e) return /* @__PURE__ */ Y("span", {
|
|
285
285
|
className: "text-muted-foreground",
|
|
286
286
|
children: "-"
|
|
287
287
|
});
|
|
288
|
-
let t =
|
|
289
|
-
if (!(n instanceof Date) || isNaN(n.getTime())) return /* @__PURE__ */
|
|
288
|
+
let t = Z(e), n = typeof t == "string" ? new Date(t) : t;
|
|
289
|
+
if (!(n instanceof Date) || isNaN(n.getTime())) return /* @__PURE__ */ Y("span", {
|
|
290
290
|
className: "text-muted-foreground",
|
|
291
291
|
children: "-"
|
|
292
292
|
});
|
|
@@ -299,15 +299,15 @@ function rt({ value: e }) {
|
|
|
299
299
|
minute: "2-digit",
|
|
300
300
|
hour12: !0
|
|
301
301
|
}).toLowerCase();
|
|
302
|
-
return /* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ X("span", {
|
|
303
303
|
className: "tabular-nums text-sm whitespace-nowrap",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ Y("span", { children: r }), /* @__PURE__ */ Y("span", {
|
|
305
305
|
className: "ml-2 text-muted-foreground",
|
|
306
306
|
children: i
|
|
307
307
|
})]
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var at = {
|
|
311
311
|
critical: "red",
|
|
312
312
|
urgent: "red",
|
|
313
313
|
high: "orange",
|
|
@@ -339,7 +339,7 @@ var it = {
|
|
|
339
339
|
overdue: "red",
|
|
340
340
|
delivered: "purple",
|
|
341
341
|
archived: "indigo"
|
|
342
|
-
},
|
|
342
|
+
}, ot = {
|
|
343
343
|
gray: "bg-gray-100 text-gray-800 border-gray-300",
|
|
344
344
|
red: "bg-red-100 text-red-800 border-red-300",
|
|
345
345
|
orange: "bg-orange-100 text-orange-800 border-orange-300",
|
|
@@ -350,45 +350,45 @@ var it = {
|
|
|
350
350
|
purple: "bg-purple-100 text-purple-800 border-purple-300",
|
|
351
351
|
pink: "bg-pink-100 text-pink-800 border-pink-300"
|
|
352
352
|
};
|
|
353
|
-
function
|
|
354
|
-
return
|
|
353
|
+
function st(e, t) {
|
|
354
|
+
return ot[e || (t ? at[String(t).toLowerCase().replace(/[\s-]/g, "_")] : void 0) || ""] || "bg-muted text-muted-foreground border-border";
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function ct({ value: e, field: t }) {
|
|
357
357
|
let n = t.options || [];
|
|
358
|
-
if (!e) return /* @__PURE__ */
|
|
359
|
-
if (Array.isArray(e)) return /* @__PURE__ */
|
|
358
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
359
|
+
if (Array.isArray(e)) return /* @__PURE__ */ Y("div", {
|
|
360
360
|
className: "flex flex-wrap gap-1",
|
|
361
361
|
children: e.map((e, t) => {
|
|
362
|
-
let r = n.find((t) => t.value === e), i = r?.label ||
|
|
363
|
-
return /* @__PURE__ */
|
|
362
|
+
let r = n.find((t) => t.value === e), i = r?.label || Je(String(e));
|
|
363
|
+
return /* @__PURE__ */ Y(G, {
|
|
364
364
|
variant: "outline",
|
|
365
|
-
className:
|
|
365
|
+
className: st(r?.color, e),
|
|
366
366
|
children: i
|
|
367
367
|
}, t);
|
|
368
368
|
})
|
|
369
369
|
});
|
|
370
|
-
let r = n.find((t) => t.value === e), i = r?.label ||
|
|
371
|
-
return /* @__PURE__ */
|
|
370
|
+
let r = n.find((t) => t.value === e), i = r?.label || Je(String(e));
|
|
371
|
+
return /* @__PURE__ */ Y(G, {
|
|
372
372
|
variant: "outline",
|
|
373
|
-
className:
|
|
373
|
+
className: st(r?.color, e),
|
|
374
374
|
children: i
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
if (!e) return /* @__PURE__ */
|
|
379
|
-
let t = String(
|
|
380
|
-
return /* @__PURE__ */
|
|
377
|
+
function lt({ value: e }) {
|
|
378
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
379
|
+
let t = String(Z(e) ?? ""), [n, r] = Ve.useState(!1);
|
|
380
|
+
return /* @__PURE__ */ X("span", {
|
|
381
381
|
className: "inline-flex items-center gap-1 group/email",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ Y(P, {
|
|
383
383
|
variant: "link",
|
|
384
384
|
className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
|
|
385
385
|
asChild: !0,
|
|
386
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ Y("a", {
|
|
387
387
|
href: `mailto:${t}`,
|
|
388
388
|
onClick: (e) => e.stopPropagation(),
|
|
389
389
|
children: t
|
|
390
390
|
})
|
|
391
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ Y("button", {
|
|
392
392
|
type: "button",
|
|
393
393
|
className: "opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
|
|
394
394
|
onClick: (e) => {
|
|
@@ -397,18 +397,18 @@ function ct({ value: e }) {
|
|
|
397
397
|
}).catch(() => {});
|
|
398
398
|
},
|
|
399
399
|
"aria-label": "Copy email",
|
|
400
|
-
children: n ? /* @__PURE__ */
|
|
400
|
+
children: n ? /* @__PURE__ */ Y(F, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Y(A, { className: "h-3 w-3 text-muted-foreground" })
|
|
401
401
|
})]
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
if (!e) return /* @__PURE__ */
|
|
406
|
-
let t = String(
|
|
407
|
-
return /* @__PURE__ */
|
|
404
|
+
function ut({ value: e }) {
|
|
405
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
406
|
+
let t = String(Z(e) ?? "");
|
|
407
|
+
return /* @__PURE__ */ Y(P, {
|
|
408
408
|
variant: "link",
|
|
409
409
|
className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
|
|
410
410
|
asChild: !0,
|
|
411
|
-
children: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ Y("a", {
|
|
412
412
|
href: t,
|
|
413
413
|
target: "_blank",
|
|
414
414
|
rel: "noopener noreferrer",
|
|
@@ -417,17 +417,17 @@ function lt({ value: e }) {
|
|
|
417
417
|
})
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
if (!e) return /* @__PURE__ */
|
|
422
|
-
let t = String(
|
|
423
|
-
return /* @__PURE__ */
|
|
420
|
+
function dt({ value: e }) {
|
|
421
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
422
|
+
let t = String(Z(e) ?? ""), [n, r] = Ve.useState(!1);
|
|
423
|
+
return /* @__PURE__ */ X("span", {
|
|
424
424
|
className: "inline-flex items-center gap-1 group/phone",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ X("a", {
|
|
426
426
|
href: `tel:${t}`,
|
|
427
427
|
className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",
|
|
428
428
|
onClick: (e) => e.stopPropagation(),
|
|
429
|
-
children: [/* @__PURE__ */
|
|
430
|
-
}), /* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ Y(ne, { className: "h-3 w-3" }), t]
|
|
430
|
+
}), /* @__PURE__ */ Y("button", {
|
|
431
431
|
type: "button",
|
|
432
432
|
className: "opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
|
|
433
433
|
onClick: (e) => {
|
|
@@ -436,15 +436,15 @@ function ut({ value: e }) {
|
|
|
436
436
|
}).catch(() => {});
|
|
437
437
|
},
|
|
438
438
|
"aria-label": "Copy phone number",
|
|
439
|
-
children: n ? /* @__PURE__ */
|
|
439
|
+
children: n ? /* @__PURE__ */ Y(F, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Y(A, { className: "h-3 w-3 text-muted-foreground" })
|
|
440
440
|
})]
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
if (!e) return /* @__PURE__ */
|
|
443
|
+
function ft({ value: e, field: t }) {
|
|
444
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
445
445
|
if (t.multiple, Array.isArray(e)) {
|
|
446
446
|
let t = e.length;
|
|
447
|
-
return /* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ X("span", {
|
|
448
448
|
className: "text-sm text-gray-600",
|
|
449
449
|
children: [
|
|
450
450
|
t,
|
|
@@ -453,30 +453,30 @@ function dt({ value: e, field: t }) {
|
|
|
453
453
|
]
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ Y("span", {
|
|
457
457
|
className: "text-sm truncate",
|
|
458
458
|
children: e.name || e.original_name || "File"
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
return e ? Array.isArray(e) ? /* @__PURE__ */
|
|
461
|
+
function pt({ value: e }) {
|
|
462
|
+
return e ? Array.isArray(e) ? /* @__PURE__ */ X("div", {
|
|
463
463
|
className: "flex -space-x-2",
|
|
464
|
-
children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */
|
|
464
|
+
children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */ Y("img", {
|
|
465
465
|
src: e.url || "",
|
|
466
466
|
alt: e.name || `Image ${t + 1}`,
|
|
467
467
|
className: "size-8 rounded-md border-2 border-white object-cover"
|
|
468
|
-
}, t)), e.length > 3 && /* @__PURE__ */
|
|
468
|
+
}, t)), e.length > 3 && /* @__PURE__ */ X("div", {
|
|
469
469
|
className: "size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",
|
|
470
470
|
children: ["+", e.length - 3]
|
|
471
471
|
})]
|
|
472
|
-
}) : /* @__PURE__ */
|
|
472
|
+
}) : /* @__PURE__ */ Y("img", {
|
|
473
473
|
src: e.url || "",
|
|
474
474
|
alt: e.name || "Image",
|
|
475
475
|
className: "size-10 rounded-md object-cover"
|
|
476
|
-
}) : /* @__PURE__ */
|
|
476
|
+
}) : /* @__PURE__ */ Y("span", { children: "-" });
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
if (e == null || e === "") return /* @__PURE__ */
|
|
478
|
+
function mt({ value: e, field: t }) {
|
|
479
|
+
if (e == null || e === "") return /* @__PURE__ */ Y("span", { children: "-" });
|
|
480
480
|
let n = t.options || [], r = (e) => {
|
|
481
481
|
if (n.length > 0) {
|
|
482
482
|
let t = n.find((t) => String(t.value) === String(e));
|
|
@@ -484,181 +484,181 @@ function pt({ value: e, field: t }) {
|
|
|
484
484
|
}
|
|
485
485
|
return String(e);
|
|
486
486
|
};
|
|
487
|
-
return Array.isArray(e) ? /* @__PURE__ */
|
|
487
|
+
return Array.isArray(e) ? /* @__PURE__ */ Y("div", {
|
|
488
488
|
className: "flex flex-wrap gap-1",
|
|
489
489
|
children: e.map((e, t) => {
|
|
490
490
|
let n;
|
|
491
|
-
return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */
|
|
491
|
+
return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */ Y("span", {
|
|
492
492
|
className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",
|
|
493
493
|
children: n
|
|
494
494
|
}, t);
|
|
495
495
|
})
|
|
496
|
-
}) : typeof e == "object" && e ? /* @__PURE__ */
|
|
496
|
+
}) : typeof e == "object" && e ? /* @__PURE__ */ Y("span", {
|
|
497
497
|
className: "truncate",
|
|
498
498
|
children: e.name || e.label || e.id || e._id || "[Object]"
|
|
499
|
-
}) : /* @__PURE__ */
|
|
499
|
+
}) : /* @__PURE__ */ Y("span", {
|
|
500
500
|
className: "truncate",
|
|
501
501
|
children: r(e)
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
let t =
|
|
506
|
-
return /* @__PURE__ */
|
|
504
|
+
function ht({ value: e }) {
|
|
505
|
+
let t = Z(e);
|
|
506
|
+
return /* @__PURE__ */ Y("span", {
|
|
507
507
|
className: "text-gray-700 font-mono text-sm",
|
|
508
508
|
children: t == null ? "-" : String(t)
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
if (!e) return /* @__PURE__ */
|
|
513
|
-
if (typeof e != "object") return /* @__PURE__ */
|
|
511
|
+
function gt({ value: e }) {
|
|
512
|
+
if (!e) return /* @__PURE__ */ Y("span", { children: "-" });
|
|
513
|
+
if (typeof e != "object") return /* @__PURE__ */ Y("span", {
|
|
514
514
|
className: "truncate",
|
|
515
515
|
children: String(e)
|
|
516
516
|
});
|
|
517
|
-
if (Array.isArray(e)) return /* @__PURE__ */
|
|
517
|
+
if (Array.isArray(e)) return /* @__PURE__ */ X("div", {
|
|
518
518
|
className: "flex -space-x-2",
|
|
519
519
|
children: [e.slice(0, 3).map((e, t) => {
|
|
520
|
-
if (typeof e != "object" || !e) return /* @__PURE__ */
|
|
520
|
+
if (typeof e != "object" || !e) return /* @__PURE__ */ Y("span", {
|
|
521
521
|
className: "truncate text-sm",
|
|
522
522
|
children: String(e)
|
|
523
523
|
}, t);
|
|
524
524
|
let n = e.name || e.username || "User";
|
|
525
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ Y(f, {
|
|
526
526
|
className: "size-8 border-2 border-white",
|
|
527
527
|
title: n,
|
|
528
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ Y(M, {
|
|
529
529
|
className: "bg-blue-500 text-white text-xs",
|
|
530
530
|
children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
531
531
|
})
|
|
532
532
|
}, t);
|
|
533
|
-
}), e.length > 3 && /* @__PURE__ */
|
|
533
|
+
}), e.length > 3 && /* @__PURE__ */ Y(f, {
|
|
534
534
|
className: "size-8 border-2 border-white",
|
|
535
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ X(M, {
|
|
536
536
|
className: "bg-gray-200 text-gray-600 text-xs",
|
|
537
537
|
children: ["+", e.length - 3]
|
|
538
538
|
})
|
|
539
539
|
})]
|
|
540
540
|
});
|
|
541
541
|
let t = e.name || e.username || "User";
|
|
542
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ X("div", {
|
|
543
543
|
className: "flex items-center gap-2",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ Y(f, {
|
|
545
545
|
className: "size-8",
|
|
546
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ Y(M, {
|
|
547
547
|
className: "bg-blue-500 text-white text-xs",
|
|
548
548
|
children: t.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
549
549
|
})
|
|
550
|
-
}), /* @__PURE__ */
|
|
550
|
+
}), /* @__PURE__ */ Y("span", {
|
|
551
551
|
className: "truncate",
|
|
552
552
|
children: t
|
|
553
553
|
})]
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
var
|
|
557
|
-
function
|
|
558
|
-
|
|
556
|
+
var _t = /* @__PURE__ */ new Map();
|
|
557
|
+
function vt(e, t) {
|
|
558
|
+
_t.set(e, t);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return
|
|
562
|
-
text:
|
|
563
|
-
textarea:
|
|
564
|
-
markdown:
|
|
565
|
-
html:
|
|
566
|
-
number:
|
|
567
|
-
currency:
|
|
568
|
-
percent:
|
|
569
|
-
boolean:
|
|
570
|
-
date:
|
|
571
|
-
datetime:
|
|
572
|
-
time:
|
|
573
|
-
select:
|
|
574
|
-
status:
|
|
575
|
-
lookup:
|
|
576
|
-
master_detail:
|
|
577
|
-
email:
|
|
578
|
-
url:
|
|
579
|
-
phone:
|
|
580
|
-
file:
|
|
581
|
-
image:
|
|
582
|
-
formula:
|
|
583
|
-
summary:
|
|
584
|
-
auto_number:
|
|
585
|
-
user:
|
|
586
|
-
owner:
|
|
587
|
-
password: () => /* @__PURE__ */
|
|
588
|
-
location:
|
|
589
|
-
object: () => /* @__PURE__ */
|
|
560
|
+
function yt(e) {
|
|
561
|
+
return _t.has(e) ? _t.get(e) : {
|
|
562
|
+
text: Q,
|
|
563
|
+
textarea: Q,
|
|
564
|
+
markdown: Q,
|
|
565
|
+
html: Q,
|
|
566
|
+
number: Ze,
|
|
567
|
+
currency: Qe,
|
|
568
|
+
percent: et,
|
|
569
|
+
boolean: nt,
|
|
570
|
+
date: rt,
|
|
571
|
+
datetime: it,
|
|
572
|
+
time: Q,
|
|
573
|
+
select: ct,
|
|
574
|
+
status: ct,
|
|
575
|
+
lookup: mt,
|
|
576
|
+
master_detail: mt,
|
|
577
|
+
email: lt,
|
|
578
|
+
url: ut,
|
|
579
|
+
phone: dt,
|
|
580
|
+
file: ft,
|
|
581
|
+
image: pt,
|
|
582
|
+
formula: ht,
|
|
583
|
+
summary: ht,
|
|
584
|
+
auto_number: Q,
|
|
585
|
+
user: gt,
|
|
586
|
+
owner: gt,
|
|
587
|
+
password: () => /* @__PURE__ */ Y("span", { children: "••••••" }),
|
|
588
|
+
location: Q,
|
|
589
|
+
object: () => /* @__PURE__ */ Y("span", {
|
|
590
590
|
className: "text-gray-500 italic",
|
|
591
591
|
children: "[Object]"
|
|
592
592
|
}),
|
|
593
|
-
vector: () => /* @__PURE__ */
|
|
593
|
+
vector: () => /* @__PURE__ */ Y("span", {
|
|
594
594
|
className: "text-gray-500 italic",
|
|
595
595
|
children: "[Vector]"
|
|
596
596
|
}),
|
|
597
|
-
grid: () => /* @__PURE__ */
|
|
597
|
+
grid: () => /* @__PURE__ */ Y("span", {
|
|
598
598
|
className: "text-gray-500 italic",
|
|
599
599
|
children: "[Grid]"
|
|
600
600
|
})
|
|
601
|
-
}[e] ||
|
|
601
|
+
}[e] || Q;
|
|
602
602
|
}
|
|
603
|
-
|
|
604
|
-
var
|
|
605
|
-
text: () => import("./TextField-
|
|
606
|
-
textarea: () => import("./TextAreaField-
|
|
607
|
-
number: () => import("./NumberField-
|
|
608
|
-
boolean: () => import("./BooleanField-
|
|
609
|
-
select: () => import("./SelectField-
|
|
610
|
-
date: () => import("./DateField-
|
|
611
|
-
datetime: () => import("./DateTimeField-
|
|
612
|
-
time: () => import("./TimeField-
|
|
613
|
-
email: () => import("./EmailField-
|
|
614
|
-
phone: () => import("./PhoneField-
|
|
615
|
-
url: () => import("./UrlField-
|
|
616
|
-
currency: () => import("./CurrencyField-
|
|
617
|
-
percent: () => import("./PercentField-
|
|
618
|
-
password: () => import("./PasswordField-
|
|
619
|
-
markdown: () => import("./RichTextField-
|
|
620
|
-
html: () => import("./RichTextField-
|
|
621
|
-
lookup: () => import("./LookupField-
|
|
622
|
-
master_detail: () => import("./MasterDetailField-
|
|
623
|
-
file: () => import("./FileField-
|
|
624
|
-
image: () => import("./ImageField-
|
|
625
|
-
location: () => import("./LocationField-
|
|
626
|
-
formula: () => import("./FormulaField-
|
|
627
|
-
summary: () => import("./SummaryField-
|
|
628
|
-
auto_number: () => import("./AutoNumberField-
|
|
629
|
-
user: () => import("./UserField-
|
|
630
|
-
owner: () => import("./UserField-
|
|
631
|
-
object: () => import("./ObjectField-
|
|
632
|
-
vector: () => import("./VectorField-
|
|
633
|
-
grid: () => import("./GridField-
|
|
634
|
-
color: () => import("./ColorField-
|
|
635
|
-
slider: () => import("./SliderField-
|
|
636
|
-
rating: () => import("./RatingField-
|
|
637
|
-
code: () => import("./CodeField-
|
|
638
|
-
avatar: () => import("./AvatarField-
|
|
639
|
-
address: () => import("./AddressField-
|
|
640
|
-
geolocation: () => import("./GeolocationField-
|
|
641
|
-
signature: () => import("./SignatureField-
|
|
642
|
-
qrcode: () => import("./QRCodeField-
|
|
603
|
+
vt("lookup", mt), vt("master_detail", mt), vt("select", ct), vt("status", ct), vt("user", gt), vt("owner", gt), Be(yt);
|
|
604
|
+
var bt = {
|
|
605
|
+
text: () => import("./TextField-OTLa3p51.js").then((e) => e.t).then((e) => ({ default: e.TextField })),
|
|
606
|
+
textarea: () => import("./TextAreaField-Cmw1oXcw.js").then((e) => e.t).then((e) => ({ default: e.TextAreaField })),
|
|
607
|
+
number: () => import("./NumberField-DL2QAL7X.js").then((e) => e.t).then((e) => ({ default: e.NumberField })),
|
|
608
|
+
boolean: () => import("./BooleanField-DwfMKknK.js").then((e) => e.t).then((e) => ({ default: e.BooleanField })),
|
|
609
|
+
select: () => import("./SelectField-XBVI50AD.js").then((e) => ({ default: e.SelectField })),
|
|
610
|
+
date: () => import("./DateField-BKqXpkOh.js").then((e) => e.t).then((e) => ({ default: e.DateField })),
|
|
611
|
+
datetime: () => import("./DateTimeField-CR-nJCE7.js").then((e) => e.t).then((e) => ({ default: e.DateTimeField })),
|
|
612
|
+
time: () => import("./TimeField-DKPoNWoR.js").then((e) => e.t).then((e) => ({ default: e.TimeField })),
|
|
613
|
+
email: () => import("./EmailField-CgvW1Qal.js").then((e) => e.t).then((e) => ({ default: e.EmailField })),
|
|
614
|
+
phone: () => import("./PhoneField-CX1JL-jp.js").then((e) => e.t).then((e) => ({ default: e.PhoneField })),
|
|
615
|
+
url: () => import("./UrlField-CxbmzP9f.js").then((e) => e.t).then((e) => ({ default: e.UrlField })),
|
|
616
|
+
currency: () => import("./CurrencyField-tvS3fPAF.js").then((e) => e.t).then((e) => ({ default: e.CurrencyField })),
|
|
617
|
+
percent: () => import("./PercentField-DjR6BSpw.js").then((e) => e.t).then((e) => ({ default: e.PercentField })),
|
|
618
|
+
password: () => import("./PasswordField-DVTimsc3.js").then((e) => e.t).then((e) => ({ default: e.PasswordField })),
|
|
619
|
+
markdown: () => import("./RichTextField-CJqLWlrb.js").then((e) => e.t).then((e) => ({ default: e.RichTextField })),
|
|
620
|
+
html: () => import("./RichTextField-CJqLWlrb.js").then((e) => e.t).then((e) => ({ default: e.RichTextField })),
|
|
621
|
+
lookup: () => import("./LookupField-D00z6gn_.js").then((e) => ({ default: e.LookupField })),
|
|
622
|
+
master_detail: () => import("./MasterDetailField-B0HTmmD7.js").then((e) => e.t).then((e) => ({ default: e.MasterDetailField })),
|
|
623
|
+
file: () => import("./FileField-BVAme2ML.js").then((e) => e.t).then((e) => ({ default: e.FileField })),
|
|
624
|
+
image: () => import("./ImageField-CDANtgVV.js").then((e) => e.t).then((e) => ({ default: e.ImageField })),
|
|
625
|
+
location: () => import("./LocationField-ZSyZ0O-h.js").then((e) => e.t).then((e) => ({ default: e.LocationField })),
|
|
626
|
+
formula: () => import("./FormulaField-DamJ2VaG.js").then((e) => e.t).then((e) => ({ default: e.FormulaField })),
|
|
627
|
+
summary: () => import("./SummaryField-7ch9aqAu.js").then((e) => e.t).then((e) => ({ default: e.SummaryField })),
|
|
628
|
+
auto_number: () => import("./AutoNumberField-CtE7suf5.js").then((e) => e.t).then((e) => ({ default: e.AutoNumberField })),
|
|
629
|
+
user: () => import("./UserField-ChvwUkMK.js").then((e) => e.t).then((e) => ({ default: e.UserField })),
|
|
630
|
+
owner: () => import("./UserField-ChvwUkMK.js").then((e) => e.t).then((e) => ({ default: e.UserField })),
|
|
631
|
+
object: () => import("./ObjectField-JYvUnuRO.js").then((e) => e.t).then((e) => ({ default: e.ObjectField })),
|
|
632
|
+
vector: () => import("./VectorField-BVClL8Vw.js").then((e) => e.t).then((e) => ({ default: e.VectorField })),
|
|
633
|
+
grid: () => import("./GridField-C9JbpTx_.js").then((e) => e.t).then((e) => ({ default: e.GridField })),
|
|
634
|
+
color: () => import("./ColorField-YKHA7dBD.js").then((e) => e.t).then((e) => ({ default: e.ColorField })),
|
|
635
|
+
slider: () => import("./SliderField-DEpMVXko.js").then((e) => e.t).then((e) => ({ default: e.SliderField })),
|
|
636
|
+
rating: () => import("./RatingField-rRi_P0N0.js").then((e) => e.t).then((e) => ({ default: e.RatingField })),
|
|
637
|
+
code: () => import("./CodeField-CfwgRxx2.js").then((e) => e.t).then((e) => ({ default: e.CodeField })),
|
|
638
|
+
avatar: () => import("./AvatarField-Xuieq0ZI.js").then((e) => e.t).then((e) => ({ default: e.AvatarField })),
|
|
639
|
+
address: () => import("./AddressField-CDLSeyNx.js").then((e) => e.t).then((e) => ({ default: e.AddressField })),
|
|
640
|
+
geolocation: () => import("./GeolocationField-C99z7ZBM.js").then((e) => e.t).then((e) => ({ default: e.GeolocationField })),
|
|
641
|
+
signature: () => import("./SignatureField-2CnhcWI0.js").then((e) => e.t).then((e) => ({ default: e.SignatureField })),
|
|
642
|
+
qrcode: () => import("./QRCodeField-CH_1pU6R.js").then((e) => e.t).then((e) => ({ default: e.QRCodeField }))
|
|
643
643
|
};
|
|
644
|
-
function
|
|
645
|
-
let t =
|
|
644
|
+
function xt(e) {
|
|
645
|
+
let t = bt[e];
|
|
646
646
|
if (!t) {
|
|
647
647
|
console.warn(`Unknown field type: ${e}`);
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
|
-
let n =
|
|
651
|
-
|
|
650
|
+
let n = Ve.lazy(t);
|
|
651
|
+
le.register(e, n, { namespace: "field" });
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
Object.keys(
|
|
655
|
-
|
|
653
|
+
function St() {
|
|
654
|
+
Object.keys(bt).forEach((e) => {
|
|
655
|
+
xt(e);
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
|
-
|
|
658
|
+
St();
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region src/autoLayout.ts
|
|
661
|
-
var
|
|
661
|
+
var Ct = new Set([
|
|
662
662
|
"textarea",
|
|
663
663
|
"markdown",
|
|
664
664
|
"html",
|
|
@@ -670,10 +670,10 @@ var St = new Set([
|
|
|
670
670
|
"field:grid",
|
|
671
671
|
"field:rich-text"
|
|
672
672
|
]);
|
|
673
|
-
function
|
|
674
|
-
return
|
|
673
|
+
function wt(e) {
|
|
674
|
+
return Ct.has(e);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Tt(e, t) {
|
|
677
677
|
let n;
|
|
678
678
|
if (n = e <= 3 ? 1 : e <= 10 ? 2 : 3, t !== void 0) {
|
|
679
679
|
if (t < 640) return Math.min(n, 1);
|
|
@@ -681,29 +681,29 @@ function wt(e, t) {
|
|
|
681
681
|
}
|
|
682
682
|
return n;
|
|
683
683
|
}
|
|
684
|
-
function
|
|
685
|
-
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type &&
|
|
684
|
+
function Et(e, t) {
|
|
685
|
+
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type && wt(e.type) ? {
|
|
686
686
|
...e,
|
|
687
687
|
span: t
|
|
688
688
|
} : e);
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Dt(e, t, n) {
|
|
691
691
|
if (t !== void 0) return {
|
|
692
|
-
fields:
|
|
692
|
+
fields: Et(e, t),
|
|
693
693
|
columns: t
|
|
694
694
|
};
|
|
695
|
-
let r =
|
|
695
|
+
let r = Tt(e.length, n);
|
|
696
696
|
return {
|
|
697
|
-
fields:
|
|
697
|
+
fields: Et(e, r),
|
|
698
698
|
columns: r
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
702
|
//#region src/useDetailTranslation.ts
|
|
703
|
-
function
|
|
703
|
+
function Ot(e, t) {
|
|
704
704
|
return function() {
|
|
705
705
|
try {
|
|
706
|
-
let n =
|
|
706
|
+
let n = oe();
|
|
707
707
|
return n.t(t) === t ? { t: (t, n) => {
|
|
708
708
|
let r = e[t] || t;
|
|
709
709
|
if (n) for (let [e, t] of Object.entries(n)) r = r.replace(`{{${e}}}`, String(t));
|
|
@@ -718,7 +718,7 @@ function Dt(e, t) {
|
|
|
718
718
|
}
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
|
-
var
|
|
721
|
+
var kt = {
|
|
722
722
|
"detail.back": "Back",
|
|
723
723
|
"detail.edit": "Edit",
|
|
724
724
|
"detail.editInline": "Edit inline",
|
|
@@ -762,15 +762,74 @@ var Ot = {
|
|
|
762
762
|
"detail.pageOf": "Page {{current}} of {{total}}",
|
|
763
763
|
"detail.sortBy": "Sort by",
|
|
764
764
|
"detail.filterPlaceholder": "Filter...",
|
|
765
|
-
"detail.highlightFields": "Key Fields"
|
|
766
|
-
|
|
765
|
+
"detail.highlightFields": "Key Fields",
|
|
766
|
+
"detail.comments": "Comments",
|
|
767
|
+
"detail.searchComments": "Search comments…",
|
|
768
|
+
"detail.addCommentPlaceholder": "Add a comment… (Ctrl+Enter to submit)",
|
|
769
|
+
"detail.noMatchingComments": "No matching comments",
|
|
770
|
+
"detail.noCommentsYet": "No comments yet",
|
|
771
|
+
"detail.pinned": "Pinned",
|
|
772
|
+
"detail.pin": "Pin",
|
|
773
|
+
"detail.unpin": "Unpin",
|
|
774
|
+
"detail.justNow": "just now",
|
|
775
|
+
"detail.minutesAgo": "{{count}}m ago",
|
|
776
|
+
"detail.hoursAgo": "{{count}}h ago",
|
|
777
|
+
"detail.daysAgo": "{{count}}d ago",
|
|
778
|
+
"detail.dropFilesToUpload": "Drop files here or click to upload",
|
|
779
|
+
"detail.attachmentCount": "{{count}} attachment",
|
|
780
|
+
"detail.attachmentCountPlural": "{{count}} attachments",
|
|
781
|
+
"detail.removeAttachment": "Remove attachment",
|
|
782
|
+
"detail.unifiedDiff": "Unified diff",
|
|
783
|
+
"detail.sideBySideDiff": "Side-by-side diff",
|
|
784
|
+
"detail.noChanges": "No changes",
|
|
785
|
+
"detail.previousVersion": "Previous",
|
|
786
|
+
"detail.currentVersion": "Current",
|
|
787
|
+
"detail.discussion": "Discussion",
|
|
788
|
+
"detail.showDiscussion": "Show Discussion ({{count}})",
|
|
789
|
+
"detail.hideDiscussion": "Hide discussion",
|
|
790
|
+
"detail.bold": "Bold (Ctrl+B)",
|
|
791
|
+
"detail.italic": "Italic (Ctrl+I)",
|
|
792
|
+
"detail.listFormat": "List",
|
|
793
|
+
"detail.inlineCode": "Inline code",
|
|
794
|
+
"detail.mentionSomeone": "Mention someone",
|
|
795
|
+
"detail.preview": "Preview",
|
|
796
|
+
"detail.submitComment": "Submit (Ctrl+Enter)",
|
|
797
|
+
"detail.writeComment": "Write a comment…",
|
|
798
|
+
"detail.subscribedTooltip": "Subscribed — click to unsubscribe",
|
|
799
|
+
"detail.unsubscribedTooltip": "Subscribe to notifications",
|
|
800
|
+
"detail.firstRecord": "First record (Home)",
|
|
801
|
+
"detail.previousRecordKey": "Previous record (←)",
|
|
802
|
+
"detail.nextRecordKey": "Next record (→)",
|
|
803
|
+
"detail.lastRecord": "Last record (End)",
|
|
804
|
+
"detail.noRecords": "No records",
|
|
805
|
+
"detail.searchWhileNavigating": "Search while navigating",
|
|
806
|
+
"detail.searchRecords": "Search records…",
|
|
807
|
+
"detail.allActivity": "All Activity",
|
|
808
|
+
"detail.commentsOnly": "Comments Only",
|
|
809
|
+
"detail.fieldChangesFilter": "Field Changes",
|
|
810
|
+
"detail.tasksOnly": "Tasks Only",
|
|
811
|
+
"detail.leaveCommentPlaceholder": "Leave a comment… (Ctrl+Enter to submit)",
|
|
812
|
+
"detail.noActivity": "No activity recorded",
|
|
813
|
+
"detail.loadMore": "Load more",
|
|
814
|
+
"detail.edited": "(edited)",
|
|
815
|
+
"detail.via": "via {{source}}",
|
|
816
|
+
"detail.replyCount": "{{count}} reply",
|
|
817
|
+
"detail.replyCountPlural": "{{count}} replies",
|
|
818
|
+
"detail.replyPlaceholder": "Reply…",
|
|
819
|
+
"detail.filterActivity": "Filter activity",
|
|
820
|
+
"detail.openDiscussion": "Open discussion panel",
|
|
821
|
+
"detail.closeDiscussion": "Close discussion panel",
|
|
822
|
+
"detail.subscribeAriaLabel": "Subscribe to notifications",
|
|
823
|
+
"detail.unsubscribeAriaLabel": "Unsubscribe from notifications",
|
|
824
|
+
"detail.clearSearch": "Clear search"
|
|
825
|
+
}, $ = Ot(kt, "detail.back");
|
|
767
826
|
//#endregion
|
|
768
827
|
//#region src/DetailSection.tsx
|
|
769
828
|
function At(e, t) {
|
|
770
829
|
return !e || e <= 1 || t <= 1 ? "" : t === 2 ? e >= 2 ? "md:col-span-2" : "" : e === 2 ? "md:col-span-2" : e >= 3 ? "md:col-span-2 lg:col-span-3" : "";
|
|
771
830
|
}
|
|
772
831
|
var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, isEditing: o = !1, onFieldChange: s, virtualScroll: l }) => {
|
|
773
|
-
let [u, d] =
|
|
832
|
+
let [u, d] = q.useState(e.defaultCollapsed ?? !1), [f, h] = q.useState(null), [g, _] = q.useState(void 0), { t: v } = $(), { fieldLabel: y } = Ge(), b = q.useCallback((e, t) => {
|
|
774
833
|
let n = t == null ? "" : String(t);
|
|
775
834
|
navigator.clipboard.writeText(n).then(() => {
|
|
776
835
|
h(e), setTimeout(() => h(null), 2e3);
|
|
@@ -780,9 +839,9 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
780
839
|
return n != null && n !== "";
|
|
781
840
|
}) : e.fields;
|
|
782
841
|
if (x.length === 0) return null;
|
|
783
|
-
let { fields: S, columns: C } =
|
|
842
|
+
let { fields: S, columns: C } = Dt(x, e.columns), w = (e) => {
|
|
784
843
|
let n = t?.[e.name] ?? e.value;
|
|
785
|
-
if (e.render) return /* @__PURE__ */
|
|
844
|
+
if (e.render) return /* @__PURE__ */ Y(Ce, {
|
|
786
845
|
schema: e.render,
|
|
787
846
|
data: {
|
|
788
847
|
...t,
|
|
@@ -790,7 +849,7 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
790
849
|
}
|
|
791
850
|
});
|
|
792
851
|
let i = At(e.span, C), c = (() => {
|
|
793
|
-
if (n == null) return /* @__PURE__ */
|
|
852
|
+
if (n == null) return /* @__PURE__ */ Y("span", {
|
|
794
853
|
className: "text-muted-foreground/50 text-xs italic",
|
|
795
854
|
children: "—"
|
|
796
855
|
});
|
|
@@ -801,54 +860,54 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
801
860
|
n && !a.reference_to && (a.reference_to = n), t.reference_field && !a.reference_field && (a.reference_field = t.reference_field);
|
|
802
861
|
}
|
|
803
862
|
if (i) {
|
|
804
|
-
let e =
|
|
805
|
-
if (e) return /* @__PURE__ */
|
|
863
|
+
let e = yt(i);
|
|
864
|
+
if (e) return /* @__PURE__ */ Y(e, {
|
|
806
865
|
value: n,
|
|
807
866
|
field: a
|
|
808
867
|
});
|
|
809
868
|
}
|
|
810
869
|
return String(n);
|
|
811
870
|
})(), l = n != null && n !== "", u = f === e.name;
|
|
812
|
-
return /* @__PURE__ */
|
|
813
|
-
className:
|
|
814
|
-
children: [/* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ X("div", {
|
|
872
|
+
className: K("space-y-1.5 group", i),
|
|
873
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
815
874
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
816
875
|
children: y(a || "", e.name, e.label || e.name)
|
|
817
|
-
}), o && !e.readonly ? /* @__PURE__ */
|
|
876
|
+
}), o && !e.readonly ? /* @__PURE__ */ Y("div", {
|
|
818
877
|
className: "min-h-[44px] sm:min-h-0",
|
|
819
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ Y("input", {
|
|
820
879
|
type: e.type === "number" ? "number" : e.type === "date" ? "date" : "text",
|
|
821
880
|
className: "w-full px-2 py-1.5 text-sm border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring",
|
|
822
881
|
value: n == null ? "" : String(n),
|
|
823
882
|
onChange: (t) => s?.(e.name, t.target.value)
|
|
824
883
|
})
|
|
825
|
-
}) : /* @__PURE__ */
|
|
826
|
-
className:
|
|
884
|
+
}) : /* @__PURE__ */ X("div", {
|
|
885
|
+
className: K("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md", l && "cursor-pointer active:bg-muted/60 transition-colors"),
|
|
827
886
|
onClick: l ? () => b(e.name, n) : void 0,
|
|
828
887
|
onKeyDown: l ? (t) => {
|
|
829
888
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), b(e.name, n));
|
|
830
889
|
} : void 0,
|
|
831
890
|
role: l ? "button" : void 0,
|
|
832
891
|
tabIndex: l ? 0 : void 0,
|
|
833
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
834
893
|
className: "text-sm flex-1 break-words py-1",
|
|
835
894
|
children: c
|
|
836
|
-
}), l && /* @__PURE__ */
|
|
895
|
+
}), l && /* @__PURE__ */ Y(V, { children: /* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
837
896
|
asChild: !0,
|
|
838
|
-
children: /* @__PURE__ */
|
|
897
|
+
children: /* @__PURE__ */ Y(P, {
|
|
839
898
|
variant: "ghost",
|
|
840
899
|
size: "icon",
|
|
841
900
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",
|
|
842
901
|
onClick: (t) => {
|
|
843
902
|
t.stopPropagation(), b(e.name, n);
|
|
844
903
|
},
|
|
845
|
-
children: u ? /* @__PURE__ */
|
|
904
|
+
children: u ? /* @__PURE__ */ Y(F, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Y(A, { className: "h-3 w-3" })
|
|
846
905
|
})
|
|
847
|
-
}), /* @__PURE__ */
|
|
906
|
+
}), /* @__PURE__ */ Y(H, { children: v(u ? "detail.copied" : "detail.copyToClipboard") })] }) })]
|
|
848
907
|
})]
|
|
849
908
|
}, e.name);
|
|
850
909
|
}, T = l?.enabled === !0, E = l?.batchSize ?? 20;
|
|
851
|
-
|
|
910
|
+
q.useEffect(() => {
|
|
852
911
|
if (!T) {
|
|
853
912
|
_(void 0);
|
|
854
913
|
return;
|
|
@@ -865,94 +924,94 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
865
924
|
S.length,
|
|
866
925
|
E
|
|
867
926
|
]);
|
|
868
|
-
let O = g === void 0 ? S : S.slice(0, g),
|
|
869
|
-
className:
|
|
927
|
+
let O = g === void 0 ? S : S.slice(0, g), ee = /* @__PURE__ */ Y("div", {
|
|
928
|
+
className: K("grid gap-3 sm:gap-4", C === 1 ? "grid-cols-1" : C === 2 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),
|
|
870
929
|
children: O.map(w)
|
|
871
930
|
});
|
|
872
|
-
return e.collapsible ? /* @__PURE__ */
|
|
931
|
+
return e.collapsible ? /* @__PURE__ */ Y(Re, {
|
|
873
932
|
open: !u,
|
|
874
933
|
onOpenChange: (e) => d(!e),
|
|
875
934
|
className: n,
|
|
876
|
-
children: /* @__PURE__ */
|
|
935
|
+
children: /* @__PURE__ */ X(D, { children: [/* @__PURE__ */ Y(k, {
|
|
877
936
|
asChild: !0,
|
|
878
|
-
children: /* @__PURE__ */
|
|
879
|
-
className:
|
|
880
|
-
children: [/* @__PURE__ */
|
|
937
|
+
children: /* @__PURE__ */ X(c, {
|
|
938
|
+
className: K("cursor-pointer hover:bg-muted/50 transition-colors", e.headerColor && `bg-${e.headerColor}`),
|
|
939
|
+
children: [/* @__PURE__ */ X(m, {
|
|
881
940
|
className: "flex items-center justify-between",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
941
|
+
children: [/* @__PURE__ */ X("div", {
|
|
883
942
|
className: "flex items-center gap-2",
|
|
884
943
|
children: [
|
|
885
|
-
e.icon && /* @__PURE__ */
|
|
944
|
+
e.icon && /* @__PURE__ */ Y("span", {
|
|
886
945
|
className: "text-muted-foreground",
|
|
887
946
|
children: e.icon
|
|
888
947
|
}),
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
e.fields && /* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ Y("span", { children: e.title }),
|
|
949
|
+
e.fields && /* @__PURE__ */ Y(G, {
|
|
891
950
|
variant: "secondary",
|
|
892
951
|
className: "ml-2 text-xs",
|
|
893
952
|
children: e.fields.length
|
|
894
953
|
})
|
|
895
954
|
]
|
|
896
|
-
}), /* @__PURE__ */
|
|
955
|
+
}), /* @__PURE__ */ Y("div", {
|
|
897
956
|
className: "flex items-center gap-2",
|
|
898
|
-
children:
|
|
957
|
+
children: Y(u ? p : te, { className: "h-4 w-4 text-muted-foreground" })
|
|
899
958
|
})]
|
|
900
|
-
}), e.description && !u && /* @__PURE__ */
|
|
959
|
+
}), e.description && !u && /* @__PURE__ */ Y("p", {
|
|
901
960
|
className: "text-sm text-muted-foreground mt-1.5",
|
|
902
961
|
children: e.description
|
|
903
962
|
})]
|
|
904
963
|
})
|
|
905
|
-
}), /* @__PURE__ */
|
|
964
|
+
}), /* @__PURE__ */ Y(i, { children: /* @__PURE__ */ Y(j, {
|
|
906
965
|
className: "pt-4 sm:pt-6 px-3 sm:px-6",
|
|
907
|
-
children:
|
|
966
|
+
children: ee
|
|
908
967
|
}) })] })
|
|
909
|
-
}) : /* @__PURE__ */
|
|
910
|
-
className:
|
|
911
|
-
children: [e.title && /* @__PURE__ */
|
|
912
|
-
className:
|
|
913
|
-
children: [/* @__PURE__ */
|
|
968
|
+
}) : /* @__PURE__ */ X(D, {
|
|
969
|
+
className: K(e.showBorder === !1 ? "border-none shadow-none" : "", n),
|
|
970
|
+
children: [e.title && /* @__PURE__ */ X(c, {
|
|
971
|
+
className: K(e.headerColor && `bg-${e.headerColor}`),
|
|
972
|
+
children: [/* @__PURE__ */ Y(m, {
|
|
914
973
|
className: "flex items-center justify-between",
|
|
915
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ X("div", {
|
|
916
975
|
className: "flex items-center gap-2",
|
|
917
976
|
children: [
|
|
918
|
-
e.icon && /* @__PURE__ */
|
|
977
|
+
e.icon && /* @__PURE__ */ Y("span", {
|
|
919
978
|
className: "text-muted-foreground",
|
|
920
979
|
children: e.icon
|
|
921
980
|
}),
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
e.fields && /* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ Y("span", { children: e.title }),
|
|
982
|
+
e.fields && /* @__PURE__ */ Y(G, {
|
|
924
983
|
variant: "secondary",
|
|
925
984
|
className: "ml-2 text-xs",
|
|
926
985
|
children: e.fields.length
|
|
927
986
|
})
|
|
928
987
|
]
|
|
929
988
|
})
|
|
930
|
-
}), e.description && /* @__PURE__ */
|
|
989
|
+
}), e.description && /* @__PURE__ */ Y("p", {
|
|
931
990
|
className: "text-sm text-muted-foreground mt-1.5",
|
|
932
991
|
children: e.description
|
|
933
992
|
})]
|
|
934
|
-
}), /* @__PURE__ */
|
|
993
|
+
}), /* @__PURE__ */ Y(j, {
|
|
935
994
|
className: "pt-4 sm:pt-6 px-3 sm:px-6",
|
|
936
|
-
children:
|
|
995
|
+
children: ee
|
|
937
996
|
})]
|
|
938
997
|
});
|
|
939
998
|
}, Mt = ({ tabs: e, data: t, className: n }) => {
|
|
940
|
-
let [r, i] =
|
|
941
|
-
return /* @__PURE__ */
|
|
999
|
+
let [r, i] = q.useState(e[0]?.key), a = e.filter((e) => typeof e.visible == "boolean" ? e.visible : (e.visible, !0));
|
|
1000
|
+
return /* @__PURE__ */ X(ye, {
|
|
942
1001
|
value: r,
|
|
943
1002
|
onValueChange: i,
|
|
944
1003
|
className: n,
|
|
945
|
-
children: [/* @__PURE__ */
|
|
1004
|
+
children: [/* @__PURE__ */ Y(de, {
|
|
946
1005
|
className: "w-full justify-start border-b rounded-none bg-transparent p-0",
|
|
947
|
-
children: a.map((e) => /* @__PURE__ */
|
|
1006
|
+
children: a.map((e) => /* @__PURE__ */ Y(L, {
|
|
948
1007
|
value: e.key,
|
|
949
1008
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
950
|
-
children: /* @__PURE__ */
|
|
1009
|
+
children: /* @__PURE__ */ X("div", {
|
|
951
1010
|
className: "flex items-center gap-2",
|
|
952
1011
|
children: [
|
|
953
|
-
e.icon && /* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
e.badge && /* @__PURE__ */
|
|
1012
|
+
e.icon && /* @__PURE__ */ Y("span", { children: e.icon }),
|
|
1013
|
+
/* @__PURE__ */ Y("span", { children: e.label }),
|
|
1014
|
+
e.badge && /* @__PURE__ */ Y(G, {
|
|
956
1015
|
variant: "secondary",
|
|
957
1016
|
className: "ml-1",
|
|
958
1017
|
children: e.badge
|
|
@@ -960,34 +1019,34 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
960
1019
|
]
|
|
961
1020
|
})
|
|
962
1021
|
}, e.key))
|
|
963
|
-
}), a.map((e) => /* @__PURE__ */
|
|
1022
|
+
}), a.map((e) => /* @__PURE__ */ Y(Ee, {
|
|
964
1023
|
value: e.key,
|
|
965
1024
|
className: "mt-4",
|
|
966
|
-
children: Array.isArray(e.content) ? /* @__PURE__ */
|
|
1025
|
+
children: Array.isArray(e.content) ? /* @__PURE__ */ Y("div", {
|
|
967
1026
|
className: "space-y-4",
|
|
968
|
-
children: e.content.map((e, n) => /* @__PURE__ */
|
|
1027
|
+
children: e.content.map((e, n) => /* @__PURE__ */ Y(Ce, {
|
|
969
1028
|
schema: e,
|
|
970
1029
|
data: t
|
|
971
1030
|
}, n))
|
|
972
|
-
}) : /* @__PURE__ */
|
|
1031
|
+
}) : /* @__PURE__ */ Y(Ce, {
|
|
973
1032
|
schema: e.content,
|
|
974
1033
|
data: t
|
|
975
1034
|
})
|
|
976
1035
|
}, e.key))]
|
|
977
1036
|
});
|
|
978
1037
|
}, Nt = ({ title: e, type: t, api: n, data: r = [], schema: i, columns: o, className: s, dataSource: l, objectName: u, onNew: f, onViewAll: h, onRowEdit: g, onRowDelete: _, pageSize: v, sortable: y = !1, filterable: b = !1, collapsible: x = !1, defaultCollapsed: S = !1 }) => {
|
|
979
|
-
let [C, w] =
|
|
980
|
-
|
|
1038
|
+
let [C, w] = q.useState(r), [T, E] = q.useState(!1), [O, k] = q.useState(0), [A, ee] = q.useState(null), [M, F] = q.useState("asc"), [I, ne] = q.useState(""), [L, re] = q.useState(null), [z, ie] = q.useState(S), { t: B } = $(), { fieldLabel: ae } = Ge();
|
|
1039
|
+
q.useEffect(() => {
|
|
981
1040
|
w(r);
|
|
982
|
-
}, [r]),
|
|
983
|
-
n && l?.getObjectSchema && !o?.length && l.getObjectSchema(n).then(
|
|
1041
|
+
}, [r]), q.useEffect(() => {
|
|
1042
|
+
n && l?.getObjectSchema && !o?.length && l.getObjectSchema(n).then(re).catch((e) => {
|
|
984
1043
|
console.warn(`[RelatedList] Failed to fetch schema for ${n}:`, e);
|
|
985
1044
|
});
|
|
986
1045
|
}, [
|
|
987
1046
|
n,
|
|
988
1047
|
l,
|
|
989
1048
|
o
|
|
990
|
-
]),
|
|
1049
|
+
]), q.useEffect(() => {
|
|
991
1050
|
n && !r.length && (E(!0), l && typeof l.find == "function" ? l.find(n).then((e) => {
|
|
992
1051
|
w(Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []), E(!1);
|
|
993
1052
|
}).catch((e) => {
|
|
@@ -1002,44 +1061,44 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1002
1061
|
r,
|
|
1003
1062
|
l
|
|
1004
1063
|
]);
|
|
1005
|
-
let
|
|
1064
|
+
let oe = q.useMemo(() => {
|
|
1006
1065
|
if (!I) return C;
|
|
1007
1066
|
let e = I.toLowerCase();
|
|
1008
1067
|
return C.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
|
|
1009
|
-
}, [C, I]), se =
|
|
1068
|
+
}, [C, I]), se = q.useMemo(() => A ? [...oe].sort((e, t) => {
|
|
1010
1069
|
let n = e[A], r = t[A];
|
|
1011
1070
|
if (n == null && r == null) return 0;
|
|
1012
1071
|
if (n == null) return 1;
|
|
1013
1072
|
if (r == null) return -1;
|
|
1014
1073
|
let i = String(n).localeCompare(String(r), void 0, { numeric: !0 });
|
|
1015
|
-
return
|
|
1016
|
-
}) :
|
|
1017
|
-
|
|
1074
|
+
return M === "asc" ? i : -i;
|
|
1075
|
+
}) : oe, [
|
|
1076
|
+
oe,
|
|
1018
1077
|
A,
|
|
1019
|
-
|
|
1020
|
-
]),
|
|
1021
|
-
|
|
1078
|
+
M
|
|
1079
|
+
]), V = v && v > 0 ? v : 0, ce = V ? Math.max(1, Math.ceil(se.length / V)) : 1, H = V ? se.slice(O * V, (O + 1) * V) : se;
|
|
1080
|
+
q.useEffect(() => {
|
|
1022
1081
|
k(0);
|
|
1023
1082
|
}, [
|
|
1024
1083
|
I,
|
|
1025
1084
|
A,
|
|
1026
|
-
|
|
1085
|
+
M
|
|
1027
1086
|
]);
|
|
1028
|
-
let
|
|
1029
|
-
A === e ? F((e) => e === "asc" ? "desc" : "asc") : (
|
|
1030
|
-
}, [A]),
|
|
1031
|
-
window.confirm(
|
|
1032
|
-
}, [_,
|
|
1087
|
+
let le = q.useCallback((e) => {
|
|
1088
|
+
A === e ? F((e) => e === "asc" ? "desc" : "asc") : (ee(e), F("asc"));
|
|
1089
|
+
}, [A]), de = q.useCallback((e) => {
|
|
1090
|
+
window.confirm(B("detail.deleteRowConfirmation")) && _?.(e);
|
|
1091
|
+
}, [_, B]), pe = q.useMemo(() => {
|
|
1033
1092
|
if (o && o.length > 0) return o;
|
|
1034
1093
|
if (!L?.fields) return [];
|
|
1035
1094
|
let e = u || n || "";
|
|
1036
1095
|
return Object.entries(L.fields).filter(([e]) => !e.startsWith("_") && e !== "id").map(([t, n]) => {
|
|
1037
1096
|
let r = {
|
|
1038
1097
|
accessorKey: t,
|
|
1039
|
-
header:
|
|
1098
|
+
header: ae(e, t, n.label || t)
|
|
1040
1099
|
};
|
|
1041
1100
|
if (n.type) {
|
|
1042
|
-
let e =
|
|
1101
|
+
let e = yt(n.type);
|
|
1043
1102
|
if (e) {
|
|
1044
1103
|
let i = {
|
|
1045
1104
|
name: t,
|
|
@@ -1052,7 +1111,7 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1052
1111
|
...(n.reference_to || n.reference) && { reference_to: n.reference_to || n.reference },
|
|
1053
1112
|
...n.reference_field && { reference_field: n.reference_field }
|
|
1054
1113
|
};
|
|
1055
|
-
r.cell = (t) => t == null ?
|
|
1114
|
+
r.cell = (t) => t == null ? q.createElement("span", { className: "text-muted-foreground/50 text-xs italic" }, "—") : q.createElement(e, {
|
|
1056
1115
|
value: t,
|
|
1057
1116
|
field: i
|
|
1058
1117
|
});
|
|
@@ -1065,21 +1124,21 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1065
1124
|
L,
|
|
1066
1125
|
u,
|
|
1067
1126
|
n,
|
|
1068
|
-
|
|
1069
|
-
]),
|
|
1127
|
+
ae
|
|
1128
|
+
]), U = q.useMemo(() => {
|
|
1070
1129
|
if (i) return i;
|
|
1071
1130
|
switch (t) {
|
|
1072
1131
|
case "grid":
|
|
1073
1132
|
case "table": return {
|
|
1074
1133
|
type: "data-table",
|
|
1075
|
-
data:
|
|
1076
|
-
columns:
|
|
1134
|
+
data: H,
|
|
1135
|
+
columns: pe,
|
|
1077
1136
|
pagination: !1,
|
|
1078
|
-
pageSize:
|
|
1137
|
+
pageSize: V || 10
|
|
1079
1138
|
};
|
|
1080
1139
|
case "list": return {
|
|
1081
1140
|
type: "data-list",
|
|
1082
|
-
data:
|
|
1141
|
+
data: H
|
|
1083
1142
|
};
|
|
1084
1143
|
default: return {
|
|
1085
1144
|
type: "div",
|
|
@@ -1088,146 +1147,146 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1088
1147
|
}
|
|
1089
1148
|
}, [
|
|
1090
1149
|
t,
|
|
1091
|
-
|
|
1092
|
-
|
|
1150
|
+
H,
|
|
1151
|
+
pe,
|
|
1093
1152
|
i,
|
|
1094
|
-
|
|
1153
|
+
V
|
|
1095
1154
|
]), me = !!g || !!_;
|
|
1096
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ X(D, {
|
|
1097
1156
|
className: s,
|
|
1098
|
-
children: [/* @__PURE__ */
|
|
1157
|
+
children: [/* @__PURE__ */ Y(c, {
|
|
1099
1158
|
className: x ? "cursor-pointer select-none" : void 0,
|
|
1100
|
-
onClick: x ? () =>
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1159
|
+
onClick: x ? () => ie((e) => !e) : void 0,
|
|
1160
|
+
children: /* @__PURE__ */ X(m, {
|
|
1102
1161
|
className: "flex items-center justify-between",
|
|
1103
|
-
children: [/* @__PURE__ */
|
|
1162
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1104
1163
|
className: "flex items-center gap-2",
|
|
1105
1164
|
children: [
|
|
1106
|
-
x &&
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1165
|
+
x && Y(z ? p : te, { className: "h-4 w-4 text-muted-foreground" }),
|
|
1166
|
+
/* @__PURE__ */ Y("span", { children: e }),
|
|
1167
|
+
/* @__PURE__ */ Y(G, {
|
|
1109
1168
|
variant: "secondary",
|
|
1110
1169
|
className: "text-xs font-normal",
|
|
1111
1170
|
"aria-label": `${C.length} records`,
|
|
1112
1171
|
children: C.length
|
|
1113
1172
|
})
|
|
1114
1173
|
]
|
|
1115
|
-
}), /* @__PURE__ */
|
|
1174
|
+
}), /* @__PURE__ */ X("div", {
|
|
1116
1175
|
className: "flex items-center gap-1",
|
|
1117
|
-
children: [f && /* @__PURE__ */
|
|
1176
|
+
children: [f && /* @__PURE__ */ X(P, {
|
|
1118
1177
|
variant: "ghost",
|
|
1119
1178
|
size: "sm",
|
|
1120
1179
|
onClick: (e) => {
|
|
1121
1180
|
e.stopPropagation(), f();
|
|
1122
1181
|
},
|
|
1123
1182
|
className: "gap-1 h-7 text-xs",
|
|
1124
|
-
children: [/* @__PURE__ */
|
|
1125
|
-
}), h && /* @__PURE__ */
|
|
1183
|
+
children: [/* @__PURE__ */ Y(ue, { className: "h-3.5 w-3.5" }), B("detail.new")]
|
|
1184
|
+
}), h && /* @__PURE__ */ X(P, {
|
|
1126
1185
|
variant: "ghost",
|
|
1127
1186
|
size: "sm",
|
|
1128
1187
|
onClick: (e) => {
|
|
1129
1188
|
e.stopPropagation(), h();
|
|
1130
1189
|
},
|
|
1131
1190
|
className: "gap-1 h-7 text-xs",
|
|
1132
|
-
children: [
|
|
1191
|
+
children: [B("detail.viewAll"), /* @__PURE__ */ Y(d, { className: "h-3 w-3" })]
|
|
1133
1192
|
})]
|
|
1134
1193
|
})]
|
|
1135
1194
|
})
|
|
1136
|
-
}), !
|
|
1137
|
-
b && C.length > 0 && /* @__PURE__ */
|
|
1195
|
+
}), !z && /* @__PURE__ */ X(j, { children: [
|
|
1196
|
+
b && C.length > 0 && /* @__PURE__ */ Y("div", {
|
|
1138
1197
|
className: "mb-3",
|
|
1139
|
-
children: /* @__PURE__ */
|
|
1140
|
-
placeholder:
|
|
1198
|
+
children: /* @__PURE__ */ Y(a, {
|
|
1199
|
+
placeholder: B("detail.filterPlaceholder"),
|
|
1141
1200
|
value: I,
|
|
1142
1201
|
onChange: (e) => ne(e.target.value),
|
|
1143
1202
|
className: "h-8 text-sm"
|
|
1144
1203
|
})
|
|
1145
1204
|
}),
|
|
1146
|
-
y &&
|
|
1205
|
+
y && pe && pe.length > 0 && C.length > 0 && /* @__PURE__ */ Y("div", {
|
|
1147
1206
|
className: "flex flex-wrap gap-1 mb-3",
|
|
1148
|
-
children:
|
|
1207
|
+
children: pe.map((e) => {
|
|
1149
1208
|
let t = e.accessorKey || e.field || e.name;
|
|
1150
1209
|
if (!t) return null;
|
|
1151
1210
|
let n = e.header || e.label || t, r = A === t;
|
|
1152
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ X(P, {
|
|
1153
1212
|
variant: r ? "secondary" : "ghost",
|
|
1154
1213
|
size: "sm",
|
|
1155
1214
|
className: "gap-1 h-7 text-xs",
|
|
1156
|
-
onClick: () =>
|
|
1215
|
+
onClick: () => le(t),
|
|
1157
1216
|
children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ Y(fe, { className: "h-3 w-3" }),
|
|
1159
1218
|
n,
|
|
1160
|
-
r && (
|
|
1219
|
+
r && (M === "asc" ? " ↑" : " ↓")
|
|
1161
1220
|
]
|
|
1162
1221
|
}, t);
|
|
1163
1222
|
})
|
|
1164
1223
|
}),
|
|
1165
|
-
T ? /* @__PURE__ */
|
|
1224
|
+
T ? /* @__PURE__ */ Y("div", {
|
|
1166
1225
|
className: "flex items-center justify-center py-8 text-muted-foreground",
|
|
1167
|
-
children:
|
|
1168
|
-
}) : C.length === 0 ? /* @__PURE__ */
|
|
1226
|
+
children: B("detail.loading")
|
|
1227
|
+
}) : C.length === 0 ? /* @__PURE__ */ Y("div", {
|
|
1169
1228
|
className: "flex items-center justify-center py-8 text-muted-foreground text-sm",
|
|
1170
|
-
children:
|
|
1171
|
-
}) : /* @__PURE__ */
|
|
1229
|
+
children: B("detail.noRelatedRecords")
|
|
1230
|
+
}) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ce, { schema: U }), me && H.length > 0 && /* @__PURE__ */ Y("div", {
|
|
1172
1231
|
className: "mt-2 space-y-1",
|
|
1173
1232
|
"data-testid": "row-actions",
|
|
1174
|
-
children:
|
|
1233
|
+
children: H.map((e, t) => /* @__PURE__ */ X("div", {
|
|
1175
1234
|
className: "flex items-center justify-between px-2 py-1 text-xs border-b last:border-b-0",
|
|
1176
|
-
children: [/* @__PURE__ */
|
|
1235
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1177
1236
|
className: "truncate text-muted-foreground",
|
|
1178
1237
|
children: e.name || e.title || e.id || `Row ${t + 1}`
|
|
1179
|
-
}), /* @__PURE__ */
|
|
1238
|
+
}), /* @__PURE__ */ X("div", {
|
|
1180
1239
|
className: "flex items-center gap-1",
|
|
1181
|
-
children: [g && /* @__PURE__ */
|
|
1240
|
+
children: [g && /* @__PURE__ */ X(P, {
|
|
1182
1241
|
variant: "ghost",
|
|
1183
1242
|
size: "sm",
|
|
1184
1243
|
className: "h-6 text-xs gap-1 px-2",
|
|
1185
1244
|
onClick: () => g(e),
|
|
1186
|
-
children: [/* @__PURE__ */
|
|
1187
|
-
}), _ && /* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ Y(R, { className: "h-3 w-3" }), B("detail.editRow")]
|
|
1246
|
+
}), _ && /* @__PURE__ */ X(P, {
|
|
1188
1247
|
variant: "ghost",
|
|
1189
1248
|
size: "sm",
|
|
1190
1249
|
className: "h-6 text-xs gap-1 px-2 text-destructive hover:text-destructive",
|
|
1191
|
-
onClick: () =>
|
|
1192
|
-
children: [/* @__PURE__ */
|
|
1250
|
+
onClick: () => de(e),
|
|
1251
|
+
children: [/* @__PURE__ */ Y(je, { className: "h-3 w-3" }), B("detail.deleteRow")]
|
|
1193
1252
|
})]
|
|
1194
1253
|
})]
|
|
1195
1254
|
}, e.id || t))
|
|
1196
1255
|
})] }),
|
|
1197
|
-
|
|
1256
|
+
V > 0 && se.length > V && /* @__PURE__ */ X("div", {
|
|
1198
1257
|
className: "flex items-center justify-between mt-3 pt-3 border-t",
|
|
1199
1258
|
children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1259
|
+
/* @__PURE__ */ X(P, {
|
|
1201
1260
|
variant: "outline",
|
|
1202
1261
|
size: "sm",
|
|
1203
1262
|
className: "h-7 text-xs gap-1",
|
|
1204
1263
|
disabled: O === 0,
|
|
1205
1264
|
onClick: () => k((e) => Math.max(0, e - 1)),
|
|
1206
|
-
children: [/* @__PURE__ */
|
|
1265
|
+
children: [/* @__PURE__ */ Y(N, { className: "h-3 w-3" }), B("detail.previousPage")]
|
|
1207
1266
|
}),
|
|
1208
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ Y("span", {
|
|
1209
1268
|
className: "text-xs text-muted-foreground",
|
|
1210
|
-
children:
|
|
1269
|
+
children: B("detail.pageOf", {
|
|
1211
1270
|
current: O + 1,
|
|
1212
1271
|
total: ce
|
|
1213
1272
|
})
|
|
1214
1273
|
}),
|
|
1215
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ X(P, {
|
|
1216
1275
|
variant: "outline",
|
|
1217
1276
|
size: "sm",
|
|
1218
1277
|
className: "h-7 text-xs gap-1",
|
|
1219
1278
|
disabled: O >= ce - 1,
|
|
1220
1279
|
onClick: () => k((e) => Math.min(ce - 1, e + 1)),
|
|
1221
|
-
children: [
|
|
1280
|
+
children: [B("detail.nextPage"), /* @__PURE__ */ Y(p, { className: "h-3 w-3" })]
|
|
1222
1281
|
})
|
|
1223
1282
|
]
|
|
1224
1283
|
})
|
|
1225
1284
|
] })]
|
|
1226
1285
|
});
|
|
1227
1286
|
}, Pt = ({ group: e, data: t, className: n, objectSchema: r, objectName: a, isEditing: o = !1, onFieldChange: s }) => {
|
|
1228
|
-
let c = e.collapsible ?? !0, [l, u] =
|
|
1287
|
+
let c = e.collapsible ?? !0, [l, u] = q.useState(e.defaultCollapsed ?? !1), d = /* @__PURE__ */ Y("div", {
|
|
1229
1288
|
className: "space-y-3 sm:space-y-4",
|
|
1230
|
-
children: e.sections.map((e, n) => /* @__PURE__ */
|
|
1289
|
+
children: e.sections.map((e, n) => /* @__PURE__ */ Y(jt, {
|
|
1231
1290
|
section: e,
|
|
1232
1291
|
data: t,
|
|
1233
1292
|
objectSchema: r,
|
|
@@ -1236,51 +1295,51 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1236
1295
|
onFieldChange: s
|
|
1237
1296
|
}, n))
|
|
1238
1297
|
});
|
|
1239
|
-
return c ? /* @__PURE__ */
|
|
1298
|
+
return c ? /* @__PURE__ */ X(Re, {
|
|
1240
1299
|
open: !l,
|
|
1241
1300
|
onOpenChange: (e) => u(!e),
|
|
1242
1301
|
className: n,
|
|
1243
1302
|
children: [
|
|
1244
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ Y(k, {
|
|
1245
1304
|
asChild: !0,
|
|
1246
|
-
children: /* @__PURE__ */
|
|
1305
|
+
children: /* @__PURE__ */ X("div", {
|
|
1247
1306
|
className: "flex items-center gap-2 pb-2 border-b cursor-pointer hover:bg-muted/50 transition-colors rounded-t-md px-2 py-1.5",
|
|
1248
1307
|
children: [
|
|
1249
|
-
|
|
1250
|
-
e.icon && /* @__PURE__ */
|
|
1308
|
+
Y(l ? p : te, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
1309
|
+
e.icon && /* @__PURE__ */ Y("span", {
|
|
1251
1310
|
className: "text-muted-foreground",
|
|
1252
1311
|
children: e.icon
|
|
1253
1312
|
}),
|
|
1254
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ Y("h3", {
|
|
1255
1314
|
className: "text-lg font-semibold",
|
|
1256
1315
|
children: e.title
|
|
1257
1316
|
})
|
|
1258
1317
|
]
|
|
1259
1318
|
})
|
|
1260
1319
|
}),
|
|
1261
|
-
e.description && !l && /* @__PURE__ */
|
|
1320
|
+
e.description && !l && /* @__PURE__ */ Y("p", {
|
|
1262
1321
|
className: "text-sm text-muted-foreground mt-1",
|
|
1263
1322
|
children: e.description
|
|
1264
1323
|
}),
|
|
1265
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ Y(i, { children: /* @__PURE__ */ Y("div", {
|
|
1266
1325
|
className: "mt-3",
|
|
1267
1326
|
children: d
|
|
1268
1327
|
}) })
|
|
1269
1328
|
]
|
|
1270
|
-
}) : /* @__PURE__ */
|
|
1271
|
-
className:
|
|
1329
|
+
}) : /* @__PURE__ */ X("div", {
|
|
1330
|
+
className: K("space-y-3", n),
|
|
1272
1331
|
children: [
|
|
1273
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ X("div", {
|
|
1274
1333
|
className: "flex items-center gap-2 pb-2 border-b",
|
|
1275
|
-
children: [e.icon && /* @__PURE__ */
|
|
1334
|
+
children: [e.icon && /* @__PURE__ */ Y("span", {
|
|
1276
1335
|
className: "text-muted-foreground",
|
|
1277
1336
|
children: e.icon
|
|
1278
|
-
}), /* @__PURE__ */
|
|
1337
|
+
}), /* @__PURE__ */ Y("h3", {
|
|
1279
1338
|
className: "text-lg font-semibold",
|
|
1280
1339
|
children: e.title
|
|
1281
1340
|
})]
|
|
1282
1341
|
}),
|
|
1283
|
-
e.description && /* @__PURE__ */
|
|
1342
|
+
e.description && /* @__PURE__ */ Y("p", {
|
|
1284
1343
|
className: "text-sm text-muted-foreground",
|
|
1285
1344
|
children: e.description
|
|
1286
1345
|
}),
|
|
@@ -1288,18 +1347,18 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1288
1347
|
]
|
|
1289
1348
|
});
|
|
1290
1349
|
}, Ft = ({ fields: e, data: t, className: n, objectName: r, objectSchema: i }) => {
|
|
1291
|
-
let { fieldLabel: a } =
|
|
1350
|
+
let { fieldLabel: a } = Ge();
|
|
1292
1351
|
if (!e.length || !t) return null;
|
|
1293
1352
|
let o = e.filter((e) => {
|
|
1294
1353
|
let n = t?.[e.name];
|
|
1295
1354
|
return n != null && n !== "";
|
|
1296
1355
|
});
|
|
1297
|
-
return o.length === 0 ? null : /* @__PURE__ */
|
|
1298
|
-
className:
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1356
|
+
return o.length === 0 ? null : /* @__PURE__ */ Y(D, {
|
|
1357
|
+
className: K("bg-muted/30 border-dashed", n),
|
|
1358
|
+
children: /* @__PURE__ */ Y(j, {
|
|
1300
1359
|
className: "py-3 px-4",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1302
|
-
className:
|
|
1360
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1361
|
+
className: K("grid gap-4", o.length === 1 ? "grid-cols-1" : o.length === 2 ? "grid-cols-2" : o.length === 3 ? "grid-cols-3" : "grid-cols-2 md:grid-cols-4"),
|
|
1303
1362
|
children: o.map((e) => {
|
|
1304
1363
|
let n = t[e.name], o = i?.fields?.[e.name], s = e.type || o?.type, c = {
|
|
1305
1364
|
name: e.name,
|
|
@@ -1309,18 +1368,18 @@ var jt = ({ section: e, data: t, className: n, objectSchema: r, objectName: a, i
|
|
|
1309
1368
|
...o?.currency && { currency: o.currency },
|
|
1310
1369
|
...o?.precision !== void 0 && { precision: o.precision },
|
|
1311
1370
|
...o?.format && { format: o.format }
|
|
1312
|
-
}, l =
|
|
1313
|
-
return /* @__PURE__ */
|
|
1371
|
+
}, l = yt(s || "text");
|
|
1372
|
+
return /* @__PURE__ */ X("div", {
|
|
1314
1373
|
className: "flex flex-col gap-0.5",
|
|
1315
|
-
children: [/* @__PURE__ */
|
|
1374
|
+
children: [/* @__PURE__ */ X("span", {
|
|
1316
1375
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
1317
|
-
children: [e.icon && /* @__PURE__ */
|
|
1376
|
+
children: [e.icon && /* @__PURE__ */ Y("span", {
|
|
1318
1377
|
className: "mr-1",
|
|
1319
1378
|
children: e.icon
|
|
1320
1379
|
}), a(r || "", e.name, e.label)]
|
|
1321
|
-
}), /* @__PURE__ */
|
|
1380
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1322
1381
|
className: "text-sm font-semibold truncate",
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1382
|
+
children: /* @__PURE__ */ Y(l, {
|
|
1324
1383
|
value: n,
|
|
1325
1384
|
field: c
|
|
1326
1385
|
})
|
|
@@ -1347,30 +1406,30 @@ function It(e) {
|
|
|
1347
1406
|
}
|
|
1348
1407
|
}
|
|
1349
1408
|
var Lt = ({ comments: t, onAddComment: n, onTogglePin: r, searchable: i = !1, className: a }) => {
|
|
1350
|
-
let
|
|
1351
|
-
let e =
|
|
1409
|
+
let { t: o } = $(), [s, l] = q.useState(""), [u, d] = q.useState(!1), [f, p] = q.useState(""), h = q.useCallback(async () => {
|
|
1410
|
+
let e = s.trim();
|
|
1352
1411
|
if (!(!e || !n)) {
|
|
1353
|
-
|
|
1412
|
+
d(!0);
|
|
1354
1413
|
try {
|
|
1355
|
-
await n(e),
|
|
1414
|
+
await n(e), l("");
|
|
1356
1415
|
} finally {
|
|
1357
|
-
|
|
1416
|
+
d(!1);
|
|
1358
1417
|
}
|
|
1359
1418
|
}
|
|
1360
|
-
}, [
|
|
1361
|
-
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(),
|
|
1362
|
-
}, [
|
|
1363
|
-
let t =
|
|
1419
|
+
}, [s, n]), g = q.useCallback((e) => {
|
|
1420
|
+
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), h());
|
|
1421
|
+
}, [h]), _ = q.useMemo(() => [...f.trim() ? t.filter((e) => {
|
|
1422
|
+
let t = f.trim().toLowerCase();
|
|
1364
1423
|
return e.text.toLowerCase().includes(t) || e.author.toLowerCase().includes(t);
|
|
1365
|
-
}) : t].sort((e, t) => e.pinned && !t.pinned ? -1 : !e.pinned && t.pinned ? 1 : 0), [t,
|
|
1366
|
-
return /* @__PURE__ */
|
|
1367
|
-
className:
|
|
1368
|
-
children: [/* @__PURE__ */
|
|
1424
|
+
}) : t].sort((e, t) => e.pinned && !t.pinned ? -1 : !e.pinned && t.pinned ? 1 : 0), [t, f]);
|
|
1425
|
+
return /* @__PURE__ */ X(D, {
|
|
1426
|
+
className: K("", a),
|
|
1427
|
+
children: [/* @__PURE__ */ Y(c, { children: /* @__PURE__ */ X(m, {
|
|
1369
1428
|
className: "flex items-center gap-2 text-base",
|
|
1370
1429
|
children: [
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
"
|
|
1373
|
-
/* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ Y(T, { className: "h-4 w-4" }),
|
|
1431
|
+
o("detail.comments"),
|
|
1432
|
+
/* @__PURE__ */ X("span", {
|
|
1374
1433
|
className: "text-sm font-normal text-muted-foreground",
|
|
1375
1434
|
children: [
|
|
1376
1435
|
"(",
|
|
@@ -1379,97 +1438,97 @@ var Lt = ({ comments: t, onAddComment: n, onTogglePin: r, searchable: i = !1, cl
|
|
|
1379
1438
|
]
|
|
1380
1439
|
})
|
|
1381
1440
|
]
|
|
1382
|
-
}) }), /* @__PURE__ */
|
|
1441
|
+
}) }), /* @__PURE__ */ X(j, {
|
|
1383
1442
|
className: "space-y-4",
|
|
1384
1443
|
children: [
|
|
1385
|
-
i && /* @__PURE__ */
|
|
1444
|
+
i && /* @__PURE__ */ Y("div", {
|
|
1386
1445
|
className: "flex items-center gap-2",
|
|
1387
|
-
children: /* @__PURE__ */
|
|
1446
|
+
children: /* @__PURE__ */ X("div", {
|
|
1388
1447
|
className: "relative flex-1",
|
|
1389
1448
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ Y(ie, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
1450
|
+
/* @__PURE__ */ Y("input", {
|
|
1392
1451
|
className: "w-full rounded-md border border-input bg-background pl-8 pr-8 py-1.5 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1393
|
-
placeholder: "
|
|
1394
|
-
value:
|
|
1395
|
-
onChange: (e) =>
|
|
1396
|
-
"aria-label": "
|
|
1452
|
+
placeholder: o("detail.searchComments"),
|
|
1453
|
+
value: f,
|
|
1454
|
+
onChange: (e) => p(e.target.value),
|
|
1455
|
+
"aria-label": o("detail.searchComments")
|
|
1397
1456
|
}),
|
|
1398
|
-
|
|
1457
|
+
f && /* @__PURE__ */ Y("button", {
|
|
1399
1458
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
1400
|
-
onClick: () =>
|
|
1401
|
-
"aria-label": "
|
|
1459
|
+
onClick: () => p(""),
|
|
1460
|
+
"aria-label": o("detail.clearSearch"),
|
|
1402
1461
|
type: "button",
|
|
1403
|
-
children: /* @__PURE__ */
|
|
1462
|
+
children: /* @__PURE__ */ Y(e, { className: "h-3.5 w-3.5" })
|
|
1404
1463
|
})
|
|
1405
1464
|
]
|
|
1406
1465
|
})
|
|
1407
1466
|
}),
|
|
1408
|
-
n && /* @__PURE__ */
|
|
1467
|
+
n && /* @__PURE__ */ X("div", {
|
|
1409
1468
|
className: "flex gap-2",
|
|
1410
|
-
children: [/* @__PURE__ */
|
|
1469
|
+
children: [/* @__PURE__ */ Y("textarea", {
|
|
1411
1470
|
className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
|
|
1412
|
-
placeholder: "
|
|
1413
|
-
value:
|
|
1414
|
-
onChange: (e) =>
|
|
1415
|
-
onKeyDown:
|
|
1416
|
-
disabled:
|
|
1417
|
-
}), /* @__PURE__ */
|
|
1471
|
+
placeholder: o("detail.addCommentPlaceholder"),
|
|
1472
|
+
value: s,
|
|
1473
|
+
onChange: (e) => l(e.target.value),
|
|
1474
|
+
onKeyDown: g,
|
|
1475
|
+
disabled: u
|
|
1476
|
+
}), /* @__PURE__ */ Y(P, {
|
|
1418
1477
|
size: "icon",
|
|
1419
1478
|
variant: "default",
|
|
1420
|
-
onClick:
|
|
1421
|
-
disabled: !
|
|
1479
|
+
onClick: h,
|
|
1480
|
+
disabled: !s.trim() || u,
|
|
1422
1481
|
className: "shrink-0 self-end",
|
|
1423
|
-
children: /* @__PURE__ */
|
|
1482
|
+
children: /* @__PURE__ */ Y(Me, { className: "h-4 w-4" })
|
|
1424
1483
|
})]
|
|
1425
1484
|
}),
|
|
1426
|
-
|
|
1485
|
+
_.length === 0 ? /* @__PURE__ */ Y("p", {
|
|
1427
1486
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
1428
|
-
children:
|
|
1429
|
-
}) : /* @__PURE__ */
|
|
1487
|
+
children: f.trim() ? o("detail.noMatchingComments") : o("detail.noCommentsYet")
|
|
1488
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
1430
1489
|
className: "space-y-3",
|
|
1431
|
-
children:
|
|
1432
|
-
className:
|
|
1433
|
-
children: [/* @__PURE__ */
|
|
1490
|
+
children: _.map((e) => /* @__PURE__ */ X("div", {
|
|
1491
|
+
className: K("flex gap-3", e.pinned && "bg-muted/40 rounded-md p-2 -mx-2"),
|
|
1492
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1434
1493
|
className: "shrink-0",
|
|
1435
|
-
children: e.avatarUrl ? /* @__PURE__ */
|
|
1494
|
+
children: e.avatarUrl ? /* @__PURE__ */ Y("img", {
|
|
1436
1495
|
src: e.avatarUrl,
|
|
1437
1496
|
alt: e.author,
|
|
1438
1497
|
className: "h-8 w-8 rounded-full object-cover"
|
|
1439
|
-
}) : /* @__PURE__ */
|
|
1498
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
1440
1499
|
className: "h-8 w-8 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground",
|
|
1441
1500
|
children: e.author.charAt(0).toUpperCase()
|
|
1442
1501
|
})
|
|
1443
|
-
}), /* @__PURE__ */
|
|
1502
|
+
}), /* @__PURE__ */ X("div", {
|
|
1444
1503
|
className: "flex-1 min-w-0",
|
|
1445
1504
|
children: [
|
|
1446
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ X("div", {
|
|
1447
1506
|
className: "flex items-center gap-2 mb-0.5",
|
|
1448
1507
|
children: [
|
|
1449
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ Y("span", {
|
|
1450
1509
|
className: "text-sm font-medium truncate",
|
|
1451
1510
|
children: e.author
|
|
1452
1511
|
}),
|
|
1453
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ Y("span", {
|
|
1454
1513
|
className: "text-xs text-muted-foreground",
|
|
1455
1514
|
children: It(e.createdAt)
|
|
1456
1515
|
}),
|
|
1457
|
-
e.pinned && /* @__PURE__ */
|
|
1516
|
+
e.pinned && /* @__PURE__ */ X("span", {
|
|
1458
1517
|
className: "text-xs text-amber-600 flex items-center gap-0.5",
|
|
1459
|
-
children: [/* @__PURE__ */
|
|
1518
|
+
children: [/* @__PURE__ */ Y(ce, { className: "h-3 w-3" }), o("detail.pinned")]
|
|
1460
1519
|
})
|
|
1461
1520
|
]
|
|
1462
1521
|
}),
|
|
1463
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ Y("p", {
|
|
1464
1523
|
className: "text-sm whitespace-pre-wrap break-words",
|
|
1465
1524
|
children: e.text
|
|
1466
1525
|
}),
|
|
1467
|
-
r && /* @__PURE__ */
|
|
1526
|
+
r && /* @__PURE__ */ X("button", {
|
|
1468
1527
|
type: "button",
|
|
1469
1528
|
className: "mt-1 text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",
|
|
1470
1529
|
onClick: () => r(e.id),
|
|
1471
|
-
"aria-label": e.pinned ? "
|
|
1472
|
-
children: [/* @__PURE__ */
|
|
1530
|
+
"aria-label": e.pinned ? o("detail.unpin") : o("detail.pin"),
|
|
1531
|
+
children: [/* @__PURE__ */ Y(ce, { className: "h-3 w-3" }), e.pinned ? o("detail.unpin") : o("detail.pin")]
|
|
1473
1532
|
})
|
|
1474
1533
|
]
|
|
1475
1534
|
})]
|
|
@@ -1479,9 +1538,9 @@ var Lt = ({ comments: t, onAddComment: n, onTogglePin: r, searchable: i = !1, cl
|
|
|
1479
1538
|
})]
|
|
1480
1539
|
});
|
|
1481
1540
|
}, Rt = {
|
|
1482
|
-
field_change:
|
|
1483
|
-
create:
|
|
1484
|
-
delete:
|
|
1541
|
+
field_change: R,
|
|
1542
|
+
create: ee,
|
|
1543
|
+
delete: je,
|
|
1485
1544
|
comment: T,
|
|
1486
1545
|
status_change: xe
|
|
1487
1546
|
}, zt = {
|
|
@@ -1515,15 +1574,15 @@ var Ht = {
|
|
|
1515
1574
|
comment: "Comments",
|
|
1516
1575
|
status_change: "Status Changes"
|
|
1517
1576
|
}, Ut = ({ activities: e, filterable: t = !1, defaultFilter: n = "all", className: r }) => {
|
|
1518
|
-
let [i, a] =
|
|
1519
|
-
return /* @__PURE__ */
|
|
1520
|
-
className:
|
|
1521
|
-
children: [/* @__PURE__ */
|
|
1577
|
+
let [i, a] = q.useState(n), o = q.useMemo(() => i === "all" ? e : e.filter((e) => e.type === i), [e, i]);
|
|
1578
|
+
return /* @__PURE__ */ X(D, {
|
|
1579
|
+
className: K("", r),
|
|
1580
|
+
children: [/* @__PURE__ */ Y(c, { children: /* @__PURE__ */ X(m, {
|
|
1522
1581
|
className: "flex items-center gap-2 text-base",
|
|
1523
1582
|
children: [
|
|
1524
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ Y(_e, { className: "h-4 w-4" }),
|
|
1525
1584
|
"Activity",
|
|
1526
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ X("span", {
|
|
1527
1586
|
className: "text-sm font-normal text-muted-foreground",
|
|
1528
1587
|
children: [
|
|
1529
1588
|
"(",
|
|
@@ -1532,47 +1591,47 @@ var Ht = {
|
|
|
1532
1591
|
]
|
|
1533
1592
|
})
|
|
1534
1593
|
]
|
|
1535
|
-
}) }), /* @__PURE__ */
|
|
1594
|
+
}) }), /* @__PURE__ */ X(j, { children: [t && /* @__PURE__ */ Y("div", {
|
|
1536
1595
|
className: "flex flex-wrap gap-1.5 mb-4",
|
|
1537
1596
|
role: "group",
|
|
1538
1597
|
"aria-label": "Activity type filter",
|
|
1539
|
-
children: Object.keys(Ht).map((e) => /* @__PURE__ */
|
|
1598
|
+
children: Object.keys(Ht).map((e) => /* @__PURE__ */ X("button", {
|
|
1540
1599
|
type: "button",
|
|
1541
|
-
className:
|
|
1600
|
+
className: K("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors", i === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80"),
|
|
1542
1601
|
onClick: () => a(e),
|
|
1543
1602
|
"aria-pressed": i === e,
|
|
1544
|
-
children: [e !== "all" &&
|
|
1603
|
+
children: [e !== "all" && q.createElement(Rt[e] || R, { className: "h-3 w-3" }), Ht[e]]
|
|
1545
1604
|
}, e))
|
|
1546
|
-
}), o.length === 0 ? /* @__PURE__ */
|
|
1605
|
+
}), o.length === 0 ? /* @__PURE__ */ Y("p", {
|
|
1547
1606
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
1548
1607
|
children: "No activity recorded"
|
|
1549
|
-
}) : /* @__PURE__ */
|
|
1608
|
+
}) : /* @__PURE__ */ X("div", {
|
|
1550
1609
|
className: "relative",
|
|
1551
|
-
children: [/* @__PURE__ */
|
|
1610
|
+
children: [/* @__PURE__ */ Y("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Y("div", {
|
|
1552
1611
|
className: "space-y-4",
|
|
1553
1612
|
children: o.map((e) => {
|
|
1554
|
-
let t = Rt[e.type] ||
|
|
1555
|
-
return /* @__PURE__ */
|
|
1613
|
+
let t = Rt[e.type] || R;
|
|
1614
|
+
return /* @__PURE__ */ X("div", {
|
|
1556
1615
|
className: "flex gap-3 relative",
|
|
1557
|
-
children: [/* @__PURE__ */
|
|
1558
|
-
className:
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1560
|
-
}), /* @__PURE__ */
|
|
1616
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1617
|
+
className: K("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", zt[e.type] || "bg-gray-100 text-gray-600"),
|
|
1618
|
+
children: /* @__PURE__ */ Y(t, { className: "h-3.5 w-3.5" })
|
|
1619
|
+
}), /* @__PURE__ */ X("div", {
|
|
1561
1620
|
className: "flex-1 min-w-0 pt-1",
|
|
1562
|
-
children: [/* @__PURE__ */
|
|
1621
|
+
children: [/* @__PURE__ */ X("p", {
|
|
1563
1622
|
className: "text-sm",
|
|
1564
1623
|
children: [
|
|
1565
|
-
/* @__PURE__ */
|
|
1624
|
+
/* @__PURE__ */ Y("span", {
|
|
1566
1625
|
className: "font-medium",
|
|
1567
1626
|
children: e.user
|
|
1568
1627
|
}),
|
|
1569
1628
|
" ",
|
|
1570
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ Y("span", {
|
|
1571
1630
|
className: "text-muted-foreground",
|
|
1572
1631
|
children: Vt(e)
|
|
1573
1632
|
})
|
|
1574
1633
|
]
|
|
1575
|
-
}), /* @__PURE__ */
|
|
1634
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1576
1635
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
1577
1636
|
children: Bt(e.timestamp)
|
|
1578
1637
|
})]
|
|
@@ -1583,8 +1642,8 @@ var Ht = {
|
|
|
1583
1642
|
})] })]
|
|
1584
1643
|
});
|
|
1585
1644
|
}, Wt = 5, Gt = ({ schema: e, dataSource: t, className: i, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l }) => {
|
|
1586
|
-
let [u, d] =
|
|
1587
|
-
|
|
1645
|
+
let [u, d] = q.useState(e.data), [f, m] = q.useState(!e.data && !!(e.api && e.resourceId || t && e.objectName && e.resourceId)), [h, _] = q.useState(!1), [y, b] = q.useState(!1), [x, S] = q.useState({}), [C, T] = q.useState(null), { t: E } = $();
|
|
1646
|
+
q.useEffect(() => {
|
|
1588
1647
|
let n = !0;
|
|
1589
1648
|
if (e.data) {
|
|
1590
1649
|
d(e.data), m(!1);
|
|
@@ -1596,7 +1655,7 @@ var Ht = {
|
|
|
1596
1655
|
(t.getObjectSchema ? t.getObjectSchema(r).catch(() => null) : Promise.resolve(null)).then((e) => {
|
|
1597
1656
|
if (!n) return;
|
|
1598
1657
|
T(e);
|
|
1599
|
-
let s =
|
|
1658
|
+
let s = He(e?.fields, o), c = s.length > 0 ? { $expand: s } : void 0, l = c ? t.findOne(r, i, c) : t.findOne(r, i), u = () => {
|
|
1600
1659
|
let e = String(i), o = e.startsWith(a) ? e.slice(a.length) : `${a}${e}`;
|
|
1601
1660
|
return (c ? t.findOne(r, o, c) : t.findOne(r, o)).then((e) => {
|
|
1602
1661
|
n && (d(e), m(!1));
|
|
@@ -1634,18 +1693,18 @@ var Ht = {
|
|
|
1634
1693
|
e.sections,
|
|
1635
1694
|
e.fields
|
|
1636
1695
|
]);
|
|
1637
|
-
let D =
|
|
1696
|
+
let D = q.useCallback(() => {
|
|
1638
1697
|
if (s) s();
|
|
1639
1698
|
else if (e.onNavigate) {
|
|
1640
1699
|
let t = e.backUrl || (e.objectName ? `/${e.objectName}` : "/");
|
|
1641
1700
|
e.onNavigate(t, { replace: !0 });
|
|
1642
1701
|
} else e.backUrl ? window.location.href = e.backUrl : window.history.back();
|
|
1643
|
-
}, [s, e]), O =
|
|
1702
|
+
}, [s, e]), O = q.useCallback(() => {
|
|
1644
1703
|
a ? a() : e.onNavigate && e.editUrl ? e.onNavigate(e.editUrl) : e.onNavigate && e.objectName && e.resourceId ? e.onNavigate(`/${e.objectName}/${e.resourceId}/edit`) : e.editUrl && (window.location.href = e.editUrl);
|
|
1645
|
-
}, [a, e]), k =
|
|
1704
|
+
}, [a, e]), k = q.useCallback(() => {
|
|
1646
1705
|
let t = e.deleteConfirmation || E("detail.deleteConfirmation");
|
|
1647
1706
|
window.confirm(t) && (o?.(), e.onNavigate && e.objectName && e.onNavigate(`/${e.objectName}`, { replace: !0 }));
|
|
1648
|
-
}, [o, e]), j =
|
|
1707
|
+
}, [o, e]), j = q.useCallback(() => {
|
|
1649
1708
|
navigator.share && e.objectName && e.resourceId ? navigator.share({
|
|
1650
1709
|
title: e.title || E("detail.details"),
|
|
1651
1710
|
text: `${e.objectName} #${e.resourceId}`,
|
|
@@ -1653,15 +1712,15 @@ var Ht = {
|
|
|
1653
1712
|
}).catch((e) => console.log("Share failed:", e)) : navigator.clipboard.writeText(window.location.href).then(() => {
|
|
1654
1713
|
console.log("Link copied to clipboard");
|
|
1655
1714
|
});
|
|
1656
|
-
}, [e]),
|
|
1715
|
+
}, [e]), ee = q.useCallback(() => {
|
|
1657
1716
|
console.log("Duplicate record:", u);
|
|
1658
|
-
}, [u]),
|
|
1717
|
+
}, [u]), te = q.useCallback(() => {
|
|
1659
1718
|
console.log("Export record:", u);
|
|
1660
|
-
}, [u]),
|
|
1719
|
+
}, [u]), M = q.useCallback(() => {
|
|
1661
1720
|
console.log("View history for record:", e.resourceId);
|
|
1662
|
-
}, [e]), ne =
|
|
1721
|
+
}, [e]), ne = q.useCallback(() => {
|
|
1663
1722
|
_(!h);
|
|
1664
|
-
}, [h]),
|
|
1723
|
+
}, [h]), re = q.useCallback(() => {
|
|
1665
1724
|
if (y) {
|
|
1666
1725
|
let e = Object.entries(x);
|
|
1667
1726
|
if (e.length > 0) {
|
|
@@ -1681,13 +1740,13 @@ var Ht = {
|
|
|
1681
1740
|
x,
|
|
1682
1741
|
u,
|
|
1683
1742
|
l
|
|
1684
|
-
]),
|
|
1743
|
+
]), z = q.useCallback((e, t) => {
|
|
1685
1744
|
S((n) => ({
|
|
1686
1745
|
...n,
|
|
1687
1746
|
[e]: t
|
|
1688
1747
|
}));
|
|
1689
1748
|
}, []);
|
|
1690
|
-
|
|
1749
|
+
q.useEffect(() => {
|
|
1691
1750
|
if (!e.recordNavigation) return;
|
|
1692
1751
|
let t = e.recordNavigation, n = (e) => {
|
|
1693
1752
|
let n = e.target?.tagName;
|
|
@@ -1695,7 +1754,7 @@ var Ht = {
|
|
|
1695
1754
|
};
|
|
1696
1755
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
1697
1756
|
}, [e.recordNavigation]);
|
|
1698
|
-
let
|
|
1757
|
+
let ie = q.useMemo(() => {
|
|
1699
1758
|
if (!e.autoDiscoverRelated || !C?.fields || e.related && e.related.length > 0) return [];
|
|
1700
1759
|
let t = [], n = C.fields;
|
|
1701
1760
|
for (let [e, r] of Object.entries(n)) {
|
|
@@ -1712,107 +1771,107 @@ var Ht = {
|
|
|
1712
1771
|
e.autoDiscoverRelated,
|
|
1713
1772
|
e.related,
|
|
1714
1773
|
C
|
|
1715
|
-
]),
|
|
1774
|
+
]), B = q.useMemo(() => e.related && e.related.length > 0 ? e.related : ie.map((e) => ({
|
|
1716
1775
|
title: e.title,
|
|
1717
1776
|
type: e.type,
|
|
1718
1777
|
api: e.objectName,
|
|
1719
1778
|
data: []
|
|
1720
|
-
})), [e.related,
|
|
1721
|
-
return f || e.loading ? /* @__PURE__ */
|
|
1722
|
-
className:
|
|
1779
|
+
})), [e.related, ie]);
|
|
1780
|
+
return f || e.loading ? /* @__PURE__ */ X("div", {
|
|
1781
|
+
className: K("space-y-4", i),
|
|
1723
1782
|
children: [
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ Y(Ne, { className: "h-10 w-full" }),
|
|
1784
|
+
/* @__PURE__ */ Y(Ne, { className: "h-64 w-full" }),
|
|
1785
|
+
/* @__PURE__ */ Y(Ne, { className: "h-48 w-full" })
|
|
1727
1786
|
]
|
|
1728
|
-
}) : !u && !e.data ? /* @__PURE__ */
|
|
1729
|
-
className:
|
|
1787
|
+
}) : !u && !e.data ? /* @__PURE__ */ X("div", {
|
|
1788
|
+
className: K("flex flex-col items-center justify-center py-16 text-center", i),
|
|
1730
1789
|
children: [
|
|
1731
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ Y("p", {
|
|
1732
1791
|
className: "text-lg font-semibold",
|
|
1733
1792
|
children: E("detail.recordNotFound")
|
|
1734
1793
|
}),
|
|
1735
|
-
/* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ Y("p", {
|
|
1736
1795
|
className: "text-sm text-muted-foreground mt-1",
|
|
1737
1796
|
children: E("detail.recordNotFoundDescription")
|
|
1738
1797
|
}),
|
|
1739
|
-
(e.showBack ?? !0) && /* @__PURE__ */
|
|
1798
|
+
(e.showBack ?? !0) && /* @__PURE__ */ X(P, {
|
|
1740
1799
|
variant: "outline",
|
|
1741
1800
|
size: "sm",
|
|
1742
1801
|
onClick: D,
|
|
1743
1802
|
className: "mt-4 gap-2",
|
|
1744
|
-
children: [/* @__PURE__ */
|
|
1803
|
+
children: [/* @__PURE__ */ Y(Oe, { className: "h-4 w-4" }), E("detail.goBack")]
|
|
1745
1804
|
})
|
|
1746
1805
|
]
|
|
1747
|
-
}) : /* @__PURE__ */
|
|
1748
|
-
className:
|
|
1806
|
+
}) : /* @__PURE__ */ Y(V, { children: /* @__PURE__ */ X("div", {
|
|
1807
|
+
className: K("space-y-6", i),
|
|
1749
1808
|
children: [
|
|
1750
|
-
/* @__PURE__ */
|
|
1809
|
+
/* @__PURE__ */ X("div", {
|
|
1751
1810
|
className: "flex flex-col sm:flex-row items-start justify-between gap-3 sm:gap-4 pb-4 border-b",
|
|
1752
|
-
children: [/* @__PURE__ */
|
|
1811
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1753
1812
|
className: "flex items-start gap-2 sm:gap-3 flex-1 min-w-0",
|
|
1754
|
-
children: [(e.showBack ?? !0) && /* @__PURE__ */
|
|
1813
|
+
children: [(e.showBack ?? !0) && /* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1755
1814
|
asChild: !0,
|
|
1756
|
-
children: /* @__PURE__ */
|
|
1815
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1757
1816
|
variant: "ghost",
|
|
1758
1817
|
size: "icon",
|
|
1759
1818
|
onClick: D,
|
|
1760
1819
|
className: "shrink-0 mt-1",
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1820
|
+
children: /* @__PURE__ */ Y(Oe, { className: "h-4 w-4" })
|
|
1762
1821
|
})
|
|
1763
|
-
}), /* @__PURE__ */
|
|
1822
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.back") })] }), /* @__PURE__ */ X("div", {
|
|
1764
1823
|
className: "flex-1 min-w-0",
|
|
1765
|
-
children: [/* @__PURE__ */
|
|
1824
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1766
1825
|
className: "flex items-center gap-2 flex-wrap",
|
|
1767
1826
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1827
|
+
/* @__PURE__ */ Y("h1", {
|
|
1769
1828
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
1770
1829
|
children: e.primaryField && u?.[e.primaryField] || e.title || E("detail.details")
|
|
1771
1830
|
}),
|
|
1772
1831
|
e.summaryFields?.map((e) => {
|
|
1773
1832
|
let t = u?.[e];
|
|
1774
|
-
return t == null || t === "" ? null : /* @__PURE__ */
|
|
1833
|
+
return t == null || t === "" ? null : /* @__PURE__ */ Y(G, {
|
|
1775
1834
|
variant: "secondary",
|
|
1776
1835
|
className: "text-xs",
|
|
1777
1836
|
"aria-label": `${e}: ${t}`,
|
|
1778
1837
|
children: String(t)
|
|
1779
1838
|
}, e);
|
|
1780
1839
|
}),
|
|
1781
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1782
1841
|
asChild: !0,
|
|
1783
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1784
1843
|
variant: "ghost",
|
|
1785
1844
|
size: "icon",
|
|
1786
1845
|
className: "h-6 w-6 shrink-0",
|
|
1787
1846
|
onClick: ne,
|
|
1788
|
-
children: h ? /* @__PURE__ */
|
|
1847
|
+
children: h ? /* @__PURE__ */ Y(De, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }) : /* @__PURE__ */ Y(pe, { className: "h-4 w-4 text-muted-foreground" })
|
|
1789
1848
|
})
|
|
1790
|
-
}), /* @__PURE__ */
|
|
1849
|
+
}), /* @__PURE__ */ Y(H, { children: E(h ? "detail.removeFromFavorites" : "detail.addToFavorites") })] })
|
|
1791
1850
|
]
|
|
1792
|
-
}), e.objectName && /* @__PURE__ */
|
|
1851
|
+
}), e.objectName && /* @__PURE__ */ X("p", {
|
|
1793
1852
|
className: "text-sm text-muted-foreground mt-1 flex items-center gap-1.5",
|
|
1794
1853
|
children: [
|
|
1795
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ Y("span", {
|
|
1796
1855
|
className: "font-medium",
|
|
1797
1856
|
children: e.objectName
|
|
1798
1857
|
}),
|
|
1799
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ Y("span", {
|
|
1800
1859
|
className: "text-muted-foreground/60",
|
|
1801
1860
|
children: "•"
|
|
1802
1861
|
}),
|
|
1803
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ X("span", { children: ["#", e.resourceId] })
|
|
1804
1863
|
]
|
|
1805
1864
|
})]
|
|
1806
1865
|
})]
|
|
1807
|
-
}), /* @__PURE__ */
|
|
1866
|
+
}), /* @__PURE__ */ X("div", {
|
|
1808
1867
|
className: "flex flex-wrap items-center gap-1.5 shrink-0 w-full sm:w-auto",
|
|
1809
1868
|
children: [
|
|
1810
|
-
e.recordNavigation && /* @__PURE__ */
|
|
1869
|
+
e.recordNavigation && /* @__PURE__ */ X("div", {
|
|
1811
1870
|
className: "flex items-center gap-1 mr-2",
|
|
1812
1871
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1814
1873
|
asChild: !0,
|
|
1815
|
-
children: /* @__PURE__ */
|
|
1874
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1816
1875
|
variant: "outline",
|
|
1817
1876
|
size: "icon",
|
|
1818
1877
|
className: "h-8 w-8",
|
|
@@ -1821,19 +1880,19 @@ var Ht = {
|
|
|
1821
1880
|
let t = e.recordNavigation;
|
|
1822
1881
|
t.currentIndex > 0 && t.onNavigate(t.recordIds[t.currentIndex - 1]);
|
|
1823
1882
|
},
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1883
|
+
children: /* @__PURE__ */ Y(N, { className: "h-4 w-4" })
|
|
1825
1884
|
})
|
|
1826
|
-
}), /* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
1885
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.previousRecord") })] }),
|
|
1886
|
+
/* @__PURE__ */ Y("span", {
|
|
1828
1887
|
className: "text-xs text-muted-foreground whitespace-nowrap px-1",
|
|
1829
1888
|
children: E("detail.recordOf", {
|
|
1830
1889
|
current: e.recordNavigation.currentIndex + 1,
|
|
1831
1890
|
total: e.recordNavigation.recordIds.length
|
|
1832
1891
|
})
|
|
1833
1892
|
}),
|
|
1834
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1835
1894
|
asChild: !0,
|
|
1836
|
-
children: /* @__PURE__ */
|
|
1895
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1837
1896
|
variant: "outline",
|
|
1838
1897
|
size: "icon",
|
|
1839
1898
|
className: "h-8 w-8",
|
|
@@ -1842,145 +1901,145 @@ var Ht = {
|
|
|
1842
1901
|
let t = e.recordNavigation;
|
|
1843
1902
|
t.currentIndex < t.recordIds.length - 1 && t.onNavigate(t.recordIds[t.currentIndex + 1]);
|
|
1844
1903
|
},
|
|
1845
|
-
children: /* @__PURE__ */
|
|
1904
|
+
children: /* @__PURE__ */ Y(p, { className: "h-4 w-4" })
|
|
1846
1905
|
})
|
|
1847
|
-
}), /* @__PURE__ */
|
|
1906
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.nextRecord") })] })
|
|
1848
1907
|
]
|
|
1849
1908
|
}),
|
|
1850
|
-
e.actions?.map((e, t) => /* @__PURE__ */
|
|
1909
|
+
e.actions?.map((e, t) => /* @__PURE__ */ Y(Ce, {
|
|
1851
1910
|
schema: e,
|
|
1852
1911
|
data: u
|
|
1853
1912
|
}, t)),
|
|
1854
|
-
c && /* @__PURE__ */
|
|
1913
|
+
c && /* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1855
1914
|
asChild: !0,
|
|
1856
|
-
children: /* @__PURE__ */
|
|
1915
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1857
1916
|
variant: y ? "default" : "outline",
|
|
1858
1917
|
size: "sm",
|
|
1859
|
-
onClick:
|
|
1918
|
+
onClick: re,
|
|
1860
1919
|
className: "gap-2 hidden sm:inline-flex",
|
|
1861
|
-
children: y ? /* @__PURE__ */
|
|
1920
|
+
children: y ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(F, { className: "h-4 w-4" }), /* @__PURE__ */ Y("span", {
|
|
1862
1921
|
className: "hidden sm:inline",
|
|
1863
1922
|
children: E("detail.save")
|
|
1864
|
-
})] }) : /* @__PURE__ */
|
|
1923
|
+
})] }) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(R, { className: "h-4 w-4" }), /* @__PURE__ */ Y("span", {
|
|
1865
1924
|
className: "hidden sm:inline",
|
|
1866
1925
|
children: E("detail.editInline")
|
|
1867
1926
|
})] })
|
|
1868
1927
|
})
|
|
1869
|
-
}), /* @__PURE__ */
|
|
1870
|
-
/* @__PURE__ */
|
|
1928
|
+
}), /* @__PURE__ */ Y(H, { children: E(y ? "detail.saveChanges" : "detail.editFieldsInline") })] }),
|
|
1929
|
+
/* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1871
1930
|
asChild: !0,
|
|
1872
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1873
1932
|
variant: "outline",
|
|
1874
1933
|
size: "icon",
|
|
1875
1934
|
onClick: j,
|
|
1876
1935
|
className: "hidden sm:inline-flex",
|
|
1877
|
-
children: /* @__PURE__ */
|
|
1936
|
+
children: /* @__PURE__ */ Y(ve, { className: "h-4 w-4" })
|
|
1878
1937
|
})
|
|
1879
|
-
}), /* @__PURE__ */
|
|
1880
|
-
e.showEdit && /* @__PURE__ */
|
|
1938
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.share") })] }),
|
|
1939
|
+
e.showEdit && /* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1881
1940
|
asChild: !0,
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1941
|
+
children: /* @__PURE__ */ X(P, {
|
|
1883
1942
|
variant: "default",
|
|
1884
1943
|
onClick: O,
|
|
1885
1944
|
className: "gap-2 hidden sm:inline-flex",
|
|
1886
|
-
children: [/* @__PURE__ */
|
|
1945
|
+
children: [/* @__PURE__ */ Y(R, { className: "h-4 w-4" }), /* @__PURE__ */ Y("span", {
|
|
1887
1946
|
className: "hidden sm:inline",
|
|
1888
1947
|
children: E("detail.edit")
|
|
1889
1948
|
})]
|
|
1890
1949
|
})
|
|
1891
|
-
}), /* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1950
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.editRecord") })] }),
|
|
1951
|
+
/* @__PURE__ */ X(he, { children: [/* @__PURE__ */ X(W, { children: [/* @__PURE__ */ Y(I, {
|
|
1893
1952
|
asChild: !0,
|
|
1894
|
-
children: /* @__PURE__ */
|
|
1953
|
+
children: /* @__PURE__ */ Y(v, {
|
|
1895
1954
|
asChild: !0,
|
|
1896
|
-
children: /* @__PURE__ */
|
|
1955
|
+
children: /* @__PURE__ */ Y(P, {
|
|
1897
1956
|
variant: "ghost",
|
|
1898
1957
|
size: "icon",
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ Y(w, { className: "h-4 w-4" })
|
|
1900
1959
|
})
|
|
1901
1960
|
})
|
|
1902
|
-
}), /* @__PURE__ */
|
|
1961
|
+
}), /* @__PURE__ */ Y(H, { children: E("detail.moreActions") })] }), /* @__PURE__ */ X(n, {
|
|
1903
1962
|
align: "end",
|
|
1904
1963
|
className: "w-[calc(100vw-2rem)] sm:w-48 max-h-[60vh] overflow-y-auto",
|
|
1905
1964
|
children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ X(U, {
|
|
1907
1966
|
onClick: j,
|
|
1908
1967
|
className: "sm:hidden",
|
|
1909
|
-
children: [/* @__PURE__ */
|
|
1968
|
+
children: [/* @__PURE__ */ Y(ve, { className: "h-4 w-4 mr-2" }), E("detail.share")]
|
|
1910
1969
|
}),
|
|
1911
|
-
e.showEdit && /* @__PURE__ */
|
|
1970
|
+
e.showEdit && /* @__PURE__ */ X(U, {
|
|
1912
1971
|
onClick: O,
|
|
1913
1972
|
className: "sm:hidden",
|
|
1914
|
-
children: [/* @__PURE__ */
|
|
1973
|
+
children: [/* @__PURE__ */ Y(R, { className: "h-4 w-4 mr-2" }), E("detail.edit")]
|
|
1915
1974
|
}),
|
|
1916
|
-
c && /* @__PURE__ */
|
|
1917
|
-
onClick:
|
|
1975
|
+
c && /* @__PURE__ */ X(U, {
|
|
1976
|
+
onClick: re,
|
|
1918
1977
|
className: "sm:hidden",
|
|
1919
|
-
children: [/* @__PURE__ */
|
|
1978
|
+
children: [/* @__PURE__ */ Y(R, { className: "h-4 w-4 mr-2" }), E(y ? "detail.save" : "detail.editInline")]
|
|
1920
1979
|
}),
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
onClick: M,
|
|
1924
|
-
children: [/* @__PURE__ */ X(A, { className: "h-4 w-4 mr-2" }), E("detail.duplicate")]
|
|
1925
|
-
}),
|
|
1926
|
-
/* @__PURE__ */ Z(W, {
|
|
1980
|
+
/* @__PURE__ */ Y(g, { className: "sm:hidden" }),
|
|
1981
|
+
/* @__PURE__ */ X(U, {
|
|
1927
1982
|
onClick: ee,
|
|
1928
|
-
children: [/* @__PURE__ */
|
|
1983
|
+
children: [/* @__PURE__ */ Y(A, { className: "h-4 w-4 mr-2" }), E("detail.duplicate")]
|
|
1929
1984
|
}),
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
onClick:
|
|
1932
|
-
children: [/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ X(U, {
|
|
1986
|
+
onClick: te,
|
|
1987
|
+
children: [/* @__PURE__ */ Y(ze, { className: "h-4 w-4 mr-2" }), E("detail.export")]
|
|
1933
1988
|
}),
|
|
1934
|
-
|
|
1989
|
+
/* @__PURE__ */ X(U, {
|
|
1990
|
+
onClick: M,
|
|
1991
|
+
children: [/* @__PURE__ */ Y(r, { className: "h-4 w-4 mr-2" }), E("detail.viewHistory")]
|
|
1992
|
+
}),
|
|
1993
|
+
e.showDelete && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(g, {}), /* @__PURE__ */ X(U, {
|
|
1935
1994
|
onClick: k,
|
|
1936
1995
|
className: "text-destructive focus:text-destructive",
|
|
1937
|
-
children: [/* @__PURE__ */
|
|
1996
|
+
children: [/* @__PURE__ */ Y(je, { className: "h-4 w-4 mr-2" }), E("detail.delete")]
|
|
1938
1997
|
})] })
|
|
1939
1998
|
]
|
|
1940
1999
|
})] })
|
|
1941
2000
|
]
|
|
1942
2001
|
})]
|
|
1943
2002
|
}),
|
|
1944
|
-
e.header && /* @__PURE__ */
|
|
2003
|
+
e.header && /* @__PURE__ */ Y("div", { children: /* @__PURE__ */ Y(Ce, {
|
|
1945
2004
|
schema: e.header,
|
|
1946
2005
|
data: u
|
|
1947
2006
|
}) }),
|
|
1948
|
-
e.highlightFields && e.highlightFields.length > 0 && /* @__PURE__ */
|
|
2007
|
+
e.highlightFields && e.highlightFields.length > 0 && /* @__PURE__ */ Y(Ft, {
|
|
1949
2008
|
fields: e.highlightFields,
|
|
1950
2009
|
data: u,
|
|
1951
2010
|
objectName: e.objectName,
|
|
1952
2011
|
objectSchema: C
|
|
1953
2012
|
}),
|
|
1954
|
-
e.autoTabs && !e.tabs?.length ? /* @__PURE__ */
|
|
2013
|
+
e.autoTabs && !e.tabs?.length ? /* @__PURE__ */ X(ye, {
|
|
1955
2014
|
defaultValue: "details",
|
|
1956
2015
|
className: "w-full",
|
|
1957
2016
|
children: [
|
|
1958
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ X(de, {
|
|
1959
2018
|
className: "w-full justify-start border-b rounded-none bg-transparent p-0",
|
|
1960
2019
|
children: [
|
|
1961
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ Y(L, {
|
|
1962
2021
|
value: "details",
|
|
1963
2022
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
1964
2023
|
children: E("detail.details")
|
|
1965
2024
|
}),
|
|
1966
|
-
|
|
2025
|
+
B.length > 0 && /* @__PURE__ */ Y(L, {
|
|
1967
2026
|
value: "related",
|
|
1968
2027
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
1969
|
-
children: /* @__PURE__ */
|
|
2028
|
+
children: /* @__PURE__ */ X("span", {
|
|
1970
2029
|
className: "flex items-center gap-1.5",
|
|
1971
|
-
children: [E("detail.related"), /* @__PURE__ */
|
|
2030
|
+
children: [E("detail.related"), /* @__PURE__ */ Y(G, {
|
|
1972
2031
|
variant: "secondary",
|
|
1973
2032
|
className: "text-xs",
|
|
1974
|
-
children:
|
|
2033
|
+
children: B.length
|
|
1975
2034
|
})]
|
|
1976
2035
|
})
|
|
1977
2036
|
}),
|
|
1978
|
-
e.activities && e.activities.length > 0 && /* @__PURE__ */
|
|
2037
|
+
e.activities && e.activities.length > 0 && /* @__PURE__ */ Y(L, {
|
|
1979
2038
|
value: "activity",
|
|
1980
2039
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
1981
|
-
children: /* @__PURE__ */
|
|
2040
|
+
children: /* @__PURE__ */ X("span", {
|
|
1982
2041
|
className: "flex items-center gap-1.5",
|
|
1983
|
-
children: [E("detail.activity"), /* @__PURE__ */
|
|
2042
|
+
children: [E("detail.activity"), /* @__PURE__ */ Y(G, {
|
|
1984
2043
|
variant: "secondary",
|
|
1985
2044
|
className: "text-xs",
|
|
1986
2045
|
children: e.activities.length
|
|
@@ -1989,13 +2048,13 @@ var Ht = {
|
|
|
1989
2048
|
})
|
|
1990
2049
|
]
|
|
1991
2050
|
}),
|
|
1992
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ Y(Ee, {
|
|
1993
2052
|
value: "details",
|
|
1994
2053
|
className: "mt-4",
|
|
1995
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ X("div", {
|
|
1996
2055
|
className: "space-y-3 sm:space-y-4",
|
|
1997
2056
|
children: [
|
|
1998
|
-
e.sectionGroups && e.sectionGroups.length > 0 && e.sectionGroups.map((t, n) => /* @__PURE__ */
|
|
2057
|
+
e.sectionGroups && e.sectionGroups.length > 0 && e.sectionGroups.map((t, n) => /* @__PURE__ */ Y(Pt, {
|
|
1999
2058
|
group: t,
|
|
2000
2059
|
data: {
|
|
2001
2060
|
...u,
|
|
@@ -2004,9 +2063,9 @@ var Ht = {
|
|
|
2004
2063
|
objectSchema: C,
|
|
2005
2064
|
objectName: e.objectName,
|
|
2006
2065
|
isEditing: y,
|
|
2007
|
-
onFieldChange:
|
|
2066
|
+
onFieldChange: z
|
|
2008
2067
|
}, n)),
|
|
2009
|
-
e.sections && e.sections.length > 0 && e.sections.map((t, n) => /* @__PURE__ */
|
|
2068
|
+
e.sections && e.sections.length > 0 && e.sections.map((t, n) => /* @__PURE__ */ Y(jt, {
|
|
2010
2069
|
section: t,
|
|
2011
2070
|
data: {
|
|
2012
2071
|
...u,
|
|
@@ -2015,9 +2074,9 @@ var Ht = {
|
|
|
2015
2074
|
objectSchema: C,
|
|
2016
2075
|
objectName: e.objectName,
|
|
2017
2076
|
isEditing: y,
|
|
2018
|
-
onFieldChange:
|
|
2077
|
+
onFieldChange: z
|
|
2019
2078
|
}, n)),
|
|
2020
|
-
e.fields && e.fields.length > 0 && !e.sections?.length && /* @__PURE__ */
|
|
2079
|
+
e.fields && e.fields.length > 0 && !e.sections?.length && /* @__PURE__ */ Y(jt, {
|
|
2021
2080
|
section: {
|
|
2022
2081
|
fields: e.fields,
|
|
2023
2082
|
columns: e.columns
|
|
@@ -2029,21 +2088,21 @@ var Ht = {
|
|
|
2029
2088
|
objectSchema: C,
|
|
2030
2089
|
objectName: e.objectName,
|
|
2031
2090
|
isEditing: y,
|
|
2032
|
-
onFieldChange:
|
|
2091
|
+
onFieldChange: z
|
|
2033
2092
|
}),
|
|
2034
|
-
e.comments && /* @__PURE__ */
|
|
2093
|
+
e.comments && /* @__PURE__ */ Y(Lt, {
|
|
2035
2094
|
comments: e.comments,
|
|
2036
2095
|
onAddComment: e.onAddComment
|
|
2037
2096
|
})
|
|
2038
2097
|
]
|
|
2039
2098
|
})
|
|
2040
2099
|
}),
|
|
2041
|
-
|
|
2100
|
+
B.length > 0 && /* @__PURE__ */ Y(Ee, {
|
|
2042
2101
|
value: "related",
|
|
2043
2102
|
className: "mt-4",
|
|
2044
|
-
children: /* @__PURE__ */
|
|
2103
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2045
2104
|
className: "space-y-4",
|
|
2046
|
-
children:
|
|
2105
|
+
children: B.map((e, n) => /* @__PURE__ */ Y(Nt, {
|
|
2047
2106
|
title: e.title,
|
|
2048
2107
|
type: e.type,
|
|
2049
2108
|
api: e.api,
|
|
@@ -2056,16 +2115,16 @@ var Ht = {
|
|
|
2056
2115
|
}, n))
|
|
2057
2116
|
})
|
|
2058
2117
|
}),
|
|
2059
|
-
e.activities && e.activities.length > 0 && /* @__PURE__ */
|
|
2118
|
+
e.activities && e.activities.length > 0 && /* @__PURE__ */ Y(Ee, {
|
|
2060
2119
|
value: "activity",
|
|
2061
2120
|
className: "mt-4",
|
|
2062
|
-
children: /* @__PURE__ */
|
|
2121
|
+
children: /* @__PURE__ */ Y(Ut, { activities: e.activities })
|
|
2063
2122
|
})
|
|
2064
2123
|
]
|
|
2065
|
-
}) : /* @__PURE__ */
|
|
2066
|
-
e.sectionGroups && e.sectionGroups.length > 0 && /* @__PURE__ */
|
|
2124
|
+
}) : /* @__PURE__ */ X(J, { children: [
|
|
2125
|
+
e.sectionGroups && e.sectionGroups.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2067
2126
|
className: "space-y-3 sm:space-y-4",
|
|
2068
|
-
children: e.sectionGroups.map((t, n) => /* @__PURE__ */
|
|
2127
|
+
children: e.sectionGroups.map((t, n) => /* @__PURE__ */ Y(Pt, {
|
|
2069
2128
|
group: t,
|
|
2070
2129
|
data: {
|
|
2071
2130
|
...u,
|
|
@@ -2074,12 +2133,12 @@ var Ht = {
|
|
|
2074
2133
|
objectSchema: C,
|
|
2075
2134
|
objectName: e.objectName,
|
|
2076
2135
|
isEditing: y,
|
|
2077
|
-
onFieldChange:
|
|
2136
|
+
onFieldChange: z
|
|
2078
2137
|
}, n))
|
|
2079
2138
|
}),
|
|
2080
|
-
e.sections && e.sections.length > 0 && /* @__PURE__ */
|
|
2139
|
+
e.sections && e.sections.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2081
2140
|
className: "space-y-3 sm:space-y-4",
|
|
2082
|
-
children: e.sections.map((t, n) => /* @__PURE__ */
|
|
2141
|
+
children: e.sections.map((t, n) => /* @__PURE__ */ Y(jt, {
|
|
2083
2142
|
section: t,
|
|
2084
2143
|
data: {
|
|
2085
2144
|
...u,
|
|
@@ -2088,10 +2147,10 @@ var Ht = {
|
|
|
2088
2147
|
objectSchema: C,
|
|
2089
2148
|
objectName: e.objectName,
|
|
2090
2149
|
isEditing: y,
|
|
2091
|
-
onFieldChange:
|
|
2150
|
+
onFieldChange: z
|
|
2092
2151
|
}, n))
|
|
2093
2152
|
}),
|
|
2094
|
-
e.fields && e.fields.length > 0 && !e.sections?.length && /* @__PURE__ */
|
|
2153
|
+
e.fields && e.fields.length > 0 && !e.sections?.length && /* @__PURE__ */ Y(jt, {
|
|
2095
2154
|
section: {
|
|
2096
2155
|
fields: e.fields,
|
|
2097
2156
|
columns: e.columns
|
|
@@ -2103,18 +2162,18 @@ var Ht = {
|
|
|
2103
2162
|
objectSchema: C,
|
|
2104
2163
|
objectName: e.objectName,
|
|
2105
2164
|
isEditing: y,
|
|
2106
|
-
onFieldChange:
|
|
2165
|
+
onFieldChange: z
|
|
2107
2166
|
}),
|
|
2108
|
-
e.tabs && e.tabs.length > 0 && /* @__PURE__ */
|
|
2167
|
+
e.tabs && e.tabs.length > 0 && /* @__PURE__ */ Y(Mt, {
|
|
2109
2168
|
tabs: e.tabs,
|
|
2110
2169
|
data: u
|
|
2111
2170
|
}),
|
|
2112
|
-
|
|
2171
|
+
B.length > 0 && /* @__PURE__ */ X("div", {
|
|
2113
2172
|
className: "space-y-4",
|
|
2114
|
-
children: [/* @__PURE__ */
|
|
2173
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
2115
2174
|
className: "text-xl font-semibold",
|
|
2116
2175
|
children: E("detail.related")
|
|
2117
|
-
}),
|
|
2176
|
+
}), B.map((e, n) => /* @__PURE__ */ Y(Nt, {
|
|
2118
2177
|
title: e.title,
|
|
2119
2178
|
type: e.type,
|
|
2120
2179
|
api: e.api,
|
|
@@ -2126,24 +2185,24 @@ var Ht = {
|
|
|
2126
2185
|
pageSize: Wt
|
|
2127
2186
|
}, n))]
|
|
2128
2187
|
}),
|
|
2129
|
-
e.comments && /* @__PURE__ */
|
|
2188
|
+
e.comments && /* @__PURE__ */ Y(Lt, {
|
|
2130
2189
|
comments: e.comments,
|
|
2131
2190
|
onAddComment: e.onAddComment
|
|
2132
2191
|
}),
|
|
2133
|
-
e.activities && e.activities.length > 0 && /* @__PURE__ */
|
|
2192
|
+
e.activities && e.activities.length > 0 && /* @__PURE__ */ Y(Ut, { activities: e.activities })
|
|
2134
2193
|
] }),
|
|
2135
|
-
e.footer && /* @__PURE__ */
|
|
2194
|
+
e.footer && /* @__PURE__ */ Y("div", { children: /* @__PURE__ */ Y(Ce, {
|
|
2136
2195
|
schema: e.footer,
|
|
2137
2196
|
data: u
|
|
2138
2197
|
}) })
|
|
2139
2198
|
]
|
|
2140
2199
|
}) });
|
|
2141
2200
|
}, Kt = ({ objectName: t, relationshipField: n, fields: r, onCreateRecord: i, onLinkRecord: s, onSearch: l, existingRecords: u = [], className: d }) => {
|
|
2142
|
-
let [f, p] =
|
|
2201
|
+
let [f, p] = q.useState(!1), [h, g] = q.useState("create"), [_, v] = q.useState({}), [y, b] = q.useState(""), [x, S] = q.useState(u), [C, w] = q.useState(!1), [T, O] = q.useState(!1), k = q.useMemo(() => {
|
|
2143
2202
|
if (!y.trim()) return x;
|
|
2144
2203
|
let e = y.toLowerCase();
|
|
2145
2204
|
return x.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
2146
|
-
}, [y, x]), A =
|
|
2205
|
+
}, [y, x]), A = q.useCallback(async (e) => {
|
|
2147
2206
|
if (b(e), l && e.trim().length >= 2) {
|
|
2148
2207
|
O(!0);
|
|
2149
2208
|
try {
|
|
@@ -2152,12 +2211,12 @@ var Ht = {
|
|
|
2152
2211
|
O(!1);
|
|
2153
2212
|
}
|
|
2154
2213
|
}
|
|
2155
|
-
}, [l]),
|
|
2214
|
+
}, [l]), ee = q.useCallback((e, t) => {
|
|
2156
2215
|
v((n) => ({
|
|
2157
2216
|
...n,
|
|
2158
2217
|
[e]: t
|
|
2159
2218
|
}));
|
|
2160
|
-
}, []),
|
|
2219
|
+
}, []), te = q.useCallback(async () => {
|
|
2161
2220
|
if (i) {
|
|
2162
2221
|
w(!0);
|
|
2163
2222
|
try {
|
|
@@ -2173,7 +2232,7 @@ var Ht = {
|
|
|
2173
2232
|
i,
|
|
2174
2233
|
_,
|
|
2175
2234
|
n
|
|
2176
|
-
]),
|
|
2235
|
+
]), M = q.useCallback(async (e) => {
|
|
2177
2236
|
if (s) {
|
|
2178
2237
|
w(!0);
|
|
2179
2238
|
try {
|
|
@@ -2182,100 +2241,100 @@ var Ht = {
|
|
|
2182
2241
|
w(!1);
|
|
2183
2242
|
}
|
|
2184
2243
|
}
|
|
2185
|
-
}, [s]),
|
|
2186
|
-
return f ? /* @__PURE__ */
|
|
2187
|
-
className:
|
|
2188
|
-
children: [/* @__PURE__ */
|
|
2244
|
+
}, [s]), N = q.useMemo(() => r.filter((e) => e.required).every((e) => _[e.name]?.toString().trim()), [r, _]);
|
|
2245
|
+
return f ? /* @__PURE__ */ X(D, {
|
|
2246
|
+
className: K("", d),
|
|
2247
|
+
children: [/* @__PURE__ */ Y(c, {
|
|
2189
2248
|
className: "pb-3",
|
|
2190
|
-
children: /* @__PURE__ */
|
|
2249
|
+
children: /* @__PURE__ */ X(m, {
|
|
2191
2250
|
className: "flex items-center justify-between text-sm",
|
|
2192
|
-
children: [/* @__PURE__ */
|
|
2251
|
+
children: [/* @__PURE__ */ X("span", { children: [
|
|
2193
2252
|
h === "create" ? "Create" : "Link",
|
|
2194
2253
|
" ",
|
|
2195
2254
|
t
|
|
2196
|
-
] }), /* @__PURE__ */
|
|
2255
|
+
] }), /* @__PURE__ */ Y(P, {
|
|
2197
2256
|
variant: "ghost",
|
|
2198
2257
|
size: "icon",
|
|
2199
2258
|
className: "h-6 w-6",
|
|
2200
2259
|
onClick: () => p(!1),
|
|
2201
|
-
children: /* @__PURE__ */
|
|
2260
|
+
children: /* @__PURE__ */ Y(e, { className: "h-3.5 w-3.5" })
|
|
2202
2261
|
})]
|
|
2203
2262
|
})
|
|
2204
|
-
}), /* @__PURE__ */
|
|
2263
|
+
}), /* @__PURE__ */ Y(j, { children: /* @__PURE__ */ X(ye, {
|
|
2205
2264
|
value: h,
|
|
2206
2265
|
onValueChange: g,
|
|
2207
2266
|
children: [
|
|
2208
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ X(de, {
|
|
2209
2268
|
className: "mb-3 w-full",
|
|
2210
|
-
children: [i && /* @__PURE__ */
|
|
2269
|
+
children: [i && /* @__PURE__ */ X(L, {
|
|
2211
2270
|
value: "create",
|
|
2212
2271
|
className: "flex-1 gap-1.5",
|
|
2213
|
-
children: [/* @__PURE__ */
|
|
2214
|
-
}), s && /* @__PURE__ */
|
|
2272
|
+
children: [/* @__PURE__ */ Y(ue, { className: "h-3.5 w-3.5" }), "Create New"]
|
|
2273
|
+
}), s && /* @__PURE__ */ X(L, {
|
|
2215
2274
|
value: "link",
|
|
2216
2275
|
className: "flex-1 gap-1.5",
|
|
2217
|
-
children: [/* @__PURE__ */
|
|
2276
|
+
children: [/* @__PURE__ */ Y(o, { className: "h-3.5 w-3.5" }), "Link Existing"]
|
|
2218
2277
|
})]
|
|
2219
2278
|
}),
|
|
2220
|
-
i && /* @__PURE__ */
|
|
2279
|
+
i && /* @__PURE__ */ X(Ee, {
|
|
2221
2280
|
value: "create",
|
|
2222
2281
|
className: "space-y-3 mt-0",
|
|
2223
|
-
children: [r.map((e) => /* @__PURE__ */
|
|
2282
|
+
children: [r.map((e) => /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("label", {
|
|
2224
2283
|
className: "text-xs font-medium text-muted-foreground mb-1 block",
|
|
2225
|
-
children: [e.label, e.required && /* @__PURE__ */
|
|
2284
|
+
children: [e.label, e.required && /* @__PURE__ */ Y("span", {
|
|
2226
2285
|
className: "text-destructive ml-0.5",
|
|
2227
2286
|
children: "*"
|
|
2228
2287
|
})]
|
|
2229
|
-
}), /* @__PURE__ */
|
|
2288
|
+
}), /* @__PURE__ */ Y(a, {
|
|
2230
2289
|
type: e.type === "number" ? "number" : e.type === "date" ? "date" : "text",
|
|
2231
2290
|
placeholder: e.placeholder || `Enter ${e.label.toLowerCase()}`,
|
|
2232
2291
|
value: _[e.name] || "",
|
|
2233
|
-
onChange: (t) =>
|
|
2292
|
+
onChange: (t) => ee(e.name, t.target.value),
|
|
2234
2293
|
className: "h-8 text-sm"
|
|
2235
|
-
})] }, e.name)), /* @__PURE__ */
|
|
2294
|
+
})] }, e.name)), /* @__PURE__ */ X("div", {
|
|
2236
2295
|
className: "flex justify-end gap-2 pt-1",
|
|
2237
|
-
children: [/* @__PURE__ */
|
|
2296
|
+
children: [/* @__PURE__ */ Y(P, {
|
|
2238
2297
|
variant: "ghost",
|
|
2239
2298
|
size: "sm",
|
|
2240
2299
|
onClick: () => p(!1),
|
|
2241
2300
|
children: "Cancel"
|
|
2242
|
-
}), /* @__PURE__ */
|
|
2301
|
+
}), /* @__PURE__ */ X(P, {
|
|
2243
2302
|
size: "sm",
|
|
2244
|
-
onClick:
|
|
2245
|
-
disabled: !
|
|
2303
|
+
onClick: te,
|
|
2304
|
+
disabled: !N || C,
|
|
2246
2305
|
className: "gap-1.5",
|
|
2247
|
-
children: [C && /* @__PURE__ */
|
|
2306
|
+
children: [C && /* @__PURE__ */ Y(E, { className: "h-3.5 w-3.5 animate-spin" }), "Create"]
|
|
2248
2307
|
})]
|
|
2249
2308
|
})]
|
|
2250
2309
|
}),
|
|
2251
|
-
s && /* @__PURE__ */
|
|
2310
|
+
s && /* @__PURE__ */ X(Ee, {
|
|
2252
2311
|
value: "link",
|
|
2253
2312
|
className: "space-y-3 mt-0",
|
|
2254
|
-
children: [/* @__PURE__ */
|
|
2313
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2255
2314
|
className: "relative",
|
|
2256
|
-
children: [/* @__PURE__ */
|
|
2315
|
+
children: [/* @__PURE__ */ Y(ie, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ Y(a, {
|
|
2257
2316
|
placeholder: `Search ${t}…`,
|
|
2258
2317
|
value: y,
|
|
2259
2318
|
onChange: (e) => A(e.target.value),
|
|
2260
2319
|
className: "h-8 text-sm pl-8"
|
|
2261
2320
|
})]
|
|
2262
|
-
}), /* @__PURE__ */
|
|
2321
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2263
2322
|
className: "max-h-48 overflow-y-auto space-y-1",
|
|
2264
|
-
children: T ? /* @__PURE__ */
|
|
2323
|
+
children: T ? /* @__PURE__ */ X("div", {
|
|
2265
2324
|
className: "flex items-center justify-center py-4 text-sm text-muted-foreground",
|
|
2266
|
-
children: [/* @__PURE__ */
|
|
2267
|
-
}) : k.length === 0 ? /* @__PURE__ */
|
|
2325
|
+
children: [/* @__PURE__ */ Y(E, { className: "h-4 w-4 animate-spin mr-2" }), "Searching…"]
|
|
2326
|
+
}) : k.length === 0 ? /* @__PURE__ */ Y("p", {
|
|
2268
2327
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
2269
2328
|
children: y ? "No records found" : "Type to search records"
|
|
2270
|
-
}) : k.map((e) => /* @__PURE__ */
|
|
2329
|
+
}) : k.map((e) => /* @__PURE__ */ X("button", {
|
|
2271
2330
|
type: "button",
|
|
2272
2331
|
className: "w-full text-left px-3 py-2 rounded-md hover:bg-accent text-sm transition-colors",
|
|
2273
|
-
onClick: () =>
|
|
2332
|
+
onClick: () => M(e.id),
|
|
2274
2333
|
disabled: C,
|
|
2275
|
-
children: [/* @__PURE__ */
|
|
2334
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2276
2335
|
className: "font-medium",
|
|
2277
2336
|
children: e.label
|
|
2278
|
-
}), e.description && /* @__PURE__ */
|
|
2337
|
+
}), e.description && /* @__PURE__ */ Y("span", {
|
|
2279
2338
|
className: "block text-xs text-muted-foreground mt-0.5",
|
|
2280
2339
|
children: e.description
|
|
2281
2340
|
})]
|
|
@@ -2284,9 +2343,9 @@ var Ht = {
|
|
|
2284
2343
|
})
|
|
2285
2344
|
]
|
|
2286
2345
|
}) })]
|
|
2287
|
-
}) : /* @__PURE__ */
|
|
2288
|
-
className:
|
|
2289
|
-
children: [i && /* @__PURE__ */
|
|
2346
|
+
}) : /* @__PURE__ */ X("div", {
|
|
2347
|
+
className: K("flex gap-2", d),
|
|
2348
|
+
children: [i && /* @__PURE__ */ X(P, {
|
|
2290
2349
|
variant: "outline",
|
|
2291
2350
|
size: "sm",
|
|
2292
2351
|
onClick: () => {
|
|
@@ -2294,18 +2353,18 @@ var Ht = {
|
|
|
2294
2353
|
},
|
|
2295
2354
|
className: "gap-1.5",
|
|
2296
2355
|
children: [
|
|
2297
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ Y(ue, { className: "h-3.5 w-3.5" }),
|
|
2298
2357
|
"New ",
|
|
2299
2358
|
t
|
|
2300
2359
|
]
|
|
2301
|
-
}), s && /* @__PURE__ */
|
|
2360
|
+
}), s && /* @__PURE__ */ X(P, {
|
|
2302
2361
|
variant: "outline",
|
|
2303
2362
|
size: "sm",
|
|
2304
2363
|
onClick: () => {
|
|
2305
2364
|
g("link"), p(!0);
|
|
2306
2365
|
},
|
|
2307
2366
|
className: "gap-1.5",
|
|
2308
|
-
children: [/* @__PURE__ */
|
|
2367
|
+
children: [/* @__PURE__ */ Y(o, { className: "h-3.5 w-3.5" }), "Link Existing"]
|
|
2309
2368
|
})]
|
|
2310
2369
|
});
|
|
2311
2370
|
};
|
|
@@ -2315,13 +2374,13 @@ function qt(e) {
|
|
|
2315
2374
|
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/>");
|
|
2316
2375
|
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
2317
2376
|
}
|
|
2318
|
-
var Jt = ({ value: e, onChange: n, onSubmit: r, mentionSuggestions: i = [], placeholder: a
|
|
2319
|
-
let
|
|
2320
|
-
if (!
|
|
2321
|
-
let e =
|
|
2377
|
+
var Jt = ({ value: e, onChange: n, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: c = !1 }) => {
|
|
2378
|
+
let { t: l } = $(), [u, d] = q.useState(!1), [f, p] = q.useState(!1), [m, h] = q.useState(""), [g, _] = q.useState(0), v = q.useRef(null), y = q.useMemo(() => {
|
|
2379
|
+
if (!m) return i;
|
|
2380
|
+
let e = m.toLowerCase();
|
|
2322
2381
|
return i.filter((t) => t.label.toLowerCase().includes(e));
|
|
2323
|
-
}, [
|
|
2324
|
-
let i =
|
|
2382
|
+
}, [m, i]), S = q.useCallback((t, r = "") => {
|
|
2383
|
+
let i = v.current;
|
|
2325
2384
|
if (!i) return;
|
|
2326
2385
|
let a = i.selectionStart, o = i.selectionEnd, s = e.slice(a, o);
|
|
2327
2386
|
n(e.slice(0, a) + t + s + r + e.slice(o)), requestAnimationFrame(() => {
|
|
@@ -2329,150 +2388,150 @@ var Jt = ({ value: e, onChange: n, onSubmit: r, mentionSuggestions: i = [], plac
|
|
|
2329
2388
|
let e = a + t.length + s.length;
|
|
2330
2389
|
i.setSelectionRange(e, e);
|
|
2331
2390
|
});
|
|
2332
|
-
}, [e, n]),
|
|
2333
|
-
|
|
2334
|
-
}, [
|
|
2335
|
-
let r =
|
|
2391
|
+
}, [e, n]), C = q.useCallback(() => S("**", "**"), [S]), w = q.useCallback(() => S("*", "*"), [S]), T = q.useCallback(() => S("\n- ", ""), [S]), E = q.useCallback(() => S("`", "`"), [S]), D = q.useCallback(() => {
|
|
2392
|
+
S("@", ""), p(!0), h(""), _(0);
|
|
2393
|
+
}, [S]), k = q.useCallback((t) => {
|
|
2394
|
+
let r = v.current;
|
|
2336
2395
|
if (!r) return;
|
|
2337
2396
|
let i = r.selectionStart, a = e.slice(0, i).lastIndexOf("@");
|
|
2338
|
-
a !== -1 && n(e.slice(0, a) + `@${t.label} ` + e.slice(i)),
|
|
2339
|
-
}, [e, n]),
|
|
2397
|
+
a !== -1 && n(e.slice(0, a) + `@${t.label} ` + e.slice(i)), p(!1), h(""), requestAnimationFrame(() => r.focus());
|
|
2398
|
+
}, [e, n]), A = q.useCallback((e) => {
|
|
2340
2399
|
let t = e.target.value;
|
|
2341
2400
|
n(t);
|
|
2342
2401
|
let r = e.target.selectionStart, i = t.slice(0, r), a = i.lastIndexOf("@");
|
|
2343
2402
|
if (a !== -1) {
|
|
2344
2403
|
let e = i.slice(a + 1), t = a > 0 ? i[a - 1] : " ";
|
|
2345
2404
|
if (/\s/.test(t) && !/\s/.test(e)) {
|
|
2346
|
-
|
|
2405
|
+
p(!0), h(e), _(0);
|
|
2347
2406
|
return;
|
|
2348
2407
|
}
|
|
2349
2408
|
}
|
|
2350
|
-
|
|
2351
|
-
}, [n]),
|
|
2352
|
-
if (
|
|
2409
|
+
p(!1);
|
|
2410
|
+
}, [n]), j = q.useCallback((e) => {
|
|
2411
|
+
if (f && y.length > 0) {
|
|
2353
2412
|
if (e.key === "ArrowDown") {
|
|
2354
|
-
e.preventDefault(),
|
|
2413
|
+
e.preventDefault(), _((e) => e < y.length - 1 ? e + 1 : 0);
|
|
2355
2414
|
return;
|
|
2356
2415
|
}
|
|
2357
2416
|
if (e.key === "ArrowUp") {
|
|
2358
|
-
e.preventDefault(),
|
|
2417
|
+
e.preventDefault(), _((e) => e > 0 ? e - 1 : y.length - 1);
|
|
2359
2418
|
return;
|
|
2360
2419
|
}
|
|
2361
2420
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
2362
|
-
e.preventDefault(),
|
|
2421
|
+
e.preventDefault(), k(y[g]);
|
|
2363
2422
|
return;
|
|
2364
2423
|
}
|
|
2365
2424
|
if (e.key === "Escape") {
|
|
2366
|
-
|
|
2425
|
+
p(!1);
|
|
2367
2426
|
return;
|
|
2368
2427
|
}
|
|
2369
2428
|
}
|
|
2370
2429
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), r?.());
|
|
2371
2430
|
}, [
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2431
|
+
f,
|
|
2432
|
+
y,
|
|
2433
|
+
g,
|
|
2434
|
+
k,
|
|
2376
2435
|
r
|
|
2377
2436
|
]);
|
|
2378
|
-
return /* @__PURE__ */
|
|
2379
|
-
className:
|
|
2380
|
-
children: [/* @__PURE__ */
|
|
2437
|
+
return /* @__PURE__ */ X("div", {
|
|
2438
|
+
className: K("border rounded-md", o),
|
|
2439
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2381
2440
|
className: "flex items-center gap-0.5 px-2 py-1.5 border-b bg-muted/30",
|
|
2382
2441
|
children: [
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
variant: "ghost",
|
|
2385
|
-
size: "icon",
|
|
2386
|
-
className: "h-7 w-7",
|
|
2387
|
-
onClick: S,
|
|
2388
|
-
disabled: c || l,
|
|
2389
|
-
title: "Bold (Ctrl+B)",
|
|
2390
|
-
children: /* @__PURE__ */ X(t, { className: "h-3.5 w-3.5" })
|
|
2391
|
-
}),
|
|
2392
|
-
/* @__PURE__ */ X(P, {
|
|
2442
|
+
/* @__PURE__ */ Y(P, {
|
|
2393
2443
|
variant: "ghost",
|
|
2394
2444
|
size: "icon",
|
|
2395
2445
|
className: "h-7 w-7",
|
|
2396
2446
|
onClick: C,
|
|
2397
|
-
disabled: c ||
|
|
2398
|
-
title: "
|
|
2399
|
-
children: /* @__PURE__ */
|
|
2447
|
+
disabled: c || u,
|
|
2448
|
+
title: l("detail.bold"),
|
|
2449
|
+
children: /* @__PURE__ */ Y(t, { className: "h-3.5 w-3.5" })
|
|
2400
2450
|
}),
|
|
2401
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ Y(P, {
|
|
2402
2452
|
variant: "ghost",
|
|
2403
2453
|
size: "icon",
|
|
2404
2454
|
className: "h-7 w-7",
|
|
2405
2455
|
onClick: w,
|
|
2406
|
-
disabled: c ||
|
|
2407
|
-
title: "
|
|
2408
|
-
children: /* @__PURE__ */
|
|
2456
|
+
disabled: c || u,
|
|
2457
|
+
title: l("detail.italic"),
|
|
2458
|
+
children: /* @__PURE__ */ Y(b, { className: "h-3.5 w-3.5" })
|
|
2409
2459
|
}),
|
|
2410
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ Y(P, {
|
|
2411
2461
|
variant: "ghost",
|
|
2412
2462
|
size: "icon",
|
|
2413
2463
|
className: "h-7 w-7",
|
|
2414
2464
|
onClick: T,
|
|
2415
|
-
disabled: c ||
|
|
2416
|
-
title: "
|
|
2417
|
-
children: /* @__PURE__ */
|
|
2465
|
+
disabled: c || u,
|
|
2466
|
+
title: l("detail.listFormat"),
|
|
2467
|
+
children: /* @__PURE__ */ Y(s, { className: "h-3.5 w-3.5" })
|
|
2418
2468
|
}),
|
|
2419
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ Y(P, {
|
|
2420
2470
|
variant: "ghost",
|
|
2421
2471
|
size: "icon",
|
|
2422
2472
|
className: "h-7 w-7",
|
|
2423
2473
|
onClick: E,
|
|
2424
|
-
disabled: c ||
|
|
2425
|
-
title: "
|
|
2426
|
-
children: /* @__PURE__ */
|
|
2474
|
+
disabled: c || u,
|
|
2475
|
+
title: l("detail.inlineCode"),
|
|
2476
|
+
children: /* @__PURE__ */ Y(O, { className: "h-3.5 w-3.5" })
|
|
2427
2477
|
}),
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */ X(P, {
|
|
2478
|
+
/* @__PURE__ */ Y(P, {
|
|
2430
2479
|
variant: "ghost",
|
|
2431
2480
|
size: "icon",
|
|
2432
2481
|
className: "h-7 w-7",
|
|
2433
|
-
onClick:
|
|
2434
|
-
|
|
2435
|
-
|
|
2482
|
+
onClick: D,
|
|
2483
|
+
disabled: c || u,
|
|
2484
|
+
title: l("detail.mentionSomeone"),
|
|
2485
|
+
children: /* @__PURE__ */ Y(be, { className: "h-3.5 w-3.5" })
|
|
2436
2486
|
}),
|
|
2437
|
-
|
|
2487
|
+
/* @__PURE__ */ Y("div", { className: "flex-1" }),
|
|
2488
|
+
/* @__PURE__ */ Y(P, {
|
|
2489
|
+
variant: "ghost",
|
|
2490
|
+
size: "icon",
|
|
2491
|
+
className: "h-7 w-7",
|
|
2492
|
+
onClick: () => d(!u),
|
|
2493
|
+
title: l(u ? "detail.edit" : "detail.preview"),
|
|
2494
|
+
children: Y(u ? R : x, { className: "h-3.5 w-3.5" })
|
|
2495
|
+
}),
|
|
2496
|
+
r && /* @__PURE__ */ Y(P, {
|
|
2438
2497
|
variant: "ghost",
|
|
2439
2498
|
size: "icon",
|
|
2440
2499
|
className: "h-7 w-7",
|
|
2441
2500
|
onClick: r,
|
|
2442
2501
|
disabled: c || !e.trim(),
|
|
2443
|
-
title: "
|
|
2444
|
-
children: /* @__PURE__ */
|
|
2502
|
+
title: l("detail.submitComment"),
|
|
2503
|
+
children: /* @__PURE__ */ Y(Me, { className: "h-3.5 w-3.5" })
|
|
2445
2504
|
})
|
|
2446
2505
|
]
|
|
2447
|
-
}), /* @__PURE__ */
|
|
2506
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2448
2507
|
className: "relative",
|
|
2449
|
-
children:
|
|
2508
|
+
children: u ? /* @__PURE__ */ Y("div", {
|
|
2450
2509
|
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
2451
2510
|
dangerouslySetInnerHTML: { __html: qt(e) }
|
|
2452
|
-
}) : /* @__PURE__ */
|
|
2453
|
-
ref:
|
|
2511
|
+
}) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("textarea", {
|
|
2512
|
+
ref: v,
|
|
2454
2513
|
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
2455
|
-
placeholder: a,
|
|
2514
|
+
placeholder: a ?? l("detail.writeComment"),
|
|
2456
2515
|
value: e,
|
|
2457
|
-
onChange:
|
|
2458
|
-
onKeyDown:
|
|
2516
|
+
onChange: A,
|
|
2517
|
+
onKeyDown: j,
|
|
2459
2518
|
disabled: c
|
|
2460
|
-
}),
|
|
2519
|
+
}), f && y.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2461
2520
|
className: "absolute left-2 bottom-full mb-1 w-56 bg-popover border rounded-md shadow-md z-50 max-h-40 overflow-y-auto",
|
|
2462
|
-
children:
|
|
2521
|
+
children: y.map((e, t) => /* @__PURE__ */ X("button", {
|
|
2463
2522
|
type: "button",
|
|
2464
|
-
className:
|
|
2523
|
+
className: K("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === g && "bg-accent"),
|
|
2465
2524
|
onMouseDown: (t) => {
|
|
2466
|
-
t.preventDefault(),
|
|
2525
|
+
t.preventDefault(), k(e);
|
|
2467
2526
|
},
|
|
2468
|
-
children: [e.avatarUrl ? /* @__PURE__ */
|
|
2527
|
+
children: [e.avatarUrl ? /* @__PURE__ */ Y("img", {
|
|
2469
2528
|
src: e.avatarUrl,
|
|
2470
2529
|
alt: e.label,
|
|
2471
2530
|
className: "h-5 w-5 rounded-full object-cover"
|
|
2472
|
-
}) : /* @__PURE__ */
|
|
2531
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
2473
2532
|
className: "h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium",
|
|
2474
2533
|
children: e.label.charAt(0).toUpperCase()
|
|
2475
|
-
}), /* @__PURE__ */
|
|
2534
|
+
}), /* @__PURE__ */ Y("span", { children: e.label })]
|
|
2476
2535
|
}, e.id))
|
|
2477
2536
|
})] })
|
|
2478
2537
|
})]
|
|
@@ -2525,17 +2584,17 @@ var Zt = {
|
|
|
2525
2584
|
removed: "-",
|
|
2526
2585
|
unchanged: " "
|
|
2527
2586
|
}, $t = ({ oldValue: e, newValue: t, fieldName: n, fieldType: r = "string", mode: i = "unified", className: a }) => {
|
|
2528
|
-
let
|
|
2529
|
-
if (
|
|
2587
|
+
let { t: o } = $(), [s, l] = q.useState(i), d = q.useMemo(() => Yt(e, r), [e, r]), f = q.useMemo(() => Yt(t, r), [t, r]), p = q.useMemo(() => Xt(d, f), [d, f]), h = p.some((e) => e.type !== "unchanged"), g = q.useMemo(() => {
|
|
2588
|
+
if (s !== "side-by-side") return [];
|
|
2530
2589
|
let e = [], t = 0;
|
|
2531
|
-
for (; t <
|
|
2532
|
-
let n =
|
|
2590
|
+
for (; t < p.length;) {
|
|
2591
|
+
let n = p[t];
|
|
2533
2592
|
if (n.type === "unchanged") e.push({
|
|
2534
2593
|
left: n,
|
|
2535
2594
|
right: n
|
|
2536
2595
|
}), t++;
|
|
2537
2596
|
else if (n.type === "removed") {
|
|
2538
|
-
let r = t + 1 <
|
|
2597
|
+
let r = t + 1 < p.length ? p[t + 1] : null;
|
|
2539
2598
|
r && r.type === "added" ? (e.push({
|
|
2540
2599
|
left: n,
|
|
2541
2600
|
right: r
|
|
@@ -2549,127 +2608,127 @@ var Zt = {
|
|
|
2549
2608
|
}), t++;
|
|
2550
2609
|
}
|
|
2551
2610
|
return e;
|
|
2552
|
-
}, [
|
|
2553
|
-
return /* @__PURE__ */
|
|
2554
|
-
className:
|
|
2555
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
}, [s, p]);
|
|
2612
|
+
return /* @__PURE__ */ X(D, {
|
|
2613
|
+
className: K("overflow-hidden", a),
|
|
2614
|
+
children: [/* @__PURE__ */ Y(c, {
|
|
2556
2615
|
className: "pb-2",
|
|
2557
|
-
children: /* @__PURE__ */
|
|
2616
|
+
children: /* @__PURE__ */ X(m, {
|
|
2558
2617
|
className: "flex items-center justify-between text-sm",
|
|
2559
|
-
children: [/* @__PURE__ */
|
|
2618
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2560
2619
|
className: "font-medium",
|
|
2561
2620
|
children: n
|
|
2562
|
-
}), /* @__PURE__ */
|
|
2621
|
+
}), /* @__PURE__ */ X("div", {
|
|
2563
2622
|
className: "flex items-center gap-1",
|
|
2564
|
-
children: [/* @__PURE__ */
|
|
2565
|
-
variant:
|
|
2623
|
+
children: [/* @__PURE__ */ Y(P, {
|
|
2624
|
+
variant: s === "unified" ? "secondary" : "ghost",
|
|
2566
2625
|
size: "icon",
|
|
2567
2626
|
className: "h-7 w-7",
|
|
2568
|
-
onClick: () =>
|
|
2569
|
-
title: "
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2571
|
-
}), /* @__PURE__ */
|
|
2572
|
-
variant:
|
|
2627
|
+
onClick: () => l("unified"),
|
|
2628
|
+
title: o("detail.unifiedDiff"),
|
|
2629
|
+
children: /* @__PURE__ */ Y(se, { className: "h-3.5 w-3.5" })
|
|
2630
|
+
}), /* @__PURE__ */ Y(P, {
|
|
2631
|
+
variant: s === "side-by-side" ? "secondary" : "ghost",
|
|
2573
2632
|
size: "icon",
|
|
2574
2633
|
className: "h-7 w-7",
|
|
2575
|
-
onClick: () =>
|
|
2576
|
-
title: "
|
|
2577
|
-
children: /* @__PURE__ */
|
|
2634
|
+
onClick: () => l("side-by-side"),
|
|
2635
|
+
title: o("detail.sideBySideDiff"),
|
|
2636
|
+
children: /* @__PURE__ */ Y(u, { className: "h-3.5 w-3.5" })
|
|
2578
2637
|
})]
|
|
2579
2638
|
})]
|
|
2580
2639
|
})
|
|
2581
|
-
}), /* @__PURE__ */
|
|
2640
|
+
}), /* @__PURE__ */ Y(j, {
|
|
2582
2641
|
className: "p-0",
|
|
2583
|
-
children:
|
|
2642
|
+
children: h ? s === "unified" ? /* @__PURE__ */ Y("div", {
|
|
2584
2643
|
className: "font-mono text-xs overflow-x-auto",
|
|
2585
|
-
children:
|
|
2586
|
-
className:
|
|
2587
|
-
children: [/* @__PURE__ */
|
|
2644
|
+
children: p.map((e, t) => /* @__PURE__ */ X("div", {
|
|
2645
|
+
className: K("px-4 py-0.5 whitespace-pre-wrap border-l-2", Zt[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
|
|
2646
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2588
2647
|
className: "select-none mr-2 inline-block w-3 text-center opacity-60",
|
|
2589
2648
|
children: Qt[e.type]
|
|
2590
2649
|
}), e.value]
|
|
2591
2650
|
}, t))
|
|
2592
|
-
}) : /* @__PURE__ */
|
|
2651
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
2593
2652
|
className: "overflow-x-auto",
|
|
2594
|
-
children: /* @__PURE__ */
|
|
2653
|
+
children: /* @__PURE__ */ X("div", {
|
|
2595
2654
|
className: "grid grid-cols-2 divide-x font-mono text-xs min-w-0",
|
|
2596
2655
|
children: [
|
|
2597
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ Y("div", {
|
|
2598
2657
|
className: "px-3 py-1.5 text-xs font-medium text-muted-foreground bg-muted/50",
|
|
2599
|
-
children: "
|
|
2658
|
+
children: o("detail.previousVersion")
|
|
2600
2659
|
}),
|
|
2601
|
-
/* @__PURE__ */
|
|
2660
|
+
/* @__PURE__ */ Y("div", {
|
|
2602
2661
|
className: "px-3 py-1.5 text-xs font-medium text-muted-foreground bg-muted/50",
|
|
2603
|
-
children: "
|
|
2662
|
+
children: o("detail.currentVersion")
|
|
2604
2663
|
}),
|
|
2605
|
-
|
|
2606
|
-
className:
|
|
2664
|
+
g.map((e, t) => /* @__PURE__ */ X(q.Fragment, { children: [/* @__PURE__ */ Y("div", {
|
|
2665
|
+
className: K("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? Zt[e.left.type] : "bg-muted/20"),
|
|
2607
2666
|
children: e.left?.value ?? ""
|
|
2608
|
-
}), /* @__PURE__ */
|
|
2609
|
-
className:
|
|
2667
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2668
|
+
className: K("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? Zt[e.right.type] : "bg-muted/20"),
|
|
2610
2669
|
children: e.right?.value ?? ""
|
|
2611
2670
|
})] }, t))
|
|
2612
2671
|
]
|
|
2613
2672
|
})
|
|
2614
|
-
}) : /* @__PURE__ */
|
|
2673
|
+
}) : /* @__PURE__ */ Y("p", {
|
|
2615
2674
|
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
2616
|
-
children: "
|
|
2675
|
+
children: o("detail.noChanges")
|
|
2617
2676
|
})
|
|
2618
2677
|
})]
|
|
2619
2678
|
});
|
|
2620
2679
|
}, en = ({ currentIndex: e, totalRecords: t, recordIds: n, onNavigate: r, onSearch: i, className: o }) => {
|
|
2621
|
-
let
|
|
2622
|
-
|
|
2680
|
+
let { t: s } = $(), [c, l] = q.useState(""), [u, d] = q.useState(!1), f = q.useRef(null), m = e > 0, g = e > 0, _ = e < t - 1, v = e < t - 1, y = q.useCallback(() => {
|
|
2681
|
+
m && r(n[0]);
|
|
2623
2682
|
}, [
|
|
2624
|
-
|
|
2683
|
+
m,
|
|
2625
2684
|
r,
|
|
2626
2685
|
n
|
|
2627
|
-
]),
|
|
2628
|
-
|
|
2686
|
+
]), b = q.useCallback(() => {
|
|
2687
|
+
g && r(n[e - 1]);
|
|
2629
2688
|
}, [
|
|
2630
|
-
|
|
2689
|
+
g,
|
|
2631
2690
|
r,
|
|
2632
2691
|
n,
|
|
2633
2692
|
e
|
|
2634
|
-
]),
|
|
2635
|
-
|
|
2693
|
+
]), x = q.useCallback(() => {
|
|
2694
|
+
_ && r(n[e + 1]);
|
|
2636
2695
|
}, [
|
|
2637
|
-
|
|
2696
|
+
_,
|
|
2638
2697
|
r,
|
|
2639
2698
|
n,
|
|
2640
2699
|
e
|
|
2641
|
-
]),
|
|
2642
|
-
|
|
2700
|
+
]), S = q.useCallback(() => {
|
|
2701
|
+
v && r(n[n.length - 1]);
|
|
2643
2702
|
}, [
|
|
2644
|
-
|
|
2703
|
+
v,
|
|
2645
2704
|
r,
|
|
2646
2705
|
n
|
|
2647
|
-
]),
|
|
2706
|
+
]), C = q.useCallback((e) => {
|
|
2648
2707
|
let t = e.target.value;
|
|
2649
|
-
|
|
2650
|
-
}, [i]),
|
|
2651
|
-
|
|
2708
|
+
l(t), i?.(t);
|
|
2709
|
+
}, [i]), w = q.useCallback(() => {
|
|
2710
|
+
d((e) => (e ? (l(""), i?.("")) : requestAnimationFrame(() => f.current?.focus()), !e));
|
|
2652
2711
|
}, [i]);
|
|
2653
|
-
return
|
|
2712
|
+
return q.useEffect(() => {
|
|
2654
2713
|
let t = (t) => {
|
|
2655
2714
|
let a = t.target?.tagName;
|
|
2656
|
-
if (!((a === "INPUT" || a === "TEXTAREA" || t.target?.isContentEditable) && t.target !==
|
|
2657
|
-
if (t.target ===
|
|
2658
|
-
t.key === "Escape" && (t.preventDefault(),
|
|
2715
|
+
if (!((a === "INPUT" || a === "TEXTAREA" || t.target?.isContentEditable) && t.target !== f.current)) {
|
|
2716
|
+
if (t.target === f.current) {
|
|
2717
|
+
t.key === "Escape" && (t.preventDefault(), d(!1), l(""), i?.(""), t.target.blur());
|
|
2659
2718
|
return;
|
|
2660
2719
|
}
|
|
2661
2720
|
switch (t.key) {
|
|
2662
2721
|
case "Home":
|
|
2663
|
-
t.preventDefault(),
|
|
2722
|
+
t.preventDefault(), m && r(n[0]);
|
|
2664
2723
|
break;
|
|
2665
2724
|
case "End":
|
|
2666
|
-
t.preventDefault(),
|
|
2725
|
+
t.preventDefault(), v && r(n[n.length - 1]);
|
|
2667
2726
|
break;
|
|
2668
2727
|
case "ArrowLeft":
|
|
2669
|
-
t.preventDefault(),
|
|
2728
|
+
t.preventDefault(), g && r(n[e - 1]);
|
|
2670
2729
|
break;
|
|
2671
2730
|
case "ArrowRight":
|
|
2672
|
-
t.preventDefault(),
|
|
2731
|
+
t.preventDefault(), _ && r(n[e + 1]);
|
|
2673
2732
|
break;
|
|
2674
2733
|
}
|
|
2675
2734
|
}
|
|
@@ -2678,70 +2737,73 @@ var Zt = {
|
|
|
2678
2737
|
}, [
|
|
2679
2738
|
e,
|
|
2680
2739
|
n,
|
|
2681
|
-
f,
|
|
2682
2740
|
m,
|
|
2683
2741
|
g,
|
|
2684
2742
|
_,
|
|
2743
|
+
v,
|
|
2685
2744
|
r,
|
|
2686
2745
|
i
|
|
2687
|
-
]), /* @__PURE__ */
|
|
2688
|
-
className:
|
|
2746
|
+
]), /* @__PURE__ */ X("div", {
|
|
2747
|
+
className: K("flex items-center gap-1.5", o),
|
|
2689
2748
|
children: [
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
variant: "outline",
|
|
2692
|
-
size: "icon",
|
|
2693
|
-
className: "h-8 w-8",
|
|
2694
|
-
disabled: !f,
|
|
2695
|
-
onClick: v,
|
|
2696
|
-
title: "First record (Home)",
|
|
2697
|
-
children: /* @__PURE__ */ X(we, { className: "h-4 w-4" })
|
|
2698
|
-
}),
|
|
2699
|
-
/* @__PURE__ */ X(P, {
|
|
2749
|
+
/* @__PURE__ */ Y(P, {
|
|
2700
2750
|
variant: "outline",
|
|
2701
2751
|
size: "icon",
|
|
2702
2752
|
className: "h-8 w-8",
|
|
2703
2753
|
disabled: !m,
|
|
2704
2754
|
onClick: y,
|
|
2705
|
-
title: "
|
|
2706
|
-
children: /* @__PURE__ */
|
|
2755
|
+
title: s("detail.firstRecord"),
|
|
2756
|
+
children: /* @__PURE__ */ Y(Te, { className: "h-4 w-4" })
|
|
2707
2757
|
}),
|
|
2708
|
-
/* @__PURE__ */
|
|
2709
|
-
className: "text-xs text-muted-foreground whitespace-nowrap px-1.5 tabular-nums",
|
|
2710
|
-
children: t > 0 ? `${e + 1} of ${t}` : "No records"
|
|
2711
|
-
}),
|
|
2712
|
-
/* @__PURE__ */ X(P, {
|
|
2758
|
+
/* @__PURE__ */ Y(P, {
|
|
2713
2759
|
variant: "outline",
|
|
2714
2760
|
size: "icon",
|
|
2715
2761
|
className: "h-8 w-8",
|
|
2716
2762
|
disabled: !g,
|
|
2717
2763
|
onClick: b,
|
|
2718
|
-
title: "
|
|
2719
|
-
children: /* @__PURE__ */
|
|
2764
|
+
title: s("detail.previousRecordKey"),
|
|
2765
|
+
children: /* @__PURE__ */ Y(N, { className: "h-4 w-4" })
|
|
2720
2766
|
}),
|
|
2721
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ Y("span", {
|
|
2768
|
+
className: "text-xs text-muted-foreground whitespace-nowrap px-1.5 tabular-nums",
|
|
2769
|
+
children: t > 0 ? s("detail.recordOf", {
|
|
2770
|
+
current: e + 1,
|
|
2771
|
+
total: t
|
|
2772
|
+
}) : s("detail.noRecords")
|
|
2773
|
+
}),
|
|
2774
|
+
/* @__PURE__ */ Y(P, {
|
|
2722
2775
|
variant: "outline",
|
|
2723
2776
|
size: "icon",
|
|
2724
2777
|
className: "h-8 w-8",
|
|
2725
2778
|
disabled: !_,
|
|
2726
2779
|
onClick: x,
|
|
2727
|
-
title: "
|
|
2728
|
-
children: /* @__PURE__ */
|
|
2780
|
+
title: s("detail.nextRecordKey"),
|
|
2781
|
+
children: /* @__PURE__ */ Y(p, { className: "h-4 w-4" })
|
|
2782
|
+
}),
|
|
2783
|
+
/* @__PURE__ */ Y(P, {
|
|
2784
|
+
variant: "outline",
|
|
2785
|
+
size: "icon",
|
|
2786
|
+
className: "h-8 w-8",
|
|
2787
|
+
disabled: !v,
|
|
2788
|
+
onClick: S,
|
|
2789
|
+
title: s("detail.lastRecord"),
|
|
2790
|
+
children: /* @__PURE__ */ Y(h, { className: "h-4 w-4" })
|
|
2729
2791
|
}),
|
|
2730
|
-
i && /* @__PURE__ */
|
|
2731
|
-
variant:
|
|
2792
|
+
i && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(P, {
|
|
2793
|
+
variant: u ? "secondary" : "ghost",
|
|
2732
2794
|
size: "icon",
|
|
2733
2795
|
className: "h-8 w-8",
|
|
2734
|
-
onClick:
|
|
2735
|
-
title: "
|
|
2736
|
-
children: /* @__PURE__ */
|
|
2737
|
-
}),
|
|
2796
|
+
onClick: w,
|
|
2797
|
+
title: s("detail.searchWhileNavigating"),
|
|
2798
|
+
children: /* @__PURE__ */ Y(ie, { className: "h-4 w-4" })
|
|
2799
|
+
}), u && /* @__PURE__ */ Y("div", {
|
|
2738
2800
|
className: "relative",
|
|
2739
|
-
children: /* @__PURE__ */
|
|
2740
|
-
ref:
|
|
2801
|
+
children: /* @__PURE__ */ Y(a, {
|
|
2802
|
+
ref: f,
|
|
2741
2803
|
type: "text",
|
|
2742
|
-
placeholder: "
|
|
2743
|
-
value:
|
|
2744
|
-
onChange:
|
|
2804
|
+
placeholder: s("detail.searchRecords"),
|
|
2805
|
+
value: c,
|
|
2806
|
+
onChange: C,
|
|
2745
2807
|
className: "h-8 w-48 text-sm"
|
|
2746
2808
|
})
|
|
2747
2809
|
})] })
|
|
@@ -2826,11 +2888,11 @@ function on(e, t = 6) {
|
|
|
2826
2888
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2827
2889
|
}
|
|
2828
2890
|
var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, className: i }) => {
|
|
2829
|
-
let a =
|
|
2891
|
+
let a = q.useRef(null), [o, s] = q.useState({
|
|
2830
2892
|
width: 500,
|
|
2831
2893
|
height: 400
|
|
2832
|
-
}), [l, u] =
|
|
2833
|
-
|
|
2894
|
+
}), [l, u] = q.useState(null);
|
|
2895
|
+
q.useEffect(() => {
|
|
2834
2896
|
let e = a.current;
|
|
2835
2897
|
if (!e) return;
|
|
2836
2898
|
let t = e.parentElement;
|
|
@@ -2846,22 +2908,22 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
2846
2908
|
});
|
|
2847
2909
|
return n.observe(t), () => n.disconnect();
|
|
2848
2910
|
}, []);
|
|
2849
|
-
let { nodes: d, edges: f } =
|
|
2911
|
+
let { nodes: d, edges: f } = q.useMemo(() => an(e, t, n, o.width, o.height), [
|
|
2850
2912
|
e,
|
|
2851
2913
|
t,
|
|
2852
2914
|
n,
|
|
2853
2915
|
o
|
|
2854
2916
|
]);
|
|
2855
|
-
return /* @__PURE__ */
|
|
2856
|
-
className:
|
|
2857
|
-
children: [/* @__PURE__ */
|
|
2917
|
+
return /* @__PURE__ */ X(D, {
|
|
2918
|
+
className: K("overflow-hidden", i),
|
|
2919
|
+
children: [/* @__PURE__ */ Y(c, {
|
|
2858
2920
|
className: "pb-2",
|
|
2859
|
-
children: /* @__PURE__ */
|
|
2921
|
+
children: /* @__PURE__ */ X(m, {
|
|
2860
2922
|
className: "flex items-center gap-2 text-base",
|
|
2861
2923
|
children: [
|
|
2862
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ Y(Ie, { className: "h-4 w-4" }),
|
|
2863
2925
|
"Relationships",
|
|
2864
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ X("span", {
|
|
2865
2927
|
className: "text-sm font-normal text-muted-foreground",
|
|
2866
2928
|
children: [
|
|
2867
2929
|
"(",
|
|
@@ -2871,15 +2933,15 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
2871
2933
|
})
|
|
2872
2934
|
]
|
|
2873
2935
|
})
|
|
2874
|
-
}), /* @__PURE__ */
|
|
2936
|
+
}), /* @__PURE__ */ Y(j, {
|
|
2875
2937
|
className: "p-0",
|
|
2876
|
-
children: /* @__PURE__ */
|
|
2938
|
+
children: /* @__PURE__ */ X("svg", {
|
|
2877
2939
|
ref: a,
|
|
2878
2940
|
width: "100%",
|
|
2879
2941
|
height: o.height,
|
|
2880
2942
|
viewBox: `0 0 ${o.width} ${o.height}`,
|
|
2881
2943
|
className: "select-none",
|
|
2882
|
-
children: [f.map((e, t) => /* @__PURE__ */
|
|
2944
|
+
children: [f.map((e, t) => /* @__PURE__ */ Y("line", {
|
|
2883
2945
|
x1: e.fromX,
|
|
2884
2946
|
y1: e.fromY,
|
|
2885
2947
|
x2: e.toX,
|
|
@@ -2889,13 +2951,13 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
2889
2951
|
strokeOpacity: .5
|
|
2890
2952
|
}, `edge-${t}`)), d.map((e) => {
|
|
2891
2953
|
let t = l === e.id, n = nn[Math.min(e.level, nn.length - 1)], i = rn[Math.min(e.level, rn.length - 1)], a = e.level === 0 ? tn + 6 : tn;
|
|
2892
|
-
return /* @__PURE__ */
|
|
2893
|
-
className:
|
|
2954
|
+
return /* @__PURE__ */ X("g", {
|
|
2955
|
+
className: K("cursor-pointer transition-transform", r && "hover:opacity-80"),
|
|
2894
2956
|
onClick: () => r?.(e.id),
|
|
2895
2957
|
onMouseEnter: () => u(e.id),
|
|
2896
2958
|
onMouseLeave: () => u(null),
|
|
2897
2959
|
children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2960
|
+
/* @__PURE__ */ Y("circle", {
|
|
2899
2961
|
cx: e.x,
|
|
2900
2962
|
cy: e.y,
|
|
2901
2963
|
r: t ? a + 3 : a,
|
|
@@ -2904,22 +2966,22 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
2904
2966
|
strokeWidth: 2,
|
|
2905
2967
|
strokeOpacity: .3
|
|
2906
2968
|
}),
|
|
2907
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ Y("text", {
|
|
2908
2970
|
x: e.x,
|
|
2909
2971
|
y: e.y,
|
|
2910
2972
|
textAnchor: "middle",
|
|
2911
2973
|
dominantBaseline: "central",
|
|
2912
|
-
className:
|
|
2974
|
+
className: K("text-[10px] font-medium pointer-events-none", i),
|
|
2913
2975
|
children: on(e.label)
|
|
2914
2976
|
}),
|
|
2915
|
-
e.type && /* @__PURE__ */
|
|
2977
|
+
e.type && /* @__PURE__ */ Y("text", {
|
|
2916
2978
|
x: e.x,
|
|
2917
2979
|
y: e.y + a + 12,
|
|
2918
2980
|
textAnchor: "middle",
|
|
2919
2981
|
className: "fill-muted-foreground text-[9px] pointer-events-none",
|
|
2920
2982
|
children: e.type
|
|
2921
2983
|
}),
|
|
2922
|
-
t && /* @__PURE__ */
|
|
2984
|
+
t && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("rect", {
|
|
2923
2985
|
x: e.x - 50,
|
|
2924
2986
|
y: e.y - a - 28,
|
|
2925
2987
|
width: 100,
|
|
@@ -2927,7 +2989,7 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: r, classNa
|
|
|
2927
2989
|
rx: 4,
|
|
2928
2990
|
className: "fill-popover stroke-border",
|
|
2929
2991
|
strokeWidth: 1
|
|
2930
|
-
}), /* @__PURE__ */
|
|
2992
|
+
}), /* @__PURE__ */ Y("text", {
|
|
2931
2993
|
x: e.x,
|
|
2932
2994
|
y: e.y - a - 16,
|
|
2933
2995
|
textAnchor: "middle",
|
|
@@ -2951,86 +3013,82 @@ function ln(e) {
|
|
|
2951
3013
|
return e.startsWith("image/");
|
|
2952
3014
|
}
|
|
2953
3015
|
function un(e) {
|
|
2954
|
-
return ln(e) ?
|
|
3016
|
+
return ln(e) ? ge : e.includes("pdf") || e.includes("document") || e.includes("text") ? _ : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? y : me;
|
|
2955
3017
|
}
|
|
2956
3018
|
var dn = ({ attachments: t, onUpload: n, onRemove: r, className: i, readOnly: a = !1 }) => {
|
|
2957
|
-
let
|
|
2958
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2959
|
-
}, []),
|
|
2960
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2961
|
-
}, []),
|
|
2962
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2963
|
-
}, [n]),
|
|
3019
|
+
let { t: o } = $(), [s, c] = q.useState(!1), l = q.useRef(null), u = q.useCallback((e) => {
|
|
3020
|
+
e.preventDefault(), e.stopPropagation(), c(!0);
|
|
3021
|
+
}, []), d = q.useCallback((e) => {
|
|
3022
|
+
e.preventDefault(), e.stopPropagation(), c(!1);
|
|
3023
|
+
}, []), f = q.useCallback((e) => {
|
|
3024
|
+
e.preventDefault(), e.stopPropagation(), c(!1), n && e.dataTransfer.files.length > 0 && n(e.dataTransfer.files);
|
|
3025
|
+
}, [n]), p = q.useCallback((e) => {
|
|
2964
3026
|
n && e.target.files && e.target.files.length > 0 && (n(e.target.files), e.target.value = "");
|
|
2965
3027
|
}, [n]);
|
|
2966
|
-
return /* @__PURE__ */
|
|
2967
|
-
className:
|
|
2968
|
-
children: [n && !a && /* @__PURE__ */
|
|
2969
|
-
className:
|
|
2970
|
-
onDragOver:
|
|
2971
|
-
onDragLeave:
|
|
2972
|
-
onDrop:
|
|
2973
|
-
onClick: () =>
|
|
3028
|
+
return /* @__PURE__ */ X("div", {
|
|
3029
|
+
className: K("space-y-2", i),
|
|
3030
|
+
children: [n && !a && /* @__PURE__ */ X("div", {
|
|
3031
|
+
className: K("border-2 border-dashed rounded-md px-4 py-3 text-center transition-colors cursor-pointer", s ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-muted-foreground/40"),
|
|
3032
|
+
onDragOver: u,
|
|
3033
|
+
onDragLeave: d,
|
|
3034
|
+
onDrop: f,
|
|
3035
|
+
onClick: () => l.current?.click(),
|
|
2974
3036
|
role: "button",
|
|
2975
3037
|
tabIndex: 0,
|
|
2976
3038
|
onKeyDown: (e) => {
|
|
2977
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
3039
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l.current?.click());
|
|
2978
3040
|
},
|
|
2979
3041
|
children: [
|
|
2980
|
-
/* @__PURE__ */
|
|
2981
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ Y(ae, { className: "h-5 w-5 mx-auto text-muted-foreground mb-1" }),
|
|
3043
|
+
/* @__PURE__ */ Y("p", {
|
|
2982
3044
|
className: "text-xs text-muted-foreground",
|
|
2983
|
-
children: "
|
|
3045
|
+
children: o("detail.dropFilesToUpload")
|
|
2984
3046
|
}),
|
|
2985
|
-
/* @__PURE__ */
|
|
2986
|
-
ref:
|
|
3047
|
+
/* @__PURE__ */ Y("input", {
|
|
3048
|
+
ref: l,
|
|
2987
3049
|
type: "file",
|
|
2988
3050
|
multiple: !0,
|
|
2989
3051
|
className: "hidden",
|
|
2990
|
-
onChange:
|
|
3052
|
+
onChange: p
|
|
2991
3053
|
})
|
|
2992
3054
|
]
|
|
2993
|
-
}), t.length > 0 && /* @__PURE__ */
|
|
3055
|
+
}), t.length > 0 && /* @__PURE__ */ X("div", {
|
|
2994
3056
|
className: "space-y-1.5",
|
|
2995
|
-
children: [/* @__PURE__ */
|
|
3057
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2996
3058
|
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
2997
|
-
children: [/* @__PURE__ */
|
|
2998
|
-
|
|
2999
|
-
" attachment",
|
|
3000
|
-
t.length === 1 ? "" : "s"
|
|
3001
|
-
] })]
|
|
3002
|
-
}), /* @__PURE__ */ X("div", {
|
|
3059
|
+
children: [/* @__PURE__ */ Y(Pe, { className: "h-3 w-3" }), /* @__PURE__ */ Y("span", { children: t.length === 1 ? o("detail.attachmentCount", { count: t.length }) : o("detail.attachmentCountPlural", { count: t.length }) })]
|
|
3060
|
+
}), /* @__PURE__ */ Y("div", {
|
|
3003
3061
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
3004
3062
|
children: t.map((t) => {
|
|
3005
3063
|
let n = ln(t.type), i = un(t.type);
|
|
3006
|
-
return /* @__PURE__ */
|
|
3064
|
+
return /* @__PURE__ */ X("div", {
|
|
3007
3065
|
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
3008
3066
|
children: [
|
|
3009
|
-
n && (t.thumbnailUrl || t.url) ? /* @__PURE__ */
|
|
3067
|
+
n && (t.thumbnailUrl || t.url) ? /* @__PURE__ */ Y("img", {
|
|
3010
3068
|
src: t.thumbnailUrl || t.url,
|
|
3011
3069
|
alt: t.name,
|
|
3012
3070
|
className: "h-10 w-10 rounded object-cover shrink-0"
|
|
3013
|
-
}) : /* @__PURE__ */
|
|
3071
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
3014
3072
|
className: "h-10 w-10 rounded bg-muted flex items-center justify-center shrink-0",
|
|
3015
|
-
children: /* @__PURE__ */
|
|
3073
|
+
children: /* @__PURE__ */ Y(i, { className: "h-5 w-5 text-muted-foreground" })
|
|
3016
3074
|
}),
|
|
3017
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ X("div", {
|
|
3018
3076
|
className: "flex-1 min-w-0",
|
|
3019
|
-
children: [/* @__PURE__ */
|
|
3077
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
3020
3078
|
className: "text-xs font-medium truncate",
|
|
3021
3079
|
children: t.name
|
|
3022
|
-
}), /* @__PURE__ */
|
|
3080
|
+
}), /* @__PURE__ */ Y("p", {
|
|
3023
3081
|
className: "text-[10px] text-muted-foreground",
|
|
3024
3082
|
children: cn(t.size)
|
|
3025
3083
|
})]
|
|
3026
3084
|
}),
|
|
3027
|
-
r && !a && /* @__PURE__ */
|
|
3085
|
+
r && !a && /* @__PURE__ */ Y(P, {
|
|
3028
3086
|
variant: "ghost",
|
|
3029
3087
|
size: "icon",
|
|
3030
3088
|
className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
3031
3089
|
onClick: () => r(t.id),
|
|
3032
|
-
title: "
|
|
3033
|
-
children: /* @__PURE__ */
|
|
3090
|
+
title: o("detail.removeAttachment"),
|
|
3091
|
+
children: /* @__PURE__ */ Y(e, { className: "h-3.5 w-3.5" })
|
|
3034
3092
|
})
|
|
3035
3093
|
]
|
|
3036
3094
|
}, t.id);
|
|
@@ -3053,7 +3111,7 @@ function fn(e) {
|
|
|
3053
3111
|
}
|
|
3054
3112
|
}
|
|
3055
3113
|
var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
3056
|
-
let [a, o] =
|
|
3114
|
+
let [a, o] = q.useState(null), [s, l] = q.useState(!1), [u, d] = q.useState(!1), f = q.useMemo(() => t.find((e) => e.id === a) ?? null, [t, a]), h = q.useCallback(async () => {
|
|
3057
3115
|
if (!(!f || !n)) {
|
|
3058
3116
|
if (!s) {
|
|
3059
3117
|
l(!0);
|
|
@@ -3071,19 +3129,19 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3071
3129
|
f,
|
|
3072
3130
|
n,
|
|
3073
3131
|
s
|
|
3074
|
-
]), g =
|
|
3132
|
+
]), g = q.useCallback(() => {
|
|
3075
3133
|
l(!1);
|
|
3076
3134
|
}, []);
|
|
3077
|
-
return /* @__PURE__ */
|
|
3078
|
-
className:
|
|
3079
|
-
children: [/* @__PURE__ */
|
|
3135
|
+
return /* @__PURE__ */ X(D, {
|
|
3136
|
+
className: K("", i),
|
|
3137
|
+
children: [/* @__PURE__ */ Y(c, {
|
|
3080
3138
|
className: "pb-3",
|
|
3081
|
-
children: /* @__PURE__ */
|
|
3139
|
+
children: /* @__PURE__ */ X(m, {
|
|
3082
3140
|
className: "flex items-center gap-2 text-base",
|
|
3083
3141
|
children: [
|
|
3084
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ Y(r, { className: "h-4 w-4" }),
|
|
3085
3143
|
"Revision History",
|
|
3086
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__PURE__ */ X("span", {
|
|
3087
3145
|
className: "text-sm font-normal text-muted-foreground",
|
|
3088
3146
|
children: [
|
|
3089
3147
|
"(",
|
|
@@ -3093,40 +3151,40 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3093
3151
|
})
|
|
3094
3152
|
]
|
|
3095
3153
|
})
|
|
3096
|
-
}), /* @__PURE__ */
|
|
3154
|
+
}), /* @__PURE__ */ Y(j, { children: t.length === 0 ? /* @__PURE__ */ Y("p", {
|
|
3097
3155
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
3098
3156
|
children: "No revisions recorded"
|
|
3099
|
-
}) : /* @__PURE__ */
|
|
3157
|
+
}) : /* @__PURE__ */ X("div", {
|
|
3100
3158
|
className: "flex flex-col lg:flex-row gap-4",
|
|
3101
|
-
children: [/* @__PURE__ */
|
|
3159
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
3102
3160
|
className: "flex-1 min-w-0",
|
|
3103
|
-
children: /* @__PURE__ */
|
|
3161
|
+
children: /* @__PURE__ */ X("div", {
|
|
3104
3162
|
className: "relative",
|
|
3105
|
-
children: [/* @__PURE__ */
|
|
3163
|
+
children: [/* @__PURE__ */ Y("div", { className: "absolute left-3 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Y("div", {
|
|
3106
3164
|
className: "space-y-1",
|
|
3107
3165
|
children: t.map((e) => {
|
|
3108
3166
|
let t = e.id === a;
|
|
3109
|
-
return /* @__PURE__ */
|
|
3167
|
+
return /* @__PURE__ */ X("button", {
|
|
3110
3168
|
type: "button",
|
|
3111
|
-
className:
|
|
3169
|
+
className: K("w-full text-left flex items-start gap-3 py-2 px-2 rounded-md transition-colors relative", t ? "bg-accent" : "hover:bg-accent/50"),
|
|
3112
3170
|
onClick: () => {
|
|
3113
3171
|
o(e.id), l(!1);
|
|
3114
3172
|
},
|
|
3115
|
-
children: [/* @__PURE__ */
|
|
3116
|
-
className:
|
|
3117
|
-
children: t && /* @__PURE__ */
|
|
3118
|
-
}), /* @__PURE__ */
|
|
3173
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
3174
|
+
className: K("shrink-0 h-6 w-6 rounded-full border-2 flex items-center justify-center z-10 mt-0.5", t ? "border-primary bg-primary" : "border-border bg-background"),
|
|
3175
|
+
children: t && /* @__PURE__ */ Y(p, { className: "h-3 w-3 text-primary-foreground" })
|
|
3176
|
+
}), /* @__PURE__ */ X("div", {
|
|
3119
3177
|
className: "flex-1 min-w-0",
|
|
3120
|
-
children: [/* @__PURE__ */
|
|
3178
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3121
3179
|
className: "flex items-center gap-2",
|
|
3122
|
-
children: [/* @__PURE__ */
|
|
3180
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
3123
3181
|
className: "text-sm font-medium",
|
|
3124
3182
|
children: e.user
|
|
3125
|
-
}), /* @__PURE__ */
|
|
3183
|
+
}), /* @__PURE__ */ Y("span", {
|
|
3126
3184
|
className: "text-xs text-muted-foreground",
|
|
3127
3185
|
children: fn(e.timestamp)
|
|
3128
3186
|
})]
|
|
3129
|
-
}), /* @__PURE__ */
|
|
3187
|
+
}), /* @__PURE__ */ X("p", {
|
|
3130
3188
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
3131
3189
|
children: [
|
|
3132
3190
|
e.changes.length,
|
|
@@ -3141,29 +3199,29 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3141
3199
|
})
|
|
3142
3200
|
})]
|
|
3143
3201
|
})
|
|
3144
|
-
}), f && /* @__PURE__ */
|
|
3202
|
+
}), f && /* @__PURE__ */ X("div", {
|
|
3145
3203
|
className: "lg:w-80 border rounded-md p-3 space-y-3",
|
|
3146
3204
|
children: [
|
|
3147
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ X("div", {
|
|
3148
3206
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
3149
|
-
children: [/* @__PURE__ */
|
|
3207
|
+
children: [/* @__PURE__ */ Y(x, { className: "h-4 w-4 text-muted-foreground" }), "Revision Preview"]
|
|
3150
3208
|
}),
|
|
3151
|
-
/* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ Y("div", {
|
|
3152
3210
|
className: "space-y-2",
|
|
3153
|
-
children: f.changes.map((e, t) => /* @__PURE__ */
|
|
3211
|
+
children: f.changes.map((e, t) => /* @__PURE__ */ X("div", {
|
|
3154
3212
|
className: "text-xs",
|
|
3155
|
-
children: [/* @__PURE__ */
|
|
3213
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
3156
3214
|
className: "font-medium text-muted-foreground",
|
|
3157
3215
|
children: e.field
|
|
3158
|
-
}), /* @__PURE__ */
|
|
3216
|
+
}), /* @__PURE__ */ X("div", {
|
|
3159
3217
|
className: "flex items-center gap-1.5 mt-0.5",
|
|
3160
3218
|
children: [
|
|
3161
|
-
/* @__PURE__ */
|
|
3219
|
+
/* @__PURE__ */ Y("span", {
|
|
3162
3220
|
className: "line-through text-red-600 dark:text-red-400 truncate max-w-[120px]",
|
|
3163
3221
|
children: e.oldValue == null ? "(empty)" : String(e.oldValue)
|
|
3164
3222
|
}),
|
|
3165
|
-
/* @__PURE__ */
|
|
3166
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ Y(p, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
3224
|
+
/* @__PURE__ */ Y("span", {
|
|
3167
3225
|
className: "text-green-600 dark:text-green-400 truncate max-w-[120px]",
|
|
3168
3226
|
children: e.newValue == null ? "(empty)" : String(e.newValue)
|
|
3169
3227
|
})
|
|
@@ -3171,28 +3229,28 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3171
3229
|
})]
|
|
3172
3230
|
}, t))
|
|
3173
3231
|
}),
|
|
3174
|
-
f.snapshot && /* @__PURE__ */
|
|
3232
|
+
f.snapshot && /* @__PURE__ */ X("div", {
|
|
3175
3233
|
className: "border-t pt-2 space-y-1",
|
|
3176
|
-
children: [/* @__PURE__ */
|
|
3234
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
3177
3235
|
className: "text-xs font-medium text-muted-foreground",
|
|
3178
3236
|
children: "Record state at this point"
|
|
3179
|
-
}), /* @__PURE__ */
|
|
3237
|
+
}), /* @__PURE__ */ Y("div", {
|
|
3180
3238
|
className: "max-h-40 overflow-y-auto space-y-1",
|
|
3181
|
-
children: Object.entries(f.snapshot).map(([e, t]) => /* @__PURE__ */
|
|
3239
|
+
children: Object.entries(f.snapshot).map(([e, t]) => /* @__PURE__ */ X("div", {
|
|
3182
3240
|
className: "flex justify-between text-xs gap-2",
|
|
3183
|
-
children: [/* @__PURE__ */
|
|
3241
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
3184
3242
|
className: "text-muted-foreground truncate",
|
|
3185
3243
|
children: e
|
|
3186
|
-
}), /* @__PURE__ */
|
|
3244
|
+
}), /* @__PURE__ */ Y("span", {
|
|
3187
3245
|
className: "font-mono truncate max-w-[140px]",
|
|
3188
3246
|
children: t == null ? "–" : String(t)
|
|
3189
3247
|
})]
|
|
3190
3248
|
}, e))
|
|
3191
3249
|
})]
|
|
3192
3250
|
}),
|
|
3193
|
-
n && /* @__PURE__ */
|
|
3251
|
+
n && /* @__PURE__ */ Y("div", {
|
|
3194
3252
|
className: "pt-1 space-y-2",
|
|
3195
|
-
children: s ? /* @__PURE__ */
|
|
3253
|
+
children: s ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X("p", {
|
|
3196
3254
|
className: "text-xs text-amber-600 dark:text-amber-400",
|
|
3197
3255
|
children: [
|
|
3198
3256
|
"This will restore the record to its state at",
|
|
@@ -3200,28 +3258,28 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3200
3258
|
fn(f.timestamp),
|
|
3201
3259
|
". Continue?"
|
|
3202
3260
|
]
|
|
3203
|
-
}), /* @__PURE__ */
|
|
3261
|
+
}), /* @__PURE__ */ X("div", {
|
|
3204
3262
|
className: "flex gap-2",
|
|
3205
|
-
children: [/* @__PURE__ */
|
|
3263
|
+
children: [/* @__PURE__ */ X(P, {
|
|
3206
3264
|
variant: "destructive",
|
|
3207
3265
|
size: "sm",
|
|
3208
3266
|
className: "gap-1.5 flex-1",
|
|
3209
3267
|
onClick: h,
|
|
3210
3268
|
disabled: u,
|
|
3211
|
-
children: [/* @__PURE__ */
|
|
3212
|
-
}), /* @__PURE__ */
|
|
3269
|
+
children: [/* @__PURE__ */ Y(we, { className: "h-3.5 w-3.5" }), u ? "Restoring…" : "Confirm Restore"]
|
|
3270
|
+
}), /* @__PURE__ */ Y(P, {
|
|
3213
3271
|
variant: "ghost",
|
|
3214
3272
|
size: "sm",
|
|
3215
3273
|
onClick: g,
|
|
3216
3274
|
disabled: u,
|
|
3217
3275
|
children: "Cancel"
|
|
3218
3276
|
})]
|
|
3219
|
-
})] }) : /* @__PURE__ */
|
|
3277
|
+
})] }) : /* @__PURE__ */ X(P, {
|
|
3220
3278
|
variant: "outline",
|
|
3221
3279
|
size: "sm",
|
|
3222
3280
|
className: "w-full gap-1.5",
|
|
3223
3281
|
onClick: h,
|
|
3224
|
-
children: [/* @__PURE__ */
|
|
3282
|
+
children: [/* @__PURE__ */ Y(we, { className: "h-3.5 w-3.5" }), "Restore to this point"]
|
|
3225
3283
|
})
|
|
3226
3284
|
})
|
|
3227
3285
|
]
|
|
@@ -3230,19 +3288,19 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3230
3288
|
});
|
|
3231
3289
|
}, mn = ({ change: e, className: t }) => {
|
|
3232
3290
|
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));
|
|
3233
|
-
return /* @__PURE__ */
|
|
3234
|
-
className:
|
|
3291
|
+
return /* @__PURE__ */ X("div", {
|
|
3292
|
+
className: K("flex items-center gap-1.5 text-sm flex-wrap", t),
|
|
3235
3293
|
children: [
|
|
3236
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ Y("span", {
|
|
3237
3295
|
className: "font-medium text-foreground",
|
|
3238
3296
|
children: n
|
|
3239
3297
|
}),
|
|
3240
|
-
/* @__PURE__ */
|
|
3298
|
+
/* @__PURE__ */ Y("span", {
|
|
3241
3299
|
className: "text-muted-foreground line-through",
|
|
3242
3300
|
children: r
|
|
3243
3301
|
}),
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3302
|
+
/* @__PURE__ */ Y(re, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
3303
|
+
/* @__PURE__ */ Y("span", {
|
|
3246
3304
|
className: "text-foreground",
|
|
3247
3305
|
children: i
|
|
3248
3306
|
})
|
|
@@ -3256,32 +3314,32 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3256
3314
|
"😮",
|
|
3257
3315
|
"😢"
|
|
3258
3316
|
], gn = ({ reactions: e, onToggleReaction: t, emojiOptions: n = hn, className: r }) => {
|
|
3259
|
-
let [i, a] =
|
|
3317
|
+
let [i, a] = q.useState(!1), o = q.useCallback((e) => {
|
|
3260
3318
|
t?.(e), a(!1);
|
|
3261
3319
|
}, [t]);
|
|
3262
|
-
return /* @__PURE__ */
|
|
3263
|
-
className:
|
|
3264
|
-
children: [e.map((e) => /* @__PURE__ */
|
|
3320
|
+
return /* @__PURE__ */ X("div", {
|
|
3321
|
+
className: K("flex items-center gap-1 flex-wrap", r),
|
|
3322
|
+
children: [e.map((e) => /* @__PURE__ */ X("button", {
|
|
3265
3323
|
type: "button",
|
|
3266
|
-
className:
|
|
3324
|
+
className: K("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs border transition-colors", e.reacted ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted border-border text-muted-foreground hover:bg-muted/80"),
|
|
3267
3325
|
onClick: () => o(e.emoji),
|
|
3268
3326
|
disabled: !t,
|
|
3269
3327
|
"aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}`,
|
|
3270
|
-
children: [/* @__PURE__ */
|
|
3271
|
-
}, e.emoji)), t && /* @__PURE__ */
|
|
3328
|
+
children: [/* @__PURE__ */ Y("span", { children: e.emoji }), /* @__PURE__ */ Y("span", { children: e.count })]
|
|
3329
|
+
}, e.emoji)), t && /* @__PURE__ */ X("div", {
|
|
3272
3330
|
className: "relative",
|
|
3273
|
-
children: [/* @__PURE__ */
|
|
3331
|
+
children: [/* @__PURE__ */ Y(P, {
|
|
3274
3332
|
variant: "ghost",
|
|
3275
3333
|
size: "icon",
|
|
3276
3334
|
className: "h-6 w-6",
|
|
3277
3335
|
onClick: () => a(!i),
|
|
3278
3336
|
"aria-label": "Add reaction",
|
|
3279
|
-
children: /* @__PURE__ */
|
|
3280
|
-
}), i && /* @__PURE__ */
|
|
3337
|
+
children: /* @__PURE__ */ Y(ke, { className: "h-3.5 w-3.5" })
|
|
3338
|
+
}), i && /* @__PURE__ */ Y("div", {
|
|
3281
3339
|
className: "absolute bottom-full mb-1 left-0 bg-popover border rounded-md shadow-md z-50 p-1.5 flex gap-1",
|
|
3282
3340
|
role: "listbox",
|
|
3283
3341
|
"aria-label": "Emoji picker",
|
|
3284
|
-
children: n.map((t) => /* @__PURE__ */
|
|
3342
|
+
children: n.map((t) => /* @__PURE__ */ Y("button", {
|
|
3285
3343
|
type: "button",
|
|
3286
3344
|
className: "hover:bg-accent rounded p-1 text-base transition-colors",
|
|
3287
3345
|
onClick: () => o(t),
|
|
@@ -3309,122 +3367,118 @@ function _n(e) {
|
|
|
3309
3367
|
}
|
|
3310
3368
|
}
|
|
3311
3369
|
var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, className: i }) => {
|
|
3312
|
-
let
|
|
3313
|
-
let t =
|
|
3370
|
+
let { t: a } = $(), [o, s] = q.useState(!1), [c, l] = q.useState(""), [u, d] = q.useState(!1), f = q.useCallback(async () => {
|
|
3371
|
+
let t = c.trim();
|
|
3314
3372
|
if (!(!t || !n)) {
|
|
3315
|
-
|
|
3373
|
+
d(!0);
|
|
3316
3374
|
try {
|
|
3317
|
-
await n(e.id, t),
|
|
3375
|
+
await n(e.id, t), l("");
|
|
3318
3376
|
} finally {
|
|
3319
|
-
|
|
3377
|
+
d(!1);
|
|
3320
3378
|
}
|
|
3321
3379
|
}
|
|
3322
3380
|
}, [
|
|
3323
|
-
|
|
3381
|
+
c,
|
|
3324
3382
|
n,
|
|
3325
3383
|
e.id
|
|
3326
|
-
]),
|
|
3327
|
-
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(),
|
|
3328
|
-
}, [
|
|
3329
|
-
return t.length === 0 && !r ? null : /* @__PURE__ */
|
|
3330
|
-
className:
|
|
3384
|
+
]), m = q.useCallback((e) => {
|
|
3385
|
+
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), f());
|
|
3386
|
+
}, [f]);
|
|
3387
|
+
return t.length === 0 && !r ? null : /* @__PURE__ */ X("div", {
|
|
3388
|
+
className: K("ml-10 mt-1", i),
|
|
3331
3389
|
children: [
|
|
3332
|
-
t.length > 0 && /* @__PURE__ */
|
|
3390
|
+
t.length > 0 && /* @__PURE__ */ X("button", {
|
|
3333
3391
|
type: "button",
|
|
3334
3392
|
className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors mb-1",
|
|
3335
|
-
onClick: () =>
|
|
3336
|
-
"aria-expanded":
|
|
3393
|
+
onClick: () => s(!o),
|
|
3394
|
+
"aria-expanded": o,
|
|
3337
3395
|
children: [
|
|
3338
|
-
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
t.length,
|
|
3342
|
-
" ",
|
|
3343
|
-
t.length === 1 ? "reply" : "replies"
|
|
3344
|
-
] })
|
|
3396
|
+
Y(o ? te : p, { className: "h-3 w-3" }),
|
|
3397
|
+
/* @__PURE__ */ Y(T, { className: "h-3 w-3" }),
|
|
3398
|
+
/* @__PURE__ */ Y("span", { children: t.length === 1 ? a("detail.replyCount", { count: t.length }) : a("detail.replyCountPlural", { count: t.length }) })
|
|
3345
3399
|
]
|
|
3346
3400
|
}),
|
|
3347
|
-
|
|
3401
|
+
o && /* @__PURE__ */ Y("div", {
|
|
3348
3402
|
className: "space-y-2 border-l-2 border-border pl-3",
|
|
3349
|
-
children: t.map((e) => /* @__PURE__ */
|
|
3403
|
+
children: t.map((e) => /* @__PURE__ */ X("div", {
|
|
3350
3404
|
className: "flex gap-2",
|
|
3351
|
-
children: [/* @__PURE__ */
|
|
3405
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
3352
3406
|
className: "shrink-0",
|
|
3353
|
-
children: e.actorAvatarUrl ? /* @__PURE__ */
|
|
3407
|
+
children: e.actorAvatarUrl ? /* @__PURE__ */ Y("img", {
|
|
3354
3408
|
src: e.actorAvatarUrl,
|
|
3355
3409
|
alt: e.actor,
|
|
3356
3410
|
className: "h-6 w-6 rounded-full object-cover"
|
|
3357
|
-
}) : /* @__PURE__ */
|
|
3411
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
3358
3412
|
className: "h-6 w-6 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium text-muted-foreground",
|
|
3359
3413
|
children: e.actor.charAt(0).toUpperCase()
|
|
3360
3414
|
})
|
|
3361
|
-
}), /* @__PURE__ */
|
|
3415
|
+
}), /* @__PURE__ */ X("div", {
|
|
3362
3416
|
className: "flex-1 min-w-0",
|
|
3363
|
-
children: [/* @__PURE__ */
|
|
3417
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3364
3418
|
className: "flex items-center gap-1.5",
|
|
3365
|
-
children: [/* @__PURE__ */
|
|
3419
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
3366
3420
|
className: "text-xs font-medium",
|
|
3367
3421
|
children: e.actor
|
|
3368
|
-
}), /* @__PURE__ */
|
|
3422
|
+
}), /* @__PURE__ */ Y("span", {
|
|
3369
3423
|
className: "text-[10px] text-muted-foreground",
|
|
3370
3424
|
children: _n(e.createdAt)
|
|
3371
3425
|
})]
|
|
3372
|
-
}), /* @__PURE__ */
|
|
3426
|
+
}), /* @__PURE__ */ Y("p", {
|
|
3373
3427
|
className: "text-xs whitespace-pre-wrap break-words",
|
|
3374
3428
|
children: e.body
|
|
3375
3429
|
})]
|
|
3376
3430
|
})]
|
|
3377
3431
|
}, e.id))
|
|
3378
3432
|
}),
|
|
3379
|
-
r && n && /* @__PURE__ */
|
|
3433
|
+
r && n && /* @__PURE__ */ X("div", {
|
|
3380
3434
|
className: "flex gap-1.5 mt-1.5",
|
|
3381
|
-
children: [/* @__PURE__ */
|
|
3435
|
+
children: [/* @__PURE__ */ Y("input", {
|
|
3382
3436
|
className: "flex-1 rounded-md border border-input bg-background px-2 py-1 text-xs placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3383
|
-
placeholder: "
|
|
3384
|
-
value:
|
|
3385
|
-
onChange: (e) =>
|
|
3386
|
-
onKeyDown:
|
|
3387
|
-
disabled:
|
|
3388
|
-
}), /* @__PURE__ */
|
|
3437
|
+
placeholder: a("detail.replyPlaceholder"),
|
|
3438
|
+
value: c,
|
|
3439
|
+
onChange: (e) => l(e.target.value),
|
|
3440
|
+
onKeyDown: m,
|
|
3441
|
+
disabled: u
|
|
3442
|
+
}), /* @__PURE__ */ Y(P, {
|
|
3389
3443
|
variant: "ghost",
|
|
3390
3444
|
size: "icon",
|
|
3391
3445
|
className: "h-6 w-6 shrink-0",
|
|
3392
|
-
onClick:
|
|
3393
|
-
disabled: !
|
|
3446
|
+
onClick: f,
|
|
3447
|
+
disabled: !c.trim() || u,
|
|
3394
3448
|
"aria-label": "Send reply",
|
|
3395
|
-
children: /* @__PURE__ */
|
|
3449
|
+
children: /* @__PURE__ */ Y(Me, { className: "h-3 w-3" })
|
|
3396
3450
|
})]
|
|
3397
3451
|
})
|
|
3398
3452
|
]
|
|
3399
3453
|
});
|
|
3400
3454
|
}, yn = ({ subscription: e, onToggle: t, className: n }) => {
|
|
3401
|
-
let
|
|
3455
|
+
let { t: r } = $(), [i, a] = q.useState(!1), o = q.useCallback(async () => {
|
|
3402
3456
|
if (t) {
|
|
3403
|
-
|
|
3457
|
+
a(!0);
|
|
3404
3458
|
try {
|
|
3405
3459
|
await t(!e.subscribed);
|
|
3406
3460
|
} finally {
|
|
3407
|
-
|
|
3461
|
+
a(!1);
|
|
3408
3462
|
}
|
|
3409
3463
|
}
|
|
3410
3464
|
}, [t, e.subscribed]);
|
|
3411
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ Y(P, {
|
|
3412
3466
|
variant: "ghost",
|
|
3413
3467
|
size: "icon",
|
|
3414
|
-
className:
|
|
3415
|
-
onClick:
|
|
3416
|
-
disabled:
|
|
3417
|
-
"aria-label": e.subscribed ? "
|
|
3418
|
-
title: e.subscribed ? "
|
|
3419
|
-
children: e.subscribed ? /* @__PURE__ */
|
|
3468
|
+
className: K("h-8 w-8", n),
|
|
3469
|
+
onClick: o,
|
|
3470
|
+
disabled: i || !t,
|
|
3471
|
+
"aria-label": e.subscribed ? r("detail.unsubscribeAriaLabel") : r("detail.subscribeAriaLabel"),
|
|
3472
|
+
title: e.subscribed ? r("detail.subscribedTooltip") : r("detail.unsubscribedTooltip"),
|
|
3473
|
+
children: e.subscribed ? /* @__PURE__ */ Y(B, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ Y(Ae, { className: "h-4 w-4 text-muted-foreground" })
|
|
3420
3474
|
});
|
|
3421
3475
|
}, bn = {
|
|
3422
3476
|
comment: T,
|
|
3423
|
-
field_change:
|
|
3477
|
+
field_change: R,
|
|
3424
3478
|
task: Se,
|
|
3425
3479
|
event: C,
|
|
3426
3480
|
system: S,
|
|
3427
|
-
email:
|
|
3481
|
+
email: Fe,
|
|
3428
3482
|
call: ne
|
|
3429
3483
|
}, xn = {
|
|
3430
3484
|
comment: "bg-purple-100 text-purple-600",
|
|
@@ -3434,24 +3488,27 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3434
3488
|
system: "bg-gray-100 text-gray-600",
|
|
3435
3489
|
email: "bg-indigo-100 text-indigo-600",
|
|
3436
3490
|
call: "bg-teal-100 text-teal-600"
|
|
3437
|
-
}
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3491
|
+
};
|
|
3492
|
+
function Sn(e) {
|
|
3493
|
+
return [
|
|
3494
|
+
{
|
|
3495
|
+
value: "all",
|
|
3496
|
+
label: e("detail.allActivity")
|
|
3497
|
+
},
|
|
3498
|
+
{
|
|
3499
|
+
value: "comments_only",
|
|
3500
|
+
label: e("detail.commentsOnly")
|
|
3501
|
+
},
|
|
3502
|
+
{
|
|
3503
|
+
value: "changes_only",
|
|
3504
|
+
label: e("detail.fieldChangesFilter")
|
|
3505
|
+
},
|
|
3506
|
+
{
|
|
3507
|
+
value: "tasks_only",
|
|
3508
|
+
label: e("detail.tasksOnly")
|
|
3509
|
+
}
|
|
3510
|
+
];
|
|
3511
|
+
}
|
|
3455
3512
|
function Cn(e) {
|
|
3456
3513
|
try {
|
|
3457
3514
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
@@ -3474,169 +3531,169 @@ function wn(e, t) {
|
|
|
3474
3531
|
}
|
|
3475
3532
|
}
|
|
3476
3533
|
var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: i = !1, onLoadMore: a, loading: o = !1, onAddComment: s, onAddReply: l, onToggleReaction: u, subscription: d, onToggleSubscription: f, collapseWhenEmpty: p = !1, className: h }) => {
|
|
3477
|
-
let
|
|
3534
|
+
let { t: g } = $(), [_, v] = q.useState("all"), [y, b] = q.useState(""), [x, C] = q.useState(!1), [w, O] = q.useState(!1), k = n ?? _, A = t?.showFilterToggle !== !1, ee = t?.showCommentInput !== !1 && !!s, M = t?.enableReactions ?? !1, N = t?.enableThreading ?? !1, F = t?.showSubscriptionToggle ?? !1, I = q.useMemo(() => wn(e, k), [e, k]), ne = q.useMemo(() => N ? I.filter((e) => !e.parentId) : I, [I, N]), L = q.useMemo(() => {
|
|
3478
3535
|
if (!N) return /* @__PURE__ */ new Map();
|
|
3479
3536
|
let e = /* @__PURE__ */ new Map();
|
|
3480
|
-
for (let t of
|
|
3537
|
+
for (let t of I) if (t.parentId) {
|
|
3481
3538
|
let n = e.get(t.parentId) ?? [];
|
|
3482
3539
|
n.push(t), e.set(t.parentId, n);
|
|
3483
3540
|
}
|
|
3484
3541
|
return e;
|
|
3485
|
-
}, [
|
|
3486
|
-
r ? r(e) :
|
|
3487
|
-
}, [r]), R =
|
|
3488
|
-
let e =
|
|
3542
|
+
}, [I, N]), re = q.useCallback((e) => {
|
|
3543
|
+
r ? r(e) : v(e);
|
|
3544
|
+
}, [r]), R = q.useCallback(async () => {
|
|
3545
|
+
let e = y.trim();
|
|
3489
3546
|
if (!(!e || !s)) {
|
|
3490
|
-
|
|
3547
|
+
C(!0);
|
|
3491
3548
|
try {
|
|
3492
|
-
await s(e),
|
|
3549
|
+
await s(e), b("");
|
|
3493
3550
|
} finally {
|
|
3494
|
-
|
|
3551
|
+
C(!1);
|
|
3495
3552
|
}
|
|
3496
3553
|
}
|
|
3497
|
-
}, [
|
|
3554
|
+
}, [y, s]), z = q.useCallback((e) => {
|
|
3498
3555
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), R());
|
|
3499
|
-
}, [R]),
|
|
3556
|
+
}, [R]), ie = q.useCallback(async () => {
|
|
3500
3557
|
if (a) {
|
|
3501
|
-
|
|
3558
|
+
O(!0);
|
|
3502
3559
|
try {
|
|
3503
3560
|
await a();
|
|
3504
3561
|
} finally {
|
|
3505
|
-
|
|
3562
|
+
O(!1);
|
|
3506
3563
|
}
|
|
3507
3564
|
}
|
|
3508
3565
|
}, [a]);
|
|
3509
|
-
return /* @__PURE__ */
|
|
3510
|
-
className:
|
|
3511
|
-
children: [/* @__PURE__ */
|
|
3566
|
+
return /* @__PURE__ */ X(D, {
|
|
3567
|
+
className: K("", h),
|
|
3568
|
+
children: [/* @__PURE__ */ Y(c, { children: /* @__PURE__ */ X("div", {
|
|
3512
3569
|
className: "flex items-center justify-between",
|
|
3513
|
-
children: [/* @__PURE__ */
|
|
3570
|
+
children: [/* @__PURE__ */ X(m, {
|
|
3514
3571
|
className: "flex items-center gap-2 text-base",
|
|
3515
3572
|
children: [
|
|
3516
|
-
/* @__PURE__ */
|
|
3517
|
-
"
|
|
3518
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ Y(_e, { className: "h-4 w-4" }),
|
|
3574
|
+
g("detail.activity"),
|
|
3575
|
+
/* @__PURE__ */ X("span", {
|
|
3519
3576
|
className: "text-sm font-normal text-muted-foreground",
|
|
3520
3577
|
children: [
|
|
3521
3578
|
"(",
|
|
3522
|
-
|
|
3579
|
+
I.length,
|
|
3523
3580
|
")"
|
|
3524
3581
|
]
|
|
3525
3582
|
})
|
|
3526
3583
|
]
|
|
3527
|
-
}), /* @__PURE__ */
|
|
3584
|
+
}), /* @__PURE__ */ Y("div", {
|
|
3528
3585
|
className: "flex items-center gap-1",
|
|
3529
|
-
children:
|
|
3586
|
+
children: F && d && /* @__PURE__ */ Y(yn, {
|
|
3530
3587
|
subscription: d,
|
|
3531
3588
|
onToggle: f
|
|
3532
3589
|
})
|
|
3533
3590
|
})]
|
|
3534
|
-
}) }), /* @__PURE__ */
|
|
3591
|
+
}) }), /* @__PURE__ */ X(j, {
|
|
3535
3592
|
className: "space-y-4",
|
|
3536
3593
|
children: [
|
|
3537
|
-
|
|
3594
|
+
A && /* @__PURE__ */ Y("div", {
|
|
3538
3595
|
className: "flex items-center gap-2",
|
|
3539
|
-
children: /* @__PURE__ */
|
|
3596
|
+
children: /* @__PURE__ */ Y("select", {
|
|
3540
3597
|
className: "rounded-md border border-input bg-background px-2.5 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3541
|
-
value:
|
|
3542
|
-
onChange: (e) =>
|
|
3543
|
-
"aria-label": "
|
|
3544
|
-
children: Sn.map((e) => /* @__PURE__ */
|
|
3598
|
+
value: k,
|
|
3599
|
+
onChange: (e) => re(e.target.value),
|
|
3600
|
+
"aria-label": g("detail.filterActivity"),
|
|
3601
|
+
children: Sn(g).map((e) => /* @__PURE__ */ Y("option", {
|
|
3545
3602
|
value: e.value,
|
|
3546
3603
|
children: e.label
|
|
3547
3604
|
}, e.value))
|
|
3548
3605
|
})
|
|
3549
3606
|
}),
|
|
3550
|
-
|
|
3607
|
+
ee && /* @__PURE__ */ X("div", {
|
|
3551
3608
|
className: "flex gap-2",
|
|
3552
|
-
children: [/* @__PURE__ */
|
|
3609
|
+
children: [/* @__PURE__ */ Y("textarea", {
|
|
3553
3610
|
className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
|
|
3554
|
-
placeholder: "
|
|
3555
|
-
value:
|
|
3556
|
-
onChange: (e) =>
|
|
3611
|
+
placeholder: g("detail.leaveCommentPlaceholder"),
|
|
3612
|
+
value: y,
|
|
3613
|
+
onChange: (e) => b(e.target.value),
|
|
3557
3614
|
onKeyDown: z,
|
|
3558
|
-
disabled:
|
|
3559
|
-
}), /* @__PURE__ */
|
|
3615
|
+
disabled: x
|
|
3616
|
+
}), /* @__PURE__ */ Y(P, {
|
|
3560
3617
|
size: "icon",
|
|
3561
3618
|
variant: "default",
|
|
3562
3619
|
onClick: R,
|
|
3563
|
-
disabled: !
|
|
3620
|
+
disabled: !y.trim() || x,
|
|
3564
3621
|
className: "shrink-0 self-end",
|
|
3565
|
-
"aria-label": "
|
|
3566
|
-
children: /* @__PURE__ */
|
|
3622
|
+
"aria-label": g("detail.submitComment"),
|
|
3623
|
+
children: /* @__PURE__ */ Y(T, { className: "h-4 w-4" })
|
|
3567
3624
|
})]
|
|
3568
3625
|
}),
|
|
3569
|
-
|
|
3626
|
+
I.length === 0 ? p ? null : /* @__PURE__ */ Y("p", {
|
|
3570
3627
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
3571
|
-
children: "
|
|
3572
|
-
}) : /* @__PURE__ */
|
|
3628
|
+
children: g("detail.noActivity")
|
|
3629
|
+
}) : /* @__PURE__ */ X("div", {
|
|
3573
3630
|
className: "relative",
|
|
3574
|
-
children: [/* @__PURE__ */
|
|
3631
|
+
children: [/* @__PURE__ */ Y("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Y("div", {
|
|
3575
3632
|
className: "space-y-4",
|
|
3576
|
-
children:
|
|
3577
|
-
let t = bn[e.type] || S, n = xn[e.type] || "bg-gray-100 text-gray-600", r =
|
|
3578
|
-
return /* @__PURE__ */
|
|
3633
|
+
children: ne.map((e) => {
|
|
3634
|
+
let t = bn[e.type] || S, n = xn[e.type] || "bg-gray-100 text-gray-600", r = L.get(e.id) ?? [];
|
|
3635
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
3579
3636
|
className: "flex gap-3 relative",
|
|
3580
|
-
children: [/* @__PURE__ */
|
|
3581
|
-
className:
|
|
3582
|
-
children: e.actorAvatarUrl ? /* @__PURE__ */
|
|
3637
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
3638
|
+
className: K("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", n),
|
|
3639
|
+
children: e.actorAvatarUrl ? /* @__PURE__ */ Y("img", {
|
|
3583
3640
|
src: e.actorAvatarUrl,
|
|
3584
3641
|
alt: e.actor,
|
|
3585
3642
|
className: "h-8 w-8 rounded-full object-cover"
|
|
3586
|
-
}) : /* @__PURE__ */
|
|
3587
|
-
}), /* @__PURE__ */
|
|
3643
|
+
}) : /* @__PURE__ */ Y(t, { className: "h-3.5 w-3.5" })
|
|
3644
|
+
}), /* @__PURE__ */ X("div", {
|
|
3588
3645
|
className: "flex-1 min-w-0 pt-1",
|
|
3589
3646
|
children: [
|
|
3590
|
-
/* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ X("div", {
|
|
3591
3648
|
className: "flex items-center gap-2 mb-0.5",
|
|
3592
3649
|
children: [
|
|
3593
|
-
/* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ Y("span", {
|
|
3594
3651
|
className: "text-sm font-medium",
|
|
3595
3652
|
children: e.actor
|
|
3596
3653
|
}),
|
|
3597
|
-
e.source && /* @__PURE__ */
|
|
3654
|
+
e.source && /* @__PURE__ */ Y("span", {
|
|
3598
3655
|
className: "text-xs text-muted-foreground",
|
|
3599
|
-
children:
|
|
3656
|
+
children: g("detail.via", { source: e.source })
|
|
3600
3657
|
}),
|
|
3601
|
-
/* @__PURE__ */
|
|
3658
|
+
/* @__PURE__ */ Y("span", {
|
|
3602
3659
|
className: "text-xs text-muted-foreground",
|
|
3603
3660
|
children: Cn(e.createdAt)
|
|
3604
3661
|
}),
|
|
3605
|
-
e.edited && /* @__PURE__ */
|
|
3662
|
+
e.edited && /* @__PURE__ */ Y("span", {
|
|
3606
3663
|
className: "text-xs text-muted-foreground italic",
|
|
3607
|
-
children: "
|
|
3664
|
+
children: g("detail.edited")
|
|
3608
3665
|
}),
|
|
3609
3666
|
e.pinned && /* @__PURE__ */ X("span", {
|
|
3610
3667
|
className: "text-xs text-amber-600",
|
|
3611
|
-
children: "📌
|
|
3668
|
+
children: ["📌 ", g("detail.pinned")]
|
|
3612
3669
|
})
|
|
3613
3670
|
]
|
|
3614
3671
|
}),
|
|
3615
|
-
e.body && /* @__PURE__ */
|
|
3672
|
+
e.body && /* @__PURE__ */ Y("p", {
|
|
3616
3673
|
className: "text-sm whitespace-pre-wrap break-words text-muted-foreground",
|
|
3617
3674
|
children: e.body
|
|
3618
3675
|
}),
|
|
3619
|
-
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */
|
|
3676
|
+
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ Y("div", {
|
|
3620
3677
|
className: "space-y-1 mt-1",
|
|
3621
|
-
children: e.fieldChanges.map((e, t) => /* @__PURE__ */
|
|
3678
|
+
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Y(mn, { change: e }, t))
|
|
3622
3679
|
}),
|
|
3623
|
-
M && e.reactions && e.reactions.length > 0 && /* @__PURE__ */
|
|
3680
|
+
M && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ Y("div", {
|
|
3624
3681
|
className: "mt-1.5",
|
|
3625
|
-
children: /* @__PURE__ */
|
|
3682
|
+
children: /* @__PURE__ */ Y(gn, {
|
|
3626
3683
|
reactions: e.reactions,
|
|
3627
3684
|
onToggleReaction: u ? (t) => u(e.id, t) : void 0
|
|
3628
3685
|
})
|
|
3629
3686
|
}),
|
|
3630
|
-
M && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */
|
|
3687
|
+
M && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */ Y("div", {
|
|
3631
3688
|
className: "mt-1.5",
|
|
3632
|
-
children: /* @__PURE__ */
|
|
3689
|
+
children: /* @__PURE__ */ Y(gn, {
|
|
3633
3690
|
reactions: [],
|
|
3634
3691
|
onToggleReaction: (t) => u(e.id, t)
|
|
3635
3692
|
})
|
|
3636
3693
|
})
|
|
3637
3694
|
]
|
|
3638
3695
|
})]
|
|
3639
|
-
}), N && (e.replyCount ?? 0) > 0 && /* @__PURE__ */
|
|
3696
|
+
}), N && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Y(vn, {
|
|
3640
3697
|
parentItem: e,
|
|
3641
3698
|
replies: r,
|
|
3642
3699
|
onAddReply: l,
|
|
@@ -3645,57 +3702,57 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: i =
|
|
|
3645
3702
|
})
|
|
3646
3703
|
})]
|
|
3647
3704
|
}),
|
|
3648
|
-
i && /* @__PURE__ */
|
|
3705
|
+
i && /* @__PURE__ */ Y("div", {
|
|
3649
3706
|
className: "text-center pt-2",
|
|
3650
|
-
children: /* @__PURE__ */
|
|
3707
|
+
children: /* @__PURE__ */ X(P, {
|
|
3651
3708
|
variant: "ghost",
|
|
3652
3709
|
size: "sm",
|
|
3653
|
-
onClick:
|
|
3654
|
-
disabled:
|
|
3655
|
-
"aria-label": "
|
|
3656
|
-
children: [
|
|
3710
|
+
onClick: ie,
|
|
3711
|
+
disabled: w,
|
|
3712
|
+
"aria-label": g("detail.loadMore"),
|
|
3713
|
+
children: [w ? /* @__PURE__ */ Y(E, { className: "h-4 w-4 animate-spin mr-1" }) : /* @__PURE__ */ Y(te, { className: "h-4 w-4 mr-1" }), g("detail.loadMore")]
|
|
3657
3714
|
})
|
|
3658
3715
|
})
|
|
3659
3716
|
]
|
|
3660
3717
|
})]
|
|
3661
3718
|
});
|
|
3662
3719
|
}, En = ({ config: t, items: n, hasMore: r, onLoadMore: i, loading: a, onAddComment: o, onAddReply: s, onToggleReaction: c, subscription: l, onToggleSubscription: u, filterMode: d, onFilterChange: f, collapseWhenEmpty: p = !1, className: m }) => {
|
|
3663
|
-
let h = t?.position ?? "right", g = t?.width ?? "360px", _ = t?.collapsible ?? !0, v = p && n.length === 0 || (t?.defaultCollapsed ?? !1),
|
|
3664
|
-
return h === "right" || h === "left" ?
|
|
3665
|
-
className:
|
|
3666
|
-
children: /* @__PURE__ */
|
|
3720
|
+
let h = t?.position ?? "right", g = t?.width ?? "360px", _ = t?.collapsible ?? !0, v = p && n.length === 0 || (t?.defaultCollapsed ?? !1), { t: y } = $(), [b, x] = q.useState(v);
|
|
3721
|
+
return h === "right" || h === "left" ? b && _ ? /* @__PURE__ */ Y("div", {
|
|
3722
|
+
className: K("flex items-start pt-4", h === "right" ? "border-l" : "border-r", m),
|
|
3723
|
+
children: /* @__PURE__ */ Y(P, {
|
|
3667
3724
|
variant: "ghost",
|
|
3668
3725
|
size: "icon",
|
|
3669
3726
|
className: "h-8 w-8 mx-1",
|
|
3670
|
-
onClick: () =>
|
|
3671
|
-
"aria-label": "
|
|
3672
|
-
children: /* @__PURE__ */
|
|
3727
|
+
onClick: () => x(!1),
|
|
3728
|
+
"aria-label": y("detail.openDiscussion"),
|
|
3729
|
+
children: /* @__PURE__ */ Y(Le, { className: "h-4 w-4" })
|
|
3673
3730
|
})
|
|
3674
|
-
}) : /* @__PURE__ */
|
|
3675
|
-
className:
|
|
3731
|
+
}) : /* @__PURE__ */ X("div", {
|
|
3732
|
+
className: K("flex flex-col overflow-hidden", h === "right" ? "border-l" : "border-r", m),
|
|
3676
3733
|
style: {
|
|
3677
3734
|
width: g,
|
|
3678
3735
|
minWidth: g
|
|
3679
3736
|
},
|
|
3680
|
-
children: [/* @__PURE__ */
|
|
3737
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3681
3738
|
className: "flex items-center justify-between px-4 py-3 border-b",
|
|
3682
|
-
children: [/* @__PURE__ */
|
|
3739
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3683
3740
|
className: "flex items-center gap-2",
|
|
3684
|
-
children: [/* @__PURE__ */
|
|
3741
|
+
children: [/* @__PURE__ */ Y(T, { className: "h-4 w-4" }), /* @__PURE__ */ Y("span", {
|
|
3685
3742
|
className: "text-sm font-medium",
|
|
3686
|
-
children: "
|
|
3743
|
+
children: y("detail.discussion")
|
|
3687
3744
|
})]
|
|
3688
|
-
}), _ && /* @__PURE__ */
|
|
3745
|
+
}), _ && /* @__PURE__ */ Y(P, {
|
|
3689
3746
|
variant: "ghost",
|
|
3690
3747
|
size: "icon",
|
|
3691
3748
|
className: "h-7 w-7",
|
|
3692
|
-
onClick: () =>
|
|
3693
|
-
"aria-label": "
|
|
3694
|
-
children: /* @__PURE__ */
|
|
3749
|
+
onClick: () => x(!0),
|
|
3750
|
+
"aria-label": y("detail.closeDiscussion"),
|
|
3751
|
+
children: /* @__PURE__ */ Y(e, { className: "h-3.5 w-3.5" })
|
|
3695
3752
|
})]
|
|
3696
|
-
}), /* @__PURE__ */
|
|
3753
|
+
}), /* @__PURE__ */ Y("div", {
|
|
3697
3754
|
className: "flex-1 overflow-y-auto",
|
|
3698
|
-
children: /* @__PURE__ */
|
|
3755
|
+
children: /* @__PURE__ */ Y(Tn, {
|
|
3699
3756
|
items: n,
|
|
3700
3757
|
config: t?.feed,
|
|
3701
3758
|
hasMore: r,
|
|
@@ -3712,32 +3769,28 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: i =
|
|
|
3712
3769
|
className: "border-0 shadow-none"
|
|
3713
3770
|
})
|
|
3714
3771
|
})]
|
|
3715
|
-
}) : /* @__PURE__ */
|
|
3716
|
-
className:
|
|
3717
|
-
children: _ &&
|
|
3772
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
3773
|
+
className: K("", m),
|
|
3774
|
+
children: _ && b ? /* @__PURE__ */ X(P, {
|
|
3718
3775
|
variant: "ghost",
|
|
3719
3776
|
className: "w-full justify-start gap-2 text-muted-foreground",
|
|
3720
|
-
onClick: () =>
|
|
3721
|
-
"aria-label": "
|
|
3722
|
-
children: [/* @__PURE__ */
|
|
3723
|
-
|
|
3724
|
-
n.length,
|
|
3725
|
-
")"
|
|
3726
|
-
] })]
|
|
3727
|
-
}) : /* @__PURE__ */ Z("div", { children: [_ && /* @__PURE__ */ Z("div", {
|
|
3777
|
+
onClick: () => x(!1),
|
|
3778
|
+
"aria-label": y("detail.showDiscussion", { count: n.length }),
|
|
3779
|
+
children: [/* @__PURE__ */ Y(T, { className: "h-4 w-4" }), /* @__PURE__ */ Y("span", { children: y("detail.showDiscussion", { count: n.length }) })]
|
|
3780
|
+
}) : /* @__PURE__ */ X("div", { children: [_ && /* @__PURE__ */ X("div", {
|
|
3728
3781
|
className: "flex items-center justify-between mb-2",
|
|
3729
|
-
children: [/* @__PURE__ */
|
|
3782
|
+
children: [/* @__PURE__ */ X("div", {
|
|
3730
3783
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
3731
|
-
children: [/* @__PURE__ */
|
|
3732
|
-
}), /* @__PURE__ */
|
|
3784
|
+
children: [/* @__PURE__ */ Y(T, { className: "h-4 w-4" }), y("detail.discussion")]
|
|
3785
|
+
}), /* @__PURE__ */ Y(P, {
|
|
3733
3786
|
variant: "ghost",
|
|
3734
3787
|
size: "icon",
|
|
3735
3788
|
className: "h-7 w-7",
|
|
3736
|
-
onClick: () =>
|
|
3737
|
-
"aria-label": "
|
|
3738
|
-
children: /* @__PURE__ */
|
|
3789
|
+
onClick: () => x(!0),
|
|
3790
|
+
"aria-label": y("detail.hideDiscussion"),
|
|
3791
|
+
children: /* @__PURE__ */ Y(z, { className: "h-3.5 w-3.5" })
|
|
3739
3792
|
})]
|
|
3740
|
-
}), /* @__PURE__ */
|
|
3793
|
+
}), /* @__PURE__ */ Y(Tn, {
|
|
3741
3794
|
items: n,
|
|
3742
3795
|
config: t?.feed,
|
|
3743
3796
|
hasMore: r,
|
|
@@ -3754,7 +3807,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: i =
|
|
|
3754
3807
|
})] })
|
|
3755
3808
|
});
|
|
3756
3809
|
}, Dn = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: n = !1, className: r }) => {
|
|
3757
|
-
let [i, a] =
|
|
3810
|
+
let [i, a] = q.useState(""), [o, s] = q.useState(!1), c = q.useCallback(async () => {
|
|
3758
3811
|
let t = i.trim();
|
|
3759
3812
|
if (t) {
|
|
3760
3813
|
s(!0);
|
|
@@ -3764,59 +3817,59 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: r, hasMore: i =
|
|
|
3764
3817
|
s(!1);
|
|
3765
3818
|
}
|
|
3766
3819
|
}
|
|
3767
|
-
}, [i, e]), l =
|
|
3820
|
+
}, [i, e]), l = q.useCallback((e) => {
|
|
3768
3821
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), c());
|
|
3769
3822
|
}, [c]);
|
|
3770
|
-
return /* @__PURE__ */
|
|
3771
|
-
className:
|
|
3772
|
-
children: [/* @__PURE__ */
|
|
3823
|
+
return /* @__PURE__ */ X("div", {
|
|
3824
|
+
className: K("flex gap-2", r),
|
|
3825
|
+
children: [/* @__PURE__ */ Y("textarea", {
|
|
3773
3826
|
className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
|
|
3774
3827
|
placeholder: t,
|
|
3775
3828
|
value: i,
|
|
3776
3829
|
onChange: (e) => a(e.target.value),
|
|
3777
3830
|
onKeyDown: l,
|
|
3778
3831
|
disabled: n || o
|
|
3779
|
-
}), /* @__PURE__ */
|
|
3832
|
+
}), /* @__PURE__ */ Y(P, {
|
|
3780
3833
|
size: "icon",
|
|
3781
3834
|
variant: "default",
|
|
3782
3835
|
onClick: c,
|
|
3783
3836
|
disabled: !i.trim() || o || n,
|
|
3784
3837
|
className: "shrink-0 self-end",
|
|
3785
3838
|
"aria-label": "Submit comment",
|
|
3786
|
-
children: /* @__PURE__ */
|
|
3839
|
+
children: /* @__PURE__ */ Y(Me, { className: "h-4 w-4" })
|
|
3787
3840
|
})]
|
|
3788
3841
|
});
|
|
3789
3842
|
}, On = ({ query: e, suggestions: t, onSelect: n, visible: r = !0, activeIndex: i = 0, className: a }) => {
|
|
3790
|
-
let o =
|
|
3843
|
+
let o = q.useMemo(() => {
|
|
3791
3844
|
if (!e) return t;
|
|
3792
3845
|
let n = e.toLowerCase();
|
|
3793
3846
|
return t.filter((e) => e.name.toLowerCase().includes(n) || e.id.toLowerCase().includes(n));
|
|
3794
3847
|
}, [e, t]);
|
|
3795
|
-
return !r || o.length === 0 ? null : /* @__PURE__ */
|
|
3796
|
-
className:
|
|
3848
|
+
return !r || o.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
3849
|
+
className: K("bg-popover border rounded-md shadow-md z-50 max-h-48 overflow-y-auto w-56", a),
|
|
3797
3850
|
role: "listbox",
|
|
3798
3851
|
"aria-label": "Mention suggestions",
|
|
3799
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
3852
|
+
children: o.map((e, t) => /* @__PURE__ */ X("button", {
|
|
3800
3853
|
type: "button",
|
|
3801
3854
|
role: "option",
|
|
3802
3855
|
"aria-selected": t === i,
|
|
3803
|
-
className:
|
|
3856
|
+
className: K("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === i && "bg-accent"),
|
|
3804
3857
|
onMouseDown: (t) => {
|
|
3805
3858
|
t.preventDefault(), n(e);
|
|
3806
3859
|
},
|
|
3807
|
-
children: [e.avatarUrl ? /* @__PURE__ */
|
|
3860
|
+
children: [e.avatarUrl ? /* @__PURE__ */ Y("img", {
|
|
3808
3861
|
src: e.avatarUrl,
|
|
3809
3862
|
alt: e.name,
|
|
3810
3863
|
className: "h-5 w-5 rounded-full object-cover"
|
|
3811
|
-
}) : /* @__PURE__ */
|
|
3864
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
3812
3865
|
className: "h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium",
|
|
3813
3866
|
children: e.name.charAt(0).toUpperCase()
|
|
3814
|
-
}), /* @__PURE__ */
|
|
3867
|
+
}), /* @__PURE__ */ X("div", {
|
|
3815
3868
|
className: "flex-1 min-w-0",
|
|
3816
|
-
children: [/* @__PURE__ */
|
|
3869
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
3817
3870
|
className: "truncate",
|
|
3818
3871
|
children: e.name
|
|
3819
|
-
}), e.type !== "user" && /* @__PURE__ */
|
|
3872
|
+
}), e.type !== "user" && /* @__PURE__ */ X("span", {
|
|
3820
3873
|
className: "ml-1 text-xs text-muted-foreground capitalize",
|
|
3821
3874
|
children: [
|
|
3822
3875
|
"(",
|
|
@@ -3837,7 +3890,7 @@ function kn(e, t, n) {
|
|
|
3837
3890
|
length: n
|
|
3838
3891
|
};
|
|
3839
3892
|
}
|
|
3840
|
-
|
|
3893
|
+
le.register("detail-view", Gt, {
|
|
3841
3894
|
namespace: "plugin-detail",
|
|
3842
3895
|
label: "Detail View",
|
|
3843
3896
|
category: "Views",
|
|
@@ -3967,7 +4020,7 @@ ve.register("detail-view", Gt, {
|
|
|
3967
4020
|
tabs: [],
|
|
3968
4021
|
related: []
|
|
3969
4022
|
}
|
|
3970
|
-
}),
|
|
4023
|
+
}), le.register("detail-section", jt, {
|
|
3971
4024
|
namespace: "plugin-detail",
|
|
3972
4025
|
label: "Detail Section",
|
|
3973
4026
|
category: "Detail Components",
|
|
@@ -4018,7 +4071,7 @@ ve.register("detail-view", Gt, {
|
|
|
4018
4071
|
label: "Header Color"
|
|
4019
4072
|
}
|
|
4020
4073
|
]
|
|
4021
|
-
}),
|
|
4074
|
+
}), le.register("related-list", Nt, {
|
|
4022
4075
|
namespace: "plugin-detail",
|
|
4023
4076
|
label: "Related List",
|
|
4024
4077
|
category: "Detail Components",
|
|
@@ -4065,7 +4118,7 @@ ve.register("detail-view", Gt, {
|
|
|
4065
4118
|
label: "Columns"
|
|
4066
4119
|
}
|
|
4067
4120
|
]
|
|
4068
|
-
}),
|
|
4121
|
+
}), le.register("detail", Gt, {
|
|
4069
4122
|
namespace: "view",
|
|
4070
4123
|
category: "view",
|
|
4071
4124
|
label: "Detail",
|
|
@@ -4090,4 +4143,4 @@ ve.register("detail-view", Gt, {
|
|
|
4090
4143
|
]
|
|
4091
4144
|
});
|
|
4092
4145
|
//#endregion
|
|
4093
|
-
export { Ut as ActivityTimeline, dn as CommentAttachment, Dn as CommentInput,
|
|
4146
|
+
export { Ut as ActivityTimeline, dn as CommentAttachment, Dn as CommentInput, kt as DETAIL_DEFAULT_TRANSLATIONS, jt as DetailSection, Mt as DetailTabs, Gt as DetailView, $t as DiffView, mn as FieldChangeItem, Ft as HeaderHighlight, Kt as InlineCreateRelated, On as MentionAutocomplete, pn as PointInTimeRestore, gn as ReactionPicker, Tn as RecordActivityTimeline, En as RecordChatterPanel, Lt as RecordComments, en as RecordNavigationEnhanced, Nt as RelatedList, sn as RelationshipGraph, Jt as RichTextCommentInput, Pt as SectionGroup, yn as SubscriptionToggle, vn as ThreadedReplies, Et as applyAutoSpan, Dt as applyDetailAutoLayout, kn as createMentionFromSuggestion, Ot as createSafeTranslationHook, Tt as inferDetailColumns, wt as isWideFieldType, $ as useDetailTranslation };
|