@declarion/react 0.54.0 → 0.56.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/{DraggableChildrenTable-CPoUY99R.js → DraggableChildrenTable-BV5sb8Uo.js} +32 -32
- package/dist-lib/{Grid--QAEby8k.js → Grid-DWgUPuZ3.js} +45 -45
- package/dist-lib/{JsonEditor-DoNmyrYd.js → JsonEditor-Dz1PQHC8.js} +2 -2
- package/dist-lib/{LayoutRenderer-BxZ7Nd9b.js → LayoutRenderer-C9AH9cXf.js} +716 -714
- package/dist-lib/{ListCardsBody-BPV4GPrv.js → ListCardsBody-DXcDg536.js} +29 -29
- package/dist-lib/{MarkdownRenderer-CIKuh_0i.js → MarkdownRenderer-CcSFc2N3.js} +1 -1
- package/dist-lib/{RefreshControl-DMLkZP3R.js → RefreshControl-CNtN8zSl.js} +41 -41
- package/dist-lib/{SmartDetailPage.impl-SnNu6Ug-.js → SmartDetailPage.impl-lskCd-WG.js} +492 -492
- package/dist-lib/{SmartListPage.impl-C73pR7Iw.js → SmartListPage.impl-CrGbdzyK.js} +744 -743
- package/dist-lib/{SmartRecordListPage.impl-rJjQZe1V.js → SmartRecordListPage.impl-Bkl9aZJ8.js} +129 -129
- package/dist-lib/{SortHeaderMenu-DQ_KrkWk.js → SortHeaderMenu-SYSAaqQJ.js} +1 -1
- package/dist-lib/{action-dispatch-DsuUS7ae.js → action-dispatch-CR4ajBtT.js} +179 -179
- package/dist-lib/api/auth.d.ts +1 -1
- package/dist-lib/api/batch.d.ts +1 -1
- package/dist-lib/api/data.d.ts +3 -3
- package/dist-lib/api/entities.d.ts +1 -1
- package/dist-lib/api/events.d.ts +13 -4
- package/dist-lib/api/params.d.ts +1 -1
- package/dist-lib/api/properties.d.ts +1 -1
- package/dist-lib/api/schema.d.ts +1 -1
- package/dist-lib/api/status.d.ts +1 -1
- package/dist-lib/{cardProjection-BadzqyeQ.js → cardProjection-CW5RIMko.js} +24 -24
- package/dist-lib/components/actions/ActionButton.d.ts +1 -1
- package/dist-lib/components/actions/ActionDialog.d.ts +1 -1
- package/dist-lib/components/actions/ActionRunner.d.ts +1 -1
- package/dist-lib/components/actions/ObjectActionBar.d.ts +3 -3
- package/dist-lib/components/actions/PropertyGridEditor.d.ts +2 -2
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +2 -2
- package/dist-lib/components/actions/RowActionsKebab.d.ts +1 -1
- package/dist-lib/components/agents/AgentConversationDrawer.d.ts +1 -1
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +1 -1
- package/dist-lib/components/chrome/AssociationTabs.d.ts +1 -1
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +1 -1
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +2 -2
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +2 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +3 -3
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +3 -3
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +3 -3
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +3 -3
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +1 -1
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +2 -2
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +2 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +1 -1
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +2 -2
- package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +2 -2
- package/dist-lib/components/fields/cells/factories/host-icons.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -2
- package/dist-lib/components/fields/index.d.ts +3 -3
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +3 -3
- package/dist-lib/components/file-widgets/payload.d.ts +2 -2
- package/dist-lib/components/file-widgets/types.d.ts +1 -1
- package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +1 -1
- package/dist-lib/components/filters/FilterChips.d.ts +1 -1
- package/dist-lib/components/filters/FilterDrawer.d.ts +3 -3
- package/dist-lib/components/layout/CommandPalette.d.ts +2 -2
- package/dist-lib/components/layout/Layout.d.ts +3 -3
- package/dist-lib/components/layout/Rail.d.ts +2 -2
- package/dist-lib/components/layout/Sidebar.d.ts +1 -1
- package/dist-lib/components/layout/TabStrip.d.ts +1 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/layout/tab-close.d.ts +1 -1
- package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
- package/dist-lib/components/list/PeekFieldCell.d.ts +2 -2
- package/dist-lib/components/list/QuickPeek.d.ts +3 -3
- package/dist-lib/components/list/ViewSwitcher.d.ts +1 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/ExportMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -1
- package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
- package/dist-lib/components/pages/exportRequest.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardRow.d.ts +3 -3
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +3 -3
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +3 -3
- package/dist-lib/components/pages/list/ListHeader.d.ts +3 -3
- package/dist-lib/components/pages/list/ListNoRows.d.ts +1 -1
- package/dist-lib/components/pages/list/ListTable.d.ts +2 -2
- package/dist-lib/components/pages/list/ListTableRow.d.ts +1 -1
- package/dist-lib/components/pages/list/ListToolbar.d.ts +7 -5
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +1 -1
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -1
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +1 -1
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -2
- package/dist-lib/components/pages/list/columns.d.ts +3 -3
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -2
- package/dist-lib/components/pages/list/sortable-header.d.ts +1 -1
- package/dist-lib/components/pages/list/table-features.d.ts +1 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +4 -4
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +1 -1
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -8
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSelection.d.ts +2 -2
- package/dist-lib/components/pages/list/useListSort.d.ts +1 -1
- package/dist-lib/components/pages/list/useListViews.d.ts +3 -3
- package/dist-lib/components/pages/list/useRowMenu.d.ts +3 -3
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +1 -1
- package/dist-lib/components/params/param-editors.d.ts +1 -1
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -1
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +1 -1
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +2 -2
- package/dist-lib/embed/screen-location.d.ts +1 -1
- package/dist-lib/{field-classification-sMkkAEg9.js → field-classification-D6xQYn-h.js} +271 -400
- package/dist-lib/{format-count-B5SLlNOb.js → format-count-Dobmi-Ji.js} +238 -238
- package/dist-lib/hooks/useAgentConversation.d.ts +1 -1
- package/dist-lib/hooks/useAllEntityData.d.ts +1 -1
- package/dist-lib/hooks/useAssociatedData.d.ts +1 -1
- package/dist-lib/hooks/useBranding.d.ts +4 -4
- package/dist-lib/hooks/useBrandingChrome.d.ts +2 -2
- package/dist-lib/hooks/useChildrenData.d.ts +1 -1
- package/dist-lib/hooks/useCurrentScreen.d.ts +1 -1
- package/dist-lib/hooks/useCursorEntityData.d.ts +5 -5
- package/dist-lib/hooks/useEntity.d.ts +1 -1
- package/dist-lib/hooks/useEntityData.d.ts +8 -1
- package/dist-lib/hooks/useFilters.d.ts +1 -1
- package/dist-lib/hooks/useImpersonation.d.ts +1 -1
- package/dist-lib/hooks/useLiveObject.d.ts +2 -2
- package/dist-lib/hooks/useMutations.d.ts +3 -3
- package/dist-lib/hooks/useObject.d.ts +1 -1
- package/dist-lib/hooks/useParams.d.ts +2 -2
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useResponsiveMode.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +1 -2
- package/dist-lib/hooks/useScreen.d.ts +1 -1
- package/dist-lib/hooks/useTimelineData.d.ts +2 -2
- package/dist-lib/hooks/useViews.d.ts +1 -1
- package/dist-lib/index.js +811 -811
- package/dist-lib/lib/action-dispatch.d.ts +2 -2
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/brand-tokens.d.ts +1 -1
- package/dist-lib/lib/branding.d.ts +1 -1
- package/dist-lib/lib/child-config.d.ts +1 -1
- package/dist-lib/lib/children-validation.d.ts +2 -2
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/evidence-verdict.d.ts +1 -1
- package/dist-lib/lib/mass-edit.d.ts +1 -1
- package/dist-lib/lib/messages.d.ts +2 -2
- package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
- package/dist-lib/lib/realtime-reconcile.d.ts +1 -10
- package/dist-lib/lib/realtime-resync.d.ts +23 -0
- package/dist-lib/lib/rich-text.d.ts +1 -1
- package/dist-lib/lib/schema-routing.d.ts +1 -1
- package/dist-lib/lib/screen-back.d.ts +1 -1
- package/dist-lib/lib/size-value.d.ts +1 -1
- package/dist-lib/lib/toast.d.ts +2 -2
- package/dist-lib/lib/ui-actions.d.ts +1 -1
- package/dist-lib/lib/variants.d.ts +1 -1
- package/dist-lib/{peekDraftStore-CbHFwz_F.js → peekDraftStore-5wQ7lq_V.js} +17 -17
- package/dist-lib/{registry-D0RhCnEL.js → registry-CjgUaF7C.js} +511 -511
- package/dist-lib/stores/auth.d.ts +1 -1
- package/dist-lib/stores/preferences.d.ts +1 -1
- package/dist-lib/stores/realtime.d.ts +86 -19
- package/dist-lib/testing.d.ts +4 -4
- package/dist-lib/testing.js +40 -40
- package/dist-lib/types/api.d.ts +1 -1
- package/dist-lib/types/schema.d.ts +2 -2
- package/dist-lib/{useCurrentScreen-DVTXCj_K.js → useCurrentScreen-CzwzQpoW.js} +2476 -1967
- package/dist-lib/useListQuery-D7Hr5WM1.js +96 -0
- package/dist-lib/{useProperties-BcIz-MyO.js → useProperties-CqtCzFCr.js} +25 -25
- package/dist-lib/{useTabSearchMirror-UYCsopxP.js → useTabSearchMirror-C39U85cg.js} +13 -13
- package/dist-lib/{value-CQzGOI0F.js → value-Bo8C8WMU.js} +4 -4
- package/package.json +10 -10
- package/dist-lib/useListQuery-C2nq58YV.js +0 -90
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { bt as e, l as t, s as n, vt as r, xt as i, yt as a } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
|
+
import { g as o } from "./field-classification-D6xQYn-h.js";
|
|
3
|
+
import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
4
|
+
import { useQueryClient as d } from "@tanstack/react-query";
|
|
5
|
+
//#region src/components/pages/list/useListQuery.ts
|
|
6
|
+
var f = 1e4;
|
|
7
|
+
function p(c) {
|
|
8
|
+
let u = d(), { entity: f, entityCode: p, screen: h, screenCode: g, page: _, perPage: v, sortForRequest: y, debouncedSearch: b, filters: x, filterError: S, includeDeleted: C, expand: w, select: T, runCountQuery: E, urlKey: D } = c, O = S ? void 0 : x.length > 0 ? x : void 0, k = {
|
|
9
|
+
page: _,
|
|
10
|
+
per_page: v,
|
|
11
|
+
sort: y,
|
|
12
|
+
search: b || void 0,
|
|
13
|
+
filters: O,
|
|
14
|
+
include_deleted: C || void 0,
|
|
15
|
+
expand: w,
|
|
16
|
+
select: T,
|
|
17
|
+
preview: !0,
|
|
18
|
+
screen: h?.fixed_filters ? g : void 0
|
|
19
|
+
}, A = {
|
|
20
|
+
sort: y,
|
|
21
|
+
filters: O,
|
|
22
|
+
search: b || void 0,
|
|
23
|
+
select: T,
|
|
24
|
+
expand: w,
|
|
25
|
+
includeDeleted: C || void 0,
|
|
26
|
+
screen: h?.fixed_filters ? g : void 0,
|
|
27
|
+
preview: !0,
|
|
28
|
+
limit: v
|
|
29
|
+
}, j = f?.list_pagination === "cursor", M = i(p, k, !j), N = e(p, k, E && !j), P = t(p, A, j);
|
|
30
|
+
o(a(p, k), !j), o(n(p, A), j);
|
|
31
|
+
let F = j ? P.isLoading : M.isLoading, I = l(() => j ? P.rows : M.data?.data ?? [], [
|
|
32
|
+
j,
|
|
33
|
+
P.rows,
|
|
34
|
+
M.data?.data
|
|
35
|
+
]), L = j ? P.total : N.data?.meta?.total, R = l(() => {
|
|
36
|
+
if (!(j || L === void 0 || v <= 0)) return Math.max(1, Math.ceil(L / v));
|
|
37
|
+
}, [
|
|
38
|
+
j,
|
|
39
|
+
L,
|
|
40
|
+
v
|
|
41
|
+
]), z = m(F, D), B = j ? n(p, A) : a(p, k), V = r(p, k), H = E && !j, U = s(async () => {
|
|
42
|
+
p && (await Promise.all([u.cancelQueries({
|
|
43
|
+
queryKey: B,
|
|
44
|
+
exact: !0
|
|
45
|
+
}), H ? u.cancelQueries({
|
|
46
|
+
queryKey: V,
|
|
47
|
+
exact: !0
|
|
48
|
+
}) : void 0]), await Promise.all([j ? P.refetch() : M.refetch(), H ? N.refetch() : void 0]));
|
|
49
|
+
}, [
|
|
50
|
+
p,
|
|
51
|
+
u,
|
|
52
|
+
B,
|
|
53
|
+
V,
|
|
54
|
+
H,
|
|
55
|
+
j,
|
|
56
|
+
P,
|
|
57
|
+
M,
|
|
58
|
+
N
|
|
59
|
+
]), W = s(() => {
|
|
60
|
+
P.fetchNextPage();
|
|
61
|
+
}, [P]);
|
|
62
|
+
return {
|
|
63
|
+
rows: I,
|
|
64
|
+
meta: M.data?.meta,
|
|
65
|
+
refs: j ? P.refs : M.data?.$refs,
|
|
66
|
+
isLoading: F,
|
|
67
|
+
isFetching: j ? P.isFetching : M.isFetching,
|
|
68
|
+
isError: j ? P.isError : M.isError,
|
|
69
|
+
error: j ? P.error : M.error,
|
|
70
|
+
isLoadingStale: z,
|
|
71
|
+
retry: U,
|
|
72
|
+
countTotal: L,
|
|
73
|
+
countStrategy: j ? P.countMode : N.data?.meta?.count_mode,
|
|
74
|
+
countLoading: j ? P.isLoading : N.isLoading,
|
|
75
|
+
countError: !j && N.isError,
|
|
76
|
+
totalPages: R,
|
|
77
|
+
hasMorePages: j ? P.hasMore : M.data?.meta?.has_more ?? (R !== void 0 && _ < R),
|
|
78
|
+
isCursor: j,
|
|
79
|
+
fetchNextPage: W,
|
|
80
|
+
isFetchingNextPage: P.isFetchingNextPage
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function m(e, t) {
|
|
84
|
+
let [n, r] = u(!1);
|
|
85
|
+
return c(() => {
|
|
86
|
+
if (!e) {
|
|
87
|
+
r(!1);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
r(!1);
|
|
91
|
+
let t = window.setTimeout(() => r(!0), f);
|
|
92
|
+
return () => window.clearTimeout(t);
|
|
93
|
+
}, [e, t]), n;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { p as t };
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { en as e, jt as t } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
2
|
import { useMutation as n, useQueryClient as r } from "@tanstack/react-query";
|
|
3
3
|
//#region src/api/status.ts
|
|
4
|
-
async function i(
|
|
4
|
+
async function i(t, n, r, i, a) {
|
|
5
5
|
let o = {
|
|
6
6
|
status_group_code: r,
|
|
7
7
|
status_code: i
|
|
8
8
|
};
|
|
9
9
|
a != null && (o.note = a);
|
|
10
|
-
let s = (await
|
|
10
|
+
let s = (await e(`${t}.__update`, {
|
|
11
11
|
object_ids: [n],
|
|
12
|
-
entity:
|
|
12
|
+
entity: t,
|
|
13
13
|
fields: { $statuses: [o] }
|
|
14
14
|
})).result?.rows?.[0]?.$statuses ?? [];
|
|
15
15
|
return s.find((e) => e.group_code === r) ?? s[0];
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/hooks/useObjectStatus.ts
|
|
19
|
-
function a(
|
|
19
|
+
function a(e, a) {
|
|
20
20
|
let o = r();
|
|
21
21
|
return n({
|
|
22
|
-
mutationFn: ({ groupCode:
|
|
22
|
+
mutationFn: ({ groupCode: t, statusCode: n, note: r }) => i(e, a, t, n, r),
|
|
23
23
|
onSuccess: () => {
|
|
24
|
-
o.invalidateQueries({ queryKey: ["entity-item",
|
|
24
|
+
o.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
25
25
|
},
|
|
26
|
-
onError: (
|
|
27
|
-
|
|
26
|
+
onError: (e) => {
|
|
27
|
+
t.error(e.message);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/api/properties.ts
|
|
33
|
-
async function o(
|
|
34
|
-
let a = (await
|
|
33
|
+
async function o(t, n, r, i) {
|
|
34
|
+
let a = (await e(`${t}.__update`, {
|
|
35
35
|
object_ids: [n],
|
|
36
|
-
entity:
|
|
36
|
+
entity: t,
|
|
37
37
|
fields: { $properties: [{
|
|
38
38
|
property_code: r,
|
|
39
39
|
value: i
|
|
@@ -41,10 +41,10 @@ async function o(e, n, r, i) {
|
|
|
41
41
|
})).result?.rows?.[0]?.$properties ?? [];
|
|
42
42
|
return a.find((e) => e.property_code === r) ?? a[0];
|
|
43
43
|
}
|
|
44
|
-
async function s(
|
|
45
|
-
await
|
|
44
|
+
async function s(t, n, r) {
|
|
45
|
+
await e(`${t}.__update`, {
|
|
46
46
|
object_ids: [n],
|
|
47
|
-
entity:
|
|
47
|
+
entity: t,
|
|
48
48
|
fields: { $properties: [{
|
|
49
49
|
property_code: r,
|
|
50
50
|
value: null
|
|
@@ -53,27 +53,27 @@ async function s(e, n, r) {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/hooks/useProperties.ts
|
|
56
|
-
function c(
|
|
56
|
+
function c(e, i) {
|
|
57
57
|
let a = r();
|
|
58
58
|
return n({
|
|
59
|
-
mutationFn: ({ propertyCode:
|
|
59
|
+
mutationFn: ({ propertyCode: t, value: n }) => o(e, i, t, n),
|
|
60
60
|
onSuccess: () => {
|
|
61
|
-
a.invalidateQueries({ queryKey: ["entity-item",
|
|
61
|
+
a.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
62
62
|
},
|
|
63
|
-
onError: (
|
|
64
|
-
|
|
63
|
+
onError: (e) => {
|
|
64
|
+
t.error(e.message);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function l(
|
|
68
|
+
function l(e, i) {
|
|
69
69
|
let a = r();
|
|
70
70
|
return n({
|
|
71
|
-
mutationFn: (
|
|
71
|
+
mutationFn: (t) => s(e, i, t),
|
|
72
72
|
onSuccess: () => {
|
|
73
|
-
a.invalidateQueries({ queryKey: ["entity-item",
|
|
73
|
+
a.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
74
74
|
},
|
|
75
|
-
onError: (
|
|
76
|
-
|
|
75
|
+
onError: (e) => {
|
|
76
|
+
t.error(e.message);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { M as r } from "./field-classification-
|
|
1
|
+
import { Vt as e, mr as t, nr as n } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
|
+
import { M as r } from "./field-classification-D6xQYn-h.js";
|
|
3
3
|
import { useEffect as i, useLayoutEffect as a } from "react";
|
|
4
4
|
import { useSearchParams as o } from "react-router";
|
|
5
5
|
//#region src/lib/filters.ts
|
|
@@ -73,22 +73,22 @@ function p(e) {
|
|
|
73
73
|
}
|
|
74
74
|
function m(e) {
|
|
75
75
|
let t = [];
|
|
76
|
-
for (let n of e)
|
|
76
|
+
for (let n of e) n && typeof n == "object" && (n.field && n.op && t.push(n), n.or && t.push(...m(n.or)), n.and && t.push(...m(n.and)));
|
|
77
77
|
return t;
|
|
78
78
|
}
|
|
79
79
|
function h(e) {
|
|
80
80
|
return m(e).length;
|
|
81
81
|
}
|
|
82
|
-
function g(e,
|
|
82
|
+
function g(e, n) {
|
|
83
83
|
if (!e.field || !e.op) return "";
|
|
84
84
|
let r = l[e.op] || e.op;
|
|
85
85
|
if (s.has(e.op)) return `${r}`;
|
|
86
86
|
let i = e.field, a = (e) => {
|
|
87
|
-
if (
|
|
88
|
-
let
|
|
89
|
-
return
|
|
87
|
+
if (n) {
|
|
88
|
+
let t = n(i, e);
|
|
89
|
+
return t.label != null && (t.status === "special" || t.status === "resolved") ? t.label : t.raw;
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return t(e);
|
|
92
92
|
};
|
|
93
93
|
return `${r} ${Array.isArray(e.value) ? e.value.map(a).join(", ") : a(e.value)}`;
|
|
94
94
|
}
|
|
@@ -101,7 +101,7 @@ function _(e, t) {
|
|
|
101
101
|
}
|
|
102
102
|
function v(e, t) {
|
|
103
103
|
let n = [];
|
|
104
|
-
for (let r of e) if (
|
|
104
|
+
for (let r of e) if (r && typeof r == "object" && r.field !== t) {
|
|
105
105
|
if (r.or) {
|
|
106
106
|
let e = v(r.or, t);
|
|
107
107
|
e.length > 0 && n.push({
|
|
@@ -141,7 +141,7 @@ var b = new Set(Object.keys(l));
|
|
|
141
141
|
function x(t, n, a, o) {
|
|
142
142
|
let s = e();
|
|
143
143
|
i(() => {
|
|
144
|
-
|
|
144
|
+
t && !s.enabled && r.getState().openTab({
|
|
145
145
|
pathname: t,
|
|
146
146
|
search: o,
|
|
147
147
|
title: n,
|
|
@@ -155,9 +155,9 @@ function x(t, n, a, o) {
|
|
|
155
155
|
s.enabled
|
|
156
156
|
]);
|
|
157
157
|
}
|
|
158
|
-
function S(e,
|
|
159
|
-
let i = e?.route, a =
|
|
160
|
-
x(
|
|
158
|
+
function S(e, t, r) {
|
|
159
|
+
let i = e?.route, a = t ? n(e?.display?.name) || n(t.display.name_plural) : "", o = e?.display?.icon || t?.display.icon;
|
|
160
|
+
x(t ? i : void 0, a, o, r);
|
|
161
161
|
}
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/hooks/useTabSearchMirror.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { An as e, Nn as t, Wn as n, jn as r } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
2
|
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
3
3
|
//#region src/embed/file-src.ts
|
|
4
4
|
var c = "/api/files";
|
|
@@ -30,10 +30,10 @@ function p(e) {
|
|
|
30
30
|
return `${e}${e.includes("?") ? "&" : "?"}disposition=attachment`;
|
|
31
31
|
}
|
|
32
32
|
async function m(t, i) {
|
|
33
|
-
let a = await
|
|
33
|
+
let a = await e(), o = await fetch(t, f(a, i));
|
|
34
34
|
if (o.status !== 401) return o;
|
|
35
|
-
await
|
|
36
|
-
let s = await
|
|
35
|
+
await n(o), r();
|
|
36
|
+
let s = await e();
|
|
37
37
|
return fetch(t, f(s, i));
|
|
38
38
|
}
|
|
39
39
|
async function h(e, n, r) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@declarion/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "React SDK for Declarion, the schema-driven business apps platform.",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"@radix-ui/react-slot": "^1.3.3",
|
|
68
68
|
"@tanstack/react-query": "^5.102.8",
|
|
69
69
|
"@tanstack/react-table": "^9.2.4",
|
|
70
|
-
"@tanstack/react-virtual": "^3.14.
|
|
70
|
+
"@tanstack/react-virtual": "^3.14.13",
|
|
71
71
|
"class-variance-authority": "^0.7.1",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
73
73
|
"date-fns": "^4.4.0",
|
|
74
|
-
"lucide-react": "^1.
|
|
74
|
+
"lucide-react": "^1.46.0",
|
|
75
75
|
"mdast-util-to-string": "^4.0.0",
|
|
76
76
|
"monaco-editor": "^0.56.0",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"@testing-library/jest-dom": "^7.0.1",
|
|
96
96
|
"@testing-library/react": "^16.3.3",
|
|
97
97
|
"@testing-library/user-event": "^14.6.7",
|
|
98
|
-
"@types/react": "^19.
|
|
99
|
-
"@types/react-dom": "^19.
|
|
98
|
+
"@types/react": "^19.3.0",
|
|
99
|
+
"@types/react-dom": "^19.3.0",
|
|
100
100
|
"@vitejs/plugin-react": "^6.1.1",
|
|
101
101
|
"@vitest/coverage-v8": "^5.0.0",
|
|
102
102
|
"axe-core": "^4.13.0",
|
|
@@ -105,13 +105,13 @@
|
|
|
105
105
|
"jsdom": "^30.0.1",
|
|
106
106
|
"msw": "^2.15.0",
|
|
107
107
|
"publint": "^0.3.24",
|
|
108
|
-
"react": "^19.
|
|
109
|
-
"react-dom": "^19.
|
|
108
|
+
"react": "^19.3.0",
|
|
109
|
+
"react-dom": "^19.3.0",
|
|
110
110
|
"tailwindcss": "^4.3.3",
|
|
111
|
-
"tsc-alias": "^1.9.
|
|
111
|
+
"tsc-alias": "^1.9.5",
|
|
112
112
|
"typescript": "^6.0.3",
|
|
113
|
-
"typescript-eslint": "^8.
|
|
114
|
-
"vite": "^8.
|
|
113
|
+
"typescript-eslint": "^8.70.0",
|
|
114
|
+
"vite": "^8.3.0",
|
|
115
115
|
"vitest": "^5.0.0"
|
|
116
116
|
},
|
|
117
117
|
"scripts": {
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { C as e, St as t, T as n, bt as r, xt as i } from "./useCurrentScreen-DVTXCj_K.js";
|
|
2
|
-
import { g as a } from "./field-classification-sMkkAEg9.js";
|
|
3
|
-
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
4
|
-
import { useQueryClient as u } from "@tanstack/react-query";
|
|
5
|
-
//#region src/components/pages/list/useListQuery.ts
|
|
6
|
-
var d = 1e4;
|
|
7
|
-
function f(s) {
|
|
8
|
-
let l = u(), { entity: d, entityCode: f, screen: m, screenCode: h, page: g, perPage: _, sortForRequest: v, debouncedSearch: y, filters: b, filterError: x, includeDeleted: S, expand: C, select: w, runCountQuery: T, urlKey: E } = s, D = x ? void 0 : b.length > 0 ? b : void 0, O = {
|
|
9
|
-
page: g,
|
|
10
|
-
per_page: _,
|
|
11
|
-
sort: v,
|
|
12
|
-
search: y || void 0,
|
|
13
|
-
filters: D,
|
|
14
|
-
include_deleted: S || void 0,
|
|
15
|
-
expand: C,
|
|
16
|
-
select: w,
|
|
17
|
-
preview: !0,
|
|
18
|
-
screen: m?.fixed_filters ? h : void 0
|
|
19
|
-
}, k = {
|
|
20
|
-
sort: v,
|
|
21
|
-
filters: D,
|
|
22
|
-
search: y || void 0,
|
|
23
|
-
select: w,
|
|
24
|
-
expand: C,
|
|
25
|
-
includeDeleted: S || void 0,
|
|
26
|
-
screen: m?.fixed_filters ? h : void 0,
|
|
27
|
-
preview: !0,
|
|
28
|
-
limit: _
|
|
29
|
-
}, A = d?.list_pagination === "cursor", j = t(f, O, !A), M = i(f, O, T && !A), N = n(f, k, A);
|
|
30
|
-
a(r(f, O), !A), a(e(f, k), A);
|
|
31
|
-
let P = A ? N.isLoading : j.isLoading, F = c(() => A ? N.rows : j.data?.data ?? [], [
|
|
32
|
-
A,
|
|
33
|
-
N.rows,
|
|
34
|
-
j.data?.data
|
|
35
|
-
]), I = A ? N.total : M.data?.meta?.total, L = c(() => {
|
|
36
|
-
if (!(A || I === void 0 || _ <= 0)) return Math.max(1, Math.ceil(I / _));
|
|
37
|
-
}, [
|
|
38
|
-
A,
|
|
39
|
-
I,
|
|
40
|
-
_
|
|
41
|
-
]), R = p(P, E), z = A ? e(f, k) : r(f, O), B = o(async () => {
|
|
42
|
-
f && (await l.cancelQueries({
|
|
43
|
-
queryKey: z,
|
|
44
|
-
exact: !0
|
|
45
|
-
}), await (A ? N.refetch() : j.refetch()));
|
|
46
|
-
}, [
|
|
47
|
-
f,
|
|
48
|
-
l,
|
|
49
|
-
z,
|
|
50
|
-
A,
|
|
51
|
-
N,
|
|
52
|
-
j
|
|
53
|
-
]), V = o(() => {
|
|
54
|
-
N.fetchNextPage();
|
|
55
|
-
}, [N]);
|
|
56
|
-
return {
|
|
57
|
-
rows: F,
|
|
58
|
-
meta: j.data?.meta,
|
|
59
|
-
refs: A ? N.refs : j.data?.$refs,
|
|
60
|
-
isLoading: P,
|
|
61
|
-
isFetching: A ? N.isFetching : j.isFetching,
|
|
62
|
-
isError: A ? N.isError : j.isError,
|
|
63
|
-
error: A ? N.error : j.error,
|
|
64
|
-
isLoadingStale: R,
|
|
65
|
-
retry: B,
|
|
66
|
-
countTotal: I,
|
|
67
|
-
countStrategy: A ? N.countMode : M.data?.meta?.count_mode,
|
|
68
|
-
countLoading: A ? N.isLoading : M.isLoading,
|
|
69
|
-
countError: !A && M.isError,
|
|
70
|
-
totalPages: L,
|
|
71
|
-
hasMorePages: A ? N.hasMore : j.data?.meta?.has_more ?? (L !== void 0 && g < L),
|
|
72
|
-
isCursor: A,
|
|
73
|
-
fetchNextPage: V,
|
|
74
|
-
isFetchingNextPage: N.isFetchingNextPage
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function p(e, t) {
|
|
78
|
-
let [n, r] = l(!1);
|
|
79
|
-
return s(() => {
|
|
80
|
-
if (!e) {
|
|
81
|
-
r(!1);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
r(!1);
|
|
85
|
-
let t = window.setTimeout(() => r(!0), d);
|
|
86
|
-
return () => window.clearTimeout(t);
|
|
87
|
-
}, [e, t]), n;
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
export { f as t };
|