@declarion/react 0.48.1 → 0.49.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.
Files changed (84) hide show
  1. package/dist-lib/Check-DAfMbQIw.js +38 -0
  2. package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-B98Md-Yq.js} +30 -30
  3. package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BdtEd4R9.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-oVU3nEb5.js} +600 -597
  5. package/dist-lib/ListCardsBody-DYMt1H8l.js +287 -0
  6. package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-E9hbyoUn.js} +1 -1
  7. package/dist-lib/RefreshControl-B_2eW53M.js +430 -0
  8. package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-Dg22HOxb.js} +520 -515
  9. package/dist-lib/SmartListPage.impl-CPhhXT5S.js +2849 -0
  10. package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-CF0UKgUj.js} +243 -240
  11. package/dist-lib/SortHeaderMenu-DodGvb7A.js +106 -0
  12. package/dist-lib/action-dispatch-CYOw7nkP.js +1984 -0
  13. package/dist-lib/api/batch.d.ts +5 -2
  14. package/dist-lib/api/data.d.ts +35 -4
  15. package/dist-lib/api/entities.d.ts +3 -3
  16. package/dist-lib/cardProjection-D-AufCh-.js +757 -0
  17. package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
  18. package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
  19. package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
  20. package/dist-lib/components/file-widgets/upload.d.ts +6 -1
  21. package/dist-lib/components/layout/Layout.d.ts +1 -1
  22. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  23. package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
  24. package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
  25. package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
  26. package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
  27. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  28. package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
  29. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  30. package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
  31. package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
  32. package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
  33. package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
  34. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
  35. package/dist-lib/components/pages/list/page-size.d.ts +3 -0
  36. package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
  37. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
  38. package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
  39. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
  40. package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
  41. package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
  42. package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
  43. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  44. package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
  45. package/dist-lib/field-classification-DTgUnbzd.js +1134 -0
  46. package/dist-lib/format-count-DAHCcHZO.js +1551 -0
  47. package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
  48. package/dist-lib/hooks/useText.d.ts +3 -0
  49. package/dist-lib/hooks/useViews.d.ts +1 -1
  50. package/dist-lib/index.d.ts +17 -15
  51. package/dist-lib/index.js +1783 -6287
  52. package/dist-lib/lib/messages.d.ts +7 -1
  53. package/dist-lib/lib/rowClickGesture.d.ts +12 -0
  54. package/dist-lib/lib/timestamp.d.ts +8 -3
  55. package/dist-lib/peekDraftStore-CnxqkoWN.js +194 -0
  56. package/dist-lib/record-documents-key-DEFlLxnF.js +27 -0
  57. package/dist-lib/registry-WypUQQ7t.js +1768 -0
  58. package/dist-lib/testing.d.ts +17 -2
  59. package/dist-lib/testing.js +72 -58
  60. package/dist-lib/types/api.d.ts +54 -12
  61. package/dist-lib/types/schema.d.ts +22 -6
  62. package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-C5Oio-1G.js} +1125 -1068
  63. package/dist-lib/useListQuery-Dc2vbxqs.js +87 -0
  64. package/dist-lib/useProperties-C36ENFdY.js +81 -0
  65. package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-sIuYEFaq.js} +116 -194
  66. package/dist-lib/{value-B1O6QikE.js → value-igT4LsqW.js} +69 -69
  67. package/package.json +1 -1
  68. package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
  69. package/dist-lib/registry-CCxnZW2b.js +0 -5281
  70. /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
  71. /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
  72. /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
  73. /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
  74. /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
  75. /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
  76. /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
  77. /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
  78. /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
  79. /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
  80. /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
  81. /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
  82. /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
  83. /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
  84. /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
