@declarion/react 0.48.2 → 0.50.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 (88) hide show
  1. package/dist-lib/Check-DAfMbQIw.js +38 -0
  2. package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-Dar8C-Z9.js} +31 -31
  3. package/dist-lib/DynamicIcon-DW5krHuX.js +280 -0
  4. package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BkHtfsty.js} +2 -2
  5. package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-Cic7IAop.js} +601 -598
  6. package/dist-lib/ListCardsBody-Dko91bLv.js +287 -0
  7. package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-CJrVG5HZ.js} +1 -1
  8. package/dist-lib/RefreshControl-BS8WWL8i.js +430 -0
  9. package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-DxRDo0p2.js} +521 -516
  10. package/dist-lib/SmartListPage.impl-CNdq5Vts.js +2849 -0
  11. package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-3ct7f4rT.js} +244 -241
  12. package/dist-lib/SortHeaderMenu-NgjkW8QZ.js +106 -0
  13. package/dist-lib/action-dispatch-hVrm3Hrg.js +1984 -0
  14. package/dist-lib/api/batch.d.ts +5 -2
  15. package/dist-lib/api/data.d.ts +35 -4
  16. package/dist-lib/api/entities.d.ts +3 -3
  17. package/dist-lib/cardProjection-BR-fXPvJ.js +757 -0
  18. package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
  19. package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
  20. package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
  21. package/dist-lib/components/file-widgets/upload.d.ts +6 -1
  22. package/dist-lib/components/layout/Layout.d.ts +1 -1
  23. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  24. package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
  25. package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
  26. package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
  27. package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
  28. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  29. package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
  30. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  31. package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
  32. package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
  33. package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
  34. package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
  35. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
  36. package/dist-lib/components/pages/list/page-size.d.ts +3 -0
  37. package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
  38. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
  39. package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
  40. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
  41. package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
  42. package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
  43. package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
  44. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  45. package/dist-lib/components/primitives/Icons.d.ts +5 -0
  46. package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
  47. package/dist-lib/field-classification-Bm0mgbwA.js +1134 -0
  48. package/dist-lib/format-count-BfRGwx2v.js +1551 -0
  49. package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
  50. package/dist-lib/hooks/useText.d.ts +3 -0
  51. package/dist-lib/hooks/useViews.d.ts +1 -1
  52. package/dist-lib/icons.js +1 -1
  53. package/dist-lib/index.d.ts +17 -15
  54. package/dist-lib/index.js +1784 -6288
  55. package/dist-lib/lib/messages.d.ts +7 -1
  56. package/dist-lib/lib/rowClickGesture.d.ts +12 -0
  57. package/dist-lib/lib/timestamp.d.ts +8 -3
  58. package/dist-lib/peekDraftStore-bb4WroTA.js +194 -0
  59. package/dist-lib/record-documents-key-8fdm7C10.js +27 -0
  60. package/dist-lib/registry-CgeGoWpW.js +1768 -0
  61. package/dist-lib/testing.d.ts +17 -2
  62. package/dist-lib/testing.js +72 -58
  63. package/dist-lib/types/api.d.ts +54 -12
  64. package/dist-lib/types/schema.d.ts +22 -6
  65. package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-D3XH5ptA.js} +1127 -1070
  66. package/dist-lib/useListQuery-CfuINl-0.js +87 -0
  67. package/dist-lib/useProperties-DNocaxBX.js +81 -0
  68. package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-d0BAUIcQ.js} +116 -194
  69. package/dist-lib/{value-B1O6QikE.js → value-D71J0sJq.js} +69 -69
  70. package/package.json +1 -1
  71. package/dist-lib/DynamicIcon-Dc2j-rg_.js +0 -275
  72. package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
  73. package/dist-lib/registry-CCxnZW2b.js +0 -5281
  74. /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
  75. /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
  76. /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
  77. /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
  78. /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
  79. /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
  80. /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
  81. /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
  82. /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
  83. /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
  84. /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
  85. /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
  86. /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
  87. /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
  88. /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
@@ -1,6 +1,12 @@
1
1
  import { type LocalizedString } from "../types/schema";
2
2
  import type { PublicParam } from "../types/api";
3
3
  export declare const DEFAULT_LOCALE = "en";
