@declarion/react 0.446.0 → 0.517.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 (43) hide show
  1. package/dist-lib/components/agents/AgentChatPanel.impl.js +349 -332
  2. package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
  3. package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
  4. package/dist-lib/components/detail-layout/FieldRow.js +56 -60
  5. package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
  6. package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
  7. package/dist-lib/components/detail-layout/labelLayout.js +35 -0
  8. package/dist-lib/components/fields/JsonField.js +128 -125
  9. package/dist-lib/components/fields/StringField.js +10 -25
  10. package/dist-lib/components/fields/StructureField.js +125 -167
  11. package/dist-lib/components/fields/ValueRows.js +114 -0
  12. package/dist-lib/components/fields/cells/factories/id.js +10 -0
  13. package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
  14. package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
  15. package/dist-lib/components/fields/cells/registry.js +25 -23
  16. package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
  17. package/dist-lib/components/file-widgets/helpers.js +32 -19
  18. package/dist-lib/components/file-widgets/host.js +4 -1
  19. package/dist-lib/components/list/PeekFieldCell.js +57 -55
  20. package/dist-lib/components/list/QuickPeek.js +109 -121
  21. package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
  22. package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
  23. package/dist-lib/components/pages/list/ListCardRow.js +101 -100
  24. package/dist-lib/components/pages/list/cardProjection.js +117 -112
  25. package/dist-lib/components/pages/list/useListQuery.js +1 -1
  26. package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
  27. package/dist-lib/components/primitives/IdBadge.js +27 -0
  28. package/dist-lib/components/primitives/RowField.js +11 -43
  29. package/dist-lib/components/shared/CopyButton.js +13 -18
  30. package/dist-lib/components/shared/RefChip.js +33 -0
  31. package/dist-lib/declarion-react.css +1 -1
  32. package/dist-lib/hooks/useAgentConversation.js +134 -110
  33. package/dist-lib/hooks/useCopy.js +18 -0
  34. package/dist-lib/index.d.ts +55 -20
  35. package/dist-lib/index.js +116 -111
  36. package/dist-lib/lib/realtime-reconcile.js +70 -59
  37. package/dist-lib/lib/reference.js +52 -34
  38. package/dist-lib/lib/short-id.js +12 -0
  39. package/dist-lib/testing.d.ts +1 -1
  40. package/dist-lib/types/schema.js +84 -80
  41. package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
  42. package/package.json +6 -1
  43. package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
@@ -14,61 +14,61 @@ import { useTabStore as oe } from "../../stores/tabs.js";
14
14
  import { usePreferencesStore as se } from "../../stores/preferences.js";
15
15
  import { useScreenIsLive as ce } from "../../stores/realtime.js";
16
16
  import { filterUnavailableMutationActions as le, getScreenActions as ue } from "../../lib/actions.js";
17
- import { buildDetailHrefFromId as de, entityAllowsMutation as fe, getDisplayValue as pe, pkValuesToDetailId as me } from "../../types/schema.js";
18
- import { useFilters as he } from "../../hooks/useFilters.js";
19
- import { useActiveView as ge } from "./list/useActiveView.js";
20
- import { QuickPeek as _e } from "../list/QuickPeek.js";
21
- import { clearPeekDraft as ve } from "../list/peekDraftStore.js";
22
- import { executeAction as ye } from "../../api/data.js";
23
- import { countActiveFilters as be, parseFilterURLState as xe, removeFilterAtPath as Se } from "../../lib/filters.js";
24
- import { effectiveScreenForRecord as Ce } from "../../lib/variants.js";
25
- import { coerceDisplayString as we } from "../../lib/display-value.js";
26
- import { FilterChips as Te } from "../filters/FilterChips.js";
27
- import { FilterDrawer as Ee } from "../filters/FilterDrawer.js";
28
- import { listTableFeatures as De } from "./list/table-features.js";
17
+ import { buildDetailHrefFromId as de, entityAllowsEditForm as fe, entityAllowsMutation as pe, getDisplayValue as me, pkValuesToDetailId as he } from "../../types/schema.js";
18
+ import { useFilters as ge } from "../../hooks/useFilters.js";
19
+ import { useActiveView as _e } from "./list/useActiveView.js";
20
+ import { QuickPeek as ve } from "../list/QuickPeek.js";
21
+ import { clearPeekDraft as ye } from "../list/peekDraftStore.js";
22
+ import { executeAction as be } from "../../api/data.js";
23
+ import { countActiveFilters as xe, parseFilterURLState as Se, removeFilterAtPath as Ce } from "../../lib/filters.js";
24
+ import { effectiveScreenForRecord as we } from "../../lib/variants.js";
25
+ import { coerceDisplayString as Te } from "../../lib/display-value.js";
26
+ import { FilterChips as Ee } from "../filters/FilterChips.js";
27
+ import { FilterDrawer as De } from "../filters/FilterDrawer.js";
28
+ import { listTableFeatures as Oe } from "./list/table-features.js";
29
29
  import "./list/page-size.js";
