@declarion/react 0.87.0 → 0.89.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
@@ -64,17 +64,25 @@ function h({ screenCode: e, screen: r, entity: c, searchParams: u, setSearchPara
64
64
  u,
65
65
  h
66
66
  ]);
67
- let F = E, I = !S && !v && !N && !D && (!j || !!P);
67
+ let F = E, I = !S && !v && !N && !D && (!j || !!P), L = o(() => {
68
+ if (I) return b ? P : r?.default_view ? y.find((e) => e.source === "system" && e.id === r.default_view) : void 0;
69
+ }, [
70
+ I,
71
+ b,
72
+ P,
73
+ r?.default_view,
74
+ y
75
+ ]), R = T ?? L;
68
76
  return {
69
77
  all: y,
70
78
  activeId: S,
71
79
  active: T,
72
80
  defaults: o(() => ({
73
- ...m(c, T, r),
74
- columns: T?.columns?.length ? T.columns : r?.default_columns ?? r?.columns ?? l
81
+ ...m(c, R, r),
82
+ columns: R?.columns?.length ? R.columns : r?.default_columns ?? r?.columns ?? l
75
83
  }), [
76
84
  c,
77
- T,
85
+ R,
78
86
  r
79
87
  ]),
80
88
  clearedKey: M,
@@ -91,7 +99,8 @@ function h({ screenCode: e, screen: r, entity: c, searchParams: u, setSearchPara
91
99
  ]),
92
100
  retryViews: x,
93
101
  isUnresolved: !!S && !T && !E,
94
- isHeld: F || I
102
+ isHeld: F || I,
103
+ prefetchWhileHeld: I && !F && !b
95
104
  };
96
105
  }
97
106
  //#endregion
@@ -1,101 +1,141 @@
1
- import { entityCountQueryKey as e, entityDataQueryKey as t, useEntityCount as n, useEntityData as r } from "../../../hooks/useEntityData.js";
2
- import { cursorEntityDataQueryKey as i, useCursorEntityData as a } from "../../../hooks/useCursorEntityData.js";
3
- import { useRegisterRetainedQuery as o } from "../../../hooks/usePageStateRuntime.js";
4
- import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
5
- import { useQueryClient as d } from "@tanstack/react-query";
1
+ import { entityCountQueryKey as e, entityDataQueryKey as t, entityDataQueryOptions as n, useEntityCount as r, useEntityData as i } from "../../../hooks/useEntityData.js";
2
+ import { cursorEntityDataQueryKey as a, useCursorEntityData as o } from "../../../hooks/useCursorEntityData.js";
3
+ import { useRegisterRetainedQuery as s } from "../../../hooks/usePageStateRuntime.js";
4
+ import { correctEstimateAgainstWindow as c } from "../../../lib/format-count.js";
5
+ import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
6
+ import { useQueryClient as p } from "@tanstack/react-query";
6
7
  //#region src/components/pages/list/useListQuery.ts
