@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.
- package/dist-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- 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,
|
|
74
|
-
columns:
|
|
81
|
+
...m(c, R, r),
|
|
82
|
+
columns: R?.columns?.length ? R.columns : r?.default_columns ?? r?.columns ?? l
|
|
75
83
|
}), [
|
|
76
84
|
c,
|
|
77
|
-
|
|
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,
|
|
2
|
-
import { cursorEntityDataQueryKey as
|
|
3
|
-
import { useRegisterRetainedQuery as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
page:
|
|
11
|
-
per_page:
|
|
12
|
-
sort:
|
|
13
|
-
search:
|
|
14
|
-
filters:
|
|
15
|
-
include_deleted:
|
|
16
|
-
expand:
|
|
17
|
-
select:
|
|
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:
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
}),
|
|
48
|
-
queryKey:
|
|
87
|
+
}), X ? m.cancelQueries({
|
|
88
|
+
queryKey: Y,
|
|
49
89
|
exact: !0
|
|
50
|
-
}) : void 0]), await Promise.all([
|
|
90
|
+
}) : void 0]), await Promise.all([R ? V.refetch() : z.refetch(), X ? B.refetch() : void 0]));
|
|
51
91
|
}, [
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
E,
|
|
93
|
+
O,
|
|
94
|
+
v,
|
|
54
95
|
m,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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:
|
|
68
|
-
meta:
|
|
69
|
-
refs:
|
|
70
|
-
isLoading:
|
|
71
|
-
isFetching:
|
|
72
|
-
isShowingPreviousRows: !
|
|
73
|
-
isError:
|
|
74
|
-
error:
|
|
75
|
-
isLoadingStale:
|
|
76
|
-
retry:
|
|
77
|
-
countTotal:
|
|
78
|
-
countStrategy:
|
|
79
|
-
countLoading:
|
|
80
|
-
countError: !
|
|
81
|
-
totalPages:
|
|
82
|
-
hasMorePages:
|
|
83
|
-
isCursor:
|
|
84
|
-
fetchNextPage:
|
|
85
|
-
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
|
|
89
|
-
let [n, r] =
|
|
90
|
-
return
|
|
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),
|
|
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 {
|
|
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,
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
21
|
-
if (!
|
|
22
|
-
let
|
|
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
|
-
|
|
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(
|
|
30
|
-
|
|
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
|
-
|
|
36
|
-
w,
|
|
35
|
+
P,
|
|
37
36
|
T,
|
|
38
37
|
E,
|
|
39
|
-
|
|
38
|
+
D,
|
|
40
39
|
k,
|
|
41
|
-
A
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
t
|
|
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
|
-
}, [])),
|
|
50
|
-
if (
|
|
51
|
-
if (!
|
|
52
|
-
|
|
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 =
|
|
56
|
-
if (
|
|
57
|
-
clearTimeout(
|
|
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
|
-
|
|
60
|
+
V.current && clearTimeout(V.current.timer);
|
|
61
61
|
let r = setTimeout(() => {
|
|
62
|
-
|
|
62
|
+
V.current = null, L(t);
|
|
63
63
|
}, 250);
|
|
64
|
-
|
|
64
|
+
V.current = {
|
|
65
65
|
rowId: n,
|
|
66
66
|
timer: r
|
|
67
67
|
};
|
|
68
68
|
}, [
|
|
69
|
-
|
|
70
|
-
V,
|
|
69
|
+
T,
|
|
71
70
|
H,
|
|
72
|
-
U
|
|
71
|
+
U,
|
|
72
|
+
W
|
|
73
73
|
]);
|
|
74
74
|
return {
|
|
75
|
-
peekAllowed:
|
|
76
|
-
peekRow:
|
|
77
|
-
setPeekRow:
|
|
78
|
-
peekFields:
|
|
79
|
-
if (!
|
|
80
|
-
let e =
|
|
81
|
-
return
|
|
82
|
-
if (
|
|
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:
|
|
84
|
+
label: d(P, T, e, O),
|
|
85
85
|
kind: "file",
|
|
86
86
|
readOnly: !t
|
|
87
87
|
};
|
|
88
|
-
let n =
|
|
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(
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
w,
|
|
98
|
+
P,
|
|
99
|
+
H,
|
|
100
|
+
I,
|
|
102
101
|
T,
|
|
103
|
-
D,
|
|
104
102
|
E,
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
O,
|
|
104
|
+
D,
|
|
105
|
+
N,
|
|
106
|
+
F
|
|
107
107
|
]),
|
|
108
|
-
peekActions:
|
|
109
|
-
peekExecute:
|
|
110
|
-
let i =
|
|
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
|
-
}, [
|
|
113
|
-
contextMenu:
|
|
114
|
-
setContextMenu:
|
|
115
|
-
pressedRow:
|
|
116
|
-
longPress:
|
|
117
|
-
onRowClick:
|
|
118
|
-
navigateToDetail:
|
|
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 {
|
|
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 {
|
|
4
|
-
import {
|
|
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 =
|
|
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) =>
|
|
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
|
|
90
|
-
if (
|
|
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
|
|
94
|
+
execute: (e) => r(i, n(e, [y]))
|
|
95
95
|
});
|
|
96
96
|
}, [
|
|
97
97
|
k,
|