@@ -0,0 +1,287 @@
1
+ import { Dn as e, Tn as t, ur as n, zn as r } from "./useCurrentScreen-C5Oio-1G.js";
2
+ import { t as i } from "./Check-DAfMbQIw.js";
3
+ import { f as a, m as o, p as s, r as c } from "./action-dispatch-CYOw7nkP.js";
4
+ import { t as l } from "./cardProjection-D-AufCh-.js";
5
+ import { t as u } from "./SmartListPage.impl-CPhhXT5S.js";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ //#region src/components/pages/list/ListCardRow.tsx
8
+ function p(t, n, r) {
9
+ if (t.startsWith("$status.")) {
10
+ let r = t.slice(8), i = n.status_groups?.[r];
11
+ return i ? e(i.name) || r : t;
12
+ }
13
+ if (t.startsWith("$property.")) {
14
+ let r = t.slice(10), i = n.properties?.[r];
15
+ return i ? e(i.name) || r : t;
16
+ }
17
+ return o(n, t, r);
18
+ }
19
+ function m(e, t, n) {
20
+ if (e.startsWith("$status.")) {
21
+ let n = e.slice(8), r = t.$statuses;
22
+ return Array.isArray(r) && r.some((e) => e.group_code === n);
23
+ }
24
+ if (e.startsWith("$property.")) {
25
+ let n = e.slice(10), i = t.$properties, a = Array.isArray(i) ? i.find((e) => e.property_code === n) : void 0;
26
+ return a?.value != null && r(a.value) !== "";
27
+ }
28
+ let i = a(n, t, e);
29
+ return i != null && r(i) !== "";
30
+ }
31
+ function h(t, i, a) {
32
+ let { entity: o, entityCode: c, refs: l, locale: u, renderers: f } = a;
33
+ if (t.startsWith("$status.")) {
34
+ let r = t.slice(8), a = o.status_groups?.[r], s = i.$statuses, c = Array.isArray(s) ? s.find((e) => e.group_code === r) : void 0;
35
+ if (!a || !c) return /* @__PURE__ */ d("span", {
36
+ style: { color: "var(--text-3)" },
37
+ children: "-"
38
+ });
39
+ let l = a.statuses.find((e) => e.code === c.status_code);
40
+ return /* @__PURE__ */ d(n, {
41
+ tone: l?.color ?? "slate",
42
+ size: "xs",
43
+ children: e(l?.name) || c.status_code
44
+ });
45
+ }
46
+ if (t.startsWith("$property.")) {
47
+ let e = t.slice(10), n = i.$properties, a = Array.isArray(n) ? n.find((t) => t.property_code === e) : void 0;
48
+ return !a || a.value == null ? /* @__PURE__ */ d("span", {
49
+ style: { color: "var(--text-3)" },
50
+ children: "-"
51
+ }) : /* @__PURE__ */ d("span", { children: r(a.value) });
52
+ }
53
+ if (o.files?.get(t)) return s({
54
+ entity: o,
55
+ entityCode: c,
56
+ fieldName: t,
57
+ record: i,
58
+ mode: "display",
59
+ surface: "list",
60
+ refs: l,
61
+ locale: u
62
+ });
63
+ let p = f.get(t);
64
+ if (!p) {
65
+ let e = i[t];
66
+ return r(e) || /* @__PURE__ */ d("span", {
67
+ style: { color: "var(--text-3)" },
68
+ children: "-"
69
+ });
70
+ }
71
+ return p(i[t], i);
72
+ }
73
+ function g({ row: e, rowIndex: n, entity: r, screen: a, entityCode: o, entities: s, savedViewColumns: g, refs: _, locale: v, renderers: y, rowActions: b, tabNavigate: x, interaction: S, hasSoftDelete: C, zebra: w, hasBatchActions: T, hasDetailTarget: E, rowKey: D, measureElement: O }) {
74
+ let k = {
75
+ entity: r,
76
+ entityCode: o,
77
+ refs: _,
78
+ locale: v,
79
+ renderers: y
80
+ }, A = e.original, j = c(r, a, A), M = l({
81
+ entity: r,
82
+ screen: j,
83
+ savedViewColumns: g
84
+ }), N = C && A[r.soft_delete] != null, P = e.getIsSelected(), F = w && n % 2 == 1, I = E || S.peekAllowed, L = (M.titleUsesDisplay ? t(A, r) ?? (M.titleField ? null : D(A)) : null) || (M.titleField ? h(M.titleField, A, k) : D(A)), R = M.badgeFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), z = M.bodyFields.filter((e) => !M.hideEmptyFields || m(e, A, r)), B = M.metaFields.filter((e) => !M.hideEmptyFields || m(e, A, r));
85
+ return /* @__PURE__ */ d("div", {
86
+ "data-index": n,
87
+ "data-testid": "list-card",
88
+ ref: (e) => O(e),
89
+ style: {
90
+ padding: "6px 10px",
91
+ boxSizing: "border-box"
92
+ },
93
+ children: /* @__PURE__ */ f("div", {
94
+ className: "sl-list-card-surface",
95
+ "data-row-stripe": F ? "" : void 0,
96
+ "aria-selected": P,
97
+ style: {
98
+ display: "grid",
99
+ gridTemplateColumns: T ? "28px minmax(0, 1fr) auto" : "minmax(0, 1fr) auto",
100
+ gap: 8,
101
+ alignItems: "start",
102
+ width: "100%",
103
+ boxSizing: "border-box",
104
+ borderRadius: 8,
105
+ opacity: N ? .56 : 1,
106
+ fontStyle: N ? "italic" : "normal",
107
+ padding: "12px",
108
+ cursor: I ? "pointer" : "default"
109
+ },
110
+ tabIndex: I ? 0 : void 0,
111
+ onClick: I ? (e) => S.onRowClick(e, A) : void 0,
112
+ onKeyDown: I ? (e) => {
113
+ if (e.key === "Enter") {
114
+ if (e.preventDefault(), S.peekAllowed) {
115
+ S.setPeekRow(A);
116
+ return;
117
+ }
118
+ S.navigateToDetail(A);
119
+ }
120
+ } : void 0,
121
+ onContextMenu: (e) => {
122
+ e.preventDefault(), S.setContextMenu({
123
+ x: e.clientX,
124
+ y: e.clientY,
125
+ row: A
126
+ });
127
+ },
128
+ ...S.longPress.handlers,
129
+ onPointerDown: (e) => {
130
+ S.pressedRow.current = A, S.longPress.handlers.onPointerDown(e);
131
+ },
132
+ children: [
133
+ T && /* @__PURE__ */ d("span", {
134
+ "data-testid": "row-select-checkbox",
135
+ style: { paddingTop: 2 },
136
+ children: /* @__PURE__ */ d(i, {
137
+ checked: P,
138
+ onChange: () => e.toggleSelected()
139
+ })
140
+ }),
141
+ /* @__PURE__ */ f("div", {
142
+ style: { minWidth: 0 },
143
+ children: [
144
+ /* @__PURE__ */ d("div", {
145
+ style: {
146
+ display: "flex",
147
+ alignItems: "flex-start",
148
+ gap: 8,
149
+ minWidth: 0
150
+ },
151
+ children: /* @__PURE__ */ f("div", {
152
+ style: {
153
+ minWidth: 0,
154
+ flex: 1
155
+ },
156
+ children: [/* @__PURE__ */ d("div", {
157
+ style: {
158
+ fontSize: 14,
159
+ lineHeight: 1.25,
160
+ fontWeight: 650,
161
+ color: "var(--text)",
162
+ overflowWrap: "anywhere"
163
+ },
164
+ children: L
165
+ }), M.subtitleField && /* @__PURE__ */ d("div", {
166
+ style: {
167
+ marginTop: 3,
168
+ fontSize: 12.5,
169
+ lineHeight: 1.35,
170
+ color: "var(--text-3)",
171
+ overflowWrap: "anywhere"
172
+ },
173
+ children: h(M.subtitleField, A, k)
174
+ })]
175
+ })
176
+ }),
177
+ R.length > 0 && /* @__PURE__ */ d("div", {
178
+ style: {
179
+ display: "flex",
180
+ flexWrap: "wrap",
181
+ gap: 6,
182
+ marginTop: 10
183
+ },
184
+ children: R.map((e) => /* @__PURE__ */ d("span", {
185
+ style: {
186
+ display: "inline-flex",
187
+ minWidth: 0
188
+ },
189
+ children: h(e, A, k)
190
+ }, e))
191
+ }),
192
+ z.length > 0 && /* @__PURE__ */ d("dl", {
193
+ style: {
194
+ display: "grid",
195
+ gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
196
+ gap: "6px 10px",
197
+ margin: "12px 0 0",
198
+ fontSize: 12.5,
199
+ lineHeight: 1.35
200
+ },
201
+ children: z.map((e) => /* @__PURE__ */ f("div", {
202
+ style: { display: "contents" },
203
+ children: [/* @__PURE__ */ d("dt", {
204
+ style: { color: "var(--text-3)" },
205
+ children: p(e, r, s)
206
+ }), /* @__PURE__ */ d("dd", {
207
+ style: {
208
+ margin: 0,
209
+ color: "var(--text-2)",
210
+ minWidth: 0,
211
+ overflowWrap: "anywhere"
212
+ },
213
+ children: h(e, A, k)
214
+ })]
215
+ }, e))
216
+ }),
217
+ B.length > 0 && /* @__PURE__ */ d("div", {
218
+ style: {
219
+ display: "flex",
220
+ flexWrap: "wrap",
221
+ gap: 10,
222
+ marginTop: 10,
223
+ color: "var(--text-3)",
224
+ fontSize: 11.5
225
+ },
226
+ children: B.map((e) => /* @__PURE__ */ f("span", {
227
+ style: {
228
+ minWidth: 0,
229
+ overflowWrap: "anywhere"
230
+ },
231
+ children: [
232
+ p(e, r, s),
233
+ ": ",
234
+ h(e, A, k)
235
+ ]
236
+ }, e))
237
+ })
238
+ ]
239
+ }),
240
+ /* @__PURE__ */ d(u, {
241
+ row: A,
242
+ rowId: D(A),
243
+ screen: a,
244
+ fullScreen: a,
245
+ entity: r,
246
+ entityCode: o,
247
+ rowActions: b,
248
+ tabNavigate: x,
249
+ peekAllowed: S.peekAllowed,
250
+ hasDetailTarget: E,
251
+ onPeek: S.setPeekRow,
252
+ locale: v
253
+ })
254
+ ]
255
+ })
256
+ }, e.id);
257
+ }
258
+ //#endregion
259
+ //#region src/components/pages/list/ListCardsBody.tsx
260
+ function _({ rows: e, virtualizer: t, ...n }) {
261
+ return /* @__PURE__ */ d("div", {
262
+ style: {
263
+ height: t.getTotalSize(),
264
+ width: "100%",
265
+ position: "relative",
266
+ boxSizing: "border-box"
267
+ },
268
+ children: t.getVirtualItems().map((r) => /* @__PURE__ */ d("div", {
269
+ style: {
270
+ position: "absolute",
271
+ top: 0,
272
+ left: 0,
273
+ width: "100%",
274
+ transform: `translateY(${r.start}px)`,
275
+ boxSizing: "border-box"
276
+ },
277
+ children: /* @__PURE__ */ d(g, {
278
+ row: e[r.index],
279
+ rowIndex: r.index,
280
+ measureElement: t.measureElement,
281
+ ...n
282
+ })
283
+ }, e[r.index]?.id ?? r.key))
284
+ });
285
+ }
286
+ //#endregion
287
+ export { _ as ListCardsBody };
@@ -1,4 +1,4 @@
1
- import { H as e, et as t } from "./useCurrentScreen-BshVTPVq.js";
1
+ import { H as e, et as t } from "./useCurrentScreen-C5Oio-1G.js";
2
2
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
3
  import i, { defaultUrlTransform as a } from "react-markdown";
4
4
  import o from "remark-breaks";