@nivaro/react 0.3.9 → 0.3.11
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/fields/FileField.js +20 -19
- package/dist/full.css +1 -1
- package/dist/hooks/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +103 -4
- package/dist/index.js +512 -501
- package/dist/shared/components/CollectionBrowserView.js +1632 -1564
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +4386 -4142
- package/dist/shared/components/JsonMapEditor.js +18 -17
- package/dist/shared/components/MatrixEditor.js +8 -7
- package/dist/shared/components/MyWorkView.js +32 -31
- package/dist/shared/components/PageRenderer.js +527 -479
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
- package/dist/shared/components/ai/AskPanel.js +55 -54
- package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
- package/dist/shared/components/chat/SlashCommands.js +30 -29
- package/dist/shared/components/chat/chat-outbox.js +76 -75
- package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
- package/dist/shared/components/integrations/console/SignalCard.js +124 -123
- package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
- package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2287 -2275
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- package/dist/shared/components/item-edit/staged-links.js +86 -0
- package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
- package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
- package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1026 -957
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- package/dist/shared/lib/client-version.js +63 -0
- package/dist/shared/lib/force-reload.js +36 -0
- package/dist/shared/lib/load-error.js +11 -10
- package/dist/shared/lib/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/presence-live.js +54 -35
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { initialFilterSelection as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as Q, useQueryClient as Ae } from "@tanstack/react-query";
|
|
3
|
+
import { useState as q, useEffect as ee, useRef as te, useMemo as Pe, useCallback as Fe } from "react";
|
|
4
|
+
import { createPortal as Be } from "react-dom";
|
|
5
|
+
import { useNivaroClient as D, useDrilldown as ke, useOverlayState as Ee, DrilldownContext as Le, useItemNavigation as Ie } from "../context.js";
|
|
6
|
+
import { get as we, post as U } from "../lib/commands.js";
|
|
7
|
+
import { explicitAllUrlParams as Qe, initialFilterSelection as De, filterSelectionToSearch as ze } from "../lib/query-filter-seed.js";
|
|
8
|
+
import { uniqueByValue as Ke } from "../lib/unique-options.js";
|
|
9
|
+
import { userErrorMessage as Ne } from "../lib/safe-error.js";
|
|
10
|
+
import { resolveSheetDef as Ve } from "../lib/sheet-def.js";
|
|
11
|
+
import { useMyScopes as Ge, matchScopeDimension as ge, effectiveScopeSeedIds as Ue, translateScopeValues as He } from "../lib/use-my-scopes.js";
|
|
12
|
+
import { titleCase as L, formatRelative as Ye, formatNumber as Je } from "../lib/utils.js";
|
|
13
|
+
import { CacheStamp as Xe } from "./CacheStamp.js";
|
|
14
|
+
import { RelationCombobox as Ze } from "./item-edit/RelationCombobox.js";
|
|
15
|
+
import { MatrixEditor as re } from "./MatrixEditor.js";
|
|
16
|
+
import { QueryStatStrip as et } from "./QueryStatStrip.js";
|
|
17
|
+
import { QueryTable as tt } from "./QueryTable.js";
|
|
18
|
+
import { RecordDrilldownSheet as rt } from "./RecordDrilldownSheet.js";
|
|
19
|
+
import { RecordGridEditor as ye } from "./RecordGridEditor.js";
|
|
20
|
+
import { SheetHeaderBody as at } from "./SheetHeaderBody.js";
|
|
21
|
+
const X = 76;
|
|
20
22
|
function H() {
|
|
21
23
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 p-3", children: [1, 2, 3].map((e) => /* @__PURE__ */ t(
|
|
22
24
|
"div",
|
|
@@ -26,155 +28,155 @@ function H() {
|
|
|
26
28
|
e
|
|
27
29
|
)) });
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
const r = e
|
|
31
|
+
function Y({ error: e }) {
|
|
32
|
+
const r = Ne(e, "Failed to load widget data");
|
|
31
33
|
return /* @__PURE__ */ t("div", { className: "flex h-full items-center justify-center p-3 text-[12px] text-amber-600 dark:text-amber-500", children: r });
|
|
32
34
|
}
|
|
33
|
-
function
|
|
35
|
+
function lt(e) {
|
|
34
36
|
if (e == null) return "—";
|
|
35
37
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
36
38
|
const r = String(e);
|
|
37
39
|
return r.length > 80 ? `${r.slice(0, 80)}…` : r;
|
|
38
40
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
return e.split(n).forEach((
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
else if (
|
|
47
|
-
|
|
48
|
-
else if (
|
|
49
|
-
|
|
41
|
+
function Z(e, r) {
|
|
42
|
+
const a = [], n = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g;
|
|
43
|
+
return e.split(n).forEach((i, m) => {
|
|
44
|
+
const s = `${r}-${m}`;
|
|
45
|
+
if (i)
|
|
46
|
+
if (i.startsWith("**") && i.endsWith("**"))
|
|
47
|
+
a.push(/* @__PURE__ */ t("strong", { children: i.slice(2, -2) }, s));
|
|
48
|
+
else if (i.startsWith("*") && i.endsWith("*") && i.length > 2)
|
|
49
|
+
a.push(/* @__PURE__ */ t("em", { children: i.slice(1, -1) }, s));
|
|
50
|
+
else if (i.startsWith("`") && i.endsWith("`"))
|
|
51
|
+
a.push(
|
|
50
52
|
/* @__PURE__ */ t(
|
|
51
53
|
"code",
|
|
52
54
|
{
|
|
53
55
|
className: "rounded bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] dark:bg-muted",
|
|
54
|
-
children:
|
|
56
|
+
children: i.slice(1, -1)
|
|
55
57
|
},
|
|
56
|
-
|
|
58
|
+
s
|
|
57
59
|
)
|
|
58
60
|
);
|
|
59
61
|
else {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */ t("a", { href:
|
|
63
|
-
) :
|
|
62
|
+
const l = i.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
63
|
+
l && (/^https?:\/\//i.test(l[2]) || l[2].startsWith("/")) ? a.push(
|
|
64
|
+
/* @__PURE__ */ t("a", { href: l[2], className: "text-nvr-cyan underline-offset-2 hover:underline", children: l[1] }, s)
|
|
65
|
+
) : a.push(i);
|
|
64
66
|
}
|
|
65
|
-
}),
|
|
67
|
+
}), a;
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function nt({ content: e }) {
|
|
68
70
|
const r = [];
|
|
69
|
-
let
|
|
70
|
-
const m = (
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */ t("p", { className: "leading-relaxed", children:
|
|
73
|
-
),
|
|
74
|
-
},
|
|
71
|
+
let a = [], n = [], i = !1;
|
|
72
|
+
const m = (l) => {
|
|
73
|
+
a.length && (r.push(
|
|
74
|
+
/* @__PURE__ */ t("p", { className: "leading-relaxed", children: Z(a.join(" "), l) }, l)
|
|
75
|
+
), a = []);
|
|
76
|
+
}, s = (l) => {
|
|
75
77
|
if (!n.length) return;
|
|
76
|
-
const
|
|
78
|
+
const o = n.map((u, x) => /* @__PURE__ */ t("li", { children: Z(u, `${l}-${x}`) }, `${l}-${x}`));
|
|
77
79
|
r.push(
|
|
78
|
-
|
|
80
|
+
i ? /* @__PURE__ */ t("ol", { className: "list-decimal space-y-0.5 pl-5", children: o }, l) : /* @__PURE__ */ t("ul", { className: "list-disc space-y-0.5 pl-5", children: o }, l)
|
|
79
81
|
), n = [];
|
|
80
82
|
};
|
|
81
83
|
return e.split(`
|
|
82
|
-
`).forEach((
|
|
83
|
-
const u = `md-${
|
|
84
|
+
`).forEach((l, o) => {
|
|
85
|
+
const u = `md-${o}`, x = l.match(/^(#{1,3})\s+(.*)$/), b = l.match(/^[-*]\s+(.*)$/), N = l.match(/^\d+\.\s+(.*)$/);
|
|
84
86
|
if (x) {
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
+
s(`${u}-fl`), m(`${u}-fp`);
|
|
88
|
+
const S = x[1].length, W = S === 1 ? "text-[17px] font-semibold" : S === 2 ? "text-[15px] font-semibold" : "text-[13.5px] font-semibold";
|
|
87
89
|
r.push(
|
|
88
|
-
/* @__PURE__ */ t("div", { className: `${
|
|
90
|
+
/* @__PURE__ */ t("div", { className: `${W} text-slate-900 dark:text-slate-100`, children: Z(x[2], `${u}-h`) }, u)
|
|
89
91
|
);
|
|
90
|
-
} else if (
|
|
92
|
+
} else if (b || N) {
|
|
91
93
|
m(`${u}-fp`);
|
|
92
|
-
const
|
|
93
|
-
n.length &&
|
|
94
|
-
} else
|
|
95
|
-
}),
|
|
94
|
+
const S = !!N;
|
|
95
|
+
n.length && i !== S && s(`${u}-fl`), i = S, n.push((b == null ? void 0 : b[1]) ?? (N == null ? void 0 : N[1]));
|
|
96
|
+
} else l.trim() === "" ? (s(`${u}-fl`), m(`${u}-fp`)) : (s(`${u}-fl`), a.push(l.trim()));
|
|
97
|
+
}), s("md-end-l"), m("md-end-p"), /* @__PURE__ */ t("div", { className: "space-y-2 p-4 text-[13px] text-slate-700 dark:text-slate-300", children: r });
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
const n =
|
|
99
|
-
return
|
|
99
|
+
function ae(e, r, a) {
|
|
100
|
+
const n = D();
|
|
101
|
+
return Q({
|
|
100
102
|
queryKey: ["page-renderer-widget-data", e, r.id],
|
|
101
|
-
queryFn: () => n.request(
|
|
102
|
-
enabled:
|
|
103
|
+
queryFn: () => n.request(U(`/pages/${e}/widget-data`, { widget_id: r.id })).then((i) => i.data),
|
|
104
|
+
enabled: a,
|
|
103
105
|
retry: !1,
|
|
104
106
|
staleTime: 3e4
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
|
-
function
|
|
109
|
+
function st({ slug: e, widget: r }) {
|
|
108
110
|
var u;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
111
|
+
const a = r.config ?? {}, { data: n, isLoading: i, error: m } = ae(e, r, !!a.collection), s = Ie();
|
|
112
|
+
if (!a.collection)
|
|
111
113
|
return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
112
|
-
if (
|
|
113
|
-
if (m) return /* @__PURE__ */ t(
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
return
|
|
114
|
+
if (i) return /* @__PURE__ */ t(H, {});
|
|
115
|
+
if (m) return /* @__PURE__ */ t(Y, { error: m });
|
|
116
|
+
const l = (n == null ? void 0 : n.rows) ?? [];
|
|
117
|
+
if (!l.length) return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "No records" });
|
|
118
|
+
const o = (u = a.columns) != null && u.length ? a.columns : Object.keys(l[0]).filter((x) => {
|
|
119
|
+
const b = l[0][x];
|
|
120
|
+
return b === null || ["string", "number", "boolean"].includes(typeof b);
|
|
119
121
|
}).slice(0, 5);
|
|
120
122
|
return /* @__PURE__ */ t("div", { className: "h-full overflow-auto", children: /* @__PURE__ */ p("table", { className: "w-full text-[12px]", children: [
|
|
121
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 dark:border-border", children:
|
|
123
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 dark:border-border", children: o.map((x) => /* @__PURE__ */ t(
|
|
122
124
|
"th",
|
|
123
125
|
{
|
|
124
126
|
className: "whitespace-nowrap px-3 py-1.5 text-left font-medium text-slate-400",
|
|
125
|
-
children:
|
|
127
|
+
children: L(x)
|
|
126
128
|
},
|
|
127
129
|
x
|
|
128
130
|
)) }) }),
|
|
129
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
131
|
+
/* @__PURE__ */ t("tbody", { children: l.map((x, b) => /* @__PURE__ */ t(
|
|
130
132
|
"tr",
|
|
131
133
|
{
|
|
132
|
-
onClick: x.id != null ? () =>
|
|
134
|
+
onClick: x.id != null ? () => s.open({ collection: a.collection, itemId: String(x.id) }) : void 0,
|
|
133
135
|
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" : ""}`,
|
|
134
|
-
children:
|
|
136
|
+
children: o.map((N) => /* @__PURE__ */ t(
|
|
135
137
|
"td",
|
|
136
138
|
{
|
|
137
139
|
className: "whitespace-nowrap px-3 py-1.5 text-slate-700 dark:text-slate-300",
|
|
138
|
-
children:
|
|
140
|
+
children: lt(x[N])
|
|
139
141
|
},
|
|
140
|
-
|
|
142
|
+
N
|
|
141
143
|
))
|
|
142
144
|
},
|
|
143
|
-
x.id != null ? `${x.id}-${
|
|
145
|
+
x.id != null ? `${x.id}-${b}` : b
|
|
144
146
|
)) })
|
|
145
147
|
] }) });
|
|
146
148
|
}
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */ t("span", { className: "mt-1.5 text-[12px] text-slate-400", children:
|
|
149
|
+
function it({ slug: e, widget: r }) {
|
|
150
|
+
const a = r.config ?? {}, { data: n, isLoading: i, error: m } = ae(e, r, !!a.collection);
|
|
151
|
+
return a.collection ? m ? /* @__PURE__ */ t(Y, { error: m }) : /* @__PURE__ */ p("div", { className: "flex h-full flex-col items-start justify-center px-4", children: [
|
|
152
|
+
i ? /* @__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: (n == null ? void 0 : n.value) != null ? Je(Number(n.value)) : "—" }),
|
|
153
|
+
/* @__PURE__ */ t("span", { className: "mt-1.5 text-[12px] text-slate-400", children: a.label || `${a.aggregate ?? "count"} of ${a.collection}` })
|
|
152
154
|
] }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
153
155
|
}
|
|
154
|
-
function
|
|
155
|
-
const { data:
|
|
156
|
+
function ot({ slug: e, widget: r }) {
|
|
157
|
+
const { data: a, isLoading: n, error: i } = ae(e, r, !0);
|
|
156
158
|
if (n) return /* @__PURE__ */ t(H, {});
|
|
157
|
-
if (
|
|
158
|
-
const m = (
|
|
159
|
-
return m.length ? /* @__PURE__ */ t("div", { className: "h-full overflow-auto px-3 py-1.5", children: m.map((
|
|
159
|
+
if (i) return /* @__PURE__ */ t(Y, { error: i });
|
|
160
|
+
const m = (a == null ? void 0 : a.rows) ?? [];
|
|
161
|
+
return m.length ? /* @__PURE__ */ t("div", { className: "h-full overflow-auto px-3 py-1.5", children: m.map((s) => /* @__PURE__ */ p(
|
|
160
162
|
"div",
|
|
161
163
|
{
|
|
162
164
|
className: "flex items-center gap-2 border-b border-slate-50 py-1.5 text-[12px] last:border-0 dark:border-border/50",
|
|
163
165
|
children: [
|
|
164
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-300", children:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-300", children: s.action }),
|
|
167
|
+
s.collection && /* @__PURE__ */ p("span", { className: "truncate font-mono text-[11px] text-slate-400", children: [
|
|
168
|
+
s.collection,
|
|
169
|
+
s.item ? ` · ${s.item}` : ""
|
|
168
170
|
] }),
|
|
169
|
-
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children:
|
|
171
|
+
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children: Ye(s.timestamp) })
|
|
170
172
|
]
|
|
171
173
|
},
|
|
172
|
-
|
|
174
|
+
s.id
|
|
173
175
|
)) }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "No activity" });
|
|
174
176
|
}
|
|
175
|
-
function
|
|
176
|
-
var
|
|
177
|
-
const r = String(((
|
|
177
|
+
function dt({ widget: e }) {
|
|
178
|
+
var a;
|
|
179
|
+
const r = String(((a = e.config) == null ? void 0 : a.url) ?? "");
|
|
178
180
|
return r ? /^https?:\/\//i.test(r) ? /* @__PURE__ */ t(
|
|
179
181
|
"iframe",
|
|
180
182
|
{
|
|
@@ -185,20 +187,20 @@ function rt({ widget: e }) {
|
|
|
185
187
|
}
|
|
186
188
|
) : /* @__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" });
|
|
187
189
|
}
|
|
188
|
-
function
|
|
190
|
+
function $e({
|
|
189
191
|
config: e,
|
|
190
192
|
initialScope: r,
|
|
191
|
-
width:
|
|
193
|
+
width: a,
|
|
192
194
|
title: n,
|
|
193
|
-
onClose:
|
|
195
|
+
onClose: i
|
|
194
196
|
}) {
|
|
195
|
-
const m = typeof
|
|
196
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
197
|
+
const m = typeof a == "number" ? `${a}px` : a ?? "85%";
|
|
198
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: i, children: /* @__PURE__ */ p(
|
|
197
199
|
"div",
|
|
198
200
|
{
|
|
199
201
|
className: "flex h-full flex-col border-l border-slate-200 bg-white shadow-2xl dark:border-border dark:bg-background",
|
|
200
202
|
style: { width: m, maxWidth: "96%" },
|
|
201
|
-
onClick: (
|
|
203
|
+
onClick: (s) => s.stopPropagation(),
|
|
202
204
|
children: [
|
|
203
205
|
/* @__PURE__ */ p("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
204
206
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: n ?? e.title ?? "Manage" }),
|
|
@@ -206,19 +208,19 @@ function ke({
|
|
|
206
208
|
"button",
|
|
207
209
|
{
|
|
208
210
|
type: "button",
|
|
209
|
-
onClick:
|
|
211
|
+
onClick: i,
|
|
210
212
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
211
213
|
children: "Close"
|
|
212
214
|
}
|
|
213
215
|
)
|
|
214
216
|
] }),
|
|
215
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
217
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(re, { config: e, initialScope: r }) })
|
|
216
218
|
]
|
|
217
219
|
}
|
|
218
220
|
) });
|
|
219
221
|
}
|
|
220
|
-
function
|
|
221
|
-
const r = e.config ?? {}, [
|
|
222
|
+
function ct({ widget: e }) {
|
|
223
|
+
const r = e.config ?? {}, [a, n] = q(!1);
|
|
222
224
|
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__ */ p("div", { className: "flex h-full items-center", children: [
|
|
223
225
|
/* @__PURE__ */ t(
|
|
224
226
|
"button",
|
|
@@ -229,53 +231,54 @@ function lt({ widget: e }) {
|
|
|
229
231
|
children: r.button_label ?? r.title ?? "Manage"
|
|
230
232
|
}
|
|
231
233
|
),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
a && /* @__PURE__ */ t(
|
|
235
|
+
$e,
|
|
234
236
|
{
|
|
235
237
|
config: r,
|
|
236
238
|
width: r.sheet_width,
|
|
237
239
|
onClose: () => n(!1)
|
|
238
240
|
}
|
|
239
241
|
)
|
|
240
|
-
] }) : /* @__PURE__ */ t(
|
|
242
|
+
] }) : /* @__PURE__ */ t(re, { config: r });
|
|
241
243
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
244
|
+
function mt(e) {
|
|
245
|
+
return De(
|
|
244
246
|
e,
|
|
245
247
|
typeof window > "u" ? "" : window.location.search
|
|
246
248
|
);
|
|
247
249
|
}
|
|
248
|
-
function
|
|
250
|
+
function Se(e, r, a, n, i, m) {
|
|
249
251
|
if (typeof e != "string") return e;
|
|
250
252
|
if (e.startsWith("$row.")) return r == null ? void 0 : r[e.slice(5)];
|
|
251
253
|
if (e.startsWith("$rows.")) {
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
+
const s = e.slice(6), l = [...new Set(a.map((o) => o[s]).filter((o) => o != null && o !== ""))];
|
|
255
|
+
return l.length ? l.join(",") : void 0;
|
|
254
256
|
}
|
|
255
257
|
if (e.startsWith("$param.")) return n[e.slice(7)];
|
|
256
258
|
if (e.startsWith("$filters.")) {
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
+
const s = e.slice(9), l = m == null ? void 0 : m.find((u) => u.param === s), o = i[s] ?? [];
|
|
260
|
+
return o.length ? o.map((u) => String(u[(l == null ? void 0 : l.value_field) ?? "id"] ?? "")).join(",") : void 0;
|
|
259
261
|
}
|
|
260
262
|
return e;
|
|
261
263
|
}
|
|
262
|
-
function
|
|
263
|
-
const
|
|
264
|
-
for (const [
|
|
265
|
-
const u =
|
|
266
|
-
u !== void 0 && (
|
|
264
|
+
function ut(e, r, a, n, i, m) {
|
|
265
|
+
const s = {};
|
|
266
|
+
for (const [l, o] of Object.entries(e.params ?? {})) {
|
|
267
|
+
const u = Se(o, r, a, n, i, m);
|
|
268
|
+
u !== void 0 && (s[l] = u);
|
|
267
269
|
}
|
|
268
|
-
return { ...e, params:
|
|
270
|
+
return { ...e, params: s };
|
|
269
271
|
}
|
|
270
|
-
function
|
|
272
|
+
function pt({
|
|
271
273
|
config: e,
|
|
272
274
|
stats: r,
|
|
273
|
-
asOf:
|
|
275
|
+
asOf: a,
|
|
276
|
+
note: n
|
|
274
277
|
}) {
|
|
275
|
-
const
|
|
276
|
-
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(
|
|
277
|
-
queryFn: () =>
|
|
278
|
-
|
|
278
|
+
const i = D(), m = e.params ?? {}, { data: s, isPending: l, isError: o } = Q({
|
|
279
|
+
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(m)],
|
|
280
|
+
queryFn: () => i.request(
|
|
281
|
+
U(`/custom-queries/${e.query_slug}/execute`, { params: m })
|
|
279
282
|
),
|
|
280
283
|
enabled: !!e.query_slug,
|
|
281
284
|
staleTime: 6e4
|
|
@@ -286,151 +289,173 @@ function st({
|
|
|
286
289
|
className: "shrink-0 border-b border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card",
|
|
287
290
|
"data-sheet-header": !0,
|
|
288
291
|
children: /* @__PURE__ */ t(
|
|
289
|
-
|
|
292
|
+
at,
|
|
290
293
|
{
|
|
291
294
|
stats: r,
|
|
292
|
-
rows: (
|
|
293
|
-
params:
|
|
294
|
-
loading:
|
|
295
|
-
error:
|
|
296
|
-
asOf:
|
|
295
|
+
rows: (s == null ? void 0 : s.data) ?? [],
|
|
296
|
+
params: m,
|
|
297
|
+
loading: l && !o,
|
|
298
|
+
error: o,
|
|
299
|
+
asOf: a,
|
|
300
|
+
note: n
|
|
297
301
|
}
|
|
298
302
|
)
|
|
299
303
|
}
|
|
300
304
|
);
|
|
301
305
|
}
|
|
302
|
-
function
|
|
306
|
+
function ht({
|
|
303
307
|
def: e,
|
|
304
308
|
row: r,
|
|
305
|
-
onClose:
|
|
309
|
+
onClose: a
|
|
306
310
|
}) {
|
|
307
|
-
const [n,
|
|
311
|
+
const [n, i] = q(e.initialTab ?? 0), m = e.title ? e.title.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (o, u) => {
|
|
308
312
|
const x = r == null ? void 0 : r[u];
|
|
309
313
|
return x == null ? "" : String(x);
|
|
310
|
-
}) : "Details",
|
|
311
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
314
|
+
}) : "Details", s = typeof e.width == "number" ? `${e.width}px` : e.width ?? "90%", l = e.resolvedTabs[n];
|
|
315
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: a, children: /* @__PURE__ */ p(
|
|
312
316
|
"div",
|
|
313
317
|
{
|
|
314
318
|
className: "flex h-full flex-col border-l border-slate-200 bg-slate-50 shadow-2xl dark:border-border dark:bg-background",
|
|
315
|
-
style: { width:
|
|
316
|
-
onClick: (
|
|
319
|
+
style: { width: s, maxWidth: "96%" },
|
|
320
|
+
onClick: (o) => o.stopPropagation(),
|
|
317
321
|
children: [
|
|
318
322
|
/* @__PURE__ */ p("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: [
|
|
319
323
|
/* @__PURE__ */ p("div", { className: "flex items-center gap-3", children: [
|
|
320
324
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: m }),
|
|
321
|
-
e.resolvedTabs.length > 1 && /* @__PURE__ */ t("div", { className: "flex gap-1", children: e.resolvedTabs.map((
|
|
325
|
+
e.resolvedTabs.length > 1 && /* @__PURE__ */ t("div", { className: "flex gap-1", children: e.resolvedTabs.map((o, u) => /* @__PURE__ */ t(
|
|
322
326
|
"button",
|
|
323
327
|
{
|
|
324
328
|
type: "button",
|
|
325
|
-
onClick: () =>
|
|
329
|
+
onClick: () => i(u),
|
|
326
330
|
className: `rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ${u === n ? "bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,
|
|
327
|
-
children:
|
|
331
|
+
children: o.label
|
|
328
332
|
},
|
|
329
|
-
|
|
333
|
+
o.label
|
|
330
334
|
)) })
|
|
331
335
|
] }),
|
|
332
336
|
/* @__PURE__ */ t(
|
|
333
337
|
"button",
|
|
334
338
|
{
|
|
335
339
|
type: "button",
|
|
336
|
-
onClick:
|
|
340
|
+
onClick: a,
|
|
337
341
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
338
342
|
children: "Close"
|
|
339
343
|
}
|
|
340
344
|
)
|
|
341
345
|
] }),
|
|
342
|
-
e.header && /* @__PURE__ */ t(
|
|
343
|
-
|
|
344
|
-
|
|
346
|
+
e.header && /* @__PURE__ */ t(
|
|
347
|
+
pt,
|
|
348
|
+
{
|
|
349
|
+
config: e.header.config,
|
|
350
|
+
stats: e.header.stats,
|
|
351
|
+
asOf: e.header.asOf,
|
|
352
|
+
note: e.header.note
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: l != null && l.matrix ? /* @__PURE__ */ t(
|
|
356
|
+
re,
|
|
345
357
|
{
|
|
346
|
-
config:
|
|
347
|
-
initialScope:
|
|
358
|
+
config: l.matrix.config,
|
|
359
|
+
initialScope: l.matrix.initialScope,
|
|
348
360
|
lockScope: !0
|
|
349
361
|
},
|
|
350
362
|
n
|
|
351
|
-
) :
|
|
363
|
+
) : l != null && l.config ? /* @__PURE__ */ p(E, { children: [
|
|
364
|
+
l.note && /* @__PURE__ */ t(
|
|
365
|
+
"p",
|
|
366
|
+
{
|
|
367
|
+
className: "border-b border-slate-200 bg-white px-4 py-1.5 text-[11.5px] text-slate-500 dark:border-border dark:bg-card dark:text-slate-400",
|
|
368
|
+
"data-sheet-tab-note": !0,
|
|
369
|
+
children: l.note
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ t(_e, { config: l.config }, n)
|
|
373
|
+
] }) : /* @__PURE__ */ t("p", { className: "p-4 text-[12px] text-slate-400", children: "Sheet not configured" }) })
|
|
352
374
|
]
|
|
353
375
|
}
|
|
354
376
|
) });
|
|
355
377
|
}
|
|
356
|
-
function
|
|
378
|
+
function xt(e, r, a, n) {
|
|
357
379
|
if (!e) return;
|
|
358
|
-
const
|
|
359
|
-
const u = /^\$filters\.(\w+)(?:\.(\w+))?$/.exec(
|
|
380
|
+
const i = (o) => {
|
|
381
|
+
const u = /^\$filters\.(\w+)(?:\.(\w+))?$/.exec(o);
|
|
360
382
|
if (!u) return;
|
|
361
|
-
const x = n == null ? void 0 : n.find((
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
}, m = (
|
|
366
|
-
Object.entries(
|
|
367
|
-
) :
|
|
368
|
-
return Array.isArray(
|
|
383
|
+
const x = n == null ? void 0 : n.find((S) => S.param === u[1]), b = (a == null ? void 0 : a[u[1]]) ?? [];
|
|
384
|
+
if (b.length === 0) return;
|
|
385
|
+
const N = u[2] ?? (x == null ? void 0 : x.value_field) ?? "id";
|
|
386
|
+
return b.map((S) => S[N]);
|
|
387
|
+
}, m = (o) => typeof o == "string" && o.startsWith("$row.") ? r[o.slice(5)] : typeof o == "string" && o.startsWith("$filters.") ? i(o) : Array.isArray(o) ? o.map(m) : o && typeof o == "object" ? Object.fromEntries(
|
|
388
|
+
Object.entries(o).map(([u, x]) => [u, m(x)])
|
|
389
|
+
) : o, s = (o) => o === void 0 ? !0 : Array.isArray(o) ? o.some(s) : o && typeof o == "object" ? Object.values(o).some(s) : !1, l = m(e);
|
|
390
|
+
return Array.isArray(l._and) && (l._and = l._and.filter((o) => !s(o))), s(l) ? void 0 : l;
|
|
369
391
|
}
|
|
370
|
-
function
|
|
392
|
+
function ft({
|
|
371
393
|
filter: e,
|
|
372
394
|
selected: r,
|
|
373
|
-
onChange:
|
|
395
|
+
onChange: a,
|
|
374
396
|
allowedIds: n,
|
|
375
|
-
scopeDefault:
|
|
397
|
+
scopeDefault: i
|
|
376
398
|
}) {
|
|
377
|
-
const m =
|
|
378
|
-
queryKey: ["page-renderer-filter", e.collection,
|
|
399
|
+
const m = D(), [s, l] = q(!1), [o, u] = q(""), x = te(null), b = e.value_field ?? "id", N = e.label_field ?? b, { data: S = [] } = Q({
|
|
400
|
+
queryKey: ["page-renderer-filter", e.collection, b, N, e.sort],
|
|
379
401
|
queryFn: () => m.request(
|
|
380
|
-
|
|
381
|
-
fields: [.../* @__PURE__ */ new Set(["id",
|
|
402
|
+
we(`/items/${e.collection}`, {
|
|
403
|
+
fields: [.../* @__PURE__ */ new Set(["id", b, N])].join(","),
|
|
382
404
|
limit: e.limit ?? 500,
|
|
383
405
|
...e.sort ? { sort: e.sort } : {}
|
|
384
406
|
})
|
|
385
|
-
).then((
|
|
407
|
+
).then((w) => w.data ?? []),
|
|
386
408
|
staleTime: 6e4
|
|
387
409
|
});
|
|
388
|
-
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
x.current && !x.current.contains(
|
|
410
|
+
ee(() => {
|
|
411
|
+
if (!s) return;
|
|
412
|
+
const w = ($) => {
|
|
413
|
+
x.current && !x.current.contains($.target) && l(!1);
|
|
392
414
|
};
|
|
393
|
-
return window.addEventListener("mousedown",
|
|
394
|
-
}, [
|
|
395
|
-
const
|
|
396
|
-
(
|
|
397
|
-
|
|
415
|
+
return window.addEventListener("mousedown", w), () => window.removeEventListener("mousedown", w);
|
|
416
|
+
}, [s]);
|
|
417
|
+
const W = e.label ?? L(e.param), j = Ke(
|
|
418
|
+
n != null && n.length ? S.filter((w) => n.some(($) => String($) === String(w.id))) : S,
|
|
419
|
+
(w) => String(w[b] ?? "")
|
|
420
|
+
).filter(
|
|
421
|
+
(w) => o ? String(w[N] ?? "").toLowerCase().includes(o.toLowerCase()) : !0
|
|
422
|
+
), R = n != null && n.length ? {
|
|
398
423
|
label: "restricted",
|
|
399
424
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
400
|
-
title: `Options limited to your restricted ${
|
|
401
|
-
} :
|
|
402
|
-
label: "default",
|
|
425
|
+
title: `Options limited to your restricted ${W} scope${i ? "; selection seeded from your defaults" : ""}`
|
|
426
|
+
} : i && r.length > 0 ? {
|
|
427
|
+
label: "your default",
|
|
403
428
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
404
|
-
title: `Pre-selected from your default ${
|
|
429
|
+
title: `Pre-selected from your default ${W} scope — adjust freely`
|
|
405
430
|
} : null;
|
|
406
431
|
return /* @__PURE__ */ p("div", { ref: x, className: "relative", children: [
|
|
407
432
|
/* @__PURE__ */ p(
|
|
408
433
|
"button",
|
|
409
434
|
{
|
|
410
435
|
type: "button",
|
|
411
|
-
onClick: () =>
|
|
436
|
+
onClick: () => l((w) => !w),
|
|
412
437
|
className: `inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] transition-colors ${r.length > 0 ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-700 dark:text-slate-200" : "border-slate-200 bg-white text-slate-600 hover:border-slate-400 dark:border-border dark:bg-card dark:text-slate-300"}`,
|
|
413
438
|
children: [
|
|
414
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
415
|
-
|
|
439
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: W }),
|
|
440
|
+
R && /* @__PURE__ */ t(
|
|
416
441
|
"span",
|
|
417
442
|
{
|
|
418
|
-
title:
|
|
419
|
-
className: `rounded px-1 py-px text-[9px] font-semibold uppercase tracking-wide ${
|
|
420
|
-
children:
|
|
443
|
+
title: R.title,
|
|
444
|
+
className: `rounded px-1 py-px text-[9px] font-semibold uppercase tracking-wide ${R.cls}`,
|
|
445
|
+
children: R.label
|
|
421
446
|
}
|
|
422
447
|
),
|
|
423
|
-
/* @__PURE__ */ t("span", { className: "text-slate-400", children: r.length === 0 ? "All" : r.length === 1 ? String(r[0][
|
|
448
|
+
/* @__PURE__ */ t("span", { className: "text-slate-400", children: r.length === 0 ? "All" : r.length === 1 ? String(r[0][N] ?? r[0][b] ?? "") : `${r.length} selected` }),
|
|
424
449
|
/* @__PURE__ */ t("span", { className: "text-slate-400", children: "⌃" })
|
|
425
450
|
]
|
|
426
451
|
}
|
|
427
452
|
),
|
|
428
|
-
|
|
453
|
+
s && /* @__PURE__ */ p("div", { className: "absolute left-0 top-9 z-40 w-56 rounded-md border border-slate-200 bg-white p-1 shadow-md dark:border-border dark:bg-popover", children: [
|
|
429
454
|
/* @__PURE__ */ t(
|
|
430
455
|
"input",
|
|
431
456
|
{
|
|
432
|
-
value:
|
|
433
|
-
onChange: (
|
|
457
|
+
value: o,
|
|
458
|
+
onChange: (w) => u(w.target.value),
|
|
434
459
|
placeholder: "Search…",
|
|
435
460
|
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"
|
|
436
461
|
}
|
|
@@ -440,39 +465,45 @@ function dt({
|
|
|
440
465
|
"button",
|
|
441
466
|
{
|
|
442
467
|
type: "button",
|
|
443
|
-
onClick: () =>
|
|
468
|
+
onClick: () => a([]),
|
|
444
469
|
className: "flex w-full items-center rounded px-2 py-1 text-left text-[12px] text-slate-500 hover:bg-slate-100 dark:hover:bg-muted",
|
|
445
470
|
children: "Clear selection"
|
|
446
471
|
}
|
|
447
472
|
),
|
|
448
|
-
|
|
449
|
-
const
|
|
473
|
+
j.map((w) => {
|
|
474
|
+
const $ = String(w[b] ?? ""), O = r.some((d) => String(d[b] ?? "") === $);
|
|
450
475
|
return /* @__PURE__ */ p(
|
|
451
476
|
"button",
|
|
452
477
|
{
|
|
453
478
|
type: "button",
|
|
454
|
-
onClick: () =>
|
|
455
|
-
|
|
456
|
-
|
|
479
|
+
onClick: () => {
|
|
480
|
+
if (e.single) {
|
|
481
|
+
a(O ? [] : [w]), l(!1);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
a(
|
|
485
|
+
O ? r.filter((d) => String(d[b] ?? "") !== $) : [...r, w]
|
|
486
|
+
);
|
|
487
|
+
},
|
|
457
488
|
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",
|
|
458
489
|
children: [
|
|
459
|
-
/* @__PURE__ */ t("span", { className: `w-3.5 shrink-0 text-nvr-cyan ${
|
|
460
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: String(
|
|
490
|
+
/* @__PURE__ */ t("span", { className: `w-3.5 shrink-0 text-nvr-cyan ${O ? "" : "invisible"}`, children: "✓" }),
|
|
491
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: String(w[N] ?? $) })
|
|
461
492
|
]
|
|
462
493
|
},
|
|
463
|
-
|
|
494
|
+
$
|
|
464
495
|
);
|
|
465
496
|
}),
|
|
466
|
-
|
|
497
|
+
j.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-1.5 text-[12px] text-slate-400", children: "No options" })
|
|
467
498
|
] })
|
|
468
499
|
] })
|
|
469
500
|
] });
|
|
470
501
|
}
|
|
471
|
-
function
|
|
472
|
-
return /* @__PURE__ */ t(
|
|
502
|
+
function bt({ widget: e }) {
|
|
503
|
+
return /* @__PURE__ */ t(_e, { config: e.config ?? {} });
|
|
473
504
|
}
|
|
474
|
-
function
|
|
475
|
-
const r = e.config ?? {}, [
|
|
505
|
+
function gt({ widget: e }) {
|
|
506
|
+
const r = e.config ?? {}, [a, n] = q(!1);
|
|
476
507
|
return r.collection ? r.display === "drawer" ? /* @__PURE__ */ p("div", { className: "flex h-full items-center", children: [
|
|
477
508
|
/* @__PURE__ */ t(
|
|
478
509
|
"button",
|
|
@@ -483,7 +514,7 @@ function mt({ widget: e }) {
|
|
|
483
514
|
children: r.button_label ?? r.title ?? "Manage"
|
|
484
515
|
}
|
|
485
516
|
),
|
|
486
|
-
|
|
517
|
+
a && /* @__PURE__ */ t(
|
|
487
518
|
"div",
|
|
488
519
|
{
|
|
489
520
|
className: "fixed inset-0 z-50 flex justify-end bg-black/30",
|
|
@@ -496,7 +527,7 @@ function mt({ widget: e }) {
|
|
|
496
527
|
width: typeof r.sheet_width == "number" ? `${r.sheet_width}px` : r.sheet_width ?? "92%",
|
|
497
528
|
maxWidth: "96%"
|
|
498
529
|
},
|
|
499
|
-
onClick: (
|
|
530
|
+
onClick: (i) => i.stopPropagation(),
|
|
500
531
|
children: [
|
|
501
532
|
/* @__PURE__ */ p("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
502
533
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: r.button_label ?? r.title ?? "Manage" }),
|
|
@@ -510,24 +541,24 @@ function mt({ widget: e }) {
|
|
|
510
541
|
}
|
|
511
542
|
)
|
|
512
543
|
] }),
|
|
513
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
544
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(ye, { config: r }) })
|
|
514
545
|
]
|
|
515
546
|
}
|
|
516
547
|
)
|
|
517
548
|
}
|
|
518
549
|
)
|
|
519
|
-
] }) : /* @__PURE__ */ t(
|
|
550
|
+
] }) : /* @__PURE__ */ t(ye, { config: r }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Configure the record grid (collection)" });
|
|
520
551
|
}
|
|
521
|
-
function
|
|
552
|
+
function yt({
|
|
522
553
|
cfg: e
|
|
523
554
|
}) {
|
|
524
|
-
const [r,
|
|
555
|
+
const [r, a] = q(!1), n = { ...e };
|
|
525
556
|
return delete n.display, /* @__PURE__ */ p("div", { className: "flex h-full items-center", children: [
|
|
526
557
|
/* @__PURE__ */ t(
|
|
527
558
|
"button",
|
|
528
559
|
{
|
|
529
560
|
type: "button",
|
|
530
|
-
onClick: () =>
|
|
561
|
+
onClick: () => a(!0),
|
|
531
562
|
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",
|
|
532
563
|
children: e.button_label ?? e.label ?? "View"
|
|
533
564
|
}
|
|
@@ -536,7 +567,7 @@ function ut({
|
|
|
536
567
|
"div",
|
|
537
568
|
{
|
|
538
569
|
className: "fixed inset-0 z-50 flex justify-end bg-black/30",
|
|
539
|
-
onClick: () =>
|
|
570
|
+
onClick: () => a(!1),
|
|
540
571
|
children: /* @__PURE__ */ p(
|
|
541
572
|
"div",
|
|
542
573
|
{
|
|
@@ -545,7 +576,7 @@ function ut({
|
|
|
545
576
|
width: typeof e.sheet_width == "number" ? `${e.sheet_width}px` : e.sheet_width ?? "90%",
|
|
546
577
|
maxWidth: "96%"
|
|
547
578
|
},
|
|
548
|
-
onClick: (
|
|
579
|
+
onClick: (i) => i.stopPropagation(),
|
|
549
580
|
children: [
|
|
550
581
|
/* @__PURE__ */ p("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: [
|
|
551
582
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: e.button_label ?? e.label ?? "View" }),
|
|
@@ -553,13 +584,13 @@ function ut({
|
|
|
553
584
|
"button",
|
|
554
585
|
{
|
|
555
586
|
type: "button",
|
|
556
|
-
onClick: () =>
|
|
587
|
+
onClick: () => a(!1),
|
|
557
588
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
558
589
|
children: "Close"
|
|
559
590
|
}
|
|
560
591
|
)
|
|
561
592
|
] }),
|
|
562
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(
|
|
593
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(Ce, { config: n }) })
|
|
563
594
|
]
|
|
564
595
|
}
|
|
565
596
|
)
|
|
@@ -567,152 +598,168 @@ function ut({
|
|
|
567
598
|
)
|
|
568
599
|
] });
|
|
569
600
|
}
|
|
570
|
-
function
|
|
571
|
-
return e.display === "drawer" ? /* @__PURE__ */ t(
|
|
601
|
+
function _e({ config: e }) {
|
|
602
|
+
return e.display === "drawer" ? /* @__PURE__ */ t(yt, { cfg: e }) : /* @__PURE__ */ t(Ce, { config: e });
|
|
572
603
|
}
|
|
573
|
-
function
|
|
574
|
-
var
|
|
575
|
-
const r =
|
|
576
|
-
() =>
|
|
577
|
-
), [
|
|
578
|
-
|
|
579
|
-
|
|
604
|
+
function Ce({ config: e }) {
|
|
605
|
+
var me, ue, pe, he, xe, fe, be;
|
|
606
|
+
const r = D(), a = ke(), [n, i] = q(null), [m, s] = q(null), [l, o] = q(null), [u, x] = q(
|
|
607
|
+
() => mt(e.filters)
|
|
608
|
+
), [b] = q(
|
|
609
|
+
() => Qe(e.filters, typeof window > "u" ? "" : window.location.search)
|
|
610
|
+
), N = (c, h) => {
|
|
611
|
+
const g = { ...u, [c]: h };
|
|
612
|
+
if (x(g), typeof window > "u" || !(e.filters ?? []).some((k) => k.url_param)) return;
|
|
613
|
+
const f = ze(e.filters, g, window.location.search);
|
|
614
|
+
f !== window.location.search && window.history.replaceState(
|
|
615
|
+
window.history.state,
|
|
616
|
+
"",
|
|
617
|
+
`${window.location.pathname}${f}${window.location.hash}`
|
|
618
|
+
);
|
|
619
|
+
}, [S, W] = q(null), [C, j] = q(null), R = (C == null ? void 0 : C.phase) === "running", w = Ae();
|
|
620
|
+
ee(() => {
|
|
621
|
+
if ((C == null ? void 0 : C.phase) !== "running") return;
|
|
580
622
|
const c = window.setInterval(() => {
|
|
581
|
-
|
|
623
|
+
j(
|
|
582
624
|
(h) => (h == null ? void 0 : h.phase) === "running" ? { ...h, elapsedMs: Date.now() - h.startedAt } : h
|
|
583
625
|
);
|
|
584
626
|
}, 250);
|
|
585
627
|
return () => window.clearInterval(c);
|
|
586
|
-
}, [
|
|
587
|
-
const { scopes:
|
|
588
|
-
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
-
const c = (e.filters ?? []).filter(
|
|
592
|
-
|
|
593
|
-
|
|
628
|
+
}, [C == null ? void 0 : C.phase]);
|
|
629
|
+
const { scopes: $, ready: O } = Ge(), d = te(!1), [y, F] = q(!1), [z, K] = q(/* @__PURE__ */ new Set());
|
|
630
|
+
ee(() => {
|
|
631
|
+
if (d.current || !O) return;
|
|
632
|
+
d.current = !0;
|
|
633
|
+
const c = (e.filters ?? []).filter(
|
|
634
|
+
(h) => !(u[h.param] ?? []).length && !b.has(h.param)
|
|
635
|
+
);
|
|
636
|
+
if (!$ || !c.length) {
|
|
637
|
+
F(!0);
|
|
594
638
|
return;
|
|
595
639
|
}
|
|
596
640
|
(async () => {
|
|
597
641
|
try {
|
|
598
642
|
const h = {};
|
|
599
|
-
for (const
|
|
600
|
-
const
|
|
601
|
-
if (!
|
|
602
|
-
const
|
|
603
|
-
if (!
|
|
604
|
-
const
|
|
643
|
+
for (const g of c) {
|
|
644
|
+
const f = ge($, { key: g.param, collection: g.collection });
|
|
645
|
+
if (!f) continue;
|
|
646
|
+
const k = Ue($, f.name);
|
|
647
|
+
if (!k.length) continue;
|
|
648
|
+
const _ = g.value_field ?? "id", M = await He(
|
|
605
649
|
r,
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
650
|
+
f,
|
|
651
|
+
k,
|
|
652
|
+
_
|
|
609
653
|
);
|
|
610
|
-
|
|
654
|
+
if (M.length) {
|
|
655
|
+
const P = M.map((I, Me) => ({ [_]: I, id: k[Me] }));
|
|
656
|
+
h[g.param] = g.single ? P.slice(0, 1) : P;
|
|
657
|
+
}
|
|
611
658
|
}
|
|
612
|
-
Object.keys(h).length && (x((
|
|
613
|
-
const
|
|
614
|
-
for (const [
|
|
615
|
-
(
|
|
616
|
-
return
|
|
617
|
-
}),
|
|
659
|
+
Object.keys(h).length && (x((g) => {
|
|
660
|
+
const f = { ...g };
|
|
661
|
+
for (const [k, _] of Object.entries(h))
|
|
662
|
+
(f[k] ?? []).length || (f[k] = _);
|
|
663
|
+
return f;
|
|
664
|
+
}), K(new Set(Object.keys(h))));
|
|
618
665
|
} finally {
|
|
619
|
-
|
|
666
|
+
F(!0);
|
|
620
667
|
}
|
|
621
668
|
})();
|
|
622
|
-
}, [$,
|
|
623
|
-
const
|
|
669
|
+
}, [O, $, e.filters, u, r, b]);
|
|
670
|
+
const T = Pe(() => {
|
|
624
671
|
const c = { ...e.params ?? {} };
|
|
625
672
|
for (const h of e.filters ?? []) {
|
|
626
|
-
const
|
|
627
|
-
|
|
673
|
+
const g = u[h.param] ?? [];
|
|
674
|
+
g.length > 0 && (c[h.param] = g.map((f) => String(f[h.value_field ?? "id"] ?? "")).join(","));
|
|
628
675
|
}
|
|
629
676
|
return c;
|
|
630
|
-
}, [e.params, e.filters, u]),
|
|
631
|
-
data:
|
|
632
|
-
isPending:
|
|
633
|
-
error:
|
|
634
|
-
refetch:
|
|
635
|
-
isFetching:
|
|
636
|
-
} =
|
|
637
|
-
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(
|
|
677
|
+
}, [e.params, e.filters, u]), B = te(!1), {
|
|
678
|
+
data: A,
|
|
679
|
+
isPending: le,
|
|
680
|
+
error: ne,
|
|
681
|
+
refetch: se,
|
|
682
|
+
isFetching: qe
|
|
683
|
+
} = Q({
|
|
684
|
+
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(T)],
|
|
638
685
|
queryFn: () => {
|
|
639
|
-
const c =
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
params:
|
|
686
|
+
const c = B.current;
|
|
687
|
+
return B.current = !1, r.request(
|
|
688
|
+
U(`/custom-queries/${e.query_slug}/execute`, {
|
|
689
|
+
params: T,
|
|
643
690
|
...c ? { refresh: !0 } : {}
|
|
644
691
|
})
|
|
645
692
|
);
|
|
646
693
|
},
|
|
647
|
-
enabled: !!e.query_slug &&
|
|
694
|
+
enabled: !!e.query_slug && y,
|
|
648
695
|
staleTime: 6e4
|
|
649
|
-
}),
|
|
650
|
-
|
|
651
|
-
}, [
|
|
696
|
+
}), V = A == null ? void 0 : A.data, je = Fe(() => {
|
|
697
|
+
B.current = !0, se();
|
|
698
|
+
}, [se]), ie = le;
|
|
652
699
|
if (!e.query_slug) return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Set a query slug" });
|
|
653
|
-
const
|
|
654
|
-
var
|
|
700
|
+
const Re = (c) => {
|
|
701
|
+
var k;
|
|
655
702
|
const h = {};
|
|
656
|
-
for (const [
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
|
|
703
|
+
for (const [_, M] of Object.entries(c.params ?? {})) {
|
|
704
|
+
const P = Se(M, null, V ?? [], T, u, e.filters);
|
|
705
|
+
if (P === void 0) {
|
|
706
|
+
W(`Select a value for "${_}" first`);
|
|
660
707
|
return;
|
|
661
708
|
}
|
|
662
|
-
h[
|
|
709
|
+
h[_] = P;
|
|
663
710
|
}
|
|
664
|
-
const
|
|
711
|
+
const g = (k = c.confirm) == null ? void 0 : k.replace(/\{(\w+)\}/g, (_, M) => String(h[M] ?? "")), f = {
|
|
665
712
|
action: c,
|
|
666
713
|
params: h,
|
|
667
|
-
phase:
|
|
668
|
-
confirmText:
|
|
714
|
+
phase: g ? "confirm" : "running",
|
|
715
|
+
confirmText: g ?? null,
|
|
669
716
|
startedAt: Date.now(),
|
|
670
717
|
elapsedMs: 0
|
|
671
718
|
};
|
|
672
|
-
|
|
673
|
-
},
|
|
719
|
+
j(f), g || oe(f);
|
|
720
|
+
}, oe = async (c) => {
|
|
674
721
|
const h = Date.now();
|
|
675
|
-
|
|
722
|
+
j({ ...c, phase: "running", startedAt: h, elapsedMs: 0 });
|
|
676
723
|
try {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
),
|
|
680
|
-
|
|
681
|
-
(
|
|
682
|
-
...
|
|
724
|
+
const g = await r.request(
|
|
725
|
+
U(`/custom-queries/${c.action.query_slug}/execute`, { params: c.params })
|
|
726
|
+
), f = Array.isArray(g == null ? void 0 : g.data) ? g.data : [];
|
|
727
|
+
j(
|
|
728
|
+
(k) => k && k.action === c.action ? {
|
|
729
|
+
...k,
|
|
683
730
|
phase: "done",
|
|
684
731
|
elapsedMs: Date.now() - h,
|
|
685
|
-
resultRows:
|
|
686
|
-
resultSample:
|
|
687
|
-
} :
|
|
688
|
-
),
|
|
732
|
+
resultRows: f.length,
|
|
733
|
+
resultSample: f[0] ?? null
|
|
734
|
+
} : k
|
|
735
|
+
), W(
|
|
689
736
|
`${c.action.success_message ?? `${c.action.label} completed`} · ${G(Date.now() - h)}`
|
|
690
|
-
),
|
|
691
|
-
} catch (
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
(
|
|
695
|
-
),
|
|
737
|
+
), w.invalidateQueries({ queryKey: ["page-renderer-query", e.query_slug] });
|
|
738
|
+
} catch (g) {
|
|
739
|
+
const f = Ne(g, "unknown error");
|
|
740
|
+
j(
|
|
741
|
+
(k) => k && k.action === c.action ? { ...k, phase: "error", elapsedMs: Date.now() - h, error: f } : k
|
|
742
|
+
), W(`${c.action.label} failed: ${f}`);
|
|
696
743
|
}
|
|
697
|
-
},
|
|
698
|
-
|
|
744
|
+
}, We = /* @__PURE__ */ t(
|
|
745
|
+
Xe,
|
|
699
746
|
{
|
|
700
|
-
envelope:
|
|
701
|
-
onRefresh:
|
|
702
|
-
refreshing:
|
|
747
|
+
envelope: A,
|
|
748
|
+
onRefresh: je,
|
|
749
|
+
refreshing: qe && !le,
|
|
703
750
|
className: "ml-auto"
|
|
704
751
|
}
|
|
705
|
-
),
|
|
752
|
+
), J = e.filters && e.filters.length > 0 || (me = e.actions) != null && me.length || A != null && A.cache_ttl ? /* @__PURE__ */ p("div", { className: "flex flex-wrap items-center gap-2 pb-2", children: [
|
|
706
753
|
(e.filters ?? []).map((c) => {
|
|
707
|
-
const h =
|
|
754
|
+
const h = ge($, { key: c.param, collection: c.collection }), g = h ? ($ == null ? void 0 : $.restricted[h.name]) ?? [] : [];
|
|
708
755
|
return /* @__PURE__ */ t(
|
|
709
|
-
|
|
756
|
+
ft,
|
|
710
757
|
{
|
|
711
758
|
filter: c,
|
|
712
759
|
selected: u[c.param] ?? [],
|
|
713
|
-
allowedIds:
|
|
714
|
-
scopeDefault:
|
|
715
|
-
onChange: (
|
|
760
|
+
allowedIds: g.length > 0 ? g : void 0,
|
|
761
|
+
scopeDefault: z.has(c.param),
|
|
762
|
+
onChange: (f) => N(c.param, f)
|
|
716
763
|
},
|
|
717
764
|
c.param
|
|
718
765
|
);
|
|
@@ -721,140 +768,141 @@ function $e({ config: e }) {
|
|
|
721
768
|
"button",
|
|
722
769
|
{
|
|
723
770
|
type: "button",
|
|
724
|
-
disabled:
|
|
725
|
-
onClick: () => void
|
|
771
|
+
disabled: R,
|
|
772
|
+
onClick: () => void Re(c),
|
|
726
773
|
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",
|
|
727
|
-
children:
|
|
774
|
+
children: R ? "Running…" : c.label
|
|
728
775
|
},
|
|
729
776
|
c.label
|
|
730
777
|
)),
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
] }) : null,
|
|
734
|
-
|
|
778
|
+
S && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: S }),
|
|
779
|
+
We
|
|
780
|
+
] }) : null, de = (ue = e.stats) != null && ue.length ? /* @__PURE__ */ t(
|
|
781
|
+
et,
|
|
735
782
|
{
|
|
736
783
|
stats: e.stats,
|
|
737
|
-
rows:
|
|
738
|
-
effectiveParams:
|
|
739
|
-
loading:
|
|
784
|
+
rows: V ?? [],
|
|
785
|
+
effectiveParams: T,
|
|
786
|
+
loading: ie
|
|
740
787
|
}
|
|
741
788
|
) : null;
|
|
742
|
-
if (
|
|
789
|
+
if (ie)
|
|
743
790
|
return /* @__PURE__ */ p("div", { className: "p-3", children: [
|
|
744
|
-
|
|
745
|
-
|
|
791
|
+
J,
|
|
792
|
+
de,
|
|
746
793
|
/* @__PURE__ */ t(H, {})
|
|
747
794
|
] });
|
|
748
|
-
if (
|
|
795
|
+
if (ne)
|
|
749
796
|
return /* @__PURE__ */ p("div", { className: "p-3", children: [
|
|
750
|
-
|
|
751
|
-
/* @__PURE__ */ t(
|
|
797
|
+
J,
|
|
798
|
+
/* @__PURE__ */ t(Y, { error: ne })
|
|
752
799
|
] });
|
|
753
|
-
const
|
|
754
|
-
const
|
|
755
|
-
|
|
800
|
+
const v = e.row_click, ce = (c, h) => {
|
|
801
|
+
const f = Ve(c, (_) => ut(
|
|
802
|
+
_,
|
|
756
803
|
h,
|
|
757
|
-
|
|
758
|
-
|
|
804
|
+
V ?? [],
|
|
805
|
+
T,
|
|
759
806
|
u,
|
|
760
807
|
e.filters
|
|
761
|
-
)),
|
|
762
|
-
if ("matrix" in
|
|
763
|
-
const
|
|
764
|
-
for (const [
|
|
765
|
-
|
|
808
|
+
)), k = f.resolvedTabs.map((_) => {
|
|
809
|
+
if ("matrix" in _) {
|
|
810
|
+
const M = {};
|
|
811
|
+
for (const [P, I] of Object.entries(_.matrix.scope))
|
|
812
|
+
M[P] = I.startsWith("$row.") ? h == null ? void 0 : h[I.slice(5)] : I;
|
|
766
813
|
return {
|
|
767
|
-
label:
|
|
768
|
-
matrix: { config:
|
|
814
|
+
label: _.label,
|
|
815
|
+
matrix: { config: _.matrix.config, initialScope: M }
|
|
769
816
|
};
|
|
770
817
|
}
|
|
771
|
-
return { label:
|
|
818
|
+
return { label: _.label, note: _.note, config: _.config };
|
|
772
819
|
});
|
|
773
|
-
|
|
820
|
+
o({
|
|
774
821
|
def: {
|
|
775
822
|
...c,
|
|
776
|
-
resolvedTabs:
|
|
777
|
-
header:
|
|
778
|
-
config:
|
|
779
|
-
stats:
|
|
780
|
-
asOf:
|
|
823
|
+
resolvedTabs: k,
|
|
824
|
+
header: f.header ? {
|
|
825
|
+
config: f.header.config,
|
|
826
|
+
stats: f.header.stats,
|
|
827
|
+
asOf: f.header.asOf,
|
|
828
|
+
note: f.header.note
|
|
781
829
|
} : null,
|
|
782
|
-
initialTab:
|
|
830
|
+
initialTab: f.initialTab
|
|
783
831
|
},
|
|
784
832
|
row: h
|
|
785
833
|
});
|
|
786
|
-
},
|
|
787
|
-
|
|
788
|
-
collection:
|
|
834
|
+
}, Te = v ? (c) => {
|
|
835
|
+
v.picker ? i(c) : v.sheet ? ce(v.sheet, c) : v.matrix && c.id != null ? s(c.id) : v.drill && c.id != null && (a == null || a.open({
|
|
836
|
+
collection: v.drill.collection ?? "",
|
|
789
837
|
itemId: String(c.id),
|
|
790
|
-
layoutId:
|
|
791
|
-
width:
|
|
838
|
+
layoutId: v.drill.layout_id,
|
|
839
|
+
width: v.drill.width
|
|
792
840
|
}));
|
|
793
|
-
} : void 0,
|
|
841
|
+
} : void 0, Oe = (pe = e.row_actions) != null && pe.length ? e.row_actions.map((c) => ({
|
|
794
842
|
label: c.label,
|
|
795
|
-
onClick: (h) =>
|
|
843
|
+
onClick: (h) => ce(c.sheet, h)
|
|
796
844
|
})) : void 0;
|
|
797
845
|
return /* @__PURE__ */ p(
|
|
798
846
|
"div",
|
|
799
847
|
{
|
|
800
|
-
className: (
|
|
848
|
+
className: (he = e.table) != null && he.sticky ? (
|
|
801
849
|
// Sticky grids own their scroll: filters/stats stay pinned above a
|
|
802
850
|
// scrolling table region (header/first-column/totals pin inside it).
|
|
803
851
|
"flex h-full min-h-0 flex-col overflow-hidden p-3"
|
|
804
852
|
) : "h-full overflow-auto p-3",
|
|
805
853
|
children: [
|
|
806
|
-
|
|
807
|
-
|
|
854
|
+
J,
|
|
855
|
+
de,
|
|
808
856
|
/* @__PURE__ */ t(
|
|
809
|
-
|
|
857
|
+
tt,
|
|
810
858
|
{
|
|
811
|
-
rows:
|
|
859
|
+
rows: V ?? [],
|
|
812
860
|
config: (
|
|
813
861
|
// Current-month highlight only applies when the selected year param
|
|
814
862
|
// IS the current year — otherwise strip it.
|
|
815
|
-
(
|
|
816
|
-
String(
|
|
863
|
+
(xe = e.table) != null && xe.highlight_group && e.table.highlight_year_param ? Number(
|
|
864
|
+
String(T[e.table.highlight_year_param] ?? "").split(",")[0]
|
|
817
865
|
) === (/* @__PURE__ */ new Date()).getFullYear() ? e.table : { ...e.table, highlight_group: void 0 } : e.table
|
|
818
866
|
),
|
|
819
|
-
onRowClick:
|
|
820
|
-
rowActions:
|
|
867
|
+
onRowClick: Te,
|
|
868
|
+
rowActions: Oe,
|
|
821
869
|
emptyText: e.empty_label,
|
|
822
|
-
pivotYear: (
|
|
870
|
+
pivotYear: (be = (fe = e.table) == null ? void 0 : fe.pivot) != null && be.year_param && Number(String(T[e.table.pivot.year_param] ?? "").split(",")[0]) || void 0
|
|
823
871
|
}
|
|
824
872
|
),
|
|
825
|
-
(
|
|
873
|
+
(v == null ? void 0 : v.picker) && n && /* @__PURE__ */ t(
|
|
826
874
|
"div",
|
|
827
875
|
{
|
|
828
876
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-black/30 pt-32",
|
|
829
|
-
onClick: () =>
|
|
877
|
+
onClick: () => i(null),
|
|
830
878
|
children: /* @__PURE__ */ p(
|
|
831
879
|
"div",
|
|
832
880
|
{
|
|
833
881
|
className: "w-[420px] rounded-lg border border-slate-200 bg-white p-4 shadow-xl dark:border-border dark:bg-background",
|
|
834
882
|
onClick: (c) => c.stopPropagation(),
|
|
835
883
|
children: [
|
|
836
|
-
/* @__PURE__ */ t("p", { className: "mb-2 text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
884
|
+
/* @__PURE__ */ t("p", { className: "mb-2 text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: v.picker.title ?? "Choose a record" }),
|
|
837
885
|
/* @__PURE__ */ t(
|
|
838
|
-
|
|
886
|
+
Ze,
|
|
839
887
|
{
|
|
840
|
-
collection:
|
|
888
|
+
collection: v.picker.collection,
|
|
841
889
|
value: null,
|
|
842
890
|
onChange: (c) => {
|
|
843
|
-
var h,
|
|
844
|
-
if (
|
|
845
|
-
if (
|
|
846
|
-
|
|
891
|
+
var h, g, f, k;
|
|
892
|
+
if (i(null), c != null) {
|
|
893
|
+
if (v.matrix) {
|
|
894
|
+
s(c);
|
|
847
895
|
return;
|
|
848
896
|
}
|
|
849
|
-
|
|
850
|
-
collection: ((h =
|
|
897
|
+
a == null || a.open({
|
|
898
|
+
collection: ((h = v.drill) == null ? void 0 : h.collection) ?? ((g = v.picker) == null ? void 0 : g.collection) ?? "",
|
|
851
899
|
itemId: String(c),
|
|
852
|
-
layoutId: (
|
|
853
|
-
width: (
|
|
900
|
+
layoutId: (f = v.drill) == null ? void 0 : f.layout_id,
|
|
901
|
+
width: (k = v.drill) == null ? void 0 : k.width
|
|
854
902
|
});
|
|
855
903
|
}
|
|
856
904
|
},
|
|
857
|
-
extraFilter:
|
|
905
|
+
extraFilter: xt(v.picker.filter, n, u, e.filters),
|
|
858
906
|
placeholder: "Search…"
|
|
859
907
|
}
|
|
860
908
|
),
|
|
@@ -862,7 +910,7 @@ function $e({ config: e }) {
|
|
|
862
910
|
"button",
|
|
863
911
|
{
|
|
864
912
|
type: "button",
|
|
865
|
-
onClick: () =>
|
|
913
|
+
onClick: () => i(null),
|
|
866
914
|
className: "mt-3 h-7 rounded px-2 text-[12px] text-slate-500 hover:text-slate-700",
|
|
867
915
|
children: "Cancel"
|
|
868
916
|
}
|
|
@@ -872,24 +920,24 @@ function $e({ config: e }) {
|
|
|
872
920
|
)
|
|
873
921
|
}
|
|
874
922
|
),
|
|
875
|
-
(
|
|
876
|
-
|
|
923
|
+
(v == null ? void 0 : v.matrix) && m != null && /* @__PURE__ */ t(
|
|
924
|
+
$e,
|
|
877
925
|
{
|
|
878
|
-
config:
|
|
879
|
-
initialScope: { [
|
|
880
|
-
width:
|
|
881
|
-
title:
|
|
882
|
-
onClose: () =>
|
|
926
|
+
config: v.matrix.config,
|
|
927
|
+
initialScope: { [v.matrix.scope_field]: m },
|
|
928
|
+
width: v.matrix.width,
|
|
929
|
+
title: v.matrix.title,
|
|
930
|
+
onClose: () => s(null)
|
|
883
931
|
}
|
|
884
932
|
),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
933
|
+
l && /* @__PURE__ */ t(ht, { def: l.def, row: l.row, onClose: () => o(null) }),
|
|
934
|
+
C && /* @__PURE__ */ t(
|
|
935
|
+
vt,
|
|
888
936
|
{
|
|
889
|
-
run:
|
|
890
|
-
onConfirm: () => void
|
|
937
|
+
run: C,
|
|
938
|
+
onConfirm: () => void oe(C),
|
|
891
939
|
onClose: () => {
|
|
892
|
-
|
|
940
|
+
j(null);
|
|
893
941
|
}
|
|
894
942
|
}
|
|
895
943
|
)
|
|
@@ -898,20 +946,20 @@ function $e({ config: e }) {
|
|
|
898
946
|
);
|
|
899
947
|
}
|
|
900
948
|
const G = (e) => e < 6e4 ? `${(e / 1e3).toFixed(e < 1e4 ? 1 : 0)}s` : `${Math.floor(e / 6e4)}m ${Math.round(e % 6e4 / 1e3)}s`;
|
|
901
|
-
function
|
|
949
|
+
function vt({
|
|
902
950
|
run: e,
|
|
903
951
|
onConfirm: r,
|
|
904
|
-
onClose:
|
|
952
|
+
onClose: a
|
|
905
953
|
}) {
|
|
906
954
|
const n = Object.entries(e.params);
|
|
907
|
-
return
|
|
908
|
-
/* @__PURE__ */ p(
|
|
955
|
+
return Be(
|
|
956
|
+
/* @__PURE__ */ p(E, { children: [
|
|
909
957
|
/* @__PURE__ */ t(
|
|
910
958
|
"div",
|
|
911
959
|
{
|
|
912
960
|
role: "presentation",
|
|
913
961
|
className: "fixed inset-0 z-40 bg-slate-950/40",
|
|
914
|
-
onClick: e.phase === "running" ? void 0 :
|
|
962
|
+
onClick: e.phase === "running" ? void 0 : a
|
|
915
963
|
}
|
|
916
964
|
),
|
|
917
965
|
/* @__PURE__ */ p(
|
|
@@ -923,11 +971,11 @@ function pt({
|
|
|
923
971
|
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",
|
|
924
972
|
children: [
|
|
925
973
|
/* @__PURE__ */ t("p", { className: "text-[13.5px] font-semibold text-slate-900 dark:text-foreground", children: e.action.label }),
|
|
926
|
-
n.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: n.map(([
|
|
927
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children:
|
|
974
|
+
n.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: n.map(([i, m]) => /* @__PURE__ */ p("div", { className: "flex gap-2", children: [
|
|
975
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: L(i) }),
|
|
928
976
|
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(m) })
|
|
929
|
-
] },
|
|
930
|
-
e.phase === "confirm" && /* @__PURE__ */ p(
|
|
977
|
+
] }, i)) }),
|
|
978
|
+
e.phase === "confirm" && /* @__PURE__ */ p(E, { children: [
|
|
931
979
|
/* @__PURE__ */ t("p", { className: "mt-2 text-[12.5px] text-slate-600 dark:text-slate-300", children: e.confirmText }),
|
|
932
980
|
/* @__PURE__ */ p("div", { className: "mt-3 flex gap-2", children: [
|
|
933
981
|
/* @__PURE__ */ t(
|
|
@@ -943,7 +991,7 @@ function pt({
|
|
|
943
991
|
"button",
|
|
944
992
|
{
|
|
945
993
|
type: "button",
|
|
946
|
-
onClick:
|
|
994
|
+
onClick: a,
|
|
947
995
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300",
|
|
948
996
|
children: "Cancel"
|
|
949
997
|
}
|
|
@@ -955,17 +1003,17 @@ function pt({
|
|
|
955
1003
|
"Running… ",
|
|
956
1004
|
/* @__PURE__ */ t("span", { className: "tabular-nums", children: G(e.elapsedMs) })
|
|
957
1005
|
] }),
|
|
958
|
-
e.phase === "done" && /* @__PURE__ */ p(
|
|
1006
|
+
e.phase === "done" && /* @__PURE__ */ p(E, { children: [
|
|
959
1007
|
/* @__PURE__ */ p("p", { className: "mt-2 text-[12.5px] font-medium text-emerald-600 dark:text-emerald-400", children: [
|
|
960
1008
|
e.action.success_message ?? "Completed",
|
|
961
1009
|
" · ",
|
|
962
1010
|
G(e.elapsedMs)
|
|
963
1011
|
] }),
|
|
964
1012
|
e.resultRows != null && e.resultRows > 0 && e.resultSample && /* @__PURE__ */ p("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: [
|
|
965
|
-
Object.entries(e.resultSample).slice(0, 8).map(([
|
|
966
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children:
|
|
1013
|
+
Object.entries(e.resultSample).slice(0, 8).map(([i, m]) => /* @__PURE__ */ p("div", { className: "flex gap-2", children: [
|
|
1014
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: L(i) }),
|
|
967
1015
|
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(m ?? "—") })
|
|
968
|
-
] },
|
|
1016
|
+
] }, i)),
|
|
969
1017
|
e.resultRows > 1 && /* @__PURE__ */ p("p", { className: "pt-0.5 text-slate-400", children: [
|
|
970
1018
|
"…",
|
|
971
1019
|
e.resultRows,
|
|
@@ -976,13 +1024,13 @@ function pt({
|
|
|
976
1024
|
"button",
|
|
977
1025
|
{
|
|
978
1026
|
type: "button",
|
|
979
|
-
onClick:
|
|
1027
|
+
onClick: a,
|
|
980
1028
|
className: "mt-3 h-8 w-full rounded-md border border-slate-200 text-[12.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300",
|
|
981
1029
|
children: "Close"
|
|
982
1030
|
}
|
|
983
1031
|
)
|
|
984
1032
|
] }),
|
|
985
|
-
e.phase === "error" && /* @__PURE__ */ p(
|
|
1033
|
+
e.phase === "error" && /* @__PURE__ */ p(E, { children: [
|
|
986
1034
|
/* @__PURE__ */ p("p", { className: "mt-2 text-[12.5px] font-medium text-red-600 dark:text-red-400", children: [
|
|
987
1035
|
"Failed after ",
|
|
988
1036
|
G(e.elapsedMs),
|
|
@@ -1003,7 +1051,7 @@ function pt({
|
|
|
1003
1051
|
"button",
|
|
1004
1052
|
{
|
|
1005
1053
|
type: "button",
|
|
1006
|
-
onClick:
|
|
1054
|
+
onClick: a,
|
|
1007
1055
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300",
|
|
1008
1056
|
children: "Close"
|
|
1009
1057
|
}
|
|
@@ -1017,124 +1065,124 @@ function pt({
|
|
|
1017
1065
|
document.body
|
|
1018
1066
|
);
|
|
1019
1067
|
}
|
|
1020
|
-
function
|
|
1021
|
-
var
|
|
1068
|
+
function ve({ slug: e, widget: r }) {
|
|
1069
|
+
var a;
|
|
1022
1070
|
switch (r.type) {
|
|
1023
1071
|
case "table":
|
|
1024
|
-
return /* @__PURE__ */ t(
|
|
1072
|
+
return /* @__PURE__ */ t(st, { slug: e, widget: r });
|
|
1025
1073
|
case "kpi":
|
|
1026
|
-
return /* @__PURE__ */ t(
|
|
1074
|
+
return /* @__PURE__ */ t(it, { slug: e, widget: r });
|
|
1027
1075
|
case "markdown":
|
|
1028
|
-
return /* @__PURE__ */ t(
|
|
1076
|
+
return /* @__PURE__ */ t(nt, { content: String(((a = r.config) == null ? void 0 : a.content) ?? "") });
|
|
1029
1077
|
case "iframe":
|
|
1030
|
-
return /* @__PURE__ */ t(
|
|
1078
|
+
return /* @__PURE__ */ t(dt, { widget: r });
|
|
1031
1079
|
case "query":
|
|
1032
|
-
return /* @__PURE__ */ t(
|
|
1080
|
+
return /* @__PURE__ */ t(bt, { widget: r });
|
|
1033
1081
|
case "matrix":
|
|
1034
|
-
return /* @__PURE__ */ t(
|
|
1082
|
+
return /* @__PURE__ */ t(ct, { widget: r });
|
|
1035
1083
|
case "record-grid":
|
|
1036
|
-
return /* @__PURE__ */ t(
|
|
1084
|
+
return /* @__PURE__ */ t(gt, { widget: r });
|
|
1037
1085
|
case "recent-activity":
|
|
1038
|
-
return /* @__PURE__ */ t(
|
|
1086
|
+
return /* @__PURE__ */ t(ot, { slug: e, widget: r });
|
|
1039
1087
|
default:
|
|
1040
1088
|
return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Unknown widget" });
|
|
1041
1089
|
}
|
|
1042
1090
|
}
|
|
1043
|
-
function
|
|
1044
|
-
var
|
|
1045
|
-
const n =
|
|
1046
|
-
data:
|
|
1047
|
-
isLoading:
|
|
1091
|
+
function It({ slug: e, hideHeader: r, className: a }) {
|
|
1092
|
+
var $, O;
|
|
1093
|
+
const n = D(), i = ke(), m = Ee("drill.page"), s = m.value, {
|
|
1094
|
+
data: l,
|
|
1095
|
+
isLoading: o,
|
|
1048
1096
|
error: u
|
|
1049
|
-
} =
|
|
1097
|
+
} = Q({
|
|
1050
1098
|
queryKey: ["page-renderer", e],
|
|
1051
|
-
queryFn: () => n.request(
|
|
1099
|
+
queryFn: () => n.request(we(`/pages/${e}`)).then((d) => d.data),
|
|
1052
1100
|
enabled: !!e,
|
|
1053
1101
|
retry: !1
|
|
1054
1102
|
});
|
|
1055
|
-
if (
|
|
1056
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1057
|
-
if (u || !
|
|
1103
|
+
if (o)
|
|
1104
|
+
return /* @__PURE__ */ t("div", { className: a ?? "p-6", children: /* @__PURE__ */ t(H, {}) });
|
|
1105
|
+
if (u || !l)
|
|
1058
1106
|
return /* @__PURE__ */ p(
|
|
1059
1107
|
"div",
|
|
1060
1108
|
{
|
|
1061
|
-
className: `flex flex-col items-center justify-center p-10 text-center ${
|
|
1109
|
+
className: `flex flex-col items-center justify-center p-10 text-center ${a ?? ""}`,
|
|
1062
1110
|
children: [
|
|
1063
1111
|
/* @__PURE__ */ t("p", { className: "text-sm font-medium text-slate-600 dark:text-slate-300", children: "Page not found" }),
|
|
1064
1112
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-slate-400", children: "This page does not exist or you do not have access to it." })
|
|
1065
1113
|
]
|
|
1066
1114
|
}
|
|
1067
1115
|
);
|
|
1068
|
-
const x = ((
|
|
1069
|
-
var
|
|
1070
|
-
return (
|
|
1071
|
-
},
|
|
1072
|
-
y:
|
|
1073
|
-
items:
|
|
1074
|
-
})),
|
|
1075
|
-
var
|
|
1076
|
-
return (
|
|
1077
|
-
}),
|
|
1078
|
-
!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:
|
|
1079
|
-
/* @__PURE__ */ t("div", { className: `min-h-0 flex-1 overflow-y-auto ${
|
|
1080
|
-
|
|
1116
|
+
const x = (($ = l.layout) == null ? void 0 : $.columns) ?? 12, b = ((O = l.layout) == null ? void 0 : O.widgets) ?? [], N = (d) => {
|
|
1117
|
+
var y;
|
|
1118
|
+
return (d.type === "matrix" || d.type === "query" || d.type === "record-grid") && ((y = d.config) == null ? void 0 : y.display) === "drawer";
|
|
1119
|
+
}, S = [...new Set(b.filter(N).map((d) => d.y))].filter((d) => b.every((y) => N(y) || d < y.y || d >= y.y + Math.max(y.h, 1))).sort((d, y) => d - y), W = S.map((d) => ({
|
|
1120
|
+
y: d,
|
|
1121
|
+
items: b.filter((y) => y.y === d && N(y)).sort((y, F) => y.x - F.x)
|
|
1122
|
+
})), C = b.filter((d) => !(N(d) && S.includes(d.y))), j = (d) => d - S.filter((y) => y < d).length, R = C.find((d) => {
|
|
1123
|
+
var y;
|
|
1124
|
+
return (y = d.config) == null ? void 0 : y.full_height;
|
|
1125
|
+
}), w = /* @__PURE__ */ p("div", { className: `flex h-full min-h-0 flex-col ${a ?? ""}`, children: [
|
|
1126
|
+
!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: l.name }) }),
|
|
1127
|
+
/* @__PURE__ */ t("div", { className: `min-h-0 flex-1 overflow-y-auto ${R ? "flex flex-col" : ""}`, children: b.length === 0 ? /* @__PURE__ */ t("p", { className: "p-6 text-center text-[13px] text-slate-400", children: "This page has no widgets yet." }) : /* @__PURE__ */ p(E, { children: [
|
|
1128
|
+
W.map((d) => /* @__PURE__ */ t("div", { className: "mb-3 flex shrink-0 flex-wrap items-center gap-2", children: d.items.map((y) => /* @__PURE__ */ t(ve, { slug: l.slug, widget: y }, y.id)) }, d.y)),
|
|
1081
1129
|
/* @__PURE__ */ t(
|
|
1082
1130
|
"div",
|
|
1083
1131
|
{
|
|
1084
|
-
className:
|
|
1132
|
+
className: R ? "grid min-h-0 flex-1 gap-4" : "grid gap-4",
|
|
1085
1133
|
style: {
|
|
1086
1134
|
gridTemplateColumns: `repeat(${x}, minmax(0, 1fr))`,
|
|
1087
1135
|
// repeat(0, …) is INVALID CSS (count must be ≥1) and drops the
|
|
1088
1136
|
// whole declaration — a fill widget in the first row band emits
|
|
1089
1137
|
// just the stretching track.
|
|
1090
|
-
...
|
|
1091
|
-
gridTemplateRows: `${
|
|
1138
|
+
...R ? {
|
|
1139
|
+
gridTemplateRows: `${j(R.y) > 0 ? `repeat(${j(R.y)}, ${X}px) ` : ""}minmax(${X * 3}px, 1fr)`
|
|
1092
1140
|
} : {},
|
|
1093
|
-
gridAutoRows: `${
|
|
1141
|
+
gridAutoRows: `${X}px`
|
|
1094
1142
|
},
|
|
1095
|
-
children:
|
|
1096
|
-
var
|
|
1097
|
-
const
|
|
1143
|
+
children: C.map((d) => {
|
|
1144
|
+
var z, K, T, B;
|
|
1145
|
+
const y = (d.type === "matrix" || d.type === "query" || d.type === "record-grid") && ((z = d.config) == null ? void 0 : z.display) === "drawer", F = d === R;
|
|
1098
1146
|
return /* @__PURE__ */ p(
|
|
1099
1147
|
"div",
|
|
1100
1148
|
{
|
|
1101
|
-
className:
|
|
1149
|
+
className: y ? "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",
|
|
1102
1150
|
style: {
|
|
1103
|
-
gridColumn: `${Math.min(
|
|
1104
|
-
gridRow:
|
|
1151
|
+
gridColumn: `${Math.min(d.x, x - 1) + 1} / span ${Math.min(d.w, x)}`,
|
|
1152
|
+
gridRow: F ? `${j(d.y) + 1} / -1` : `${j(d.y) + 1} / span ${Math.max(d.h, 1)}`
|
|
1105
1153
|
},
|
|
1106
1154
|
children: [
|
|
1107
|
-
!
|
|
1108
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ t(
|
|
1155
|
+
!y && d.type !== "kpi" && d.type !== "markdown" && ((K = d.config) == null ? void 0 : K.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(((T = d.config) == null ? void 0 : T.label) ?? "") || (typeof ((B = d.config) == null ? void 0 : B.collection) == "string" ? L(String(d.config.collection)) : L(d.type)) }),
|
|
1156
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ t(ve, { slug: l.slug, widget: d }) })
|
|
1109
1157
|
]
|
|
1110
1158
|
},
|
|
1111
|
-
|
|
1159
|
+
d.id
|
|
1112
1160
|
);
|
|
1113
1161
|
})
|
|
1114
1162
|
}
|
|
1115
1163
|
)
|
|
1116
1164
|
] }) })
|
|
1117
1165
|
] });
|
|
1118
|
-
return
|
|
1119
|
-
|
|
1120
|
-
|
|
1166
|
+
return i ? w : /* @__PURE__ */ p(Le.Provider, { value: { open: (d) => m.push([d]) }, children: [
|
|
1167
|
+
s != null && s.length ? /* @__PURE__ */ t(
|
|
1168
|
+
rt,
|
|
1121
1169
|
{
|
|
1122
|
-
collection:
|
|
1123
|
-
itemId:
|
|
1124
|
-
layoutId:
|
|
1125
|
-
width:
|
|
1126
|
-
title:
|
|
1127
|
-
stack:
|
|
1128
|
-
onPush: (
|
|
1170
|
+
collection: s[0].collection,
|
|
1171
|
+
itemId: s[0].itemId,
|
|
1172
|
+
layoutId: s[0].layoutId,
|
|
1173
|
+
width: s[0].width,
|
|
1174
|
+
title: s[0].title,
|
|
1175
|
+
stack: s,
|
|
1176
|
+
onPush: (d) => m.push([...s, d]),
|
|
1129
1177
|
onPop: () => m.back(),
|
|
1130
|
-
onClose: () => m.back(
|
|
1178
|
+
onClose: () => m.back(s.length)
|
|
1131
1179
|
}
|
|
1132
1180
|
) : null,
|
|
1133
|
-
|
|
1181
|
+
w
|
|
1134
1182
|
] });
|
|
1135
1183
|
}
|
|
1136
1184
|
export {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1185
|
+
It as PageRenderer,
|
|
1186
|
+
_e as QueryWidgetView,
|
|
1187
|
+
gt as RecordGridWidgetBody
|
|
1140
1188
|
};
|