@declarion/react 0.86.0 → 0.88.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/dist-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useSchema as e } from "../../hooks/useSchema.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { executeAction as t } from "../../api/data.js";
|
|
3
|
+
import { downloadFile as n, isMissingArtifactError as r } from "../../lib/download.js";
|
|
4
|
+
import { failureTitle as i } from "../../lib/failure.js";
|
|
5
|
+
import { Icon as a } from "../primitives/Icons.js";
|
|
6
|
+
import { Btn as o } from "../primitives/Btn.js";
|
|
7
|
+
import { useText as s } from "../../hooks/useText.js";
|
|
8
|
+
import { SectionCard as c } from "../primitives/SectionCard.js";
|
|
9
9
|
import { RECORD_DOCUMENTS_KEY as l } from "../../lib/record-documents-key.js";
|
|
10
10
|
import { useState as u } from "react";
|
|
11
11
|
import { useQuery as d, useQueryClient as f } from "@tanstack/react-query";
|
|
@@ -15,35 +15,35 @@ var h = 4e3, g = "pdf";
|
|
|
15
15
|
function _(e) {
|
|
16
16
|
return e?.some((e) => e.status === "pending") ? h : !1;
|
|
17
17
|
}
|
|
18
|
-
function v({ entityCode: e, objectId: n, canGenerateOne:
|
|
19
|
-
let u =
|
|
18
|
+
function v({ entityCode: e, objectId: n, canGenerateOne: r, canManageTemplates: o }) {
|
|
19
|
+
let u = s(), f = s("errors"), { data: h, isLoading: g, error: v } = d({
|
|
20
20
|
queryKey: [
|
|
21
21
|
l,
|
|
22
22
|
e,
|
|
23
23
|
n
|
|
24
24
|
],
|
|
25
|
-
queryFn: async () => (await
|
|
25
|
+
queryFn: async () => (await t("document.object_links", {
|
|
26
26
|
entity: e,
|
|
27
27
|
object_id: n
|
|
28
28
|
})).result?.documents ?? [],
|
|
29
|
-
enabled: !!(e && n) && (!!
|
|
29
|
+
enabled: !!(e && n) && (!!r || !!o),
|
|
30
30
|
refetchInterval: (e) => _(e.state.data)
|
|
31
31
|
}), S = (h?.length ?? 0) > 0;
|
|
32
|
-
return !
|
|
32
|
+
return !r && !S ? null : /* @__PURE__ */ m(c, {
|
|
33
33
|
title: /* @__PURE__ */ p(y, {}),
|
|
34
34
|
collapsible: !1,
|
|
35
35
|
padding: "0",
|
|
36
36
|
children: [
|
|
37
37
|
g && /* @__PURE__ */ p(x, {
|
|
38
|
-
icon: /* @__PURE__ */ p(
|
|
38
|
+
icon: /* @__PURE__ */ p(a.loader, { size: 14 }),
|
|
39
39
|
text: u("document.panel.loading", "Loading documents...")
|
|
40
40
|
}),
|
|
41
41
|
v && /* @__PURE__ */ p(x, {
|
|
42
|
-
icon: /* @__PURE__ */ p(
|
|
43
|
-
text:
|
|
42
|
+
icon: /* @__PURE__ */ p(a.warning, { size: 14 }),
|
|
43
|
+
text: i(f, v)
|
|
44
44
|
}),
|
|
45
45
|
!g && !v && (h?.length ?? 0) === 0 && /* @__PURE__ */ p(x, {
|
|
46
|
-
icon: /* @__PURE__ */ p(
|
|
46
|
+
icon: /* @__PURE__ */ p(a.file, { size: 14 }),
|
|
47
47
|
text: u("document.panel.empty", "No generated documents")
|
|
48
48
|
}),
|
|
49
49
|
!g && !v && h && h.length > 0 && /* @__PURE__ */ p("div", {
|
|
@@ -61,7 +61,7 @@ function v({ entityCode: e, objectId: n, canGenerateOne: o, canManageTemplates:
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
function y() {
|
|
64
|
-
let e =
|
|
64
|
+
let e = s();
|
|
65
65
|
return /* @__PURE__ */ m("div", {
|
|
66
66
|
style: {
|
|
67
67
|
display: "flex",
|
|
@@ -73,21 +73,21 @@ function y() {
|
|
|
73
73
|
fontWeight: 600,
|
|
74
74
|
color: "var(--text)"
|
|
75
75
|
},
|
|
76
|
-
children: [/* @__PURE__ */ p(
|
|
76
|
+
children: [/* @__PURE__ */ p(a.file, { size: 13 }), e("document.panel.title", "Documents")]
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function b({ entityCode:
|
|
80
|
-
let _ =
|
|
79
|
+
function b({ entityCode: c, objectId: d, doc: h }) {
|
|
80
|
+
let _ = s(), { data: v } = e(), y = _(v?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === h.status)?.name) || h.status, b = s("errors"), x = f(), [S, C] = u(!1), [w, T] = u(!1), [E, D] = u(!1), [O, k] = u(!1), [A, j] = u(null), M = _(h.title) || h.filename || h.template_code, N = h.status === "ready" && h.download_url && !O;
|
|
81
81
|
async function P() {
|
|
82
82
|
C(!0), j(null);
|
|
83
83
|
try {
|
|
84
|
-
let e = (await
|
|
84
|
+
let e = (await t("document.download_format", {
|
|
85
85
|
generated_document_id: h.generated_document_id,
|
|
86
86
|
format: g
|
|
87
87
|
})).result;
|
|
88
|
-
e?.download_url && await
|
|
88
|
+
e?.download_url && await n(b, e.download_url, e.filename);
|
|
89
89
|
} catch (e) {
|
|
90
|
-
|
|
90
|
+
r(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(i(b, e));
|
|
91
91
|
} finally {
|
|
92
92
|
C(!1);
|
|
93
93
|
}
|
|
@@ -96,9 +96,9 @@ function b({ entityCode: i, objectId: d, doc: h }) {
|
|
|
96
96
|
if (h.download_url) {
|
|
97
97
|
T(!0), j(null);
|
|
98
98
|
try {
|
|
99
|
-
await
|
|
99
|
+
await n(b, h.download_url, h.filename);
|
|
100
100
|
} catch (e) {
|
|
101
|
-
|
|
101
|
+
r(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(i(b, e));
|
|
102
102
|
} finally {
|
|
103
103
|
T(!1);
|
|
104
104
|
}
|
|
@@ -107,18 +107,18 @@ function b({ entityCode: i, objectId: d, doc: h }) {
|
|
|
107
107
|
async function I() {
|
|
108
108
|
D(!0), j(null);
|
|
109
109
|
try {
|
|
110
|
-
await
|
|
110
|
+
await t("document.generate", {
|
|
111
111
|
...h.input ?? {},
|
|
112
112
|
template_code: h.template_code,
|
|
113
113
|
template_source: h.template_source,
|
|
114
114
|
output_format: h.output_format
|
|
115
115
|
}), await x.invalidateQueries({ queryKey: [
|
|
116
116
|
l,
|
|
117
|
-
|
|
117
|
+
c,
|
|
118
118
|
d
|
|
119
119
|
] });
|
|
120
120
|
} catch (e) {
|
|
121
|
-
j(
|
|
121
|
+
j(i(b, e));
|
|
122
122
|
} finally {
|
|
123
123
|
D(!1);
|
|
124
124
|
}
|
|
@@ -183,29 +183,29 @@ function b({ entityCode: i, objectId: d, doc: h }) {
|
|
|
183
183
|
display: "flex",
|
|
184
184
|
gap: 6
|
|
185
185
|
},
|
|
186
|
-
children: [/* @__PURE__ */ p(
|
|
186
|
+
children: [/* @__PURE__ */ p(o, {
|
|
187
187
|
kind: "ghost",
|
|
188
188
|
size: "sm",
|
|
189
|
-
icon: p(S ?
|
|
189
|
+
icon: p(S ? a.loader : a.file, { size: 12 }),
|
|
190
190
|
onClick: P,
|
|
191
191
|
disabled: S,
|
|
192
192
|
children: g.toUpperCase()
|
|
193
|
-
}), /* @__PURE__ */ p(
|
|
193
|
+
}), /* @__PURE__ */ p(o, {
|
|
194
194
|
kind: "default",
|
|
195
195
|
size: "sm",
|
|
196
|
-
icon: p(w ?
|
|
196
|
+
icon: p(w ? a.loader : a.download, { size: 12 }),
|
|
197
197
|
onClick: F,
|
|
198
198
|
disabled: w,
|
|
199
199
|
children: _("document.result.download", "Download")
|
|
200
200
|
})]
|
|
201
|
-
}) : O ? /* @__PURE__ */ p(
|
|
201
|
+
}) : O ? /* @__PURE__ */ p(o, {
|
|
202
202
|
kind: "ghost",
|
|
203
203
|
size: "sm",
|
|
204
|
-
icon: p(E ?
|
|
204
|
+
icon: p(E ? a.loader : a.file, { size: 12 }),
|
|
205
205
|
onClick: I,
|
|
206
206
|
disabled: E,
|
|
207
207
|
children: _("document.row.regenerate", "Regenerate")
|
|
208
|
-
}) : /* @__PURE__ */ p(
|
|
208
|
+
}) : /* @__PURE__ */ p(o, {
|
|
209
209
|
kind: "ghost",
|
|
210
210
|
size: "sm",
|
|
211
211
|
disabled: !0,
|
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { formatOffsetTimestamp as e } from "../../lib/timestamp.js";
|
|
2
|
+
import { resolveRefRecordLabel as t } from "../../types/schema.js";
|
|
3
|
+
import { useSchema as n } from "../../hooks/useSchema.js";
|
|
4
|
+
import { executeAction as r } from "../../api/data.js";
|
|
5
|
+
import { failureTitle as i } from "../../lib/failure.js";
|
|
6
|
+
import { Icon as a } from "../primitives/Icons.js";
|
|
7
|
+
import { Btn as o } from "../primitives/Btn.js";
|
|
8
|
+
import { useText as s } from "../../hooks/useText.js";
|
|
9
|
+
import { SectionCard as c } from "../primitives/SectionCard.js";
|
|
10
|
+
import { FieldLabel as l, TextArea as u } from "../primitives/Fields.js";
|
|
11
|
+
import { PanelState as d } from "./RecordDocumentsPanel.js";
|
|
12
|
+
import { useId as f, useState as p } from "react";
|
|
13
|
+
import { useQuery as m, useQueryClient as h } from "@tanstack/react-query";
|
|
14
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
15
|
//#region src/components/pages/RecordNotesPanel.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let
|
|
16
|
+
var v = "record-notes";
|
|
17
|
+
function y({ entityCode: y, objectId: x }) {
|
|
18
|
+
let S = s(), C = s("errors"), { data: w } = n(), T = h(), E = !!w?.actions?.["record_note.list"], D = !!w?.actions?.["record_note.add"], O = !!w?.actions?.["record_note.remove"], [k, A] = p(!1), [j, M] = p(""), [N, P] = p(!1), [F, I] = p(null), L = f(), { data: R, isLoading: z, error: B } = m({
|
|
18
19
|
queryKey: [
|
|
19
|
-
_,
|
|
20
20
|
v,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
y,
|
|
22
|
+
x,
|
|
23
|
+
k
|
|
23
24
|
],
|
|
24
25
|
queryFn: async () => {
|
|
25
|
-
let e = await
|
|
26
|
+
let e = await r("record_note.list", {
|
|
26
27
|
target: {
|
|
27
|
-
entity:
|
|
28
|
-
id:
|
|
28
|
+
entity: y,
|
|
29
|
+
id: x
|
|
29
30
|
},
|
|
30
|
-
include_superseded:
|
|
31
|
+
include_superseded: k
|
|
31
32
|
});
|
|
32
33
|
return {
|
|
33
34
|
notes: e.result?.notes ?? [],
|
|
34
35
|
refs: e.result?.$refs ?? {}
|
|
35
36
|
};
|
|
36
37
|
},
|
|
37
|
-
enabled:
|
|
38
|
+
enabled: E && !!(y && x)
|
|
38
39
|
});
|
|
39
|
-
if (!
|
|
40
|
-
let
|
|
41
|
-
let i =
|
|
42
|
-
return i ?
|
|
40
|
+
if (!E) return null;
|
|
41
|
+
let V = (e, n, r) => {
|
|
42
|
+
let i = R?.refs?.[e]?.[n];
|
|
43
|
+
return i ? t(S, i, r ?? "$display", n) : n;
|
|
43
44
|
};
|
|
44
|
-
async function
|
|
45
|
-
|
|
45
|
+
async function H(e, t) {
|
|
46
|
+
P(!0), I(null);
|
|
46
47
|
try {
|
|
47
|
-
return await
|
|
48
|
-
_,
|
|
48
|
+
return await r(e, t), await T.invalidateQueries({ queryKey: [
|
|
49
49
|
v,
|
|
50
|
-
|
|
50
|
+
y,
|
|
51
|
+
x
|
|
51
52
|
] }), !0;
|
|
52
53
|
} catch (e) {
|
|
53
|
-
return
|
|
54
|
+
return I(i(C, e)), !1;
|
|
54
55
|
} finally {
|
|
55
|
-
|
|
56
|
+
P(!1);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
async function
|
|
59
|
-
|
|
59
|
+
async function U() {
|
|
60
|
+
j.trim() !== "" && await H("record_note.add", {
|
|
60
61
|
target: {
|
|
61
|
-
entity:
|
|
62
|
-
id:
|
|
62
|
+
entity: y,
|
|
63
|
+
id: x
|
|
63
64
|
},
|
|
64
|
-
body:
|
|
65
|
-
}) &&
|
|
65
|
+
body: j
|
|
66
|
+
}) && M("");
|
|
66
67
|
}
|
|
67
|
-
let
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
title: /* @__PURE__ */
|
|
68
|
+
let W = R?.notes ?? [];
|
|
69
|
+
return /* @__PURE__ */ _(c, {
|
|
70
|
+
title: /* @__PURE__ */ g(b, {}),
|
|
70
71
|
collapsible: !1,
|
|
71
72
|
padding: "0",
|
|
72
73
|
children: [
|
|
73
|
-
|
|
74
|
-
icon: /* @__PURE__ */
|
|
75
|
-
text:
|
|
74
|
+
z && /* @__PURE__ */ g(d, {
|
|
75
|
+
icon: /* @__PURE__ */ g(a.loader, { size: 14 }),
|
|
76
|
+
text: S("record.notes.loading", "Loading notes...")
|
|
76
77
|
}),
|
|
77
|
-
|
|
78
|
-
icon: /* @__PURE__ */
|
|
79
|
-
text:
|
|
78
|
+
B && /* @__PURE__ */ g(d, {
|
|
79
|
+
icon: /* @__PURE__ */ g(a.warning, { size: 14 }),
|
|
80
|
+
text: i(C, B)
|
|
80
81
|
}),
|
|
81
|
-
!
|
|
82
|
-
icon: /* @__PURE__ */
|
|
83
|
-
text:
|
|
82
|
+
!z && !B && W.length === 0 && /* @__PURE__ */ g(d, {
|
|
83
|
+
icon: /* @__PURE__ */ g(a.file, { size: 14 }),
|
|
84
|
+
text: S("record.notes.empty", "No notes")
|
|
84
85
|
}),
|
|
85
|
-
!
|
|
86
|
+
!z && !B && W.map((t) => /* @__PURE__ */ _("div", {
|
|
86
87
|
"data-testid": "record-note",
|
|
87
88
|
style: {
|
|
88
89
|
display: "flex",
|
|
@@ -90,44 +91,44 @@ function v({ entityCode: v, objectId: b }) {
|
|
|
90
91
|
alignItems: "flex-start",
|
|
91
92
|
padding: "10px 14px",
|
|
92
93
|
borderTop: "1px solid var(--border)",
|
|
93
|
-
opacity:
|
|
94
|
+
opacity: t.superseded_by_note_id ? .6 : 1
|
|
94
95
|
},
|
|
95
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ _("div", {
|
|
96
97
|
style: {
|
|
97
98
|
flex: 1,
|
|
98
99
|
minWidth: 0
|
|
99
100
|
},
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ g("div", {
|
|
101
102
|
style: {
|
|
102
103
|
fontSize: 13,
|
|
103
104
|
whiteSpace: "pre-wrap",
|
|
104
105
|
overflowWrap: "anywhere"
|
|
105
106
|
},
|
|
106
|
-
children:
|
|
107
|
-
}), /* @__PURE__ */
|
|
107
|
+
children: t.body
|
|
108
|
+
}), /* @__PURE__ */ g("div", {
|
|
108
109
|
style: {
|
|
109
110
|
marginTop: 4,
|
|
110
111
|
fontSize: 12,
|
|
111
112
|
color: "var(--text-3)"
|
|
112
113
|
},
|
|
113
114
|
children: [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
V("user", t.author_user_id),
|
|
116
|
+
t.agent_id ? S("record.notes.via_agent", "via {agent}", { agent: V("agent", t.agent_id, "code") }) : null,
|
|
117
|
+
t.acted_for ? S("record.notes.acted_for", "for {who}", { who: V(t.acted_for.entity, t.acted_for.id) }) : null,
|
|
118
|
+
e(t.created_at, { zone: S.timeZone }),
|
|
119
|
+
t.superseded_by_note_id ? S("record.notes.replaced", "replaced") : null
|
|
119
120
|
].filter(Boolean).join(" · ")
|
|
120
121
|
})]
|
|
121
|
-
}),
|
|
122
|
+
}), O && /* @__PURE__ */ g(o, {
|
|
122
123
|
kind: "ghost",
|
|
123
124
|
size: "sm",
|
|
124
|
-
icon: /* @__PURE__ */
|
|
125
|
-
disabled:
|
|
126
|
-
onClick: () =>
|
|
127
|
-
children:
|
|
125
|
+
icon: /* @__PURE__ */ g(a.trash, { size: 12 }),
|
|
126
|
+
disabled: N,
|
|
127
|
+
onClick: () => H("record_note.remove", { note_id: t.id }),
|
|
128
|
+
children: S("record.notes.remove", "Remove")
|
|
128
129
|
})]
|
|
129
|
-
},
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
}, t.id)),
|
|
131
|
+
/* @__PURE__ */ _("div", {
|
|
131
132
|
style: {
|
|
132
133
|
display: "flex",
|
|
133
134
|
flexDirection: "column",
|
|
@@ -136,53 +137,53 @@ function v({ entityCode: v, objectId: b }) {
|
|
|
136
137
|
borderTop: "1px solid var(--border)"
|
|
137
138
|
},
|
|
138
139
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(o, {
|
|
140
141
|
kind: "ghost",
|
|
141
142
|
size: "sm",
|
|
142
|
-
onClick: () =>
|
|
143
|
-
children:
|
|
143
|
+
onClick: () => A((e) => !e),
|
|
144
|
+
children: k ? S("record.notes.hide_replaced", "Hide replaced notes") : S("record.notes.show_replaced", "Show replaced notes")
|
|
144
145
|
}) }),
|
|
145
|
-
|
|
146
|
+
D && /* @__PURE__ */ _("div", {
|
|
146
147
|
style: {
|
|
147
148
|
display: "flex",
|
|
148
149
|
flexDirection: "column",
|
|
149
150
|
gap: 6
|
|
150
151
|
},
|
|
151
152
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
htmlFor:
|
|
154
|
-
children:
|
|
153
|
+
/* @__PURE__ */ g(l, {
|
|
154
|
+
htmlFor: L,
|
|
155
|
+
children: S("record.notes.new", "New note")
|
|
155
156
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
id:
|
|
158
|
-
value:
|
|
159
|
-
onChange:
|
|
157
|
+
/* @__PURE__ */ g(u, {
|
|
158
|
+
id: L,
|
|
159
|
+
value: j,
|
|
160
|
+
onChange: M,
|
|
160
161
|
rows: 2
|
|
161
162
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(o, {
|
|
163
164
|
kind: "default",
|
|
164
165
|
size: "sm",
|
|
165
|
-
disabled:
|
|
166
|
-
onClick:
|
|
167
|
-
children:
|
|
166
|
+
disabled: N || j.trim() === "",
|
|
167
|
+
onClick: U,
|
|
168
|
+
children: S("record.notes.add", "Add note")
|
|
168
169
|
}) })
|
|
169
170
|
]
|
|
170
171
|
}),
|
|
171
|
-
|
|
172
|
+
F && /* @__PURE__ */ g("div", {
|
|
172
173
|
style: {
|
|
173
174
|
color: "var(--danger)",
|
|
174
175
|
fontSize: 12
|
|
175
176
|
},
|
|
176
|
-
children:
|
|
177
|
+
children: F
|
|
177
178
|
})
|
|
178
179
|
]
|
|
179
180
|
})
|
|
180
181
|
]
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
let e =
|
|
185
|
-
return /* @__PURE__ */
|
|
184
|
+
function b() {
|
|
185
|
+
let e = s();
|
|
186
|
+
return /* @__PURE__ */ _("div", {
|
|
186
187
|
style: {
|
|
187
188
|
display: "flex",
|
|
188
189
|
alignItems: "center",
|
|
@@ -193,8 +194,8 @@ function y() {
|
|
|
193
194
|
fontWeight: 600,
|
|
194
195
|
color: "var(--text)"
|
|
195
196
|
},
|
|
196
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ g(a.file, { size: 13 }), e("record.notes.title", "Notes")]
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
//#endregion
|
|
200
|
-
export {
|
|
201
|
+
export { y as RecordNotesPanel };
|