@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
@@ -1,7 +1,7 @@
1
1
  import { pluralText as e } from "../../../lib/language.js";
2
- import { Icon as t } from "../../primitives/Icons.js";
3
- import { useText as n } from "../../../hooks/useText.js";
4
- import { buildActionBody as r, executeAction as i } from "../../../api/data.js";
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 = n(), M = d(E), N = n("errors"), { run: P } = c(), F = h(() => {
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, t) => {
98
- let n = l(N, e, t, {}, T);
99
- if (n !== null) return P({
100
- action: t,
101
- title: j(t.display?.name) || e,
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 t = await i(n, r(e, y));
106
- return k(), t;
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(t.x, { size: 14 })
126
+ children: /* @__PURE__ */ g(r.x, { size: 14 })
127
127
  })
128
128
  ]
129
129
  });
@@ -1,9 +1,9 @@
1
- import { Icon as e } from "../../primitives/Icons.js";
2
- import { IconBtn as t } from "../../primitives/IconBtn.js";
3
- import { InfoTooltip as n } from "../../primitives/Tooltip.js";
4
- import { useText as r } from "../../../hooks/useText.js";
5
- import { useResponsiveMode as i } from "../../../hooks/useResponsiveMode.js";
6
- import { buildActionBody as a, executeAction as o } from "../../../api/data.js";
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 = r(), N = v(j.entity), P = r("errors"), { run: F } = p(), { isPhone: I } = i(), L = m("list"), R = L.isVisible("show_title"), z = L.isVisible("show_actions"), B = h(), V = y(() => {
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 = (e, t) => {
47
- let n = g(P, e, t, {});
48
- if (n === null) return;
49
- let r = M(t.display?.name) || e;
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: t,
52
- title: r,
51
+ action: r,
52
+ title: a,
53
53
  bulkSelection: W.length > 0 ? W : void 0,
54
- execute: async (e) => {
55
- let t = D.length > 0 ? D : void 0, r = await o(n, a(e, t));
56
- return t && t.length > 0 && A(), r;
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(t, {
75
- icon: /* @__PURE__ */ b(e.back, { size: 14 }),
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(n, {
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 { Btn as n } from "../../primitives/Btn.js";
4
- import { useText as r } from "../../../hooks/useText.js";
5
- import { safeExternalUrl as i } from "../../../lib/safe-url.js";
6
- import { failureTitle as a } from "../../../lib/failure.js";
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, r, i, o) {
12
- let s = a(r, o);
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 = i.fields.get(c), u = l ? t(n, l, c) : c, d = o.ext("value");
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: a, error: f, rowCount: p, entity: m, screen: h, screenName: g, screenIcon: _, isFiltered: v, canCreate: y, toolbarActions: b, onRetry: x }) {
27
- let S = r(), C = r("errors"), w = m.display;
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(n, {
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 }) : a ? /* @__PURE__ */ l("div", {
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(n, {
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), n = S(e?.body), r = i(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(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") : n ? /* @__PURE__ */ u(c, { children: [n, r && /* @__PURE__ */ u(c, { children: [" ", /* @__PURE__ */ l("a", {
59
- href: r,
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 { Icon as e } from "../../primitives/Icons.js";
2
- import { Btn as t } from "../../primitives/Btn.js";
3
- import { IconBtn as n } from "../../primitives/IconBtn.js";
4
- import { Pill as r } from "../../primitives/Pill.js";
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 i } from "../../primitives/Dropdown.js";
7
+ import { Dropdown as a } from "../../primitives/Dropdown.js";
7
8
  import { useText as te } from "../../../hooks/useText.js";
8
- import { MenuItem as a } from "../../primitives/MenuItem.js";
9
- import { TextInput as o } from "../../primitives/Fields.js";
10
- import { usePreferencesStore as s } from "../../../stores/preferences.js";
11
- import { useEntity as ne } from "../../../hooks/useEntity.js";
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 ie } from "../../file-widgets/host.js";
14
- import { ColumnPicker as c } from "../../list/ColumnPicker.js";
15
- import { ViewSwitcher as l } from "../../list/ViewSwitcher.js";
16
- import { RefreshControl as u } from "../../shared/RefreshControl.js";
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 d } from "../../../lib/document-templates.js";
19
- import { isHeaderSortable as f } from "./sortable-header.js";
20
- import { ExportMenu as p } from "../ExportMenu.js";
21
- import { useRef as m, useState as h } from "react";
22
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
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 y({ screen: y, entity: b, entityCode: x, schema: S, screenCode: C, screenName: w, isPhone: T, isCardsPresentation: E, sort: D, columns: O, views: k, query: A, selection: j, filters: M, searchValue: N, onSearchChange: oe, onSaveView: se, onDeleteView: ce, page: P, perPage: F, includeDeleted: I, canViewDeleted: L, onToggleDeleted: R, realtime: z, isLive: B }) {
25
- let V = te(), H = ne("view")?.actions, [U, W] = h(!1), [G, K] = h(!1), [q, J] = h(!1), Y = m(null), X = m(null), Z = s((e) => e.density), Q = () => {
26
- let e = Z === "compact" ? "comfortable" : Z === "comfortable" ? "cozy" : "compact";
27
- s.getState().setMany({ density: e });
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 = b.status_groups?.[t];
31
- return n ? V(n.name) || t : e;
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 = b.properties?.[t];
35
- return n ? V(n.name) || t : e;
34
+ let t = e.slice(10), n = x.properties?.[t];
35
+ return n ? H(n.name) || t : e;
36
36
  }
37
- return ie(V, b, e, S?.entities);
38
- }, ue = (y.columns ?? []).filter((e) => f(e, b));
39
- return /* @__PURE__ */ v("div", {
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: T ? 6 : 8,
43
+ gap: E ? 6 : 8,
44
44
  paddingTop: 0,
45
45
  paddingBottom: 10,
46
- ...T ? re(12) : {
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__ */ _(l, {
54
- views: k.all,
55
- activeViewId: k.activeId,
56
- isDirty: k.isDirty,
57
- onSelect: k.apply,
58
- onSaveAs: H?.__create ? se : void 0,
59
- onSave: H?.__update ? () => {
60
- k.overwriteActive().catch(() => void 0);
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: k.discard,
63
- onDelete: H?.__delete ? ce : void 0,
64
- deletePending: k.isDeleting
62
+ onDiscard: A.discard,
63
+ onDelete: U?.__delete ? ce : void 0,
64
+ deletePending: A.isDeleting
65
65
  }),
66
- le ? /* @__PURE__ */ v("div", {
66
+ de ? /* @__PURE__ */ y("div", {
67
67
  style: {
68
68
  position: "relative",
69
- width: T ? "100%" : 260,
70
- order: T ? -1 : 0
69
+ width: E ? "100%" : 260,
70
+ order: E ? -1 : 0
71
71
  },
72
- children: [/* @__PURE__ */ _(o, {
73
- value: N,
72
+ children: [/* @__PURE__ */ v(s, {
73
+ value: P,
74
74
  onChange: oe,
75
- placeholder: V("list.toolbar.search_placeholder", "Search {name}…", { name: w }),
76
- prefix: /* @__PURE__ */ _(e.search, { size: 13 })
77
- }), /* @__PURE__ */ _("span", {
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__ */ _(ee, { children: "/" })
85
+ children: /* @__PURE__ */ v(ee, { children: "/" })
86
86
  })]
87
- }) : /* @__PURE__ */ _(n, {
88
- icon: /* @__PURE__ */ _(e.search, { size: 14 }),
89
- title: V("list.toolbar.search", "Search {name}", { name: w }),
90
- onClick: () => W(!0)
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__ */ v(t, {
93
- icon: /* @__PURE__ */ _(e.filter, { size: 13 }),
94
- onClick: M.onOpen,
95
- active: M.count > 0,
96
- children: [V("list.toolbar.filters", "Filters"), M.count > 0 && /* @__PURE__ */ _(r, {
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: M.count
100
+ children: N.count
101
101
  })]
102
102
  }),
103
- E && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v(t, {
103
+ D && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y(n, {
104
104
  ref: Y,
105
- icon: /* @__PURE__ */ _(e.sort, { size: 13 }),
105
+ icon: /* @__PURE__ */ v(t.sort, { size: 13 }),
106
106
  onClick: () => K((e) => !e),
107
- active: G || D.cols.length > 0,
108
- children: [V("list.toolbar.sort", "Sort"), D.cols.length > 0 && /* @__PURE__ */ _(r, {
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: D.cols.length
112
+ children: O.cols.length
113
113
  })]
114
- }), /* @__PURE__ */ v(i, {
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__ */ _("div", {
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: V("list.toolbar.sort_by", "Sort by")
130
+ children: H("list.toolbar.sort_by", "Sort by")
131
131
  }),
132
- ue.map((t) => {
133
- let n = D.cols.find((e) => e.field === t);
134
- return /* @__PURE__ */ _(a, {
135
- icon: n ? n.dir === "desc" ? /* @__PURE__ */ _(e.arrowDown, { size: 12 }) : /* @__PURE__ */ _(e.arrowUp, { size: 12 }) : /* @__PURE__ */ _("span", { style: {
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
- D.applyColumn(t, n?.dir === "asc" ? "desc" : "asc", void 0), K(!1);
141
+ O.applyColumn(e, n?.dir === "asc" ? "desc" : "asc", void 0), K(!1);
142
142
  },
143
- children: $(t)
144
- }, t);
143
+ children: $(e)
144
+ }, e);
145
145
  }),
146
- D.cols.length > 0 && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(a, { divider: !0 }), /* @__PURE__ */ _(a, {
147
- icon: /* @__PURE__ */ _(e.x, { size: 12 }),
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
- D.clearAll(), K(!1);
149
+ O.clearAll(), K(!1);
150
150
  },
151
- children: V("list.toolbar.clear_sort", "Clear sort")
151
+ children: H("list.toolbar.clear_sort", "Clear sort")
152
152
  })] })
153
153
  ]
154
154
  })] }),
155
- !E && /* @__PURE__ */ _(c, {
156
- availableColumns: y.columns ?? [],
157
- visibleColumns: O.visible,
155
+ !D && /* @__PURE__ */ v(u, {
156
+ availableColumns: b.columns ?? [],
157
+ visibleColumns: k.visible,
158
158
  onToggle: (e) => {
159
- let t = O.visible.includes(e) ? O.visible.filter((t) => t !== e) : [...O.visible, e];
160
- O.apply(t);
159
+ let t = k.visible.includes(e) ? k.visible.filter((t) => t !== e) : [...k.visible, e];
160
+ k.apply(t);
161
161
  },
162
- onMove: O.move,
163
- onReset: O.clear,
164
- onShowAll: () => O.apply(y.columns ?? []),
165
- onResetWidths: O.resetWidths,
162
+ onMove: k.move,
163
+ onReset: k.clear,
164
+ onShowAll: () => k.apply(b.columns ?? []),
165
+ onResetWidths: k.resetWidths,
166
166
  columnLabel: $
167
167
  }),
168
- !T && /* @__PURE__ */ _("span", { style: {
168
+ !E && /* @__PURE__ */ v("span", { style: {
169
169
  width: 1,
170
170
  height: 20,
171
171
  background: "var(--divider)"
172
172
  } }),
173
- !T && /* @__PURE__ */ _(n, {
174
- icon: /* @__PURE__ */ _(e.grid, { size: 14 }),
175
- title: V("list.toolbar.density", "Density"),
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__ */ _(u, {
179
+ /* @__PURE__ */ v(ie, {
180
180
  liveObject: {
181
- refetch: A.retry,
182
- isLoading: A.isLoading,
183
- isLive: B
181
+ refetch: j.retry,
182
+ isLoading: j.isLoading,
183
+ isLive: V
184
184
  },
185
- realtime: z
185
+ realtime: B
186
186
  }),
187
- !T && /* @__PURE__ */ _("div", { style: { flex: 1 } }),
188
- !T && L && /* @__PURE__ */ _(t, {
187
+ !E && /* @__PURE__ */ v("div", { style: { flex: 1 } }),
188
+ !E && R && /* @__PURE__ */ v(n, {
189
189
  kind: "ghost",
190
190
  size: "sm",
191
- icon: _(I ? e.eyeOff : e.eye, { size: 12 }),
192
- onClick: R,
193
- active: I,
194
- children: I ? V("list.toolbar.hide_deleted", "Hide deleted") : V("list.toolbar.show_deleted", "Show deleted")
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
- T && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(n, {
196
+ E && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(r, {
197
197
  ref: X,
198
- icon: /* @__PURE__ */ _(e.more, { size: 14 }),
199
- title: V("list.toolbar.more", "More"),
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__ */ v(i, {
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__ */ _(a, {
209
- icon: /* @__PURE__ */ _(e.grid, { size: 13 }),
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: V("list.toolbar.density", "Density")
214
- }), L && /* @__PURE__ */ _(a, {
215
- icon: _(I ? e.eyeOff : e.eye, { size: 13 }),
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
- R(), J(!1);
217
+ z(), J(!1);
218
218
  },
219
- children: I ? V("list.toolbar.hide_deleted", "Hide deleted") : V("list.toolbar.show_deleted", "Show deleted")
219
+ children: L ? H("list.toolbar.hide_deleted", "Hide deleted") : H("list.toolbar.show_deleted", "Show deleted")
220
220
  })]
221
221
  })] }),
222
- x && b && /* @__PURE__ */ _(ae, {
223
- entityCode: x,
222
+ S && x && /* @__PURE__ */ v(ae, {
223
+ entityCode: S,
224
224
  scope: "list",
225
- selectedIds: j.ids,
225
+ selectedIds: M.ids,
226
226
  viewState: {
227
- screenCode: C,
228
- jsonFilters: M.json,
229
- search: M.debouncedSearch,
230
- sort: D.forRequest,
231
- includeDeleted: I || void 0,
232
- page: P,
233
- perPage: F
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: b.documents,
236
- canManageTemplates: d(S)
235
+ capability: x.documents,
236
+ canManageTemplates: f(C)
237
237
  }),
238
- x && b && /* @__PURE__ */ _(p, {
239
- entityCode: x,
240
- entity: b,
241
- screen: y,
238
+ S && x && /* @__PURE__ */ v(m, {
239
+ entityCode: S,
240
+ entity: x,
241
+ screen: b,
242
242
  viewState: {
243
- screenCode: C,
244
- jsonFilters: M.json,
245
- search: M.debouncedSearch,
246
- sort: D.forRequest,
247
- includeDeleted: I || void 0,
248
- page: P,
249
- perPage: F
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: O.visible,
252
- selectedRowPKs: j.pkValues,
253
- totalRows: A.countTotal,
254
- pageRows: A.isLoading || A.isShowingPreviousRows ? void 0 : A.rows.length,
255
- language: V.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 { y as ListToolbar };
261
+ export { b as ListToolbar };