@declarion/react 0.30.0 → 0.31.1

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 (29) hide show
  1. package/dist-lib/{ActionRunner-HrBGEIPi.js → ActionRunner-BzaZQtiI.js} +1149 -992
  2. package/dist-lib/{DraggableChildrenTable-DawgL01j.js → DraggableChildrenTable-DILqStHQ.js} +29 -29
  3. package/dist-lib/{Grid-CywIwAds.js → Grid-BIsiUwPh.js} +2 -2
  4. package/dist-lib/LayoutRenderer-3RvIsC9M.js +2885 -0
  5. package/dist-lib/{MarkdownRenderer-DoKB-5LZ.js → MarkdownRenderer-CaHhWrfm.js} +1 -1
  6. package/dist-lib/SmartDetailPage.impl--EO-9fos.js +1494 -0
  7. package/dist-lib/SmartRecordListPage.impl-B1iws8yf.js +763 -0
  8. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -0
  9. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +2 -1
  10. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +2 -0
  11. package/dist-lib/components/layout/TenantChip.d.ts +2 -1
  12. package/dist-lib/components/layout/TopBar.d.ts +9 -1
  13. package/dist-lib/components/pages/SmartDetailPage.d.ts +2 -5
  14. package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +4 -0
  15. package/dist-lib/components/pages/SmartRecordListPage.d.ts +2 -5
  16. package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +4 -0
  17. package/dist-lib/components/pages/list/cardProjection.d.ts +66 -0
  18. package/dist-lib/declarion-react.css +1 -1
  19. package/dist-lib/hooks/useResponsiveMode.d.ts +30 -0
  20. package/dist-lib/index.d.ts +2 -0
  21. package/dist-lib/index.js +6773 -15562
  22. package/dist-lib/peekDraftStore-yyzMbaiI.js +468 -0
  23. package/dist-lib/registry-2KliNTHB.js +5177 -0
  24. package/dist-lib/testing.d.ts +3 -0
  25. package/dist-lib/testing.js +55 -52
  26. package/dist-lib/types/schema.d.ts +38 -0
  27. package/dist-lib/useProperties-Co3RdtuT.js +453 -0
  28. package/dist-lib/{value-D9BaSRFG.js → value-BooGwUik.js} +1 -1
  29. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./DynamicIcon-DCRdxxZ7.js";
