@declarion/react 0.51.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-BQZTvZaU.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid-B9Tiytbd.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-D_v9OD_A.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-dRnXsQ7A.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-BCyrsLrd.js} +10 -10
- package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
- package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-CV8nGACW.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-DWprVNMb.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-BwWURGwa.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-BKKBShAg.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-pgi4sxMs.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DlHTYag7.js} +382 -382
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-C7Orz841.js} +146 -204
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
- package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-EY8CFF3P.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-BHkaDr9V.js} +245 -245
- package/dist-lib/hooks/useMutations.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +24 -4
- package/dist-lib/index.js +1541 -1832
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
- package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-1pIajluX.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-C5ug25M8.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-BdnZq8vZ.js} +2504 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-BxgrPZIB.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-Bhi9Wn5O.js} +25 -25
- package/dist-lib/useTabSearchMirror-Dl5x0xKu.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-Rp-5W3o8.js} +25 -25
- package/package.json +7 -7
- package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pr as e, Yn as t, Zn as n, lr as r } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
2
|
import { t as i } from "./Check-DAfMbQIw.js";
|
|
3
|
-
import { f as a, m as o, p as s, r as c } from "./action-dispatch-
|
|
4
|
-
import { t as l } from "./cardProjection-
|
|
5
|
-
import { t as u } from "./SmartListPage.impl-
|
|
3
|
+
import { f as a, m as o, p as s, r as c } from "./action-dispatch-DlHTYag7.js";
|
|
4
|
+
import { t as l } from "./cardProjection-C7Orz841.js";
|
|
5
|
+
import { t as u } from "./SmartListPage.impl-BwWURGwa.js";
|
|
6
6
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/pages/list/ListCardRow.tsx
|
|
8
|
-
function p(
|
|
9
|
-
if (
|
|
10
|
-
let r =
|
|
11
|
-
return i ?
|
|
8
|
+
function p(e, t, r) {
|
|
9
|
+
if (e.startsWith("$status.")) {
|
|
10
|
+
let r = e.slice(8), i = t.status_groups?.[r];
|
|
11
|
+
return i ? n(i.name) || r : e;
|
|
12
12
|
}
|
|
13
|
-
if (
|
|
14
|
-
let r =
|
|
15
|
-
return i ?
|
|
13
|
+
if (e.startsWith("$property.")) {
|
|
14
|
+
let r = e.slice(10), i = t.properties?.[r];
|
|
15
|
+
return i ? n(i.name) || r : e;
|
|
16
16
|
}
|
|
17
|
-
return o(
|
|
17
|
+
return o(t, e, r);
|
|
18
18
|
}
|
|
19
19
|
function m(e, t, n) {
|
|
20
20
|
if (e.startsWith("$status.")) {
|
|
@@ -37,10 +37,10 @@ function h(t, i, a) {
|
|
|
37
37
|
children: "-"
|
|
38
38
|
});
|
|
39
39
|
let l = a.statuses.find((e) => e.code === c.status_code);
|
|
40
|
-
return /* @__PURE__ */ d(
|
|
40
|
+
return /* @__PURE__ */ d(e, {
|
|
41
41
|
tone: l?.color ?? "slate",
|
|
42
42
|
size: "xs",
|
|
43
|
-
children:
|
|
43
|
+
children: n(l?.name) || c.status_code
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
if (t.startsWith("$property.")) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as e, mt as t } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
2
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
3
|
import i, { defaultUrlTransform as a } from "react-markdown";
|
|
4
4
|
import o from "remark-breaks";
|
|
@@ -11,26 +11,26 @@ function d(e) {
|
|
|
11
11
|
function f(e) {
|
|
12
12
|
return e.startsWith("/") || e.startsWith("https://") || e.startsWith("http://") ? e : null;
|
|
13
13
|
}
|
|
14
|
-
function p({ href:
|
|
15
|
-
return t
|
|
16
|
-
href:
|
|
14
|
+
function p({ href: t, children: r }) {
|
|
15
|
+
return e(t) ? /* @__PURE__ */ n("a", {
|
|
16
|
+
href: t,
|
|
17
17
|
target: "_blank",
|
|
18
18
|
rel: "noopener noreferrer",
|
|
19
19
|
children: r
|
|
20
20
|
}) : /* @__PURE__ */ n("a", {
|
|
21
|
-
href:
|
|
21
|
+
href: t,
|
|
22
22
|
children: r
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function m(
|
|
25
|
+
function m(e) {
|
|
26
26
|
return {
|
|
27
27
|
img({ src: i, alt: a }) {
|
|
28
|
-
let o =
|
|
28
|
+
let o = t(i);
|
|
29
29
|
if (!o) return /* @__PURE__ */ n("img", {
|
|
30
30
|
src: i,
|
|
31
31
|
alt: a ?? ""
|
|
32
32
|
});
|
|
33
|
-
let s =
|
|
33
|
+
let s = e[o], c = s?.presigned_url ?? s?.url, l = c ? f(c) : null;
|
|
34
34
|
return l ? /* @__PURE__ */ n("img", {
|
|
35
35
|
src: l,
|
|
36
36
|
alt: a ?? s.filename ?? ""
|
|
@@ -43,12 +43,12 @@ function m(t) {
|
|
|
43
43
|
});
|
|
44
44
|
},
|
|
45
45
|
a({ href: i, children: a }) {
|
|
46
|
-
let o =
|
|
46
|
+
let o = t(i);
|
|
47
47
|
if (!o) return /* @__PURE__ */ n(p, {
|
|
48
48
|
href: i,
|
|
49
49
|
children: a
|
|
50
50
|
});
|
|
51
|
-
let s =
|
|
51
|
+
let s = e[o], c = s?.presigned_url ?? s?.url, l = c ? f(c) : null;
|
|
52
52
|
return l ? /* @__PURE__ */ n("a", {
|
|
53
53
|
href: l,
|
|
54
54
|
target: "_blank",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
2
|
+
import { Cr as t, Dr as n, Fr as r, Ht as i, Or as a, Pr as o } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
3
|
+
import { D as s, L as c, b as l, c as u } from "./field-classification-EY8CFF3P.js";
|
|
4
|
+
import { useCallback as d, useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
5
|
+
import { useLocation as _ } from "react-router";
|
|
6
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as x } from "react-dom";
|
|
8
8
|
//#region src/components/primitives/Avatar.tsx
|
|
9
|
-
function
|
|
9
|
+
function S({ name: e, size: t = 22, color: n }) {
|
|
10
10
|
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 = [
|
|
11
11
|
"#DCE4F6",
|
|
12
12
|
"#E4DCF6",
|
|
@@ -17,7 +17,7 @@ function x({ name: e, size: t = 22, color: n }) {
|
|
|
17
17
|
"#F1F6DC",
|
|
18
18
|
"#F6DCF1"
|
|
19
19
|
], o = n || a[i % a.length];
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ y("span", {
|
|
21
21
|
style: {
|
|
22
22
|
display: "inline-flex",
|
|
23
23
|
alignItems: "center",
|
|
@@ -36,36 +36,36 @@ function x({ name: e, size: t = 22, color: n }) {
|
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/components/primitives/Tooltip.tsx
|
|
39
|
-
var ee = 350,
|
|
40
|
-
function
|
|
41
|
-
let [n, r] =
|
|
39
|
+
var ee = 350, C = 80, w = 260, T = 6, E = 4;
|
|
40
|
+
function D(e, t) {
|
|
41
|
+
let [n, r] = g(!1), [i, a] = g(null), o = h(null), s = h(null), c = h(null), l = p(), u = d(() => {
|
|
42
42
|
s.current && clearTimeout(s.current), c.current && clearTimeout(c.current), s.current = null, c.current = null;
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), m = d(() => {
|
|
44
44
|
let t = e.current;
|
|
45
45
|
if (!t) return;
|
|
46
|
-
let n = t.getBoundingClientRect(), r = o.current, i = r?.offsetWidth ??
|
|
47
|
-
c = Math.max(
|
|
48
|
-
let l = n.top -
|
|
46
|
+
let n = t.getBoundingClientRect(), r = o.current, i = r?.offsetWidth ?? w, s = r?.offsetHeight ?? 0, c = n.left + n.width / 2 - i / 2;
|
|
47
|
+
c = Math.max(E, Math.min(c, window.innerWidth - i - E));
|
|
48
|
+
let l = n.top - T - s < E ? n.bottom + T : n.top - T - s;
|
|
49
49
|
a({
|
|
50
50
|
left: c,
|
|
51
51
|
top: l
|
|
52
52
|
});
|
|
53
|
-
}, [e]), _ =
|
|
54
|
-
t && (
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
|
|
53
|
+
}, [e]), _ = d((e) => {
|
|
54
|
+
t && (u(), e ? r(!0) : s.current = setTimeout(() => r(!0), ee));
|
|
55
|
+
}, [u, t]), v = d(() => {
|
|
56
|
+
u(), c.current = setTimeout(() => r(!1), C);
|
|
57
|
+
}, [u]);
|
|
58
|
+
f(() => {
|
|
59
59
|
if (!n) {
|
|
60
60
|
a(null);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
let e = () =>
|
|
63
|
+
m();
|
|
64
|
+
let e = () => m();
|
|
65
65
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
66
66
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
67
67
|
};
|
|
68
|
-
}, [n,
|
|
68
|
+
}, [n, m]), f(() => u, [u]), f(() => {
|
|
69
69
|
if (!n) return;
|
|
70
70
|
let t = (t) => {
|
|
71
71
|
let n = e.current;
|
|
@@ -73,12 +73,12 @@ function E(e, t) {
|
|
|
73
73
|
};
|
|
74
74
|
return document.addEventListener("pointerdown", t, !0), () => document.removeEventListener("pointerdown", t, !0);
|
|
75
75
|
}, [n, e]);
|
|
76
|
-
let
|
|
76
|
+
let b = {
|
|
77
77
|
position: "fixed",
|
|
78
78
|
left: i?.left ?? 0,
|
|
79
79
|
top: i?.top ?? 0,
|
|
80
80
|
zIndex: 1e3,
|
|
81
|
-
maxWidth:
|
|
81
|
+
maxWidth: w,
|
|
82
82
|
padding: "5px 8px",
|
|
83
83
|
borderRadius: 6,
|
|
84
84
|
background: "var(--surface-inverse, #1f2430)",
|
|
@@ -89,31 +89,31 @@ function E(e, t) {
|
|
|
89
89
|
pointerEvents: "none",
|
|
90
90
|
visibility: i ? "visible" : "hidden",
|
|
91
91
|
whiteSpace: "normal"
|
|
92
|
-
},
|
|
92
|
+
}, S = n && t ? x(/* @__PURE__ */ y("div", {
|
|
93
93
|
ref: o,
|
|
94
94
|
id: l,
|
|
95
95
|
role: "tooltip",
|
|
96
|
-
style:
|
|
96
|
+
style: b,
|
|
97
97
|
children: t
|
|
98
98
|
}), document.body) : null;
|
|
99
99
|
return {
|
|
100
100
|
open: n,
|
|
101
101
|
triggerHandlers: {
|
|
102
102
|
onMouseEnter: () => _(!1),
|
|
103
|
-
onMouseLeave:
|
|
103
|
+
onMouseLeave: v,
|
|
104
104
|
onFocus: () => _(!0),
|
|
105
|
-
onBlur:
|
|
105
|
+
onBlur: v,
|
|
106
106
|
onPointerUp: (e) => {
|
|
107
|
-
e.pointerType === "mouse" || !t || (
|
|
107
|
+
e.pointerType === "mouse" || !t || (u(), r((e) => !e));
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
describedBy: n && t ? l : void 0,
|
|
111
|
-
portal:
|
|
111
|
+
portal: S
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
let r =
|
|
116
|
-
return e ? /* @__PURE__ */
|
|
114
|
+
function O({ content: e, children: t, triggerProps: n }) {
|
|
115
|
+
let r = h(null), { triggerHandlers: i, describedBy: a, portal: o } = D(r, e);
|
|
116
|
+
return e ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("span", {
|
|
117
117
|
...n,
|
|
118
118
|
ref: r,
|
|
119
119
|
"aria-describedby": a,
|
|
@@ -124,12 +124,12 @@ function D({ content: e, children: t, triggerProps: n }) {
|
|
|
124
124
|
},
|
|
125
125
|
...i,
|
|
126
126
|
children: t
|
|
127
|
-
}), o] }) : /* @__PURE__ */ v
|
|
127
|
+
}), o] }) : /* @__PURE__ */ y(v, { children: t });
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
return /* @__PURE__ */
|
|
129
|
+
function k({ label: t, size: n = 14, ...r }) {
|
|
130
|
+
return /* @__PURE__ */ y(O, {
|
|
131
131
|
content: t,
|
|
132
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ y("span", {
|
|
133
133
|
tabIndex: 0,
|
|
134
134
|
role: "note",
|
|
135
135
|
"aria-label": t,
|
|
@@ -140,61 +140,61 @@ function O({ label: t, size: n = 14, ...r }) {
|
|
|
140
140
|
color: "var(--text-3)",
|
|
141
141
|
cursor: "help"
|
|
142
142
|
},
|
|
143
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ y(e.info, { size: n })
|
|
144
144
|
})
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region src/lib/branding.ts
|
|
149
|
-
var
|
|
150
|
-
function
|
|
149
|
+
var A = "branding";
|
|
150
|
+
function j(e, t) {
|
|
151
151
|
return e?.parameters.find((e) => e.code === t)?.value;
|
|
152
152
|
}
|
|
153
|
-
function j(e) {
|
|
154
|
-
return M(A(e, k));
|
|
155
|
-
}
|
|
156
153
|
function M(e) {
|
|
157
|
-
|
|
154
|
+
return N(j(e, A));
|
|
158
155
|
}
|
|
159
156
|
function N(e) {
|
|
160
|
-
|
|
161
|
-
return P(t) ? t : void 0;
|
|
157
|
+
if (F(e)) return e;
|
|
162
158
|
}
|
|
163
159
|
function P(e) {
|
|
164
|
-
|
|
160
|
+
let t = M(e)?.identity;
|
|
161
|
+
return F(t) ? t : void 0;
|
|
165
162
|
}
|
|
166
163
|
function F(e) {
|
|
164
|
+
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
165
|
+
}
|
|
166
|
+
function I(e) {
|
|
167
167
|
if (!e) return !1;
|
|
168
168
|
let t = e.trim();
|
|
169
169
|
return t ? t.startsWith("/") || t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:image/") : !1;
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/hooks/useBranding.ts
|
|
173
|
-
function
|
|
174
|
-
let e = c(
|
|
173
|
+
function L() {
|
|
174
|
+
let e = c(A);
|
|
175
175
|
return {
|
|
176
|
-
branding:
|
|
176
|
+
branding: N(e.value),
|
|
177
177
|
isLoading: e.loading
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
function L() {
|
|
181
|
-
return I().branding?.identity;
|
|
182
|
-
}
|
|
183
180
|
function R() {
|
|
184
|
-
return
|
|
181
|
+
return L().branding?.identity;
|
|
182
|
+
}
|
|
183
|
+
function z() {
|
|
184
|
+
return L().branding?.chrome;
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/hooks/useBrandingChrome.ts
|
|
188
|
-
function
|
|
189
|
-
let e = i(), t =
|
|
188
|
+
function B() {
|
|
189
|
+
let e = i(), t = z();
|
|
190
190
|
return (e.enabled ? t?.embed?.viewport : t?.full?.viewport) ?? "auto";
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function V(e, t) {
|
|
193
193
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
let e = i(), t =
|
|
197
|
-
return
|
|
195
|
+
function H() {
|
|
196
|
+
let e = i(), t = z(), n = e.enabled ? t?.embed?.breakpoints : t?.full?.breakpoints, r = n?.phone_max, a = n?.tablet_max, o = n?.landscape_phone_max_height;
|
|
197
|
+
return m(() => U({
|
|
198
198
|
phone_max: r,
|
|
199
199
|
tablet_max: a,
|
|
200
200
|
landscape_phone_max_height: o
|
|
@@ -204,17 +204,17 @@ function V() {
|
|
|
204
204
|
o
|
|
205
205
|
]);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
let t =
|
|
209
|
-
return
|
|
210
|
-
phoneMax:
|
|
211
|
-
tabletMax:
|
|
212
|
-
landscapePhoneMaxHeight:
|
|
207
|
+
function U(e) {
|
|
208
|
+
let t = V(e?.phone_max, a.phoneMax), n = V(e?.tablet_max, a.tabletMax), r = t < n;
|
|
209
|
+
return r || console.error(`branding.chrome breakpoints: phone_max (${t}) must be below tablet_max (${n}), or no viewport can ever resolve to the tablet class. Both bounds fall back to the SDK defaults.`), {
|
|
210
|
+
phoneMax: r ? t : a.phoneMax,
|
|
211
|
+
tabletMax: r ? n : a.tabletMax,
|
|
212
|
+
landscapePhoneMaxHeight: V(e?.landscape_phone_max_height, a.landscapePhoneMaxHeight)
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
let t = i(), n =
|
|
217
|
-
return
|
|
215
|
+
function W(e) {
|
|
216
|
+
let t = i(), n = z();
|
|
217
|
+
return m(() => {
|
|
218
218
|
let r = { ...t.enabled ? n?.embed?.surfaces?.[e] : n?.full?.surfaces?.[e] };
|
|
219
219
|
return {
|
|
220
220
|
...r,
|
|
@@ -226,9 +226,9 @@ function U(e) {
|
|
|
226
226
|
e
|
|
227
227
|
]);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
let e =
|
|
231
|
-
return
|
|
229
|
+
function G() {
|
|
230
|
+
let e = z();
|
|
231
|
+
return m(() => {
|
|
232
232
|
let t = { ...e?.full?.shell };
|
|
233
233
|
return {
|
|
234
234
|
...t,
|
|
@@ -238,11 +238,11 @@ function W() {
|
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/lib/scroll-restoration.ts
|
|
241
|
-
var
|
|
242
|
-
function
|
|
241
|
+
var K = "scroll", q = 120, J = 24, Y = 600;
|
|
242
|
+
function X(e, t) {
|
|
243
243
|
return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Z(e, t, n) {
|
|
246
246
|
let r = Number.isFinite(e) ? e : 0;
|
|
247
247
|
if (t) {
|
|
248
248
|
let e = n[t.index];
|
|
@@ -258,33 +258,33 @@ function X(e, t, n) {
|
|
|
258
258
|
offset: r
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function Q(e, t, n, r) {
|
|
262
262
|
if (!e) return null;
|
|
263
263
|
if (e.key) {
|
|
264
264
|
let i = t.indexOf(e.key);
|
|
265
265
|
if (i >= 0) {
|
|
266
266
|
let t = n(i);
|
|
267
|
-
if (t !== void 0) return
|
|
267
|
+
if (t !== void 0) return X(t + e.delta, r);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
return
|
|
270
|
+
return X(e.offset, r);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
let t =
|
|
272
|
+
function te(e = K) {
|
|
273
|
+
let t = _(), n = h(null);
|
|
274
274
|
if (n.current === null) {
|
|
275
275
|
let r = l(t), i = s.getState().read(r, e);
|
|
276
276
|
n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
|
|
277
277
|
}
|
|
278
278
|
return n.current;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function ne(e) {
|
|
281
281
|
let t = 0, n = null, r = () => {
|
|
282
282
|
n = null, t = Date.now(), e();
|
|
283
283
|
};
|
|
284
284
|
return {
|
|
285
285
|
trigger() {
|
|
286
286
|
let e = Date.now() - t;
|
|
287
|
-
e >=
|
|
287
|
+
e >= q ? r() : n === null && (n = setTimeout(r, q - e));
|
|
288
288
|
},
|
|
289
289
|
flush() {
|
|
290
290
|
n !== null && (clearTimeout(n), n = null), e();
|
|
@@ -294,15 +294,15 @@ function te(e) {
|
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o =
|
|
297
|
+
function re(e) {
|
|
298
|
+
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = _(), c = l(o), u = h(t);
|
|
299
299
|
u.current = t;
|
|
300
|
-
let
|
|
301
|
-
|
|
302
|
-
let p =
|
|
303
|
-
|
|
300
|
+
let d = h(r);
|
|
301
|
+
d.current = r;
|
|
302
|
+
let p = h(null);
|
|
303
|
+
f(() => {
|
|
304
304
|
p.current !== c && (p.current = null);
|
|
305
|
-
}, [c]),
|
|
305
|
+
}, [c]), f(() => {
|
|
306
306
|
if (!a) return;
|
|
307
307
|
let e = u.current;
|
|
308
308
|
if (!e || r.length === 0) return;
|
|
@@ -314,14 +314,14 @@ function ne(e) {
|
|
|
314
314
|
});
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
let o = 0, l = 0,
|
|
317
|
+
let o = 0, l = 0, f = NaN, m = () => {
|
|
318
318
|
let e = u.current;
|
|
319
319
|
if (!e) return;
|
|
320
|
-
let n =
|
|
321
|
-
n !== null && (Number.isNaN(
|
|
320
|
+
let n = Q(t, d.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
|
|
321
|
+
n !== null && (Number.isNaN(f) || Math.abs(n - f) > 1) && (e.scrollToOffset(n, {
|
|
322
322
|
align: "start",
|
|
323
323
|
behavior: "auto"
|
|
324
|
-
}),
|
|
324
|
+
}), f = n, l++ < J && (o = requestAnimationFrame(m)));
|
|
325
325
|
};
|
|
326
326
|
return m(), () => {
|
|
327
327
|
o && cancelAnimationFrame(o);
|
|
@@ -335,14 +335,14 @@ function ne(e) {
|
|
|
335
335
|
let t = u.current;
|
|
336
336
|
if (!t) return null;
|
|
337
337
|
let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
|
|
338
|
-
return
|
|
338
|
+
return Z(r, t.getVirtualItemForOffset(r), d.current);
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
function $(e, t, n, r, i) {
|
|
342
|
-
let a =
|
|
343
|
-
a.current = i,
|
|
342
|
+
let a = h(i);
|
|
343
|
+
a.current = i, f(() => {
|
|
344
344
|
if (!t) return;
|
|
345
|
-
let i = 0, o =
|
|
345
|
+
let i = 0, o = Y, c = null, l = null, u = (e) => {
|
|
346
346
|
let t = a.current(e);
|
|
347
347
|
t && s.getState().set(n, r, t);
|
|
348
348
|
}, d = () => l?.trigger(), f = () => {
|
|
@@ -351,7 +351,7 @@ function $(e, t, n, r, i) {
|
|
|
351
351
|
o-- > 0 && (i = requestAnimationFrame(f));
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
|
-
c = t, l =
|
|
354
|
+
c = t, l = ne(() => u(t)), t.addEventListener("scroll", d, { passive: !0 });
|
|
355
355
|
};
|
|
356
356
|
return f(), () => {
|
|
357
357
|
i && cancelAnimationFrame(i), c && c.removeEventListener("scroll", d), l?.flush();
|
|
@@ -363,11 +363,11 @@ function $(e, t, n, r, i) {
|
|
|
363
363
|
r
|
|
364
364
|
]);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i =
|
|
368
|
-
|
|
366
|
+
function ie(e) {
|
|
367
|
+
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = _(), a = l(i), o = h(null);
|
|
368
|
+
f(() => {
|
|
369
369
|
if (!r || o.current === a) return;
|
|
370
|
-
let e = 0, i =
|
|
370
|
+
let e = 0, i = Y, c = () => {
|
|
371
371
|
let r = t.current;
|
|
372
372
|
if (!r) {
|
|
373
373
|
i-- > 0 && (e = requestAnimationFrame(c));
|
|
@@ -393,38 +393,36 @@ function re(e) {
|
|
|
393
393
|
}
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/components/shared/RefreshControl.tsx
|
|
396
|
-
function
|
|
397
|
-
let { isPhone: s } =
|
|
398
|
-
return /* @__PURE__ */
|
|
396
|
+
function ae({ liveObject: i, realtime: a = !0 }) {
|
|
397
|
+
let { isPhone: s } = n(), { refreshing: c, refresh: l } = u(i.refetch), d = i.isLive ? s ? void 0 : "Live" : "Updates paused";
|
|
398
|
+
return /* @__PURE__ */ b("span", {
|
|
399
399
|
style: {
|
|
400
400
|
display: "inline-flex",
|
|
401
401
|
alignItems: "center",
|
|
402
402
|
gap: 8
|
|
403
403
|
},
|
|
404
|
-
children: [/* @__PURE__ */
|
|
405
|
-
icon:
|
|
404
|
+
children: [/* @__PURE__ */ y(r, {
|
|
405
|
+
icon: c ? /* @__PURE__ */ y("span", {
|
|
406
406
|
"data-testid": "refresh-spinner",
|
|
407
407
|
style: { display: "inline-flex" },
|
|
408
|
-
children: /* @__PURE__ */
|
|
409
|
-
}) : /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ y(t, { size: 14 })
|
|
409
|
+
}) : /* @__PURE__ */ y(e.refresh, { size: 14 }),
|
|
410
410
|
title: "Refresh",
|
|
411
|
-
disabled:
|
|
412
|
-
onClick:
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
}), i && /* @__PURE__ */ v("span", {
|
|
411
|
+
disabled: i.isLoading || c,
|
|
412
|
+
onClick: l
|
|
413
|
+
}), a && /* @__PURE__ */ y("span", {
|
|
416
414
|
"data-testid": "live-indicator",
|
|
417
415
|
role: "status",
|
|
418
|
-
"aria-label":
|
|
419
|
-
title:
|
|
420
|
-
children: /* @__PURE__ */
|
|
421
|
-
tone:
|
|
416
|
+
"aria-label": i.isLive ? "Live" : "Updates paused",
|
|
417
|
+
title: i.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
|
|
418
|
+
children: /* @__PURE__ */ y(o, {
|
|
419
|
+
tone: i.isLive ? "emerald" : "amber",
|
|
422
420
|
size: "xs",
|
|
423
421
|
dot: !0,
|
|
424
|
-
children:
|
|
422
|
+
children: d
|
|
425
423
|
})
|
|
426
424
|
})]
|
|
427
425
|
});
|
|
428
426
|
}
|
|
429
427
|
//#endregion
|
|
430
|
-
export {
|
|
428
|
+
export { S as _, re as a, G as c, R as d, P as f, D as g, O as h, te as i, B as l, k as m, K as n, H as o, I as p, ie as r, W as s, ae as t, L as u };
|