@declarion/react 0.81.0 → 0.83.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/actions/ObjectActionBar.js +56 -54
- package/dist-lib/components/actions/PropertyGridEditor.js +56 -53
- package/dist-lib/components/actions/RowActionsKebab.js +51 -49
- package/dist-lib/components/detail-layout/AssociatedBlock.js +385 -383
- package/dist-lib/components/list/QuickPeek.js +77 -75
- package/dist-lib/components/pages/SmartDetailPage.impl.js +484 -458
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +207 -206
- package/dist-lib/components/pages/list/DataCell.js +15 -15
- package/dist-lib/components/pages/list/ListFloatbar.js +55 -53
- package/dist-lib/components/pages/list/ListHeader.js +54 -52
- package/dist-lib/components/pages/list/ListTable.js +64 -64
- package/dist-lib/components/pages/list/cardProjection.js +85 -80
- package/dist-lib/components/pages/list/column-sizing.js +11 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.js +29 -78
- package/dist-lib/components/pages/list/useListRowInteraction.js +78 -76
- package/dist-lib/components/pages/list/useRowMenu.js +60 -58
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +341 -262
- package/dist-lib/components/params/ParamsBlock.js +59 -59
- package/dist-lib/components/params/param-editors.js +114 -99
- package/dist-lib/components/shared/ConfirmDialog.js +33 -66
- package/dist-lib/components/shared/ModalFrame.js +53 -0
- package/dist-lib/hooks/useRefRecords.js +73 -0
- package/dist-lib/hooks/useRowTenant.js +12 -0
- package/dist-lib/index.d.ts +4 -3
- package/dist-lib/lib/actions.js +105 -89
- package/dist-lib/lib/mass-edit.js +13 -13
- package/dist-lib/types/schema.js +29 -22
- package/package.json +1 -1
|
@@ -9,51 +9,53 @@ import { applyRowState as s, defaultFlatForSlot as c, filterLayoutForSlot as l }
|
|
|
9
9
|
import { useActionRunner as u } from "../actions/ActionRunner.js";
|
|
10
10
|
import { renderSchemaField as d } from "../file-widgets/host.js";
|
|
11
11
|
import { ResponsiveActionBar as f } from "../actions/ResponsiveActionBar.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
12
|
+
import { useRowTenant as p } from "../../hooks/useRowTenant.js";
|
|
13
|
+
import { effectiveScreenForRecord as m, variantActionCodesForRecord as h } from "../../lib/variants.js";
|
|
14
|
+
import { PeekFieldCell as g } from "./PeekFieldCell.js";
|
|
15
|
+
import { useUnsavedInput as _ } from "../../hooks/useUnsavedInput.js";
|
|
16
|
+
import { useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
17
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
17
18
|
//#region src/components/list/QuickPeek.tsx
|
|
18
|
-
var
|
|
19
|
+
var T = {
|
|
19
20
|
tab: "Tab",
|
|
20
21
|
esc: "Esc"
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
-
let H = o(),
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
|
|
23
|
+
function E({ entity: E, entityCode: O, record: k, title: A, recordId: j, avatarName: ee, fields: M, refs: N, screen: P, actions: F, screenActionLayout: I, entityActionLayout: L, executeAction: R, onClose: z, onOpen: B, onSave: V }) {
|
|
24
|
+
let H = o(), U = p(E), [W, G] = x({ ...k }), [K, q] = x(!1);
|
|
25
|
+
_(K);
|
|
26
|
+
let J = b(null), { run: Y } = u(), X = m(E, P, W);
|
|
27
|
+
v(() => {
|
|
28
|
+
G({ ...k }), q(!1);
|
|
29
|
+
}, [k]), v(() => {
|
|
30
|
+
J.current?.focus();
|
|
30
31
|
}, []);
|
|
31
|
-
let
|
|
32
|
-
let e =
|
|
33
|
-
return s(H, t, F, void 0,
|
|
32
|
+
let Z = y(() => {
|
|
33
|
+
let e = X?.action_layout ?? I ?? L ?? c(F, "quick_peek"), t = l(e, F, void 0, "quick_peek");
|
|
34
|
+
return s(H, t, F, void 0, W, [], U, h(E, W));
|
|
34
35
|
}, [
|
|
35
36
|
H,
|
|
36
|
-
|
|
37
|
+
X?.action_layout,
|
|
37
38
|
I,
|
|
38
39
|
L,
|
|
39
40
|
F,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
W,
|
|
42
|
+
E,
|
|
43
|
+
U
|
|
44
|
+
]), Q = ({ code: e, action: t }) => {
|
|
45
|
+
Y({
|
|
44
46
|
action: t,
|
|
45
47
|
title: H(t.display?.name) || e,
|
|
46
|
-
row:
|
|
48
|
+
row: W,
|
|
47
49
|
execute: (n) => R(e, t, n)
|
|
48
50
|
});
|
|
49
|
-
},
|
|
51
|
+
}, $ = (e, t) => {
|
|
50
52
|
let n = {
|
|
51
|
-
...
|
|
53
|
+
...W,
|
|
52
54
|
[e]: t
|
|
53
55
|
};
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
G(n), q(!0), V?.(n);
|
|
57
|
+
}, te = X?.quick_peek?.width ?? 480;
|
|
58
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
|
|
57
59
|
onClick: z,
|
|
58
60
|
style: {
|
|
59
61
|
position: "fixed",
|
|
@@ -61,8 +63,8 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
61
63
|
background: "var(--scrim-lite)",
|
|
62
64
|
zIndex: 40
|
|
63
65
|
}
|
|
64
|
-
}), /* @__PURE__ */
|
|
65
|
-
ref:
|
|
66
|
+
}), /* @__PURE__ */ w("aside", {
|
|
67
|
+
ref: J,
|
|
66
68
|
role: "dialog",
|
|
67
69
|
"aria-label": H("list.peek.dialog", "Quick peek"),
|
|
68
70
|
tabIndex: -1,
|
|
@@ -74,7 +76,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
74
76
|
top: "var(--topbar-h)",
|
|
75
77
|
right: 0,
|
|
76
78
|
bottom: "var(--tabbar-h)",
|
|
77
|
-
width:
|
|
79
|
+
width: te,
|
|
78
80
|
background: "var(--surface)",
|
|
79
81
|
borderLeft: "1px solid var(--border)",
|
|
80
82
|
zIndex: 41,
|
|
@@ -83,7 +85,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
83
85
|
boxShadow: "var(--shadow-lg)"
|
|
84
86
|
},
|
|
85
87
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ w("div", {
|
|
87
89
|
style: {
|
|
88
90
|
display: "flex",
|
|
89
91
|
alignItems: "center",
|
|
@@ -92,16 +94,16 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
92
94
|
gap: 10
|
|
93
95
|
},
|
|
94
96
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
name:
|
|
97
|
+
/* @__PURE__ */ C(a, {
|
|
98
|
+
name: ee || A,
|
|
97
99
|
size: 28
|
|
98
100
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ w("div", {
|
|
100
102
|
style: {
|
|
101
103
|
flex: 1,
|
|
102
104
|
minWidth: 0
|
|
103
105
|
},
|
|
104
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ C("div", {
|
|
105
107
|
style: {
|
|
106
108
|
fontSize: 14,
|
|
107
109
|
fontWeight: 600,
|
|
@@ -110,29 +112,29 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
110
112
|
textOverflow: "ellipsis",
|
|
111
113
|
whiteSpace: "nowrap"
|
|
112
114
|
},
|
|
113
|
-
children:
|
|
114
|
-
}),
|
|
115
|
+
children: A
|
|
116
|
+
}), j && /* @__PURE__ */ C("div", {
|
|
115
117
|
className: "mono",
|
|
116
118
|
style: {
|
|
117
119
|
fontSize: 11,
|
|
118
120
|
color: "var(--text-4)"
|
|
119
121
|
},
|
|
120
|
-
children:
|
|
122
|
+
children: j
|
|
121
123
|
})]
|
|
122
124
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
icon: /* @__PURE__ */
|
|
125
|
-
title:
|
|
126
|
-
onClick: () => B(
|
|
125
|
+
/* @__PURE__ */ C(r, {
|
|
126
|
+
icon: /* @__PURE__ */ C(t.external, { size: 13 }),
|
|
127
|
+
title: K ? H("list.peek.open_in_tab_dirty", "Open in tab (keeps unsaved changes)") : H("list.peek.open_in_tab", "Open in tab"),
|
|
128
|
+
onClick: () => B(K ? W : null)
|
|
127
129
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
icon: /* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ C(r, {
|
|
131
|
+
icon: /* @__PURE__ */ C(t.x, { size: 14 }),
|
|
130
132
|
title: H("list.peek.close", "Close"),
|
|
131
133
|
onClick: z
|
|
132
134
|
})
|
|
133
135
|
]
|
|
134
136
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ w("div", {
|
|
136
138
|
style: {
|
|
137
139
|
flex: 1,
|
|
138
140
|
overflowY: "auto",
|
|
@@ -141,7 +143,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
141
143
|
flexDirection: "column",
|
|
142
144
|
gap: 10
|
|
143
145
|
},
|
|
144
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ w("div", {
|
|
145
147
|
style: {
|
|
146
148
|
padding: "8px 10px",
|
|
147
149
|
background: "var(--accent-soft)",
|
|
@@ -153,39 +155,39 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
153
155
|
gap: 6
|
|
154
156
|
},
|
|
155
157
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ C(t.sparkle, { size: 12 }),
|
|
157
159
|
" ",
|
|
158
160
|
H("list.peek.hint", "Inline quick-edit — click any field to change."),
|
|
159
161
|
e(H("list.peek.keys_hint", "{tab} to move, {esc} to close."), {
|
|
160
|
-
tab: /* @__PURE__ */
|
|
161
|
-
esc: /* @__PURE__ */
|
|
162
|
+
tab: /* @__PURE__ */ C(i, { children: T.tab }),
|
|
163
|
+
esc: /* @__PURE__ */ C(i, { children: T.esc })
|
|
162
164
|
})
|
|
163
165
|
]
|
|
164
|
-
}), M.map((e) => /* @__PURE__ */
|
|
166
|
+
}), M.map((e) => /* @__PURE__ */ C(D, {
|
|
165
167
|
label: e.label,
|
|
166
168
|
children: e.kind === "file" ? d({
|
|
167
|
-
entity:
|
|
168
|
-
entityCode:
|
|
169
|
+
entity: E,
|
|
170
|
+
entityCode: O,
|
|
169
171
|
fieldName: e.key,
|
|
170
|
-
record:
|
|
172
|
+
record: W,
|
|
171
173
|
mode: e.readOnly ? "display" : "edit",
|
|
172
|
-
onChange: (t) =>
|
|
174
|
+
onChange: (t) => $(e.key, t),
|
|
173
175
|
refs: N,
|
|
174
176
|
disabled: e.readOnly,
|
|
175
177
|
t: H
|
|
176
|
-
}) : /* @__PURE__ */
|
|
178
|
+
}) : /* @__PURE__ */ C(g, {
|
|
177
179
|
field: e.field,
|
|
178
180
|
fieldName: e.key,
|
|
179
181
|
label: e.label,
|
|
180
|
-
value:
|
|
181
|
-
record:
|
|
182
|
+
value: W[e.key],
|
|
183
|
+
record: W,
|
|
182
184
|
refs: N,
|
|
183
185
|
readOnly: e.readOnly,
|
|
184
|
-
onCommit: (t) =>
|
|
186
|
+
onCommit: (t) => $(e.key, t)
|
|
185
187
|
})
|
|
186
188
|
}, e.key))]
|
|
187
189
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ w("div", {
|
|
189
191
|
style: {
|
|
190
192
|
display: "flex",
|
|
191
193
|
padding: "10px 14px",
|
|
@@ -194,7 +196,7 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
194
196
|
alignItems: "center"
|
|
195
197
|
},
|
|
196
198
|
children: [
|
|
197
|
-
|
|
199
|
+
K && /* @__PURE__ */ w("span", {
|
|
198
200
|
style: {
|
|
199
201
|
fontSize: 11,
|
|
200
202
|
color: "var(--warn)",
|
|
@@ -202,24 +204,24 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
202
204
|
alignItems: "center",
|
|
203
205
|
gap: 4
|
|
204
206
|
},
|
|
205
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ C("span", { style: {
|
|
206
208
|
width: 6,
|
|
207
209
|
height: 6,
|
|
208
210
|
borderRadius: 999,
|
|
209
211
|
background: "var(--warn)"
|
|
210
212
|
} }), H("list.peek.unsaved", "Unsaved")]
|
|
211
213
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ C("div", {
|
|
213
215
|
style: {
|
|
214
216
|
flex: 1,
|
|
215
217
|
minWidth: 0,
|
|
216
218
|
display: "flex",
|
|
217
219
|
justifyContent: "flex-end"
|
|
218
220
|
},
|
|
219
|
-
children:
|
|
220
|
-
layout:
|
|
221
|
-
row:
|
|
222
|
-
onRun: (e, t) =>
|
|
221
|
+
children: Z.length > 0 && /* @__PURE__ */ C(f, {
|
|
222
|
+
layout: Z,
|
|
223
|
+
row: W,
|
|
224
|
+
onRun: (e, t) => Q({
|
|
223
225
|
code: e,
|
|
224
226
|
action: t
|
|
225
227
|
}),
|
|
@@ -229,10 +231,10 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
229
231
|
ariaLabel: H("list.peek.actions", "Quick peek actions")
|
|
230
232
|
})
|
|
231
233
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ C(n, {
|
|
233
235
|
kind: "primary",
|
|
234
|
-
icon: /* @__PURE__ */
|
|
235
|
-
onClick: () => B(
|
|
236
|
+
icon: /* @__PURE__ */ C(t.edit, { size: 13 }),
|
|
237
|
+
onClick: () => B(K ? W : null),
|
|
236
238
|
children: H("list.peek.open_full", "Open full")
|
|
237
239
|
})
|
|
238
240
|
]
|
|
@@ -240,8 +242,8 @@ function T({ entity: T, entityCode: D, record: O, title: k, recordId: A, avatarN
|
|
|
240
242
|
]
|
|
241
243
|
})] });
|
|
242
244
|
}
|
|
243
|
-
function
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
+
function D({ label: e, children: t }) {
|
|
246
|
+
return /* @__PURE__ */ w("div", {
|
|
245
247
|
style: {
|
|
246
248
|
display: "grid",
|
|
247
249
|
gridTemplateColumns: "120px 1fr",
|
|
@@ -249,15 +251,15 @@ function E({ label: e, children: t }) {
|
|
|
249
251
|
padding: "4px 0",
|
|
250
252
|
borderBottom: "1px solid var(--divider)"
|
|
251
253
|
},
|
|
252
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ C("div", {
|
|
253
255
|
style: {
|
|
254
256
|
fontSize: 11.5,
|
|
255
257
|
color: "var(--text-3)",
|
|
256
258
|
fontWeight: 500
|
|
257
259
|
},
|
|
258
260
|
children: e
|
|
259
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ C("div", { children: t })]
|
|
260
262
|
});
|
|
261
263
|
}
|
|
262
264
|
//#endregion
|
|
263
|
-
export {
|
|
265
|
+
export { D as QEField, E as QuickPeek };
|