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