4
+ /**
5
+ * A catalogue of localized strings keyed by code. The platform ships two and
6
+ * they are NOT interchangeable: `schema.messages` is UI text, `schema.errors`
7
+ * is the declared error types' titles. A failure never lives in `messages` -
8
+ * enforced by a gate in the platform, not by this type.
9
+ */
4
10
  export type MessageCatalog = Record<string, LocalizedString> | undefined;
5
- export declare function localizedMessage(messages: MessageCatalog, code: string, locale: string, fallback?: string): string;
11
+ export declare function localizedMessage(catalogue: MessageCatalog, code: string, locale: string, fallback?: string): string;
6
12
  export declare function publicLocale(parameters: PublicParam[] | undefined): string;
@@ -6,6 +6,18 @@ export declare const ROW_DOUBLE_CLICK_MS = 250;
6
6
  export type RowClickPending = {
7
7
  rowId: string;
8
8
  } | null;
9
+ /**
10
+ * The row's own controls: a ref-link cell, the kebab, the select checkbox, a
11
+ * menu item. Each owns its navigation or its action, so a row-level gesture -
12
+ * click or long press - must not also fire on it.
13
+ *
14
+ * A target-closest test is more reliable than expecting every child to
15
+ * stopPropagation: synthetic-event propagation across the virtualized row and
16
+ * the cell-factory subtree proved leaky.
17
+ */
18
+ export declare const INTERACTIVE_ROW_TARGET = "a, button, input, select, [role='button'], [role='menuitem']";
19
+ /** Whether an event's target sits inside one of the row's own controls. */
20
+ export declare function isInteractiveRowTarget(target: EventTarget | null): boolean;
9
21
  /**
10
22
  * Classify a click on `rowId` given the pending deferred-click state:
11
23
  * "double" when the same row already has an undelivered deferred click (this is
@@ -25,10 +25,15 @@ export declare function formatWireDateTime(date?: Date): string;
25
25
  * Single source of the offset-resolution algorithm; callers (`formatOffsetTimestamp`
26
26
  * here, `TimestampField`'s display formatter) differ ONLY in the Intl options.
27
27
  */
28
- export declare function formatInOffsetZone(raw: string, options: Intl.DateTimeFormatOptions): string;
28
+ export declare function formatInOffsetZone(raw: string, options: Intl.DateTimeFormatOptions, locale?: string): string;
29
29
  /**
30
- * Format an offset-aware timestamp for display (medium date + short time)
31
- * WITHOUT browser-local conversion. Thin wrapper over `formatInOffsetZone`.
30
+ * Format an offset-aware timestamp for display WITHOUT browser-local
31
+ * conversion.
32
+ *
33
+ * `DD-MM-YYYY HH:mm`, the same in every locale. Deliberately NOT
34
+ * `dateStyle: "medium"`: that renders "Aug 15, 2026" for one reader and
35
+ * "15 авг. 2026 г." for another, so two people reading the same screen cannot
36
+ * quote the same date to each other.
32
37
  */
33
38
  export declare function formatOffsetTimestamp(raw: string): string;
