@declarion/react 0.48.2 → 0.49.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/Check-DAfMbQIw.js +38 -0
- package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-B98Md-Yq.js} +30 -30
- package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BdtEd4R9.js} +2 -2
- package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-oVU3nEb5.js} +600 -597
- package/dist-lib/ListCardsBody-DYMt1H8l.js +287 -0
- package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-E9hbyoUn.js} +1 -1
- package/dist-lib/RefreshControl-B_2eW53M.js +430 -0
- package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-Dg22HOxb.js} +520 -515
- package/dist-lib/SmartListPage.impl-CPhhXT5S.js +2849 -0
- package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-CF0UKgUj.js} +243 -240
- package/dist-lib/SortHeaderMenu-DodGvb7A.js +106 -0
- package/dist-lib/action-dispatch-CYOw7nkP.js +1984 -0
- package/dist-lib/api/batch.d.ts +5 -2
- package/dist-lib/api/data.d.ts +35 -4
- package/dist-lib/api/entities.d.ts +3 -3
- package/dist-lib/cardProjection-D-AufCh-.js +757 -0
- package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
- package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
- package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
- package/dist-lib/components/file-widgets/upload.d.ts +6 -1
- package/dist-lib/components/layout/Layout.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
- package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
- package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
- package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
- package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
- package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
- package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
- package/dist-lib/components/pages/list/page-size.d.ts +3 -0
- package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
- package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
- package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
- package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
- package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
- package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
- package/dist-lib/field-classification-DTgUnbzd.js +1134 -0
- package/dist-lib/format-count-DAHCcHZO.js +1551 -0
- package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
- package/dist-lib/hooks/useText.d.ts +3 -0
- package/dist-lib/hooks/useViews.d.ts +1 -1
- package/dist-lib/index.d.ts +17 -15
- package/dist-lib/index.js +1783 -6287
- package/dist-lib/lib/messages.d.ts +7 -1
- package/dist-lib/lib/rowClickGesture.d.ts +12 -0
- package/dist-lib/lib/timestamp.d.ts +8 -3
- package/dist-lib/peekDraftStore-CnxqkoWN.js +194 -0
- package/dist-lib/record-documents-key-DEFlLxnF.js +27 -0
- package/dist-lib/registry-WypUQQ7t.js +1768 -0
- package/dist-lib/testing.d.ts +17 -2
- package/dist-lib/testing.js +72 -58
- package/dist-lib/types/api.d.ts +54 -12
- package/dist-lib/types/schema.d.ts +22 -6
- package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-C5Oio-1G.js} +1125 -1068
- package/dist-lib/useListQuery-Dc2vbxqs.js +87 -0
- package/dist-lib/useProperties-C36ENFdY.js +81 -0
- package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-sIuYEFaq.js} +116 -194
- package/dist-lib/{value-B1O6QikE.js → value-igT4LsqW.js} +69 -69
- package/package.json +1 -1
- package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
- package/dist-lib/registry-CCxnZW2b.js +0 -5281
- /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
- /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
- /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
- /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
- /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
- /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
- /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
|
@@ -1,945 +0,0 @@
|
|
|
1
|
-
import { s as e } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
-
import { Gt as t, Qn as n, Rn as r, St as i, Tn as a, Zn as o, bt as s, cr as c, i as l, jt as u, lr as d, mt as f, nr as p, or as m, pt as h, tr as g, ur as ee } from "./useCurrentScreen-BshVTPVq.js";
|
|
3
|
-
import { useCallback as _, useEffect as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
4
|
-
import { useLocation as C } from "react-router";
|
|
5
|
-
import { useQuery as w, useQueryClient as T } from "@tanstack/react-query";
|
|
6
|
-
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
-
import { createPortal as k } from "react-dom";
|
|
8
|
-
import { create as A } from "zustand";
|
|
9
|
-
//#region src/components/primitives/Avatar.tsx
|
|
10
|
-
function j({ name: e, size: t = 22, color: n }) {
|
|
11
|
-
let r = e.split(/\s+/).map((e) => e[0]).slice(0, 2).join("").toUpperCase(), i = e.split("").reduce((e, t) => e + t.charCodeAt(0), 0), a = [
|
|
12
|
-
"#DCE4F6",
|
|
13
|
-
"#E4DCF6",
|
|
14
|
-
"#F6DCE4",
|
|
15
|
-
"#F6E4DC",
|
|
16
|
-
"#DCF6E4",
|
|
17
|
-
"#DCF6F1",
|
|
18
|
-
"#F1F6DC",
|
|
19
|
-
"#F6DCF1"
|
|
20
|
-
], o = n || a[i % a.length];
|
|
21
|
-
return /* @__PURE__ */ D("span", {
|
|
22
|
-
style: {
|
|
23
|
-
display: "inline-flex",
|
|
24
|
-
alignItems: "center",
|
|
25
|
-
justifyContent: "center",
|
|
26
|
-
width: t,
|
|
27
|
-
height: t,
|
|
28
|
-
borderRadius: 999,
|
|
29
|
-
background: o,
|
|
30
|
-
color: "#1E2A4A",
|
|
31
|
-
fontSize: t < 20 ? 9.5 : 10.5,
|
|
32
|
-
fontWeight: 600,
|
|
33
|
-
flexShrink: 0
|
|
34
|
-
},
|
|
35
|
-
children: r
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/components/primitives/Tooltip.tsx
|
|
40
|
-
var te = 350, ne = 80, M = 260, N = 6, P = 4;
|
|
41
|
-
function F(e, t) {
|
|
42
|
-
let [n, r] = S(!1), [i, a] = S(null), o = x(null), s = x(null), c = x(null), l = y(), u = _(() => {
|
|
43
|
-
s.current && clearTimeout(s.current), c.current && clearTimeout(c.current), s.current = null, c.current = null;
|
|
44
|
-
}, []), d = _(() => {
|
|
45
|
-
let t = e.current;
|
|
46
|
-
if (!t) return;
|
|
47
|
-
let n = t.getBoundingClientRect(), r = o.current, i = r?.offsetWidth ?? M, s = r?.offsetHeight ?? 0, c = n.left + n.width / 2 - i / 2;
|
|
48
|
-
c = Math.max(P, Math.min(c, window.innerWidth - i - P));
|
|
49
|
-
let l = n.top - N - s < P ? n.bottom + N : n.top - N - s;
|
|
50
|
-
a({
|
|
51
|
-
left: c,
|
|
52
|
-
top: l
|
|
53
|
-
});
|
|
54
|
-
}, [e]), f = _((e) => {
|
|
55
|
-
t && (u(), e ? r(!0) : s.current = setTimeout(() => r(!0), te));
|
|
56
|
-
}, [u, t]), p = _(() => {
|
|
57
|
-
u(), c.current = setTimeout(() => r(!1), ne);
|
|
58
|
-
}, [u]);
|
|
59
|
-
v(() => {
|
|
60
|
-
if (!n) {
|
|
61
|
-
a(null);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
d();
|
|
65
|
-
let e = () => d();
|
|
66
|
-
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
67
|
-
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
68
|
-
};
|
|
69
|
-
}, [n, d]), v(() => u, [u]), v(() => {
|
|
70
|
-
if (!n) return;
|
|
71
|
-
let t = (t) => {
|
|
72
|
-
let n = e.current;
|
|
73
|
-
n && t.target instanceof Node && n.contains(t.target) || r(!1);
|
|
74
|
-
};
|
|
75
|
-
return document.addEventListener("pointerdown", t, !0), () => document.removeEventListener("pointerdown", t, !0);
|
|
76
|
-
}, [n, e]);
|
|
77
|
-
let m = {
|
|
78
|
-
position: "fixed",
|
|
79
|
-
left: i?.left ?? 0,
|
|
80
|
-
top: i?.top ?? 0,
|
|
81
|
-
zIndex: 1e3,
|
|
82
|
-
maxWidth: M,
|
|
83
|
-
padding: "5px 8px",
|
|
84
|
-
borderRadius: 6,
|
|
85
|
-
background: "var(--surface-inverse, #1f2430)",
|
|
86
|
-
color: "var(--text-inverse, #f5f6f8)",
|
|
87
|
-
fontSize: 12,
|
|
88
|
-
lineHeight: 1.4,
|
|
89
|
-
boxShadow: "0 4px 14px rgba(0,0,0,0.18)",
|
|
90
|
-
pointerEvents: "none",
|
|
91
|
-
visibility: i ? "visible" : "hidden",
|
|
92
|
-
whiteSpace: "normal"
|
|
93
|
-
}, h = n && t ? k(/* @__PURE__ */ D("div", {
|
|
94
|
-
ref: o,
|
|
95
|
-
id: l,
|
|
96
|
-
role: "tooltip",
|
|
97
|
-
style: m,
|
|
98
|
-
children: t
|
|
99
|
-
}), document.body) : null;
|
|
100
|
-
return {
|
|
101
|
-
open: n,
|
|
102
|
-
triggerHandlers: {
|
|
103
|
-
onMouseEnter: () => f(!1),
|
|
104
|
-
onMouseLeave: p,
|
|
105
|
-
onFocus: () => f(!0),
|
|
106
|
-
onBlur: p,
|
|
107
|
-
onPointerUp: (e) => {
|
|
108
|
-
e.pointerType === "mouse" || !t || (u(), r((e) => !e));
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
describedBy: n && t ? l : void 0,
|
|
112
|
-
portal: h
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function re({ content: e, children: t, triggerProps: n }) {
|
|
116
|
-
let r = x(null), { triggerHandlers: i, describedBy: a, portal: o } = F(r, e);
|
|
117
|
-
return e ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
|
|
118
|
-
...n,
|
|
119
|
-
ref: r,
|
|
120
|
-
"aria-describedby": a,
|
|
121
|
-
style: {
|
|
122
|
-
display: "inline-flex",
|
|
123
|
-
alignItems: "center",
|
|
124
|
-
...n?.style ?? {}
|
|
125
|
-
},
|
|
126
|
-
...i,
|
|
127
|
-
children: t
|
|
128
|
-
}), o] }) : /* @__PURE__ */ D(E, { children: t });
|
|
129
|
-
}
|
|
130
|
-
function ie({ label: t, size: n = 14, ...r }) {
|
|
131
|
-
return /* @__PURE__ */ D(re, {
|
|
132
|
-
content: t,
|
|
133
|
-
children: /* @__PURE__ */ D("span", {
|
|
134
|
-
tabIndex: 0,
|
|
135
|
-
role: "note",
|
|
136
|
-
"aria-label": t,
|
|
137
|
-
"data-testid": r["data-testid"],
|
|
138
|
-
style: {
|
|
139
|
-
display: "inline-flex",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
color: "var(--text-3)",
|
|
142
|
-
cursor: "help"
|
|
143
|
-
},
|
|
144
|
-
children: /* @__PURE__ */ D(e.info, { size: n })
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/components/primitives/RecordIdBadge.tsx
|
|
150
|
-
var ae = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, oe = 1200;
|
|
151
|
-
function se({ value: t }) {
|
|
152
|
-
let [n, r] = S(!1), i = ae.test(t) ? `${t.slice(0, 8)}…` : t, a = _(async () => {
|
|
153
|
-
try {
|
|
154
|
-
await navigator.clipboard.writeText(t), r(!0), window.setTimeout(() => r(!1), oe);
|
|
155
|
-
} catch {}
|
|
156
|
-
}, [t]);
|
|
157
|
-
return /* @__PURE__ */ O("button", {
|
|
158
|
-
type: "button",
|
|
159
|
-
onClick: a,
|
|
160
|
-
title: n ? "Copied" : `Copy ${t}`,
|
|
161
|
-
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",
|
|
162
|
-
children: [/* @__PURE__ */ D("span", { children: i }), n ? /* @__PURE__ */ D(e.check, { size: 10 }) : /* @__PURE__ */ D(e.copy, {
|
|
163
|
-
size: 10,
|
|
164
|
-
style: { opacity: .6 }
|
|
165
|
-
})]
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region src/lib/branding.ts
|
|
170
|
-
var ce = "branding";
|
|
171
|
-
function le(e, t) {
|
|
172
|
-
return e?.parameters.find((e) => e.code === t)?.value;
|
|
173
|
-
}
|
|
174
|
-
function ue(e) {
|
|
175
|
-
return I(le(e, ce));
|
|
176
|
-
}
|
|
177
|
-
function I(e) {
|
|
178
|
-
if (L(e)) return e;
|
|
179
|
-
}
|
|
180
|
-
function de(e) {
|
|
181
|
-
let t = ue(e)?.identity;
|
|
182
|
-
return L(t) ? t : void 0;
|
|
183
|
-
}
|
|
184
|
-
function L(e) {
|
|
185
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
186
|
-
}
|
|
187
|
-
function fe(e) {
|
|
188
|
-
if (!e) return !1;
|
|
189
|
-
let t = e.trim();
|
|
190
|
-
return t ? t.startsWith("/") || t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:image/") : !1;
|
|
191
|
-
}
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region src/api/params.ts
|
|
194
|
-
async function pe() {
|
|
195
|
-
let e = (await t("/api/params/public")).data;
|
|
196
|
-
if (Array.isArray(e)) return { parameters: e };
|
|
197
|
-
let n = e ?? {};
|
|
198
|
-
return {
|
|
199
|
-
parameters: n.parameters ?? [],
|
|
200
|
-
accents: n.accents,
|
|
201
|
-
messages: n.messages,
|
|
202
|
-
meta: n.meta
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
async function R(e) {
|
|
206
|
-
return (await t(`/api/params/${encodeURIComponent(e)}`)).data;
|
|
207
|
-
}
|
|
208
|
-
async function me(e) {
|
|
209
|
-
return (await t(`/api/params${e === "tenant" ? "?resolution=tenant" : ""}`)).data ?? [];
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/hooks/useParams.ts
|
|
213
|
-
var z = "$params";
|
|
214
|
-
function he({ carrierEntityCode: e, rowId: t, enabled: n = !0, onWritten: r }) {
|
|
215
|
-
let a = T(), [o, c] = S(null), l = w({
|
|
216
|
-
queryKey: [
|
|
217
|
-
"params-carrier-detail",
|
|
218
|
-
e,
|
|
219
|
-
t
|
|
220
|
-
],
|
|
221
|
-
queryFn: () => i(e, t),
|
|
222
|
-
enabled: n && !!t,
|
|
223
|
-
staleTime: 3e4
|
|
224
|
-
}), u = l.data?.data, d = !!u && !("$params" in u), f = b(() => Array.isArray(u?.$params) ? u[z] : [], [u]), p = b(() => new Map(f.map((e) => [e.param_code, e])), [f]), m = _(async (n) => {
|
|
225
|
-
c(null);
|
|
226
|
-
try {
|
|
227
|
-
await s(`${e}.__update`, {
|
|
228
|
-
object_ids: [t],
|
|
229
|
-
entity: e,
|
|
230
|
-
fields: { [z]: n }
|
|
231
|
-
}), await a.invalidateQueries({ queryKey: ["params-all"] }), await a.invalidateQueries({ queryKey: [
|
|
232
|
-
"params-carrier-detail",
|
|
233
|
-
e,
|
|
234
|
-
t
|
|
235
|
-
] }), r?.();
|
|
236
|
-
} catch (e) {
|
|
237
|
-
c(e instanceof Error ? e.message : "Failed to save parameter.");
|
|
238
|
-
}
|
|
239
|
-
}, [
|
|
240
|
-
e,
|
|
241
|
-
t,
|
|
242
|
-
a,
|
|
243
|
-
r
|
|
244
|
-
]), h = _((e, t) => {
|
|
245
|
-
let n = f.filter((t) => t.param_code !== e.code);
|
|
246
|
-
return n.push({
|
|
247
|
-
param_code: e.code,
|
|
248
|
-
value: t
|
|
249
|
-
}), m(n);
|
|
250
|
-
}, [f, m]), g = _((e) => m(f.filter((t) => t.param_code !== e.code)), [f, m]), ee = _(() => c(null), []);
|
|
251
|
-
return {
|
|
252
|
-
overrides: f,
|
|
253
|
-
overrideByCode: p,
|
|
254
|
-
missingParams: d,
|
|
255
|
-
isLoading: l.isLoading,
|
|
256
|
-
error: o,
|
|
257
|
-
clearError: ee,
|
|
258
|
-
save: h,
|
|
259
|
-
reset: g
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function ge(e) {
|
|
263
|
-
return w({
|
|
264
|
-
queryKey: ["params-all", e ?? "full"],
|
|
265
|
-
queryFn: () => me(e),
|
|
266
|
-
staleTime: 3e4
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
function B() {
|
|
270
|
-
return w({
|
|
271
|
-
queryKey: ["params-public"],
|
|
272
|
-
queryFn: pe,
|
|
273
|
-
staleTime: 3e5
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
function V(e, t = {}) {
|
|
277
|
-
let n = t.enabled ?? !0;
|
|
278
|
-
return w({
|
|
279
|
-
queryKey: ["params", e],
|
|
280
|
-
queryFn: () => R(e),
|
|
281
|
-
enabled: !!e && n,
|
|
282
|
-
staleTime: 6e4
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
function H(e) {
|
|
286
|
-
let t = u((e) => e.isAuthenticated), n = B(), r = V(e, { enabled: t }), i = _e(n.data?.parameters, e);
|
|
287
|
-
if (t && r.data?.found) return {
|
|
288
|
-
value: r.data.value,
|
|
289
|
-
found: !0,
|
|
290
|
-
source: r.data.source,
|
|
291
|
-
loading: !1,
|
|
292
|
-
error: null
|
|
293
|
-
};
|
|
294
|
-
let a = i !== void 0;
|
|
295
|
-
return {
|
|
296
|
-
value: i?.value,
|
|
297
|
-
found: a,
|
|
298
|
-
source: a ? "public" : void 0,
|
|
299
|
-
loading: n.isLoading || t && r.isLoading && !r.data && !r.error,
|
|
300
|
-
error: r.error ?? n.error ?? null
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function _e(e, t) {
|
|
304
|
-
return e?.find((e) => e.code === t);
|
|
305
|
-
}
|
|
306
|
-
function ve(e, t) {
|
|
307
|
-
let n = w({
|
|
308
|
-
queryKey: ["params", e],
|
|
309
|
-
queryFn: () => R(e),
|
|
310
|
-
enabled: !!e,
|
|
311
|
-
staleTime: 6e4
|
|
312
|
-
}), r = n.data, i = !!r?.found;
|
|
313
|
-
return {
|
|
314
|
-
value: i ? r.value : t,
|
|
315
|
-
found: i,
|
|
316
|
-
source: r?.source,
|
|
317
|
-
loading: n.isLoading,
|
|
318
|
-
error: n.error ?? null
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
//#endregion
|
|
322
|
-
//#region src/hooks/useBranding.ts
|
|
323
|
-
function U() {
|
|
324
|
-
let e = H(ce);
|
|
325
|
-
return {
|
|
326
|
-
branding: I(e.value),
|
|
327
|
-
isLoading: e.loading
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
function ye() {
|
|
331
|
-
return U().branding?.identity;
|
|
332
|
-
}
|
|
333
|
-
function W() {
|
|
334
|
-
return U().branding?.chrome;
|
|
335
|
-
}
|
|
336
|
-
//#endregion
|
|
337
|
-
//#region src/stores/page-state.ts
|
|
338
|
-
var G = 18e5, K = null;
|
|
339
|
-
function be(e) {
|
|
340
|
-
K = e;
|
|
341
|
-
}
|
|
342
|
-
function q(e) {
|
|
343
|
-
if (!(!e || !K)) for (let t of e.queryKeys) K.removeQueries({
|
|
344
|
-
queryKey: t,
|
|
345
|
-
exact: !0
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
function J(e, t) {
|
|
349
|
-
let n = e[t];
|
|
350
|
-
if (!n) return e;
|
|
351
|
-
q(n);
|
|
352
|
-
let r = { ...e };
|
|
353
|
-
return delete r[t], r;
|
|
354
|
-
}
|
|
355
|
-
function xe(e, t) {
|
|
356
|
-
let n = e;
|
|
357
|
-
for (; Object.keys(n).length > 64;) {
|
|
358
|
-
let e = null, r = Infinity;
|
|
359
|
-
for (let [i, a] of Object.entries(n)) i !== t && a.lastActiveAt < r && (r = a.lastActiveAt, e = i);
|
|
360
|
-
if (e === null) break;
|
|
361
|
-
n = J(n, e);
|
|
362
|
-
}
|
|
363
|
-
return n;
|
|
364
|
-
}
|
|
365
|
-
var Y = A((e, t) => ({
|
|
366
|
-
entries: {},
|
|
367
|
-
ttlMs: G,
|
|
368
|
-
setTtl: (n) => {
|
|
369
|
-
if (n <= 0) {
|
|
370
|
-
let { entries: r } = t();
|
|
371
|
-
for (let e of Object.keys(r)) q(r[e]);
|
|
372
|
-
e({
|
|
373
|
-
ttlMs: n,
|
|
374
|
-
entries: {}
|
|
375
|
-
});
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
e({ ttlMs: n });
|
|
379
|
-
},
|
|
380
|
-
set: (n, r, i) => {
|
|
381
|
-
let a = t();
|
|
382
|
-
if (a.ttlMs <= 0) return;
|
|
383
|
-
let o = Date.now(), s = a.entries[n], c = s ? {
|
|
384
|
-
...s,
|
|
385
|
-
bag: {
|
|
386
|
-
...s.bag,
|
|
387
|
-
[r]: i
|
|
388
|
-
},
|
|
389
|
-
lastActiveAt: o
|
|
390
|
-
} : {
|
|
391
|
-
bag: { [r]: i },
|
|
392
|
-
lastActiveAt: o,
|
|
393
|
-
queryKeys: []
|
|
394
|
-
};
|
|
395
|
-
e({ entries: xe({
|
|
396
|
-
...a.entries,
|
|
397
|
-
[n]: c
|
|
398
|
-
}, n) });
|
|
399
|
-
},
|
|
400
|
-
read: (e, n) => {
|
|
401
|
-
let r = t();
|
|
402
|
-
if (!(r.ttlMs <= 0)) return r.entries[e]?.bag[n];
|
|
403
|
-
},
|
|
404
|
-
touch: (n) => {
|
|
405
|
-
let r = t();
|
|
406
|
-
if (r.ttlMs <= 0) return;
|
|
407
|
-
let i = r.entries[n];
|
|
408
|
-
i && e({ entries: {
|
|
409
|
-
...r.entries,
|
|
410
|
-
[n]: {
|
|
411
|
-
...i,
|
|
412
|
-
lastActiveAt: Date.now()
|
|
413
|
-
}
|
|
414
|
-
} });
|
|
415
|
-
},
|
|
416
|
-
registerQueryKey: (n, r) => {
|
|
417
|
-
let i = t();
|
|
418
|
-
if (i.ttlMs <= 0) return;
|
|
419
|
-
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) => Se(e, r));
|
|
420
|
-
if (o && s) return;
|
|
421
|
-
let c = o ? {
|
|
422
|
-
...o,
|
|
423
|
-
queryKeys: [...o.queryKeys, r],
|
|
424
|
-
lastActiveAt: a
|
|
425
|
-
} : {
|
|
426
|
-
bag: {},
|
|
427
|
-
lastActiveAt: a,
|
|
428
|
-
queryKeys: [r]
|
|
429
|
-
};
|
|
430
|
-
e({ entries: xe({
|
|
431
|
-
...i.entries,
|
|
432
|
-
[n]: c
|
|
433
|
-
}, n) });
|
|
434
|
-
},
|
|
435
|
-
kill: (n) => {
|
|
436
|
-
let r = t(), i = J(r.entries, n);
|
|
437
|
-
i !== r.entries && e({ entries: i });
|
|
438
|
-
},
|
|
439
|
-
sweep: (n) => {
|
|
440
|
-
let { ttlMs: r, entries: i } = t(), a = i;
|
|
441
|
-
for (let [e, t] of Object.entries(i)) (r <= 0 || n - t.lastActiveAt > r) && (a = J(a, e));
|
|
442
|
-
a !== i && e({ entries: a });
|
|
443
|
-
},
|
|
444
|
-
clear: () => {
|
|
445
|
-
let { entries: n } = t();
|
|
446
|
-
if (Object.keys(n).length !== 0) {
|
|
447
|
-
for (let e of Object.keys(n)) q(n[e]);
|
|
448
|
-
e({ entries: {} });
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}));
|
|
452
|
-
function Se(e, t) {
|
|
453
|
-
if (e === t) return !0;
|
|
454
|
-
try {
|
|
455
|
-
return JSON.stringify(e) === JSON.stringify(t);
|
|
456
|
-
} catch {
|
|
457
|
-
return !1;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region src/lib/canonical-url.ts
|
|
462
|
-
function Ce(e) {
|
|
463
|
-
return e.length > 1 && e.endsWith("/") ? e.replace(/\/+$/, "") || "/" : e;
|
|
464
|
-
}
|
|
465
|
-
function X(e) {
|
|
466
|
-
let t = Ce(e.pathname), n = e.search ?? "", r = n.startsWith("?") ? n.slice(1) : n, i = new URLSearchParams(r);
|
|
467
|
-
for (let e of f) i.delete(e);
|
|
468
|
-
i.sort();
|
|
469
|
-
let a = i.toString();
|
|
470
|
-
return a ? `${t}?${a}` : t;
|
|
471
|
-
}
|
|
472
|
-
function we(e) {
|
|
473
|
-
return Ce(e.pathname);
|
|
474
|
-
}
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region src/hooks/usePageStateTtl.ts
|
|
477
|
-
var Te = "ui_page_state_ttl_ms";
|
|
478
|
-
function Ee() {
|
|
479
|
-
let { value: e } = ve(Te, G);
|
|
480
|
-
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? G : e;
|
|
481
|
-
}
|
|
482
|
-
//#endregion
|
|
483
|
-
//#region src/hooks/usePageStateRuntime.ts
|
|
484
|
-
var De = [
|
|
485
|
-
["entity-data"],
|
|
486
|
-
["entity-count"],
|
|
487
|
-
["entity-item"],
|
|
488
|
-
["entity-data-cursor"],
|
|
489
|
-
["entity-data-all"],
|
|
490
|
-
["action-data"],
|
|
491
|
-
["action-data-cursor"]
|
|
492
|
-
], Oe = 6e4;
|
|
493
|
-
function ke(e, t) {
|
|
494
|
-
for (let n of De) e.setQueryDefaults(n, { gcTime: t });
|
|
495
|
-
}
|
|
496
|
-
function Ae() {
|
|
497
|
-
let e = T(), t = Ee(), n = C(), r = x(n);
|
|
498
|
-
r.current = n, v(() => (be(e), () => be(null)), [e]), v(() => {
|
|
499
|
-
if (Y.getState().setTtl(t), ke(e, t), t <= 0) for (let t of De) e.removeQueries({ queryKey: t });
|
|
500
|
-
}, [e, t]), v(() => {
|
|
501
|
-
if (t <= 0) return;
|
|
502
|
-
let e = setInterval(() => {
|
|
503
|
-
let e = Y.getState(), t = r.current;
|
|
504
|
-
e.touch(X(t)), e.touch(we(t)), e.sweep(Date.now());
|
|
505
|
-
}, Oe);
|
|
506
|
-
return () => clearInterval(e);
|
|
507
|
-
}, [t]);
|
|
508
|
-
}
|
|
509
|
-
function je(e, t = !0) {
|
|
510
|
-
let n = X(C()), r = e ? JSON.stringify(e) : "";
|
|
511
|
-
v(() => {
|
|
512
|
-
!t || !e || Y.getState().registerQueryKey(n, e);
|
|
513
|
-
}, [
|
|
514
|
-
n,
|
|
515
|
-
r,
|
|
516
|
-
t
|
|
517
|
-
]);
|
|
518
|
-
}
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region src/lib/record-documents-key.ts
|
|
521
|
-
var Me = "record-documents";
|
|
522
|
-
//#endregion
|
|
523
|
-
//#region src/hooks/useBrandingChrome.ts
|
|
524
|
-
function Ne() {
|
|
525
|
-
let e = h(), t = W();
|
|
526
|
-
return (e.enabled ? t?.embed?.viewport : t?.full?.viewport) ?? "auto";
|
|
527
|
-
}
|
|
528
|
-
function Z(e, t) {
|
|
529
|
-
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
530
|
-
}
|
|
531
|
-
function Pe() {
|
|
532
|
-
let e = h(), t = W(), n = e.enabled ? t?.embed?.breakpoints : t?.full?.breakpoints;
|
|
533
|
-
return b(() => ({
|
|
534
|
-
phoneMax: Z(n?.phone_max, p.phoneMax),
|
|
535
|
-
tabletMax: Z(n?.tablet_max, p.tabletMax),
|
|
536
|
-
landscapePhoneMaxHeight: Z(n?.landscape_phone_max_height, p.landscapePhoneMaxHeight)
|
|
537
|
-
}), [
|
|
538
|
-
n?.phone_max,
|
|
539
|
-
n?.tablet_max,
|
|
540
|
-
n?.landscape_phone_max_height
|
|
541
|
-
]);
|
|
542
|
-
}
|
|
543
|
-
function Fe(e) {
|
|
544
|
-
let t = h(), n = W();
|
|
545
|
-
return b(() => {
|
|
546
|
-
let r = { ...t.enabled ? n?.embed?.surfaces?.[e] : n?.full?.surfaces?.[e] };
|
|
547
|
-
return {
|
|
548
|
-
...r,
|
|
549
|
-
isVisible: (e) => r[e] !== !1
|
|
550
|
-
};
|
|
551
|
-
}, [
|
|
552
|
-
n,
|
|
553
|
-
t.enabled,
|
|
554
|
-
e
|
|
555
|
-
]);
|
|
556
|
-
}
|
|
557
|
-
function Ie() {
|
|
558
|
-
let e = W();
|
|
559
|
-
return b(() => {
|
|
560
|
-
let t = { ...e?.full?.shell };
|
|
561
|
-
return {
|
|
562
|
-
...t,
|
|
563
|
-
isVisible: (e) => t[e] !== !1
|
|
564
|
-
};
|
|
565
|
-
}, [e]);
|
|
566
|
-
}
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/components/pages/exportRequest.ts
|
|
569
|
-
var Le = /* @__PURE__ */ new Set(["_select", "_actions"]);
|
|
570
|
-
function Re(e) {
|
|
571
|
-
let t = {};
|
|
572
|
-
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;
|
|
573
|
-
}
|
|
574
|
-
function ze(e, t) {
|
|
575
|
-
let n = t.visibleColumns.filter((e) => !Le.has(e)), r = {
|
|
576
|
-
format: "csv",
|
|
577
|
-
scope: t.scope,
|
|
578
|
-
query: Re(e),
|
|
579
|
-
columns: n
|
|
580
|
-
};
|
|
581
|
-
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;
|
|
582
|
-
}
|
|
583
|
-
//#endregion
|
|
584
|
-
//#region src/components/pages/DocumentsMenu.tsx
|
|
585
|
-
var Be = "document-templates-available";
|
|
586
|
-
function Ve({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selectedIds: c = [], capability: u, canManageTemplates: d = !1 }) {
|
|
587
|
-
let { run: f } = l(), p = x(null), [h, _] = S(!1), v = r === "detail" ? !!u?.generate_one : !!u?.generate_many, y = d && !v, { data: C, isLoading: T, error: k } = w({
|
|
588
|
-
queryKey: [Be, t],
|
|
589
|
-
queryFn: async () => (await s("document.templates.available", { entity: t })).result?.templates ?? [],
|
|
590
|
-
enabled: h || y,
|
|
591
|
-
staleTime: 6e4
|
|
592
|
-
}), A = T, j = b(() => (C ?? []).filter((e) => r === "detail" ? e.input_mode === "one" || e.input_mode === "global" : e.input_mode === "many" || e.input_mode === "global"), [r, C]), te = y && j.length > 0, ne = v || te;
|
|
593
|
-
function M() {
|
|
594
|
-
_((e) => !e);
|
|
595
|
-
}
|
|
596
|
-
function N(e) {
|
|
597
|
-
if (e.input_mode === "global") return [{ kind: "global" }];
|
|
598
|
-
if (r === "detail") return e.input_mode === "one" && i.length === 1 ? [{
|
|
599
|
-
kind: "one",
|
|
600
|
-
objectIds: i
|
|
601
|
-
}] : [];
|
|
602
|
-
if (e.input_mode === "many") {
|
|
603
|
-
let e = [];
|
|
604
|
-
return o && e.push({
|
|
605
|
-
kind: "current_view",
|
|
606
|
-
query: Re(o)
|
|
607
|
-
}), c.length > 0 && e.push({
|
|
608
|
-
kind: "selected",
|
|
609
|
-
objectIds: c
|
|
610
|
-
}), e;
|
|
611
|
-
}
|
|
612
|
-
return [];
|
|
613
|
-
}
|
|
614
|
-
function P(e, t, n) {
|
|
615
|
-
let r = He(e), i = a(e.name) || e.code;
|
|
616
|
-
_(!1), f({
|
|
617
|
-
action: r,
|
|
618
|
-
title: i,
|
|
619
|
-
execute: (r) => {
|
|
620
|
-
let i = {
|
|
621
|
-
template_code: e.code,
|
|
622
|
-
template_source: e.source,
|
|
623
|
-
output_format: n
|
|
624
|
-
};
|
|
625
|
-
return Object.keys(r).length > 0 && (i.params = r), "objectIds" in t && (i.object_ids = t.objectIds), "query" in t && (i.query = {
|
|
626
|
-
scope: "current_view",
|
|
627
|
-
query: t.query
|
|
628
|
-
}), s("document.generate", i);
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
let { isPhone: F } = g();
|
|
633
|
-
return ne ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ee, {
|
|
634
|
-
ref: p,
|
|
635
|
-
kind: "ghost",
|
|
636
|
-
size: "sm",
|
|
637
|
-
icon: D(A ? e.loader : e.filePlus, { size: 12 }),
|
|
638
|
-
onClick: M,
|
|
639
|
-
disabled: A,
|
|
640
|
-
"aria-label": "Generate",
|
|
641
|
-
title: "Generate",
|
|
642
|
-
children: F ? null : "Generate"
|
|
643
|
-
}), /* @__PURE__ */ O(m, {
|
|
644
|
-
open: h,
|
|
645
|
-
anchor: p.current,
|
|
646
|
-
onClose: () => _(!1),
|
|
647
|
-
align: "end",
|
|
648
|
-
width: 300,
|
|
649
|
-
children: [
|
|
650
|
-
A && /* @__PURE__ */ D(n, {
|
|
651
|
-
disabled: !0,
|
|
652
|
-
icon: /* @__PURE__ */ D(e.loader, { size: 12 }),
|
|
653
|
-
children: "Loading templates..."
|
|
654
|
-
}),
|
|
655
|
-
k && /* @__PURE__ */ D(n, {
|
|
656
|
-
disabled: !0,
|
|
657
|
-
icon: /* @__PURE__ */ D(e.warning, { size: 12 }),
|
|
658
|
-
children: k instanceof Error ? k.message : String(k)
|
|
659
|
-
}),
|
|
660
|
-
!A && !k && j.length === 0 && /* @__PURE__ */ D(n, {
|
|
661
|
-
disabled: !0,
|
|
662
|
-
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
663
|
-
children: "No document templates"
|
|
664
|
-
}),
|
|
665
|
-
!A && !k && j.map((t) => {
|
|
666
|
-
let r = N(t);
|
|
667
|
-
return r.length === 0 ? null : Ue(t).flatMap((i) => r.map((r) => i.available ? /* @__PURE__ */ D(n, {
|
|
668
|
-
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
669
|
-
onClick: () => P(t, r, i.format),
|
|
670
|
-
title: a(t.description),
|
|
671
|
-
children: We(t, r, i.format)
|
|
672
|
-
}, `${t.source}:${t.code}:${r.kind}:${i.format}`) : /* @__PURE__ */ O(n, {
|
|
673
|
-
disabled: !0,
|
|
674
|
-
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
675
|
-
title: i.disabled_reason,
|
|
676
|
-
children: [
|
|
677
|
-
We(t, r, i.format),
|
|
678
|
-
" - ",
|
|
679
|
-
i.disabled_reason || "Unavailable"
|
|
680
|
-
]
|
|
681
|
-
}, `${t.source}:${t.code}:${r.kind}:${i.format}:disabled`)));
|
|
682
|
-
})
|
|
683
|
-
]
|
|
684
|
-
})] }) : null;
|
|
685
|
-
}
|
|
686
|
-
function He(e) {
|
|
687
|
-
let t = new r((e.params ?? []).map((e) => ({
|
|
688
|
-
...e,
|
|
689
|
-
name: e.name ?? ""
|
|
690
|
-
})));
|
|
691
|
-
return {
|
|
692
|
-
handler: "document.generate",
|
|
693
|
-
display: {
|
|
694
|
-
name: e.name,
|
|
695
|
-
icon: "file",
|
|
696
|
-
description: e.description
|
|
697
|
-
},
|
|
698
|
-
resolved_params: t
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
function Ue(e) {
|
|
702
|
-
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) => ({
|
|
703
|
-
format: e,
|
|
704
|
-
available: !0
|
|
705
|
-
}));
|
|
706
|
-
}
|
|
707
|
-
function We(e, t, n) {
|
|
708
|
-
let r = a(e.name) || e.code, i = n ? ` (${n.toUpperCase()})` : "";
|
|
709
|
-
switch (t.kind) {
|
|
710
|
-
case "one": return `${r}${i}`;
|
|
711
|
-
case "selected": return `${r}${i} - selected rows`;
|
|
712
|
-
case "current_view": return `${r}${i} - current view`;
|
|
713
|
-
case "global": return `${r}${i}`;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
//#endregion
|
|
717
|
-
//#region src/lib/document-templates.ts
|
|
718
|
-
function Ge(e) {
|
|
719
|
-
return !!e?.entities?.document_template;
|
|
720
|
-
}
|
|
721
|
-
//#endregion
|
|
722
|
-
//#region src/lib/scroll-restoration.ts
|
|
723
|
-
var Q = "scroll", Ke = 120, qe = 24, Je = 600;
|
|
724
|
-
function Ye(e, t) {
|
|
725
|
-
return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
|
|
726
|
-
}
|
|
727
|
-
function Xe(e, t, n) {
|
|
728
|
-
let r = Number.isFinite(e) ? e : 0;
|
|
729
|
-
if (t) {
|
|
730
|
-
let e = n[t.index];
|
|
731
|
-
if (e !== void 0) return {
|
|
732
|
-
key: e,
|
|
733
|
-
delta: Math.max(0, r - t.start),
|
|
734
|
-
offset: r
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
return {
|
|
738
|
-
key: "",
|
|
739
|
-
delta: 0,
|
|
740
|
-
offset: r
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
function Ze(e, t, n, r) {
|
|
744
|
-
if (!e) return null;
|
|
745
|
-
if (e.key) {
|
|
746
|
-
let i = t.indexOf(e.key);
|
|
747
|
-
if (i >= 0) {
|
|
748
|
-
let t = n(i);
|
|
749
|
-
if (t !== void 0) return Ye(t + e.delta, r);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
return Ye(e.offset, r);
|
|
753
|
-
}
|
|
754
|
-
function Qe(e = Q) {
|
|
755
|
-
let t = C(), n = x(null);
|
|
756
|
-
if (n.current === null) {
|
|
757
|
-
let r = X(t), i = Y.getState().read(r, e);
|
|
758
|
-
n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
|
|
759
|
-
}
|
|
760
|
-
return n.current;
|
|
761
|
-
}
|
|
762
|
-
function $e(e) {
|
|
763
|
-
let t = 0, n = null, r = () => {
|
|
764
|
-
n = null, t = Date.now(), e();
|
|
765
|
-
};
|
|
766
|
-
return {
|
|
767
|
-
trigger() {
|
|
768
|
-
let e = Date.now() - t;
|
|
769
|
-
e >= Ke ? r() : n === null && (n = setTimeout(r, Ke - e));
|
|
770
|
-
},
|
|
771
|
-
flush() {
|
|
772
|
-
n !== null && (clearTimeout(n), n = null), e();
|
|
773
|
-
},
|
|
774
|
-
cancel() {
|
|
775
|
-
n !== null && (clearTimeout(n), n = null);
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
function et(e) {
|
|
780
|
-
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = X(C()), s = x(t);
|
|
781
|
-
s.current = t;
|
|
782
|
-
let c = x(r);
|
|
783
|
-
c.current = r;
|
|
784
|
-
let l = x(null);
|
|
785
|
-
v(() => {
|
|
786
|
-
l.current !== o && (l.current = null);
|
|
787
|
-
}, [o]), v(() => {
|
|
788
|
-
if (!a) return;
|
|
789
|
-
let e = s.current;
|
|
790
|
-
if (!e || r.length === 0) return;
|
|
791
|
-
let t = Y.getState().read(o, i), n = l.current !== o;
|
|
792
|
-
if (l.current = o, !t) {
|
|
793
|
-
n && e.scrollToOffset(0, {
|
|
794
|
-
align: "start",
|
|
795
|
-
behavior: "auto"
|
|
796
|
-
});
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
let u = 0, d = 0, f = NaN, p = () => {
|
|
800
|
-
let e = s.current;
|
|
801
|
-
if (!e) return;
|
|
802
|
-
let n = Ze(t, c.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
|
|
803
|
-
n !== null && (Number.isNaN(f) || Math.abs(n - f) > 1) && (e.scrollToOffset(n, {
|
|
804
|
-
align: "start",
|
|
805
|
-
behavior: "auto"
|
|
806
|
-
}), f = n, d++ < qe && (u = requestAnimationFrame(p)));
|
|
807
|
-
};
|
|
808
|
-
return p(), () => {
|
|
809
|
-
u && cancelAnimationFrame(u);
|
|
810
|
-
};
|
|
811
|
-
}, [
|
|
812
|
-
a,
|
|
813
|
-
o,
|
|
814
|
-
r,
|
|
815
|
-
i
|
|
816
|
-
]), tt(n, a, o, i, (e) => {
|
|
817
|
-
let t = s.current;
|
|
818
|
-
if (!t) return null;
|
|
819
|
-
let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
|
|
820
|
-
return Xe(r, t.getVirtualItemForOffset(r), c.current);
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
function tt(e, t, n, r, i) {
|
|
824
|
-
let a = x(i);
|
|
825
|
-
a.current = i, v(() => {
|
|
826
|
-
if (!t) return;
|
|
827
|
-
let i = 0, o = Je, s = null, c = null, l = (e) => {
|
|
828
|
-
let t = a.current(e);
|
|
829
|
-
t && Y.getState().set(n, r, t);
|
|
830
|
-
}, u = () => c?.trigger(), d = () => {
|
|
831
|
-
let t = e.current;
|
|
832
|
-
if (!t) {
|
|
833
|
-
o-- > 0 && (i = requestAnimationFrame(d));
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
836
|
-
s = t, c = $e(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
|
|
837
|
-
};
|
|
838
|
-
return d(), () => {
|
|
839
|
-
i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", u), c?.flush();
|
|
840
|
-
};
|
|
841
|
-
}, [
|
|
842
|
-
t,
|
|
843
|
-
e,
|
|
844
|
-
n,
|
|
845
|
-
r
|
|
846
|
-
]);
|
|
847
|
-
}
|
|
848
|
-
function nt(e) {
|
|
849
|
-
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = X(C()), a = x(null);
|
|
850
|
-
v(() => {
|
|
851
|
-
if (!r || a.current === i) return;
|
|
852
|
-
let e = 0, o = Je, s = () => {
|
|
853
|
-
let r = t.current;
|
|
854
|
-
if (!r) {
|
|
855
|
-
o-- > 0 && (e = requestAnimationFrame(s));
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
a.current = i;
|
|
859
|
-
let c = Y.getState().read(i, n);
|
|
860
|
-
c && (r.scrollTop = Number.isFinite(c.offset) ? Math.max(0, c.offset) : 0);
|
|
861
|
-
};
|
|
862
|
-
return s(), () => {
|
|
863
|
-
e && cancelAnimationFrame(e);
|
|
864
|
-
};
|
|
865
|
-
}, [
|
|
866
|
-
r,
|
|
867
|
-
i,
|
|
868
|
-
n,
|
|
869
|
-
t
|
|
870
|
-
]), tt(t, r, i, n, (e) => ({
|
|
871
|
-
key: "",
|
|
872
|
-
delta: 0,
|
|
873
|
-
offset: e.scrollTop
|
|
874
|
-
}));
|
|
875
|
-
}
|
|
876
|
-
//#endregion
|
|
877
|
-
//#region src/components/list/peekDraftStore.ts
|
|
878
|
-
var $ = /* @__PURE__ */ new Map();
|
|
879
|
-
function rt(e, t) {
|
|
880
|
-
$.set(e, t);
|
|
881
|
-
}
|
|
882
|
-
function it(e) {
|
|
883
|
-
let t = $.get(e);
|
|
884
|
-
return t === void 0 ? null : ($.delete(e), t);
|
|
885
|
-
}
|
|
886
|
-
function at(e) {
|
|
887
|
-
$.delete(e);
|
|
888
|
-
}
|
|
889
|
-
//#endregion
|
|
890
|
-
//#region src/lib/evidence-verdict.ts
|
|
891
|
-
var ot = {
|
|
892
|
-
verified: "Verified",
|
|
893
|
-
unverified: "Not yet verified",
|
|
894
|
-
tampered: "Tampered",
|
|
895
|
-
indeterminate: "Cannot verify",
|
|
896
|
-
outside_coverage: "Outside coverage"
|
|
897
|
-
}, st = {
|
|
898
|
-
verified: "emerald",
|
|
899
|
-
unverified: "slate",
|
|
900
|
-
tampered: "rose",
|
|
901
|
-
indeterminate: "amber",
|
|
902
|
-
outside_coverage: "slate"
|
|
903
|
-
};
|
|
904
|
-
function ct(e) {
|
|
905
|
-
return ot[e] ?? e;
|
|
906
|
-
}
|
|
907
|
-
function lt(e) {
|
|
908
|
-
return st[e] ?? "slate";
|
|
909
|
-
}
|
|
910
|
-
//#endregion
|
|
911
|
-
//#region src/components/shared/RefreshControl.tsx
|
|
912
|
-
function ut({ liveObject: t, realtime: n = !0 }) {
|
|
913
|
-
let { isPhone: r } = g(), i = t.isLive ? r ? void 0 : "Live" : "Updates paused";
|
|
914
|
-
return /* @__PURE__ */ O("span", {
|
|
915
|
-
style: {
|
|
916
|
-
display: "inline-flex",
|
|
917
|
-
alignItems: "center",
|
|
918
|
-
gap: 8
|
|
919
|
-
},
|
|
920
|
-
children: [/* @__PURE__ */ D(d, {
|
|
921
|
-
icon: t.isFetching ? /* @__PURE__ */ D("span", {
|
|
922
|
-
"data-testid": "refresh-spinner",
|
|
923
|
-
style: { display: "inline-flex" },
|
|
924
|
-
children: /* @__PURE__ */ D(o, { size: 14 })
|
|
925
|
-
}) : /* @__PURE__ */ D(e.refresh, { size: 14 }),
|
|
926
|
-
title: "Refresh",
|
|
927
|
-
disabled: t.isLoading || t.isFetching,
|
|
928
|
-
onClick: () => {
|
|
929
|
-
t.refetch();
|
|
930
|
-
}
|
|
931
|
-
}), n && /* @__PURE__ */ D("span", {
|
|
932
|
-
"data-testid": "live-indicator",
|
|
933
|
-
"aria-label": t.isLive ? "Live" : "Updates paused",
|
|
934
|
-
title: t.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
|
|
935
|
-
children: /* @__PURE__ */ D(c, {
|
|
936
|
-
tone: t.isLive ? "emerald" : "amber",
|
|
937
|
-
size: "xs",
|
|
938
|
-
dot: !0,
|
|
939
|
-
children: i
|
|
940
|
-
})
|
|
941
|
-
})]
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
//#endregion
|
|
945
|
-
export { ge as A, re as B, Ee as C, Y as D, G as E, V as F, j as H, de as I, fe as L, H as M, ve as N, U as O, B as P, se as R, Te as S, X as T, F as V, Ne as _, rt as a, Ae as b, nt as c, Ge as d, Ve as f, Ie as g, Fe as h, at as i, he as j, ye as k, Qe as l, Pe as m, ct as n, it as o, ze as p, lt as r, Q as s, ut as t, et as u, Me as v, we as w, je as x, ke as y, ie as z };
|