@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pluralText as e } from "../../../lib/language.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { buildActionBody as t, executeAction as n } from "../../../api/data.js";
|
|
3
|
+
import { Icon as r } from "../../primitives/Icons.js";
|
|
4
|
+
import { useText as i } from "../../../hooks/useText.js";
|
|
5
5
|
import { applyRowState as a, defaultFlatForSlot as o, filterLayoutForSlot as s } from "../../../lib/actions.js";
|
|
6
6
|
import { useActionRunner as c } from "../../actions/ActionRunner.js";
|
|
7
7
|
import { dispatchAction as l } from "../../../lib/action-dispatch.js";
|
|
@@ -13,7 +13,7 @@ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
|
13
13
|
//#region src/components/pages/list/ListFloatbar.tsx
|
|
14
14
|
var v = "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}";
|
|
15
15
|
function y({ selectedIds: y, floatbarActions: b, screenActionLayout: x, entityActionLayout: S, data: C, rowKey: w, entityCode: T, entity: E, screen: D, onClear: O, onActionSuccess: k, widgetContext: A }) {
|
|
16
|
-
let j =
|
|
16
|
+
let j = i(), M = d(E), N = i("errors"), { run: P } = c(), F = h(() => {
|
|
17
17
|
let e = {};
|
|
18
18
|
for (let { code: t, action: n } of b) e[t] = n;
|
|
19
19
|
return e;
|
|
@@ -94,16 +94,16 @@ function y({ selectedIds: y, floatbarActions: b, screenActionLayout: x, entityAc
|
|
|
94
94
|
kind: "toolbar",
|
|
95
95
|
entityActions: F,
|
|
96
96
|
rowSelection: I,
|
|
97
|
-
onRun: (e,
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
100
|
-
action:
|
|
101
|
-
title: j(
|
|
97
|
+
onRun: (e, r) => {
|
|
98
|
+
let i = l(N, e, r, {}, T);
|
|
99
|
+
if (i !== null) return P({
|
|
100
|
+
action: r,
|
|
101
|
+
title: j(r.display?.name) || e,
|
|
102
102
|
bulkSelection: I,
|
|
103
103
|
entity: T,
|
|
104
104
|
execute: async (e) => {
|
|
105
|
-
let
|
|
106
|
-
return k(),
|
|
105
|
+
let r = await n(i, t(e, y));
|
|
106
|
+
return k(), r;
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
},
|
|
@@ -123,7 +123,7 @@ function y({ selectedIds: y, floatbarActions: b, screenActionLayout: x, entityAc
|
|
|
123
123
|
borderRadius: "var(--radius-md)"
|
|
124
124
|
},
|
|
125
125
|
title: j("list.selection.clear", "Clear selection"),
|
|
126
|
-
children: /* @__PURE__ */ g(
|
|
126
|
+
children: /* @__PURE__ */ g(r.x, { size: 14 })
|
|
127
127
|
})
|
|
128
128
|
]
|
|
129
129
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { buildActionBody as e, executeAction as t } from "../../../api/data.js";
|
|
2
|
+
import { Icon as n } from "../../primitives/Icons.js";
|
|
3
|
+
import { IconBtn as r } from "../../primitives/IconBtn.js";
|
|
4
|
+
import { InfoTooltip as i } from "../../primitives/Tooltip.js";
|
|
5
|
+
import { useText as a } from "../../../hooks/useText.js";
|
|
6
|
+
import { useResponsiveMode as o } from "../../../hooks/useResponsiveMode.js";
|
|
7
7
|
import { pageInsetX as s } from "../../../lib/page-inset.js";
|
|
8
8
|
import { actionRequiresSelection as c, applyRowState as l, defaultFlatForSlot as u, disableLeavesWhere as d, filterLayoutForSlot as f } from "../../../lib/actions.js";
|
|
9
9
|
import { useActionRunner as p } from "../../actions/ActionRunner.js";
|
|
@@ -16,7 +16,7 @@ import { useMemo as y } from "react";
|
|
|
16
16
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/pages/list/ListHeader.tsx
|
|
18
18
|
function S({ title: S, description: C, toolbarActions: w, screenActionLayout: T, entityActionLayout: E, selectedIds: D, data: O, rowKey: k, onActionSuccess: A, widgetContext: j }) {
|
|
19
|
-
let M =
|
|
19
|
+
let M = a(), N = v(j.entity), P = a("errors"), { run: F } = p(), { isPhone: I } = o(), L = m("list"), R = L.isVisible("show_title"), z = L.isVisible("show_actions"), B = h(), V = y(() => {
|
|
20
20
|
let e = {};
|
|
21
21
|
for (let { code: t, action: n } of w) e[t] = n;
|
|
22
22
|
return e;
|
|
@@ -43,17 +43,17 @@ function S({ title: S, description: C, toolbarActions: w, screenActionLayout: T,
|
|
|
43
43
|
V,
|
|
44
44
|
W,
|
|
45
45
|
N
|
|
46
|
-
]), K = D.length > 0 ? G : U, q = (
|
|
47
|
-
let
|
|
48
|
-
if (
|
|
49
|
-
let
|
|
46
|
+
]), K = D.length > 0 ? G : U, q = (n, r) => {
|
|
47
|
+
let i = g(P, n, r, {});
|
|
48
|
+
if (i === null) return;
|
|
49
|
+
let a = M(r.display?.name) || n;
|
|
50
50
|
return F({
|
|
51
|
-
action:
|
|
52
|
-
title:
|
|
51
|
+
action: r,
|
|
52
|
+
title: a,
|
|
53
53
|
bulkSelection: W.length > 0 ? W : void 0,
|
|
54
|
-
execute: async (
|
|
55
|
-
let
|
|
56
|
-
return
|
|
54
|
+
execute: async (n) => {
|
|
55
|
+
let r = D.length > 0 ? D : void 0, a = await t(i, e(n, r));
|
|
56
|
+
return r && r.length > 0 && A(), a;
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
};
|
|
@@ -71,8 +71,8 @@ function S({ title: S, description: C, toolbarActions: w, screenActionLayout: T,
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
children: [
|
|
74
|
-
R && B.hasOriginBack && /* @__PURE__ */ b(
|
|
75
|
-
icon: /* @__PURE__ */ b(
|
|
74
|
+
R && B.hasOriginBack && /* @__PURE__ */ b(r, {
|
|
75
|
+
icon: /* @__PURE__ */ b(n.back, { size: 14 }),
|
|
76
76
|
title: M("list.header.back", "Back"),
|
|
77
77
|
onClick: B.goBack
|
|
78
78
|
}),
|
|
@@ -101,7 +101,7 @@ function S({ title: S, description: C, toolbarActions: w, screenActionLayout: T,
|
|
|
101
101
|
color: "var(--text)"
|
|
102
102
|
},
|
|
103
103
|
children: S
|
|
104
|
-
}), C && /* @__PURE__ */ b(
|
|
104
|
+
}), C && /* @__PURE__ */ b(i, {
|
|
105
105
|
label: C,
|
|
106
106
|
"data-testid": "list-description-info"
|
|
107
107
|
})]
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ApiError as e } from "../../../types/api.js";
|
|
2
2
|
import { fieldDisplayName as t } from "../../../types/schema.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { safeExternalUrl as n } from "../../../lib/safe-url.js";
|
|
4
|
+
import { failureTitle as r } from "../../../lib/failure.js";
|
|
5
|
+
import { Btn as i } from "../../primitives/Btn.js";
|
|
6
|
+
import { useText as a } from "../../../hooks/useText.js";
|
|
7
7
|
import { EmptyState as o } from "../../shared/EmptyState.js";
|
|
8
8
|
import { TableSkeleton as s } from "../../shared/LoadingSkeleton.js";
|
|
9
9
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/pages/list/ListNoRows.tsx
|
|
11
|
-
function d(n,
|
|
12
|
-
let s =
|
|
11
|
+
function d(n, i, a, o) {
|
|
12
|
+
let s = r(i, o);
|
|
13
13
|
if (!(o instanceof e)) return s;
|
|
14
14
|
let c = o.ext("field");
|
|
15
15
|
if (!c) return s;
|
|
16
|
-
let l =
|
|
16
|
+
let l = a.fields.get(c), u = l ? t(n, l, c) : c, d = o.ext("value");
|
|
17
17
|
return d === void 0 ? n("list.rows.failed_field", "{reason} Field: {field}.", {
|
|
18
18
|
reason: s,
|
|
19
19
|
field: u
|
|
@@ -23,28 +23,28 @@ function d(n, r, i, o) {
|
|
|
23
23
|
value: d
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function f({ isLoading: e, tableLoadingStale: t, isError:
|
|
27
|
-
let S =
|
|
26
|
+
function f({ isLoading: e, tableLoadingStale: t, isError: r, error: f, rowCount: p, entity: m, screen: h, screenName: g, screenIcon: _, isFiltered: v, canCreate: y, toolbarActions: b, onRetry: x }) {
|
|
27
|
+
let S = a(), C = a("errors"), w = m.display;
|
|
28
28
|
return e && t ? /* @__PURE__ */ l("div", {
|
|
29
29
|
style: { padding: "0 20px" },
|
|
30
30
|
children: /* @__PURE__ */ l(o, {
|
|
31
31
|
icon: "alert-circle",
|
|
32
32
|
title: S("list.rows.loading_slow_title", "Still loading data"),
|
|
33
33
|
description: S("list.rows.loading_slow_body", "This table is taking longer than expected. Retry the request or check network and server health."),
|
|
34
|
-
action: /* @__PURE__ */ l(
|
|
34
|
+
action: /* @__PURE__ */ l(i, {
|
|
35
35
|
kind: "primary",
|
|
36
36
|
size: "sm",
|
|
37
37
|
onClick: x,
|
|
38
38
|
children: S("list.rows.retry", "Retry")
|
|
39
39
|
})
|
|
40
40
|
})
|
|
41
|
-
}) : e ? /* @__PURE__ */ l(s, { cols: h.columns?.length ?? 4 }) :
|
|
41
|
+
}) : e ? /* @__PURE__ */ l(s, { cols: h.columns?.length ?? 4 }) : r ? /* @__PURE__ */ l("div", {
|
|
42
42
|
style: { padding: "0 20px" },
|
|
43
43
|
children: /* @__PURE__ */ l(o, {
|
|
44
44
|
icon: "alert-circle",
|
|
45
45
|
title: C("list.rows_unreadable", "The records could not be loaded."),
|
|
46
46
|
description: d(S, C, m, f),
|
|
47
|
-
action: /* @__PURE__ */ l(
|
|
47
|
+
action: /* @__PURE__ */ l(i, {
|
|
48
48
|
kind: "primary",
|
|
49
49
|
size: "sm",
|
|
50
50
|
onClick: x,
|
|
@@ -54,9 +54,9 @@ function f({ isLoading: e, tableLoadingStale: t, isError: a, error: f, rowCount:
|
|
|
54
54
|
}) : p === 0 ? /* @__PURE__ */ l("div", {
|
|
55
55
|
style: { padding: "0 20px" },
|
|
56
56
|
children: (() => {
|
|
57
|
-
let e = w.empty_state, t = S(e?.title),
|
|
58
|
-
return d = v ? S("list.rows.no_results_body", "Try adjusting your search or filters") :
|
|
59
|
-
href:
|
|
57
|
+
let e = w.empty_state, t = S(e?.title), r = S(e?.body), i = n(e?.learn_more_url), a = v ? S("list.rows.no_results_title", "No results found") : t || S("list.rows.empty_title", "No {name} yet", { name: S(h.display?.name) || S(w.name_plural) || g }), s = y && b.some(({ code: e }) => e === "__new" || e === "__create"), d;
|
|
58
|
+
return d = v ? S("list.rows.no_results_body", "Try adjusting your search or filters") : r ? /* @__PURE__ */ u(c, { children: [r, i && /* @__PURE__ */ u(c, { children: [" ", /* @__PURE__ */ l("a", {
|
|
59
|
+
href: i,
|
|
60
60
|
target: "_blank",
|
|
61
61
|
rel: "noopener noreferrer",
|
|
62
62
|
children: S("list.rows.learn_more", "Learn more")
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { usePreferencesStore as e } from "../../../stores/preferences.js";
|
|
2
|
+
import { Icon as t } from "../../primitives/Icons.js";
|
|
3
|
+
import { Btn as n } from "../../primitives/Btn.js";
|
|
4
|
+
import { IconBtn as r } from "../../primitives/IconBtn.js";
|
|
5
|
+
import { Pill as i } from "../../primitives/Pill.js";
|
|
5
6
|
import { Kbd as ee } from "../../primitives/Kbd.js";
|
|
6
|
-
import { Dropdown as
|
|
7
|
+
import { Dropdown as a } from "../../primitives/Dropdown.js";
|
|
7
8
|
import { useText as te } from "../../../hooks/useText.js";
|
|
8
|
-
import { MenuItem as
|
|
9
|
-
import { TextInput as
|
|
10
|
-
import {
|
|
11
|
-
import { useEntity as
|
|
9
|
+
import { MenuItem as o } from "../../primitives/MenuItem.js";
|
|
10
|
+
import { TextInput as s } from "../../primitives/Fields.js";
|
|
11
|
+
import { useUiPreferences as ne } from "../../../hooks/useUiPreferences.js";
|
|
12
|
+
import { useEntity as c } from "../../../hooks/useEntity.js";
|
|
12
13
|
import { pageInsetX as re } from "../../../lib/page-inset.js";
|
|
13
|
-
import { resolveSchemaFieldLabel as
|
|
14
|
-
import { ColumnPicker as
|
|
15
|
-
import { ViewSwitcher as
|
|
16
|
-
import { RefreshControl as
|
|
14
|
+
import { resolveSchemaFieldLabel as l } from "../../file-widgets/host.js";
|
|
15
|
+
import { ColumnPicker as u } from "../../list/ColumnPicker.js";
|
|
16
|
+
import { ViewSwitcher as d } from "../../list/ViewSwitcher.js";
|
|
17
|
+
import { RefreshControl as ie } from "../../shared/RefreshControl.js";
|
|
17
18
|
import { DocumentsMenu as ae } from "../DocumentsMenu.js";
|
|
18
|
-
import { canManageDocumentTemplates as
|
|
19
|
-
import { isHeaderSortable as
|
|
20
|
-
import { ExportMenu as
|
|
21
|
-
import { useRef as
|
|
22
|
-
import { Fragment as
|
|
19
|
+
import { canManageDocumentTemplates as f } from "../../../lib/document-templates.js";
|
|
20
|
+
import { isHeaderSortable as p } from "./sortable-header.js";
|
|
21
|
+
import { ExportMenu as m } from "../ExportMenu.js";
|
|
22
|
+
import { useRef as h, useState as g } from "react";
|
|
23
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
23
24
|
//#region src/components/pages/list/ListToolbar.tsx
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, le = !T || U || N !== "", $ = (e) => {
|
|
25
|
+
function b({ screen: b, entity: x, entityCode: S, schema: C, screenCode: w, screenName: T, isPhone: E, isCardsPresentation: D, sort: O, columns: k, views: A, query: j, selection: M, filters: N, searchValue: P, onSearchChange: oe, onSaveView: se, onDeleteView: ce, page: F, perPage: I, includeDeleted: L, canViewDeleted: R, onToggleDeleted: z, realtime: B, isLive: V }) {
|
|
26
|
+
let H = te(), U = c("view")?.actions, [W, le] = g(!1), [G, K] = g(!1), [q, J] = g(!1), Y = h(null), X = h(null), Z = e((e) => e.density), { set: ue } = ne(), Q = () => {
|
|
27
|
+
ue("density", Z === "compact" ? "comfortable" : Z === "comfortable" ? "cozy" : "compact");
|
|
28
|
+
}, de = !E || W || P !== "", $ = (e) => {
|
|
29
29
|
if (e.startsWith("$status.")) {
|
|
30
|
-
let t = e.slice(8), n =
|
|
31
|
-
return n ?
|
|
30
|
+
let t = e.slice(8), n = x.status_groups?.[t];
|
|
31
|
+
return n ? H(n.name) || t : e;
|
|
32
32
|
}
|
|
33
33
|
if (e.startsWith("$property.")) {
|
|
34
|
-
let t = e.slice(10), n =
|
|
35
|
-
return n ?
|
|
34
|
+
let t = e.slice(10), n = x.properties?.[t];
|
|
35
|
+
return n ? H(n.name) || t : e;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
return /* @__PURE__ */
|
|
37
|
+
return l(H, x, e, C?.entities);
|
|
38
|
+
}, fe = (b.columns ?? []).filter((e) => p(e, x));
|
|
39
|
+
return /* @__PURE__ */ y("div", {
|
|
40
40
|
style: {
|
|
41
41
|
display: "flex",
|
|
42
42
|
alignItems: "center",
|
|
43
|
-
gap:
|
|
43
|
+
gap: E ? 6 : 8,
|
|
44
44
|
paddingTop: 0,
|
|
45
45
|
paddingBottom: 10,
|
|
46
|
-
...
|
|
46
|
+
...E ? re(12) : {
|
|
47
47
|
paddingLeft: 20,
|
|
48
48
|
paddingRight: 20
|
|
49
49
|
},
|
|
50
50
|
flexWrap: "wrap"
|
|
51
51
|
},
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
views:
|
|
55
|
-
activeViewId:
|
|
56
|
-
isDirty:
|
|
57
|
-
onSelect:
|
|
58
|
-
onSaveAs:
|
|
59
|
-
onSave:
|
|
60
|
-
|
|
53
|
+
/* @__PURE__ */ v(d, {
|
|
54
|
+
views: A.all,
|
|
55
|
+
activeViewId: A.activeId,
|
|
56
|
+
isDirty: A.isDirty,
|
|
57
|
+
onSelect: A.apply,
|
|
58
|
+
onSaveAs: U?.__create ? se : void 0,
|
|
59
|
+
onSave: U?.__update ? () => {
|
|
60
|
+
A.overwriteActive().catch(() => void 0);
|
|
61
61
|
} : void 0,
|
|
62
|
-
onDiscard:
|
|
63
|
-
onDelete:
|
|
64
|
-
deletePending:
|
|
62
|
+
onDiscard: A.discard,
|
|
63
|
+
onDelete: U?.__delete ? ce : void 0,
|
|
64
|
+
deletePending: A.isDeleting
|
|
65
65
|
}),
|
|
66
|
-
|
|
66
|
+
de ? /* @__PURE__ */ y("div", {
|
|
67
67
|
style: {
|
|
68
68
|
position: "relative",
|
|
69
|
-
width:
|
|
70
|
-
order:
|
|
69
|
+
width: E ? "100%" : 260,
|
|
70
|
+
order: E ? -1 : 0
|
|
71
71
|
},
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
value:
|
|
72
|
+
children: [/* @__PURE__ */ v(s, {
|
|
73
|
+
value: P,
|
|
74
74
|
onChange: oe,
|
|
75
|
-
placeholder:
|
|
76
|
-
prefix: /* @__PURE__ */
|
|
77
|
-
}), /* @__PURE__ */
|
|
75
|
+
placeholder: H("list.toolbar.search_placeholder", "Search {name}…", { name: T }),
|
|
76
|
+
prefix: /* @__PURE__ */ v(t.search, { size: 13 })
|
|
77
|
+
}), /* @__PURE__ */ v("span", {
|
|
78
78
|
style: {
|
|
79
79
|
position: "absolute",
|
|
80
80
|
right: 6,
|
|
@@ -82,43 +82,43 @@ function y({ screen: y, entity: b, entityCode: x, schema: S, screenCode: C, scre
|
|
|
82
82
|
transform: "translateY(-50%)",
|
|
83
83
|
pointerEvents: "none"
|
|
84
84
|
},
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ v(ee, { children: "/" })
|
|
86
86
|
})]
|
|
87
|
-
}) : /* @__PURE__ */
|
|
88
|
-
icon: /* @__PURE__ */
|
|
89
|
-
title:
|
|
90
|
-
onClick: () =>
|
|
87
|
+
}) : /* @__PURE__ */ v(r, {
|
|
88
|
+
icon: /* @__PURE__ */ v(t.search, { size: 14 }),
|
|
89
|
+
title: H("list.toolbar.search", "Search {name}", { name: T }),
|
|
90
|
+
onClick: () => le(!0)
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
icon: /* @__PURE__ */
|
|
94
|
-
onClick:
|
|
95
|
-
active:
|
|
96
|
-
children: [
|
|
92
|
+
/* @__PURE__ */ y(n, {
|
|
93
|
+
icon: /* @__PURE__ */ v(t.filter, { size: 13 }),
|
|
94
|
+
onClick: N.onOpen,
|
|
95
|
+
active: N.count > 0,
|
|
96
|
+
children: [H("list.toolbar.filters", "Filters"), N.count > 0 && /* @__PURE__ */ v(i, {
|
|
97
97
|
tone: "violet",
|
|
98
98
|
size: "xs",
|
|
99
99
|
style: { marginLeft: 4 },
|
|
100
|
-
children:
|
|
100
|
+
children: N.count
|
|
101
101
|
})]
|
|
102
102
|
}),
|
|
103
|
-
|
|
103
|
+
D && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y(n, {
|
|
104
104
|
ref: Y,
|
|
105
|
-
icon: /* @__PURE__ */
|
|
105
|
+
icon: /* @__PURE__ */ v(t.sort, { size: 13 }),
|
|
106
106
|
onClick: () => K((e) => !e),
|
|
107
|
-
active: G ||
|
|
108
|
-
children: [
|
|
107
|
+
active: G || O.cols.length > 0,
|
|
108
|
+
children: [H("list.toolbar.sort", "Sort"), O.cols.length > 0 && /* @__PURE__ */ v(i, {
|
|
109
109
|
tone: "slate",
|
|
110
110
|
size: "xs",
|
|
111
111
|
style: { marginLeft: 4 },
|
|
112
|
-
children:
|
|
112
|
+
children: O.cols.length
|
|
113
113
|
})]
|
|
114
|
-
}), /* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ y(a, {
|
|
115
115
|
open: G,
|
|
116
116
|
anchor: Y.current,
|
|
117
117
|
onClose: () => K(!1),
|
|
118
118
|
align: "start",
|
|
119
119
|
width: 280,
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ v("div", {
|
|
122
122
|
style: {
|
|
123
123
|
padding: "6px 8px 4px",
|
|
124
124
|
fontSize: 10,
|
|
@@ -127,135 +127,135 @@ function y({ screen: y, entity: b, entityCode: x, schema: S, screenCode: C, scre
|
|
|
127
127
|
letterSpacing: "0.08em",
|
|
128
128
|
textTransform: "uppercase"
|
|
129
129
|
},
|
|
130
|
-
children:
|
|
130
|
+
children: H("list.toolbar.sort_by", "Sort by")
|
|
131
131
|
}),
|
|
132
|
-
|
|
133
|
-
let n =
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
icon: n ? n.dir === "desc" ? /* @__PURE__ */
|
|
132
|
+
fe.map((e) => {
|
|
133
|
+
let n = O.cols.find((t) => t.field === e);
|
|
134
|
+
return /* @__PURE__ */ v(o, {
|
|
135
|
+
icon: n ? n.dir === "desc" ? /* @__PURE__ */ v(t.arrowDown, { size: 12 }) : /* @__PURE__ */ v(t.arrowUp, { size: 12 }) : /* @__PURE__ */ v("span", { style: {
|
|
136
136
|
width: 12,
|
|
137
137
|
display: "inline-block"
|
|
138
138
|
} }),
|
|
139
139
|
active: !!n,
|
|
140
140
|
onClick: () => {
|
|
141
|
-
|
|
141
|
+
O.applyColumn(e, n?.dir === "asc" ? "desc" : "asc", void 0), K(!1);
|
|
142
142
|
},
|
|
143
|
-
children: $(
|
|
144
|
-
},
|
|
143
|
+
children: $(e)
|
|
144
|
+
}, e);
|
|
145
145
|
}),
|
|
146
|
-
|
|
147
|
-
icon: /* @__PURE__ */
|
|
146
|
+
O.cols.length > 0 && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(o, { divider: !0 }), /* @__PURE__ */ v(o, {
|
|
147
|
+
icon: /* @__PURE__ */ v(t.x, { size: 12 }),
|
|
148
148
|
onClick: () => {
|
|
149
|
-
|
|
149
|
+
O.clearAll(), K(!1);
|
|
150
150
|
},
|
|
151
|
-
children:
|
|
151
|
+
children: H("list.toolbar.clear_sort", "Clear sort")
|
|
152
152
|
})] })
|
|
153
153
|
]
|
|
154
154
|
})] }),
|
|
155
|
-
!
|
|
156
|
-
availableColumns:
|
|
157
|
-
visibleColumns:
|
|
155
|
+
!D && /* @__PURE__ */ v(u, {
|
|
156
|
+
availableColumns: b.columns ?? [],
|
|
157
|
+
visibleColumns: k.visible,
|
|
158
158
|
onToggle: (e) => {
|
|
159
|
-
let t =
|
|
160
|
-
|
|
159
|
+
let t = k.visible.includes(e) ? k.visible.filter((t) => t !== e) : [...k.visible, e];
|
|
160
|
+
k.apply(t);
|
|
161
161
|
},
|
|
162
|
-
onMove:
|
|
163
|
-
onReset:
|
|
164
|
-
onShowAll: () =>
|
|
165
|
-
onResetWidths:
|
|
162
|
+
onMove: k.move,
|
|
163
|
+
onReset: k.clear,
|
|
164
|
+
onShowAll: () => k.apply(b.columns ?? []),
|
|
165
|
+
onResetWidths: k.resetWidths,
|
|
166
166
|
columnLabel: $
|
|
167
167
|
}),
|
|
168
|
-
!
|
|
168
|
+
!E && /* @__PURE__ */ v("span", { style: {
|
|
169
169
|
width: 1,
|
|
170
170
|
height: 20,
|
|
171
171
|
background: "var(--divider)"
|
|
172
172
|
} }),
|
|
173
|
-
!
|
|
174
|
-
icon: /* @__PURE__ */
|
|
175
|
-
title:
|
|
173
|
+
!E && /* @__PURE__ */ v(r, {
|
|
174
|
+
icon: /* @__PURE__ */ v(t.grid, { size: 14 }),
|
|
175
|
+
title: H("list.toolbar.density", "Density"),
|
|
176
176
|
active: Z !== "compact",
|
|
177
177
|
onClick: Q
|
|
178
178
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ v(ie, {
|
|
180
180
|
liveObject: {
|
|
181
|
-
refetch:
|
|
182
|
-
isLoading:
|
|
183
|
-
isLive:
|
|
181
|
+
refetch: j.retry,
|
|
182
|
+
isLoading: j.isLoading,
|
|
183
|
+
isLive: V
|
|
184
184
|
},
|
|
185
|
-
realtime:
|
|
185
|
+
realtime: B
|
|
186
186
|
}),
|
|
187
|
-
!
|
|
188
|
-
!
|
|
187
|
+
!E && /* @__PURE__ */ v("div", { style: { flex: 1 } }),
|
|
188
|
+
!E && R && /* @__PURE__ */ v(n, {
|
|
189
189
|
kind: "ghost",
|
|
190
190
|
size: "sm",
|
|
191
|
-
icon:
|
|
192
|
-
onClick:
|
|
193
|
-
active:
|
|
194
|
-
children:
|
|
191
|
+
icon: v(L ? t.eyeOff : t.eye, { size: 12 }),
|
|
192
|
+
onClick: z,
|
|
193
|
+
active: L,
|
|
194
|
+
children: L ? H("list.toolbar.hide_deleted", "Hide deleted") : H("list.toolbar.show_deleted", "Show deleted")
|
|
195
195
|
}),
|
|
196
|
-
|
|
196
|
+
E && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(r, {
|
|
197
197
|
ref: X,
|
|
198
|
-
icon: /* @__PURE__ */
|
|
199
|
-
title:
|
|
198
|
+
icon: /* @__PURE__ */ v(t.more, { size: 14 }),
|
|
199
|
+
title: H("list.toolbar.more", "More"),
|
|
200
200
|
active: q,
|
|
201
201
|
onClick: () => J((e) => !e)
|
|
202
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ y(a, {
|
|
203
203
|
open: q,
|
|
204
204
|
anchor: X.current,
|
|
205
205
|
onClose: () => J(!1),
|
|
206
206
|
align: "end",
|
|
207
207
|
width: 220,
|
|
208
|
-
children: [/* @__PURE__ */
|
|
209
|
-
icon: /* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ v(o, {
|
|
209
|
+
icon: /* @__PURE__ */ v(t.grid, { size: 13 }),
|
|
210
210
|
onClick: () => {
|
|
211
211
|
Q(), J(!1);
|
|
212
212
|
},
|
|
213
|
-
children:
|
|
214
|
-
}),
|
|
215
|
-
icon:
|
|
213
|
+
children: H("list.toolbar.density", "Density")
|
|
214
|
+
}), R && /* @__PURE__ */ v(o, {
|
|
215
|
+
icon: v(L ? t.eyeOff : t.eye, { size: 13 }),
|
|
216
216
|
onClick: () => {
|
|
217
|
-
|
|
217
|
+
z(), J(!1);
|
|
218
218
|
},
|
|
219
|
-
children:
|
|
219
|
+
children: L ? H("list.toolbar.hide_deleted", "Hide deleted") : H("list.toolbar.show_deleted", "Show deleted")
|
|
220
220
|
})]
|
|
221
221
|
})] }),
|
|
222
|
-
|
|
223
|
-
entityCode:
|
|
222
|
+
S && x && /* @__PURE__ */ v(ae, {
|
|
223
|
+
entityCode: S,
|
|
224
224
|
scope: "list",
|
|
225
|
-
selectedIds:
|
|
225
|
+
selectedIds: M.ids,
|
|
226
226
|
viewState: {
|
|
227
|
-
screenCode:
|
|
228
|
-
jsonFilters:
|
|
229
|
-
search:
|
|
230
|
-
sort:
|
|
231
|
-
includeDeleted:
|
|
232
|
-
page:
|
|
233
|
-
perPage:
|
|
227
|
+
screenCode: w,
|
|
228
|
+
jsonFilters: N.json,
|
|
229
|
+
search: N.debouncedSearch,
|
|
230
|
+
sort: O.forRequest,
|
|
231
|
+
includeDeleted: L || void 0,
|
|
232
|
+
page: F,
|
|
233
|
+
perPage: I
|
|
234
234
|
},
|
|
235
|
-
capability:
|
|
236
|
-
canManageTemplates:
|
|
235
|
+
capability: x.documents,
|
|
236
|
+
canManageTemplates: f(C)
|
|
237
237
|
}),
|
|
238
|
-
|
|
239
|
-
entityCode:
|
|
240
|
-
entity:
|
|
241
|
-
screen:
|
|
238
|
+
S && x && /* @__PURE__ */ v(m, {
|
|
239
|
+
entityCode: S,
|
|
240
|
+
entity: x,
|
|
241
|
+
screen: b,
|
|
242
242
|
viewState: {
|
|
243
|
-
screenCode:
|
|
244
|
-
jsonFilters:
|
|
245
|
-
search:
|
|
246
|
-
sort:
|
|
247
|
-
includeDeleted:
|
|
248
|
-
page:
|
|
249
|
-
perPage:
|
|
243
|
+
screenCode: w,
|
|
244
|
+
jsonFilters: N.json,
|
|
245
|
+
search: N.debouncedSearch,
|
|
246
|
+
sort: O.forRequest,
|
|
247
|
+
includeDeleted: L || void 0,
|
|
248
|
+
page: F,
|
|
249
|
+
perPage: I
|
|
250
250
|
},
|
|
251
|
-
visibleColumns:
|
|
252
|
-
selectedRowPKs:
|
|
253
|
-
totalRows:
|
|
254
|
-
pageRows:
|
|
255
|
-
language:
|
|
251
|
+
visibleColumns: k.visible,
|
|
252
|
+
selectedRowPKs: M.pkValues,
|
|
253
|
+
totalRows: j.countTotal,
|
|
254
|
+
pageRows: j.isLoading || j.isShowingPreviousRows ? void 0 : j.rows.length,
|
|
255
|
+
language: H.language
|
|
256
256
|
})
|
|
257
257
|
]
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
|
-
export {
|
|
261
|
+
export { b as ListToolbar };
|