2
- import { Ln as t, Rn as n, gn as r, m as i, p as a, rn as o } from "./ActionRunner-HrBGEIPi.js";
2
+ import { Hn as t, Vn as n, gn as r, m as i, p as a, rn as o } from "./ActionRunner-BzaZQtiI.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,8 +7,8 @@ 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: r, schema: i, rows: a, onChange: l, validationErrors: x, refs: C }) {
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) => {
10
+ function w({ config: n, childEntity: r, schema: i, rows: a, onChange: l, validationErrors: x, refs: C }) {
11
+ let w = f(null), E = n.position_field, D = n.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(n.foreign_key) ? n.foreign_key : [n.foreign_key]), A = D.filter((e) => {
12
12
  if (k.has(e) || e === E) return !1;
13
13
  let t = r.fields.get(e);
14
14
  return !(!t || t.auto || t.primary || t.source);
@@ -26,22 +26,22 @@ function w({ config: t, childEntity: r, schema: i, rows: a, onChange: l, validat
26
26
  let e = a.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
- }, -1), n = {
29
+ }, -1), t = {
30
30
  _key: crypto.randomUUID(),
31
31
  _dirty: !0,
32
32
  [E]: e + 1
33
- }, i = t.quick_add?.defaults ?? {};
33
+ }, i = n.quick_add?.defaults ?? {};
34
34
  for (let e of A) {
35
- let t = r.fields.get(e);
36
- t && (i[e] === void 0 ? t.default === void 0 ? t.type === "bool" && (n[e] = !1) : n[e] = t.default : n[e] = i[e]);
35
+ let n = r.fields.get(e);
36
+ n && (i[e] === void 0 ? n.default === void 0 ? n.type === "bool" && (t[e] = !1) : t[e] = n.default : t[e] = i[e]);
37
37
  }
38
- l([...a, n]);
38
+ l([...a, t]);
39
39
  }, [
40
40
  a,
41
41
  l,
42
42
  A,
43
43
  r,
44
- t.quick_add?.defaults,
44
+ n.quick_add?.defaults,
45
45
  E
46
46
  ]), I = u((e) => {
47
47
  l(a.map((t) => t._key === e ? {
@@ -148,7 +148,7 @@ function w({ config: t, childEntity: r, schema: i, rows: a, onChange: l, validat
148
148
  })
149
149
  }), /* @__PURE__ */ p("div", {
150
150
  style: { marginTop: 8 },
151
- children: /* @__PURE__ */ p(n, {
151
+ children: /* @__PURE__ */ p(t, {
152
152
  kind: "ghost",
153
153
  size: "xs",
154
154
  icon: /* @__PURE__ */ p(e.plus, { size: 12 }),
@@ -157,9 +157,9 @@ function w({ config: t, childEntity: r, schema: i, rows: a, onChange: l, validat
157
157
  })
158
158
  })] });
159
159
  }
160
- function T({ row: n, columns: o, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
161
- let v = a(), y = !!n._deleted, b = d?.[n._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
162
- id: n._key,
160
+ function T({ row: t, columns: o, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
161
+ let v = a(), y = !!t._deleted, b = d?.[t._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
162
+ id: t._key,
163
163
  disabled: y
164
164
  }), k = {
165
165
  transform: C.Translate.toString(E),
@@ -201,21 +201,21 @@ function T({ row: n, columns: o, editableColumns: s, displayOnlyColumns: c, chil
201
201
  })
202
202
  }),
203
203
  o.map((e) => {
204
- let t = u.fields.get(e), a = b?.includes(e), o = c.has(e), l = s.includes(e);
204
+ let n = u.fields.get(e), a = b?.includes(e), o = c.has(e), l = s.includes(e);
205
205
  return y || o || !l ? /* @__PURE__ */ p("td", {
206
206
  style: {
207
207
  ...A,
208
208
  textDecoration: y ? "line-through" : "none"
209
209
  },
210
- children: t ? i({
211
- field: t,
210
+ children: n ? i({
211
+ field: n,
212
212
  fieldName: e,
213
- value: n[e],
213
+ value: t[e],
214
214
  mode: "display",
215
- record: n,
215
+ record: t,
216
216
  refs: f,
217
217
  locale: v
218
- }) : r(n[e])
218
+ }) : r(t[e])
219
219
  }, e) : /* @__PURE__ */ p("td", {
220
220
  style: {
221
221
  ...j,
@@ -224,16 +224,16 @@ function T({ row: n, columns: o, editableColumns: s, displayOnlyColumns: c, chil
224
224
  borderRadius: a ? 4 : 0
225
225
  },
226
226
  title: a ? `${e} is required` : void 0,
227
- children: t ? i({
228
- field: t,
227
+ children: n ? i({
228
+ field: n,
229
229
  fieldName: e,
230
- value: n[e],
230
+ value: t[e],
231
231
  mode: "edit",
232
- onChange: (t) => h(n._key, e, t),
233
- record: n,
232
+ onChange: (n) => h(t._key, e, n),
233
+ record: t,
234
234
  refs: f,
235
235
  locale: v
236
- }) : r(n[e])
236
+ }) : r(t[e])
237
237
  }, e);
238
238
  }),
239
239
  /* @__PURE__ */ p("td", {
@@ -242,15 +242,15 @@ function T({ row: n, 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(t, {
245
+ children: y ? /* @__PURE__ */ p(n, {
246
246
  size: 24,
247
247
  icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
248
- onClick: () => _(n._key),
248
+ onClick: () => _(t._key),
249
249
  title: "Undo delete"
250
- }) : /* @__PURE__ */ p(t, {
250
+ }) : /* @__PURE__ */ p(n, {
251
251
  size: 24,
252
252
  icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
253
- onClick: () => g(n._key),
253
+ onClick: () => g(t._key),
254
254
  title: "Delete row"
255
255
  })
256
256
  })
@@ -1,5 +1,5 @@
1
- import { C as e, S as t, _ as n, b as r, x as i, y as a } from "./ActionRunner-HrBGEIPi.js";
2
- import { c as o, i as s, l as c, t as l } from "./value-D9BaSRFG.js";
1
+ import { C as e, S as t, _ as n, b as r, x as i, y as a } from "./ActionRunner-BzaZQtiI.js";
2
+ import { c as o, i as s, l as c, t as l } from "./value-BooGwUik.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";