@declarion/react 0.48.2 → 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.
- package/dist-lib/Check-DAfMbQIw.js +38 -0
- package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-B98Md-Yq.js} +30 -30
- package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BdtEd4R9.js} +2 -2
- package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-oVU3nEb5.js} +600 -597
- package/dist-lib/ListCardsBody-DYMt1H8l.js +287 -0
- package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-E9hbyoUn.js} +1 -1
- package/dist-lib/RefreshControl-B_2eW53M.js +430 -0
- package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-Dg22HOxb.js} +520 -515
- package/dist-lib/SmartListPage.impl-CPhhXT5S.js +2849 -0
- package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-CF0UKgUj.js} +243 -240
- package/dist-lib/SortHeaderMenu-DodGvb7A.js +106 -0
- package/dist-lib/action-dispatch-CYOw7nkP.js +1984 -0
- package/dist-lib/api/batch.d.ts +5 -2
- package/dist-lib/api/data.d.ts +35 -4
- package/dist-lib/api/entities.d.ts +3 -3
- package/dist-lib/cardProjection-D-AufCh-.js +757 -0
- package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
- package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
- package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
- package/dist-lib/components/file-widgets/upload.d.ts +6 -1
- package/dist-lib/components/layout/Layout.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
- package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
- package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
- package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
- package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
- package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
- package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
- package/dist-lib/components/pages/list/page-size.d.ts +3 -0
- package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
- package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
- package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
- package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
- package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
- package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
- package/dist-lib/field-classification-DTgUnbzd.js +1134 -0
- package/dist-lib/format-count-DAHCcHZO.js +1551 -0
- package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
- package/dist-lib/hooks/useText.d.ts +3 -0
- package/dist-lib/hooks/useViews.d.ts +1 -1
- package/dist-lib/index.d.ts +17 -15
- package/dist-lib/index.js +1783 -6287
- package/dist-lib/lib/messages.d.ts +7 -1
- package/dist-lib/lib/rowClickGesture.d.ts +12 -0
- package/dist-lib/lib/timestamp.d.ts +8 -3
- package/dist-lib/peekDraftStore-CnxqkoWN.js +194 -0
- package/dist-lib/record-documents-key-DEFlLxnF.js +27 -0
- package/dist-lib/registry-WypUQQ7t.js +1768 -0
- package/dist-lib/testing.d.ts +17 -2
- package/dist-lib/testing.js +72 -58
- package/dist-lib/types/api.d.ts +54 -12
- package/dist-lib/types/schema.d.ts +22 -6
- package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-C5Oio-1G.js} +1125 -1068
- package/dist-lib/useListQuery-Dc2vbxqs.js +87 -0
- package/dist-lib/useProperties-C36ENFdY.js +81 -0
- package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-sIuYEFaq.js} +116 -194
- package/dist-lib/{value-B1O6QikE.js → value-igT4LsqW.js} +69 -69
- package/package.json +1 -1
- package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
- package/dist-lib/registry-CCxnZW2b.js +0 -5281
- /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
- /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
- /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
- /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
- /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/primitives/Check.tsx
|
|
3
|
+
function n({ checked: n, onChange: r, indeterminate: i, size: a = 14 }) {
|
|
4
|
+
return /* @__PURE__ */ t("span", {
|
|
5
|
+
onClick: (e) => {
|
|
6
|
+
e.stopPropagation(), r?.(!n);
|
|
7
|
+
},
|
|
8
|
+
style: {
|
|
9
|
+
display: "inline-flex",
|
|
10
|
+
width: a,
|
|
11
|
+
height: a,
|
|
12
|
+
borderRadius: 3,
|
|
13
|
+
border: `1px solid ${n || i ? "var(--accent)" : "var(--border-strong)"}`,
|
|
14
|
+
background: n || i ? "var(--accent)" : "var(--surface)",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
cursor: "pointer",
|
|
18
|
+
flexShrink: 0
|
|
19
|
+
},
|
|
20
|
+
children: [n && /* @__PURE__ */ e("svg", {
|
|
21
|
+
width: a - 4,
|
|
22
|
+
height: a - 4,
|
|
23
|
+
viewBox: "0 0 10 10",
|
|
24
|
+
fill: "none",
|
|
25
|
+
stroke: "var(--accent-foreground)",
|
|
26
|
+
strokeWidth: "2",
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round",
|
|
29
|
+
children: /* @__PURE__ */ e("path", { d: "m2 5 2 2 4-5" })
|
|
30
|
+
}), i && !n && /* @__PURE__ */ e("span", { style: {
|
|
31
|
+
width: 6,
|
|
32
|
+
height: 1.5,
|
|
33
|
+
background: "var(--accent-foreground)"
|
|
34
|
+
} })]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
-
import { A as t,
|
|
2
|
+
import { A as t, dr as n, fr as r, j as i, wn as a, zn as o } from "./useCurrentScreen-C5Oio-1G.js";
|
|
3
3
|
import { n as s, r as c, t as l } from "./dataTableStyles-vwD1mVOP.js";
|
|
4
4
|
import { useCallback as u, useMemo as d, useRef as f } from "react";
|
|
5
5
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -7,7 +7,7 @@ import { DndContext as h, PointerSensor as g, closestCenter as _, useSensor as v
|
|
|
7
7
|
import { SortableContext as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
|
|
8
8
|
import { CSS as C } from "@dnd-kit/utilities";
|
|
9
9
|
//#region src/components/detail-layout/DraggableChildrenTable.tsx
|
|
10
|
-
function w({ config: t, childEntity: n, schema: i, rows:
|
|
10
|
+
function w({ config: t, childEntity: n, schema: i, rows: o, onChange: l, validationErrors: x, refs: C }) {
|
|
11
11
|
let w = f(null), E = t.position_field, D = t.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), A = D.filter((e) => {
|
|
12
12
|
if (k.has(e) || e === E) return !1;
|
|
13
13
|
let t = n.fields.get(e);
|
|
@@ -16,14 +16,14 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
16
16
|
if (e === E) return !0;
|
|
17
17
|
let t = n.fields.get(e);
|
|
18
18
|
return t && (t.auto || t.primary || t.source);
|
|
19
|
-
})), M = D.filter((e) => e !== E), N = d(() =>
|
|
20
|
-
l(
|
|
19
|
+
})), M = D.filter((e) => e !== E), N = d(() => o.filter((e) => !e._deleted).map((e) => e._key), [o]), P = u((e, t, n) => {
|
|
20
|
+
l(o.map((r) => r._key === e ? {
|
|
21
21
|
...r,
|
|
22
22
|
[t]: n,
|
|
23
23
|
_dirty: !0
|
|
24
24
|
} : r));
|
|
25
|
-
}, [
|
|
26
|
-
let e =
|
|
25
|
+
}, [o, l]), F = u(() => {
|
|
26
|
+
let e = o.filter((e) => !e._deleted).reduce((e, t) => {
|
|
27
27
|
let n = typeof t[E] == "number" ? t[E] : -1;
|
|
28
28
|
return Math.max(e, n);
|
|
29
29
|
}, -1), r = {
|
|
@@ -35,37 +35,37 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
35
35
|
let t = n.fields.get(e);
|
|
36
36
|
t && (i[e] === void 0 ? t.default === void 0 ? t.type === "bool" && (r[e] = !1) : r[e] = t.default : r[e] = i[e]);
|
|
37
37
|
}
|
|
38
|
-
l([...
|
|
38
|
+
l([...o, r]);
|
|
39
39
|
}, [
|
|
40
|
-
|
|
40
|
+
o,
|
|
41
41
|
l,
|
|
42
42
|
A,
|
|
43
43
|
n,
|
|
44
44
|
t.quick_add?.defaults,
|
|
45
45
|
E
|
|
46
46
|
]), I = u((e) => {
|
|
47
|
-
l(
|
|
47
|
+
l(o.map((t) => t._key === e ? {
|
|
48
48
|
...t,
|
|
49
49
|
_deleted: !0
|
|
50
50
|
} : t));
|
|
51
|
-
}, [
|
|
52
|
-
l(
|
|
51
|
+
}, [o, l]), L = u((e) => {
|
|
52
|
+
l(o.map((t) => t._key === e ? {
|
|
53
53
|
...t,
|
|
54
54
|
_deleted: !1
|
|
55
55
|
} : t));
|
|
56
|
-
}, [
|
|
56
|
+
}, [o, l]), R = u((e) => {
|
|
57
57
|
let { active: t, over: n } = e;
|
|
58
58
|
if (!n || t.id === n.id) return;
|
|
59
|
-
let r =
|
|
60
|
-
if (
|
|
61
|
-
let c = [...r], [u] = c.splice(
|
|
59
|
+
let r = o.filter((e) => !e._deleted), i = o.filter((e) => e._deleted), a = r.findIndex((e) => e._key === String(t.id)), s = r.findIndex((e) => e._key === String(n.id));
|
|
60
|
+
if (a === -1 || s === -1) return;
|
|
61
|
+
let c = [...r], [u] = c.splice(a, 1);
|
|
62
62
|
c.splice(s, 0, u), l([...c.map((e, t) => ({
|
|
63
63
|
...e,
|
|
64
64
|
[E]: t,
|
|
65
65
|
_dirty: e[E] !== t || e._dirty
|
|
66
66
|
})), ...i]);
|
|
67
67
|
}, [
|
|
68
|
-
|
|
68
|
+
o,
|
|
69
69
|
l,
|
|
70
70
|
E
|
|
71
71
|
]), z = u((e) => {
|
|
@@ -121,7 +121,7 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
121
121
|
let t = n.fields.get(e);
|
|
122
122
|
return /* @__PURE__ */ p("th", {
|
|
123
123
|
style: B,
|
|
124
|
-
children: t ?
|
|
124
|
+
children: t ? a(t, e, i.entities) : e
|
|
125
125
|
}, e);
|
|
126
126
|
}),
|
|
127
127
|
/* @__PURE__ */ p("th", { style: {
|
|
@@ -131,7 +131,7 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
131
131
|
] }) }), /* @__PURE__ */ p(b, {
|
|
132
132
|
items: N,
|
|
133
133
|
strategy: S,
|
|
134
|
-
children: /* @__PURE__ */ p("tbody", { children:
|
|
134
|
+
children: /* @__PURE__ */ p("tbody", { children: o.map((e) => /* @__PURE__ */ p(T, {
|
|
135
135
|
row: e,
|
|
136
136
|
columns: M,
|
|
137
137
|
editableColumns: A,
|
|
@@ -148,7 +148,7 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
148
148
|
})
|
|
149
149
|
}), /* @__PURE__ */ p("div", {
|
|
150
150
|
style: { marginTop: 8 },
|
|
151
|
-
children: /* @__PURE__ */ p(
|
|
151
|
+
children: /* @__PURE__ */ p(r, {
|
|
152
152
|
kind: "ghost",
|
|
153
153
|
size: "xs",
|
|
154
154
|
icon: /* @__PURE__ */ p(e.plus, { size: 12 }),
|
|
@@ -157,7 +157,7 @@ function w({ config: t, childEntity: n, schema: i, rows: a, onChange: l, validat
|
|
|
157
157
|
})
|
|
158
158
|
})] });
|
|
159
159
|
}
|
|
160
|
-
function T({ row: r, columns:
|
|
160
|
+
function T({ row: r, columns: a, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
|
|
161
161
|
let v = t(), y = !!r._deleted, b = d?.[r._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
|
|
162
162
|
id: r._key,
|
|
163
163
|
disabled: y
|
|
@@ -200,9 +200,9 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
200
200
|
children: /* @__PURE__ */ p(e.grid, { size: 14 })
|
|
201
201
|
})
|
|
202
202
|
}),
|
|
203
|
-
|
|
204
|
-
let t = u.fields.get(e),
|
|
205
|
-
return y ||
|
|
203
|
+
a.map((e) => {
|
|
204
|
+
let t = u.fields.get(e), n = b?.includes(e), a = c.has(e), l = s.includes(e);
|
|
205
|
+
return y || a || !l ? /* @__PURE__ */ p("td", {
|
|
206
206
|
style: {
|
|
207
207
|
...A,
|
|
208
208
|
textDecoration: y ? "line-through" : "none"
|
|
@@ -215,15 +215,15 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
215
215
|
record: r,
|
|
216
216
|
refs: f,
|
|
217
217
|
locale: v
|
|
218
|
-
}) :
|
|
218
|
+
}) : o(r[e])
|
|
219
219
|
}, e) : /* @__PURE__ */ p("td", {
|
|
220
220
|
style: {
|
|
221
221
|
...j,
|
|
222
|
-
outline:
|
|
222
|
+
outline: n ? "1px solid var(--danger)" : "none",
|
|
223
223
|
outlineOffset: -1,
|
|
224
|
-
borderRadius:
|
|
224
|
+
borderRadius: n ? 4 : 0
|
|
225
225
|
},
|
|
226
|
-
title:
|
|
226
|
+
title: n ? `${e} is required` : void 0,
|
|
227
227
|
children: t ? i({
|
|
228
228
|
field: t,
|
|
229
229
|
fieldName: e,
|
|
@@ -233,7 +233,7 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
233
233
|
record: r,
|
|
234
234
|
refs: f,
|
|
235
235
|
locale: v
|
|
236
|
-
}) :
|
|
236
|
+
}) : o(r[e])
|
|
237
237
|
}, e);
|
|
238
238
|
}),
|
|
239
239
|
/* @__PURE__ */ p("td", {
|
|
@@ -242,12 +242,12 @@ function T({ row: r, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
242
242
|
borderBottom: "1px solid var(--divider)",
|
|
243
243
|
verticalAlign: "middle"
|
|
244
244
|
},
|
|
245
|
-
children: y ? /* @__PURE__ */ p(
|
|
245
|
+
children: y ? /* @__PURE__ */ p(n, {
|
|
246
246
|
size: 24,
|
|
247
247
|
icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
|
|
248
248
|
onClick: () => _(r._key),
|
|
249
249
|
title: "Undo delete"
|
|
250
|
-
}) : /* @__PURE__ */ p(
|
|
250
|
+
}) : /* @__PURE__ */ p(n, {
|
|
251
251
|
size: 24,
|
|
252
252
|
icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
|
|
253
253
|
onClick: () => g(r._key),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as e, I as t, L as n, P as r, R as i, z as a } from "./useCurrentScreen-
|
|
2
|
-
import { c as o, i as s, l as c, t as l } from "./value-
|
|
1
|
+
import { B as e, I as t, L as n, P as r, R as i, z as a } from "./useCurrentScreen-C5Oio-1G.js";
|
|
2
|
+
import { c as o, i as s, l as c, t as l } from "./value-igT4LsqW.js";
|
|
3
3
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
4
4
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
5
5
|
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
|