30
- import { useListFilterPresentation as Oe } from "./list/useListFilterPresentation.js";
31
- import { FilterOmittedNotice as ke } from "../filters/FilterOmittedNotice.js";
32
- import { useListQuery as Ae } from "./list/useListQuery.js";
33
- import { useListSort as je } from "./list/useListSort.js";
34
- import { rowSelectionKey as Me, useListSelection as Ne } from "./list/useListSelection.js";
35
- import { useListColumnLayout as Pe } from "./list/useListColumnLayout.js";
36
- import { useListRowInteraction as Fe } from "./list/useListRowInteraction.js";
37
- import { ListTable as Ie } from "./list/ListTable.js";
38
- import { ListTableRow as Le } from "./list/ListTableRow.js";
39
- import { ListNoRows as Re } from "./list/ListNoRows.js";
40
- import { ListFooter as ze } from "./list/ListFooter.js";
41
- import { ListToolbar as Be } from "./list/ListToolbar.js";
42
- import { overwritableViewName as Ve, useListViews as He } from "./list/useListViews.js";
43
- import { DeleteViewDialog as Ue } from "./list/DeleteViewDialog.js";
44
- import { ListUrlBanner as We } from "./list/ListUrlBanner.js";
45
- import { useFilterValueLabels as Ge } from "./list/use-filter-value-labels.js";
46
- import { SaveViewDialog as Ke } from "./list/SaveViewDialog.js";
47
- import { ListHeader as qe } from "./list/ListHeader.js";
48
- import { ListFloatbar as Je } from "./list/ListFloatbar.js";
49
- import { buildListColumns as Ye } from "./list/columns.js";
50
- import { RowContextMenu as Xe } from "./list/RowContextMenu.js";
51
- import { buildColumnSizeVars as Ze } from "./list/column-sizing.js";
52
- import { useHeaderReorder as Qe } from "./list/useHeaderReorder.js";
53
- import { resolveCard as $e, resolveListProjection as et, resolveVariantRenderFields as tt } from "./list/cardProjection.js";
54
- import { resolveCellRenderer as nt } from "../fields/cells/registry.js";
55
- import { FileDraftScope as s, useFileDraftScope as rt } from "../file-widgets/draft-scope.js";
56
- import { buildFilesPayload as it, collectCommittedFileIds as at } from "../file-widgets/payload.js";
57
- import { getSchemaFieldValue as ot, serializeSchemaFieldValue as st } from "../file-widgets/host.js";
58
- import { useText as ct } from "../../hooks/useText.js";
59
- import { Suspense as lt, lazy as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as ut } from "react";
60
- import { Fragment as dt, jsx as p, jsxs as ft } from "react/jsx-runtime";
61
- import { useSearchParams as pt } from "react-router";
62
- import { useTable as mt } from "@tanstack/react-table";
63
- import { useVirtualizer as ht } from "@tanstack/react-virtual";
30
+ import { useListFilterPresentation as ke } from "./list/useListFilterPresentation.js";
31
+ import { FilterOmittedNotice as Ae } from "../filters/FilterOmittedNotice.js";
32
+ import { useListQuery as je } from "./list/useListQuery.js";
33
+ import { useListSort as Me } from "./list/useListSort.js";
34
+ import { rowSelectionKey as Ne, useListSelection as Pe } from "./list/useListSelection.js";
35
+ import { useListColumnLayout as Fe } from "./list/useListColumnLayout.js";
36
+ import { useListRowInteraction as Ie } from "./list/useListRowInteraction.js";
37
+ import { ListTable as Le } from "./list/ListTable.js";
38
+ import { ListTableRow as Re } from "./list/ListTableRow.js";
39
+ import { ListNoRows as ze } from "./list/ListNoRows.js";
40
+ import { ListFooter as Be } from "./list/ListFooter.js";
41
+ import { ListToolbar as Ve } from "./list/ListToolbar.js";
42
+ import { overwritableViewName as He, useListViews as Ue } from "./list/useListViews.js";
43
+ import { DeleteViewDialog as We } from "./list/DeleteViewDialog.js";
44
+ import { ListUrlBanner as Ge } from "./list/ListUrlBanner.js";
45
+ import { useFilterValueLabels as Ke } from "./list/use-filter-value-labels.js";
46
+ import { SaveViewDialog as qe } from "./list/SaveViewDialog.js";
47
+ import { ListHeader as Je } from "./list/ListHeader.js";
48
+ import { ListFloatbar as Ye } from "./list/ListFloatbar.js";
49
+ import { buildListColumns as Xe } from "./list/columns.js";
50
+ import { RowContextMenu as Ze } from "./list/RowContextMenu.js";
51
+ import { buildColumnSizeVars as Qe } from "./list/column-sizing.js";
52
+ import { useHeaderReorder as $e } from "./list/useHeaderReorder.js";
53
+ import { resolveCard as et, resolveListProjection as tt, resolveVariantRenderFields as nt } from "./list/cardProjection.js";
54
+ import { resolveCellRenderer as rt } from "../fields/cells/registry.js";
55
+ import { FileDraftScope as s, useFileDraftScope as it } from "../file-widgets/draft-scope.js";
56
+ import { buildFilesPayload as at, collectCommittedFileIds as ot } from "../file-widgets/payload.js";
57
+ import { getSchemaFieldValue as st, serializeSchemaFieldValue as ct } from "../file-widgets/host.js";
58
+ import { useText as lt } from "../../hooks/useText.js";
59
+ import { Suspense as ut, lazy as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as dt } from "react";
60
+ import { Fragment as ft, jsx as p, jsxs as pt } from "react/jsx-runtime";
61
+ import { useSearchParams as mt } from "react-router";
62
+ import { useTable as ht } from "@tanstack/react-table";
63
+ import { useVirtualizer as gt } from "@tanstack/react-virtual";
64
64
  // src/components/pages/SmartListPage.impl.tsx
