@declarion/react 0.445.0 → 0.516.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/components/agents/AgentChatPanel.impl.js +349 -332
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
- package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
- package/dist-lib/components/detail-layout/FieldRow.js +56 -60
- package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
- package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
- package/dist-lib/components/detail-layout/labelLayout.js +35 -0
- package/dist-lib/components/fields/JsonField.js +128 -125
- package/dist-lib/components/fields/StringField.js +10 -25
- package/dist-lib/components/fields/StructureField.js +125 -167
- package/dist-lib/components/fields/ValueRows.js +114 -0
- package/dist-lib/components/fields/cells/factories/id.js +10 -0
- package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
- package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
- package/dist-lib/components/fields/cells/registry.js +25 -23
- package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
- package/dist-lib/components/file-widgets/helpers.js +32 -19
- package/dist-lib/components/file-widgets/host.js +4 -1
- package/dist-lib/components/list/PeekFieldCell.js +57 -55
- package/dist-lib/components/list/QuickPeek.js +109 -121
- package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
- package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
- package/dist-lib/components/pages/list/ListCardRow.js +101 -100
- package/dist-lib/components/pages/list/cardProjection.js +117 -112
- package/dist-lib/components/pages/list/useListQuery.js +1 -1
- package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
- package/dist-lib/components/primitives/IdBadge.js +27 -0
- package/dist-lib/components/primitives/RowField.js +11 -43
- package/dist-lib/components/shared/CopyButton.js +13 -18
- package/dist-lib/components/shared/RefChip.js +33 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.js +134 -110
- package/dist-lib/hooks/useCopy.js +18 -0
- package/dist-lib/index.d.ts +55 -20
- package/dist-lib/index.js +116 -111
- package/dist-lib/lib/realtime-reconcile.js +70 -59
- package/dist-lib/lib/reference.js +52 -34
- package/dist-lib/lib/short-id.js +12 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/schema.js +84 -80
- package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
- package/package.json +1 -1
- package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Check as e } from "../../primitives/Check.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { IdBadge as t } from "../../primitives/IdBadge.js";
|
|
3
|
+
import { Pill as n, pillColor as r } from "../../primitives/Pill.js";
|
|
4
|
+
import { getSchemaFieldValue as i, renderSchemaField as a, resolveSchemaFieldLabel as o } from "../../file-widgets/host.js";
|
|
5
|
+
import { coerceDisplayString as s } from "../../../lib/display-value.js";
|
|
6
|
+
import { effectiveScreenForRecord as c } from "../../../lib/variants.js";
|
|
7
|
+
import { getDisplayValue as l } from "../../../types/schema.js";
|
|
8
|
+
import { RowActionsCell as u } from "./RowActionsCell.js";
|
|
9
|
+
import { resolveCard as d } from "./cardProjection.js";
|
|
10
|
+
import { useText as f } from "../../../hooks/useText.js";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
12
|
// src/components/pages/list/ListCardRow.tsx
|
|
12
|
-
function
|
|
13
|
+
function h(e, t, n, r) {
|
|
13
14
|
if (t.startsWith("$status.")) {
|
|
14
15
|
let r = t.slice(8), i = n.status_groups?.[r];
|
|
15
16
|
return i ? e(i.name) || r : t;
|
|
@@ -18,140 +19,140 @@ function m(e, t, n, r) {
|
|
|
18
19
|
let r = t.slice(10), i = n.properties?.[r];
|
|
19
20
|
return i ? e(i.name) || r : t;
|
|
20
21
|
}
|
|
21
|
-
return
|
|
22
|
+
return o(e, n, t, r);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function g(e, t, n) {
|
|
24
25
|
if (e.startsWith("$status.")) {
|
|
25
26
|
let n = e.slice(8), r = t.$statuses;
|
|
26
27
|
return Array.isArray(r) && r.some((e) => e.group_code === n);
|
|
27
28
|
}
|
|
28
29
|
if (e.startsWith("$property.")) {
|
|
29
30
|
let n = e.slice(10), r = t.$properties, i = Array.isArray(r) ? r.find((e) => e.property_code === n) : void 0;
|
|
30
|
-
return i?.value != null &&
|
|
31
|
+
return i?.value != null && s(i.value) !== "";
|
|
31
32
|
}
|
|
32
|
-
let
|
|
33
|
-
return
|
|
33
|
+
let r = i(n, t, e);
|
|
34
|
+
return r != null && s(r) !== "";
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
let { entity:
|
|
36
|
+
function _(e, t, i) {
|
|
37
|
+
let { entity: o, entityCode: c, refs: l, t: u, renderers: d } = i;
|
|
37
38
|
if (e.startsWith("$status.")) {
|
|
38
|
-
let i = e.slice(8), a =
|
|
39
|
-
if (!a || !c) return /* @__PURE__ */
|
|
39
|
+
let i = e.slice(8), a = o.status_groups?.[i], s = t.$statuses, c = Array.isArray(s) ? s.find((e) => e.group_code === i) : void 0;
|
|
40
|
+
if (!a || !c) return /* @__PURE__ */ p("span", {
|
|
40
41
|
style: { color: "var(--text-3)" },
|
|
41
42
|
children: "-"
|
|
42
43
|
});
|
|
43
44
|
let l = a.statuses.find((e) => e.code === c.status_code);
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
tone:
|
|
45
|
+
return /* @__PURE__ */ p(n, {
|
|
46
|
+
tone: r(l?.color),
|
|
46
47
|
size: "xs",
|
|
47
48
|
children: u(l?.name) || c.status_code
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
if (e.startsWith("$property.")) {
|
|
51
|
-
let
|
|
52
|
-
return !i || i.value == null ? /* @__PURE__ */
|
|
52
|
+
let n = e.slice(10), r = t.$properties, i = Array.isArray(r) ? r.find((e) => e.property_code === n) : void 0;
|
|
53
|
+
return !i || i.value == null ? /* @__PURE__ */ p("span", {
|
|
53
54
|
style: { color: "var(--text-3)" },
|
|
54
55
|
children: "-"
|
|
55
|
-
}) : /* @__PURE__ */
|
|
56
|
+
}) : /* @__PURE__ */ p("span", { children: s(i.value) });
|
|
56
57
|
}
|
|
57
|
-
if (
|
|
58
|
-
entity:
|
|
58
|
+
if (o.files?.get(e)) return a({
|
|
59
|
+
entity: o,
|
|
59
60
|
entityCode: c,
|
|
60
61
|
fieldName: e,
|
|
61
|
-
record:
|
|
62
|
+
record: t,
|
|
62
63
|
mode: "display",
|
|
63
64
|
surface: "list",
|
|
64
65
|
refs: l,
|
|
65
66
|
t: u
|
|
66
67
|
});
|
|
67
|
-
let
|
|
68
|
-
if (!
|
|
69
|
-
let
|
|
70
|
-
return
|
|
68
|
+
let f = d.get(e);
|
|
69
|
+
if (!f) {
|
|
70
|
+
let n = t[e];
|
|
71
|
+
return s(n) || /* @__PURE__ */ p("span", {
|
|
71
72
|
style: { color: "var(--text-3)" },
|
|
72
73
|
children: "-"
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
|
-
return
|
|
76
|
+
return f(t[e], t);
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
entity:
|
|
80
|
-
entityCode:
|
|
81
|
-
refs:
|
|
82
|
-
t:
|
|
83
|
-
renderers:
|
|
84
|
-
},
|
|
85
|
-
entity:
|
|
86
|
-
screen:
|
|
87
|
-
savedViewColumns:
|
|
88
|
-
}),
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
"data-index":
|
|
78
|
+
function v({ row: n, rowIndex: r, entity: i, screen: a, entityCode: o, entities: s, savedViewColumns: v, refs: y, renderers: b, rowActions: x, tabNavigate: S, interaction: C, hasSoftDelete: w, zebra: T, hasBatchActions: E, hasDetailTarget: D, rowKey: O, measureElement: k }) {
|
|
79
|
+
let A = f(), j = {
|
|
80
|
+
entity: i,
|
|
81
|
+
entityCode: o,
|
|
82
|
+
refs: y,
|
|
83
|
+
t: A,
|
|
84
|
+
renderers: b
|
|
85
|
+
}, M = n.original, N = c(i, a, M), P = d({
|
|
86
|
+
entity: i,
|
|
87
|
+
screen: N,
|
|
88
|
+
savedViewColumns: v
|
|
89
|
+
}), F = w && M[i.soft_delete] != null, I = n.getIsSelected(), L = T && r % 2 == 1, R = D || C.peekAllowed, z = (P.titleUsesDisplay ? l(A, M, i) : null) || (P.titleField ? _(P.titleField, M, j) : /* @__PURE__ */ p(t, { value: O(M) })), B = P.subtitleField && (P.explicit || g(P.subtitleField, M, i)) ? P.subtitleField : void 0, V = P.badgeFields.filter((e) => !P.hideEmptyFields || g(e, M, i)), H = P.bodyFields.filter((e) => !P.hideEmptyFields || g(e, M, i)), U = P.metaFields.filter((e) => !P.hideEmptyFields || g(e, M, i));
|
|
90
|
+
return /* @__PURE__ */ p("div", {
|
|
91
|
+
"data-index": r,
|
|
91
92
|
"data-testid": "list-card",
|
|
92
|
-
ref: (e) =>
|
|
93
|
+
ref: (e) => k(e),
|
|
93
94
|
style: {
|
|
94
95
|
padding: "6px 10px",
|
|
95
96
|
boxSizing: "border-box"
|
|
96
97
|
},
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ m("div", {
|
|
98
99
|
className: "sl-list-card-surface",
|
|
99
|
-
"data-row-stripe":
|
|
100
|
-
"aria-selected":
|
|
100
|
+
"data-row-stripe": L ? "" : void 0,
|
|
101
|
+
"aria-selected": I,
|
|
101
102
|
style: {
|
|
102
103
|
display: "grid",
|
|
103
|
-
gridTemplateColumns:
|
|
104
|
+
gridTemplateColumns: E ? "28px minmax(0, 1fr) auto" : "minmax(0, 1fr) auto",
|
|
104
105
|
gap: 8,
|
|
105
106
|
alignItems: "start",
|
|
106
107
|
width: "100%",
|
|
107
108
|
boxSizing: "border-box",
|
|
108
109
|
borderRadius: "var(--radius-md)",
|
|
109
|
-
opacity:
|
|
110
|
-
fontStyle:
|
|
110
|
+
opacity: F ? .56 : 1,
|
|
111
|
+
fontStyle: F ? "italic" : "normal",
|
|
111
112
|
padding: "12px",
|
|
112
|
-
cursor:
|
|
113
|
+
cursor: R ? "pointer" : "default"
|
|
113
114
|
},
|
|
114
|
-
tabIndex:
|
|
115
|
-
onClick:
|
|
116
|
-
onKeyDown:
|
|
117
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
115
|
+
tabIndex: R ? 0 : void 0,
|
|
116
|
+
onClick: R ? (e) => C.onRowClick(e, M) : void 0,
|
|
117
|
+
onKeyDown: R ? (e) => {
|
|
118
|
+
e.key === "Enter" && (e.preventDefault(), C.peekAllowed ? C.setPeekRow(M) : C.navigateToDetail(M));
|
|
118
119
|
} : void 0,
|
|
119
120
|
onContextMenu: (e) => {
|
|
120
|
-
e.preventDefault(),
|
|
121
|
+
e.preventDefault(), C.setContextMenu({
|
|
121
122
|
x: e.clientX,
|
|
122
123
|
y: e.clientY,
|
|
123
|
-
row:
|
|
124
|
+
row: M
|
|
124
125
|
});
|
|
125
126
|
},
|
|
126
|
-
...
|
|
127
|
+
...C.longPress.handlers,
|
|
127
128
|
onPointerDown: (e) => {
|
|
128
|
-
|
|
129
|
+
C.pressedRow.current = M, C.longPress.handlers.onPointerDown(e);
|
|
129
130
|
},
|
|
130
131
|
children: [
|
|
131
|
-
|
|
132
|
+
E && /* @__PURE__ */ p("span", {
|
|
132
133
|
"data-testid": "row-select-checkbox",
|
|
133
134
|
style: { paddingTop: 2 },
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
checked:
|
|
136
|
-
onChange: () =>
|
|
135
|
+
children: /* @__PURE__ */ p(e, {
|
|
136
|
+
checked: I,
|
|
137
|
+
onChange: () => n.toggleSelected()
|
|
137
138
|
})
|
|
138
139
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ m("div", {
|
|
140
141
|
style: { minWidth: 0 },
|
|
141
142
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ p("div", {
|
|
143
144
|
style: {
|
|
144
145
|
display: "flex",
|
|
145
146
|
alignItems: "flex-start",
|
|
146
147
|
gap: 8,
|
|
147
148
|
minWidth: 0
|
|
148
149
|
},
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ m("div", {
|
|
150
151
|
style: {
|
|
151
152
|
minWidth: 0,
|
|
152
153
|
flex: 1
|
|
153
154
|
},
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ p("div", {
|
|
155
156
|
style: {
|
|
156
157
|
fontSize: 14,
|
|
157
158
|
lineHeight: 1.25,
|
|
@@ -159,8 +160,8 @@ function _({ row: t, rowIndex: n, entity: r, screen: i, entityCode: a, entities:
|
|
|
159
160
|
color: "var(--text)",
|
|
160
161
|
overflowWrap: "anywhere"
|
|
161
162
|
},
|
|
162
|
-
children:
|
|
163
|
-
}),
|
|
163
|
+
children: z
|
|
164
|
+
}), B && /* @__PURE__ */ p("div", {
|
|
164
165
|
style: {
|
|
165
166
|
marginTop: 3,
|
|
166
167
|
fontSize: 12.5,
|
|
@@ -168,26 +169,26 @@ function _({ row: t, rowIndex: n, entity: r, screen: i, entityCode: a, entities:
|
|
|
168
169
|
color: "var(--text-3)",
|
|
169
170
|
overflowWrap: "anywhere"
|
|
170
171
|
},
|
|
171
|
-
children:
|
|
172
|
+
children: _(B, M, j)
|
|
172
173
|
})]
|
|
173
174
|
})
|
|
174
175
|
}),
|
|
175
|
-
|
|
176
|
+
V.length > 0 && /* @__PURE__ */ p("div", {
|
|
176
177
|
style: {
|
|
177
178
|
display: "flex",
|
|
178
179
|
flexWrap: "wrap",
|
|
179
180
|
gap: 6,
|
|
180
181
|
marginTop: 10
|
|
181
182
|
},
|
|
182
|
-
children:
|
|
183
|
+
children: V.map((e) => /* @__PURE__ */ p("span", {
|
|
183
184
|
style: {
|
|
184
185
|
display: "inline-flex",
|
|
185
186
|
minWidth: 0
|
|
186
187
|
},
|
|
187
|
-
children:
|
|
188
|
+
children: _(e, M, j)
|
|
188
189
|
}, e))
|
|
189
190
|
}),
|
|
190
|
-
|
|
191
|
+
H.length > 0 && /* @__PURE__ */ p("dl", {
|
|
191
192
|
style: {
|
|
192
193
|
display: "grid",
|
|
193
194
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -196,23 +197,23 @@ function _({ row: t, rowIndex: n, entity: r, screen: i, entityCode: a, entities:
|
|
|
196
197
|
fontSize: 12.5,
|
|
197
198
|
lineHeight: 1.35
|
|
198
199
|
},
|
|
199
|
-
children:
|
|
200
|
+
children: H.map((e) => /* @__PURE__ */ m("div", {
|
|
200
201
|
style: { display: "contents" },
|
|
201
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ p("dt", {
|
|
202
203
|
style: { color: "var(--text-3)" },
|
|
203
|
-
children:
|
|
204
|
-
}), /* @__PURE__ */
|
|
204
|
+
children: h(A, e, i, s)
|
|
205
|
+
}), /* @__PURE__ */ p("dd", {
|
|
205
206
|
style: {
|
|
206
207
|
margin: 0,
|
|
207
208
|
color: "var(--text-2)",
|
|
208
209
|
minWidth: 0,
|
|
209
210
|
overflowWrap: "anywhere"
|
|
210
211
|
},
|
|
211
|
-
children:
|
|
212
|
+
children: _(e, M, j)
|
|
212
213
|
})]
|
|
213
214
|
}, e))
|
|
214
215
|
}),
|
|
215
|
-
|
|
216
|
+
U.length > 0 && /* @__PURE__ */ p("div", {
|
|
216
217
|
style: {
|
|
217
218
|
display: "flex",
|
|
218
219
|
flexWrap: "wrap",
|
|
@@ -221,35 +222,35 @@ function _({ row: t, rowIndex: n, entity: r, screen: i, entityCode: a, entities:
|
|
|
221
222
|
color: "var(--text-3)",
|
|
222
223
|
fontSize: 11.5
|
|
223
224
|
},
|
|
224
|
-
children:
|
|
225
|
+
children: U.map((e) => /* @__PURE__ */ m("span", {
|
|
225
226
|
style: {
|
|
226
227
|
minWidth: 0,
|
|
227
228
|
overflowWrap: "anywhere"
|
|
228
229
|
},
|
|
229
230
|
children: [
|
|
230
|
-
|
|
231
|
+
h(A, e, i, s),
|
|
231
232
|
": ",
|
|
232
|
-
|
|
233
|
+
_(e, M, j)
|
|
233
234
|
]
|
|
234
235
|
}, e))
|
|
235
236
|
})
|
|
236
237
|
]
|
|
237
238
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
row:
|
|
240
|
-
rowId:
|
|
241
|
-
screen:
|
|
242
|
-
fullScreen:
|
|
243
|
-
entity:
|
|
244
|
-
entityCode:
|
|
245
|
-
rowActions:
|
|
246
|
-
tabNavigate:
|
|
247
|
-
peekAllowed:
|
|
248
|
-
hasDetailTarget:
|
|
249
|
-
onPeek:
|
|
239
|
+
/* @__PURE__ */ p(u, {
|
|
240
|
+
row: M,
|
|
241
|
+
rowId: O(M),
|
|
242
|
+
screen: a,
|
|
243
|
+
fullScreen: a,
|
|
244
|
+
entity: i,
|
|
245
|
+
entityCode: o,
|
|
246
|
+
rowActions: x,
|
|
247
|
+
tabNavigate: S,
|
|
248
|
+
peekAllowed: C.peekAllowed,
|
|
249
|
+
hasDetailTarget: D,
|
|
250
|
+
onPeek: C.setPeekRow
|
|
250
251
|
})
|
|
251
252
|
]
|
|
252
253
|
})
|
|
253
|
-
},
|
|
254
|
+
}, n.id);
|
|
254
255
|
}
|
|
255
|
-
export {
|
|
256
|
+
export { v as ListCardRow };
|