@declarion/react 0.56.0 → 0.59.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/README.md +0 -2
- package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
- package/dist-lib/DetailAuditStrip-GNRA_eP5.js +289 -0
- package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
- package/dist-lib/Grid-CQabaBLx.js +405 -0
- package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
- package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
- package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
- package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
- package/dist-lib/SmartDetailPage.impl-Ds2RGg6K.js +1565 -0
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
- package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
- package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
- package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
- package/dist-lib/api/client.d.ts +5 -0
- package/dist-lib/api/data.d.ts +2 -4
- package/dist-lib/api/entities.d.ts +8 -15
- package/dist-lib/api/events.d.ts +3 -3
- package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
- package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
- package/dist-lib/components/chrome/PageShell.d.ts +7 -0
- package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
- package/dist-lib/components/fields/BoolField.d.ts +1 -1
- package/dist-lib/components/fields/EnumField.d.ts +1 -1
- package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
- package/dist-lib/components/fields/NumberField.d.ts +1 -1
- package/dist-lib/components/fields/PasswordField.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
- package/dist-lib/components/fields/SecretField.d.ts +1 -1
- package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
- package/dist-lib/components/fields/TimestampField.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -1
- package/dist-lib/components/fields/index.d.ts +2 -1
- package/dist-lib/components/fields/langMap.d.ts +2 -0
- package/dist-lib/components/fields/secretValue.d.ts +2 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +4 -3
- package/dist-lib/components/file-widgets/types.d.ts +1 -0
- package/dist-lib/components/file-widgets/upload.d.ts +18 -3
- package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +2 -1
- package/dist-lib/components/layout/Sidebar.d.ts +2 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
- package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
- package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
- package/dist-lib/components/pages/exportRequest.d.ts +4 -6
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
- package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
- package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
- package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
- package/dist-lib/components/pages/list/columns.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
- package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
- package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
- package/dist-lib/components/params/param-editors.d.ts +3 -11
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
- package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
- package/dist-lib/components/shared/ErrorBoundary.d.ts +1 -1
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
- package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/theme.d.ts +1 -1
- package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
- package/dist-lib/failure-v-uGSpbX.js +158 -0
- package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
- package/dist-lib/format-count-DA4wmmWR.js +1771 -0
- package/dist-lib/hooks/useEntityData.d.ts +1 -1
- package/dist-lib/hooks/useFilters.d.ts +7 -5
- package/dist-lib/hooks/useLanguage.d.ts +4 -0
- package/dist-lib/hooks/useParams.d.ts +4 -51
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +3 -3
- package/dist-lib/hooks/useTabTitle.d.ts +2 -0
- package/dist-lib/hooks/useText.d.ts +3 -3
- package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
- package/dist-lib/hooks/useViews.d.ts +20 -0
- package/dist-lib/index.d.ts +8 -7
- package/dist-lib/index.js +2716 -5795
- package/dist-lib/lib/action-dispatch.d.ts +2 -1
- package/dist-lib/lib/actions.d.ts +30 -42
- package/dist-lib/lib/anchor.d.ts +3 -4
- package/dist-lib/lib/decimal-text.d.ts +1 -0
- package/dist-lib/lib/document-templates.d.ts +1 -2
- package/dist-lib/lib/download.d.ts +2 -1
- package/dist-lib/lib/evidence-verdict.d.ts +2 -1
- package/dist-lib/lib/failure.d.ts +2 -0
- package/dist-lib/lib/field-classification.d.ts +3 -3
- package/dist-lib/lib/filters.d.ts +18 -2
- package/dist-lib/lib/format-count.d.ts +8 -7
- package/dist-lib/lib/language.d.ts +19 -0
- package/dist-lib/lib/mass-edit.d.ts +2 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
- package/dist-lib/lib/screen-back.d.ts +4 -6
- package/dist-lib/lib/sort.d.ts +9 -9
- package/dist-lib/lib/timestamp.d.ts +5 -7
- package/dist-lib/lib/ui-actions.d.ts +2 -1
- package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
- package/dist-lib/registry-Cb3W-czW.js +1950 -0
- package/dist-lib/safe-url-oSJw5pzO.js +34 -0
- package/dist-lib/stores/icon-registry.d.ts +2 -2
- package/dist-lib/stores/list-layout.d.ts +3 -4
- package/dist-lib/stores/realtime.d.ts +1 -1
- package/dist-lib/stores/tabs.d.ts +3 -2
- package/dist-lib/testing.d.ts +6 -0
- package/dist-lib/testing.js +98 -76
- package/dist-lib/types/api.d.ts +7 -8
- package/dist-lib/types/fieldType.d.ts +1 -1
- package/dist-lib/types/files.d.ts +4 -4
- package/dist-lib/types/schema.d.ts +44 -50
- package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
- package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
- package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
- package/dist-lib/useProperties-4Lg3odrt.js +83 -0
- package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
- package/dist-lib/useText-BFDCTUSo.js +952 -0
- package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
- package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
- package/package.json +13 -12
- package/dist-lib/Grid-DWgUPuZ3.js +0 -404
- package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
- package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
- package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
- package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
- package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
- package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
- package/dist-lib/cardProjection-CW5RIMko.js +0 -699
- package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
- package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
- package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
- package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
- package/dist-lib/hooks/useUserLocale.d.ts +0 -1
- package/dist-lib/lib/messages.d.ts +0 -12
- package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
- package/dist-lib/registry-CjgUaF7C.js +0 -1768
- package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
- package/dist-lib/useProperties-CqtCzFCr.js +0 -81
|
@@ -1,1551 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { Br as n, Cr as r, Er as i, Fr as a, G as o, H as s, Lr as c, Mr as l, Rr as u, V as d, Vr as f, et as p, ht as m, i as h, kr as g, mr as _, nr as v, tt as y, un as b, xt as x, yr as S } from "./useCurrentScreen-CzwzQpoW.js";
|
|
3
|
-
import { _ as C } from "./RefreshControl-CNtN8zSl.js";
|
|
4
|
-
import { D as w, b as T, y as E } from "./field-classification-D6xQYn-h.js";
|
|
5
|
-
import { c as ee, o as te, p as ne, r as re } from "./action-dispatch-CR4ajBtT.js";
|
|
6
|
-
import { a as D, d as O, f as k, h as A, i as j, l as M, o as N, s as P, u as F } from "./useTabSearchMirror-C39U85cg.js";
|
|
7
|
-
import { Fragment as I, useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
|
|
8
|
-
import { useLocation as H, useSearchParams as ie } from "react-router";
|
|
9
|
-
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
10
|
-
//#region src/hooks/useScreen.ts
|
|
11
|
-
function K(e) {
|
|
12
|
-
let { data: t } = b();
|
|
13
|
-
if (t && e) return t.screens[e];
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/hooks/useFilters.ts
|
|
17
|
-
function ae() {
|
|
18
|
-
let [e, t] = ie(), n = z(() => k(e), [e]), r = n.filters, i = z(() => P(r), [r]), a = L((n) => {
|
|
19
|
-
let r = new URLSearchParams(e);
|
|
20
|
-
A(n, r), r.set("page", "1"), t(r);
|
|
21
|
-
}, [e, t]), o = L(() => {
|
|
22
|
-
let n = new URLSearchParams(e);
|
|
23
|
-
n.delete("filters"), n.set("page", "1"), t(n);
|
|
24
|
-
}, [e, t]);
|
|
25
|
-
return {
|
|
26
|
-
filters: r,
|
|
27
|
-
filterError: n.error,
|
|
28
|
-
activeCount: i,
|
|
29
|
-
setFilters: a,
|
|
30
|
-
clearFilters: o
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/hooks/useViews.ts
|
|
35
|
-
function oe(e, t) {
|
|
36
|
-
let n = K(e), { data: r } = x("view", {
|
|
37
|
-
filters: [{
|
|
38
|
-
field: "screen_code",
|
|
39
|
-
op: "eq",
|
|
40
|
-
value: e
|
|
41
|
-
}, ...t ? [{ or: [{
|
|
42
|
-
field: "user_id",
|
|
43
|
-
op: "eq",
|
|
44
|
-
value: t
|
|
45
|
-
}, {
|
|
46
|
-
field: "is_shared",
|
|
47
|
-
op: "eq",
|
|
48
|
-
value: "true"
|
|
49
|
-
}] }] : []],
|
|
50
|
-
sort: "created_at:desc",
|
|
51
|
-
per_page: 100
|
|
52
|
-
});
|
|
53
|
-
return z(() => {
|
|
54
|
-
let e = [];
|
|
55
|
-
if (n?.views) for (let t of n.views) e.push({
|
|
56
|
-
id: t.code,
|
|
57
|
-
name: t.name,
|
|
58
|
-
icon: t.icon,
|
|
59
|
-
source: "system",
|
|
60
|
-
filters: t.filters,
|
|
61
|
-
columns: t.columns,
|
|
62
|
-
sort: t.sort
|
|
63
|
-
});
|
|
64
|
-
if (r?.data) for (let n of r.data) {
|
|
65
|
-
let r = t && String(n.user_id) === t;
|
|
66
|
-
e.push({
|
|
67
|
-
id: String(n.id),
|
|
68
|
-
name: typeof n.name == "object" && n.name !== null ? n.name : { en: _(n.name) },
|
|
69
|
-
icon: n.icon,
|
|
70
|
-
source: r ? "personal" : "shared",
|
|
71
|
-
is_default: n.is_default === !0,
|
|
72
|
-
filters: n.filters,
|
|
73
|
-
columns: n.columns,
|
|
74
|
-
sort: n.sort
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return e;
|
|
78
|
-
}, [
|
|
79
|
-
n?.views,
|
|
80
|
-
r?.data,
|
|
81
|
-
t
|
|
82
|
-
]);
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/hooks/usePageState.ts
|
|
86
|
-
function se(e, t, n) {
|
|
87
|
-
let r = H(), i = n?.scope === "path" ? E(r) : T(r), a = B(i);
|
|
88
|
-
a.current = i;
|
|
89
|
-
let o = B(t), s = w((t) => t.ttlMs <= 0 ? void 0 : t.entries[i]?.bag[e]), c = s === void 0 ? o.current : s;
|
|
90
|
-
return R(() => {
|
|
91
|
-
w.getState().touch(i);
|
|
92
|
-
}, [i]), [c, L((t) => {
|
|
93
|
-
let n = a.current, r = w.getState(), i = r.read(n, e), s = i === void 0 ? o.current : i, c = typeof t == "function" ? t(s) : t;
|
|
94
|
-
r.set(n, e, c);
|
|
95
|
-
}, [e])];
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/components/shared/EmptyState.tsx
|
|
99
|
-
function ce({ icon: e, title: n, description: r, action: i }) {
|
|
100
|
-
return /* @__PURE__ */ G("div", {
|
|
101
|
-
"data-testid": "empty-state",
|
|
102
|
-
style: {
|
|
103
|
-
display: "flex",
|
|
104
|
-
flexDirection: "column",
|
|
105
|
-
alignItems: "center",
|
|
106
|
-
justifyContent: "center",
|
|
107
|
-
padding: "64px 16px",
|
|
108
|
-
textAlign: "center"
|
|
109
|
-
},
|
|
110
|
-
children: [
|
|
111
|
-
e && /* @__PURE__ */ W("div", {
|
|
112
|
-
style: {
|
|
113
|
-
marginBottom: 16,
|
|
114
|
-
borderRadius: 999,
|
|
115
|
-
background: "var(--surface-3)",
|
|
116
|
-
padding: 16,
|
|
117
|
-
color: "var(--text-3)",
|
|
118
|
-
display: "inline-flex"
|
|
119
|
-
},
|
|
120
|
-
children: /* @__PURE__ */ W(t, {
|
|
121
|
-
name: e,
|
|
122
|
-
size: 32
|
|
123
|
-
})
|
|
124
|
-
}),
|
|
125
|
-
/* @__PURE__ */ W("h3", {
|
|
126
|
-
style: {
|
|
127
|
-
margin: 0,
|
|
128
|
-
fontSize: 15,
|
|
129
|
-
fontWeight: 600,
|
|
130
|
-
color: "var(--text)"
|
|
131
|
-
},
|
|
132
|
-
children: n
|
|
133
|
-
}),
|
|
134
|
-
r && /* @__PURE__ */ W("p", {
|
|
135
|
-
style: {
|
|
136
|
-
marginTop: 4,
|
|
137
|
-
fontSize: 12.5,
|
|
138
|
-
color: "var(--text-3)",
|
|
139
|
-
maxWidth: 420
|
|
140
|
-
},
|
|
141
|
-
children: r
|
|
142
|
-
}),
|
|
143
|
-
i && /* @__PURE__ */ W("div", {
|
|
144
|
-
style: { marginTop: 16 },
|
|
145
|
-
children: i
|
|
146
|
-
})
|
|
147
|
-
]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/components/filters/FilterDrawer.tsx
|
|
152
|
-
function le({ open: t, onClose: r, filters: i, onApply: a, availableFields: o, defaultFilters: s, refs: c }) {
|
|
153
|
-
let u = l().category === "phone", [d, p] = V(i), [m, h] = V(!1);
|
|
154
|
-
if (R(() => {
|
|
155
|
-
if (t) {
|
|
156
|
-
if (i.length === 0 && s && s.length > 0) {
|
|
157
|
-
let e = s.flatMap((e) => {
|
|
158
|
-
let t = o.find((t) => t.code === e);
|
|
159
|
-
return t ? [{
|
|
160
|
-
field: e,
|
|
161
|
-
op: t.operators[0] || "eq"
|
|
162
|
-
}] : [];
|
|
163
|
-
});
|
|
164
|
-
p(e);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
p(i);
|
|
168
|
-
}
|
|
169
|
-
}, [
|
|
170
|
-
t,
|
|
171
|
-
i,
|
|
172
|
-
s,
|
|
173
|
-
o
|
|
174
|
-
]), !t) return null;
|
|
175
|
-
let g = O(d), _ = new Set(M(d).filter((e) => e.field).map((e) => e.field)), v = (e = d) => {
|
|
176
|
-
let t = new Set(M(e).map((e) => e.field).filter(Boolean)), n = o.find((e) => !t.has(e.code)) ?? o[0];
|
|
177
|
-
return n ? {
|
|
178
|
-
field: n.code,
|
|
179
|
-
op: n.operators[0] || "eq"
|
|
180
|
-
} : {};
|
|
181
|
-
}, y = (e) => {
|
|
182
|
-
let t = o.find((t) => t.code === e);
|
|
183
|
-
if (!t) return;
|
|
184
|
-
let n = t.operators[0] || "eq";
|
|
185
|
-
p((t) => [...t, {
|
|
186
|
-
field: e,
|
|
187
|
-
op: n
|
|
188
|
-
}]), h(!1);
|
|
189
|
-
}, b = () => {
|
|
190
|
-
let e = d.filter((e) => e.field && e.op), t = d.filter((e) => !e.field || !e.op), n = e.length === 1 ? e[0] : e.length > 1 ? { and: e } : {};
|
|
191
|
-
p([...t, { or: [n, {}] }]);
|
|
192
|
-
}, x = (e, t) => {
|
|
193
|
-
p((n) => Z(n, e, (e) => ({
|
|
194
|
-
...e,
|
|
195
|
-
...t
|
|
196
|
-
})));
|
|
197
|
-
}, S = (e, t) => {
|
|
198
|
-
p((n) => Q(n, e, t));
|
|
199
|
-
}, C = (e) => {
|
|
200
|
-
p((t) => ge(t, e));
|
|
201
|
-
}, w = (e, t) => {
|
|
202
|
-
p((n) => Z(n, e, (e) => e.or ? {
|
|
203
|
-
...e,
|
|
204
|
-
or: [...e.or, t]
|
|
205
|
-
} : e.and ? {
|
|
206
|
-
...e,
|
|
207
|
-
and: [...e.and, t]
|
|
208
|
-
} : e));
|
|
209
|
-
}, T = (e, t) => {
|
|
210
|
-
let n = [...e, t], r = he(d, n);
|
|
211
|
-
if (!r) return;
|
|
212
|
-
let i = v();
|
|
213
|
-
r.and ? w(n, i) : r.field || r.op || r.or ? S(n, { and: [r, i] }) : S(n, i);
|
|
214
|
-
}, E = (e, t) => {
|
|
215
|
-
if (e.or || e.and) return /* @__PURE__ */ W(me, {
|
|
216
|
-
node: e,
|
|
217
|
-
renderNode: E,
|
|
218
|
-
onRemoveChild: C,
|
|
219
|
-
onAddCondition: (n) => {
|
|
220
|
-
e.or && n !== void 0 ? T(t, n) : w(t, v(e.or ?? e.and));
|
|
221
|
-
},
|
|
222
|
-
onAddBranch: () => w(t, {}),
|
|
223
|
-
path: t
|
|
224
|
-
}, t.join("-"));
|
|
225
|
-
if (!e.field || !e.op) return /* @__PURE__ */ W("div", { style: { minHeight: 4 } }, t.join("-"));
|
|
226
|
-
let n = o.find((t) => t.code === e.field);
|
|
227
|
-
return n ? /* @__PURE__ */ W(pe, {
|
|
228
|
-
node: e,
|
|
229
|
-
meta: n,
|
|
230
|
-
refs: c,
|
|
231
|
-
onUpdate: (e) => x(t, e),
|
|
232
|
-
onRemove: () => C(t)
|
|
233
|
-
}, t.join("-")) : null;
|
|
234
|
-
};
|
|
235
|
-
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
236
|
-
onClick: r,
|
|
237
|
-
style: {
|
|
238
|
-
position: "fixed",
|
|
239
|
-
inset: 0,
|
|
240
|
-
background: "var(--scrim-lite)",
|
|
241
|
-
zIndex: 40
|
|
242
|
-
}
|
|
243
|
-
}), /* @__PURE__ */ G("div", {
|
|
244
|
-
role: "dialog",
|
|
245
|
-
"aria-label": "Filters",
|
|
246
|
-
"aria-modal": "true",
|
|
247
|
-
"data-testid": "filter-drawer",
|
|
248
|
-
style: {
|
|
249
|
-
position: "fixed",
|
|
250
|
-
top: "calc(var(--topbar-h) + var(--safe-area-top))",
|
|
251
|
-
right: "var(--safe-area-right)",
|
|
252
|
-
width: "min(400px, calc(100vw - var(--safe-area-left) - var(--safe-area-right)))",
|
|
253
|
-
height: "calc(var(--app-height) - var(--topbar-h) - var(--safe-area-top) - var(--safe-area-bottom) - var(--tabbar-h))",
|
|
254
|
-
maxHeight: "calc(var(--app-height) - var(--topbar-h) - var(--safe-area-top) - var(--safe-area-bottom) - var(--tabbar-h))",
|
|
255
|
-
background: "var(--surface)",
|
|
256
|
-
borderLeft: "1px solid var(--border)",
|
|
257
|
-
boxShadow: "var(--shadow-lg)",
|
|
258
|
-
zIndex: 50,
|
|
259
|
-
display: "flex",
|
|
260
|
-
flexDirection: "column",
|
|
261
|
-
boxSizing: "border-box",
|
|
262
|
-
minWidth: 0,
|
|
263
|
-
overflow: "hidden"
|
|
264
|
-
},
|
|
265
|
-
children: [
|
|
266
|
-
/* @__PURE__ */ G("div", {
|
|
267
|
-
style: {
|
|
268
|
-
display: "flex",
|
|
269
|
-
alignItems: "center",
|
|
270
|
-
justifyContent: "space-between",
|
|
271
|
-
padding: "10px 14px",
|
|
272
|
-
borderBottom: "1px solid var(--divider)"
|
|
273
|
-
},
|
|
274
|
-
children: [/* @__PURE__ */ G("div", {
|
|
275
|
-
style: {
|
|
276
|
-
display: "flex",
|
|
277
|
-
alignItems: "center",
|
|
278
|
-
gap: 8
|
|
279
|
-
},
|
|
280
|
-
children: [/* @__PURE__ */ W(e.filter, { size: 14 }), /* @__PURE__ */ W("h3", {
|
|
281
|
-
style: {
|
|
282
|
-
margin: 0,
|
|
283
|
-
fontSize: 13,
|
|
284
|
-
fontWeight: 600,
|
|
285
|
-
color: "var(--text)"
|
|
286
|
-
},
|
|
287
|
-
children: "Filters"
|
|
288
|
-
})]
|
|
289
|
-
}), /* @__PURE__ */ W(n, {
|
|
290
|
-
icon: /* @__PURE__ */ W(e.x, { size: 14 }),
|
|
291
|
-
onClick: r,
|
|
292
|
-
title: "Close"
|
|
293
|
-
})]
|
|
294
|
-
}),
|
|
295
|
-
/* @__PURE__ */ G("div", {
|
|
296
|
-
style: {
|
|
297
|
-
flex: 1,
|
|
298
|
-
overflowY: "auto",
|
|
299
|
-
padding: 14,
|
|
300
|
-
display: "flex",
|
|
301
|
-
flexDirection: "column",
|
|
302
|
-
gap: 10,
|
|
303
|
-
minWidth: 0,
|
|
304
|
-
minHeight: 0
|
|
305
|
-
},
|
|
306
|
-
children: [d.map((e, t) => E(e, [t])), /* @__PURE__ */ W("div", {
|
|
307
|
-
style: {
|
|
308
|
-
display: "flex",
|
|
309
|
-
alignItems: "center",
|
|
310
|
-
gap: 6,
|
|
311
|
-
paddingTop: 6
|
|
312
|
-
},
|
|
313
|
-
children: m ? /* @__PURE__ */ W(_e, {
|
|
314
|
-
fields: o,
|
|
315
|
-
activeFields: _,
|
|
316
|
-
compact: u,
|
|
317
|
-
onSelect: y,
|
|
318
|
-
onCancel: () => h(!1)
|
|
319
|
-
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(f, {
|
|
320
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 12 }),
|
|
321
|
-
onClick: () => h(!0),
|
|
322
|
-
children: "Add filter"
|
|
323
|
-
}), !g && M(d).length > 0 && /* @__PURE__ */ W(f, {
|
|
324
|
-
kind: "ghost",
|
|
325
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 12 }),
|
|
326
|
-
onClick: b,
|
|
327
|
-
children: "Add OR group"
|
|
328
|
-
})] })
|
|
329
|
-
})]
|
|
330
|
-
}),
|
|
331
|
-
/* @__PURE__ */ G("div", {
|
|
332
|
-
style: {
|
|
333
|
-
display: "flex",
|
|
334
|
-
alignItems: "center",
|
|
335
|
-
padding: "10px 14px",
|
|
336
|
-
borderTop: "1px solid var(--divider)",
|
|
337
|
-
background: "var(--surface-2)",
|
|
338
|
-
gap: 6,
|
|
339
|
-
flexWrap: "wrap",
|
|
340
|
-
minWidth: 0,
|
|
341
|
-
paddingBottom: "calc(10px + var(--safe-area-bottom))"
|
|
342
|
-
},
|
|
343
|
-
children: [
|
|
344
|
-
/* @__PURE__ */ W(f, {
|
|
345
|
-
kind: "ghost",
|
|
346
|
-
onClick: () => {
|
|
347
|
-
p([]);
|
|
348
|
-
},
|
|
349
|
-
children: "Reset"
|
|
350
|
-
}),
|
|
351
|
-
/* @__PURE__ */ W("div", { style: { flex: 1 } }),
|
|
352
|
-
/* @__PURE__ */ W(f, {
|
|
353
|
-
onClick: r,
|
|
354
|
-
children: "Cancel"
|
|
355
|
-
}),
|
|
356
|
-
/* @__PURE__ */ W(f, {
|
|
357
|
-
kind: "primary",
|
|
358
|
-
onClick: () => {
|
|
359
|
-
a(q(d)), r();
|
|
360
|
-
},
|
|
361
|
-
children: "Apply"
|
|
362
|
-
})
|
|
363
|
-
]
|
|
364
|
-
})
|
|
365
|
-
]
|
|
366
|
-
})] });
|
|
367
|
-
}
|
|
368
|
-
function ue(e) {
|
|
369
|
-
return e == null || e === "" ? !1 : !Array.isArray(e) || e.length > 0;
|
|
370
|
-
}
|
|
371
|
-
function q(e) {
|
|
372
|
-
let t = [];
|
|
373
|
-
for (let n of e) {
|
|
374
|
-
if (n.or) {
|
|
375
|
-
let e = q(n.or);
|
|
376
|
-
e.length > 0 && t.push({
|
|
377
|
-
...n,
|
|
378
|
-
or: e
|
|
379
|
-
});
|
|
380
|
-
continue;
|
|
381
|
-
}
|
|
382
|
-
if (n.and) {
|
|
383
|
-
let e = q(n.and);
|
|
384
|
-
e.length > 0 && t.push({
|
|
385
|
-
...n,
|
|
386
|
-
and: e
|
|
387
|
-
});
|
|
388
|
-
continue;
|
|
389
|
-
}
|
|
390
|
-
n.field && n.op && (D.has(n.op) || ue(n.value)) && t.push(n);
|
|
391
|
-
}
|
|
392
|
-
return t;
|
|
393
|
-
}
|
|
394
|
-
function J(e) {
|
|
395
|
-
return !e || e.length === 0 ? [] : [
|
|
396
|
-
{
|
|
397
|
-
value: "",
|
|
398
|
-
label: "Special values",
|
|
399
|
-
heading: !0
|
|
400
|
-
},
|
|
401
|
-
...e.map((e) => ({
|
|
402
|
-
value: e.code,
|
|
403
|
-
label: v(e.label) || e.code
|
|
404
|
-
})),
|
|
405
|
-
{
|
|
406
|
-
value: "",
|
|
407
|
-
label: "",
|
|
408
|
-
divider: !0
|
|
409
|
-
}
|
|
410
|
-
];
|
|
411
|
-
}
|
|
412
|
-
var Y = "__custom__";
|
|
413
|
-
function de({ meta: e, value: t, onUpdate: n }) {
|
|
414
|
-
let a = e.specialValues ?? [], o = _(t), s = a.some((e) => e.code === o), [c, l] = V(!s && o !== "");
|
|
415
|
-
return c ? /* @__PURE__ */ W(i, {
|
|
416
|
-
"aria-label": `${e.label} filter value`,
|
|
417
|
-
value: o,
|
|
418
|
-
onChange: (e) => n({ value: e }),
|
|
419
|
-
placeholder: "Value…",
|
|
420
|
-
autoFocus: !0
|
|
421
|
-
}) : /* @__PURE__ */ W(r, {
|
|
422
|
-
"aria-label": `${e.label} filter value`,
|
|
423
|
-
value: o,
|
|
424
|
-
options: [
|
|
425
|
-
{
|
|
426
|
-
value: "",
|
|
427
|
-
label: "Select…"
|
|
428
|
-
},
|
|
429
|
-
...J(a),
|
|
430
|
-
{
|
|
431
|
-
value: Y,
|
|
432
|
-
label: "Custom value…"
|
|
433
|
-
}
|
|
434
|
-
],
|
|
435
|
-
onChange: (e) => {
|
|
436
|
-
e === Y ? (l(!0), n({ value: "" })) : n({ value: e });
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
function X(e) {
|
|
441
|
-
return Array.isArray(e) ? e.map((e) => _(e)) : e == null || e === "" ? [] : [_(e)];
|
|
442
|
-
}
|
|
443
|
-
function fe(e) {
|
|
444
|
-
return Array.isArray(e) ? e.length > 0 ? _(e[0]) : "" : _(e);
|
|
445
|
-
}
|
|
446
|
-
function pe({ node: t, meta: a, refs: o, onUpdate: s, onRemove: c }) {
|
|
447
|
-
let l = D.has(t.op), u = j.has(t.op), d = a.operators.map((e) => ({
|
|
448
|
-
value: e,
|
|
449
|
-
label: N[e] || e
|
|
450
|
-
})), f = (e) => {
|
|
451
|
-
let n = j.has(t.op), r = j.has(e);
|
|
452
|
-
if (r === n) {
|
|
453
|
-
s({ op: e });
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
s({
|
|
457
|
-
op: e,
|
|
458
|
-
value: r ? X(t.value) : fe(t.value)
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
return /* @__PURE__ */ G("div", {
|
|
462
|
-
style: {
|
|
463
|
-
display: "flex",
|
|
464
|
-
flexDirection: "column",
|
|
465
|
-
gap: 6,
|
|
466
|
-
minWidth: 0
|
|
467
|
-
},
|
|
468
|
-
children: [/* @__PURE__ */ G("div", {
|
|
469
|
-
style: {
|
|
470
|
-
display: "flex",
|
|
471
|
-
alignItems: "center",
|
|
472
|
-
gap: 8,
|
|
473
|
-
minWidth: 0
|
|
474
|
-
},
|
|
475
|
-
children: [/* @__PURE__ */ W("span", {
|
|
476
|
-
style: {
|
|
477
|
-
flex: 1,
|
|
478
|
-
fontSize: 12.5,
|
|
479
|
-
fontWeight: 600,
|
|
480
|
-
color: "var(--text)",
|
|
481
|
-
overflow: "hidden",
|
|
482
|
-
textOverflow: "ellipsis",
|
|
483
|
-
whiteSpace: "nowrap",
|
|
484
|
-
minWidth: 0
|
|
485
|
-
},
|
|
486
|
-
title: a.label,
|
|
487
|
-
children: a.label
|
|
488
|
-
}), /* @__PURE__ */ W(n, {
|
|
489
|
-
size: 22,
|
|
490
|
-
icon: /* @__PURE__ */ W(e.x, { size: 12 }),
|
|
491
|
-
onClick: c,
|
|
492
|
-
title: "Remove"
|
|
493
|
-
})]
|
|
494
|
-
}), /* @__PURE__ */ G("div", {
|
|
495
|
-
style: {
|
|
496
|
-
display: "grid",
|
|
497
|
-
gridTemplateColumns: l ? "minmax(0, 1fr)" : "minmax(112px, 152px) minmax(0, 1fr)",
|
|
498
|
-
gap: 6,
|
|
499
|
-
alignItems: "start",
|
|
500
|
-
minWidth: 0
|
|
501
|
-
},
|
|
502
|
-
children: [/* @__PURE__ */ W(r, {
|
|
503
|
-
"aria-label": `${a.label} filter operator`,
|
|
504
|
-
value: t.op ?? d[0]?.value,
|
|
505
|
-
options: d,
|
|
506
|
-
onChange: (e) => f(e)
|
|
507
|
-
}), l ? null : u && a.options ? /* @__PURE__ */ W(S, {
|
|
508
|
-
"aria-label": `${a.label} filter value`,
|
|
509
|
-
value: X(t.value),
|
|
510
|
-
options: [...J(a.specialValues), ...a.options.map((e) => ({
|
|
511
|
-
value: e.value,
|
|
512
|
-
label: e.label
|
|
513
|
-
}))],
|
|
514
|
-
onChange: (e) => s({ value: e }),
|
|
515
|
-
placeholder: "Select…"
|
|
516
|
-
}) : a.type === "ref" && a.ref?.entity ? /* @__PURE__ */ W(m, {
|
|
517
|
-
ref: a.ref,
|
|
518
|
-
value: t.value,
|
|
519
|
-
onChange: (e) => s({ value: e ?? "" }),
|
|
520
|
-
refs: o,
|
|
521
|
-
ariaLabel: `${a.label} filter value`,
|
|
522
|
-
placeholder: "Select…",
|
|
523
|
-
specialValues: a.specialValues
|
|
524
|
-
}) : a.options ? /* @__PURE__ */ W(r, {
|
|
525
|
-
"aria-label": `${a.label} filter value`,
|
|
526
|
-
value: _(t.value),
|
|
527
|
-
options: [...J(a.specialValues), ...a.options.map((e) => ({
|
|
528
|
-
value: e.value,
|
|
529
|
-
label: e.label
|
|
530
|
-
}))],
|
|
531
|
-
onChange: (e) => s({ value: e }),
|
|
532
|
-
placeholder: "Select…"
|
|
533
|
-
}) : a.specialValues && a.specialValues.length > 0 ? /* @__PURE__ */ W(de, {
|
|
534
|
-
meta: a,
|
|
535
|
-
value: t.value,
|
|
536
|
-
onUpdate: s
|
|
537
|
-
}) : /* @__PURE__ */ W(i, {
|
|
538
|
-
"aria-label": `${a.label} filter value`,
|
|
539
|
-
value: _(t.value),
|
|
540
|
-
onChange: (e) => s({ value: e }),
|
|
541
|
-
placeholder: "Value…"
|
|
542
|
-
})]
|
|
543
|
-
})]
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
function me({ node: t, renderNode: r, onRemoveChild: i, onAddCondition: a, onAddBranch: o, path: s }) {
|
|
547
|
-
let c = t.or ?? t.and ?? [], l = t.or !== void 0;
|
|
548
|
-
return /* @__PURE__ */ G("div", {
|
|
549
|
-
style: {
|
|
550
|
-
display: "flex",
|
|
551
|
-
flexDirection: "column",
|
|
552
|
-
gap: 8
|
|
553
|
-
},
|
|
554
|
-
children: [
|
|
555
|
-
c.map((t, o) => {
|
|
556
|
-
let c = [...s, o], u = l && t.and ? t.and : [t];
|
|
557
|
-
return /* @__PURE__ */ G("div", { children: [l && o > 0 && /* @__PURE__ */ G("div", {
|
|
558
|
-
style: {
|
|
559
|
-
display: "flex",
|
|
560
|
-
alignItems: "center",
|
|
561
|
-
gap: 8,
|
|
562
|
-
padding: "4px 0"
|
|
563
|
-
},
|
|
564
|
-
children: [
|
|
565
|
-
/* @__PURE__ */ W("div", { style: {
|
|
566
|
-
flex: 1,
|
|
567
|
-
borderTop: "1px solid var(--divider)"
|
|
568
|
-
} }),
|
|
569
|
-
/* @__PURE__ */ W("span", {
|
|
570
|
-
style: {
|
|
571
|
-
fontSize: 11,
|
|
572
|
-
fontWeight: 600,
|
|
573
|
-
color: "var(--text-3)",
|
|
574
|
-
padding: "0 6px"
|
|
575
|
-
},
|
|
576
|
-
children: "OR"
|
|
577
|
-
}),
|
|
578
|
-
/* @__PURE__ */ W("div", { style: {
|
|
579
|
-
flex: 1,
|
|
580
|
-
borderTop: "1px solid var(--divider)"
|
|
581
|
-
} })
|
|
582
|
-
]
|
|
583
|
-
}), /* @__PURE__ */ G("div", {
|
|
584
|
-
style: {
|
|
585
|
-
border: "1px solid var(--border)",
|
|
586
|
-
borderRadius: 8,
|
|
587
|
-
padding: 10,
|
|
588
|
-
display: "flex",
|
|
589
|
-
flexDirection: "column",
|
|
590
|
-
gap: 8
|
|
591
|
-
},
|
|
592
|
-
children: [
|
|
593
|
-
l && /* @__PURE__ */ W("div", {
|
|
594
|
-
style: {
|
|
595
|
-
fontSize: 10.5,
|
|
596
|
-
fontWeight: 600,
|
|
597
|
-
color: "var(--text-3)",
|
|
598
|
-
textTransform: "uppercase",
|
|
599
|
-
letterSpacing: "0.08em"
|
|
600
|
-
},
|
|
601
|
-
children: "Match ALL"
|
|
602
|
-
}),
|
|
603
|
-
u.map((e, n) => r(e, l && t.and ? [...c, n] : c)),
|
|
604
|
-
l && /* @__PURE__ */ W(f, {
|
|
605
|
-
kind: "ghost",
|
|
606
|
-
size: "xs",
|
|
607
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 11 }),
|
|
608
|
-
onClick: () => a(o),
|
|
609
|
-
children: "Add condition"
|
|
610
|
-
}),
|
|
611
|
-
l && /* @__PURE__ */ W(n, {
|
|
612
|
-
size: 22,
|
|
613
|
-
icon: /* @__PURE__ */ W(e.x, { size: 12 }),
|
|
614
|
-
onClick: () => i(c),
|
|
615
|
-
title: "Remove OR alternative"
|
|
616
|
-
})
|
|
617
|
-
]
|
|
618
|
-
})] }, o);
|
|
619
|
-
}),
|
|
620
|
-
!l && /* @__PURE__ */ W(f, {
|
|
621
|
-
kind: "ghost",
|
|
622
|
-
size: "xs",
|
|
623
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 11 }),
|
|
624
|
-
onClick: () => a(),
|
|
625
|
-
children: "Add condition"
|
|
626
|
-
}),
|
|
627
|
-
l && /* @__PURE__ */ W(f, {
|
|
628
|
-
kind: "ghost",
|
|
629
|
-
size: "xs",
|
|
630
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 11 }),
|
|
631
|
-
onClick: o,
|
|
632
|
-
children: "Add OR group"
|
|
633
|
-
})
|
|
634
|
-
]
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
function he(e, t) {
|
|
638
|
-
let n = e, r;
|
|
639
|
-
for (let e = 0; e < t.length; e += 1) {
|
|
640
|
-
let i = t[e];
|
|
641
|
-
if (r = n[i], !r) return;
|
|
642
|
-
e < t.length - 1 && (n = r.or ?? r.and ?? []);
|
|
643
|
-
}
|
|
644
|
-
return r;
|
|
645
|
-
}
|
|
646
|
-
function Z(e, t, n) {
|
|
647
|
-
if (t.length === 0) return e;
|
|
648
|
-
let [r, ...i] = t;
|
|
649
|
-
return e.map((e, t) => {
|
|
650
|
-
if (t !== r) return e;
|
|
651
|
-
if (i.length === 0) return n(e);
|
|
652
|
-
let a = e.or ? "or" : "and", o = e.or ?? e.and;
|
|
653
|
-
if (!o) return e;
|
|
654
|
-
let s = Z(o, i, n);
|
|
655
|
-
return a === "or" ? {
|
|
656
|
-
...e,
|
|
657
|
-
or: s
|
|
658
|
-
} : {
|
|
659
|
-
...e,
|
|
660
|
-
and: s
|
|
661
|
-
};
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
function Q(e, t, n) {
|
|
665
|
-
if (t.length === 0) return e;
|
|
666
|
-
let [r, ...i] = t;
|
|
667
|
-
return e.map((e, t) => {
|
|
668
|
-
if (t !== r) return e;
|
|
669
|
-
if (i.length === 0) return n;
|
|
670
|
-
let a = e.or ?? e.and;
|
|
671
|
-
if (!a) return e;
|
|
672
|
-
let o = Q(a, i, n);
|
|
673
|
-
return e.or ? {
|
|
674
|
-
...e,
|
|
675
|
-
or: o
|
|
676
|
-
} : {
|
|
677
|
-
...e,
|
|
678
|
-
and: o
|
|
679
|
-
};
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
function ge(e, t) {
|
|
683
|
-
if (t.length === 0) return e;
|
|
684
|
-
let [n, ...r] = t;
|
|
685
|
-
return r.length === 0 ? e.filter((e, t) => t !== n) : e.map((e, t) => {
|
|
686
|
-
if (t !== n) return e;
|
|
687
|
-
let i = e.or ?? e.and;
|
|
688
|
-
if (!i) return e;
|
|
689
|
-
let a = ge(i, r);
|
|
690
|
-
return e.or ? {
|
|
691
|
-
...e,
|
|
692
|
-
or: a
|
|
693
|
-
} : {
|
|
694
|
-
...e,
|
|
695
|
-
and: a
|
|
696
|
-
};
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
function _e({ fields: t, activeFields: n, compact: r, onSelect: a, onCancel: o }) {
|
|
700
|
-
let [s, c] = V(""), l = t.filter((e) => !n.has(e.code) && (s === "" || e.label.toLowerCase().includes(s.toLowerCase()) || e.code.toLowerCase().includes(s.toLowerCase())));
|
|
701
|
-
return /* @__PURE__ */ G("div", {
|
|
702
|
-
style: {
|
|
703
|
-
width: "100%",
|
|
704
|
-
border: "1px solid var(--border)",
|
|
705
|
-
borderRadius: 8,
|
|
706
|
-
padding: 8,
|
|
707
|
-
display: "flex",
|
|
708
|
-
flexDirection: "column",
|
|
709
|
-
gap: 6,
|
|
710
|
-
minWidth: 0,
|
|
711
|
-
boxSizing: "border-box"
|
|
712
|
-
},
|
|
713
|
-
children: [
|
|
714
|
-
/* @__PURE__ */ W(i, {
|
|
715
|
-
value: s,
|
|
716
|
-
onChange: c,
|
|
717
|
-
placeholder: "Search fields…",
|
|
718
|
-
prefix: /* @__PURE__ */ W(e.search, { size: 12 }),
|
|
719
|
-
autoFocus: !0
|
|
720
|
-
}),
|
|
721
|
-
/* @__PURE__ */ G("div", {
|
|
722
|
-
style: {
|
|
723
|
-
maxHeight: 200,
|
|
724
|
-
overflow: "auto",
|
|
725
|
-
display: "flex",
|
|
726
|
-
flexDirection: "column"
|
|
727
|
-
},
|
|
728
|
-
children: [l.map((e) => /* @__PURE__ */ G("button", {
|
|
729
|
-
"data-testid": `filter-field-${e.code}`,
|
|
730
|
-
onClick: () => a(e.code),
|
|
731
|
-
style: {
|
|
732
|
-
textAlign: "left",
|
|
733
|
-
padding: "6px 8px",
|
|
734
|
-
fontSize: 12,
|
|
735
|
-
background: "transparent",
|
|
736
|
-
border: 0,
|
|
737
|
-
color: "var(--text-2)",
|
|
738
|
-
cursor: "pointer",
|
|
739
|
-
borderRadius: 5,
|
|
740
|
-
display: "flex",
|
|
741
|
-
justifyContent: "space-between",
|
|
742
|
-
gap: 8,
|
|
743
|
-
minWidth: 0
|
|
744
|
-
},
|
|
745
|
-
onMouseEnter: (e) => e.currentTarget.style.background = "var(--surface-3)",
|
|
746
|
-
onMouseLeave: (e) => e.currentTarget.style.background = "transparent",
|
|
747
|
-
children: [/* @__PURE__ */ W("span", {
|
|
748
|
-
style: {
|
|
749
|
-
minWidth: 0,
|
|
750
|
-
overflow: "hidden",
|
|
751
|
-
textOverflow: "ellipsis",
|
|
752
|
-
whiteSpace: "nowrap"
|
|
753
|
-
},
|
|
754
|
-
children: e.label
|
|
755
|
-
}), /* @__PURE__ */ W("span", {
|
|
756
|
-
className: "mono",
|
|
757
|
-
style: {
|
|
758
|
-
color: "var(--text-4)",
|
|
759
|
-
fontSize: 10.5,
|
|
760
|
-
display: r ? "none" : void 0
|
|
761
|
-
},
|
|
762
|
-
children: e.code
|
|
763
|
-
})]
|
|
764
|
-
}, e.code)), l.length === 0 && /* @__PURE__ */ W("div", {
|
|
765
|
-
style: {
|
|
766
|
-
fontSize: 12,
|
|
767
|
-
color: "var(--text-3)",
|
|
768
|
-
padding: "6px 8px"
|
|
769
|
-
},
|
|
770
|
-
children: "No fields available"
|
|
771
|
-
})]
|
|
772
|
-
}),
|
|
773
|
-
/* @__PURE__ */ W(f, {
|
|
774
|
-
kind: "ghost",
|
|
775
|
-
size: "xs",
|
|
776
|
-
onClick: o,
|
|
777
|
-
style: { justifyContent: "center" },
|
|
778
|
-
children: "Cancel"
|
|
779
|
-
})
|
|
780
|
-
]
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
//#endregion
|
|
784
|
-
//#region src/components/filters/FilterChips.tsx
|
|
785
|
-
function ve({ filters: t, onRemove: n, onClearAll: r, onChipClick: i, fieldLabel: a = (e) => e, resolveValue: o }) {
|
|
786
|
-
return t.length === 0 ? null : /* @__PURE__ */ G("div", {
|
|
787
|
-
style: {
|
|
788
|
-
display: "flex",
|
|
789
|
-
alignItems: "center",
|
|
790
|
-
gap: 8,
|
|
791
|
-
flexWrap: "wrap",
|
|
792
|
-
paddingBottom: 12
|
|
793
|
-
},
|
|
794
|
-
children: [t.map((e, t) => /* @__PURE__ */ G(I, { children: [t > 0 && /* @__PURE__ */ W(be, { label: "AND" }), /* @__PURE__ */ W(ye, {
|
|
795
|
-
node: e,
|
|
796
|
-
fieldLabel: a,
|
|
797
|
-
resolveValue: o,
|
|
798
|
-
onRemove: n,
|
|
799
|
-
onClick: i
|
|
800
|
-
})] }, t)), /* @__PURE__ */ W(f, {
|
|
801
|
-
kind: "ghost",
|
|
802
|
-
size: "xs",
|
|
803
|
-
icon: /* @__PURE__ */ W(e.x, { size: 11 }),
|
|
804
|
-
onClick: r,
|
|
805
|
-
children: "Clear all"
|
|
806
|
-
})]
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
function ye({ node: e, fieldLabel: t, resolveValue: n, onRemove: r, onClick: i }) {
|
|
810
|
-
if (e.field && e.op) return /* @__PURE__ */ W(xe, {
|
|
811
|
-
node: e,
|
|
812
|
-
fieldLabel: t,
|
|
813
|
-
resolveValue: n,
|
|
814
|
-
onRemove: () => r(e.field),
|
|
815
|
-
onClick: i
|
|
816
|
-
});
|
|
817
|
-
let a = e.or ?? e.and ?? [], o = e.or ? "OR" : "AND";
|
|
818
|
-
return /* @__PURE__ */ G("span", {
|
|
819
|
-
"data-testid": `filter-${e.or ? "or" : "and"}-group`,
|
|
820
|
-
style: {
|
|
821
|
-
display: "inline-flex",
|
|
822
|
-
alignItems: "center",
|
|
823
|
-
gap: 4,
|
|
824
|
-
flexWrap: "wrap",
|
|
825
|
-
border: "1px solid var(--divider)",
|
|
826
|
-
borderRadius: 6,
|
|
827
|
-
padding: "2px 5px"
|
|
828
|
-
},
|
|
829
|
-
children: [
|
|
830
|
-
/* @__PURE__ */ W("span", {
|
|
831
|
-
"aria-hidden": "true",
|
|
832
|
-
style: {
|
|
833
|
-
color: "var(--text-3)",
|
|
834
|
-
fontWeight: 600
|
|
835
|
-
},
|
|
836
|
-
children: "("
|
|
837
|
-
}),
|
|
838
|
-
a.map((e, a) => /* @__PURE__ */ G(I, { children: [a > 0 && /* @__PURE__ */ W(be, { label: o }), /* @__PURE__ */ W(ye, {
|
|
839
|
-
node: e,
|
|
840
|
-
fieldLabel: t,
|
|
841
|
-
resolveValue: n,
|
|
842
|
-
onRemove: r,
|
|
843
|
-
onClick: i
|
|
844
|
-
})] }, a)),
|
|
845
|
-
/* @__PURE__ */ W("span", {
|
|
846
|
-
"aria-hidden": "true",
|
|
847
|
-
style: {
|
|
848
|
-
color: "var(--text-3)",
|
|
849
|
-
fontWeight: 600
|
|
850
|
-
},
|
|
851
|
-
children: ")"
|
|
852
|
-
})
|
|
853
|
-
]
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
function be({ label: e }) {
|
|
857
|
-
return /* @__PURE__ */ W("span", {
|
|
858
|
-
"aria-label": e,
|
|
859
|
-
style: {
|
|
860
|
-
fontSize: 11,
|
|
861
|
-
color: "var(--text-3)",
|
|
862
|
-
fontWeight: 600,
|
|
863
|
-
padding: "0 2px"
|
|
864
|
-
},
|
|
865
|
-
children: e
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
function xe({ node: t, fieldLabel: n, resolveValue: r, onRemove: i, onClick: o }) {
|
|
869
|
-
let s = /* @__PURE__ */ W(e.filter, { size: 11 });
|
|
870
|
-
return /* @__PURE__ */ W(a, {
|
|
871
|
-
tone: "slate",
|
|
872
|
-
icon: s,
|
|
873
|
-
onClick: o,
|
|
874
|
-
onRemove: i,
|
|
875
|
-
children: /* @__PURE__ */ G("span", { children: [
|
|
876
|
-
/* @__PURE__ */ W("span", {
|
|
877
|
-
style: { color: "var(--text-3)" },
|
|
878
|
-
children: n(t.field)
|
|
879
|
-
}),
|
|
880
|
-
" ",
|
|
881
|
-
/* @__PURE__ */ W("span", {
|
|
882
|
-
style: { fontWeight: 600 },
|
|
883
|
-
children: /* @__PURE__ */ W(Se, {
|
|
884
|
-
node: t,
|
|
885
|
-
resolveValue: r
|
|
886
|
-
})
|
|
887
|
-
})
|
|
888
|
-
] })
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
function Se({ node: e, resolveValue: t }) {
|
|
892
|
-
let n = e.op, r = N[n] || n;
|
|
893
|
-
if (D.has(n)) return /* @__PURE__ */ W(U, { children: r });
|
|
894
|
-
if (!t) return /* @__PURE__ */ W(U, { children: F(e) });
|
|
895
|
-
let i = Array.isArray(e.value) ? e.value : [e.value];
|
|
896
|
-
return /* @__PURE__ */ G(U, { children: [
|
|
897
|
-
r,
|
|
898
|
-
" ",
|
|
899
|
-
i.map((n, r) => {
|
|
900
|
-
let i = t(e.field, n);
|
|
901
|
-
return /* @__PURE__ */ G(I, { children: [r > 0 ? ", " : "", /* @__PURE__ */ W("span", { children: i.status === "loading" ? /* @__PURE__ */ W(Ce, {}) : i.label ?? i.raw })] }, r);
|
|
902
|
-
})
|
|
903
|
-
] });
|
|
904
|
-
}
|
|
905
|
-
function Ce() {
|
|
906
|
-
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ W("span", {
|
|
907
|
-
"aria-label": "loading",
|
|
908
|
-
style: {
|
|
909
|
-
display: "inline-block",
|
|
910
|
-
width: 52,
|
|
911
|
-
height: "0.72em",
|
|
912
|
-
verticalAlign: "middle",
|
|
913
|
-
borderRadius: 4,
|
|
914
|
-
background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
|
|
915
|
-
backgroundSize: "200% 100%",
|
|
916
|
-
animation: "declarion-shimmer 1.2s ease-in-out infinite"
|
|
917
|
-
}
|
|
918
|
-
})] });
|
|
919
|
-
}
|
|
920
|
-
//#endregion
|
|
921
|
-
//#region src/components/list/ColumnPicker.tsx
|
|
922
|
-
function we({ availableColumns: t, visibleColumns: r, onToggle: i, onMove: a, onReset: o, onShowAll: s, onResetWidths: l, columnLabel: u = (e) => e }) {
|
|
923
|
-
let d = B(null), [p, m] = V(!1), h = t.filter((e) => !r.includes(e)), _ = (e) => /* @__PURE__ */ W("div", {
|
|
924
|
-
style: {
|
|
925
|
-
padding: "6px 8px 4px",
|
|
926
|
-
fontSize: 10.5,
|
|
927
|
-
color: "var(--text-3)",
|
|
928
|
-
fontWeight: 600,
|
|
929
|
-
letterSpacing: "0.06em",
|
|
930
|
-
textTransform: "uppercase"
|
|
931
|
-
},
|
|
932
|
-
children: e
|
|
933
|
-
});
|
|
934
|
-
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(f, {
|
|
935
|
-
ref: d,
|
|
936
|
-
icon: /* @__PURE__ */ W(e.columns, { size: 13 }),
|
|
937
|
-
onClick: () => m((e) => !e),
|
|
938
|
-
active: p,
|
|
939
|
-
children: "Columns"
|
|
940
|
-
}), /* @__PURE__ */ G(c, {
|
|
941
|
-
open: p,
|
|
942
|
-
anchor: d.current,
|
|
943
|
-
onClose: () => m(!1),
|
|
944
|
-
align: "end",
|
|
945
|
-
width: 240,
|
|
946
|
-
children: [
|
|
947
|
-
_("Visible columns"),
|
|
948
|
-
r.map((t, o) => /* @__PURE__ */ G("div", {
|
|
949
|
-
style: {
|
|
950
|
-
display: "flex",
|
|
951
|
-
alignItems: "center",
|
|
952
|
-
gap: 2,
|
|
953
|
-
padding: "0 6px 0 8px"
|
|
954
|
-
},
|
|
955
|
-
children: [/* @__PURE__ */ G("button", {
|
|
956
|
-
type: "button",
|
|
957
|
-
onClick: () => i(t),
|
|
958
|
-
"aria-label": `Hide ${u(t)}`,
|
|
959
|
-
style: {
|
|
960
|
-
flex: 1,
|
|
961
|
-
display: "flex",
|
|
962
|
-
alignItems: "center",
|
|
963
|
-
gap: 6,
|
|
964
|
-
minWidth: 0,
|
|
965
|
-
background: "none",
|
|
966
|
-
border: 0,
|
|
967
|
-
cursor: "pointer",
|
|
968
|
-
textAlign: "left",
|
|
969
|
-
color: "var(--text)",
|
|
970
|
-
font: "inherit",
|
|
971
|
-
fontSize: 12.5,
|
|
972
|
-
padding: "4px 0"
|
|
973
|
-
},
|
|
974
|
-
children: [/* @__PURE__ */ W(e.check, { size: 12 }), /* @__PURE__ */ W("span", {
|
|
975
|
-
style: {
|
|
976
|
-
overflow: "hidden",
|
|
977
|
-
textOverflow: "ellipsis",
|
|
978
|
-
whiteSpace: "nowrap"
|
|
979
|
-
},
|
|
980
|
-
children: u(t)
|
|
981
|
-
})]
|
|
982
|
-
}), a && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(n, {
|
|
983
|
-
icon: /* @__PURE__ */ W(e.arrowUp, { size: 12 }),
|
|
984
|
-
title: `Move ${u(t)} up`,
|
|
985
|
-
size: 22,
|
|
986
|
-
disabled: o === 0,
|
|
987
|
-
onClick: () => a(t, "up")
|
|
988
|
-
}), /* @__PURE__ */ W(n, {
|
|
989
|
-
icon: /* @__PURE__ */ W(e.arrowDown, { size: 12 }),
|
|
990
|
-
title: `Move ${u(t)} down`,
|
|
991
|
-
size: 22,
|
|
992
|
-
disabled: o === r.length - 1,
|
|
993
|
-
onClick: () => a(t, "down")
|
|
994
|
-
})] })]
|
|
995
|
-
}, t)),
|
|
996
|
-
h.length > 0 && /* @__PURE__ */ G(U, { children: [_("Hidden columns"), h.map((e) => /* @__PURE__ */ W(g, {
|
|
997
|
-
icon: /* @__PURE__ */ W("span", { style: {
|
|
998
|
-
width: 12,
|
|
999
|
-
display: "inline-block"
|
|
1000
|
-
} }),
|
|
1001
|
-
onClick: () => i(e),
|
|
1002
|
-
children: u(e)
|
|
1003
|
-
}, e))] }),
|
|
1004
|
-
/* @__PURE__ */ W(g, { divider: !0 }),
|
|
1005
|
-
/* @__PURE__ */ W(g, {
|
|
1006
|
-
icon: /* @__PURE__ */ W(e.refresh, { size: 12 }),
|
|
1007
|
-
onClick: o,
|
|
1008
|
-
children: "Reset columns"
|
|
1009
|
-
}),
|
|
1010
|
-
/* @__PURE__ */ W(g, {
|
|
1011
|
-
icon: /* @__PURE__ */ W(e.eye, { size: 12 }),
|
|
1012
|
-
onClick: s,
|
|
1013
|
-
children: "Show all"
|
|
1014
|
-
}),
|
|
1015
|
-
l && /* @__PURE__ */ W(g, {
|
|
1016
|
-
icon: /* @__PURE__ */ W(e.columns, { size: 12 }),
|
|
1017
|
-
onClick: l,
|
|
1018
|
-
children: "Reset column widths (this device)"
|
|
1019
|
-
})
|
|
1020
|
-
]
|
|
1021
|
-
})] });
|
|
1022
|
-
}
|
|
1023
|
-
//#endregion
|
|
1024
|
-
//#region src/components/list/ViewSwitcher.tsx
|
|
1025
|
-
var Te = {
|
|
1026
|
-
display: "flex",
|
|
1027
|
-
alignItems: "center",
|
|
1028
|
-
gap: 6,
|
|
1029
|
-
height: 28,
|
|
1030
|
-
padding: "0 10px",
|
|
1031
|
-
background: "var(--surface)",
|
|
1032
|
-
border: "1px solid var(--border)",
|
|
1033
|
-
borderRadius: 6,
|
|
1034
|
-
cursor: "pointer",
|
|
1035
|
-
fontSize: 12,
|
|
1036
|
-
color: "var(--text-2)",
|
|
1037
|
-
fontFamily: "inherit"
|
|
1038
|
-
};
|
|
1039
|
-
function Ee({ views: t, activeViewId: n, isDirty: r, onSelect: i, onSave: a, onSaveAs: o }) {
|
|
1040
|
-
let s = B(null), [l, u] = V(!1), d = t.find((e) => e.id === n), p = t.filter((e) => e.source === "system"), m = t.filter((e) => e.source === "personal"), h = t.filter((e) => e.source === "shared"), _ = d ? v(d.name) : "Default view", y = (e) => /* @__PURE__ */ W("div", {
|
|
1041
|
-
style: {
|
|
1042
|
-
padding: "6px 8px 4px",
|
|
1043
|
-
fontSize: 10,
|
|
1044
|
-
color: "var(--text-3)",
|
|
1045
|
-
fontWeight: 700,
|
|
1046
|
-
letterSpacing: "0.08em",
|
|
1047
|
-
textTransform: "uppercase"
|
|
1048
|
-
},
|
|
1049
|
-
children: e
|
|
1050
|
-
});
|
|
1051
|
-
return /* @__PURE__ */ G("div", {
|
|
1052
|
-
style: {
|
|
1053
|
-
display: "flex",
|
|
1054
|
-
alignItems: "center",
|
|
1055
|
-
gap: 6
|
|
1056
|
-
},
|
|
1057
|
-
children: [
|
|
1058
|
-
/* @__PURE__ */ G("button", {
|
|
1059
|
-
ref: s,
|
|
1060
|
-
type: "button",
|
|
1061
|
-
onClick: () => u((e) => !e),
|
|
1062
|
-
style: Te,
|
|
1063
|
-
children: [
|
|
1064
|
-
/* @__PURE__ */ W(e.star, { size: 12 }),
|
|
1065
|
-
/* @__PURE__ */ W("span", { children: _ }),
|
|
1066
|
-
r && /* @__PURE__ */ W("span", { style: {
|
|
1067
|
-
display: "inline-block",
|
|
1068
|
-
width: 6,
|
|
1069
|
-
height: 6,
|
|
1070
|
-
borderRadius: 999,
|
|
1071
|
-
background: "var(--warn)",
|
|
1072
|
-
marginLeft: 2
|
|
1073
|
-
} }),
|
|
1074
|
-
/* @__PURE__ */ W(e.down, { size: 11 })
|
|
1075
|
-
]
|
|
1076
|
-
}),
|
|
1077
|
-
/* @__PURE__ */ G(c, {
|
|
1078
|
-
open: l,
|
|
1079
|
-
anchor: s.current,
|
|
1080
|
-
onClose: () => u(!1),
|
|
1081
|
-
width: 280,
|
|
1082
|
-
children: [
|
|
1083
|
-
/* @__PURE__ */ W(g, {
|
|
1084
|
-
icon: n ? void 0 : /* @__PURE__ */ W(e.check, { size: 12 }),
|
|
1085
|
-
active: !n,
|
|
1086
|
-
onClick: () => {
|
|
1087
|
-
i({
|
|
1088
|
-
id: "",
|
|
1089
|
-
name: { en: "Default" },
|
|
1090
|
-
source: "system"
|
|
1091
|
-
}), u(!1);
|
|
1092
|
-
},
|
|
1093
|
-
children: "Default view"
|
|
1094
|
-
}),
|
|
1095
|
-
p.length > 0 && y("Presets"),
|
|
1096
|
-
p.map((t) => /* @__PURE__ */ W(g, {
|
|
1097
|
-
icon: n === t.id ? /* @__PURE__ */ W(e.check, { size: 12 }) : void 0,
|
|
1098
|
-
active: n === t.id,
|
|
1099
|
-
onClick: () => {
|
|
1100
|
-
i(t), u(!1);
|
|
1101
|
-
},
|
|
1102
|
-
children: v(t.name)
|
|
1103
|
-
}, t.id)),
|
|
1104
|
-
m.length > 0 && y("My Views"),
|
|
1105
|
-
m.map((t) => /* @__PURE__ */ W(g, {
|
|
1106
|
-
icon: n === t.id ? /* @__PURE__ */ W(e.check, { size: 12 }) : t.is_default ? /* @__PURE__ */ W(e.star, { size: 12 }) : void 0,
|
|
1107
|
-
active: n === t.id,
|
|
1108
|
-
onClick: () => {
|
|
1109
|
-
i(t), u(!1);
|
|
1110
|
-
},
|
|
1111
|
-
children: v(t.name)
|
|
1112
|
-
}, t.id)),
|
|
1113
|
-
h.length > 0 && y("Shared"),
|
|
1114
|
-
h.map((t) => /* @__PURE__ */ W(g, {
|
|
1115
|
-
icon: n === t.id ? /* @__PURE__ */ W(e.check, { size: 12 }) : /* @__PURE__ */ W(e.globe, { size: 12 }),
|
|
1116
|
-
active: n === t.id,
|
|
1117
|
-
onClick: () => {
|
|
1118
|
-
i(t), u(!1);
|
|
1119
|
-
},
|
|
1120
|
-
children: v(t.name)
|
|
1121
|
-
}, t.id)),
|
|
1122
|
-
o && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(g, { divider: !0 }), /* @__PURE__ */ W(g, {
|
|
1123
|
-
icon: /* @__PURE__ */ W(e.plus, { size: 12 }),
|
|
1124
|
-
onClick: () => {
|
|
1125
|
-
o(), u(!1);
|
|
1126
|
-
},
|
|
1127
|
-
children: "Save as new view…"
|
|
1128
|
-
})] })
|
|
1129
|
-
]
|
|
1130
|
-
}),
|
|
1131
|
-
r && n && a && /* @__PURE__ */ W(f, {
|
|
1132
|
-
icon: /* @__PURE__ */ W(e.save, { size: 12 }),
|
|
1133
|
-
onClick: a,
|
|
1134
|
-
children: "Save"
|
|
1135
|
-
})
|
|
1136
|
-
]
|
|
1137
|
-
});
|
|
1138
|
-
}
|
|
1139
|
-
//#endregion
|
|
1140
|
-
//#region src/components/list/PeekFieldCell.tsx
|
|
1141
|
-
var De = /* @__PURE__ */ new Set([
|
|
1142
|
-
"enum",
|
|
1143
|
-
"bool",
|
|
1144
|
-
"ref"
|
|
1145
|
-
]);
|
|
1146
|
-
function Oe(e) {
|
|
1147
|
-
let t = e.display?.widget;
|
|
1148
|
-
return t && De.has(t) ? !0 : De.has(e.type);
|
|
1149
|
-
}
|
|
1150
|
-
function ke({ field: t, fieldName: r, label: i, value: a, record: o, refs: s, readOnly: c, onCommit: l }) {
|
|
1151
|
-
let u = p(), [d, f] = V(!1), [m, h] = V(a), g = Oe(t);
|
|
1152
|
-
R(() => {
|
|
1153
|
-
d || h(a);
|
|
1154
|
-
}, [a, d]);
|
|
1155
|
-
let _ = L(() => {
|
|
1156
|
-
c || (h(a), f(!0));
|
|
1157
|
-
}, [c, a]), v = L((e) => {
|
|
1158
|
-
l(e === void 0 ? m : e), f(!1);
|
|
1159
|
-
}, [l, m]), b = L(() => {
|
|
1160
|
-
h(a), f(!1);
|
|
1161
|
-
}, [a]), x = L((e) => {
|
|
1162
|
-
if (c || d) return;
|
|
1163
|
-
let t = e.target;
|
|
1164
|
-
t.closest("a") || t.closest("[data-peek-pencil=\"true\"]") || _();
|
|
1165
|
-
}, [
|
|
1166
|
-
c,
|
|
1167
|
-
d,
|
|
1168
|
-
_
|
|
1169
|
-
]), S = L((e) => {
|
|
1170
|
-
if (!d) {
|
|
1171
|
-
!c && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), _());
|
|
1172
|
-
return;
|
|
1173
|
-
}
|
|
1174
|
-
g || (e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), v()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), b()));
|
|
1175
|
-
}, [
|
|
1176
|
-
d,
|
|
1177
|
-
g,
|
|
1178
|
-
c,
|
|
1179
|
-
_,
|
|
1180
|
-
v,
|
|
1181
|
-
b
|
|
1182
|
-
]), C = L((e) => {
|
|
1183
|
-
g ? (h(e), v(e)) : h(e);
|
|
1184
|
-
}, [g, v]), w = y({
|
|
1185
|
-
field: t,
|
|
1186
|
-
fieldName: r,
|
|
1187
|
-
value: a,
|
|
1188
|
-
mode: "display",
|
|
1189
|
-
record: o,
|
|
1190
|
-
refs: s,
|
|
1191
|
-
locale: u
|
|
1192
|
-
}), T = d ? y({
|
|
1193
|
-
field: t,
|
|
1194
|
-
fieldName: r,
|
|
1195
|
-
value: m,
|
|
1196
|
-
mode: "edit",
|
|
1197
|
-
onChange: C,
|
|
1198
|
-
record: o,
|
|
1199
|
-
refs: s,
|
|
1200
|
-
locale: u
|
|
1201
|
-
}) : null;
|
|
1202
|
-
return /* @__PURE__ */ W("div", {
|
|
1203
|
-
className: "peek-field-cell",
|
|
1204
|
-
"data-editing": d ? "true" : "false",
|
|
1205
|
-
onClick: x,
|
|
1206
|
-
onKeyDown: S,
|
|
1207
|
-
onMouseEnter: (e) => {
|
|
1208
|
-
c || d || (e.currentTarget.style.borderColor = "var(--border)");
|
|
1209
|
-
},
|
|
1210
|
-
onMouseLeave: (e) => {
|
|
1211
|
-
e.currentTarget.style.borderColor = "transparent";
|
|
1212
|
-
},
|
|
1213
|
-
style: {
|
|
1214
|
-
position: "relative",
|
|
1215
|
-
display: "flex",
|
|
1216
|
-
alignItems: "center",
|
|
1217
|
-
gap: 6,
|
|
1218
|
-
padding: "4px 6px",
|
|
1219
|
-
margin: "-4px -6px",
|
|
1220
|
-
borderRadius: 4,
|
|
1221
|
-
minHeight: 28,
|
|
1222
|
-
cursor: c || d ? "default" : "text",
|
|
1223
|
-
border: "1px dashed transparent"
|
|
1224
|
-
},
|
|
1225
|
-
tabIndex: c || d ? -1 : 0,
|
|
1226
|
-
role: c || d ? void 0 : "button",
|
|
1227
|
-
"aria-label": c || d ? void 0 : `Edit ${i}`,
|
|
1228
|
-
children: d ? /* @__PURE__ */ G("div", {
|
|
1229
|
-
style: {
|
|
1230
|
-
display: "flex",
|
|
1231
|
-
alignItems: "center",
|
|
1232
|
-
gap: 4,
|
|
1233
|
-
flex: 1,
|
|
1234
|
-
minWidth: 0
|
|
1235
|
-
},
|
|
1236
|
-
children: [/* @__PURE__ */ W("div", {
|
|
1237
|
-
style: {
|
|
1238
|
-
flex: 1,
|
|
1239
|
-
minWidth: 0
|
|
1240
|
-
},
|
|
1241
|
-
children: T
|
|
1242
|
-
}), !g && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(n, {
|
|
1243
|
-
size: 24,
|
|
1244
|
-
icon: /* @__PURE__ */ W(e.check, { size: 13 }),
|
|
1245
|
-
onClick: () => v(),
|
|
1246
|
-
title: "Save"
|
|
1247
|
-
}), /* @__PURE__ */ W(n, {
|
|
1248
|
-
size: 24,
|
|
1249
|
-
icon: /* @__PURE__ */ W(e.x, { size: 13 }),
|
|
1250
|
-
onClick: b,
|
|
1251
|
-
title: "Cancel"
|
|
1252
|
-
})] })]
|
|
1253
|
-
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
1254
|
-
style: {
|
|
1255
|
-
flex: 1,
|
|
1256
|
-
minWidth: 0
|
|
1257
|
-
},
|
|
1258
|
-
children: w
|
|
1259
|
-
}), !c && /* @__PURE__ */ W("span", {
|
|
1260
|
-
"data-peek-pencil": "true",
|
|
1261
|
-
style: {
|
|
1262
|
-
position: "absolute",
|
|
1263
|
-
right: 4,
|
|
1264
|
-
top: "50%",
|
|
1265
|
-
transform: "translateY(-50%)"
|
|
1266
|
-
},
|
|
1267
|
-
className: "peek-pencil",
|
|
1268
|
-
children: /* @__PURE__ */ W(n, {
|
|
1269
|
-
size: 20,
|
|
1270
|
-
icon: /* @__PURE__ */ W(e.edit, { size: 12 }),
|
|
1271
|
-
onClick: (e) => {
|
|
1272
|
-
e.stopPropagation(), _();
|
|
1273
|
-
},
|
|
1274
|
-
title: "Edit"
|
|
1275
|
-
})
|
|
1276
|
-
})] })
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
//#endregion
|
|
1280
|
-
//#region src/components/list/QuickPeek.tsx
|
|
1281
|
-
function Ae({ entity: t, entityCode: r, record: i, title: a, recordId: c, avatarName: l, fields: m, refs: g, screen: _, actions: y, screenActionLayout: b, entityActionLayout: x, executeAction: S, onClose: w, onOpen: T, onSave: E }) {
|
|
1282
|
-
let D = p(), [O, k] = V({ ...i }), [A, j] = V(!1), M = B(null), { run: N } = h(), P = re(t, _, O);
|
|
1283
|
-
R(() => {
|
|
1284
|
-
k({ ...i }), j(!1);
|
|
1285
|
-
}, [i]), R(() => {
|
|
1286
|
-
M.current?.focus();
|
|
1287
|
-
}, []);
|
|
1288
|
-
let F = z(() => {
|
|
1289
|
-
let e = P?.action_layout ?? b ?? x ?? s(y, "quick_peek"), n = o(e, y, void 0, "quick_peek");
|
|
1290
|
-
return d(n, y, void 0, O, [], te(t, O));
|
|
1291
|
-
}, [
|
|
1292
|
-
P?.action_layout,
|
|
1293
|
-
b,
|
|
1294
|
-
x,
|
|
1295
|
-
y,
|
|
1296
|
-
O,
|
|
1297
|
-
t
|
|
1298
|
-
]), I = ({ code: e, action: t }) => {
|
|
1299
|
-
N({
|
|
1300
|
-
action: t,
|
|
1301
|
-
title: v(t.display?.name) || e,
|
|
1302
|
-
row: O,
|
|
1303
|
-
execute: (n) => S(e, t, n)
|
|
1304
|
-
});
|
|
1305
|
-
}, L = (e, t) => {
|
|
1306
|
-
let n = {
|
|
1307
|
-
...O,
|
|
1308
|
-
[e]: t
|
|
1309
|
-
};
|
|
1310
|
-
k(n), j(!0), E?.(n);
|
|
1311
|
-
}, H = P?.quick_peek?.width ?? 480;
|
|
1312
|
-
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
1313
|
-
onClick: w,
|
|
1314
|
-
style: {
|
|
1315
|
-
position: "fixed",
|
|
1316
|
-
inset: 0,
|
|
1317
|
-
background: "var(--scrim-lite)",
|
|
1318
|
-
zIndex: 40
|
|
1319
|
-
}
|
|
1320
|
-
}), /* @__PURE__ */ G("aside", {
|
|
1321
|
-
ref: M,
|
|
1322
|
-
role: "dialog",
|
|
1323
|
-
"aria-label": "Quick peek",
|
|
1324
|
-
tabIndex: -1,
|
|
1325
|
-
onKeyDown: (e) => {
|
|
1326
|
-
e.key === "Escape" && w();
|
|
1327
|
-
},
|
|
1328
|
-
style: {
|
|
1329
|
-
position: "fixed",
|
|
1330
|
-
top: "var(--topbar-h)",
|
|
1331
|
-
right: 0,
|
|
1332
|
-
bottom: "var(--tabbar-h)",
|
|
1333
|
-
width: H,
|
|
1334
|
-
background: "var(--surface)",
|
|
1335
|
-
borderLeft: "1px solid var(--border)",
|
|
1336
|
-
zIndex: 41,
|
|
1337
|
-
display: "flex",
|
|
1338
|
-
flexDirection: "column",
|
|
1339
|
-
boxShadow: "var(--shadow-lg)"
|
|
1340
|
-
},
|
|
1341
|
-
children: [
|
|
1342
|
-
/* @__PURE__ */ G("div", {
|
|
1343
|
-
style: {
|
|
1344
|
-
display: "flex",
|
|
1345
|
-
alignItems: "center",
|
|
1346
|
-
padding: "12px 16px",
|
|
1347
|
-
borderBottom: "1px solid var(--divider)",
|
|
1348
|
-
gap: 10
|
|
1349
|
-
},
|
|
1350
|
-
children: [
|
|
1351
|
-
/* @__PURE__ */ W(C, {
|
|
1352
|
-
name: l || a,
|
|
1353
|
-
size: 28
|
|
1354
|
-
}),
|
|
1355
|
-
/* @__PURE__ */ G("div", {
|
|
1356
|
-
style: {
|
|
1357
|
-
flex: 1,
|
|
1358
|
-
minWidth: 0
|
|
1359
|
-
},
|
|
1360
|
-
children: [/* @__PURE__ */ W("div", {
|
|
1361
|
-
style: {
|
|
1362
|
-
fontSize: 14,
|
|
1363
|
-
fontWeight: 600,
|
|
1364
|
-
color: "var(--text)",
|
|
1365
|
-
overflow: "hidden",
|
|
1366
|
-
textOverflow: "ellipsis",
|
|
1367
|
-
whiteSpace: "nowrap"
|
|
1368
|
-
},
|
|
1369
|
-
children: a
|
|
1370
|
-
}), c && /* @__PURE__ */ W("div", {
|
|
1371
|
-
className: "mono",
|
|
1372
|
-
style: {
|
|
1373
|
-
fontSize: 11,
|
|
1374
|
-
color: "var(--text-4)"
|
|
1375
|
-
},
|
|
1376
|
-
children: c
|
|
1377
|
-
})]
|
|
1378
|
-
}),
|
|
1379
|
-
/* @__PURE__ */ W(n, {
|
|
1380
|
-
icon: /* @__PURE__ */ W(e.external, { size: 13 }),
|
|
1381
|
-
title: A ? "Open in tab (keeps unsaved changes)" : "Open in tab",
|
|
1382
|
-
onClick: () => T(A ? O : null)
|
|
1383
|
-
}),
|
|
1384
|
-
/* @__PURE__ */ W(n, {
|
|
1385
|
-
icon: /* @__PURE__ */ W(e.x, { size: 14 }),
|
|
1386
|
-
title: "Close",
|
|
1387
|
-
onClick: w
|
|
1388
|
-
})
|
|
1389
|
-
]
|
|
1390
|
-
}),
|
|
1391
|
-
/* @__PURE__ */ G("div", {
|
|
1392
|
-
style: {
|
|
1393
|
-
flex: 1,
|
|
1394
|
-
overflowY: "auto",
|
|
1395
|
-
padding: 14,
|
|
1396
|
-
display: "flex",
|
|
1397
|
-
flexDirection: "column",
|
|
1398
|
-
gap: 10
|
|
1399
|
-
},
|
|
1400
|
-
children: [/* @__PURE__ */ G("div", {
|
|
1401
|
-
style: {
|
|
1402
|
-
padding: "8px 10px",
|
|
1403
|
-
background: "var(--accent-soft)",
|
|
1404
|
-
borderRadius: 6,
|
|
1405
|
-
fontSize: 11.5,
|
|
1406
|
-
color: "var(--accent)",
|
|
1407
|
-
display: "flex",
|
|
1408
|
-
alignItems: "center",
|
|
1409
|
-
gap: 6
|
|
1410
|
-
},
|
|
1411
|
-
children: [
|
|
1412
|
-
/* @__PURE__ */ W(e.sparkle, { size: 12 }),
|
|
1413
|
-
" Inline quick-edit — click any field to change.",
|
|
1414
|
-
/* @__PURE__ */ W(u, { children: "Tab" }),
|
|
1415
|
-
" to move, ",
|
|
1416
|
-
/* @__PURE__ */ W(u, { children: "Esc" }),
|
|
1417
|
-
" to close."
|
|
1418
|
-
]
|
|
1419
|
-
}), m.map((e) => /* @__PURE__ */ W(je, {
|
|
1420
|
-
label: e.label,
|
|
1421
|
-
children: e.kind === "file" ? ne({
|
|
1422
|
-
entity: t,
|
|
1423
|
-
entityCode: r,
|
|
1424
|
-
fieldName: e.key,
|
|
1425
|
-
record: O,
|
|
1426
|
-
mode: e.readOnly ? "display" : "edit",
|
|
1427
|
-
onChange: (t) => L(e.key, t),
|
|
1428
|
-
refs: g,
|
|
1429
|
-
disabled: e.readOnly,
|
|
1430
|
-
locale: D
|
|
1431
|
-
}) : /* @__PURE__ */ W(ke, {
|
|
1432
|
-
field: e.field,
|
|
1433
|
-
fieldName: e.key,
|
|
1434
|
-
label: e.label,
|
|
1435
|
-
value: O[e.key],
|
|
1436
|
-
record: O,
|
|
1437
|
-
refs: g,
|
|
1438
|
-
readOnly: e.readOnly,
|
|
1439
|
-
onCommit: (t) => L(e.key, t)
|
|
1440
|
-
})
|
|
1441
|
-
}, e.key))]
|
|
1442
|
-
}),
|
|
1443
|
-
/* @__PURE__ */ G("div", {
|
|
1444
|
-
style: {
|
|
1445
|
-
display: "flex",
|
|
1446
|
-
padding: "10px 14px",
|
|
1447
|
-
borderTop: "1px solid var(--divider)",
|
|
1448
|
-
gap: 6,
|
|
1449
|
-
alignItems: "center"
|
|
1450
|
-
},
|
|
1451
|
-
children: [
|
|
1452
|
-
A && /* @__PURE__ */ G("span", {
|
|
1453
|
-
style: {
|
|
1454
|
-
fontSize: 11,
|
|
1455
|
-
color: "var(--warn)",
|
|
1456
|
-
display: "flex",
|
|
1457
|
-
alignItems: "center",
|
|
1458
|
-
gap: 4
|
|
1459
|
-
},
|
|
1460
|
-
children: [/* @__PURE__ */ W("span", { style: {
|
|
1461
|
-
width: 6,
|
|
1462
|
-
height: 6,
|
|
1463
|
-
borderRadius: 999,
|
|
1464
|
-
background: "var(--warn)"
|
|
1465
|
-
} }), "Unsaved"]
|
|
1466
|
-
}),
|
|
1467
|
-
/* @__PURE__ */ W("div", {
|
|
1468
|
-
style: {
|
|
1469
|
-
flex: 1,
|
|
1470
|
-
minWidth: 0,
|
|
1471
|
-
display: "flex",
|
|
1472
|
-
justifyContent: "flex-end"
|
|
1473
|
-
},
|
|
1474
|
-
children: F.length > 0 && /* @__PURE__ */ W(ee, {
|
|
1475
|
-
layout: F,
|
|
1476
|
-
row: O,
|
|
1477
|
-
onRun: (e, t) => I({
|
|
1478
|
-
code: e,
|
|
1479
|
-
action: t
|
|
1480
|
-
}),
|
|
1481
|
-
kind: "toolbar",
|
|
1482
|
-
entityActions: y,
|
|
1483
|
-
align: "trailing",
|
|
1484
|
-
ariaLabel: "Quick peek actions"
|
|
1485
|
-
})
|
|
1486
|
-
}),
|
|
1487
|
-
/* @__PURE__ */ W(f, {
|
|
1488
|
-
kind: "primary",
|
|
1489
|
-
icon: /* @__PURE__ */ W(e.edit, { size: 13 }),
|
|
1490
|
-
onClick: () => T(A ? O : null),
|
|
1491
|
-
children: "Open full"
|
|
1492
|
-
})
|
|
1493
|
-
]
|
|
1494
|
-
})
|
|
1495
|
-
]
|
|
1496
|
-
})] });
|
|
1497
|
-
}
|
|
1498
|
-
function je({ label: e, children: t }) {
|
|
1499
|
-
return /* @__PURE__ */ G("div", {
|
|
1500
|
-
style: {
|
|
1501
|
-
display: "grid",
|
|
1502
|
-
gridTemplateColumns: "120px 1fr",
|
|
1503
|
-
alignItems: "center",
|
|
1504
|
-
padding: "4px 0",
|
|
1505
|
-
borderBottom: "1px solid var(--divider)"
|
|
1506
|
-
},
|
|
1507
|
-
children: [/* @__PURE__ */ W("div", {
|
|
1508
|
-
style: {
|
|
1509
|
-
fontSize: 11.5,
|
|
1510
|
-
color: "var(--text-3)",
|
|
1511
|
-
fontWeight: 500
|
|
1512
|
-
},
|
|
1513
|
-
children: e
|
|
1514
|
-
}), /* @__PURE__ */ W("div", { children: t })]
|
|
1515
|
-
});
|
|
1516
|
-
}
|
|
1517
|
-
//#endregion
|
|
1518
|
-
//#region src/lib/format-count.ts
|
|
1519
|
-
var Me = [
|
|
1520
|
-
{
|
|
1521
|
-
value: 1e9,
|
|
1522
|
-
suffix: "B"
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
value: 1e6,
|
|
1526
|
-
suffix: "M"
|
|
1527
|
-
},
|
|
1528
|
-
{
|
|
1529
|
-
value: 1e3,
|
|
1530
|
-
suffix: "K"
|
|
1531
|
-
}
|
|
1532
|
-
];
|
|
1533
|
-
function Ne(e) {
|
|
1534
|
-
if (!Number.isFinite(e) || e < 0) return "~0";
|
|
1535
|
-
let t = Math.round(e);
|
|
1536
|
-
if (t < 1e3) return `~${t}`;
|
|
1537
|
-
for (let { value: e, suffix: n } of Me) {
|
|
1538
|
-
if (t < e) continue;
|
|
1539
|
-
let r = t / e;
|
|
1540
|
-
return `~${(r < 10 ? r.toFixed(1) : Math.round(r).toString()).replace(/\.0$/, "")}${n}`;
|
|
1541
|
-
}
|
|
1542
|
-
return `~${t.toLocaleString()}`;
|
|
1543
|
-
}
|
|
1544
|
-
function $(e) {
|
|
1545
|
-
return !Number.isFinite(e) || e < 0 ? "0" : Math.round(e).toLocaleString();
|
|
1546
|
-
}
|
|
1547
|
-
function Pe(e, t) {
|
|
1548
|
-
return t === "estimated" ? Ne(e) : $(e);
|
|
1549
|
-
}
|
|
1550
|
-
//#endregion
|
|
1551
|
-
export { Ae as a, ve as c, se as d, oe as f, je as i, le as l, K as m, Ne as n, Ee as o, ae as p, $ as r, we as s, Pe as t, ce as u };
|