65
- var gt = c(() => import("./list/ListCardsBody.js").then((e) => ({ default: e.ListCardsBody })));
66
- function _t({ screenCode: e }) {
65
+ var _t = c(() => import("./list/ListCardsBody.js").then((e) => ({ default: e.ListCardsBody })));
66
+ function vt({ screenCode: e }) {
67
67
  return /* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(m, { screenCode: e }) });
68
68
  }
69
- var vt = [];
69
+ var yt = [];
70
70
  function m({ screenCode: s }) {
71
- let c = ct(), _t = ct("errors"), m = ne(), [h, g] = pt(), { data: _ } = n(), [yt, v] = ut(!1), [bt, y] = ut(!1), [xt, b] = ut(null), St = r((e) => e.user), Ct = r((e) => e.activeTenant), wt = rt(), x = _?.screens[s], S = x?.entity ? _?.entities[x.entity] : void 0, C = x?.entity, Tt = fe(S, "create"), Et = fe(S, "update"), Dt = fe(S, "delete"), w = _?.actions, T = d(() => le(ue(S?.actions, x?.actions, "list_toolbar", w), S), [
71
+ let c = lt(), vt = lt("errors"), m = ne(), [h, g] = mt(), { data: _ } = n(), [bt, v] = dt(!1), [xt, y] = dt(!1), [St, b] = dt(null), Ct = r((e) => e.user), wt = r((e) => e.activeTenant), Tt = it(), x = _?.screens[s], S = x?.entity ? _?.entities[x.entity] : void 0, C = x?.entity, Et = pe(S, "create"), Dt = pe(S, "update") && fe(S), Ot = pe(S, "delete"), w = _?.actions, T = d(() => le(ue(S?.actions, x?.actions, "list_toolbar", w), S), [
72
72
  S,
73
73
  x?.actions,
74
74
  w
@@ -83,16 +83,16 @@ function m({ screenCode: s }) {
83
83
  S,
84
84
  x,
85
85
  w
86
- ]), Ot = x?.row_actions !== void 0, kt = d(() => E.length > 0 || S?.export?.enabled !== !1 && x?.export?.enabled !== !1, [
86
+ ]), kt = x?.row_actions !== void 0, At = d(() => E.length > 0 || S?.export?.enabled !== !1 && x?.export?.enabled !== !1, [
87
87
  E,
88
88
  S?.export?.enabled,
89
89
  x?.export?.enabled
90
- ]), At = !!S?.soft_delete, jt = At && (St?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), Mt = jt && h.get("include_deleted") === "true", Nt = ae(), { openTab: Pt, updateTabSearch: Ft, findTabByPathname: It } = oe();
90
+ ]), jt = !!S?.soft_delete, Mt = jt && (Ct?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), Nt = Mt && h.get("include_deleted") === "true", Pt = ae(), { openTab: Ft, updateTabSearch: It, findTabByPathname: Lt } = oe();
91
91
  ie(x, S, h.toString()), re(x?.route);
92
- let Lt = l((e) => {
93
- if (!x?.route || !S || Nt.enabled) return;
94
- let t = It(x.route);
95
- t ? Ft(t.id, e) : Pt({
92
+ let Rt = l((e) => {
93
+ if (!x?.route || !S || Pt.enabled) return;
94
+ let t = Lt(x.route);
95
+ t ? It(t.id, e) : Ft({
96
96
  pathname: x.route,
97
97
  search: e,
98
98
  title: c(x.display?.name) || c(S.display.name_plural),
@@ -103,55 +103,55 @@ function m({ screenCode: s }) {
103
103
  c,
104
104
  x,
105
105
  S,
106
- Nt.enabled,
106
+ Pt.enabled,
107
+ Lt,
107
108
  It,
108
- Ft,
109
- Pt
110
- ]), O = parseInt(h.get("page") ?? "1", 10), Rt = (() => {
109
+ Ft
110
+ ]), O = parseInt(h.get("page") ?? "1", 10), zt = (() => {
111
111
  let e = parseInt(h.get("per_page") ?? "", 10);
112
112
  return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
113
- })(), zt = h.get("search") ?? "", Bt = d(() => {
114
- let e = xe(h);
115
- return e.error === null ? null : _t(e.errorCode ?? "", e.error);
116
- }, [_t, h]), k = ge({
113
+ })(), Bt = h.get("search") ?? "", Vt = d(() => {
114
+ let e = Se(h);
115
+ return e.error === null ? null : vt(e.errorCode ?? "", e.error);
116
+ }, [vt, h]), k = _e({
117
117
  screenCode: s,
118
118
  screen: x,
119
119
  entity: S,
120
120
  searchParams: h,
121
121
  setSearchParams: g,
122
- userId: St?.id,
123
- tenantId: Ct?.id,
124
- filterError: !!Bt
125
- }), { filters: Vt, columns: Ht, sort: Ut } = k.defaults, { filters: Wt, setFilters: A, clearFilters: Gt } = he({ defaults: Vt }), { visibleFilterState: Kt, filterFieldMeta: qt, allFilterFieldMeta: Jt, filterFieldName: Yt } = Oe(x, S, _?.entities, Wt), j = Kt.filters, Xt = be(j), Zt = l(() => A(vt), [A]), Qt = je({
122
+ userId: Ct?.id,
123
+ tenantId: wt?.id,
124
+ filterError: !!Vt
125
+ }), { filters: Ht, columns: Ut, sort: Wt } = k.defaults, { filters: Gt, setFilters: A, clearFilters: Kt } = ge({ defaults: Ht }), { visibleFilterState: qt, filterFieldMeta: Jt, allFilterFieldMeta: Yt, filterFieldName: Xt } = ke(x, S, _?.entities, Gt), j = qt.filters, Zt = xe(j), Qt = l(() => A(yt), [A]), $t = Me({
126
126
  searchParams: h,
127
127
  setSearchParams: g,
128
- defaultSort: Ut,
129
- commitScreenTabSearch: Lt
130
- }), { cols: M, nullsByField: $t, value: en, forRequest: tn, tableSorting: nn, write: rn, applyColumn: an, shiftClickColumn: on, appendColumn: sn, clearColumn: cn, clearAll: ln } = Qt, un = Pe({
128
+ defaultSort: Wt,
129
+ commitScreenTabSearch: Rt
130
+ }), { cols: M, nullsByField: en, value: tn, forRequest: nn, tableSorting: rn, write: an, applyColumn: on, shiftClickColumn: sn, appendColumn: cn, clearColumn: ln, clearAll: un } = $t, dn = Fe({
131
131
  screenCode: s,
132
132
  screen: x,
133
133
  searchParams: h,
134
134
  setSearchParams: g,
135
- defaultColumns: Ht
136
- }), { visible: N, sizing: dn, setSizing: fn, apply: pn, commitResize: mn } = un, hn = He({
135
+ defaultColumns: Ut
136
+ }), { visible: N, sizing: fn, setSizing: pn, apply: mn, commitResize: hn } = dn, gn = Ue({
137
137
  screenCode: s,
138
138
  screen: x,
139
139
  entity: S,
140
140
  searchParams: h,
141
141
  setSearchParams: g,
142
- userId: St?.id,
143
- tenantId: Ct?.id,
142
+ userId: Ct?.id,
143
+ tenantId: wt?.id,
144
144
  all: k.all,
145
145
  activeId: k.activeId,
146
146
  active: k.active,
147
147
  clearedKey: k.clearedKey,
148
- filters: Wt,
148
+ filters: Gt,
149
149
  visibleColumns: N,
150
- sort: en
151
- }), { active: P, saveAsNew: gn, overwriteActive: _n, isSaving: vn } = hn, yn = ee(zt, 300), F = te(), I = d(() => {
150
+ sort: tn
151
+ }), { active: P, saveAsNew: _n, overwriteActive: vn, isSaving: yn } = gn, bn = ee(Bt, 300), F = te(), I = d(() => {
152
152
  let e = x?.responsive?.[F.category]?.presentation;
153
153
  return e === "table" || e === "cards" ? e : F.category === "phone" ? "cards" : "table";
154
- }, [x?.responsive, F.category]), bn = d(() => $e({
154
+ }, [x?.responsive, F.category]), xn = d(() => et({
155
155
  entity: S,
156
156
  screen: x,
157
157
  savedViewColumns: P?.columns
@@ -159,12 +159,12 @@ function m({ screenCode: s }) {
159
159
  S,
160
160
  x,
161
161
  P?.columns
162
- ]), xn = d(() => et({
162
+ ]), Sn = d(() => tt({
163
163
  entity: S,
164
164
  screen: x,
165
165
  presentation: I,
166
166
  visibleColumns: N,
167
- card: bn,
167
+ card: xn,
168
168
  rowActions: D,
169
169
  toolbarActions: T,
170
170
  bulkActions: E,
@@ -175,41 +175,41 @@ function m({ screenCode: s }) {
175
175
  x,
176
176
  I,
177
177
  N,
178
- bn,
178
+ xn,
179
179
  D,
180
180
  T,
181
181
  E,
182
182
  M,
183
183
  _?.screens
184
- ]), Sn = Ae({
184
+ ]), Cn = je({
185
185
  entity: S,
186
186
  entityCode: C,
187
187
  screen: x,
188
188
  screenCode: s,
189
189
  page: O,
190
- perPage: Rt,
191
- sortForRequest: tn,
192
- debouncedSearch: yn,
190
+ perPage: zt,
191
+ sortForRequest: nn,
192
+ debouncedSearch: bn,
193
193
  filters: j,
194
194
  isHeld: k.isHeld,
195
195
  prefetchWhileHeld: k.prefetchWhileHeld,
196
196
  retryHeld: k.retryViews,
197
- includeDeleted: Mt,
198
- expand: xn.expandFields,
199
- select: xn.selectFields,
197
+ includeDeleted: Nt,
198
+ expand: Sn.expandFields,
199
+ select: Sn.selectFields,
200
200
  runCountQuery: !0,
201
201
  urlKey: `${C ?? ""}|${h.toString()}`
202
- }), { rows: L, meta: Cn, refs: wn, isLoading: Tn, isFetching: En, isShowingPreviousRows: Dn, isError: On, error: kn, isLoadingStale: An, retry: jn, countTotal: Mn, countStrategy: Nn, countLoading: Pn, countError: Fn, totalPages: R, hasMorePages: In, isCursor: Ln, fetchNextPage: Rn, isFetchingNextPage: zn } = Sn;
203
- e(!Tn);
204
- let Bn = Ne(S, L, En), { state: Vn, setState: z, ids: B, pkValues: Hn, rows: Un, keyOf: V } = Bn, Wn = ce(S?.realtime, C ?? ""), Gn = o(C ?? ""), H = f(wn);
205
- H.current = wn;
206
- let Kn = d(() => {
202
+ }), { rows: L, meta: wn, refs: Tn, isLoading: En, isFetching: Dn, isShowingPreviousRows: On, isError: kn, error: An, isLoadingStale: jn, retry: Mn, countTotal: Nn, countStrategy: Pn, countLoading: Fn, countError: In, totalPages: R, hasMorePages: Ln, isCursor: Rn, fetchNextPage: zn, isFetchingNextPage: Bn } = Cn;
203
+ e(!En);
204
+ let Vn = Pe(S, L, Dn), { state: Hn, setState: z, ids: B, pkValues: Un, rows: Wn, keyOf: V } = Vn, Gn = ce(S?.realtime, C ?? ""), Kn = o(C ?? ""), H = f(Tn);
205
+ H.current = Tn;
206
+ let qn = d(() => {
207
207
  let e = /* @__PURE__ */ new Map();
208
208
  if (!S) return e;
209
- for (let t of tt(S, x, P?.columns)) {
209
+ for (let t of nt(S, x, P?.columns)) {
210
210
  if (t.startsWith("$") || S.files?.get(t)) continue;
211
211
  let n = S.fields.get(t);
212
- n && e.set(t, nt({
212
+ n && e.set(t, rt({
213
213
  field: n,
214
214
  fieldName: t,
215
215
  surface: "list",
@@ -231,96 +231,96 @@ function m({ screenCode: s }) {
231
231
  _?.screens,
232
232
  H,
233
233
  c
234
- ]), { labelFor: qn, refs: Jn } = Ge(Jt, j, wn, _?.entities), U = Fe({
234
+ ]), { labelFor: Jn, refs: Yn } = Ke(Yt, j, Tn, _?.entities), U = Ie({
235
235
  entity: S,
236
236
  screen: x,
237
237
  screens: _?.screens,
238
238
  entities: _?.entities,
239
239
  searchParams: h,
240
240
  tabNavigate: m,
241
- commitScreenTabSearch: Lt,
241
+ commitScreenTabSearch: Rt,
242
242
  isPhone: F.category === "phone",
243
- canUpdate: Et
244
- }), { peekAllowed: W, peekRow: G, setPeekRow: K, peekFields: Yn, peekActions: Xn, peekExecute: Zn, contextMenu: q, setContextMenu: Qn } = U, J = d(() => !x || !S ? !1 : de(x, "_", S, _?.screens) !== null, [
243
+ canUpdate: Dt
244
+ }), { peekAllowed: W, peekRow: G, setPeekRow: K, peekFields: Xn, peekActions: Zn, peekExecute: Qn, contextMenu: q, setContextMenu: $n } = U, J = d(() => !x || !S ? !1 : de(x, "_", S, _?.screens) !== null, [
245
245
  x,
246
246
  S,
247
247
  _?.screens
248
- ]), $n = d(() => Ye({
248
+ ]), er = d(() => Xe({
249
249
  visibleCols: N,
250
250
  entity: S,
251
251
  screen: x,
252
252
  schema: _,
253
253
  entityCode: C,
254
254
  rowActions: D,
255
- hasBatchActions: kt,
256
- hasExplicitRowActions: Ot,
257
- canUpdate: Et,
258
- canDelete: Dt,
255
+ hasBatchActions: At,
256
+ hasExplicitRowActions: kt,
257
+ canUpdate: Dt,
258
+ canDelete: Ot,
259
259
  peekEnabled: W,
260
260
  hasDetailTarget: J,
261
261
  t: c,
262
262
  tabNavigate: m,
263
263
  refsRef: H,
264
- rowSelectionKey: Me,
264
+ rowSelectionKey: Ne,
265
265
  setPeekRow: K
266
266
  }), [
267
267
  x,
268
268
  S,
269
269
  N,
270
270
  m,
271
- kt,
271
+ At,
272
272
  D,
273
- Ot,
273
+ kt,
274
274
  C,
275
275
  W,
276
276
  J,
277
277
  _,
278
278
  c,
279
- Et,
280
279
  Dt,
280
+ Ot,
281
281
  H,
282
282
  K
283
- ]), Y = mt({
284
- features: De,
283
+ ]), Y = ht({
284
+ features: Oe,
285
285
  data: L,
286
- columns: $n,
286
+ columns: er,
287
287
  manualSorting: !0,
288
288
  enableColumnResizing: !0,
289
289
  columnResizeMode: "onChange",
290
- onColumnSizingChange: fn,
290
+ onColumnSizingChange: pn,
291
291
  state: {
292
- sorting: nn,
293
- rowSelection: Vn,
294
- columnSizing: dn
292
+ sorting: rn,
293
+ rowSelection: Hn,
294
+ columnSizing: fn
295
295
  },
296
296
  onSortingChange: (e) => {
297
- let t = (typeof e == "function" ? e(nn) : e).slice(0, 5);
297
+ let t = (typeof e == "function" ? e(rn) : e).slice(0, 5);
298
298
  if (t.length === 0) {
299
- rn([]);
299
+ an([]);
300
300
  return;
301
301
  }
302
302
  let n = t.map((e) => {
303
- let t = $t.get(e.id);
303
+ let t = en.get(e.id);
304
304
  return {
305
305
  field: e.id,
306
306
  dir: e.desc ? "desc" : "asc",
307
307
  ...t ? { nulls: t } : {}
308
308
  };
309
309
  });
310
- rn(n);
310
+ an(n);
311
311
  },
312
312
  onRowSelectionChange: z,
313
313
  getRowId: V
314
- }), X = Y.state.columnResizing.isResizingColumn, er = f(!1);
314
+ }), X = Y.state.columnResizing.isResizingColumn, tr = f(!1);
315
315
  u(() => {
316
- let e = !!er.current && !X;
317
- er.current = X, e && mn(Y.state.columnSizing);
316
+ let e = !!tr.current && !X;
317
+ tr.current = X, e && hn(Y.state.columnSizing);
318
318
  }, [
319
319
  X,
320
- mn,
320
+ hn,
321
321
  Y
322
322
  ]);
323
- let tr = Ze(Y), nr = Y.getTotalSize();
323
+ let nr = Qe(Y), rr = Y.getTotalSize();
324
324
  u(() => {
325
325
  let e = (e) => {
326
326
  let t = e.target?.tagName;
@@ -328,25 +328,25 @@ function m({ screenCode: s }) {
328
328
  };
329
329
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
330
330
  }, []);
331
- let Z = f(null), { rows: Q } = Y.getRowModel(), rr = f(null), ir = Qe({
331
+ let Z = f(null), { rows: Q } = Y.getRowModel(), ir = f(null), ar = $e({
332
332
  visibleCols: N,
333
- onReorder: pn,
333
+ onReorder: mn,
334
334
  scrollElRef: Z,
335
- theadRef: rr
336
- }), ar = se((e) => e.density), or = se((e) => e.zebra), sr = i(), $ = ht({
335
+ theadRef: ir
336
+ }), or = se((e) => e.density), sr = se((e) => e.zebra), cr = i(), $ = gt({
337
337
  count: Q.length,
338
338
  getScrollElement: () => Z.current,
339
339
  estimateSize: () => I === "cards" ? 142 : 48,
340
340
  overscan: 10,
341
- initialOffset: sr
342
- }), cr = d(() => Q.map((e) => e.id), [Q]);
341
+ initialOffset: cr
342
+ }), lr = d(() => Q.map((e) => e.id), [Q]);
343
343
  a({
344
344
  virtualizer: $,
345
345
  scrollElementRef: Z,
346
- rowKeys: cr
346
+ rowKeys: lr
347
347
  }), u(() => {
348
348
  $.measure();
349
- }, [ar, $]), u(() => {
349
+ }, [or, $]), u(() => {
350
350
  $.measure();
351
351
  }, [
352
352
  F.width,
@@ -354,52 +354,52 @@ function m({ screenCode: s }) {
354
354
  I,
355
355
  $
356
356
  ]);
357
- let lr = l((e) => {
357
+ let ur = l((e) => {
358
358
  g((t) => {
359
359
  let n = new URLSearchParams(t);
360
360
  return e ? n.set("search", e) : n.delete("search"), n.set("page", "1"), n;
361
361
  });
362
- }, [g]), [ur, dr] = t(zt, lr), fr = l(() => {
362
+ }, [g]), [dr, fr] = t(Bt, ur), pr = l(() => {
363
363
  g((e) => {
364
364
  let t = new URLSearchParams(e);
365
365
  return t.get("include_deleted") ? t.delete("include_deleted") : t.set("include_deleted", "true"), t.set("page", "1"), t;
366
366
  });
367
- }, [g]), pr = l((e) => {
367
+ }, [g]), mr = l((e) => {
368
368
  g((t) => {
369
369
  let n = new URLSearchParams(t);
370
370
  return n.set("page", String(e)), n;
371
371
  });
372
372
  }, [g]);
373
373
  u(() => {
374
- R !== void 0 && O > R && pr(R);
374
+ R !== void 0 && O > R && mr(R);
375
375
  }, [
376
376
  R,
377
377
  O,
378
- pr
378
+ mr
379
379
  ]);
380
- let mr = l((e) => {
380
+ let hr = l((e) => {
381
381
  g((t) => {
382
382
  let n = new URLSearchParams(t);
383
383
  return n.set("per_page", String(e)), n.set("page", "1"), n;
384
384
  });
385
385
  }, [g]);
386
386
  if (!x || !S) return null;
387
- let hr = S.display, gr = c(x.display?.name) || c(hr.name), _r = x.display?.icon || hr.icon, vr = c(x.display?.description) || c(hr.description), yr = F.category === "phone", br = I === "cards", xr = Hn.map((e) => me(S, e)), Sr = {
387
+ let gr = S.display, _r = c(x.display?.name) || c(gr.name), vr = x.display?.icon || gr.icon, yr = c(x.display?.description) || c(gr.description), br = F.category === "phone", xr = I === "cards", Sr = Un.map((e) => he(S, e)), Cr = {
388
388
  entity: S,
389
389
  entityCode: C ?? "",
390
390
  screen: x,
391
391
  screenRoute: x.route,
392
- selectedRows: Un,
393
- selectedIds: xr,
392
+ selectedRows: Wn,
393
+ selectedIds: Sr,
394
394
  t: c,
395
395
  tabNavigate: (e, t) => m(e, {
396
396
  title: t?.title,
397
397
  icon: t?.icon,
398
398
  search: t?.search
399
399
  }),
400
- runActionApi: (e, t) => ye(e, t)
400
+ runActionApi: (e, t) => be(e, t)
401
401
  };
402
- return /* @__PURE__ */ ft("div", {
402
+ return /* @__PURE__ */ pt("div", {
403
403
  style: {
404
404
  display: "flex",
405
405
  flexDirection: "column",
@@ -407,10 +407,10 @@ function m({ screenCode: s }) {
407
407
  background: "var(--background)"
408
408
  },
409
409
  children: [
410
- /* @__PURE__ */ ft(dt, { children: [
411
- /* @__PURE__ */ p(qe, {
412
- title: gr,
413
- description: vr,
410
+ /* @__PURE__ */ pt(ft, { children: [
411
+ /* @__PURE__ */ p(Je, {
412
+ title: _r,
413
+ description: yr,
414
414
  toolbarActions: T,
415
415
  screenActionLayout: x.action_layout,
416
416
  entityActionLayout: S.action_layout,
@@ -418,75 +418,75 @@ function m({ screenCode: s }) {
418
418
  data: L,
419
419
  rowKey: V,
420
420
  onActionSuccess: () => z({}),
421
- widgetContext: Sr
421
+ widgetContext: Cr
422
422
  }),
423
- /* @__PURE__ */ p(Be, {
423
+ /* @__PURE__ */ p(Ve, {
424
424
  screen: x,
425
425
  entity: S,
426
426
  entityCode: C,
427
427
  schema: _,
428
428
  screenCode: s,
429
- screenName: gr,
430
- isPhone: yr,
431
- isCardsPresentation: br,
432
- sort: Qt,
433
- columns: un,
434
- views: hn,
435
- query: Sn,
436
- selection: Bn,
429
+ screenName: _r,
430
+ isPhone: br,
431
+ isCardsPresentation: xr,
432
+ sort: $t,
433
+ columns: dn,
434
+ views: gn,
435
+ query: Cn,
436
+ selection: Vn,
437
437
  filters: {
438
438
  json: j,
439
- debouncedSearch: yn,
440
- count: Xt,
439
+ debouncedSearch: bn,
440
+ count: Zt,
441
441
  onOpen: () => v(!0)
442
442
  },
443
- searchValue: ur,
444
- onSearchChange: dr,
443
+ searchValue: dr,
444
+ onSearchChange: fr,
445
445
  onSaveView: () => y(!0),
446
446
  onDeleteView: b,
447
447
  page: O,
448
- perPage: Rt,
449
- includeDeleted: Mt,
450
- canViewDeleted: jt,
451
- onToggleDeleted: fr,
448
+ perPage: zt,
449
+ includeDeleted: Nt,
450
+ canViewDeleted: Mt,
451
+ onToggleDeleted: pr,
452
452
  realtime: S?.realtime === !0,
453
- isLive: Wn
453
+ isLive: Gn
454
454
  }),
455
- /* @__PURE__ */ p(We, {
456
- filterError: Bt,
455
+ /* @__PURE__ */ p(Ge, {
456
+ filterError: Vt,
457
457
  unresolvedViewId: k.isUnresolved ? k.activeId : null,
458
- onClearFilters: Gt,
458
+ onClearFilters: Kt,
459
459
  onClearView: k.clearActiveView
460
460
  }),
461
- Kt.omitted && /* @__PURE__ */ p(ke, { className: "px-5 pb-2.5" }),
461
+ qt.omitted && /* @__PURE__ */ p(Ae, { className: "px-5 pb-2.5" }),
462
462
  j.length > 0 && /* @__PURE__ */ p("div", {
463
463
  style: { padding: "0 20px 10px" },
464
- children: /* @__PURE__ */ p(Te, {
464
+ children: /* @__PURE__ */ p(Ee, {
465
465
  filters: j,
466
- resolveValue: qn,
467
- onRemoveAtPath: (e) => A(Se(j, e)),
468
- onClearAll: Zt,
466
+ resolveValue: Jn,
467
+ onRemoveAtPath: (e) => A(Ce(j, e)),
468
+ onClearAll: Qt,
469
469
  onChipClick: () => v(!0),
470
- fieldLabel: Yt
470
+ fieldLabel: Xt
471
471
  })
472
472
  })
473
473
  ] }),
474
- /* @__PURE__ */ p(Re, {
475
- isLoading: Tn,
476
- tableLoadingStale: An,
477
- isError: On,
478
- error: kn,
474
+ /* @__PURE__ */ p(ze, {
475
+ isLoading: En,
476
+ tableLoadingStale: jn,
477
+ isError: kn,
478
+ error: An,
479
479
  rowCount: L.length,
480
480
  entity: S,
481
481
  screen: x,
482
- screenName: gr,
483
- screenIcon: _r,
484
- isFiltered: !!yn || Xt > 0,
485
- canCreate: Tt,
482
+ screenName: _r,
483
+ screenIcon: vr,
484
+ isFiltered: !!bn || Zt > 0,
485
+ canCreate: Et,
486
486
  toolbarActions: T,
487
- onRetry: jn
487
+ onRetry: Mn
488
488
  }),
489
- Tn || On || L.length === 0 ? null : /* @__PURE__ */ p("div", {
489
+ En || kn || L.length === 0 ? null : /* @__PURE__ */ p("div", {
490
490
  style: {
491
491
  flex: 1,
492
492
  minHeight: 0,
@@ -494,7 +494,7 @@ function m({ screenCode: s }) {
494
494
  display: "flex",
495
495
  flexDirection: "column"
496
496
  },
497
- children: /* @__PURE__ */ ft("div", {
497
+ children: /* @__PURE__ */ pt("div", {
498
498
  style: {
499
499
  background: "var(--surface)",
500
500
  border: "1px solid var(--border)",
@@ -515,9 +515,9 @@ function m({ screenCode: s }) {
515
515
  flex: 1,
516
516
  minHeight: 0
517
517
  },
518
- children: I === "cards" ? /* @__PURE__ */ p(lt, {
518
+ children: I === "cards" ? /* @__PURE__ */ p(ut, {
519
519
  fallback: null,
520
- children: /* @__PURE__ */ p(gt, {
520
+ children: /* @__PURE__ */ p(_t, {
521
521
  rows: Q,
522
522
  virtualizer: $,
523
523
  entity: S,
@@ -526,100 +526,100 @@ function m({ screenCode: s }) {
526
526
  entities: _?.entities,
527
527
  savedViewColumns: P?.columns,
528
528
  refs: H.current,
529
- renderers: Kn,
529
+ renderers: qn,
530
530
  rowActions: D,
531
531
  tabNavigate: m,
532
532
  interaction: U,
533
- hasSoftDelete: At,
534
- zebra: or,
535
- hasBatchActions: kt,
533
+ hasSoftDelete: jt,
534
+ zebra: sr,
535
+ hasBatchActions: At,
536
536
  hasDetailTarget: J,
537
537
  rowKey: V
538
538
  })
539
- }) : /* @__PURE__ */ p(Ie, {
540
- showsPreviousRows: Dn,
539
+ }) : /* @__PURE__ */ p(Le, {
540
+ showsPreviousRows: On,
541
541
  table: Y,
542
- columns: $n,
542
+ columns: er,
543
543
  rows: Q,
544
544
  entity: S,
545
- columnSizeVars: tr,
546
- totalColumnsWidth: nr,
547
- theadRef: rr,
545
+ columnSizeVars: nr,
546
+ totalColumnsWidth: rr,
547
+ theadRef: ir,
548
548
  virtualizer: $,
549
549
  visibleCols: N,
550
- headerReorder: ir,
550
+ headerReorder: ar,
551
551
  sortCols: M,
552
- sortNullsMap: $t,
553
- shiftClickColumn: on,
554
- applyColumnSort: an,
555
- appendColumnSort: sn,
556
- clearColumnSort: cn,
557
- clearAllSorts: ln,
558
- renderRow: (e, t) => /* @__PURE__ */ p(Le, {
552
+ sortNullsMap: en,
553
+ shiftClickColumn: sn,
554
+ applyColumnSort: on,
555
+ appendColumnSort: cn,
556
+ clearColumnSort: ln,
557
+ clearAllSorts: un,
558
+ renderRow: (e, t) => /* @__PURE__ */ p(Re, {
559
559
  row: e,
560
560
  rowIndex: t,
561
561
  entity: S,
562
- hasSoftDelete: At,
563
- zebra: or,
562
+ hasSoftDelete: jt,
563
+ zebra: sr,
564
564
  hasDetailTarget: J,
565
565
  interaction: U,
566
566
  measureElement: $.measureElement
567
567
  }, e.id),
568
568
  isResizingColumn: X
569
569
  })
570
- }), /* @__PURE__ */ p(ze, {
571
- meta: Cn,
572
- isCursor: Ln,
573
- isPhone: yr,
570
+ }), /* @__PURE__ */ p(Be, {
571
+ meta: wn,
572
+ isCursor: Rn,
573
+ isPhone: br,
574
574
  rowsLoaded: L.length,
575
575
  selectedCount: B.length,
576
- countTotal: Mn,
577
- countStrategy: Nn,
578
- countLoading: Pn,
579
- countError: Fn,
576
+ countTotal: Nn,
577
+ countStrategy: Pn,
578
+ countLoading: Fn,
579
+ countError: In,
580
580
  page: O,
581
581
  totalPages: R,
582
- goToPage: pr,
583
- perPage: Rt,
584
- setPerPage: mr,
585
- hasMorePages: In,
586
- fetchNextPage: Rn,
587
- isFetchingNextPage: zn
582
+ goToPage: mr,
583
+ perPage: zt,
584
+ setPerPage: hr,
585
+ hasMorePages: Ln,
586
+ fetchNextPage: zn,
587
+ isFetchingNextPage: Bn
588
588
  })]
589
589
  })
590
590
  }),
591
- /* @__PURE__ */ p(Ee, {
592
- open: yt,
591
+ /* @__PURE__ */ p(De, {
592
+ open: bt,
593
593
  onClose: () => v(!1),
594
594
  filters: j,
595
595
  onApply: A,
596
- availableFields: qt,
597
- allFields: Jt,
598
- fieldLabel: Yt,
599
- resolveValue: qn,
596
+ availableFields: Jt,
597
+ allFields: Yt,
598
+ fieldLabel: Xt,
599
+ resolveValue: Jn,
600
600
  defaultFilters: x?.default_filters,
601
- refs: Jn
601
+ refs: Yn
602
602
  }),
603
- /* @__PURE__ */ p(Ue, {
604
- view: xt,
603
+ /* @__PURE__ */ p(We, {
604
+ view: St,
605
605
  onCancel: () => b(null),
606
606
  onConfirm: (e) => {
607
- hn.deleteView(e).catch(() => void 0).finally(() => b(null));
607
+ gn.deleteView(e).catch(() => void 0).finally(() => b(null));
608
608
  }
609
609
  }),
610
- /* @__PURE__ */ p(Ke, {
611
- open: bt,
612
- pending: vn,
610
+ /* @__PURE__ */ p(qe, {
611
+ open: xt,
612
+ pending: yn,
613
613
  onClose: () => y(!1),
614
- overwriteViewName: Ve(c, P),
614
+ overwriteViewName: He(c, P),
615
615
  onOverwrite: async () => {
616
- await _n(), y(!1);
616
+ await vn(), y(!1);
617
617
  },
618
618
  onSave: async (e) => {
619
- await gn(e), y(!1);
619
+ await _n(e), y(!1);
620
620
  }
621
621
  }),
622
- B.length > 0 && /* @__PURE__ */ p(Je, {
622
+ B.length > 0 && /* @__PURE__ */ p(Ye, {
623
623
  selectedIds: B,
624
624
  floatbarActions: E,
625
625
  screenActionLayout: x.action_layout,
@@ -631,9 +631,9 @@ function m({ screenCode: s }) {
631
631
  screen: x,
632
632
  onClear: () => z({}),
633
633
  onActionSuccess: () => z({}),
634
- widgetContext: Sr
634
+ widgetContext: Cr
635
635
  }),
636
- q && S && x && /* @__PURE__ */ p(Xe, {
636
+ q && S && x && /* @__PURE__ */ p(Ze, {
637
637
  x: q.x,
638
638
  y: q.y,
639
639
  row: q.row,
@@ -647,30 +647,30 @@ function m({ screenCode: s }) {
647
647
  peekAllowed: W,
648
648
  hasDetailTarget: J,
649
649
  onPeek: K,
650
- onClose: () => Qn(null)
650
+ onClose: () => $n(null)
651
651
  }),
652
- W && G && S && /* @__PURE__ */ p(_e, {
652
+ W && G && S && /* @__PURE__ */ p(ve, {
653
653
  entity: S,
654
654
  entityCode: C,
655
655
  record: G,
656
- title: pe(c, G, S) || c(S.display.name),
656
+ title: me(c, G, S) || c(S.display.name),
657
657
  recordId: (() => {
658
658
  let e = S.fields.names()?.find((e) => S.fields.get(e)?.primary);
659
- return e && S.fields.get(e)?.type !== "uuid" ? we(G[e]) : void 0;
659
+ return e && S.fields.get(e)?.type !== "uuid" ? Te(G[e]) : void 0;
660
660
  })(),
661
- fields: Yn,
661
+ fields: Xn,
662
662
  refs: H.current,
663
663
  entities: _?.entities,
664
664
  screens: _?.screens,
665
- screen: Ce(S, x, G),
666
- actions: Xn,
667
- screenActionLayout: Ce(S, x, G)?.action_layout,
665
+ screen: we(S, x, G),
666
+ actions: Zn,
667
+ screenActionLayout: we(S, x, G)?.action_layout,
668
668
  entityActionLayout: S.action_layout,
669
- executeAction: Zn,
669
+ executeAction: Qn,
670
670
  onClose: () => {
671
671
  if (S && G) {
672
672
  let e = S.fields.names()?.find((e) => S.fields.get(e)?.primary);
673
- e && ve(we(G[e]));
673
+ e && ye(Te(G[e]));
674
674
  }
675
675
  K(null);
676
676
  },
@@ -682,28 +682,28 @@ function m({ screenCode: s }) {
682
682
  K(e);
683
683
  let t = S.fields.names()?.find((e) => S.fields.get(e)?.primary);
684
684
  if (!t) return;
685
- let n = we(e[t]), r = {};
685
+ let n = Te(e[t]), r = {};
686
686
  for (let t of S.fields.names()) {
687
- let n = ot(S, e, t), i = ot(S, G, t), a = st(S, t, n), o = st(S, t, i);
687
+ let n = st(S, e, t), i = st(S, G, t), a = ct(S, t, n), o = ct(S, t, i);
688
688
  (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
689
689
  }
690
- let i = it({
690
+ let i = at({
691
691
  entity: S,
692
692
  formData: e,
693
693
  record: G,
694
694
  isNew: !1
695
695
  });
696
696
  if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
697
- let a = at(i);
698
- Gn.mutate({
697
+ let a = ot(i);
698
+ Kn.mutate({
699
699
  pkValues: n,
700
700
  data: r
701
701
  }, { onSuccess: () => {
702
- a.forEach((e) => wt.markCommitted(e));
702
+ a.forEach((e) => Tt.markCommitted(e));
703
703
  } });
704
704
  }
705
705
  })
706
706
  ]
707
707
  });
708
708
  }
709
- export { _t as SmartListPage };
709
+ export { vt as SmartListPage };