7
- var f = 1e4, p = [];
8
- function m(c) {
9
- let u = d(), { entity: f, entityCode: m, screen: g, screenCode: _, page: v, perPage: y, sortForRequest: b, debouncedSearch: x, filters: S, isHeld: C, retryHeld: w, includeDeleted: T, expand: E, select: D, runCountQuery: O, urlKey: k } = c, A = S.length > 0 ? S : void 0, j = {
10
- page: v,
11
- per_page: y,
12
- sort: b,
13
- search: x || void 0,
14
- filters: A,
15
- include_deleted: T || void 0,
16
- expand: E,
17
- select: D,
8
+ var m = 1e4, h = [];
9
+ function g(f) {
10
+ let m = p(), { entity: g, entityCode: v, screen: y, screenCode: b, page: x, perPage: S, sortForRequest: C, debouncedSearch: w, filters: T, isHeld: E, prefetchWhileHeld: D, retryHeld: O, includeDeleted: k, expand: A, select: j, runCountQuery: M, urlKey: N } = f, P = T.length > 0 ? T : void 0, F = y?.fixed_filters ? b : void 0, I = d(() => ({
11
+ page: x,
12
+ per_page: S,
13
+ sort: C,
14
+ search: w || void 0,
15
+ filters: P,
16
+ include_deleted: k || void 0,
17
+ expand: A,
18
+ select: j,
18
19
  preview: !0,
19
- screen: g?.fixed_filters ? _ : void 0
20
- }, M = {
21
- sort: b,
22
- filters: A,
23
- search: x || void 0,
24
- select: D,
25
- expand: E,
26
- includeDeleted: T || void 0,
27
- screen: g?.fixed_filters ? _ : void 0,
28
- preview: !0,
29
- limit: y
30
- }, N = f?.list_pagination === "cursor", P = r(m, j, !N && !C), F = n(m, j, O && !N && !C), I = a(m, M, N && !C);
31
- o(t(m, j), !N && !C), o(i(m, M), N && !C);
32
- let L = C || (N ? I.isLoading : P.isLoading), R = l(() => C ? p : N ? I.rows : P.data?.data ?? [], [
20
+ screen: F
21
+ }), [
22
+ x,
23
+ S,
33
24
  C,
34
- N,
35
- I.rows,
36
- P.data?.data
37
- ]), z = N ? I.total : F.data?.meta?.total, B = l(() => {
38
- if (!(N || z === void 0 || y <= 0)) return Math.max(1, Math.ceil(z / y));
25
+ w,
26
+ P,
27
+ k,
28
+ A,
29
+ j,
30
+ F
31
+ ]), L = {
32
+ sort: C,
33
+ filters: P,
34
+ search: w || void 0,
35
+ select: j,
36
+ expand: A,
37
+ includeDeleted: k || void 0,
38
+ screen: y?.fixed_filters ? b : void 0,
39
+ preview: !0,
40
+ limit: S
41
+ }, R = g?.list_pagination === "cursor";
42
+ u(() => {
43
+ E && D && !R && v && m.prefetchQuery(n(v, I));
39
44
  }, [
40
- N,
41
- z,
42
- y
43
- ]), V = h(L, k), H = N ? i(m, M) : t(m, j), U = e(m, j), W = O && !N, G = s(async () => {
44
- C ? w() : m && (await Promise.all([u.cancelQueries({
45
- queryKey: H,
45
+ E,
46
+ D,
47
+ R,
48
+ v,
49
+ I,
50
+ m
51
+ ]);
52
+ let z = i(v, I, !R && !E), B = r(v, I, M && !R && !E), V = o(v, L, R && !E);
53
+ s(t(v, I), !R && !E), s(a(v, L), R && !E);
54
+ let H = E || (R ? V.isLoading : z.isLoading), U = d(() => E ? h : R ? V.rows : z.data?.data ?? [], [
55
+ E,
56
+ R,
57
+ V.rows,
58
+ z.data?.data
59
+ ]), W = d(() => {
60
+ let e = B.data?.meta?.total, t = B.data?.meta?.count_mode, n = z.data?.meta;
61
+ return e === void 0 || !t || !z.data || z.isPlaceholderData || n?.has_more === void 0 ? {
62
+ total: e,
63
+ mode: t
64
+ } : c(e, t, {
65
+ page: x,
66
+ perPage: S,
67
+ rows: z.data.data?.length ?? 0,
68
+ hasMore: n.has_more
69
+ });
70
+ }, [
71
+ B.data?.meta?.total,
72
+ B.data?.meta?.count_mode,
73
+ z.data,
74
+ z.isPlaceholderData,
75
+ x,
76
+ S
77
+ ]), G = R ? V.total : W.total, K = d(() => {
78
+ if (!(R || G === void 0 || S <= 0)) return Math.max(1, Math.ceil(G / S));
79
+ }, [
80
+ R,
81
+ G,
82
+ S
83
+ ]), q = _(H, N), J = R ? a(v, L) : t(v, I), Y = e(v, I), X = M && !R, Z = l(async () => {
84
+ E ? O() : v && (await Promise.all([m.cancelQueries({
85
+ queryKey: J,
46
86
  exact: !0
47
- }), W ? u.cancelQueries({
48
- queryKey: U,
87
+ }), X ? m.cancelQueries({
88
+ queryKey: Y,
49
89
  exact: !0
50
- }) : void 0]), await Promise.all([N ? I.refetch() : P.refetch(), W ? F.refetch() : void 0]));
90
+ }) : void 0]), await Promise.all([R ? V.refetch() : z.refetch(), X ? B.refetch() : void 0]));
51
91
  }, [
52
- C,
53
- w,
92
+ E,
93
+ O,
94
+ v,
54
95
  m,
55
- u,
56
- H,
57
- U,
58
- W,
59
- N,
60
- I,
61
- P,
62
- F
63
- ]), K = s(() => {
64
- I.fetchNextPage();
65
- }, [I]);
96
+ J,
97
+ Y,
98
+ X,
99
+ R,
100
+ V,
101
+ z,
102
+ B
103
+ ]), Q = l(() => {
104
+ V.fetchNextPage();
105
+ }, [V]);
66
106
  return {
67
- rows: R,
68
- meta: C ? void 0 : P.data?.meta,
69
- refs: C ? void 0 : N ? I.refs : P.data?.$refs,
70
- isLoading: L,
71
- isFetching: C || (N ? I.isFetching : P.isFetching),
72
- isShowingPreviousRows: !C && (N ? I.isPlaceholderData : P.isPlaceholderData),
73
- isError: C ? !1 : N ? I.isError : P.isError,
74
- error: C ? void 0 : N ? I.error : P.error,
75
- isLoadingStale: V,
76
- retry: G,
77
- countTotal: C ? void 0 : z,
78
- countStrategy: C ? void 0 : N ? I.countMode : F.data?.meta?.count_mode,
79
- countLoading: C || (N ? I.isLoading : F.isLoading),
80
- countError: !C && !N && F.isError,
81
- totalPages: B,
82
- hasMorePages: N ? I.hasMore : P.data?.meta?.has_more ?? (B !== void 0 && v < B),
83
- isCursor: N,
84
- fetchNextPage: K,
85
- isFetchingNextPage: I.isFetchingNextPage
107
+ rows: U,
108
+ meta: E ? void 0 : z.data?.meta,
109
+ refs: E ? void 0 : R ? V.refs : z.data?.$refs,
110
+ isLoading: H,
111
+ isFetching: E || (R ? V.isFetching : z.isFetching),
112
+ isShowingPreviousRows: !E && (R ? V.isPlaceholderData : z.isPlaceholderData),
113
+ isError: E ? !1 : R ? V.isError : z.isError,
114
+ error: E ? void 0 : R ? V.error : z.error,
115
+ isLoadingStale: q,
116
+ retry: Z,
117
+ countTotal: E ? void 0 : G,
118
+ countStrategy: E ? void 0 : R ? V.countMode : W.mode,
119
+ countLoading: E || (R ? V.isLoading : B.isLoading),
120
+ countError: !E && !R && B.isError,
121
+ totalPages: K,
122
+ hasMorePages: R ? V.hasMore : z.data?.meta?.has_more ?? (K !== void 0 && x < K),
123
+ isCursor: R,
124
+ fetchNextPage: Q,
125
+ isFetchingNextPage: V.isFetchingNextPage
86
126
  };
87
127
  }
88
- function h(e, t) {
89
- let [n, r] = u(!1);
90
- return c(() => {
128
+ function _(e, t) {
129
+ let [n, r] = f(!1);
130
+ return u(() => {
91
131
  if (!e) {
92
132
  r(!1);
93
133
  return;
94
134
  }
95
135
  r(!1);
96
- let t = window.setTimeout(() => r(!0), f);
136
+ let t = window.setTimeout(() => r(!0), m);
97
137
  return () => window.clearTimeout(t);
98
138
  }, [e, t]), n;
99
139
  }
100
140
  //#endregion
101
- export { m as useListQuery };
141
+ export { g as useListQuery };
@@ -1,122 +1,122 @@
1
1
  import { coerceDisplayString as e } from "../../../lib/display-value.js";
2
- import { buildEntityDetailHref as t, extractPkValues as n, fieldDisplayName as r, getDisplayValue as i, pkValuesToDetailId as a, rowSetInTenant as o } from "../../../types/schema.js";
3
- import { useText as s } from "../../../hooks/useText.js";
2
+ import { buildEntityDetailHref as t, extractPkValues as n, fieldDisplayName as r, getDisplayValue as i, isUserEditableField as a, pkValuesToDetailId as o, rowSetInTenant as s } from "../../../types/schema.js";
4
3
  import { buildActionBody as c, executeAction as l } from "../../../api/data.js";
5
- import { resolveSchemaFieldLabel as u } from "../../file-widgets/host.js";
6
- import { useRowTenant as d } from "../../../hooks/useRowTenant.js";
7
- import { effectiveScreenForRecord as f } from "../../../lib/variants.js";
8
- import { setPeekDraft as p } from "../../list/peekDraftStore.js";
9
- import { resolveQuickPeekFieldNames as m } from "./cardProjection.js";
10
- import { rowSelectionKey as h } from "./useListSelection.js";
11
- import { classifyRowClick as g, isInteractiveRowTarget as _ } from "../../../lib/rowClickGesture.js";
12
- import { useLongPress as v } from "../../../hooks/useLongPress.js";
13
- import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
4
+ import { useText as u } from "../../../hooks/useText.js";
5
+ import { resolveSchemaFieldLabel as d } from "../../file-widgets/host.js";
6
+ import { useRowTenant as f } from "../../../hooks/useRowTenant.js";
7
+ import { effectiveScreenForRecord as p } from "../../../lib/variants.js";
8
+ import { setPeekDraft as m } from "../../list/peekDraftStore.js";
9
+ import { resolveQuickPeekFieldNames as h } from "./cardProjection.js";
10
+ import { rowSelectionKey as g } from "./useListSelection.js";
11
+ import { classifyRowClick as _, isInteractiveRowTarget as v } from "../../../lib/rowClickGesture.js";
12
+ import { useLongPress as y } from "../../../hooks/useLongPress.js";
13
+ import { useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
14
14
  //#region src/components/pages/list/useListRowInteraction.ts
15
- function w({ entity: w, screen: T, screens: E, entities: D, searchParams: O, tabNavigate: k, commitScreenTabSearch: A, isPhone: j, canUpdate: M }) {
16
- let N = s(), P = d(w), [F, I] = C(null), [L, R] = C(null), z = S(null), B = S(null);
17
- b(() => () => {
18
- B.current && clearTimeout(B.current.timer);
15
+ function T({ entity: T, screen: E, screens: D, entities: O, searchParams: k, tabNavigate: A, commitScreenTabSearch: j, isPhone: M, canUpdate: N }) {
16
+ let P = u(), F = f(T), [I, L] = w(null), [R, z] = w(null), B = C(null), V = C(null);
17
+ x(() => () => {
18
+ V.current && clearTimeout(V.current.timer);
19
19
  }, []);
20
- let V = T?.on_row_click === "peek" && T.quick_peek?.enabled !== !1 && !j, H = y((e, r) => {
21
- if (!w || !T) return;
22
- let o = n(w, e), s = a(w, o), c = t(T, w, E, o);
20
+ let H = E?.on_row_click === "peek" && E.quick_peek?.enabled !== !1 && !M, U = b((e, r) => {
21
+ if (!T || !E) return;
22
+ let a = n(T, e), s = o(T, a), c = t(E, T, D, a);
23
23
  if (!c) return;
24
24
  if (r?.draft) {
25
- p(s, r.draft);
25
+ m(s, r.draft);
26
26
  let [e, t] = c.split("?", 2), n = new URLSearchParams(t ?? "");
27
27
  n.set("edit", "true"), c = `${e}?${n.toString()}`;
28
28
  }
29
- let l = i(N, e, w) ?? N(w.display.name), u = T.display?.icon || w.display.icon;
30
- A(O.toString()), k(c, {
29
+ let l = i(P, e, T) ?? P(T.display.name), u = E.display?.icon || T.display.icon;
30
+ j(k.toString()), A(c, {
31
31
  title: l,
32
32
  icon: u
33
33
  });
34
34
  }, [
35
- N,
36
- w,
35
+ P,
37
36
  T,
38
37
  E,
39
- O,
38
+ D,
40
39
  k,
41
- A
42
- ]), U = v(y((e) => {
43
- let t = z.current;
44
- t && R({
40
+ A,
41
+ j
42
+ ]), W = y(b((e) => {
43
+ let t = B.current;
44
+ t && z({
45
45
  x: e.x,
46
46
  y: e.y,
47
47
  row: t
48
48
  });
49
- }, [])), W = y((e, t) => {
50
- if (U.consumePressFired() || _(e.target)) return;
51
- if (!V || !w) {
52
- H(t);
49
+ }, [])), G = b((e, t) => {
50
+ if (W.consumePressFired() || v(e.target)) return;
51
+ if (!H || !T) {
52
+ U(t);
53
53
  return;
54
54
  }
55
- let n = h(w, t);
56
- if (g(B.current, n) === "double") {
57
- clearTimeout(B.current.timer), B.current = null, I(null), H(t);
55
+ let n = g(T, t);
56
+ if (_(V.current, n) === "double") {
57
+ clearTimeout(V.current.timer), V.current = null, L(null), U(t);
58
58
  return;
59
59
  }
60
- B.current && clearTimeout(B.current.timer);
60
+ V.current && clearTimeout(V.current.timer);
61
61
  let r = setTimeout(() => {
62
- B.current = null, I(t);
62
+ V.current = null, L(t);
63
63
  }, 250);
64
- B.current = {
64
+ V.current = {
65
65
  rowId: n,
66
66
  timer: r
67
67
  };
68
68
  }, [
69
- w,
70
- V,
69
+ T,
71
70
  H,
72
- U
71
+ U,
72
+ W
73
73
  ]);
74
74
  return {
75
- peekAllowed: V,
76
- peekRow: F,
77
- setPeekRow: I,
78
- peekFields: x(() => {
79
- if (!V || !w || !F) return [];
80
- let e = f(w, T, F), t = M && o(w, F, P.tenantId);
81
- return m(w, e, E).map((e) => {
82
- if (w.files?.get(e)) return {
75
+ peekAllowed: H,
76
+ peekRow: I,
77
+ setPeekRow: L,
78
+ peekFields: S(() => {
79
+ if (!H || !T || !I) return [];
80
+ let e = p(T, E, I), t = N && s(T, I, F.tenantId);
81
+ return h(T, e, D).map((e) => {
82
+ if (T.files?.get(e)) return {
83
83
  key: e,
84
- label: u(N, w, e, D),
84
+ label: d(P, T, e, O),
85
85
  kind: "file",
86
86
  readOnly: !t
87
87
  };
88
- let n = w.fields.get(e), i = t && !n.primary && !n.auto && !n.ref && n.files?.mode !== "rich_text_inline";
88
+ let n = T.fields.get(e), i = t && a(n) && !n.ref && n.files?.mode !== "rich_text_inline";
89
89
  return {
90
90
  key: e,
91
- label: r(N, n, e, D),
91
+ label: r(P, n, e, O),
92
92
  kind: "field",
93
93
  field: n,
94
94
  readOnly: !i
95
95
  };
96
96
  });
97
97
  }, [
98
- N,
99
- V,
100
- F,
101
- w,
98
+ P,
99
+ H,
100
+ I,
102
101
  T,
103
- D,
104
102
  E,
105
- M,
106
- P
103
+ O,
104
+ D,
105
+ N,
106
+ F
107
107
  ]),
108
- peekActions: x(() => w?.actions ?? {}, [w?.actions]),
109
- peekExecute: y(async (t, n, r) => {
110
- let i = w?.fields.names().find((e) => w.fields.get(e)?.primary), a = i && F ? [e(F[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
108
+ peekActions: S(() => T?.actions ?? {}, [T?.actions]),
109
+ peekExecute: b(async (t, n, r) => {
110
+ let i = T?.fields.names().find((e) => T.fields.get(e)?.primary), a = i && I ? [e(I[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
111
111
  return l(o, c(r, a));
112
- }, [w, F]),
113
- contextMenu: L,
114
- setContextMenu: R,
115
- pressedRow: z,
116
- longPress: U,
117
- onRowClick: W,
118
- navigateToDetail: H
112
+ }, [T, I]),
113
+ contextMenu: R,
114
+ setContextMenu: z,
115
+ pressedRow: B,
116
+ longPress: W,
117
+ onRowClick: G,
118
+ navigateToDetail: U
119
119
  };
120
120
  }
121
121
  //#endregion
122
- export { w as useListRowInteraction };
122
+ export { T as useListRowInteraction };
@@ -1,7 +1,7 @@
1
1
  import { buildDetailHrefFromId as e } from "../../../types/schema.js";
2
2
  import { useSchema as t } from "../../../hooks/useSchema.js";
3
- import { useText as n } from "../../../hooks/useText.js";
4
- import { buildActionBody as r, executeAction as i } from "../../../api/data.js";
3
+ import { buildActionBody as n, executeAction as r } from "../../../api/data.js";
4
+ import { useText as i } from "../../../hooks/useText.js";
5
5
  import { PEEK_ACTION_CODE as a, applyRowState as o, defaultFlatForSlot as s, filterLayoutForSlot as c } from "../../../lib/actions.js";
6
6
  import { useActionRunner as l } from "../../actions/ActionRunner.js";
7
7
  import { dispatchAction as u } from "../../../lib/action-dispatch.js";
@@ -30,7 +30,7 @@ function _(e, t) {
30
30
  return !1;
31
31
  }
32
32
  function v({ row: v, rowId: y, screen: b, fullScreen: x, entity: S, entityCode: C, rowActions: w, tabNavigate: T, peekAllowed: E, hasDetailTarget: D, onPeek: O }) {
33
- let k = n(), A = d(S), j = n("errors"), { run: M } = l(), { data: N } = t(), P = x.detail_screen === void 0 && b.detail_screen !== void 0 ? {
33
+ let k = i(), A = d(S), j = i("errors"), { run: M } = l(), { data: N } = t(), P = x.detail_screen === void 0 && b.detail_screen !== void 0 ? {
34
34
  ...x,
35
35
  detail_screen: b.detail_screen
36
36
  } : x, F = f(S, P, v) ?? P, I = h(() => {
@@ -50,7 +50,7 @@ function v({ row: v, rowId: y, screen: b, fullScreen: x, entity: S, entityCode:
50
50
  icon: t?.icon,
51
51
  search: t?.search
52
52
  }),
53
- runActionApi: (e, t) => i(e, t),
53
+ runActionApi: (e, t) => r(e, t),
54
54
  openPeek: (e) => O(e ?? v),
55
55
  recordHref: (t) => e(F, t, S, N?.screens)
56
56
  }), [
@@ -86,12 +86,12 @@ function v({ row: v, rowId: y, screen: b, fullScreen: x, entity: S, entityCode:
86
86
  layout: z,
87
87
  entityActions: I,
88
88
  runRowAction: m((e, t) => {
89
- let n = u(j, e, t, { row: v });
90
- if (n !== null) return M({
89
+ let i = u(j, e, t, { row: v });
90
+ if (i !== null) return M({
91
91
  action: t,
92
92
  title: k(t.display?.name) || e,
93
93
  row: v,
94
- execute: (e) => i(n, r(e, [y]))
94
+ execute: (e) => r(i, n(e, [y]))
95
95
  });
96
96
  }, [
97
97
  k,