34
39
  /**
@@ -0,0 +1,194 @@
1
+ import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
+ import { Bn as t, Dn as n, bt as r, cr as i, er as a, fr as o, i as s, rr as c } from "./useCurrentScreen-D3XH5ptA.js";
3
+ import { useMemo as l, useRef as u, useState as d } from "react";
4
+ import { useQuery as f } from "@tanstack/react-query";
5
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ //#region src/components/pages/exportRequest.ts
7
+ var g = /* @__PURE__ */ new Set(["_select", "_actions"]);
8
+ function _(e) {
9
+ let t = {};
10
+ return e.screenCode && (t.screen = e.screenCode), e.jsonFilters && e.jsonFilters.length > 0 && (t.filters = e.jsonFilters), e.search && (t.search = e.search), e.sort && (t.sort = e.sort), e.includeDeleted && (t.include_deleted = !0), e.page && (t.page = e.page), e.perPage && (t.per_page = e.perPage), t;
11
+ }
12
+ function v(e, t) {
13
+ let n = t.visibleColumns.filter((e) => !g.has(e)), r = {
14
+ format: "csv",
15
+ scope: t.scope,
16
+ query: _(e),
17
+ columns: n
18
+ };
19
+ return t.scope === "selected_rows" && t.selectedRowPKs && t.selectedRowPKs.length > 0 && (r.selection = t.selectedRowPKs), t.locale && (r.locale = t.locale), t.filename && (r.filename = t.filename), r;
20
+ }
21
+ //#endregion
22
+ //#region src/components/pages/DocumentsMenu.tsx
23
+ var y = "document-templates-available";
24
+ function b({ entityCode: t, scope: g, objectIds: v = [], viewState: b, selectedIds: w = [], capability: T, canManageTemplates: E = !1 }) {
25
+ let { run: D } = s(), O = u(null), [k, A] = d(!1), j = g === "detail" ? !!T?.generate_one : !!T?.generate_many, M = E && !j, { data: N, isLoading: P, error: F } = f({
26
+ queryKey: [y, t],
27
+ queryFn: async () => (await r("document.templates.available", { entity: t })).result?.templates ?? [],
28
+ enabled: k || M,
29
+ staleTime: 6e4
30
+ }), I = P, L = l(() => (N ?? []).filter((e) => g === "detail" ? e.input_mode === "one" || e.input_mode === "global" : e.input_mode === "many" || e.input_mode === "global"), [g, N]), R = M && L.length > 0, z = j || R;
31
+ function B() {
32
+ A((e) => !e);
33
+ }
34
+ function V(e) {
35
+ if (e.input_mode === "global") return [{ kind: "global" }];
36
+ if (g === "detail") return e.input_mode === "one" && v.length === 1 ? [{
37
+ kind: "one",
38
+ objectIds: v
39
+ }] : [];
40
+ if (e.input_mode === "many") {
41
+ let e = [];
42
+ return b && e.push({
43
+ kind: "current_view",
44
+ query: _(b)
45
+ }), w.length > 0 && e.push({
46
+ kind: "selected",
47
+ objectIds: w
48
+ }), e;
49
+ }
50
+ return [];
51
+ }
52
+ function H(e, t, i) {
53
+ let a = x(e), o = n(e.name) || e.code;
54
+ A(!1), D({
55
+ action: a,
56
+ title: o,
57
+ execute: (n) => {
58
+ let a = {
59
+ template_code: e.code,
60
+ template_source: e.source,
61
+ output_format: i
62
+ };
63
+ return Object.keys(n).length > 0 && (a.params = n), "objectIds" in t && (a.object_ids = t.objectIds), "query" in t && (a.query = {
64
+ scope: "current_view",
65
+ query: t.query
66
+ }), r("document.generate", a);
67
+ }
68
+ });
69
+ }
70
+ let { isPhone: U } = c();
71
+ return z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(o, {
72
+ ref: O,
73
+ kind: "ghost",
74
+ size: "sm",
75
+ icon: m(I ? e.loader : e.filePlus, { size: 12 }),
76
+ onClick: B,
77
+ disabled: I,
78
+ "aria-label": "Generate",
79
+ title: "Generate",
80
+ children: U ? null : "Generate"
81
+ }), /* @__PURE__ */ h(i, {
82
+ open: k,
83
+ anchor: O.current,
84
+ onClose: () => A(!1),
85
+ align: "end",
86
+ width: 300,
87
+ children: [
88
+ I && /* @__PURE__ */ m(a, {
89
+ disabled: !0,
90
+ icon: /* @__PURE__ */ m(e.loader, { size: 12 }),
91
+ children: "Loading templates..."
92
+ }),
93
+ F && /* @__PURE__ */ m(a, {
94
+ disabled: !0,
95
+ icon: /* @__PURE__ */ m(e.warning, { size: 12 }),
96
+ children: F instanceof Error ? F.message : String(F)
97
+ }),
98
+ !I && !F && L.length === 0 && /* @__PURE__ */ m(a, {
99
+ disabled: !0,
100
+ icon: /* @__PURE__ */ m(e.file, { size: 12 }),
101
+ children: "No document templates"
102
+ }),
103
+ !I && !F && L.map((t) => {
104
+ let r = V(t);
105
+ return r.length === 0 ? null : S(t).flatMap((i) => r.map((r) => i.available ? /* @__PURE__ */ m(a, {
106
+ icon: /* @__PURE__ */ m(e.file, { size: 12 }),
107
+ onClick: () => H(t, r, i.format),
108
+ title: n(t.description),
109
+ children: C(t, r, i.format)
110
+ }, `${t.source}:${t.code}:${r.kind}:${i.format}`) : /* @__PURE__ */ h(a, {
111
+ disabled: !0,
112
+ icon: /* @__PURE__ */ m(e.file, { size: 12 }),
113
+ title: i.disabled_reason,
114
+ children: [
115
+ C(t, r, i.format),
116
+ " - ",
117
+ i.disabled_reason || "Unavailable"
118
+ ]
119
+ }, `${t.source}:${t.code}:${r.kind}:${i.format}:disabled`)));
120
+ })
121
+ ]
122
+ })] }) : null;
123
+ }
124
+ function x(e) {
125
+ let n = new t((e.params ?? []).map((e) => ({
126
+ ...e,
127
+ name: e.name ?? ""
128
+ })));
129
+ return {
130
+ handler: "document.generate",
131
+ display: {
132
+ name: e.name,
133
+ icon: "file",
134
+ description: e.description
135
+ },
136
+ resolved_params: n
137
+ };
138
+ }
139
+ function S(e) {
140
+ return e.outputs && e.outputs.length > 0 ? e.outputs : (e.allowed_outputs && e.allowed_outputs.length > 0 ? e.allowed_outputs : [e.output_format || "xlsx"]).map((e) => ({
141
+ format: e,
142
+ available: !0
143
+ }));
144
+ }
145
+ function C(e, t, r) {
146
+ let i = n(e.name) || e.code, a = r ? ` (${r.toUpperCase()})` : "";
147
+ switch (t.kind) {
148
+ case "one": return `${i}${a}`;
149
+ case "selected": return `${i}${a} - selected rows`;
150
+ case "current_view": return `${i}${a} - current view`;
151
+ case "global": return `${i}${a}`;
152
+ }
153
+ }
154
+ //#endregion
155
+ //#region src/lib/document-templates.ts
156
+ function w(e) {
157
+ return !!e?.entities?.document_template;
158
+ }
159
+ //#endregion
160
+ //#region src/lib/evidence-verdict.ts
161
+ var T = {
162
+ verified: "Verified",
163
+ unverified: "Not yet verified",
164
+ tampered: "Tampered",
165
+ indeterminate: "Cannot verify",
166
+ outside_coverage: "Outside coverage"
167
+ }, E = {
168
+ verified: "emerald",
169
+ unverified: "slate",
170
+ tampered: "rose",
171
+ indeterminate: "amber",
172
+ outside_coverage: "slate"
173
+ };
174
+ function D(e) {
175
+ return T[e] ?? e;
176
+ }
177
+ function O(e) {
178
+ return E[e] ?? "slate";
179
+ }
180
+ //#endregion
181
+ //#region src/components/list/peekDraftStore.ts
182
+ var k = /* @__PURE__ */ new Map();
183
+ function A(e, t) {
184
+ k.set(e, t);
185
+ }
186
+ function j(e) {
187
+ let t = k.get(e);
188
+ return t === void 0 ? null : (k.delete(e), t);
189
+ }
190
+ function M(e) {
191
+ k.delete(e);
192
+ }
193
+ //#endregion
194
+ export { O as a, v as c, D as i, A as n, w as o, j as r, b as s, M as t };
@@ -0,0 +1,27 @@
1
+ import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
+ import { useCallback as t, useState as n } from "react";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ //#region src/components/primitives/RecordIdBadge.tsx
5
+ var a = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, o = 1200;
6
+ function s({ value: s }) {
7
+ let [c, l] = n(!1), u = a.test(s) ? `${s.slice(0, 8)}…` : s, d = t(async () => {
8
+ try {
9
+ await navigator.clipboard.writeText(s), l(!0), window.setTimeout(() => l(!1), o);
10
+ } catch {}
11
+ }, [s]);
12
+ return /* @__PURE__ */ i("button", {
13
+ type: "button",
14
+ onClick: d,
15
+ title: c ? "Copied" : `Copy ${s}`,
16
+ className: "mono inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-text-4 hover:bg-surface-2 hover:text-text-3 transition-colors shrink-0 border border-transparent hover:border-border",
17
+ children: [/* @__PURE__ */ r("span", { children: u }), c ? /* @__PURE__ */ r(e.check, { size: 10 }) : /* @__PURE__ */ r(e.copy, {
18
+ size: 10,
19
+ style: { opacity: .6 }
20
+ })]
21
+ });
22
+ }
23
+ //#endregion
24
+ //#region src/lib/record-documents-key.ts
25
+ var c = "record-documents";
26
+ //#endregion
27
+ export { s as n, c as t };