@nivaro/react 0.3.139 → 0.3.140
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/components/InlineGridField.js +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useMemo as he, useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useNivaroClient as re, useItemEditAuth as
|
|
6
|
-
import { useDebounced as
|
|
2
|
+
import { useQueryClient as Ie, useQuery as Y } from "@tanstack/react-query";
|
|
3
|
+
import { useMemo as he, useState as j, useEffect as te, createContext as at, useRef as ee, useCallback as lt, useContext as st, useDeferredValue as ot } from "react";
|
|
4
|
+
import { createPortal as it } from "react-dom";
|
|
5
|
+
import { useNivaroClient as re, useItemEditAuth as dt, useDrilldown as ze, useOverlayState as ct, DrilldownContext as ut, useItemNavigation as mt } from "../context.js";
|
|
6
|
+
import { useDebounced as pt } from "../hooks/useDebounced.js";
|
|
7
7
|
import { get as xe, post as se } from "../lib/commands.js";
|
|
8
|
-
import { describeError as
|
|
9
|
-
import { liveQueryMeta as
|
|
10
|
-
import { useLiveFade as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
8
|
+
import { describeError as ht } from "../lib/error-message.js";
|
|
9
|
+
import { liveQueryMeta as xt } from "../lib/live-queries.js";
|
|
10
|
+
import { useLiveFade as ft } from "../lib/live-screen.js";
|
|
11
|
+
import { formatFieldNumber as fe, formatNumberAs as bt, toFiniteNumber as gt } from "../lib/number-format.js";
|
|
12
|
+
import { visiblePageWidgets as yt } from "../lib/page-widget-access.js";
|
|
13
|
+
import { explicitAllUrlParams as vt, initialFilterSelection as kt, filterSelectionToSearch as wt } from "../lib/query-filter-seed.js";
|
|
14
|
+
import { userErrorMessage as Ke } from "../lib/safe-error.js";
|
|
15
|
+
import { safeLinkKind as Nt } from "../lib/safe-href.js";
|
|
16
|
+
import { resolveSheetDef as St } from "../lib/sheet-def.js";
|
|
17
|
+
import { uniqueByValue as $t } from "../lib/unique-options.js";
|
|
18
|
+
import { useMyScopes as _t, matchScopeDimension as Ae, effectiveScopeSeedIds as Ct, translateScopeValues as qt } from "../lib/use-my-scopes.js";
|
|
19
|
+
import { titleCase as Q, formatRelative as Tt, formatNumber as Qe } from "../lib/utils.js";
|
|
20
|
+
import { LiveCacheStamp as jt } from "./CacheStamp.js";
|
|
21
|
+
import { RelationCombobox as Mt } from "./item-edit/RelationCombobox.js";
|
|
22
|
+
import { MatrixEditor as be } from "./MatrixEditor.js";
|
|
23
|
+
import { QueryStatStrip as Rt } from "./QueryStatStrip.js";
|
|
24
|
+
import { QueryTable as Wt } from "./QueryTable.js";
|
|
25
|
+
import { RecordDrilldownSheet as Pt } from "./RecordDrilldownSheet.js";
|
|
26
|
+
import { RecordGridEditor as Fe } from "./RecordGridEditor.js";
|
|
27
|
+
import { SheetHeaderBody as Lt } from "./SheetHeaderBody.js";
|
|
27
28
|
const me = 76;
|
|
28
29
|
function oe() {
|
|
29
30
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 p-3", children: [1, 2, 3].map((e) => /* @__PURE__ */ t(
|
|
@@ -35,102 +36,110 @@ function oe() {
|
|
|
35
36
|
)) });
|
|
36
37
|
}
|
|
37
38
|
function ie({ error: e, unresolved: r }) {
|
|
38
|
-
const n =
|
|
39
|
+
const n = Vt(e, r) ?? Ke(e, "Failed to load widget data");
|
|
39
40
|
return /* @__PURE__ */ t("div", { className: "flex h-full items-center justify-center p-3 text-[12px] text-amber-600 dark:text-amber-500", children: n });
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function Ot(e, r, n) {
|
|
42
43
|
if (e == null) return "—";
|
|
43
44
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
44
|
-
const
|
|
45
|
-
|
|
45
|
+
const a = gt(e);
|
|
46
|
+
if (a != null && n) return Ve(a, n);
|
|
47
|
+
if (typeof e == "number") return fe(e, { field: r }) || String(e);
|
|
48
|
+
const l = String(e);
|
|
49
|
+
return l.length > 80 ? `${l.slice(0, 80)}…` : l;
|
|
46
50
|
}
|
|
47
51
|
function pe(e, r) {
|
|
48
|
-
const n = [],
|
|
49
|
-
return e.split(
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
n.push(/* @__PURE__ */ t("strong", { children:
|
|
54
|
-
else if (
|
|
55
|
-
n.push(/* @__PURE__ */ t("em", { children:
|
|
56
|
-
else if (
|
|
52
|
+
const n = [], a = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g;
|
|
53
|
+
return e.split(a).forEach((l, c) => {
|
|
54
|
+
const m = `${r}-${c}`;
|
|
55
|
+
if (l)
|
|
56
|
+
if (l.startsWith("**") && l.endsWith("**"))
|
|
57
|
+
n.push(/* @__PURE__ */ t("strong", { children: l.slice(2, -2) }, m));
|
|
58
|
+
else if (l.startsWith("*") && l.endsWith("*") && l.length > 2)
|
|
59
|
+
n.push(/* @__PURE__ */ t("em", { children: l.slice(1, -1) }, m));
|
|
60
|
+
else if (l.startsWith("`") && l.endsWith("`"))
|
|
57
61
|
n.push(
|
|
58
62
|
/* @__PURE__ */ t(
|
|
59
63
|
"code",
|
|
60
64
|
{
|
|
61
65
|
className: "rounded bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] dark:bg-muted",
|
|
62
|
-
children:
|
|
66
|
+
children: l.slice(1, -1)
|
|
63
67
|
},
|
|
64
|
-
|
|
68
|
+
m
|
|
65
69
|
)
|
|
66
70
|
);
|
|
67
71
|
else {
|
|
68
|
-
const d =
|
|
69
|
-
d &&
|
|
70
|
-
/* @__PURE__ */ t("a", { href: d[2], className: "text-nvr-cyan underline-offset-2 hover:underline", children: d[1] },
|
|
71
|
-
) : n.push(
|
|
72
|
+
const d = l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
73
|
+
d && Nt(d[2]) !== null ? n.push(
|
|
74
|
+
/* @__PURE__ */ t("a", { href: d[2], className: "text-nvr-cyan underline-offset-2 hover:underline", children: d[1] }, m)
|
|
75
|
+
) : n.push(l);
|
|
72
76
|
}
|
|
73
77
|
}), n;
|
|
74
78
|
}
|
|
75
|
-
function
|
|
79
|
+
function At({ content: e }) {
|
|
76
80
|
const r = [];
|
|
77
|
-
let n = [],
|
|
78
|
-
const
|
|
81
|
+
let n = [], a = [], l = !1;
|
|
82
|
+
const c = (d) => {
|
|
79
83
|
n.length && (r.push(
|
|
80
84
|
/* @__PURE__ */ t("p", { className: "leading-relaxed", children: pe(n.join(" "), d) }, d)
|
|
81
85
|
), n = []);
|
|
82
|
-
},
|
|
83
|
-
if (!
|
|
84
|
-
const o =
|
|
86
|
+
}, m = (d) => {
|
|
87
|
+
if (!a.length) return;
|
|
88
|
+
const o = a.map((u, x) => /* @__PURE__ */ t("li", { children: pe(u, `${d}-${x}`) }, `${d}-${x}`));
|
|
85
89
|
r.push(
|
|
86
|
-
|
|
87
|
-
),
|
|
90
|
+
l ? /* @__PURE__ */ t("ol", { className: "list-decimal space-y-0.5 pl-5", children: o }, d) : /* @__PURE__ */ t("ul", { className: "list-disc space-y-0.5 pl-5", children: o }, d)
|
|
91
|
+
), a = [];
|
|
88
92
|
};
|
|
89
93
|
return e.split(`
|
|
90
94
|
`).forEach((d, o) => {
|
|
91
|
-
const
|
|
95
|
+
const u = `md-${o}`, x = d.match(/^(#{1,3})\s+(.*)$/), S = d.match(/^[-*]\s+(.*)$/), C = d.match(/^\d+\.\s+(.*)$/);
|
|
92
96
|
if (x) {
|
|
93
|
-
|
|
94
|
-
const
|
|
97
|
+
m(`${u}-fl`), c(`${u}-fp`);
|
|
98
|
+
const w = x[1].length, q = w === 1 ? "text-[17px] font-semibold" : w === 2 ? "text-[15px] font-semibold" : "text-[13.5px] font-semibold";
|
|
95
99
|
r.push(
|
|
96
|
-
/* @__PURE__ */ t("div", { className: `${q} text-slate-900 dark:text-slate-100`, children: pe(x[2], `${
|
|
100
|
+
/* @__PURE__ */ t("div", { className: `${q} text-slate-900 dark:text-slate-100`, children: pe(x[2], `${u}-h`) }, u)
|
|
97
101
|
);
|
|
98
|
-
} else if (
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
} else d.trim() === "" ? (
|
|
103
|
-
}),
|
|
102
|
+
} else if (S || C) {
|
|
103
|
+
c(`${u}-fp`);
|
|
104
|
+
const w = !!C;
|
|
105
|
+
a.length && l !== w && m(`${u}-fl`), l = w, a.push((S == null ? void 0 : S[1]) ?? (C == null ? void 0 : C[1]));
|
|
106
|
+
} else d.trim() === "" ? (m(`${u}-fl`), c(`${u}-fp`)) : (m(`${u}-fl`), n.push(d.trim()));
|
|
107
|
+
}), m("md-end-l"), c("md-end-p"), /* @__PURE__ */ t("div", { className: "space-y-2 p-4 text-[13px] text-slate-700 dark:text-slate-300", children: r });
|
|
104
108
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
108
|
-
return e ?
|
|
109
|
+
const Ue = at(null);
|
|
110
|
+
function ge() {
|
|
111
|
+
const e = st(Ue);
|
|
112
|
+
return e ? xt(e) : void 0;
|
|
109
113
|
}
|
|
110
|
-
const
|
|
111
|
-
function
|
|
112
|
-
|
|
114
|
+
const Ft = /* @__PURE__ */ new Set(["page-renderer-query", "page-renderer-widget-data"]);
|
|
115
|
+
function Ve(e, r) {
|
|
116
|
+
return bt(e, r.kind, {
|
|
117
|
+
options: { currency: r.currency, precision: r.decimals, unit: r.unit }
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function ye(e, r, n) {
|
|
121
|
+
const a = re();
|
|
113
122
|
return Y({
|
|
114
123
|
queryKey: ["page-renderer-widget-data", e, r.id],
|
|
115
|
-
queryFn: () =>
|
|
124
|
+
queryFn: () => a.request(se(`/pages/${e}/widget-data`, { widget_id: r.id })).then((l) => l.data),
|
|
116
125
|
enabled: n,
|
|
117
126
|
retry: !1,
|
|
118
127
|
staleTime: 3e4,
|
|
119
|
-
meta:
|
|
128
|
+
meta: ge()
|
|
120
129
|
});
|
|
121
130
|
}
|
|
122
|
-
function
|
|
123
|
-
var
|
|
124
|
-
const n = r.config ?? {}, { data:
|
|
131
|
+
function Et({ slug: e, widget: r }) {
|
|
132
|
+
var u;
|
|
133
|
+
const n = r.config ?? {}, { data: a, isLoading: l, error: c } = ye(e, r, !!n.collection), m = mt();
|
|
125
134
|
if (!n.collection)
|
|
126
135
|
return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
129
|
-
const d = (
|
|
136
|
+
if (l) return /* @__PURE__ */ t(oe, {});
|
|
137
|
+
if (c) return /* @__PURE__ */ t(ie, { error: c });
|
|
138
|
+
const d = (a == null ? void 0 : a.rows) ?? [];
|
|
130
139
|
if (!d.length) return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "No records" });
|
|
131
|
-
const o = (
|
|
132
|
-
const
|
|
133
|
-
return
|
|
140
|
+
const o = (u = n.columns) != null && u.length ? n.columns : Object.keys(d[0]).filter((x) => {
|
|
141
|
+
const S = d[0][x];
|
|
142
|
+
return S === null || ["string", "number", "boolean"].includes(typeof S);
|
|
134
143
|
}).slice(0, 5);
|
|
135
144
|
return /* @__PURE__ */ t("div", { className: "h-full overflow-auto", children: /* @__PURE__ */ h("table", { className: "w-full text-[12px]", children: [
|
|
136
145
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 dark:border-border", children: o.map((x) => /* @__PURE__ */ t(
|
|
@@ -141,53 +150,56 @@ function Lt({ slug: e, widget: r }) {
|
|
|
141
150
|
},
|
|
142
151
|
x
|
|
143
152
|
)) }) }),
|
|
144
|
-
/* @__PURE__ */ t("tbody", { children: d.map((x,
|
|
153
|
+
/* @__PURE__ */ t("tbody", { children: d.map((x, S) => /* @__PURE__ */ t(
|
|
145
154
|
"tr",
|
|
146
155
|
{
|
|
147
|
-
onClick: x.id != null ? () =>
|
|
156
|
+
onClick: x.id != null ? () => m.open({ collection: n.collection, itemId: String(x.id) }) : void 0,
|
|
148
157
|
className: `border-b border-slate-50 last:border-0 dark:border-border/50 ${x.id != null ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted/40" : ""}`,
|
|
149
|
-
children: o.map((C) =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
children: o.map((C) => {
|
|
159
|
+
var w;
|
|
160
|
+
return /* @__PURE__ */ t(
|
|
161
|
+
"td",
|
|
162
|
+
{
|
|
163
|
+
className: "whitespace-nowrap px-3 py-1.5 text-slate-700 dark:text-slate-300",
|
|
164
|
+
children: Ot(x[C], C, (w = a == null ? void 0 : a.numbers) == null ? void 0 : w[C])
|
|
165
|
+
},
|
|
166
|
+
C
|
|
167
|
+
);
|
|
168
|
+
})
|
|
157
169
|
},
|
|
158
|
-
x.id != null ? `${x.id}-${
|
|
170
|
+
x.id != null ? `${x.id}-${S}` : S
|
|
159
171
|
)) })
|
|
160
172
|
] }) });
|
|
161
173
|
}
|
|
162
|
-
function
|
|
163
|
-
const n = r.config ?? {}, { data:
|
|
164
|
-
return n.collection ?
|
|
165
|
-
|
|
174
|
+
function Bt({ slug: e, widget: r }) {
|
|
175
|
+
const n = r.config ?? {}, { data: a, isLoading: l, error: c } = ye(e, r, !!n.collection);
|
|
176
|
+
return n.collection ? c ? /* @__PURE__ */ t(ie, { error: c }) : /* @__PURE__ */ h("div", { className: "flex h-full flex-col items-start justify-center px-4", children: [
|
|
177
|
+
l ? /* @__PURE__ */ t("div", { className: "h-9 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("span", { className: "text-[32px] font-semibold leading-none tracking-tight text-slate-900 dark:text-slate-100", children: (a == null ? void 0 : a.value) != null ? a.number ? Ve(Number(a.value), a.number) : Qe(Number(a.value)) : "—" }),
|
|
166
178
|
/* @__PURE__ */ t("span", { className: "mt-1.5 text-[12px] text-slate-400", children: n.label || `${n.aggregate ?? "count"} of ${n.collection}` })
|
|
167
179
|
] }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
168
180
|
}
|
|
169
|
-
function
|
|
170
|
-
const { data: n, isLoading:
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
174
|
-
return
|
|
181
|
+
function Dt({ slug: e, widget: r }) {
|
|
182
|
+
const { data: n, isLoading: a, error: l } = ye(e, r, !0);
|
|
183
|
+
if (a) return /* @__PURE__ */ t(oe, {});
|
|
184
|
+
if (l) return /* @__PURE__ */ t(ie, { error: l });
|
|
185
|
+
const c = (n == null ? void 0 : n.rows) ?? [];
|
|
186
|
+
return c.length ? /* @__PURE__ */ t("div", { className: "h-full overflow-auto px-3 py-1.5", children: c.map((m) => /* @__PURE__ */ h(
|
|
175
187
|
"div",
|
|
176
188
|
{
|
|
177
189
|
className: "flex items-center gap-2 border-b border-slate-50 py-1.5 text-[12px] last:border-0 dark:border-border/50",
|
|
178
190
|
children: [
|
|
179
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-300", children:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
191
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-300", children: m.action }),
|
|
192
|
+
m.collection && /* @__PURE__ */ h("span", { className: "truncate font-mono text-[11px] text-slate-400", children: [
|
|
193
|
+
m.collection,
|
|
194
|
+
m.item ? ` · ${m.item}` : ""
|
|
183
195
|
] }),
|
|
184
|
-
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children:
|
|
196
|
+
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children: Tt(m.timestamp) })
|
|
185
197
|
]
|
|
186
198
|
},
|
|
187
|
-
|
|
199
|
+
m.id
|
|
188
200
|
)) }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "No activity" });
|
|
189
201
|
}
|
|
190
|
-
function
|
|
202
|
+
function It({ widget: e }) {
|
|
191
203
|
var n;
|
|
192
204
|
const r = String(((n = e.config) == null ? void 0 : n.url) ?? "");
|
|
193
205
|
return r ? /^https?:\/\//i.test(r) ? /* @__PURE__ */ t(
|
|
@@ -200,123 +212,123 @@ function Ft({ widget: e }) {
|
|
|
200
212
|
}
|
|
201
213
|
) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-amber-600", children: "URL must start with http(s)://" }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Set an iframe URL" });
|
|
202
214
|
}
|
|
203
|
-
function
|
|
215
|
+
function Ge({
|
|
204
216
|
config: e,
|
|
205
217
|
initialScope: r,
|
|
206
218
|
width: n,
|
|
207
|
-
title:
|
|
208
|
-
onClose:
|
|
219
|
+
title: a,
|
|
220
|
+
onClose: l
|
|
209
221
|
}) {
|
|
210
|
-
const
|
|
211
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
222
|
+
const c = typeof n == "number" ? `${n}px` : n ?? "85%";
|
|
223
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: l, children: /* @__PURE__ */ h(
|
|
212
224
|
"div",
|
|
213
225
|
{
|
|
214
226
|
"data-page-drawer": !0,
|
|
215
227
|
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-white shadow-2xl dark:border-border dark:bg-background",
|
|
216
|
-
style: { width:
|
|
217
|
-
onClick: (
|
|
228
|
+
style: { width: c, maxWidth: "96%" },
|
|
229
|
+
onClick: (m) => m.stopPropagation(),
|
|
218
230
|
children: [
|
|
219
231
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
220
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
232
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: a ?? e.title ?? "Manage" }),
|
|
221
233
|
/* @__PURE__ */ t(
|
|
222
234
|
"button",
|
|
223
235
|
{
|
|
224
236
|
type: "button",
|
|
225
|
-
onClick:
|
|
237
|
+
onClick: l,
|
|
226
238
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
227
239
|
children: "Close"
|
|
228
240
|
}
|
|
229
241
|
)
|
|
230
242
|
] }),
|
|
231
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
243
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(be, { config: e, initialScope: r }) })
|
|
232
244
|
]
|
|
233
245
|
}
|
|
234
246
|
) });
|
|
235
247
|
}
|
|
236
|
-
function
|
|
237
|
-
const r = e.config ?? {}, [n,
|
|
248
|
+
function zt({ widget: e }) {
|
|
249
|
+
const r = e.config ?? {}, [n, a] = j(!1);
|
|
238
250
|
return !r.target_collection || !r.option_collection || !r.key_field || !r.value_field ? /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Matrix editor not configured" }) : r.display === "drawer" ? /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
239
251
|
/* @__PURE__ */ t(
|
|
240
252
|
"button",
|
|
241
253
|
{
|
|
242
254
|
type: "button",
|
|
243
|
-
onClick: () =>
|
|
255
|
+
onClick: () => a(!0),
|
|
244
256
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
245
257
|
children: r.button_label ?? r.title ?? "Manage"
|
|
246
258
|
}
|
|
247
259
|
),
|
|
248
260
|
n && /* @__PURE__ */ t(
|
|
249
|
-
|
|
261
|
+
Ge,
|
|
250
262
|
{
|
|
251
263
|
config: r,
|
|
252
264
|
width: r.sheet_width,
|
|
253
|
-
onClose: () =>
|
|
265
|
+
onClose: () => a(!1)
|
|
254
266
|
}
|
|
255
267
|
)
|
|
256
|
-
] }) : /* @__PURE__ */ t(
|
|
268
|
+
] }) : /* @__PURE__ */ t(be, { config: r });
|
|
257
269
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
270
|
+
function Kt(e) {
|
|
271
|
+
return kt(
|
|
260
272
|
e,
|
|
261
273
|
typeof window > "u" ? "" : window.location.search
|
|
262
274
|
);
|
|
263
275
|
}
|
|
264
|
-
function
|
|
265
|
-
const n = [...new Set(e.map((
|
|
276
|
+
function Ee(e, r) {
|
|
277
|
+
const n = [...new Set(e.map((a) => a[r]).filter((a) => a != null && a !== ""))];
|
|
266
278
|
return n.length ? n.map(String).join(",") : void 0;
|
|
267
279
|
}
|
|
268
|
-
function
|
|
280
|
+
function Je(e, r, n, a, l, c, m) {
|
|
269
281
|
if (typeof e != "string") return e;
|
|
270
282
|
if (e.startsWith("$row.")) {
|
|
271
283
|
const d = e.slice(5);
|
|
272
|
-
return !r &&
|
|
284
|
+
return !r && m ? Ee(m, d) : r == null ? void 0 : r[d];
|
|
273
285
|
}
|
|
274
|
-
if (e.startsWith("$rows.")) return
|
|
275
|
-
if (e.startsWith("$param.")) return
|
|
286
|
+
if (e.startsWith("$rows.")) return Ee(n, e.slice(6));
|
|
287
|
+
if (e.startsWith("$param.")) return a[e.slice(7)];
|
|
276
288
|
if (e.startsWith("$filters.")) {
|
|
277
|
-
const d = e.slice(9), o =
|
|
278
|
-
return
|
|
289
|
+
const d = e.slice(9), o = c == null ? void 0 : c.find((x) => x.param === d), u = l[d] ?? [];
|
|
290
|
+
return u.length ? u.map((x) => String(x[(o == null ? void 0 : o.value_field) ?? "id"] ?? "")).join(",") : void 0;
|
|
279
291
|
}
|
|
280
292
|
return e;
|
|
281
293
|
}
|
|
282
|
-
function
|
|
294
|
+
function Qt(e, r, n, a, l, c, m) {
|
|
283
295
|
const d = {}, o = [];
|
|
284
|
-
for (const [
|
|
285
|
-
const
|
|
286
|
-
|
|
296
|
+
for (const [u, x] of Object.entries(e.params ?? {})) {
|
|
297
|
+
const S = Je(x, r, n, a, l, c, m);
|
|
298
|
+
S !== void 0 ? d[u] = S : typeof x == "string" && (x.startsWith("$row.") || x.startsWith("$rows.")) && o.push(u);
|
|
287
299
|
}
|
|
288
300
|
return { ...e, params: d, ...o.length ? { unresolved_params: o } : {} };
|
|
289
301
|
}
|
|
290
|
-
function
|
|
291
|
-
var
|
|
292
|
-
let n = (
|
|
302
|
+
function Ut(e, r) {
|
|
303
|
+
var l, c;
|
|
304
|
+
let n = (l = e.row_noun) == null ? void 0 : l.trim();
|
|
293
305
|
if (!n) {
|
|
294
|
-
const
|
|
295
|
-
n =
|
|
306
|
+
const m = (c = /\{\{\s*([a-z]+)_[\w.]*\s*\}\}/i.exec(e.title ?? "")) == null ? void 0 : c[1];
|
|
307
|
+
n = m ? `${m.toLowerCase()}s` : "rows";
|
|
296
308
|
}
|
|
297
|
-
const
|
|
298
|
-
return `Total of ${r.toLocaleString("en-US")} ${
|
|
309
|
+
const a = r === 1 && n.endsWith("s") ? n.slice(0, -1) : n;
|
|
310
|
+
return `Total of ${r.toLocaleString("en-US")} ${a}`;
|
|
299
311
|
}
|
|
300
|
-
function
|
|
301
|
-
const n =
|
|
302
|
-
if (!
|
|
303
|
-
const
|
|
304
|
-
return r != null && r.includes(
|
|
312
|
+
function Vt(e, r) {
|
|
313
|
+
const n = ht(e), a = [n.title, n.technical ?? ""].join(" "), l = /Missing required parameter:\s*([\w]+)/i.exec(a);
|
|
314
|
+
if (!l) return null;
|
|
315
|
+
const c = Q(l[1]).toLowerCase();
|
|
316
|
+
return r != null && r.includes(l[1]) ? `Nothing to show: the row you opened has no ${c}.` : `Choose ${c} to see this view.`;
|
|
305
317
|
}
|
|
306
|
-
function
|
|
318
|
+
function Gt({
|
|
307
319
|
config: e,
|
|
308
320
|
stats: r,
|
|
309
321
|
asOf: n,
|
|
310
|
-
note:
|
|
322
|
+
note: a
|
|
311
323
|
}) {
|
|
312
|
-
const
|
|
313
|
-
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(
|
|
314
|
-
queryFn: () =>
|
|
315
|
-
se(`/custom-queries/${e.query_slug}/execute`, { params:
|
|
324
|
+
const l = re(), c = ge(), m = e.params ?? {}, { data: d, isPending: o, isError: u } = Y({
|
|
325
|
+
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(m)],
|
|
326
|
+
queryFn: () => l.request(
|
|
327
|
+
se(`/custom-queries/${e.query_slug}/execute`, { params: m })
|
|
316
328
|
),
|
|
317
329
|
enabled: !!e.query_slug,
|
|
318
330
|
staleTime: 6e4,
|
|
319
|
-
meta:
|
|
331
|
+
meta: c
|
|
320
332
|
});
|
|
321
333
|
return /* @__PURE__ */ t(
|
|
322
334
|
"div",
|
|
@@ -324,64 +336,64 @@ function Kt({
|
|
|
324
336
|
className: "shrink-0 border-b border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card",
|
|
325
337
|
"data-sheet-header": !0,
|
|
326
338
|
children: /* @__PURE__ */ t(
|
|
327
|
-
|
|
339
|
+
Lt,
|
|
328
340
|
{
|
|
329
341
|
stats: r,
|
|
330
342
|
rows: (d == null ? void 0 : d.data) ?? [],
|
|
331
|
-
params:
|
|
332
|
-
loading: o && !
|
|
333
|
-
error:
|
|
343
|
+
params: m,
|
|
344
|
+
loading: o && !u,
|
|
345
|
+
error: u,
|
|
334
346
|
asOf: n,
|
|
335
|
-
note:
|
|
347
|
+
note: a
|
|
336
348
|
}
|
|
337
349
|
)
|
|
338
350
|
}
|
|
339
351
|
);
|
|
340
352
|
}
|
|
341
|
-
function
|
|
353
|
+
function Jt({
|
|
342
354
|
def: e,
|
|
343
355
|
row: r,
|
|
344
356
|
totalCount: n,
|
|
345
|
-
onClose:
|
|
357
|
+
onClose: a
|
|
346
358
|
}) {
|
|
347
|
-
const [
|
|
348
|
-
const
|
|
349
|
-
return
|
|
350
|
-
}) : "Details", d = typeof e.width == "number" ? `${e.width}px` : e.width ?? "90%", o = e.resolvedTabs[
|
|
351
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
359
|
+
const [l, c] = j(e.initialTab ?? 0), m = !r && n != null ? Ut(e, n) : e.title ? e.title.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (u, x) => {
|
|
360
|
+
const S = r == null ? void 0 : r[x];
|
|
361
|
+
return S == null ? "" : String(S);
|
|
362
|
+
}) : "Details", d = typeof e.width == "number" ? `${e.width}px` : e.width ?? "90%", o = e.resolvedTabs[l];
|
|
363
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: a, children: /* @__PURE__ */ h(
|
|
352
364
|
"div",
|
|
353
365
|
{
|
|
354
366
|
"data-page-drawer": !0,
|
|
355
367
|
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-slate-50 shadow-2xl dark:border-border dark:bg-background",
|
|
356
368
|
style: { width: d, maxWidth: "96%" },
|
|
357
|
-
onClick: (
|
|
369
|
+
onClick: (u) => u.stopPropagation(),
|
|
358
370
|
children: [
|
|
359
371
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 bg-white px-4 py-2.5 dark:border-border dark:bg-card", children: [
|
|
360
372
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
|
|
361
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
362
|
-
e.resolvedTabs.length > 1 && /* @__PURE__ */ t("div", { className: "flex gap-1", children: e.resolvedTabs.map((
|
|
373
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: m }),
|
|
374
|
+
e.resolvedTabs.length > 1 && /* @__PURE__ */ t("div", { className: "flex gap-1", children: e.resolvedTabs.map((u, x) => /* @__PURE__ */ t(
|
|
363
375
|
"button",
|
|
364
376
|
{
|
|
365
377
|
type: "button",
|
|
366
|
-
onClick: () =>
|
|
367
|
-
className: `rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ${x ===
|
|
368
|
-
children:
|
|
378
|
+
onClick: () => c(x),
|
|
379
|
+
className: `rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ${x === l ? "bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,
|
|
380
|
+
children: u.label
|
|
369
381
|
},
|
|
370
|
-
|
|
382
|
+
u.label
|
|
371
383
|
)) })
|
|
372
384
|
] }),
|
|
373
385
|
/* @__PURE__ */ t(
|
|
374
386
|
"button",
|
|
375
387
|
{
|
|
376
388
|
type: "button",
|
|
377
|
-
onClick:
|
|
389
|
+
onClick: a,
|
|
378
390
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
379
391
|
children: "Close"
|
|
380
392
|
}
|
|
381
393
|
)
|
|
382
394
|
] }),
|
|
383
395
|
e.header && /* @__PURE__ */ t(
|
|
384
|
-
|
|
396
|
+
Gt,
|
|
385
397
|
{
|
|
386
398
|
config: e.header.config,
|
|
387
399
|
stats: e.header.stats,
|
|
@@ -390,13 +402,13 @@ function Qt({
|
|
|
390
402
|
}
|
|
391
403
|
),
|
|
392
404
|
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: o != null && o.matrix ? /* @__PURE__ */ t(
|
|
393
|
-
|
|
405
|
+
be,
|
|
394
406
|
{
|
|
395
407
|
config: o.matrix.config,
|
|
396
408
|
initialScope: o.matrix.initialScope,
|
|
397
409
|
lockScope: !0
|
|
398
410
|
},
|
|
399
|
-
|
|
411
|
+
l
|
|
400
412
|
) : o != null && o.config ? /* @__PURE__ */ h(H, { children: [
|
|
401
413
|
o.note && /* @__PURE__ */ t(
|
|
402
414
|
"p",
|
|
@@ -406,72 +418,72 @@ function Qt({
|
|
|
406
418
|
children: o.note
|
|
407
419
|
}
|
|
408
420
|
),
|
|
409
|
-
/* @__PURE__ */ t(
|
|
421
|
+
/* @__PURE__ */ t(He, { config: o.config }, l)
|
|
410
422
|
] }) : /* @__PURE__ */ t("p", { className: "p-4 text-[12px] text-slate-400", children: "Sheet not configured" }) })
|
|
411
423
|
]
|
|
412
424
|
}
|
|
413
425
|
) });
|
|
414
426
|
}
|
|
415
|
-
function
|
|
427
|
+
function Ht(e, r, n, a) {
|
|
416
428
|
if (!e) return;
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
if (!
|
|
420
|
-
const x =
|
|
421
|
-
if (
|
|
422
|
-
const C =
|
|
423
|
-
return
|
|
424
|
-
},
|
|
425
|
-
Object.entries(o).map(([
|
|
426
|
-
) : o,
|
|
427
|
-
return Array.isArray(d._and) && (d._and = d._and.filter((o) => !
|
|
429
|
+
const l = (o) => {
|
|
430
|
+
const u = /^\$filters\.(\w+)(?:\.(\w+))?$/.exec(o);
|
|
431
|
+
if (!u) return;
|
|
432
|
+
const x = a == null ? void 0 : a.find((w) => w.param === u[1]), S = (n == null ? void 0 : n[u[1]]) ?? [];
|
|
433
|
+
if (S.length === 0) return;
|
|
434
|
+
const C = u[2] ?? (x == null ? void 0 : x.value_field) ?? "id";
|
|
435
|
+
return S.map((w) => w[C]);
|
|
436
|
+
}, c = (o) => typeof o == "string" && o.startsWith("$row.") ? r[o.slice(5)] : typeof o == "string" && o.startsWith("$filters.") ? l(o) : Array.isArray(o) ? o.map(c) : o && typeof o == "object" ? Object.fromEntries(
|
|
437
|
+
Object.entries(o).map(([u, x]) => [u, c(x)])
|
|
438
|
+
) : o, m = (o) => o === void 0 ? !0 : Array.isArray(o) ? o.some(m) : o && typeof o == "object" ? Object.values(o).some(m) : !1, d = c(e);
|
|
439
|
+
return Array.isArray(d._and) && (d._and = d._and.filter((o) => !m(o))), m(d) ? void 0 : d;
|
|
428
440
|
}
|
|
429
|
-
const
|
|
430
|
-
function
|
|
441
|
+
const Yt = 400, Xt = 2500;
|
|
442
|
+
function Be(e, r) {
|
|
431
443
|
return e.map((n) => String(n[r] ?? "")).sort().join("\0");
|
|
432
444
|
}
|
|
433
|
-
function
|
|
445
|
+
function Zt({
|
|
434
446
|
filter: e,
|
|
435
447
|
selected: r,
|
|
436
448
|
onChange: n,
|
|
437
|
-
allowedIds:
|
|
438
|
-
scopeDefault:
|
|
439
|
-
onOpenChange:
|
|
449
|
+
allowedIds: a,
|
|
450
|
+
scopeDefault: l,
|
|
451
|
+
onOpenChange: c
|
|
440
452
|
}) {
|
|
441
|
-
const
|
|
442
|
-
|
|
453
|
+
const m = re(), [d, o] = j(!1), u = ee(c);
|
|
454
|
+
u.current = c, te(() => {
|
|
443
455
|
var f;
|
|
444
|
-
(f =
|
|
456
|
+
(f = u.current) == null || f.call(u, d);
|
|
445
457
|
}, [d]);
|
|
446
|
-
const [x,
|
|
458
|
+
const [x, S] = j(""), C = ee(null), w = e.value_field ?? "id", q = e.label_field ?? w, v = e.secondary_field, T = [.../* @__PURE__ */ new Set(["id", w, q, v ?? ""])].filter(Boolean).join(","), { data: W } = Y({
|
|
447
459
|
queryKey: [
|
|
448
460
|
"page-renderer-filter",
|
|
449
461
|
e.collection,
|
|
450
|
-
|
|
462
|
+
w,
|
|
451
463
|
q,
|
|
452
464
|
v ?? "",
|
|
453
465
|
e.sort
|
|
454
466
|
],
|
|
455
|
-
queryFn: () =>
|
|
467
|
+
queryFn: () => m.request(
|
|
456
468
|
xe(`/items/${e.collection}`, {
|
|
457
|
-
fields:
|
|
469
|
+
fields: T,
|
|
458
470
|
limit: e.limit ?? 500,
|
|
459
471
|
...e.sort ? { sort: e.sort } : {}
|
|
460
472
|
})
|
|
461
473
|
).then((f) => {
|
|
462
|
-
const
|
|
463
|
-
return { rows:
|
|
474
|
+
const s = f.data ?? [], g = typeof f.total == "number" && f.total > s.length || s.length >= (e.limit ?? 500);
|
|
475
|
+
return { rows: s, more: g };
|
|
464
476
|
}),
|
|
465
477
|
staleTime: 6e4
|
|
466
|
-
}), U = (W == null ? void 0 : W.rows) ?? [], L = (W == null ? void 0 : W.more) === !0, $ = x.trim(), R =
|
|
467
|
-
queryKey: ["page-renderer-filter-search", e.collection,
|
|
478
|
+
}), U = (W == null ? void 0 : W.rows) ?? [], L = (W == null ? void 0 : W.more) === !0, $ = x.trim(), R = ot($), { data: I = [] } = Y({
|
|
479
|
+
queryKey: ["page-renderer-filter-search", e.collection, T, R],
|
|
468
480
|
enabled: L && R.length > 0,
|
|
469
|
-
queryFn: () =>
|
|
481
|
+
queryFn: () => m.request(
|
|
470
482
|
xe(`/items/${e.collection}`, {
|
|
471
|
-
fields:
|
|
483
|
+
fields: T,
|
|
472
484
|
limit: 100,
|
|
473
485
|
search: R,
|
|
474
|
-
search_fields: [.../* @__PURE__ */ new Set([
|
|
486
|
+
search_fields: [.../* @__PURE__ */ new Set([w, q, v ?? ""])].filter(Boolean).join(","),
|
|
475
487
|
...e.sort ? { sort: e.sort } : {}
|
|
476
488
|
})
|
|
477
489
|
).then((f) => f.data ?? []),
|
|
@@ -479,21 +491,21 @@ function Jt({
|
|
|
479
491
|
});
|
|
480
492
|
te(() => {
|
|
481
493
|
if (!d) return;
|
|
482
|
-
const f = (
|
|
483
|
-
C.current && !C.current.contains(
|
|
494
|
+
const f = (s) => {
|
|
495
|
+
C.current && !C.current.contains(s.target) && o(!1);
|
|
484
496
|
};
|
|
485
497
|
return window.addEventListener("mousedown", f), () => window.removeEventListener("mousedown", f);
|
|
486
498
|
}, [d]);
|
|
487
|
-
const K = e.label ?? Q(e.param), z = L && $ ? [...r, ...I] : U, E =
|
|
488
|
-
|
|
489
|
-
(f) => String(f[
|
|
490
|
-
), O = (f) => [f[
|
|
499
|
+
const K = e.label ?? Q(e.param), z = L && $ ? [...r, ...I] : U, E = $t(
|
|
500
|
+
a != null && a.length ? z.filter((f) => a.some((s) => String(s) === String(f.id))) : z,
|
|
501
|
+
(f) => String(f[w] ?? "")
|
|
502
|
+
), O = (f) => [f[w], f[q], v ? f[v] : null].filter((s) => s != null && s !== "").join(" ").toLowerCase(), V = E.filter(
|
|
491
503
|
(f) => $ ? O(f).includes($.toLowerCase()) : !0
|
|
492
|
-
), G = L && $.length > 0 && R !== $, B =
|
|
504
|
+
), G = L && $.length > 0 && R !== $, B = a != null && a.length ? {
|
|
493
505
|
label: "restricted",
|
|
494
506
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
495
|
-
title: `Options limited to your restricted ${K} scope${
|
|
496
|
-
} :
|
|
507
|
+
title: `Options limited to your restricted ${K} scope${l ? "; selection seeded from your defaults" : ""}`
|
|
508
|
+
} : l && r.length > 0 ? {
|
|
497
509
|
label: "your default",
|
|
498
510
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
499
511
|
title: `Pre-selected from your default ${K} scope — adjust freely`
|
|
@@ -515,7 +527,7 @@ function Jt({
|
|
|
515
527
|
children: B.label
|
|
516
528
|
}
|
|
517
529
|
),
|
|
518
|
-
/* @__PURE__ */ t("span", { className: "text-slate-400", children: r.length === 0 ? "All" : r.length === 1 ? String(r[0][q] ?? r[0][
|
|
530
|
+
/* @__PURE__ */ t("span", { className: "text-slate-400", children: r.length === 0 ? "All" : r.length === 1 ? String(r[0][q] ?? r[0][w] ?? "") : `${r.length} selected` }),
|
|
519
531
|
/* @__PURE__ */ t("span", { className: "text-slate-400", children: "⌃" })
|
|
520
532
|
]
|
|
521
533
|
}
|
|
@@ -525,7 +537,7 @@ function Jt({
|
|
|
525
537
|
"input",
|
|
526
538
|
{
|
|
527
539
|
value: x,
|
|
528
|
-
onChange: (f) =>
|
|
540
|
+
onChange: (f) => S(f.target.value),
|
|
529
541
|
placeholder: "Search…",
|
|
530
542
|
className: "mb-1 h-7 w-full rounded border border-slate-200 bg-white px-2 text-[12px] outline-none dark:border-border dark:bg-background"
|
|
531
543
|
}
|
|
@@ -541,7 +553,7 @@ function Jt({
|
|
|
541
553
|
}
|
|
542
554
|
),
|
|
543
555
|
V.map((f) => {
|
|
544
|
-
const
|
|
556
|
+
const s = String(f[w] ?? ""), g = r.some((P) => String(P[w] ?? "") === s);
|
|
545
557
|
return /* @__PURE__ */ h(
|
|
546
558
|
"button",
|
|
547
559
|
{
|
|
@@ -552,17 +564,17 @@ function Jt({
|
|
|
552
564
|
return;
|
|
553
565
|
}
|
|
554
566
|
n(
|
|
555
|
-
g ? r.filter((P) => String(P[
|
|
567
|
+
g ? r.filter((P) => String(P[w] ?? "") !== s) : [...r, f]
|
|
556
568
|
);
|
|
557
569
|
},
|
|
558
570
|
className: "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
|
|
559
571
|
children: [
|
|
560
572
|
/* @__PURE__ */ t("span", { className: `w-3.5 shrink-0 text-nvr-cyan ${g ? "" : "invisible"}`, children: "✓" }),
|
|
561
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: String(f[q] ??
|
|
573
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: String(f[q] ?? s) }),
|
|
562
574
|
v && f[v] != null && f[v] !== "" && /* @__PURE__ */ t("span", { className: "min-w-0 truncate text-[11px] text-slate-400", children: String(f[v]) })
|
|
563
575
|
]
|
|
564
576
|
},
|
|
565
|
-
|
|
577
|
+
s
|
|
566
578
|
);
|
|
567
579
|
}),
|
|
568
580
|
V.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-1.5 text-[12px] text-slate-400", "aria-live": "polite", children: G ? "Searching…" : $ ? `No matches for “${$}”` : "No options" }),
|
|
@@ -575,17 +587,17 @@ function Jt({
|
|
|
575
587
|
] })
|
|
576
588
|
] });
|
|
577
589
|
}
|
|
578
|
-
function
|
|
579
|
-
return /* @__PURE__ */ t(
|
|
590
|
+
function er({ widget: e }) {
|
|
591
|
+
return /* @__PURE__ */ t(He, { config: e.config ?? {} });
|
|
580
592
|
}
|
|
581
|
-
function
|
|
582
|
-
const r = e.config ?? {}, [n,
|
|
593
|
+
function tr({ widget: e }) {
|
|
594
|
+
const r = e.config ?? {}, [n, a] = j(!1);
|
|
583
595
|
return r.collection ? r.display === "drawer" ? /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
584
596
|
/* @__PURE__ */ t(
|
|
585
597
|
"button",
|
|
586
598
|
{
|
|
587
599
|
type: "button",
|
|
588
|
-
onClick: () =>
|
|
600
|
+
onClick: () => a(!0),
|
|
589
601
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
590
602
|
children: r.button_label ?? r.title ?? "Manage"
|
|
591
603
|
}
|
|
@@ -594,7 +606,7 @@ function Yt({ widget: e }) {
|
|
|
594
606
|
"div",
|
|
595
607
|
{
|
|
596
608
|
className: "fixed inset-0 z-50 flex justify-end bg-black/30",
|
|
597
|
-
onClick: () =>
|
|
609
|
+
onClick: () => a(!1),
|
|
598
610
|
children: /* @__PURE__ */ h(
|
|
599
611
|
"div",
|
|
600
612
|
{
|
|
@@ -604,7 +616,7 @@ function Yt({ widget: e }) {
|
|
|
604
616
|
width: typeof r.sheet_width == "number" ? `${r.sheet_width}px` : r.sheet_width ?? "92%",
|
|
605
617
|
maxWidth: "96%"
|
|
606
618
|
},
|
|
607
|
-
onClick: (
|
|
619
|
+
onClick: (l) => l.stopPropagation(),
|
|
608
620
|
children: [
|
|
609
621
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
610
622
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: r.button_label ?? r.title ?? "Manage" }),
|
|
@@ -612,25 +624,25 @@ function Yt({ widget: e }) {
|
|
|
612
624
|
"button",
|
|
613
625
|
{
|
|
614
626
|
type: "button",
|
|
615
|
-
onClick: () =>
|
|
627
|
+
onClick: () => a(!1),
|
|
616
628
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
617
629
|
children: "Close"
|
|
618
630
|
}
|
|
619
631
|
)
|
|
620
632
|
] }),
|
|
621
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
633
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(Fe, { config: r }) })
|
|
622
634
|
]
|
|
623
635
|
}
|
|
624
636
|
)
|
|
625
637
|
}
|
|
626
638
|
)
|
|
627
|
-
] }) : /* @__PURE__ */ t(
|
|
639
|
+
] }) : /* @__PURE__ */ t(Fe, { config: r }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Configure the record grid (collection)" });
|
|
628
640
|
}
|
|
629
|
-
function
|
|
641
|
+
function rr({
|
|
630
642
|
cfg: e
|
|
631
643
|
}) {
|
|
632
|
-
const [r, n] =
|
|
633
|
-
return delete
|
|
644
|
+
const [r, n] = j(!1), a = { ...e };
|
|
645
|
+
return delete a.display, /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
634
646
|
/* @__PURE__ */ t(
|
|
635
647
|
"button",
|
|
636
648
|
{
|
|
@@ -654,7 +666,7 @@ function Xt({
|
|
|
654
666
|
width: typeof e.sheet_width == "number" ? `${e.sheet_width}px` : e.sheet_width ?? "90%",
|
|
655
667
|
maxWidth: "96%"
|
|
656
668
|
},
|
|
657
|
-
onClick: (
|
|
669
|
+
onClick: (l) => l.stopPropagation(),
|
|
658
670
|
children: [
|
|
659
671
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 bg-white px-4 py-2.5 dark:border-border dark:bg-card", children: [
|
|
660
672
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: e.button_label ?? e.label ?? "View" }),
|
|
@@ -668,7 +680,7 @@ function Xt({
|
|
|
668
680
|
}
|
|
669
681
|
)
|
|
670
682
|
] }),
|
|
671
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
683
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(Ye, { config: a }) })
|
|
672
684
|
]
|
|
673
685
|
}
|
|
674
686
|
)
|
|
@@ -676,40 +688,40 @@ function Xt({
|
|
|
676
688
|
)
|
|
677
689
|
] });
|
|
678
690
|
}
|
|
679
|
-
function
|
|
680
|
-
return e.display === "drawer" ? /* @__PURE__ */ t(
|
|
691
|
+
function He({ config: e }) {
|
|
692
|
+
return e.display === "drawer" ? /* @__PURE__ */ t(rr, { cfg: e }) : /* @__PURE__ */ t(Ye, { config: e });
|
|
681
693
|
}
|
|
682
|
-
function
|
|
683
|
-
var
|
|
684
|
-
const r = re(), n =
|
|
685
|
-
() =>
|
|
686
|
-
), [
|
|
687
|
-
() =>
|
|
694
|
+
function Ye({ config: e }) {
|
|
695
|
+
var Ce, qe, Te, je, Me, Re, We, Pe, Le, Oe;
|
|
696
|
+
const r = re(), n = ze(), [a, l] = j(null), [c, m] = j(null), [d, o] = j(null), [u, x] = j(
|
|
697
|
+
() => Kt(e.filters)
|
|
698
|
+
), [S] = j(
|
|
699
|
+
() => vt(e.filters, typeof window > "u" ? "" : window.location.search)
|
|
688
700
|
), C = (i, p) => {
|
|
689
|
-
const b = { ...
|
|
701
|
+
const b = { ...u, [i]: p };
|
|
690
702
|
if (x(b), typeof window > "u" || !(e.filters ?? []).some((k) => k.url_param)) return;
|
|
691
|
-
const y =
|
|
703
|
+
const y = wt(e.filters, b, window.location.search);
|
|
692
704
|
y !== window.location.search && window.history.replaceState(
|
|
693
705
|
window.history.state,
|
|
694
706
|
"",
|
|
695
707
|
`${window.location.pathname}${y}${window.location.hash}`
|
|
696
708
|
);
|
|
697
|
-
}, [
|
|
709
|
+
}, [w, q] = j(null), [v, T] = j(null), W = (v == null ? void 0 : v.phase) === "running", U = Ie(), L = ge();
|
|
698
710
|
te(() => {
|
|
699
711
|
if ((v == null ? void 0 : v.phase) !== "running") return;
|
|
700
712
|
const i = window.setInterval(() => {
|
|
701
|
-
|
|
713
|
+
T(
|
|
702
714
|
(p) => (p == null ? void 0 : p.phase) === "running" ? { ...p, elapsedMs: Date.now() - p.startedAt } : p
|
|
703
715
|
);
|
|
704
716
|
}, 250);
|
|
705
717
|
return () => window.clearInterval(i);
|
|
706
718
|
}, [v == null ? void 0 : v.phase]);
|
|
707
|
-
const { scopes: $, ready: R } =
|
|
719
|
+
const { scopes: $, ready: R } = _t(), I = ee(!1), [K, z] = j(!1), [E, O] = j(/* @__PURE__ */ new Map());
|
|
708
720
|
te(() => {
|
|
709
721
|
if (I.current || !R) return;
|
|
710
722
|
I.current = !0;
|
|
711
723
|
const i = (e.filters ?? []).filter(
|
|
712
|
-
(p) => !(
|
|
724
|
+
(p) => !(u[p.param] ?? []).length && !S.has(p.param)
|
|
713
725
|
);
|
|
714
726
|
if (!$ || !i.length) {
|
|
715
727
|
z(!0);
|
|
@@ -719,11 +731,11 @@ function Ge({ config: e }) {
|
|
|
719
731
|
try {
|
|
720
732
|
const p = {};
|
|
721
733
|
for (const b of i) {
|
|
722
|
-
const y =
|
|
734
|
+
const y = Ae($, { key: b.param, collection: b.collection });
|
|
723
735
|
if (!y) continue;
|
|
724
|
-
const k =
|
|
736
|
+
const k = Ct($, y.name);
|
|
725
737
|
if (!k.length) continue;
|
|
726
|
-
const _ = b.value_field ?? "id", F = await
|
|
738
|
+
const _ = b.value_field ?? "id", F = await qt(
|
|
727
739
|
r,
|
|
728
740
|
y,
|
|
729
741
|
k,
|
|
@@ -744,7 +756,7 @@ function Ge({ config: e }) {
|
|
|
744
756
|
Object.entries(p).map(([b, y]) => {
|
|
745
757
|
var _;
|
|
746
758
|
const k = ((_ = (e.filters ?? []).find((F) => F.param === b)) == null ? void 0 : _.value_field) ?? "id";
|
|
747
|
-
return [b,
|
|
759
|
+
return [b, Be(y, k)];
|
|
748
760
|
})
|
|
749
761
|
)
|
|
750
762
|
));
|
|
@@ -752,27 +764,27 @@ function Ge({ config: e }) {
|
|
|
752
764
|
z(!0);
|
|
753
765
|
}
|
|
754
766
|
})();
|
|
755
|
-
}, [R, $, e.filters,
|
|
767
|
+
}, [R, $, e.filters, u, r, S]);
|
|
756
768
|
const V = he(() => {
|
|
757
769
|
const i = { ...e.params ?? {} };
|
|
758
770
|
for (const p of e.filters ?? []) {
|
|
759
|
-
const b =
|
|
771
|
+
const b = u[p.param] ?? [];
|
|
760
772
|
b.length > 0 && (i[p.param] = b.map((y) => String(y[p.value_field ?? "id"] ?? "")).join(","));
|
|
761
773
|
}
|
|
762
774
|
return i;
|
|
763
|
-
}, [e.params, e.filters,
|
|
764
|
-
|
|
765
|
-
f.current ? G.size > 0 ?
|
|
766
|
-
), P = f.current ? g :
|
|
775
|
+
}, [e.params, e.filters, u]), [G, B] = j(/* @__PURE__ */ new Set()), f = ee(!1), s = JSON.stringify(V), g = pt(
|
|
776
|
+
s,
|
|
777
|
+
f.current ? G.size > 0 ? Xt : Yt : 0
|
|
778
|
+
), P = f.current ? g : s, D = he(
|
|
767
779
|
() => JSON.parse(P),
|
|
768
780
|
[P]
|
|
769
781
|
), J = ee(!1), {
|
|
770
782
|
data: A,
|
|
771
783
|
isPending: X,
|
|
772
|
-
error:
|
|
773
|
-
refetch:
|
|
774
|
-
isFetching:
|
|
775
|
-
isPlaceholderData:
|
|
784
|
+
error: ve,
|
|
785
|
+
refetch: ke,
|
|
786
|
+
isFetching: we,
|
|
787
|
+
isPlaceholderData: Xe
|
|
776
788
|
} = Y({
|
|
777
789
|
queryKey: ["page-renderer-query", e.query_slug, P],
|
|
778
790
|
queryFn: () => {
|
|
@@ -792,15 +804,15 @@ function Ge({ config: e }) {
|
|
|
792
804
|
// reset its view state — "Hide empty rows" switched itself off (L13).
|
|
793
805
|
// Only the same query's answer stands in; another slug starts fresh.
|
|
794
806
|
placeholderData: (i, p) => (p == null ? void 0 : p.queryKey[1]) === e.query_slug ? i : void 0
|
|
795
|
-
}), Z = A == null ? void 0 : A.data, ne =
|
|
796
|
-
J.current = !0,
|
|
797
|
-
}, [
|
|
807
|
+
}), Z = A == null ? void 0 : A.data, ne = Xe && we, Ze = lt(() => {
|
|
808
|
+
J.current = !0, ke();
|
|
809
|
+
}, [ke]), Ne = X;
|
|
798
810
|
if (!e.query_slug) return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Set a query slug" });
|
|
799
|
-
const
|
|
811
|
+
const et = (i) => {
|
|
800
812
|
var k;
|
|
801
813
|
const p = {};
|
|
802
814
|
for (const [_, F] of Object.entries(i.params ?? {})) {
|
|
803
|
-
const M =
|
|
815
|
+
const M = Je(F, null, Z ?? [], D, u, e.filters);
|
|
804
816
|
if (M === void 0) {
|
|
805
817
|
q(`Select a value for "${_}" first`);
|
|
806
818
|
return;
|
|
@@ -815,15 +827,15 @@ function Ge({ config: e }) {
|
|
|
815
827
|
startedAt: Date.now(),
|
|
816
828
|
elapsedMs: 0
|
|
817
829
|
};
|
|
818
|
-
|
|
819
|
-
},
|
|
830
|
+
T(y), b || Se(y);
|
|
831
|
+
}, Se = async (i) => {
|
|
820
832
|
const p = Date.now();
|
|
821
|
-
|
|
833
|
+
T({ ...i, phase: "running", startedAt: p, elapsedMs: 0 });
|
|
822
834
|
try {
|
|
823
835
|
const b = await r.request(
|
|
824
836
|
se(`/custom-queries/${i.action.query_slug}/execute`, { params: i.params })
|
|
825
837
|
), y = Array.isArray(b == null ? void 0 : b.data) ? b.data : [];
|
|
826
|
-
|
|
838
|
+
T(
|
|
827
839
|
(k) => k && k.action === i.action ? {
|
|
828
840
|
...k,
|
|
829
841
|
phase: "done",
|
|
@@ -835,30 +847,30 @@ function Ge({ config: e }) {
|
|
|
835
847
|
`${i.action.success_message ?? `${i.action.label} completed`} · ${le(Date.now() - p)}`
|
|
836
848
|
), U.invalidateQueries({ queryKey: ["page-renderer-query", e.query_slug] });
|
|
837
849
|
} catch (b) {
|
|
838
|
-
const y =
|
|
839
|
-
|
|
850
|
+
const y = Ke(b, "unknown error");
|
|
851
|
+
T(
|
|
840
852
|
(k) => k && k.action === i.action ? { ...k, phase: "error", elapsedMs: Date.now() - p, error: y } : k
|
|
841
853
|
), q(`${i.action.label} failed: ${y}`);
|
|
842
854
|
}
|
|
843
|
-
},
|
|
844
|
-
|
|
855
|
+
}, tt = /* @__PURE__ */ t(
|
|
856
|
+
jt,
|
|
845
857
|
{
|
|
846
858
|
scope: `query:${e.query_slug}`,
|
|
847
859
|
envelope: A,
|
|
848
|
-
onRefresh:
|
|
849
|
-
refreshing:
|
|
860
|
+
onRefresh: Ze,
|
|
861
|
+
refreshing: we && !X,
|
|
850
862
|
className: "ml-auto"
|
|
851
863
|
}
|
|
852
|
-
), de = e.filters && e.filters.length > 0 || (
|
|
864
|
+
), de = e.filters && e.filters.length > 0 || (Ce = e.actions) != null && Ce.length || A != null && A.cache_ttl ? /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-2 pb-2", children: [
|
|
853
865
|
(e.filters ?? []).map((i) => {
|
|
854
|
-
const p =
|
|
866
|
+
const p = Ae($, { key: i.param, collection: i.collection }), b = p ? ($ == null ? void 0 : $.restricted[p.name]) ?? [] : [];
|
|
855
867
|
return /* @__PURE__ */ t(
|
|
856
|
-
|
|
868
|
+
Zt,
|
|
857
869
|
{
|
|
858
870
|
filter: i,
|
|
859
|
-
selected:
|
|
871
|
+
selected: u[i.param] ?? [],
|
|
860
872
|
allowedIds: b.length > 0 ? b : void 0,
|
|
861
|
-
scopeDefault: E.has(i.param) && E.get(i.param) ===
|
|
873
|
+
scopeDefault: E.has(i.param) && E.get(i.param) === Be(u[i.param] ?? [], i.value_field ?? "id"),
|
|
862
874
|
onChange: (y) => {
|
|
863
875
|
f.current = !0, C(i.param, y);
|
|
864
876
|
},
|
|
@@ -876,42 +888,42 @@ function Ge({ config: e }) {
|
|
|
876
888
|
{
|
|
877
889
|
type: "button",
|
|
878
890
|
disabled: W,
|
|
879
|
-
onClick: () => void
|
|
891
|
+
onClick: () => void et(i),
|
|
880
892
|
className: "ml-auto inline-flex h-8 items-center rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:opacity-90 disabled:opacity-50",
|
|
881
893
|
children: W ? "Running…" : i.label
|
|
882
894
|
},
|
|
883
895
|
i.label
|
|
884
896
|
)),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
] }) : null,
|
|
888
|
-
|
|
897
|
+
w && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: w }),
|
|
898
|
+
tt
|
|
899
|
+
] }) : null, $e = (qe = e.stats) != null && qe.length ? /* @__PURE__ */ t(
|
|
900
|
+
Rt,
|
|
889
901
|
{
|
|
890
902
|
stats: e.stats,
|
|
891
903
|
rows: Z ?? [],
|
|
892
904
|
effectiveParams: D,
|
|
893
|
-
loading:
|
|
894
|
-
zeroDash: !!((
|
|
905
|
+
loading: Ne || ne,
|
|
906
|
+
zeroDash: !!((Te = e.table) != null && Te.zero_dash)
|
|
895
907
|
}
|
|
896
908
|
) : null;
|
|
897
|
-
if (
|
|
909
|
+
if (Ne)
|
|
898
910
|
return /* @__PURE__ */ h("div", { className: "p-3", children: [
|
|
899
911
|
de,
|
|
900
|
-
|
|
912
|
+
$e,
|
|
901
913
|
/* @__PURE__ */ t(oe, {})
|
|
902
914
|
] });
|
|
903
|
-
if (
|
|
915
|
+
if (ve)
|
|
904
916
|
return /* @__PURE__ */ h("div", { className: "p-3", children: [
|
|
905
917
|
de,
|
|
906
|
-
/* @__PURE__ */ t(ie, { error:
|
|
918
|
+
/* @__PURE__ */ t(ie, { error: ve, unresolved: e.unresolved_params })
|
|
907
919
|
] });
|
|
908
|
-
const
|
|
909
|
-
const y = p ? null : b ?? Z ?? [], _ =
|
|
920
|
+
const N = e.row_click, _e = (i, p, b) => {
|
|
921
|
+
const y = p ? null : b ?? Z ?? [], _ = St(i, (M) => Qt(
|
|
910
922
|
M,
|
|
911
923
|
p,
|
|
912
924
|
Z ?? [],
|
|
913
925
|
D,
|
|
914
|
-
|
|
926
|
+
u,
|
|
915
927
|
e.filters,
|
|
916
928
|
y
|
|
917
929
|
)), F = _.resolvedTabs.map((M) => {
|
|
@@ -941,28 +953,28 @@ function Ge({ config: e }) {
|
|
|
941
953
|
row: p,
|
|
942
954
|
totalCount: y ? y.length : null
|
|
943
955
|
});
|
|
944
|
-
},
|
|
945
|
-
|
|
946
|
-
collection:
|
|
956
|
+
}, rt = N ? (i) => {
|
|
957
|
+
N.picker ? l(i) : N.sheet ? _e(N.sheet, i) : N.matrix && i.id != null ? m(i.id) : N.drill && i.id != null && (n == null || n.open({
|
|
958
|
+
collection: N.drill.collection ?? "",
|
|
947
959
|
itemId: String(i.id),
|
|
948
|
-
layoutId:
|
|
949
|
-
width:
|
|
960
|
+
layoutId: N.drill.layout_id,
|
|
961
|
+
width: N.drill.width
|
|
950
962
|
}));
|
|
951
|
-
} : void 0,
|
|
963
|
+
} : void 0, nt = (je = e.row_actions) != null && je.length ? e.row_actions.map((i) => ({
|
|
952
964
|
label: i.label,
|
|
953
|
-
onClick: (p, b) =>
|
|
965
|
+
onClick: (p, b) => _e(i.sheet, p, b)
|
|
954
966
|
})) : void 0;
|
|
955
967
|
return /* @__PURE__ */ h(
|
|
956
968
|
"div",
|
|
957
969
|
{
|
|
958
|
-
className: (
|
|
970
|
+
className: (Me = e.table) != null && Me.sticky ? (
|
|
959
971
|
// Sticky grids own their scroll: filters/stats stay pinned above a
|
|
960
972
|
// scrolling table region (header/first-column/totals pin inside it).
|
|
961
973
|
"flex h-full min-h-0 flex-col overflow-hidden p-3"
|
|
962
974
|
) : "h-full overflow-auto p-3",
|
|
963
975
|
children: [
|
|
964
976
|
de,
|
|
965
|
-
((
|
|
977
|
+
((Re = e.note) == null ? void 0 : Re.trim()) && /* @__PURE__ */ t(
|
|
966
978
|
"p",
|
|
967
979
|
{
|
|
968
980
|
"data-query-note": !0,
|
|
@@ -970,65 +982,65 @@ function Ge({ config: e }) {
|
|
|
970
982
|
children: e.note
|
|
971
983
|
}
|
|
972
984
|
),
|
|
973
|
-
|
|
985
|
+
$e,
|
|
974
986
|
/* @__PURE__ */ t(
|
|
975
987
|
"div",
|
|
976
988
|
{
|
|
977
989
|
"data-qt-refetching": ne ? "" : void 0,
|
|
978
990
|
"aria-busy": ne || void 0,
|
|
979
|
-
className: `transition-opacity ${ne ? "opacity-60" : ""} ${(
|
|
991
|
+
className: `transition-opacity ${ne ? "opacity-60" : ""} ${(We = e.table) != null && We.sticky ? "flex min-h-0 flex-1 flex-col" : ""}`.trim(),
|
|
980
992
|
children: /* @__PURE__ */ t(
|
|
981
|
-
|
|
993
|
+
Wt,
|
|
982
994
|
{
|
|
983
995
|
rows: Z ?? [],
|
|
984
996
|
config: (
|
|
985
997
|
// Current-month highlight only applies when the selected year param
|
|
986
998
|
// IS the current year — otherwise strip it.
|
|
987
|
-
(
|
|
999
|
+
(Pe = e.table) != null && Pe.highlight_group && e.table.highlight_year_param ? Number(
|
|
988
1000
|
String(D[e.table.highlight_year_param] ?? "").split(",")[0]
|
|
989
1001
|
) === (/* @__PURE__ */ new Date()).getFullYear() ? e.table : { ...e.table, highlight_group: void 0 } : e.table
|
|
990
1002
|
),
|
|
991
|
-
onRowClick:
|
|
992
|
-
rowActions:
|
|
1003
|
+
onRowClick: rt,
|
|
1004
|
+
rowActions: nt,
|
|
993
1005
|
emptyText: e.empty_label,
|
|
994
|
-
pivotYear: (
|
|
1006
|
+
pivotYear: (Oe = (Le = e.table) == null ? void 0 : Le.pivot) != null && Oe.year_param && Number(String(D[e.table.pivot.year_param] ?? "").split(",")[0]) || void 0
|
|
995
1007
|
}
|
|
996
1008
|
)
|
|
997
1009
|
}
|
|
998
1010
|
),
|
|
999
|
-
(
|
|
1011
|
+
(N == null ? void 0 : N.picker) && a && /* @__PURE__ */ t(
|
|
1000
1012
|
"div",
|
|
1001
1013
|
{
|
|
1002
1014
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-black/30 pt-32",
|
|
1003
|
-
onClick: () =>
|
|
1015
|
+
onClick: () => l(null),
|
|
1004
1016
|
children: /* @__PURE__ */ h(
|
|
1005
1017
|
"div",
|
|
1006
1018
|
{
|
|
1007
1019
|
className: "w-[420px] rounded-lg border border-slate-200 bg-white p-4 shadow-xl dark:border-border dark:bg-background",
|
|
1008
1020
|
onClick: (i) => i.stopPropagation(),
|
|
1009
1021
|
children: [
|
|
1010
|
-
/* @__PURE__ */ t("p", { className: "mb-2 text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
1022
|
+
/* @__PURE__ */ t("p", { className: "mb-2 text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: N.picker.title ?? "Choose a record" }),
|
|
1011
1023
|
/* @__PURE__ */ t(
|
|
1012
|
-
|
|
1024
|
+
Mt,
|
|
1013
1025
|
{
|
|
1014
|
-
collection:
|
|
1026
|
+
collection: N.picker.collection,
|
|
1015
1027
|
value: null,
|
|
1016
1028
|
onChange: (i) => {
|
|
1017
1029
|
var p, b, y, k;
|
|
1018
|
-
if (
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1030
|
+
if (l(null), i != null) {
|
|
1031
|
+
if (N.matrix) {
|
|
1032
|
+
m(i);
|
|
1021
1033
|
return;
|
|
1022
1034
|
}
|
|
1023
1035
|
n == null || n.open({
|
|
1024
|
-
collection: ((p =
|
|
1036
|
+
collection: ((p = N.drill) == null ? void 0 : p.collection) ?? ((b = N.picker) == null ? void 0 : b.collection) ?? "",
|
|
1025
1037
|
itemId: String(i),
|
|
1026
|
-
layoutId: (y =
|
|
1027
|
-
width: (k =
|
|
1038
|
+
layoutId: (y = N.drill) == null ? void 0 : y.layout_id,
|
|
1039
|
+
width: (k = N.drill) == null ? void 0 : k.width
|
|
1028
1040
|
});
|
|
1029
1041
|
}
|
|
1030
1042
|
},
|
|
1031
|
-
extraFilter:
|
|
1043
|
+
extraFilter: Ht(N.picker.filter, a, u, e.filters),
|
|
1032
1044
|
placeholder: "Search…"
|
|
1033
1045
|
}
|
|
1034
1046
|
),
|
|
@@ -1036,7 +1048,7 @@ function Ge({ config: e }) {
|
|
|
1036
1048
|
"button",
|
|
1037
1049
|
{
|
|
1038
1050
|
type: "button",
|
|
1039
|
-
onClick: () =>
|
|
1051
|
+
onClick: () => l(null),
|
|
1040
1052
|
className: "mt-3 h-7 rounded px-2 text-[12px] text-slate-500 hover:text-slate-700",
|
|
1041
1053
|
children: "Cancel"
|
|
1042
1054
|
}
|
|
@@ -1046,18 +1058,18 @@ function Ge({ config: e }) {
|
|
|
1046
1058
|
)
|
|
1047
1059
|
}
|
|
1048
1060
|
),
|
|
1049
|
-
(
|
|
1050
|
-
|
|
1061
|
+
(N == null ? void 0 : N.matrix) && c != null && /* @__PURE__ */ t(
|
|
1062
|
+
Ge,
|
|
1051
1063
|
{
|
|
1052
|
-
config:
|
|
1053
|
-
initialScope: { [
|
|
1054
|
-
width:
|
|
1055
|
-
title:
|
|
1056
|
-
onClose: () =>
|
|
1064
|
+
config: N.matrix.config,
|
|
1065
|
+
initialScope: { [N.matrix.scope_field]: c },
|
|
1066
|
+
width: N.matrix.width,
|
|
1067
|
+
title: N.matrix.title,
|
|
1068
|
+
onClose: () => m(null)
|
|
1057
1069
|
}
|
|
1058
1070
|
),
|
|
1059
1071
|
d && /* @__PURE__ */ t(
|
|
1060
|
-
|
|
1072
|
+
Jt,
|
|
1061
1073
|
{
|
|
1062
1074
|
def: d.def,
|
|
1063
1075
|
row: d.row,
|
|
@@ -1066,12 +1078,12 @@ function Ge({ config: e }) {
|
|
|
1066
1078
|
}
|
|
1067
1079
|
),
|
|
1068
1080
|
v && /* @__PURE__ */ t(
|
|
1069
|
-
|
|
1081
|
+
nr,
|
|
1070
1082
|
{
|
|
1071
1083
|
run: v,
|
|
1072
|
-
onConfirm: () => void
|
|
1084
|
+
onConfirm: () => void Se(v),
|
|
1073
1085
|
onClose: () => {
|
|
1074
|
-
|
|
1086
|
+
T(null);
|
|
1075
1087
|
}
|
|
1076
1088
|
}
|
|
1077
1089
|
)
|
|
@@ -1080,13 +1092,13 @@ function Ge({ config: e }) {
|
|
|
1080
1092
|
);
|
|
1081
1093
|
}
|
|
1082
1094
|
const le = (e) => e < 6e4 ? `${(e / 1e3).toFixed(e < 1e4 ? 1 : 0)}s` : `${Math.floor(e / 6e4)}m ${Math.round(e % 6e4 / 1e3)}s`;
|
|
1083
|
-
function
|
|
1095
|
+
function nr({
|
|
1084
1096
|
run: e,
|
|
1085
1097
|
onConfirm: r,
|
|
1086
1098
|
onClose: n
|
|
1087
1099
|
}) {
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1100
|
+
const a = Object.entries(e.params);
|
|
1101
|
+
return it(
|
|
1090
1102
|
/* @__PURE__ */ h(H, { children: [
|
|
1091
1103
|
/* @__PURE__ */ t(
|
|
1092
1104
|
"div",
|
|
@@ -1105,10 +1117,10 @@ function Zt({
|
|
|
1105
1117
|
className: "fixed left-1/2 top-[24vh] z-50 w-[min(400px,92vw)] -translate-x-1/2 rounded-xl border border-slate-200 bg-white p-4 shadow-2xl dark:border-border dark:bg-card",
|
|
1106
1118
|
children: [
|
|
1107
1119
|
/* @__PURE__ */ t("p", { className: "text-[13.5px] font-semibold text-slate-900 dark:text-foreground", children: e.action.label }),
|
|
1108
|
-
|
|
1109
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(
|
|
1110
|
-
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(
|
|
1111
|
-
] },
|
|
1120
|
+
a.length > 0 && /* @__PURE__ */ t("dl", { className: "mt-2 space-y-0.5 rounded-lg bg-slate-50 px-2.5 py-1.5 text-[11.5px] dark:bg-muted", children: a.map(([l, c]) => /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
1121
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(l) }),
|
|
1122
|
+
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: typeof c == "number" && fe(c, { field: l }) || String(c) })
|
|
1123
|
+
] }, l)) }),
|
|
1112
1124
|
e.phase === "confirm" && /* @__PURE__ */ h(H, { children: [
|
|
1113
1125
|
/* @__PURE__ */ t("p", { className: "mt-2 text-[12.5px] text-slate-600 dark:text-slate-300", children: e.confirmText }),
|
|
1114
1126
|
/* @__PURE__ */ h("div", { className: "mt-3 flex gap-2", children: [
|
|
@@ -1144,13 +1156,13 @@ function Zt({
|
|
|
1144
1156
|
le(e.elapsedMs)
|
|
1145
1157
|
] }),
|
|
1146
1158
|
e.resultRows != null && e.resultRows > 0 && e.resultSample && /* @__PURE__ */ h("dl", { className: "mt-2 max-h-40 space-y-0.5 overflow-y-auto rounded-lg bg-slate-50 px-2.5 py-1.5 text-[11.5px] dark:bg-muted", children: [
|
|
1147
|
-
Object.entries(e.resultSample).slice(0, 8).map(([
|
|
1148
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(
|
|
1149
|
-
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(
|
|
1150
|
-
] },
|
|
1159
|
+
Object.entries(e.resultSample).slice(0, 8).map(([l, c]) => /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
1160
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(l) }),
|
|
1161
|
+
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: typeof c == "number" ? fe(c, { field: l }) || String(c) : String(c ?? "—") })
|
|
1162
|
+
] }, l)),
|
|
1151
1163
|
e.resultRows > 1 && /* @__PURE__ */ h("p", { className: "pt-0.5 text-slate-400", children: [
|
|
1152
1164
|
"…",
|
|
1153
|
-
e.resultRows,
|
|
1165
|
+
Qe(e.resultRows),
|
|
1154
1166
|
" result rows"
|
|
1155
1167
|
] })
|
|
1156
1168
|
] }),
|
|
@@ -1199,69 +1211,69 @@ function Zt({
|
|
|
1199
1211
|
document.body
|
|
1200
1212
|
);
|
|
1201
1213
|
}
|
|
1202
|
-
function
|
|
1214
|
+
function De({ slug: e, widget: r }) {
|
|
1203
1215
|
var n;
|
|
1204
1216
|
switch (r.type) {
|
|
1205
1217
|
case "table":
|
|
1206
|
-
return /* @__PURE__ */ t(
|
|
1218
|
+
return /* @__PURE__ */ t(Et, { slug: e, widget: r });
|
|
1207
1219
|
case "kpi":
|
|
1208
|
-
return /* @__PURE__ */ t(
|
|
1220
|
+
return /* @__PURE__ */ t(Bt, { slug: e, widget: r });
|
|
1209
1221
|
case "markdown":
|
|
1210
|
-
return /* @__PURE__ */ t(
|
|
1222
|
+
return /* @__PURE__ */ t(At, { content: String(((n = r.config) == null ? void 0 : n.content) ?? "") });
|
|
1211
1223
|
case "iframe":
|
|
1212
|
-
return /* @__PURE__ */ t(
|
|
1224
|
+
return /* @__PURE__ */ t(It, { widget: r });
|
|
1213
1225
|
case "query":
|
|
1214
|
-
return /* @__PURE__ */ t(
|
|
1226
|
+
return /* @__PURE__ */ t(er, { widget: r });
|
|
1215
1227
|
case "matrix":
|
|
1216
|
-
return /* @__PURE__ */ t(
|
|
1228
|
+
return /* @__PURE__ */ t(zt, { widget: r });
|
|
1217
1229
|
case "record-grid":
|
|
1218
|
-
return /* @__PURE__ */ t(
|
|
1230
|
+
return /* @__PURE__ */ t(tr, { widget: r });
|
|
1219
1231
|
case "recent-activity":
|
|
1220
|
-
return /* @__PURE__ */ t(
|
|
1232
|
+
return /* @__PURE__ */ t(Dt, { slug: e, widget: r });
|
|
1221
1233
|
default:
|
|
1222
1234
|
return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Unknown widget" });
|
|
1223
1235
|
}
|
|
1224
1236
|
}
|
|
1225
|
-
function
|
|
1237
|
+
function Mr({
|
|
1226
1238
|
slug: e,
|
|
1227
1239
|
hideHeader: r,
|
|
1228
1240
|
className: n,
|
|
1229
|
-
liveReads:
|
|
1230
|
-
liveGapMs:
|
|
1241
|
+
liveReads: a,
|
|
1242
|
+
liveGapMs: l
|
|
1231
1243
|
}) {
|
|
1232
1244
|
var B, f;
|
|
1233
|
-
const
|
|
1245
|
+
const c = re(), m = Ie(), d = (a ?? []).filter(Boolean).join(","), o = he(
|
|
1234
1246
|
() => d ? {
|
|
1235
1247
|
reads: d.split(","),
|
|
1236
|
-
minGapMs:
|
|
1248
|
+
minGapMs: l ?? 15e3,
|
|
1237
1249
|
// Server-cached figures are dropped a moment after the write (a few seconds'
|
|
1238
1250
|
// window): read after that, and spread the viewers out.
|
|
1239
1251
|
delayMs: 3500,
|
|
1240
1252
|
jitterMs: 3e3
|
|
1241
1253
|
} : null,
|
|
1242
|
-
[d,
|
|
1243
|
-
), [
|
|
1254
|
+
[d, l]
|
|
1255
|
+
), [u, x] = j(0);
|
|
1244
1256
|
te(() => {
|
|
1245
1257
|
if (o)
|
|
1246
|
-
return
|
|
1247
|
-
if (
|
|
1248
|
-
const g =
|
|
1249
|
-
!
|
|
1258
|
+
return m.getQueryCache().subscribe((s) => {
|
|
1259
|
+
if (s.type !== "updated" || s.action.type !== "success") return;
|
|
1260
|
+
const g = s.query;
|
|
1261
|
+
!Ft.has(String(g.queryKey[0])) || g.state.dataUpdateCount < 2 || x(Date.now());
|
|
1250
1262
|
});
|
|
1251
|
-
}, [
|
|
1252
|
-
const
|
|
1253
|
-
data:
|
|
1263
|
+
}, [m, o]);
|
|
1264
|
+
const S = ft(u, { enabled: !!o }), { isAdmin: C } = dt(), w = ze(), q = ct("drill.page"), v = q.value, {
|
|
1265
|
+
data: T,
|
|
1254
1266
|
isLoading: W,
|
|
1255
1267
|
error: U
|
|
1256
1268
|
} = Y({
|
|
1257
1269
|
queryKey: ["page-renderer", e],
|
|
1258
|
-
queryFn: () =>
|
|
1270
|
+
queryFn: () => c.request(xe(`/pages/${e}`)).then((s) => s.data),
|
|
1259
1271
|
enabled: !!e,
|
|
1260
1272
|
retry: !1
|
|
1261
1273
|
});
|
|
1262
1274
|
if (W)
|
|
1263
1275
|
return /* @__PURE__ */ t("div", { className: n ?? "p-6", children: /* @__PURE__ */ t(oe, {}) });
|
|
1264
|
-
if (U || !
|
|
1276
|
+
if (U || !T)
|
|
1265
1277
|
return /* @__PURE__ */ h(
|
|
1266
1278
|
"div",
|
|
1267
1279
|
{
|
|
@@ -1272,19 +1284,19 @@ function _r({
|
|
|
1272
1284
|
]
|
|
1273
1285
|
}
|
|
1274
1286
|
);
|
|
1275
|
-
const L = ((B =
|
|
1287
|
+
const L = ((B = T.layout) == null ? void 0 : B.columns) ?? 12, $ = yt(((f = T.layout) == null ? void 0 : f.widgets) ?? [], C), R = (s) => {
|
|
1276
1288
|
var g;
|
|
1277
|
-
return (
|
|
1278
|
-
}, I = [...new Set($.filter(R).map((
|
|
1279
|
-
y:
|
|
1280
|
-
items: $.filter((g) => g.y ===
|
|
1281
|
-
})), z = $.filter((
|
|
1289
|
+
return (s.type === "matrix" || s.type === "query" || s.type === "record-grid") && ((g = s.config) == null ? void 0 : g.display) === "drawer";
|
|
1290
|
+
}, I = [...new Set($.filter(R).map((s) => s.y))].filter((s) => $.every((g) => R(g) || s < g.y || s >= g.y + Math.max(g.h, 1))).sort((s, g) => s - g), K = I.map((s) => ({
|
|
1291
|
+
y: s,
|
|
1292
|
+
items: $.filter((g) => g.y === s && R(g)).sort((g, P) => g.x - P.x)
|
|
1293
|
+
})), z = $.filter((s) => !(R(s) && I.includes(s.y))), E = (s) => s - I.filter((g) => g < s).length, O = z.find((s) => {
|
|
1282
1294
|
var g;
|
|
1283
|
-
return (g =
|
|
1284
|
-
}), V = /* @__PURE__ */ h("div", { ref:
|
|
1285
|
-
!r && /* @__PURE__ */ t("div", { className: "shrink-0 pb-4", children: /* @__PURE__ */ t("h1", { className: "text-lg font-semibold text-slate-900 dark:text-slate-100", children:
|
|
1295
|
+
return (g = s.config) == null ? void 0 : g.full_height;
|
|
1296
|
+
}), V = /* @__PURE__ */ h("div", { ref: S, className: `flex h-full min-h-0 flex-col ${n ?? ""}`, children: [
|
|
1297
|
+
!r && /* @__PURE__ */ t("div", { className: "shrink-0 pb-4", children: /* @__PURE__ */ t("h1", { className: "text-lg font-semibold text-slate-900 dark:text-slate-100", children: T.name }) }),
|
|
1286
1298
|
/* @__PURE__ */ t("div", { className: `min-h-0 flex-1 overflow-y-auto ${O ? "flex flex-col" : ""}`, children: $.length === 0 ? /* @__PURE__ */ t("p", { className: "p-6 text-center text-[13px] text-slate-400", children: "This page has no widgets yet." }) : /* @__PURE__ */ h(H, { children: [
|
|
1287
|
-
K.map((
|
|
1299
|
+
K.map((s) => /* @__PURE__ */ t("div", { className: "mb-3 flex shrink-0 flex-wrap items-center gap-2", children: s.items.map((g) => /* @__PURE__ */ t(De, { slug: T.slug, widget: g }, g.id)) }, s.y)),
|
|
1288
1300
|
/* @__PURE__ */ t(
|
|
1289
1301
|
"div",
|
|
1290
1302
|
{
|
|
@@ -1299,32 +1311,32 @@ function _r({
|
|
|
1299
1311
|
} : {},
|
|
1300
1312
|
gridAutoRows: `${me}px`
|
|
1301
1313
|
},
|
|
1302
|
-
children: z.map((
|
|
1314
|
+
children: z.map((s) => {
|
|
1303
1315
|
var D, J, A, X;
|
|
1304
|
-
const g = (
|
|
1316
|
+
const g = (s.type === "matrix" || s.type === "query" || s.type === "record-grid") && ((D = s.config) == null ? void 0 : D.display) === "drawer", P = s === O;
|
|
1305
1317
|
return /* @__PURE__ */ h(
|
|
1306
1318
|
"div",
|
|
1307
1319
|
{
|
|
1308
1320
|
className: g ? "flex min-h-0 flex-col" : "flex min-h-0 flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-border dark:bg-card",
|
|
1309
1321
|
style: {
|
|
1310
|
-
gridColumn: `${Math.min(
|
|
1311
|
-
gridRow: P ? `${E(
|
|
1322
|
+
gridColumn: `${Math.min(s.x, L - 1) + 1} / span ${Math.min(s.w, L)}`,
|
|
1323
|
+
gridRow: P ? `${E(s.y) + 1} / -1` : `${E(s.y) + 1} / span ${Math.max(s.h, 1)}`
|
|
1312
1324
|
},
|
|
1313
1325
|
children: [
|
|
1314
|
-
!g &&
|
|
1315
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ t(
|
|
1326
|
+
!g && s.type !== "kpi" && s.type !== "markdown" && ((J = s.config) == null ? void 0 : J.hide_label) !== !0 && /* @__PURE__ */ t("div", { className: "shrink-0 border-b border-slate-100 px-3 py-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:border-border", children: String(((A = s.config) == null ? void 0 : A.label) ?? "") || (typeof ((X = s.config) == null ? void 0 : X.collection) == "string" ? Q(String(s.config.collection)) : Q(s.type)) }),
|
|
1327
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ t(De, { slug: T.slug, widget: s }) })
|
|
1316
1328
|
]
|
|
1317
1329
|
},
|
|
1318
|
-
|
|
1330
|
+
s.id
|
|
1319
1331
|
);
|
|
1320
1332
|
})
|
|
1321
1333
|
}
|
|
1322
1334
|
)
|
|
1323
1335
|
] }) })
|
|
1324
|
-
] }), G = /* @__PURE__ */ t(
|
|
1325
|
-
return
|
|
1336
|
+
] }), G = /* @__PURE__ */ t(Ue.Provider, { value: o, children: V });
|
|
1337
|
+
return w ? G : /* @__PURE__ */ h(ut.Provider, { value: { open: (s) => q.push([s]) }, children: [
|
|
1326
1338
|
v != null && v.length ? /* @__PURE__ */ t(
|
|
1327
|
-
|
|
1339
|
+
Pt,
|
|
1328
1340
|
{
|
|
1329
1341
|
collection: v[0].collection,
|
|
1330
1342
|
itemId: v[0].itemId,
|
|
@@ -1332,7 +1344,7 @@ function _r({
|
|
|
1332
1344
|
width: v[0].width,
|
|
1333
1345
|
title: v[0].title,
|
|
1334
1346
|
stack: v,
|
|
1335
|
-
onPush: (
|
|
1347
|
+
onPush: (s) => q.push([...v, s]),
|
|
1336
1348
|
onPop: () => q.back(),
|
|
1337
1349
|
onClose: () => q.back(v.length)
|
|
1338
1350
|
}
|
|
@@ -1341,12 +1353,12 @@ function _r({
|
|
|
1341
1353
|
] });
|
|
1342
1354
|
}
|
|
1343
1355
|
export {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1356
|
+
Mr as PageRenderer,
|
|
1357
|
+
He as QueryWidgetView,
|
|
1358
|
+
tr as RecordGridWidgetBody,
|
|
1359
|
+
Vt as missingRowParamMessage,
|
|
1360
|
+
Qt as resolveSheetConfig,
|
|
1361
|
+
Je as resolveSheetValue,
|
|
1362
|
+
Be as selectionSignature,
|
|
1363
|
+
Ut as totalSheetTitle
|
|
1352
1364
|
};
|