react-semaphor 0.1.311 → 0.1.313
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/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/{braces-DwaAt32i.js → braces-NfG5hX2c.js} +1 -1
- package/dist/chunks/{braces-CSECDaJQ.js → braces-raPCNcS4.js} +1 -1
- package/dist/chunks/{chevrons-up-down-DJhB8JNW.js → chevrons-up-down-BYzO4q5w.js} +1 -1
- package/dist/chunks/{chevrons-up-down-3vBEM7eI.js → chevrons-up-down-DiWloubI.js} +1 -1
- package/dist/chunks/dashboard-controls-DMsmUQkB.js +2043 -0
- package/dist/chunks/dashboard-controls-wPVXTTiH.js +57 -0
- package/dist/chunks/dashboard-filter-controls-launcher-CqXgWEa1.js +1540 -0
- package/dist/chunks/dashboard-filter-controls-launcher-DBmNn4EY.js +11 -0
- package/dist/chunks/{dashboard-json-GL_IXTCk.js → dashboard-json-CHoCrAp0.js} +2 -2
- package/dist/chunks/{dashboard-json-B_rQbUUz.js → dashboard-json-DMFZLkws.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-CcszMc1A.js → dashboard-summary-settings-dialog-CZkn4rtm.js} +3 -3
- package/dist/chunks/{dashboard-summary-settings-dialog-DgqFlYl9.js → dashboard-summary-settings-dialog-DoxcpXjk.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-nGSsSTYx.js → edit-dashboard-visual-B0Ae_O25.js} +4534 -4470
- package/dist/chunks/edit-dashboard-visual-CIP9G-Bu.js +183 -0
- package/dist/chunks/{index-9v7DehZd.js → index-D7e2Eyp_.js} +34869 -34317
- package/dist/chunks/{index-CGCrm-dj.js → index-DjZqoaV5.js} +228 -228
- package/dist/chunks/{palette-CI2J34i6.js → palette-7yJYVEvk.js} +1 -1
- package/dist/chunks/{palette-C5o9bLo6.js → palette-CJTdBzJB.js} +1 -1
- package/dist/chunks/{resource-management-panel-CNmVHnCz.js → resource-management-panel-B1mhnY97.js} +1 -1
- package/dist/chunks/{resource-management-panel-DTg9_DI9.js → resource-management-panel-CSkNW3es.js} +3 -3
- package/dist/chunks/{save-CMv91_Hz.js → save-B8x5Vi0W.js} +1 -1
- package/dist/chunks/{save-Cpz6BWx9.js → save-DDX_vrED.js} +1 -1
- package/dist/chunks/{switch-Dhoqe3OE.js → switch-DEPWsRhf.js} +114 -113
- package/dist/chunks/{switch-otrSiyjH.js → switch-DPaKnsb8.js} +14 -14
- package/dist/chunks/use-create-flow-overlay-state-7LiC_vaL.js +16 -0
- package/dist/chunks/{use-create-flow-overlay-state-C8WGfC8T.js → use-create-flow-overlay-state-BHQjJwik.js} +511 -483
- package/dist/chunks/{use-visual-utils-BeJ73yvV.js → use-visual-utils-Bz7kjSrk.js} +1 -1
- package/dist/chunks/{use-visual-utils-RkPa2gqQ.js → use-visual-utils-Dw-uLgop.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +76 -74
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +1 -1
- package/dist/types/main.d.ts +76 -23
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/surfboard.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-CeKjYa7s.js +0 -2274
- package/dist/chunks/dashboard-controls-Ds8Hmo3Q.js +0 -57
- package/dist/chunks/dashboard-filter-controls-button-CWL2jJcu.js +0 -11
- package/dist/chunks/dashboard-filter-controls-button-Tk5lhwVV.js +0 -1116
- package/dist/chunks/edit-dashboard-visual-Bu2rxJjm.js +0 -183
- package/dist/chunks/use-create-flow-overlay-state-DiH6M1Cd.js +0 -16
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { c as De, n as L,
|
|
2
|
-
import {
|
|
3
|
-
import { a$ as
|
|
4
|
-
import {
|
|
5
|
-
import { u as we } from "./use-visual-utils-
|
|
6
|
-
import { S as nt } from "./save-
|
|
1
|
+
import { c as De, n as L, l as le, u as ne, z as ft, A as ht, D as bt, a as oe, F as gt, a8 as yt, B as V, e as xt, X as Ke, m as Ye, f as Ge, a9 as vt, aa as Ct, ab as re, ac as Ae, ad as ze, ae as be, af as ge, ag as kt, ah as Oe, ai as Nt, aj as St, ak as se, al as Dt, am as Me, G as Be, an as Xe, ao as He, ap as Je, L as Y, I as We, g as ye, h as xe, i as ve, j as Ce, k as ke, aq as Ze, ar as wt, as as It, at as Qe, au as Tt, av as je, aw as Et, ax as Ne } from "./switch-DEPWsRhf.js";
|
|
2
|
+
import { useEffect as ie, useMemo as z, useState as j, useRef as Se, useCallback as M, Fragment as Vt } from "react";
|
|
3
|
+
import { a$ as qt, b0 as et, b1 as _t, b2 as Ft, b3 as Lt, b4 as At, b5 as zt, V as Ot, P as Mt, q as ce, b6 as tt, s as at, b7 as rt, b8 as Bt, o as Q, b9 as Qt, ba as jt, bb as Re, bc as Rt, bd as Ut, be as st, bf as lt, bg as Pt, bh as $t, bi as Kt, bj as Yt, bk as Gt, bl as Xt, bm as Ht, bn as Jt } from "./index-D7e2Eyp_.js";
|
|
4
|
+
import { jsx as t, jsxs as d, Fragment as $ } from "react/jsx-runtime";
|
|
5
|
+
import { u as we } from "./use-visual-utils-Dw-uLgop.js";
|
|
6
|
+
import { S as nt } from "./save-DDX_vrED.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const ua = De("CircleX", [
|
|
14
14
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
15
15
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
16
16
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -21,7 +21,7 @@ const ca = De("CircleX", [
|
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const Wt = De("Library", [
|
|
25
25
|
["path", { d: "m16 6 4 14", key: "ji33uf" }],
|
|
26
26
|
["path", { d: "M12 6v14", key: "1n7gus" }],
|
|
27
27
|
["path", { d: "M8 8v12", key: "1gg7y9" }],
|
|
@@ -33,78 +33,100 @@ const Jt = De("Library", [
|
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const Zt = De("Link2", [
|
|
37
37
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
38
38
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
39
39
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
40
40
|
]);
|
|
41
|
+
function pa() {
|
|
42
|
+
const s = L((h) => h.card.dataSource), {
|
|
43
|
+
setSelectedConnectionId: r,
|
|
44
|
+
setSelectedDatabaseName: o,
|
|
45
|
+
setSelectedSchemaName: i,
|
|
46
|
+
setSelectedTableName: p,
|
|
47
|
+
setSelectedDatamodelId: u
|
|
48
|
+
} = le();
|
|
49
|
+
ie(() => {
|
|
50
|
+
var S;
|
|
51
|
+
if (!s) return;
|
|
52
|
+
const { tableName: h, schemaName: y, databaseName: b, connectionId: v } = qt(s), g = (S = s.selectedEntities) == null ? void 0 : S[0], x = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
|
|
53
|
+
r(v || ""), o(b || ""), i(y || ""), p(h || ""), u(x);
|
|
54
|
+
}, [
|
|
55
|
+
s,
|
|
56
|
+
r,
|
|
57
|
+
o,
|
|
58
|
+
i,
|
|
59
|
+
p,
|
|
60
|
+
u
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
41
63
|
function ot() {
|
|
42
|
-
var
|
|
43
|
-
const s = L((
|
|
64
|
+
var b, v;
|
|
65
|
+
const s = L((g) => g.card), r = L((g) => g.frame), o = z(
|
|
44
66
|
() => et(r, s),
|
|
45
67
|
[r, s]
|
|
46
|
-
), { manifest: i } =
|
|
47
|
-
((
|
|
48
|
-
),
|
|
68
|
+
), { manifest: i } = _t(
|
|
69
|
+
((b = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : b.url) || ""
|
|
70
|
+
), p = z(
|
|
49
71
|
() => {
|
|
50
|
-
var
|
|
51
|
-
return (
|
|
72
|
+
var g;
|
|
73
|
+
return (g = i == null ? void 0 : i.visuals) == null ? void 0 : g.find(
|
|
52
74
|
(m) => {
|
|
53
|
-
var
|
|
54
|
-
return m.name === ((
|
|
75
|
+
var x;
|
|
76
|
+
return m.name === ((x = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : x.componentName);
|
|
55
77
|
}
|
|
56
78
|
);
|
|
57
79
|
},
|
|
58
|
-
[i, (
|
|
59
|
-
), u =
|
|
60
|
-
() =>
|
|
80
|
+
[i, (v = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : v.componentName]
|
|
81
|
+
), u = Ft(o, p), h = z(
|
|
82
|
+
() => Lt({
|
|
61
83
|
frame: r,
|
|
62
84
|
configCard: o,
|
|
63
85
|
isMultiInputVisual: u === "multiple"
|
|
64
86
|
}),
|
|
65
87
|
[r, o, u]
|
|
66
|
-
),
|
|
67
|
-
const
|
|
88
|
+
), y = z(() => {
|
|
89
|
+
const g = h.findIndex(
|
|
68
90
|
(m) => (m == null ? void 0 : m.id) === s.id
|
|
69
91
|
);
|
|
70
|
-
return
|
|
71
|
-
}, [
|
|
72
|
-
return z(() => !o || u !== "multiple" ||
|
|
92
|
+
return g < 0 ? -1 : At(s, g);
|
|
93
|
+
}, [h, s]);
|
|
94
|
+
return z(() => !o || u !== "multiple" || y < 0 ? s.type : zt(
|
|
73
95
|
s,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
) ?? s.type, [o, u,
|
|
96
|
+
y,
|
|
97
|
+
p == null ? void 0 : p.slots
|
|
98
|
+
) ?? s.type, [o, u, y, s, p == null ? void 0 : p.slots]);
|
|
77
99
|
}
|
|
78
|
-
function
|
|
100
|
+
function ma({
|
|
79
101
|
type: s,
|
|
80
102
|
isLinked: r,
|
|
81
103
|
className: o,
|
|
82
104
|
showLabel: i = !1,
|
|
83
|
-
showLocal:
|
|
105
|
+
showLocal: p = !1
|
|
84
106
|
}) {
|
|
85
|
-
const u =
|
|
86
|
-
let
|
|
107
|
+
const u = ne((D) => D.selectedFrameId), h = Ot((D) => D.selectedVisual), y = L((D) => D.frame);
|
|
108
|
+
let b;
|
|
87
109
|
if (s)
|
|
88
|
-
|
|
110
|
+
b = s;
|
|
89
111
|
else if (r !== void 0)
|
|
90
|
-
|
|
91
|
-
else if (!!!(
|
|
92
|
-
|
|
93
|
-
else if (
|
|
94
|
-
|
|
95
|
-
else if (
|
|
96
|
-
|
|
97
|
-
else if (
|
|
98
|
-
|
|
112
|
+
b = r ? "linked" : "library";
|
|
113
|
+
else if (!!!(y != null && y.visualId || h != null && h.id) && u)
|
|
114
|
+
b = "local";
|
|
115
|
+
else if (h && !u)
|
|
116
|
+
b = "library";
|
|
117
|
+
else if (y != null && y.visualId && u)
|
|
118
|
+
b = "linked";
|
|
119
|
+
else if (h != null && h.id && u)
|
|
120
|
+
b = "library";
|
|
99
121
|
else
|
|
100
122
|
return null;
|
|
101
|
-
if (
|
|
123
|
+
if (b === "local" && !p)
|
|
102
124
|
return null;
|
|
103
|
-
const
|
|
125
|
+
const v = {
|
|
104
126
|
local: "border-slate-200/70 bg-slate-50/80 text-slate-700 shadow-sm hover:bg-slate-100/80 dark:border-slate-700 dark:bg-slate-900/70 dark:text-slate-200 dark:hover:bg-slate-800/80",
|
|
105
127
|
linked: "border-purple-200/70 bg-gradient-to-r from-purple-50/50 to-purple-100/30 text-purple-900 shadow-sm hover:from-purple-100/60 hover:to-purple-100/50 hover:shadow-md dark:border-purple-800/50 dark:from-purple-950/40 dark:to-purple-900/30 dark:text-purple-100 dark:hover:from-purple-950/60 dark:hover:to-purple-900/50",
|
|
106
128
|
library: "border-blue-200/70 bg-gradient-to-r from-blue-50/50 to-blue-100/30 text-blue-900 shadow-sm hover:from-blue-100/60 hover:to-blue-100/50 hover:shadow-md dark:border-blue-800/50 dark:from-blue-950/40 dark:to-blue-900/30 dark:text-blue-100 dark:hover:from-blue-950/60 dark:hover:to-blue-900/50"
|
|
107
|
-
},
|
|
129
|
+
}, g = {
|
|
108
130
|
local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
|
|
109
131
|
linked: "Linked to library: Changes made here update the library visual and all linked instances.",
|
|
110
132
|
library: "Library visual: Share and reuse this visual across multiple dashboards."
|
|
@@ -112,32 +134,32 @@ function ua({
|
|
|
112
134
|
local: "border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",
|
|
113
135
|
linked: "border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",
|
|
114
136
|
library: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
|
|
115
|
-
},
|
|
137
|
+
}, x = {
|
|
116
138
|
local: "fill-slate-50 dark:fill-slate-900",
|
|
117
139
|
linked: "fill-purple-50 dark:fill-purple-950",
|
|
118
140
|
library: "fill-blue-50 dark:fill-blue-950"
|
|
119
|
-
},
|
|
141
|
+
}, S = {
|
|
120
142
|
local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
|
|
121
|
-
linked: /* @__PURE__ */ t(
|
|
122
|
-
library: /* @__PURE__ */ t(
|
|
123
|
-
},
|
|
143
|
+
linked: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" }),
|
|
144
|
+
library: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
|
|
145
|
+
}, N = {
|
|
124
146
|
local: "Local",
|
|
125
147
|
linked: "Linked",
|
|
126
148
|
library: "Library"
|
|
127
149
|
};
|
|
128
150
|
return /* @__PURE__ */ t(ft, { children: /* @__PURE__ */ d(ht, { delayDuration: 300, children: [
|
|
129
151
|
/* @__PURE__ */ t(bt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
130
|
-
|
|
152
|
+
Mt,
|
|
131
153
|
{
|
|
132
154
|
variant: "outline",
|
|
133
|
-
className:
|
|
155
|
+
className: oe(
|
|
134
156
|
"cursor-help select-none transition-all",
|
|
135
|
-
|
|
157
|
+
v[b],
|
|
136
158
|
o
|
|
137
159
|
),
|
|
138
160
|
children: [
|
|
139
|
-
|
|
140
|
-
i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children:
|
|
161
|
+
S[b],
|
|
162
|
+
i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: N[b] })
|
|
141
163
|
]
|
|
142
164
|
}
|
|
143
165
|
) }),
|
|
@@ -145,16 +167,16 @@ function ua({
|
|
|
145
167
|
gt,
|
|
146
168
|
{
|
|
147
169
|
side: "bottom",
|
|
148
|
-
className:
|
|
170
|
+
className: oe("max-w-xs", m[b]),
|
|
149
171
|
children: [
|
|
150
|
-
/* @__PURE__ */ t(yt, { className:
|
|
151
|
-
/* @__PURE__ */ t("p", { children:
|
|
172
|
+
/* @__PURE__ */ t(yt, { className: x[b] }),
|
|
173
|
+
/* @__PURE__ */ t("p", { children: g[b] })
|
|
152
174
|
]
|
|
153
175
|
}
|
|
154
176
|
)
|
|
155
177
|
] }) });
|
|
156
178
|
}
|
|
157
|
-
function
|
|
179
|
+
function ea(s, r) {
|
|
158
180
|
return {
|
|
159
181
|
...s,
|
|
160
182
|
sql: "",
|
|
@@ -170,23 +192,23 @@ function Zt(s, r) {
|
|
|
170
192
|
type: r ? s.type : "bar"
|
|
171
193
|
};
|
|
172
194
|
}
|
|
173
|
-
function
|
|
195
|
+
function Ie(s) {
|
|
174
196
|
const r = vt(s);
|
|
175
197
|
return r ? (Q.error(r), !1) : !0;
|
|
176
198
|
}
|
|
177
|
-
function
|
|
199
|
+
function fa({
|
|
178
200
|
className: s,
|
|
179
201
|
variant: r = "outline"
|
|
180
202
|
}) {
|
|
181
203
|
const o = L((u) => u.onSave), { getUpdatedFrame: i } = we();
|
|
182
|
-
function
|
|
204
|
+
function p() {
|
|
183
205
|
const u = i();
|
|
184
|
-
|
|
206
|
+
Ie(u) && (o == null || o(u));
|
|
185
207
|
}
|
|
186
208
|
return /* @__PURE__ */ d(
|
|
187
|
-
|
|
209
|
+
V,
|
|
188
210
|
{
|
|
189
|
-
onClick:
|
|
211
|
+
onClick: p,
|
|
190
212
|
className: s,
|
|
191
213
|
size: "xs",
|
|
192
214
|
variant: r,
|
|
@@ -197,41 +219,41 @@ function pa({
|
|
|
197
219
|
}
|
|
198
220
|
);
|
|
199
221
|
}
|
|
200
|
-
function
|
|
222
|
+
function ha({
|
|
201
223
|
className: s,
|
|
202
224
|
variant: r = "default"
|
|
203
225
|
}) {
|
|
204
|
-
const o =
|
|
205
|
-
(
|
|
206
|
-
), { setIsVisualEditing:
|
|
226
|
+
const o = ce(), [i, p] = j(!1), u = ne(
|
|
227
|
+
(x) => x.actions.setIsDashboardPanelOpen
|
|
228
|
+
), { setIsVisualEditing: h } = Ye(), { getUpdatedFrame: y } = we(), b = at(), v = L((x) => x.frame), g = rt();
|
|
207
229
|
return /* @__PURE__ */ t(
|
|
208
|
-
|
|
230
|
+
V,
|
|
209
231
|
{
|
|
210
232
|
onClick: () => {
|
|
211
|
-
const
|
|
212
|
-
if (!
|
|
233
|
+
const x = y();
|
|
234
|
+
if (!Ie(x))
|
|
213
235
|
return;
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
236
|
+
const S = (v == null ? void 0 : v.visualId) || (b == null ? void 0 : b.id);
|
|
237
|
+
if (!S) {
|
|
216
238
|
Q.error("No visual to save");
|
|
217
239
|
return;
|
|
218
240
|
}
|
|
219
|
-
|
|
241
|
+
p(!0), g.mutate(
|
|
220
242
|
{
|
|
221
|
-
visualId:
|
|
243
|
+
visualId: S,
|
|
222
244
|
data: {
|
|
223
|
-
frameObject:
|
|
245
|
+
frameObject: x
|
|
224
246
|
}
|
|
225
247
|
},
|
|
226
248
|
{
|
|
227
249
|
onSuccess: () => {
|
|
228
|
-
|
|
229
|
-
queryKey: ["resource-by-id", "visual",
|
|
250
|
+
p(!1), u(!0), Q.success("Visual updated successfully"), o.invalidateQueries({
|
|
251
|
+
queryKey: ["resource-by-id", "visual", S],
|
|
230
252
|
exact: !0
|
|
231
253
|
});
|
|
232
254
|
},
|
|
233
255
|
onError: () => {
|
|
234
|
-
|
|
256
|
+
p(!1), Q.error("Failed to update visual");
|
|
235
257
|
}
|
|
236
258
|
}
|
|
237
259
|
);
|
|
@@ -239,60 +261,60 @@ function ma({
|
|
|
239
261
|
className: s,
|
|
240
262
|
size: "xs",
|
|
241
263
|
variant: r,
|
|
242
|
-
children: i ? /* @__PURE__ */ d(
|
|
264
|
+
children: i ? /* @__PURE__ */ d($, { children: [
|
|
243
265
|
/* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
244
266
|
"Saving"
|
|
245
|
-
] }) : /* @__PURE__ */ d(
|
|
267
|
+
] }) : /* @__PURE__ */ d($, { children: [
|
|
246
268
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
247
269
|
"Save to Library"
|
|
248
270
|
] })
|
|
249
271
|
}
|
|
250
272
|
);
|
|
251
273
|
}
|
|
252
|
-
function
|
|
274
|
+
function ba({
|
|
253
275
|
className: s
|
|
254
276
|
}) {
|
|
255
|
-
const r =
|
|
277
|
+
const r = ce(), [o, i] = j(!1), p = at(), u = L((N) => N.frame), h = ne((N) => N.selectedSheetId), y = ne((N) => N.dashboard), { updateFrame: b, setIsVisualEditing: v } = Ye(), { getUpdatedFrame: g } = we(), m = rt(), x = Bt();
|
|
256
278
|
return /* @__PURE__ */ t(
|
|
257
|
-
|
|
279
|
+
V,
|
|
258
280
|
{
|
|
259
281
|
onClick: async () => {
|
|
260
|
-
if (!
|
|
282
|
+
if (!h) {
|
|
261
283
|
Q.error("No sheet selected");
|
|
262
284
|
return;
|
|
263
285
|
}
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
286
|
+
const N = (u == null ? void 0 : u.visualId) || (p == null ? void 0 : p.id);
|
|
287
|
+
if (!N) {
|
|
266
288
|
Q.error("No visual to update");
|
|
267
289
|
return;
|
|
268
290
|
}
|
|
269
291
|
i(!0);
|
|
270
292
|
try {
|
|
271
|
-
const
|
|
272
|
-
if (!
|
|
293
|
+
const D = g();
|
|
294
|
+
if (!Ie(D)) {
|
|
273
295
|
i(!1);
|
|
274
296
|
return;
|
|
275
297
|
}
|
|
276
|
-
const
|
|
277
|
-
...
|
|
278
|
-
visualId:
|
|
298
|
+
const _ = {
|
|
299
|
+
...D,
|
|
300
|
+
visualId: N
|
|
279
301
|
// Keep the link to library visual
|
|
280
|
-
}, G =
|
|
302
|
+
}, G = Qt(y, _.id), X = await x(_, {
|
|
281
303
|
previousFrame: G
|
|
282
304
|
});
|
|
283
305
|
await m.mutateAsync({
|
|
284
|
-
visualId:
|
|
306
|
+
visualId: N,
|
|
285
307
|
data: {
|
|
286
|
-
frameObject:
|
|
308
|
+
frameObject: D
|
|
287
309
|
}
|
|
288
|
-
}), h
|
|
310
|
+
}), b(h, _, {
|
|
289
311
|
semanticExecutionPayload: X
|
|
290
|
-
}), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual",
|
|
291
|
-
|
|
312
|
+
}), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", N] }), Q.success("Saved to library and applied locally"), setTimeout(() => {
|
|
313
|
+
v(!1);
|
|
292
314
|
}, 300);
|
|
293
|
-
} catch (
|
|
294
|
-
console.error("Failed to save and apply:",
|
|
295
|
-
|
|
315
|
+
} catch (D) {
|
|
316
|
+
console.error("Failed to save and apply:", D), Q.error(
|
|
317
|
+
D instanceof Error ? D.message : "Failed to save and apply changes"
|
|
296
318
|
);
|
|
297
319
|
} finally {
|
|
298
320
|
i(!1);
|
|
@@ -302,81 +324,81 @@ function fa({
|
|
|
302
324
|
size: "xs",
|
|
303
325
|
variant: "default",
|
|
304
326
|
disabled: o,
|
|
305
|
-
children: o ? /* @__PURE__ */ d(
|
|
327
|
+
children: o ? /* @__PURE__ */ d($, { children: [
|
|
306
328
|
/* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
307
329
|
"Saving..."
|
|
308
|
-
] }) : /* @__PURE__ */ d(
|
|
330
|
+
] }) : /* @__PURE__ */ d($, { children: [
|
|
309
331
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
310
332
|
"Save & Apply"
|
|
311
333
|
] })
|
|
312
334
|
}
|
|
313
335
|
);
|
|
314
336
|
}
|
|
315
|
-
function
|
|
316
|
-
const { setTempQueryData: r, setSqlGen: o } =
|
|
317
|
-
function
|
|
318
|
-
if (
|
|
319
|
-
const { queryKey: m, queryData:
|
|
320
|
-
m &&
|
|
337
|
+
function ga({ className: s }) {
|
|
338
|
+
const { setTempQueryData: r, setSqlGen: o } = le(), i = ce(), p = L((m) => m.tempQueryData), u = L((m) => m.onClose), h = L((m) => m.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b);
|
|
339
|
+
function g() {
|
|
340
|
+
if (p) {
|
|
341
|
+
const { queryKey: m, queryData: x } = p;
|
|
342
|
+
m && x && i.setQueryData(m, x);
|
|
321
343
|
}
|
|
322
344
|
o({}), u == null || u();
|
|
323
345
|
}
|
|
324
346
|
return /* @__PURE__ */ d(
|
|
325
|
-
|
|
347
|
+
V,
|
|
326
348
|
{
|
|
327
|
-
onClick:
|
|
349
|
+
onClick: g,
|
|
328
350
|
className: s,
|
|
329
351
|
size: "xs",
|
|
330
352
|
variant: "outline",
|
|
331
353
|
children: [
|
|
332
|
-
/* @__PURE__ */ t(
|
|
354
|
+
/* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" }),
|
|
333
355
|
"Close"
|
|
334
356
|
]
|
|
335
357
|
}
|
|
336
358
|
);
|
|
337
359
|
}
|
|
338
|
-
function
|
|
360
|
+
function ya({
|
|
339
361
|
label: s = "Clear",
|
|
340
362
|
variant: r = "secondary",
|
|
341
363
|
className: o
|
|
342
364
|
} = {}) {
|
|
343
|
-
const { setTempQueryData: i } =
|
|
344
|
-
setCardSql:
|
|
365
|
+
const { setTempQueryData: i } = le(), p = ce(), u = L((O) => O.tempQueryData), h = L((O) => O.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b), {
|
|
366
|
+
setCardSql: g,
|
|
345
367
|
setSqlGen: m,
|
|
346
|
-
setCardPython:
|
|
347
|
-
setCardCustomCfg:
|
|
348
|
-
setCardPreferences:
|
|
349
|
-
clearQueryConfig:
|
|
350
|
-
setCardConfig:
|
|
368
|
+
setCardPython: x,
|
|
369
|
+
setCardCustomCfg: S,
|
|
370
|
+
setCardPreferences: N,
|
|
371
|
+
clearQueryConfig: D,
|
|
372
|
+
setCardConfig: _,
|
|
351
373
|
setCardType: G,
|
|
352
374
|
setFrame: X,
|
|
353
375
|
setCard: te,
|
|
354
376
|
setActiveTabCardId: H
|
|
355
|
-
} =
|
|
356
|
-
function
|
|
377
|
+
} = le();
|
|
378
|
+
function ue() {
|
|
357
379
|
var J, ae, q, W;
|
|
358
|
-
const O =
|
|
380
|
+
const O = p.getQueryData(v);
|
|
359
381
|
u != null && u.queryData || i({
|
|
360
|
-
queryKey:
|
|
382
|
+
queryKey: v,
|
|
361
383
|
queryData: O
|
|
362
|
-
}),
|
|
363
|
-
const a = L.getState().frame,
|
|
384
|
+
}), p.setQueryData(v, null), p.removeQueries({ queryKey: v, exact: !0 }), g(""), m({}), D(), _(void 0), x(""), S(""), N({});
|
|
385
|
+
const a = L.getState().frame, T = L.getState().card, E = et(a, T), B = ((J = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((ae = E == null ? void 0 : E.customCardPreferences) != null && ae.dataInputCardIds) || (((q = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : q.minInputs) || 0) > 1 || (((W = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : W.maxInputs) || 0) > 1, R = ea(T, B);
|
|
364
386
|
X({
|
|
365
387
|
...a,
|
|
366
388
|
cards: a.cards.map(
|
|
367
389
|
(U) => U.id === R.id ? R : U
|
|
368
390
|
)
|
|
369
|
-
}), H(R.id), te(R),
|
|
391
|
+
}), H(R.id), te(R), B || G("bar");
|
|
370
392
|
}
|
|
371
393
|
return /* @__PURE__ */ d(
|
|
372
|
-
|
|
394
|
+
V,
|
|
373
395
|
{
|
|
374
|
-
onClick:
|
|
396
|
+
onClick: ue,
|
|
375
397
|
className: o,
|
|
376
398
|
size: "xs",
|
|
377
399
|
variant: r,
|
|
378
400
|
children: [
|
|
379
|
-
/* @__PURE__ */ t(
|
|
401
|
+
/* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" }),
|
|
380
402
|
s
|
|
381
403
|
]
|
|
382
404
|
}
|
|
@@ -397,18 +419,18 @@ function it(s) {
|
|
|
397
419
|
)
|
|
398
420
|
] });
|
|
399
421
|
}
|
|
400
|
-
function
|
|
422
|
+
function ta(s) {
|
|
401
423
|
const { currentStep: r, labels: o } = s;
|
|
402
|
-
return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: o.map((i,
|
|
403
|
-
const u =
|
|
404
|
-
return /* @__PURE__ */ d(
|
|
424
|
+
return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: o.map((i, p) => {
|
|
425
|
+
const u = p + 1, h = u === r, y = u < r;
|
|
426
|
+
return /* @__PURE__ */ d(Vt, { children: [
|
|
405
427
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-1.5", children: [
|
|
406
428
|
/* @__PURE__ */ t(
|
|
407
429
|
"span",
|
|
408
430
|
{
|
|
409
|
-
className:
|
|
431
|
+
className: oe(
|
|
410
432
|
"flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
|
|
411
|
-
|
|
433
|
+
h ? "border-foreground bg-foreground text-background" : y ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
|
|
412
434
|
),
|
|
413
435
|
children: u
|
|
414
436
|
}
|
|
@@ -416,15 +438,15 @@ function ea(s) {
|
|
|
416
438
|
/* @__PURE__ */ t(
|
|
417
439
|
"span",
|
|
418
440
|
{
|
|
419
|
-
className:
|
|
441
|
+
className: oe(
|
|
420
442
|
"text-[12px]",
|
|
421
|
-
|
|
443
|
+
h ? "font-medium text-foreground" : "text-muted-foreground"
|
|
422
444
|
),
|
|
423
445
|
children: i
|
|
424
446
|
}
|
|
425
447
|
)
|
|
426
448
|
] }),
|
|
427
|
-
|
|
449
|
+
p < o.length - 1 ? /* @__PURE__ */ t(
|
|
428
450
|
"span",
|
|
429
451
|
{
|
|
430
452
|
className: "h-px w-4 bg-border/60 sm:w-6",
|
|
@@ -434,7 +456,7 @@ function ea(s) {
|
|
|
434
456
|
] }, i);
|
|
435
457
|
}) }) });
|
|
436
458
|
}
|
|
437
|
-
function
|
|
459
|
+
function de(s) {
|
|
438
460
|
const { secondary: r, tertiary: o, primary: i } = s;
|
|
439
461
|
return /* @__PURE__ */ d("div", { className: "sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: [
|
|
440
462
|
r,
|
|
@@ -442,10 +464,10 @@ function oe(s) {
|
|
|
442
464
|
i
|
|
443
465
|
] });
|
|
444
466
|
}
|
|
445
|
-
function
|
|
467
|
+
function aa(s) {
|
|
446
468
|
const { control: r, scope: o, detail: i } = s;
|
|
447
469
|
return /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
|
|
448
|
-
/* @__PURE__ */ t(
|
|
470
|
+
/* @__PURE__ */ t(Jt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
|
|
449
471
|
/* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
|
|
450
472
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
|
|
451
473
|
/* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
@@ -466,28 +488,28 @@ function Ue(s) {
|
|
|
466
488
|
control: r,
|
|
467
489
|
defaultValue: o,
|
|
468
490
|
availableFieldChoices: i,
|
|
469
|
-
availableMetricChoices:
|
|
491
|
+
availableMetricChoices: p,
|
|
470
492
|
previewControlDefinitions: u,
|
|
471
|
-
previewControlValues:
|
|
472
|
-
onControlChange:
|
|
473
|
-
onLabelChange:
|
|
474
|
-
onDefaultValueChange:
|
|
475
|
-
onBack:
|
|
493
|
+
previewControlValues: h,
|
|
494
|
+
onControlChange: y,
|
|
495
|
+
onLabelChange: b,
|
|
496
|
+
onDefaultValueChange: v,
|
|
497
|
+
onBack: g,
|
|
476
498
|
onNext: m,
|
|
477
|
-
nextDisabled:
|
|
499
|
+
nextDisabled: x
|
|
478
500
|
} = s;
|
|
479
501
|
return /* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
480
|
-
/* @__PURE__ */ t(it, { control: r, onChange:
|
|
502
|
+
/* @__PURE__ */ t(it, { control: r, onChange: b }),
|
|
481
503
|
/* @__PURE__ */ t(
|
|
482
504
|
st,
|
|
483
505
|
{
|
|
484
506
|
control: r,
|
|
485
507
|
availableFieldChoices: i,
|
|
486
|
-
availableMetricChoices:
|
|
508
|
+
availableMetricChoices: p,
|
|
487
509
|
previewControlDefinitions: u,
|
|
488
|
-
previewControlValues:
|
|
510
|
+
previewControlValues: h,
|
|
489
511
|
controlLifecycle: "create",
|
|
490
|
-
onChange:
|
|
512
|
+
onChange: y
|
|
491
513
|
}
|
|
492
514
|
),
|
|
493
515
|
/* @__PURE__ */ t(
|
|
@@ -495,25 +517,25 @@ function Ue(s) {
|
|
|
495
517
|
{
|
|
496
518
|
control: r,
|
|
497
519
|
value: o,
|
|
498
|
-
onChange:
|
|
520
|
+
onChange: v,
|
|
499
521
|
allowNoDefault: !0,
|
|
500
522
|
allowCardDefault: !0,
|
|
501
523
|
hint: "This is the value viewers will see first.",
|
|
502
524
|
previewControlDefinitions: u,
|
|
503
|
-
previewControlValues:
|
|
525
|
+
previewControlValues: h
|
|
504
526
|
}
|
|
505
527
|
),
|
|
506
528
|
/* @__PURE__ */ t(
|
|
507
|
-
|
|
529
|
+
de,
|
|
508
530
|
{
|
|
509
|
-
secondary: /* @__PURE__ */ t(
|
|
531
|
+
secondary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: g, children: "Back" }),
|
|
510
532
|
primary: /* @__PURE__ */ t(
|
|
511
|
-
|
|
533
|
+
V,
|
|
512
534
|
{
|
|
513
535
|
type: "button",
|
|
514
536
|
size: "xs",
|
|
515
537
|
onClick: m,
|
|
516
|
-
disabled:
|
|
538
|
+
disabled: x,
|
|
517
539
|
children: "Next"
|
|
518
540
|
}
|
|
519
541
|
)
|
|
@@ -521,14 +543,14 @@ function Ue(s) {
|
|
|
521
543
|
)
|
|
522
544
|
] });
|
|
523
545
|
}
|
|
524
|
-
const
|
|
546
|
+
const ra = /* @__PURE__ */ new Set([
|
|
525
547
|
"grain_selector",
|
|
526
548
|
"aggregation_selector",
|
|
527
549
|
"field_selector",
|
|
528
550
|
"metric_selector"
|
|
529
551
|
]);
|
|
530
|
-
function
|
|
531
|
-
const { text: r, ariaLabel: o } = s, [i,
|
|
552
|
+
function Pe(s) {
|
|
553
|
+
const { text: r, ariaLabel: o } = s, [i, p] = j(!1);
|
|
532
554
|
return /* @__PURE__ */ d(
|
|
533
555
|
"button",
|
|
534
556
|
{
|
|
@@ -536,7 +558,7 @@ function $e(s) {
|
|
|
536
558
|
"aria-label": o,
|
|
537
559
|
onClick: async () => {
|
|
538
560
|
try {
|
|
539
|
-
await navigator.clipboard.writeText(r),
|
|
561
|
+
await navigator.clipboard.writeText(r), p(!0), setTimeout(() => p(!1), 1200);
|
|
540
562
|
} catch (u) {
|
|
541
563
|
console.error("Failed to copy", u);
|
|
542
564
|
}
|
|
@@ -549,47 +571,47 @@ function $e(s) {
|
|
|
549
571
|
}
|
|
550
572
|
);
|
|
551
573
|
}
|
|
552
|
-
function
|
|
574
|
+
function $e(s) {
|
|
553
575
|
const {
|
|
554
576
|
control: r,
|
|
555
577
|
scope: o,
|
|
556
578
|
createdReference: i,
|
|
557
|
-
explorerContent:
|
|
579
|
+
explorerContent: p,
|
|
558
580
|
sqlDescription: u,
|
|
559
|
-
summaryDetail:
|
|
560
|
-
onBack:
|
|
561
|
-
onCancel:
|
|
562
|
-
onDone:
|
|
563
|
-
} = s,
|
|
581
|
+
summaryDetail: h,
|
|
582
|
+
onBack: y,
|
|
583
|
+
onCancel: b,
|
|
584
|
+
onDone: v
|
|
585
|
+
} = s, g = ra.has(r.type), m = i.match(/\[\[param\.(.+?)\]\]/), x = m ? `{{ param('${m[1]}') }}` : "";
|
|
564
586
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
565
587
|
/* @__PURE__ */ t(
|
|
566
|
-
|
|
588
|
+
aa,
|
|
567
589
|
{
|
|
568
590
|
control: r,
|
|
569
591
|
scope: o,
|
|
570
|
-
detail:
|
|
592
|
+
detail: h
|
|
571
593
|
}
|
|
572
594
|
),
|
|
573
595
|
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
574
596
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-foreground", children: "How cards use this control" }),
|
|
575
597
|
/* @__PURE__ */ d("div", { className: "divide-y divide-border/60 overflow-hidden rounded-control border border-border/60", children: [
|
|
576
|
-
|
|
598
|
+
g ? /* @__PURE__ */ d("div", { className: "space-y-1 px-3 py-2.5", children: [
|
|
577
599
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Explorer cards" }),
|
|
578
|
-
/* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children:
|
|
600
|
+
/* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: p })
|
|
579
601
|
] }) : null,
|
|
580
602
|
/* @__PURE__ */ d("div", { className: "space-y-1.5 px-3 py-2.5", children: [
|
|
581
603
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
|
|
582
604
|
/* @__PURE__ */ t(
|
|
583
|
-
|
|
605
|
+
Pe,
|
|
584
606
|
{
|
|
585
607
|
text: i,
|
|
586
608
|
ariaLabel: "Copy SQL control reference"
|
|
587
609
|
}
|
|
588
610
|
),
|
|
589
|
-
|
|
590
|
-
|
|
611
|
+
x ? /* @__PURE__ */ t(
|
|
612
|
+
Pe,
|
|
591
613
|
{
|
|
592
|
-
text:
|
|
614
|
+
text: x,
|
|
593
615
|
ariaLabel: "Copy Jinja control reference"
|
|
594
616
|
}
|
|
595
617
|
) : null,
|
|
@@ -612,35 +634,35 @@ function Ke(s) {
|
|
|
612
634
|
] })
|
|
613
635
|
] }),
|
|
614
636
|
/* @__PURE__ */ t(
|
|
615
|
-
|
|
637
|
+
de,
|
|
616
638
|
{
|
|
617
|
-
secondary: /* @__PURE__ */ t(
|
|
618
|
-
tertiary: /* @__PURE__ */ t(
|
|
619
|
-
primary: /* @__PURE__ */ t(
|
|
639
|
+
secondary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: y, children: "Back" }),
|
|
640
|
+
tertiary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: b, children: "Cancel" }),
|
|
641
|
+
primary: /* @__PURE__ */ t(V, { type: "button", size: "xs", onClick: v, children: "Done" })
|
|
620
642
|
}
|
|
621
643
|
)
|
|
622
644
|
] });
|
|
623
645
|
}
|
|
624
|
-
function
|
|
646
|
+
function sa(s) {
|
|
625
647
|
const r = re(
|
|
626
648
|
s.scope,
|
|
627
649
|
s.existingControls,
|
|
628
650
|
s.reservedIds
|
|
629
651
|
), o = s.type === r.type ? {
|
|
630
652
|
...r,
|
|
631
|
-
label:
|
|
653
|
+
label: Ne[s.type]
|
|
632
654
|
} : {
|
|
633
655
|
...Ze({
|
|
634
656
|
controls: [
|
|
635
657
|
{
|
|
636
658
|
...r,
|
|
637
|
-
label:
|
|
659
|
+
label: Ne[s.type]
|
|
638
660
|
}
|
|
639
661
|
],
|
|
640
662
|
controlId: r.id,
|
|
641
663
|
nextType: s.type
|
|
642
664
|
}).controls[0],
|
|
643
|
-
label:
|
|
665
|
+
label: Ne[s.type]
|
|
644
666
|
};
|
|
645
667
|
return {
|
|
646
668
|
step: 2,
|
|
@@ -648,78 +670,78 @@ function ra(s) {
|
|
|
648
670
|
defaultValue: se(o, void 0)
|
|
649
671
|
};
|
|
650
672
|
}
|
|
651
|
-
function
|
|
673
|
+
function xa({
|
|
652
674
|
scope: s,
|
|
653
675
|
controls: r,
|
|
654
676
|
reservedControlIds: o,
|
|
655
677
|
defaultValues: i,
|
|
656
|
-
onChange:
|
|
678
|
+
onChange: p,
|
|
657
679
|
emptyMessage: u,
|
|
658
|
-
initialCreateFlow:
|
|
659
|
-
usageByControlId:
|
|
660
|
-
availableFieldChoices:
|
|
661
|
-
availableMetricChoices:
|
|
662
|
-
structuralParticipants:
|
|
680
|
+
initialCreateFlow: h = !1,
|
|
681
|
+
usageByControlId: y,
|
|
682
|
+
availableFieldChoices: b,
|
|
683
|
+
availableMetricChoices: v,
|
|
684
|
+
structuralParticipants: g,
|
|
663
685
|
structuralParticipantIdsByControlId: m,
|
|
664
|
-
card:
|
|
665
|
-
allowedControlTypes:
|
|
666
|
-
onCreateFlowActiveChange:
|
|
667
|
-
onCreateFlowComplete:
|
|
686
|
+
card: x,
|
|
687
|
+
allowedControlTypes: S,
|
|
688
|
+
onCreateFlowActiveChange: N,
|
|
689
|
+
onCreateFlowComplete: D
|
|
668
690
|
}) {
|
|
669
|
-
const
|
|
691
|
+
const _ = z(
|
|
670
692
|
() => new Set(o || []),
|
|
671
693
|
[o]
|
|
672
694
|
), G = wt(s), X = Ct(s), [te, H] = j(
|
|
673
695
|
null
|
|
674
|
-
), [
|
|
696
|
+
), [ue, O] = j(
|
|
675
697
|
null
|
|
676
|
-
), [a,
|
|
677
|
-
() =>
|
|
698
|
+
), [a, T] = j(
|
|
699
|
+
() => h ? {
|
|
678
700
|
step: 1,
|
|
679
|
-
control: re(s, r, Array.from(
|
|
701
|
+
control: re(s, r, Array.from(_))
|
|
680
702
|
} : null
|
|
681
|
-
),
|
|
682
|
-
const e = Ae({ scope: s, card:
|
|
683
|
-
if (!
|
|
703
|
+
), E = Se({}), B = Se(void 0), R = Se(h), J = z(() => {
|
|
704
|
+
const e = Ae({ scope: s, card: x });
|
|
705
|
+
if (!S)
|
|
684
706
|
return e;
|
|
685
|
-
const n = new Set(
|
|
707
|
+
const n = new Set(S);
|
|
686
708
|
return e.filter((l) => n.has(l.value));
|
|
687
|
-
}, [
|
|
709
|
+
}, [S, x, s]), ae = M(
|
|
688
710
|
(e) => {
|
|
689
711
|
const n = Ae({
|
|
690
712
|
scope: s,
|
|
691
|
-
card:
|
|
692
|
-
includeType:
|
|
713
|
+
card: x,
|
|
714
|
+
includeType: S ? void 0 : e
|
|
693
715
|
});
|
|
694
|
-
if (!
|
|
716
|
+
if (!S)
|
|
695
717
|
return n;
|
|
696
|
-
const l = new Set(
|
|
718
|
+
const l = new Set(S);
|
|
697
719
|
return n.filter((c) => l.has(c.value));
|
|
698
720
|
},
|
|
699
|
-
[
|
|
700
|
-
), q =
|
|
721
|
+
[S, x, s]
|
|
722
|
+
), q = M(
|
|
701
723
|
(e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
702
724
|
[s]
|
|
703
725
|
), W = z(
|
|
704
726
|
() => a ? ze(
|
|
705
|
-
|
|
727
|
+
g || [],
|
|
706
728
|
a.control.type
|
|
707
729
|
) : [],
|
|
708
|
-
[a,
|
|
730
|
+
[a, g]
|
|
709
731
|
), U = z(() => {
|
|
710
732
|
if (!a)
|
|
711
733
|
return {
|
|
712
|
-
fields:
|
|
713
|
-
metrics:
|
|
734
|
+
fields: b || [],
|
|
735
|
+
metrics: v || []
|
|
714
736
|
};
|
|
715
737
|
if (!q(a.control.type))
|
|
716
738
|
return {
|
|
717
|
-
fields:
|
|
718
|
-
metrics:
|
|
739
|
+
fields: b || [],
|
|
740
|
+
metrics: v || []
|
|
719
741
|
};
|
|
720
|
-
const e = a.selectedCardIds || [], n =
|
|
742
|
+
const e = a.selectedCardIds || [], n = be({
|
|
721
743
|
controlType: a.control.type,
|
|
722
|
-
participants:
|
|
744
|
+
participants: g || [],
|
|
723
745
|
selectedCardIds: e
|
|
724
746
|
});
|
|
725
747
|
return {
|
|
@@ -733,36 +755,36 @@ function ga({
|
|
|
733
755
|
})) : []
|
|
734
756
|
};
|
|
735
757
|
}, [
|
|
736
|
-
|
|
737
|
-
|
|
758
|
+
b,
|
|
759
|
+
v,
|
|
738
760
|
a,
|
|
739
761
|
q,
|
|
740
|
-
|
|
762
|
+
g
|
|
741
763
|
]);
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}, [a,
|
|
745
|
-
const e =
|
|
746
|
-
R.current =
|
|
764
|
+
ie(() => {
|
|
765
|
+
N == null || N(!!a);
|
|
766
|
+
}, [a, N]), ie(() => {
|
|
767
|
+
const e = h && !R.current;
|
|
768
|
+
R.current = h, e && (T({
|
|
747
769
|
step: 1,
|
|
748
|
-
control: re(s, r, Array.from(
|
|
770
|
+
control: re(s, r, Array.from(_))
|
|
749
771
|
}), O(null), H(null));
|
|
750
|
-
}, [r,
|
|
772
|
+
}, [r, h, _, s]);
|
|
751
773
|
const dt = (e) => {
|
|
752
774
|
if (!q(e.type))
|
|
753
775
|
return {
|
|
754
|
-
fields:
|
|
755
|
-
metrics:
|
|
776
|
+
fields: b || [],
|
|
777
|
+
metrics: v || []
|
|
756
778
|
};
|
|
757
779
|
const n = (m == null ? void 0 : m[e.id]) || [];
|
|
758
780
|
if (n.length === 0)
|
|
759
781
|
return {
|
|
760
|
-
fields:
|
|
761
|
-
metrics:
|
|
782
|
+
fields: b || [],
|
|
783
|
+
metrics: v || []
|
|
762
784
|
};
|
|
763
|
-
const l =
|
|
785
|
+
const l = be({
|
|
764
786
|
controlType: e.type,
|
|
765
|
-
participants:
|
|
787
|
+
participants: g || [],
|
|
766
788
|
selectedCardIds: n
|
|
767
789
|
});
|
|
768
790
|
return {
|
|
@@ -775,101 +797,101 @@ function ga({
|
|
|
775
797
|
target: l.metricTargetMap[c.value]
|
|
776
798
|
})) : []
|
|
777
799
|
};
|
|
778
|
-
},
|
|
800
|
+
}, Te = (e) => {
|
|
779
801
|
if (!q(e.control.type))
|
|
780
802
|
return {
|
|
781
803
|
nextControl: e.control,
|
|
782
804
|
cardBindingsById: void 0
|
|
783
805
|
};
|
|
784
|
-
const n = (m == null ? void 0 : m[e.control.id]) || [], l =
|
|
806
|
+
const n = (m == null ? void 0 : m[e.control.id]) || [], l = be({
|
|
785
807
|
controlType: e.control.type,
|
|
786
|
-
participants:
|
|
808
|
+
participants: g || [],
|
|
787
809
|
selectedCardIds: e.nextSelectedCardIds
|
|
788
|
-
}), c =
|
|
810
|
+
}), c = Et({
|
|
789
811
|
control: e.control,
|
|
790
812
|
choices: l.choices
|
|
791
|
-
}),
|
|
792
|
-
n.filter((
|
|
813
|
+
}), C = Object.fromEntries(
|
|
814
|
+
n.filter((k) => !e.nextSelectedCardIds.includes(k)).map((k) => [k, void 0])
|
|
793
815
|
);
|
|
794
816
|
return e.nextSelectedCardIds.length > 0 && c.source.kind === "manual" && c.source.options.length > 0 && Object.assign(
|
|
795
|
-
|
|
817
|
+
C,
|
|
796
818
|
je({
|
|
797
819
|
control: c,
|
|
798
|
-
participants:
|
|
820
|
+
participants: g || [],
|
|
799
821
|
selectedCardIds: e.nextSelectedCardIds
|
|
800
822
|
})
|
|
801
823
|
), {
|
|
802
824
|
nextControl: c,
|
|
803
|
-
cardBindingsById:
|
|
825
|
+
cardBindingsById: C
|
|
804
826
|
};
|
|
805
|
-
}, A =
|
|
827
|
+
}, A = M(
|
|
806
828
|
(e, n = i, l = { type: "update" }) => {
|
|
807
|
-
const c = e.map((
|
|
808
|
-
control:
|
|
829
|
+
const c = e.map((C) => (ge({
|
|
830
|
+
control: C,
|
|
809
831
|
defaultValues: n
|
|
810
832
|
}), kt(
|
|
811
|
-
|
|
833
|
+
C
|
|
812
834
|
)));
|
|
813
|
-
|
|
835
|
+
p(c, n, l);
|
|
814
836
|
},
|
|
815
|
-
[i,
|
|
837
|
+
[i, p]
|
|
816
838
|
), Z = (e, n) => {
|
|
817
839
|
const l = r.find(
|
|
818
|
-
(
|
|
840
|
+
(I) => I.id === e
|
|
819
841
|
);
|
|
820
|
-
let c = r.map((
|
|
821
|
-
const
|
|
822
|
-
(
|
|
842
|
+
let c = r.map((I) => I.id !== e ? I : n(I));
|
|
843
|
+
const C = c.find(
|
|
844
|
+
(I) => I.id === e
|
|
823
845
|
);
|
|
824
|
-
let
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
control:
|
|
828
|
-
nextSelectedCardIds:
|
|
846
|
+
let k, f;
|
|
847
|
+
if (C && s === "dashboard" && (C.type === "field_selector" || C.type === "metric_selector")) {
|
|
848
|
+
const I = (m == null ? void 0 : m[C.id]) || [], K = Te({
|
|
849
|
+
control: C,
|
|
850
|
+
nextSelectedCardIds: I
|
|
829
851
|
});
|
|
830
852
|
c = c.map(
|
|
831
|
-
(
|
|
832
|
-
),
|
|
853
|
+
(P) => P.id === e ? K.nextControl : P
|
|
854
|
+
), k = K.cardBindingsById, f = [C.id];
|
|
833
855
|
} else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
),
|
|
856
|
+
const I = (m == null ? void 0 : m[l.id]) || [];
|
|
857
|
+
k = Object.fromEntries(
|
|
858
|
+
I.map((K) => [K, void 0])
|
|
859
|
+
), f = [l.id];
|
|
838
860
|
}
|
|
839
|
-
const
|
|
840
|
-
(
|
|
861
|
+
const w = c.find(
|
|
862
|
+
(I) => I.id === e
|
|
841
863
|
);
|
|
842
|
-
let
|
|
843
|
-
if (l &&
|
|
844
|
-
const
|
|
864
|
+
let F = i;
|
|
865
|
+
if (l && w) {
|
|
866
|
+
const I = ge({
|
|
845
867
|
control: l,
|
|
846
868
|
defaultValues: i
|
|
847
869
|
});
|
|
848
|
-
l.source.kind === "manual" &&
|
|
849
|
-
const
|
|
870
|
+
l.source.kind === "manual" && w.source.kind === "sql_query" && (E.current[e] = I);
|
|
871
|
+
const K = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? E.current[e] : I, P = Qe({
|
|
850
872
|
previousControl: l,
|
|
851
|
-
nextControl:
|
|
852
|
-
currentDefaultValue:
|
|
873
|
+
nextControl: w,
|
|
874
|
+
currentDefaultValue: K
|
|
853
875
|
});
|
|
854
|
-
|
|
855
|
-
(Le) => Le.id === e ? { ...
|
|
876
|
+
w.source.kind === "manual" && (E.current[e] = P), i && (F = { ...i }, P === void 0 ? delete F[e] : F[e] = P), c = c.map(
|
|
877
|
+
(Le) => Le.id === e ? { ...w, defaultValue: P } : Le
|
|
856
878
|
);
|
|
857
879
|
}
|
|
858
|
-
A(c,
|
|
880
|
+
A(c, F, {
|
|
859
881
|
type: "update",
|
|
860
|
-
cardBindingsById:
|
|
861
|
-
affectedBindingControlIds:
|
|
882
|
+
cardBindingsById: k,
|
|
883
|
+
affectedBindingControlIds: f
|
|
862
884
|
});
|
|
863
885
|
}, ct = (e, n) => {
|
|
864
886
|
if (!n.trim())
|
|
865
887
|
return;
|
|
866
|
-
const l =
|
|
867
|
-
if (l === e ||
|
|
868
|
-
(
|
|
888
|
+
const l = Ht(n);
|
|
889
|
+
if (l === e || _.has(l) || r.some(
|
|
890
|
+
(k) => k.id === l && k.id !== e
|
|
869
891
|
))
|
|
870
892
|
return;
|
|
871
893
|
const c = r.map(
|
|
872
|
-
(
|
|
894
|
+
(k) => k.id === e ? { ...k, id: l } : k
|
|
873
895
|
);
|
|
874
896
|
if (!i) {
|
|
875
897
|
A(c, void 0, {
|
|
@@ -879,8 +901,8 @@ function ga({
|
|
|
879
901
|
});
|
|
880
902
|
return;
|
|
881
903
|
}
|
|
882
|
-
const
|
|
883
|
-
Object.prototype.hasOwnProperty.call(
|
|
904
|
+
const C = { ...i };
|
|
905
|
+
Object.prototype.hasOwnProperty.call(C, e) && (C[l] = C[e], delete C[e]), A(c, C, {
|
|
884
906
|
type: "rename",
|
|
885
907
|
oldId: e,
|
|
886
908
|
newId: l
|
|
@@ -893,36 +915,36 @@ function ga({
|
|
|
893
915
|
}
|
|
894
916
|
const l = { ...i };
|
|
895
917
|
delete l[e], A(n, l, { type: "remove", controlId: e });
|
|
896
|
-
}, pt =
|
|
897
|
-
|
|
918
|
+
}, pt = M(() => {
|
|
919
|
+
B.current = void 0, T({
|
|
898
920
|
step: 1,
|
|
899
|
-
control: re(s, r, Array.from(
|
|
921
|
+
control: re(s, r, Array.from(_))
|
|
900
922
|
}), O(null), H(null);
|
|
901
|
-
}, [r,
|
|
902
|
-
|
|
923
|
+
}, [r, _, s]), ee = (e) => {
|
|
924
|
+
T(
|
|
903
925
|
(n) => n && (() => {
|
|
904
926
|
const l = e(n.control);
|
|
905
|
-
n.control.source.kind === "manual" && l.source.kind === "sql_query" && (
|
|
906
|
-
const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ?
|
|
927
|
+
n.control.source.kind === "manual" && l.source.kind === "sql_query" && (B.current = n.defaultValue);
|
|
928
|
+
const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? B.current : n.defaultValue, C = Qe({
|
|
907
929
|
previousControl: n.control,
|
|
908
930
|
nextControl: l,
|
|
909
931
|
currentDefaultValue: c
|
|
910
932
|
});
|
|
911
|
-
return l.source.kind === "manual" && (
|
|
933
|
+
return l.source.kind === "manual" && (B.current = C), {
|
|
912
934
|
...n,
|
|
913
935
|
control: l,
|
|
914
|
-
defaultValue:
|
|
936
|
+
defaultValue: C
|
|
915
937
|
};
|
|
916
938
|
})()
|
|
917
939
|
);
|
|
918
|
-
},
|
|
919
|
-
|
|
920
|
-
(n) => n && (n.control.source.kind === "manual" && (
|
|
940
|
+
}, Ee = (e) => {
|
|
941
|
+
T(
|
|
942
|
+
(n) => n && (n.control.source.kind === "manual" && (B.current = e), {
|
|
921
943
|
...n,
|
|
922
944
|
defaultValue: e
|
|
923
945
|
})
|
|
924
946
|
);
|
|
925
|
-
},
|
|
947
|
+
}, pe = (() => {
|
|
926
948
|
if (!a)
|
|
927
949
|
return !1;
|
|
928
950
|
if (a.step === 2 && q(a.control.type))
|
|
@@ -935,45 +957,45 @@ function ga({
|
|
|
935
957
|
)))
|
|
936
958
|
return !1;
|
|
937
959
|
if (n.source.kind === "sql_query") {
|
|
938
|
-
const { connectionId: l, sql: c, valueColumn:
|
|
939
|
-
return l.trim().length > 0 && c.trim().length > 0 &&
|
|
960
|
+
const { connectionId: l, sql: c, valueColumn: C } = n.source;
|
|
961
|
+
return l.trim().length > 0 && c.trim().length > 0 && C.trim().length > 0;
|
|
940
962
|
}
|
|
941
963
|
return St(
|
|
942
964
|
se(n, a.defaultValue)
|
|
943
965
|
);
|
|
944
|
-
})(),
|
|
945
|
-
var
|
|
966
|
+
})(), Ve = () => {
|
|
967
|
+
var k;
|
|
946
968
|
if (!a)
|
|
947
969
|
return;
|
|
948
|
-
const e = Oe(a.control), n =
|
|
970
|
+
const e = Oe(a.control), n = Tt({
|
|
949
971
|
label: e.label,
|
|
950
972
|
fallbackId: e.id,
|
|
951
973
|
existingControls: r,
|
|
952
|
-
reservedIds: Array.from(
|
|
974
|
+
reservedIds: Array.from(_)
|
|
953
975
|
}), l = {
|
|
954
976
|
...e,
|
|
955
977
|
id: n
|
|
956
|
-
}, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((
|
|
978
|
+
}, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((k = a.selectedCardIds) != null && k.length) ? je({
|
|
957
979
|
control: l,
|
|
958
|
-
participants:
|
|
980
|
+
participants: g || [],
|
|
959
981
|
selectedCardIds: a.selectedCardIds
|
|
960
|
-
}) : void 0,
|
|
982
|
+
}) : void 0, C = se(
|
|
961
983
|
l,
|
|
962
984
|
a.defaultValue
|
|
963
985
|
);
|
|
964
|
-
|
|
986
|
+
T({
|
|
965
987
|
step: s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") ? 4 : 3,
|
|
966
988
|
control: l,
|
|
967
|
-
defaultValue:
|
|
989
|
+
defaultValue: C,
|
|
968
990
|
createdControlId: n,
|
|
969
991
|
selectedCardIds: a.selectedCardIds,
|
|
970
992
|
cardBindingsById: c
|
|
971
993
|
});
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
}, []), qe =
|
|
994
|
+
}, me = M(() => {
|
|
995
|
+
T(null);
|
|
996
|
+
}, []), qe = M(() => {
|
|
975
997
|
if (!(a != null && a.createdControlId)) {
|
|
976
|
-
|
|
998
|
+
T(null);
|
|
977
999
|
return;
|
|
978
1000
|
}
|
|
979
1001
|
const e = a.control, n = a.createdControlId, l = se(
|
|
@@ -1011,12 +1033,12 @@ function ga({
|
|
|
1011
1033
|
cardBindingsById: a.cardBindingsById
|
|
1012
1034
|
}
|
|
1013
1035
|
);
|
|
1014
|
-
O(n),
|
|
1015
|
-
}, [r, a, i, A,
|
|
1036
|
+
O(n), T(null), D == null || D();
|
|
1037
|
+
}, [r, a, i, A, D]), mt = a ? q(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], _e = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Dt(a.control.label) || a.control.id}]]` : "", fe = Me({
|
|
1016
1038
|
controls: r,
|
|
1017
1039
|
defaultValues: i
|
|
1018
|
-
}),
|
|
1019
|
-
controls:
|
|
1040
|
+
}), he = a ? [...r, a.control] : r, Fe = a ? Me({
|
|
1041
|
+
controls: he,
|
|
1020
1042
|
defaultValues: i,
|
|
1021
1043
|
overrides: [
|
|
1022
1044
|
{
|
|
@@ -1024,11 +1046,11 @@ function ga({
|
|
|
1024
1046
|
value: a.defaultValue
|
|
1025
1047
|
}
|
|
1026
1048
|
]
|
|
1027
|
-
}) :
|
|
1049
|
+
}) : fe;
|
|
1028
1050
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
1029
1051
|
a ? /* @__PURE__ */ d("div", { className: "space-y-4 pb-1", children: [
|
|
1030
1052
|
/* @__PURE__ */ t(
|
|
1031
|
-
|
|
1053
|
+
ta,
|
|
1032
1054
|
{
|
|
1033
1055
|
currentStep: a.step,
|
|
1034
1056
|
labels: mt
|
|
@@ -1040,50 +1062,55 @@ function ga({
|
|
|
1040
1062
|
"aggregation_selector",
|
|
1041
1063
|
"field_selector",
|
|
1042
1064
|
"metric_selector"
|
|
1043
|
-
]), n =
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1065
|
+
]), n = /* @__PURE__ */ new Set([
|
|
1066
|
+
// Temporarily hide these from the add-control dialog while
|
|
1067
|
+
// keeping the shared definitions for existing controls.
|
|
1068
|
+
"date",
|
|
1069
|
+
"text"
|
|
1070
|
+
]), l = J.filter(
|
|
1071
|
+
(k) => !e.has(k.value) && !n.has(k.value)
|
|
1072
|
+
), c = J.filter(
|
|
1073
|
+
(k) => e.has(k.value)
|
|
1074
|
+
), C = (k) => /* @__PURE__ */ d(
|
|
1048
1075
|
"button",
|
|
1049
1076
|
{
|
|
1050
1077
|
type: "button",
|
|
1051
1078
|
className: "rounded-control border border-border/60 bg-background px-3 py-2.5 text-left transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:outline-none",
|
|
1052
|
-
onClick: () =>
|
|
1053
|
-
|
|
1079
|
+
onClick: () => T(
|
|
1080
|
+
sa({
|
|
1054
1081
|
scope: s,
|
|
1055
1082
|
existingControls: r,
|
|
1056
|
-
reservedIds: Array.from(
|
|
1057
|
-
type:
|
|
1083
|
+
reservedIds: Array.from(_),
|
|
1084
|
+
type: k.value
|
|
1058
1085
|
})
|
|
1059
1086
|
),
|
|
1060
1087
|
children: [
|
|
1061
|
-
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children:
|
|
1062
|
-
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children:
|
|
1088
|
+
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: k.label }),
|
|
1089
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: k.description })
|
|
1063
1090
|
]
|
|
1064
1091
|
},
|
|
1065
|
-
|
|
1092
|
+
k.value
|
|
1066
1093
|
);
|
|
1067
1094
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
1068
|
-
s === "card" && (
|
|
1069
|
-
|
|
1095
|
+
s === "card" && (x == null ? void 0 : x.sql) == null ? /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null,
|
|
1096
|
+
l.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1070
1097
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
|
|
1071
|
-
/* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children:
|
|
1098
|
+
/* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: l.map(C) })
|
|
1072
1099
|
] }),
|
|
1073
|
-
|
|
1100
|
+
c.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1074
1101
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data-driven controls" }),
|
|
1075
|
-
/* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children:
|
|
1102
|
+
/* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: c.map(C) })
|
|
1076
1103
|
] }),
|
|
1077
1104
|
/* @__PURE__ */ t(
|
|
1078
|
-
|
|
1105
|
+
de,
|
|
1079
1106
|
{
|
|
1080
1107
|
secondary: /* @__PURE__ */ t(
|
|
1081
|
-
|
|
1108
|
+
V,
|
|
1082
1109
|
{
|
|
1083
1110
|
type: "button",
|
|
1084
1111
|
variant: "outline",
|
|
1085
1112
|
size: "xs",
|
|
1086
|
-
onClick:
|
|
1113
|
+
onClick: me,
|
|
1087
1114
|
children: "Back to controls"
|
|
1088
1115
|
}
|
|
1089
1116
|
)
|
|
@@ -1113,17 +1140,17 @@ function ga({
|
|
|
1113
1140
|
className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
|
|
1114
1141
|
children: [
|
|
1115
1142
|
/* @__PURE__ */ t(
|
|
1116
|
-
|
|
1143
|
+
jt,
|
|
1117
1144
|
{
|
|
1118
1145
|
checked: n,
|
|
1119
|
-
onCheckedChange: (l) =>
|
|
1146
|
+
onCheckedChange: (l) => T(
|
|
1120
1147
|
(c) => c && {
|
|
1121
1148
|
...c,
|
|
1122
1149
|
selectedCardIds: l === !0 ? [
|
|
1123
1150
|
...c.selectedCardIds || [],
|
|
1124
1151
|
e.cardId
|
|
1125
1152
|
] : (c.selectedCardIds || []).filter(
|
|
1126
|
-
(
|
|
1153
|
+
(C) => C !== e.cardId
|
|
1127
1154
|
)
|
|
1128
1155
|
}
|
|
1129
1156
|
)
|
|
@@ -1139,15 +1166,15 @@ function ga({
|
|
|
1139
1166
|
);
|
|
1140
1167
|
}) }),
|
|
1141
1168
|
/* @__PURE__ */ t(
|
|
1142
|
-
|
|
1169
|
+
de,
|
|
1143
1170
|
{
|
|
1144
1171
|
secondary: /* @__PURE__ */ t(
|
|
1145
|
-
|
|
1172
|
+
V,
|
|
1146
1173
|
{
|
|
1147
1174
|
type: "button",
|
|
1148
1175
|
variant: "outline",
|
|
1149
1176
|
size: "xs",
|
|
1150
|
-
onClick: () =>
|
|
1177
|
+
onClick: () => T(
|
|
1151
1178
|
(e) => e && {
|
|
1152
1179
|
...e,
|
|
1153
1180
|
step: 1,
|
|
@@ -1158,17 +1185,17 @@ function ga({
|
|
|
1158
1185
|
}
|
|
1159
1186
|
),
|
|
1160
1187
|
primary: /* @__PURE__ */ t(
|
|
1161
|
-
|
|
1188
|
+
V,
|
|
1162
1189
|
{
|
|
1163
1190
|
type: "button",
|
|
1164
1191
|
size: "xs",
|
|
1165
|
-
onClick: () =>
|
|
1192
|
+
onClick: () => T(
|
|
1166
1193
|
(e) => e && {
|
|
1167
1194
|
...e,
|
|
1168
1195
|
step: 3
|
|
1169
1196
|
}
|
|
1170
1197
|
),
|
|
1171
|
-
disabled: !
|
|
1198
|
+
disabled: !pe,
|
|
1172
1199
|
children: "Next"
|
|
1173
1200
|
}
|
|
1174
1201
|
)
|
|
@@ -1182,22 +1209,22 @@ function ga({
|
|
|
1182
1209
|
defaultValue: a.defaultValue,
|
|
1183
1210
|
availableFieldChoices: U.fields,
|
|
1184
1211
|
availableMetricChoices: U.metrics,
|
|
1185
|
-
previewControlDefinitions:
|
|
1186
|
-
previewControlValues:
|
|
1212
|
+
previewControlDefinitions: he,
|
|
1213
|
+
previewControlValues: Fe,
|
|
1187
1214
|
onControlChange: (e) => ee(() => e),
|
|
1188
1215
|
onLabelChange: (e) => ee((n) => ({
|
|
1189
1216
|
...n,
|
|
1190
1217
|
label: e
|
|
1191
1218
|
})),
|
|
1192
|
-
onDefaultValueChange:
|
|
1193
|
-
onBack: () =>
|
|
1219
|
+
onDefaultValueChange: Ee,
|
|
1220
|
+
onBack: () => T(
|
|
1194
1221
|
(e) => e && {
|
|
1195
1222
|
...e,
|
|
1196
1223
|
step: 1
|
|
1197
1224
|
}
|
|
1198
1225
|
),
|
|
1199
|
-
onNext:
|
|
1200
|
-
nextDisabled: !
|
|
1226
|
+
onNext: Ve,
|
|
1227
|
+
nextDisabled: !pe
|
|
1201
1228
|
}
|
|
1202
1229
|
),
|
|
1203
1230
|
a.step === 3 && q(a.control.type) && /* @__PURE__ */ t(
|
|
@@ -1207,31 +1234,31 @@ function ga({
|
|
|
1207
1234
|
defaultValue: a.defaultValue,
|
|
1208
1235
|
availableFieldChoices: U.fields,
|
|
1209
1236
|
availableMetricChoices: U.metrics,
|
|
1210
|
-
previewControlDefinitions:
|
|
1211
|
-
previewControlValues:
|
|
1237
|
+
previewControlDefinitions: he,
|
|
1238
|
+
previewControlValues: Fe,
|
|
1212
1239
|
onControlChange: (e) => ee(() => e),
|
|
1213
1240
|
onLabelChange: (e) => ee((n) => ({
|
|
1214
1241
|
...n,
|
|
1215
1242
|
label: e
|
|
1216
1243
|
})),
|
|
1217
|
-
onDefaultValueChange:
|
|
1218
|
-
onBack: () =>
|
|
1244
|
+
onDefaultValueChange: Ee,
|
|
1245
|
+
onBack: () => T(
|
|
1219
1246
|
(e) => e && {
|
|
1220
1247
|
...e,
|
|
1221
1248
|
step: 2
|
|
1222
1249
|
}
|
|
1223
1250
|
),
|
|
1224
|
-
onNext:
|
|
1225
|
-
nextDisabled: !
|
|
1251
|
+
onNext: Ve,
|
|
1252
|
+
nextDisabled: !pe
|
|
1226
1253
|
}
|
|
1227
1254
|
),
|
|
1228
1255
|
a.step === 3 && !q(a.control.type) && /* @__PURE__ */ t(
|
|
1229
|
-
|
|
1256
|
+
$e,
|
|
1230
1257
|
{
|
|
1231
1258
|
control: a.control,
|
|
1232
1259
|
scope: s,
|
|
1233
|
-
createdReference:
|
|
1234
|
-
explorerContent: /* @__PURE__ */ d(
|
|
1260
|
+
createdReference: _e,
|
|
1261
|
+
explorerContent: /* @__PURE__ */ d($, { children: [
|
|
1235
1262
|
"Open the card and use",
|
|
1236
1263
|
" ",
|
|
1237
1264
|
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
|
|
@@ -1239,47 +1266,47 @@ function ga({
|
|
|
1239
1266
|
"to choose what this control changes."
|
|
1240
1267
|
] }),
|
|
1241
1268
|
sqlDescription: "Reference this control directly in the SQL editor.",
|
|
1242
|
-
onBack: () =>
|
|
1269
|
+
onBack: () => T(
|
|
1243
1270
|
(e) => e && {
|
|
1244
1271
|
...e,
|
|
1245
1272
|
step: 2
|
|
1246
1273
|
}
|
|
1247
1274
|
),
|
|
1248
|
-
onCancel:
|
|
1275
|
+
onCancel: me,
|
|
1249
1276
|
onDone: qe
|
|
1250
1277
|
}
|
|
1251
1278
|
),
|
|
1252
1279
|
a.step === 4 && q(a.control.type) && /* @__PURE__ */ t(
|
|
1253
|
-
|
|
1280
|
+
$e,
|
|
1254
1281
|
{
|
|
1255
1282
|
control: a.control,
|
|
1256
1283
|
scope: s,
|
|
1257
|
-
createdReference:
|
|
1258
|
-
summaryDetail: /* @__PURE__ */ d(
|
|
1284
|
+
createdReference: _e,
|
|
1285
|
+
summaryDetail: /* @__PURE__ */ d($, { children: [
|
|
1259
1286
|
"Used by ",
|
|
1260
1287
|
(a.selectedCardIds || []).length,
|
|
1261
1288
|
" selected card",
|
|
1262
1289
|
(a.selectedCardIds || []).length === 1 ? "" : "s"
|
|
1263
1290
|
] }),
|
|
1264
|
-
explorerContent: /* @__PURE__ */ t(
|
|
1291
|
+
explorerContent: /* @__PURE__ */ t($, { children: "Selected cards have been set up to respond to this control automatically." }),
|
|
1265
1292
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
1266
|
-
onBack: () =>
|
|
1293
|
+
onBack: () => T(
|
|
1267
1294
|
(e) => e && {
|
|
1268
1295
|
...e,
|
|
1269
1296
|
step: 3
|
|
1270
1297
|
}
|
|
1271
1298
|
),
|
|
1272
|
-
onCancel:
|
|
1299
|
+
onCancel: me,
|
|
1273
1300
|
onDone: qe
|
|
1274
1301
|
}
|
|
1275
1302
|
)
|
|
1276
1303
|
] }) : null,
|
|
1277
1304
|
!a && r.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: u }) : null,
|
|
1278
1305
|
!a && r.map((e) => {
|
|
1279
|
-
const n = dt(e), l =
|
|
1306
|
+
const n = dt(e), l = y == null ? void 0 : y[e.id], c = ge({
|
|
1280
1307
|
control: e,
|
|
1281
1308
|
defaultValues: i
|
|
1282
|
-
}),
|
|
1309
|
+
}), C = ue === e.id, k = "inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";
|
|
1283
1310
|
return /* @__PURE__ */ d(
|
|
1284
1311
|
"div",
|
|
1285
1312
|
{
|
|
@@ -1292,15 +1319,15 @@ function ga({
|
|
|
1292
1319
|
type: "button",
|
|
1293
1320
|
className: "flex min-w-0 flex-1 items-start gap-2 rounded-control text-left focus:outline-none focus-visible:bg-muted/40",
|
|
1294
1321
|
onClick: () => O(
|
|
1295
|
-
(
|
|
1322
|
+
(f) => f === e.id ? null : e.id
|
|
1296
1323
|
),
|
|
1297
1324
|
children: [
|
|
1298
|
-
|
|
1325
|
+
C ? /* @__PURE__ */ t(Be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Re, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1299
1326
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1300
1327
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
1301
1328
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
|
|
1302
|
-
/* @__PURE__ */ t("span", { className:
|
|
1303
|
-
/* @__PURE__ */ t("span", { className:
|
|
1329
|
+
/* @__PURE__ */ t("span", { className: k, children: Xe(e.type).label }),
|
|
1330
|
+
/* @__PURE__ */ t("span", { className: k, children: He(s, e.placement) })
|
|
1304
1331
|
] }),
|
|
1305
1332
|
/* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
|
|
1306
1333
|
Je(e),
|
|
@@ -1311,7 +1338,7 @@ function ga({
|
|
|
1311
1338
|
}
|
|
1312
1339
|
),
|
|
1313
1340
|
/* @__PURE__ */ t(
|
|
1314
|
-
|
|
1341
|
+
V,
|
|
1315
1342
|
{
|
|
1316
1343
|
type: "button",
|
|
1317
1344
|
size: "xs",
|
|
@@ -1319,11 +1346,11 @@ function ga({
|
|
|
1319
1346
|
className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
|
|
1320
1347
|
onClick: () => ut(e.id),
|
|
1321
1348
|
"aria-label": `Remove ${e.label}`,
|
|
1322
|
-
children: /* @__PURE__ */ t(
|
|
1349
|
+
children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
|
|
1323
1350
|
}
|
|
1324
1351
|
)
|
|
1325
1352
|
] }),
|
|
1326
|
-
|
|
1353
|
+
C && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
|
|
1327
1354
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
|
|
1328
1355
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1329
1356
|
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
@@ -1333,9 +1360,9 @@ function ga({
|
|
|
1333
1360
|
size: "xs",
|
|
1334
1361
|
value: e.label,
|
|
1335
1362
|
placeholder: "Control label",
|
|
1336
|
-
onChange: (
|
|
1337
|
-
...
|
|
1338
|
-
label:
|
|
1363
|
+
onChange: (f) => Z(e.id, (w) => ({
|
|
1364
|
+
...w,
|
|
1365
|
+
label: f.target.value
|
|
1339
1366
|
}))
|
|
1340
1367
|
}
|
|
1341
1368
|
)
|
|
@@ -1343,28 +1370,28 @@ function ga({
|
|
|
1343
1370
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1344
1371
|
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
|
|
1345
1372
|
/* @__PURE__ */ d(
|
|
1346
|
-
|
|
1373
|
+
ye,
|
|
1347
1374
|
{
|
|
1348
1375
|
value: e.type,
|
|
1349
|
-
onValueChange: (
|
|
1350
|
-
const
|
|
1376
|
+
onValueChange: (f) => {
|
|
1377
|
+
const w = Ze({
|
|
1351
1378
|
controls: r,
|
|
1352
1379
|
controlId: e.id,
|
|
1353
|
-
nextType:
|
|
1380
|
+
nextType: f,
|
|
1354
1381
|
defaultValues: i
|
|
1355
1382
|
});
|
|
1356
|
-
A(
|
|
1383
|
+
A(w.controls, w.defaultValues);
|
|
1357
1384
|
},
|
|
1358
1385
|
children: [
|
|
1359
|
-
/* @__PURE__ */ t(
|
|
1360
|
-
/* @__PURE__ */ t(
|
|
1361
|
-
(
|
|
1362
|
-
|
|
1386
|
+
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
|
|
1387
|
+
/* @__PURE__ */ t(Ce, { children: ae(e.type).map(
|
|
1388
|
+
(f) => /* @__PURE__ */ t(
|
|
1389
|
+
ke,
|
|
1363
1390
|
{
|
|
1364
|
-
value:
|
|
1365
|
-
children:
|
|
1391
|
+
value: f.value,
|
|
1392
|
+
children: f.label
|
|
1366
1393
|
},
|
|
1367
|
-
|
|
1394
|
+
f.value
|
|
1368
1395
|
)
|
|
1369
1396
|
) })
|
|
1370
1397
|
]
|
|
@@ -1374,44 +1401,44 @@ function ga({
|
|
|
1374
1401
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1375
1402
|
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
|
|
1376
1403
|
/* @__PURE__ */ d(
|
|
1377
|
-
|
|
1404
|
+
ye,
|
|
1378
1405
|
{
|
|
1379
1406
|
value: e.placement || X,
|
|
1380
|
-
onValueChange: (
|
|
1381
|
-
...
|
|
1382
|
-
placement:
|
|
1407
|
+
onValueChange: (f) => Z(e.id, (w) => ({
|
|
1408
|
+
...w,
|
|
1409
|
+
placement: f
|
|
1383
1410
|
})),
|
|
1384
1411
|
children: [
|
|
1385
|
-
/* @__PURE__ */ t(
|
|
1386
|
-
/* @__PURE__ */ t(
|
|
1412
|
+
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
|
|
1413
|
+
/* @__PURE__ */ t(Ce, { children: G.map((f) => /* @__PURE__ */ t(ke, { value: f.value, children: f.label }, f.value)) })
|
|
1387
1414
|
]
|
|
1388
1415
|
}
|
|
1389
1416
|
)
|
|
1390
1417
|
] })
|
|
1391
1418
|
] }),
|
|
1392
1419
|
q(e.type) ? /* @__PURE__ */ t(
|
|
1393
|
-
|
|
1420
|
+
Ut,
|
|
1394
1421
|
{
|
|
1395
1422
|
type: e.type,
|
|
1396
1423
|
participants: ze(
|
|
1397
|
-
|
|
1424
|
+
g || [],
|
|
1398
1425
|
e.type
|
|
1399
|
-
).map((
|
|
1400
|
-
cardId:
|
|
1401
|
-
title:
|
|
1402
|
-
choiceCount: e.type === "field_selector" ?
|
|
1426
|
+
).map((f) => ({
|
|
1427
|
+
cardId: f.cardId,
|
|
1428
|
+
title: f.title,
|
|
1429
|
+
choiceCount: e.type === "field_selector" ? f.fieldChoices.length : f.metricChoices.length
|
|
1403
1430
|
})),
|
|
1404
1431
|
selectedCardIds: (m == null ? void 0 : m[e.id]) || [],
|
|
1405
|
-
onChange: (
|
|
1406
|
-
const
|
|
1432
|
+
onChange: (f) => {
|
|
1433
|
+
const w = Te({
|
|
1407
1434
|
control: e,
|
|
1408
|
-
nextSelectedCardIds:
|
|
1409
|
-
}),
|
|
1410
|
-
(
|
|
1435
|
+
nextSelectedCardIds: f
|
|
1436
|
+
}), F = r.map(
|
|
1437
|
+
(I) => I.id === e.id ? w.nextControl : I
|
|
1411
1438
|
);
|
|
1412
|
-
A(
|
|
1439
|
+
A(F, i, {
|
|
1413
1440
|
type: "update",
|
|
1414
|
-
cardBindingsById:
|
|
1441
|
+
cardBindingsById: w.cardBindingsById
|
|
1415
1442
|
});
|
|
1416
1443
|
}
|
|
1417
1444
|
}
|
|
@@ -1423,9 +1450,9 @@ function ga({
|
|
|
1423
1450
|
availableFieldChoices: n.fields,
|
|
1424
1451
|
availableMetricChoices: n.metrics,
|
|
1425
1452
|
previewControlDefinitions: r,
|
|
1426
|
-
previewControlValues:
|
|
1453
|
+
previewControlValues: fe,
|
|
1427
1454
|
controlLifecycle: "edit",
|
|
1428
|
-
onChange: (
|
|
1455
|
+
onChange: (f) => Z(e.id, () => f)
|
|
1429
1456
|
}
|
|
1430
1457
|
),
|
|
1431
1458
|
e.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
|
|
@@ -1436,48 +1463,48 @@ function ga({
|
|
|
1436
1463
|
allowNoDefault: !0,
|
|
1437
1464
|
allowCardDefault: !0,
|
|
1438
1465
|
previewControlDefinitions: r,
|
|
1439
|
-
previewControlValues:
|
|
1440
|
-
onChange: (
|
|
1441
|
-
const
|
|
1442
|
-
(
|
|
1466
|
+
previewControlValues: fe,
|
|
1467
|
+
onChange: (f) => {
|
|
1468
|
+
const w = r.map(
|
|
1469
|
+
(F) => F.id === e.id ? { ...F, defaultValue: f } : F
|
|
1443
1470
|
);
|
|
1444
|
-
if (e.source.kind === "manual" && (
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1471
|
+
if (e.source.kind === "manual" && (E.current[e.id] = f), i) {
|
|
1472
|
+
const F = { ...i };
|
|
1473
|
+
f === void 0 ? delete F[e.id] : F[e.id] = f, A(w, F);
|
|
1447
1474
|
return;
|
|
1448
1475
|
}
|
|
1449
|
-
A(
|
|
1476
|
+
A(w, void 0);
|
|
1450
1477
|
}
|
|
1451
1478
|
}
|
|
1452
1479
|
),
|
|
1453
1480
|
/* @__PURE__ */ d(
|
|
1454
|
-
|
|
1481
|
+
Pt,
|
|
1455
1482
|
{
|
|
1456
1483
|
open: te === e.id,
|
|
1457
|
-
onOpenChange: (
|
|
1484
|
+
onOpenChange: (f) => H(f ? e.id : null),
|
|
1458
1485
|
children: [
|
|
1459
|
-
/* @__PURE__ */ t(
|
|
1460
|
-
|
|
1486
|
+
/* @__PURE__ */ t($t, { asChild: !0, children: /* @__PURE__ */ d(
|
|
1487
|
+
V,
|
|
1461
1488
|
{
|
|
1462
1489
|
type: "button",
|
|
1463
1490
|
variant: "ghost",
|
|
1464
1491
|
size: "xs",
|
|
1465
1492
|
className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
|
|
1466
1493
|
children: [
|
|
1467
|
-
te === e.id ? /* @__PURE__ */ t(
|
|
1494
|
+
te === e.id ? /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
|
|
1468
1495
|
"Advanced"
|
|
1469
1496
|
]
|
|
1470
1497
|
}
|
|
1471
1498
|
) }),
|
|
1472
|
-
/* @__PURE__ */ d(
|
|
1499
|
+
/* @__PURE__ */ d(Kt, { className: "space-y-3 pt-2", children: [
|
|
1473
1500
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
1474
1501
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1475
1502
|
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
|
|
1476
1503
|
/* @__PURE__ */ t(
|
|
1477
|
-
|
|
1504
|
+
Yt,
|
|
1478
1505
|
{
|
|
1479
1506
|
controlId: e.id,
|
|
1480
|
-
onCommit: (
|
|
1507
|
+
onCommit: (f) => ct(e.id, f)
|
|
1481
1508
|
},
|
|
1482
1509
|
e.id
|
|
1483
1510
|
)
|
|
@@ -1485,22 +1512,22 @@ function ga({
|
|
|
1485
1512
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1486
1513
|
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
|
|
1487
1514
|
/* @__PURE__ */ d(
|
|
1488
|
-
|
|
1515
|
+
ye,
|
|
1489
1516
|
{
|
|
1490
1517
|
value: e.initialValueStrategy,
|
|
1491
|
-
onValueChange: (
|
|
1492
|
-
...
|
|
1493
|
-
initialValueStrategy:
|
|
1518
|
+
onValueChange: (f) => Z(e.id, (w) => ({
|
|
1519
|
+
...w,
|
|
1520
|
+
initialValueStrategy: f
|
|
1494
1521
|
})),
|
|
1495
1522
|
children: [
|
|
1496
|
-
/* @__PURE__ */ t(
|
|
1497
|
-
/* @__PURE__ */ t(
|
|
1498
|
-
|
|
1523
|
+
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
|
|
1524
|
+
/* @__PURE__ */ t(Ce, { children: It.map((f) => /* @__PURE__ */ t(
|
|
1525
|
+
ke,
|
|
1499
1526
|
{
|
|
1500
|
-
value:
|
|
1501
|
-
children:
|
|
1527
|
+
value: f.value,
|
|
1528
|
+
children: f.label
|
|
1502
1529
|
},
|
|
1503
|
-
|
|
1530
|
+
f.value
|
|
1504
1531
|
)) })
|
|
1505
1532
|
]
|
|
1506
1533
|
}
|
|
@@ -1508,10 +1535,10 @@ function ga({
|
|
|
1508
1535
|
] })
|
|
1509
1536
|
] }),
|
|
1510
1537
|
/* @__PURE__ */ t(
|
|
1511
|
-
|
|
1538
|
+
Gt,
|
|
1512
1539
|
{
|
|
1513
1540
|
control: e,
|
|
1514
|
-
onChange: (
|
|
1541
|
+
onChange: (f) => Z(e.id, () => f)
|
|
1515
1542
|
}
|
|
1516
1543
|
)
|
|
1517
1544
|
] })
|
|
@@ -1525,65 +1552,66 @@ function ga({
|
|
|
1525
1552
|
);
|
|
1526
1553
|
}),
|
|
1527
1554
|
!a && /* @__PURE__ */ d(
|
|
1528
|
-
|
|
1555
|
+
V,
|
|
1529
1556
|
{
|
|
1530
1557
|
type: "button",
|
|
1531
1558
|
variant: "outline",
|
|
1532
1559
|
size: "xs",
|
|
1533
1560
|
onClick: pt,
|
|
1534
1561
|
children: [
|
|
1535
|
-
/* @__PURE__ */ t(
|
|
1562
|
+
/* @__PURE__ */ t(Xt, { className: "h-3.5 w-3.5" }),
|
|
1536
1563
|
"Add control"
|
|
1537
1564
|
]
|
|
1538
1565
|
}
|
|
1539
1566
|
)
|
|
1540
1567
|
] });
|
|
1541
1568
|
}
|
|
1542
|
-
function
|
|
1569
|
+
function va(s) {
|
|
1543
1570
|
const {
|
|
1544
1571
|
open: r,
|
|
1545
1572
|
onOpenChange: o,
|
|
1546
1573
|
initialCreateFlowActive: i = !1,
|
|
1547
|
-
dismissMode:
|
|
1548
|
-
} = s, u = r !== void 0, [
|
|
1574
|
+
dismissMode: p = "passive"
|
|
1575
|
+
} = s, u = r !== void 0, [h, y] = j(!1), [b, v] = j(
|
|
1549
1576
|
i
|
|
1550
|
-
),
|
|
1551
|
-
(
|
|
1552
|
-
!
|
|
1577
|
+
), g = u ? r : h, m = M(
|
|
1578
|
+
(N) => {
|
|
1579
|
+
!N && b && p === "passive" || (u || y(N), N || v(!1), o == null || o(N));
|
|
1553
1580
|
},
|
|
1554
|
-
[u,
|
|
1555
|
-
),
|
|
1556
|
-
u ||
|
|
1581
|
+
[u, b, p, o]
|
|
1582
|
+
), x = M(() => {
|
|
1583
|
+
u || y(!1), v(!1), o == null || o(!1);
|
|
1557
1584
|
}, [u, o]);
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
}, [
|
|
1561
|
-
const
|
|
1562
|
-
(
|
|
1563
|
-
|
|
1585
|
+
ie(() => {
|
|
1586
|
+
g || v(!1);
|
|
1587
|
+
}, [g]);
|
|
1588
|
+
const S = M(
|
|
1589
|
+
(N) => {
|
|
1590
|
+
b && N.preventDefault();
|
|
1564
1591
|
},
|
|
1565
|
-
[
|
|
1592
|
+
[b]
|
|
1566
1593
|
);
|
|
1567
1594
|
return {
|
|
1568
|
-
forceClose:
|
|
1595
|
+
forceClose: x,
|
|
1569
1596
|
handleOpenChange: m,
|
|
1570
|
-
isCreateFlowActive:
|
|
1571
|
-
preventPassiveDismissDuringCreate:
|
|
1572
|
-
resolvedOpen:
|
|
1573
|
-
setIsCreateFlowActive:
|
|
1597
|
+
isCreateFlowActive: b,
|
|
1598
|
+
preventPassiveDismissDuringCreate: S,
|
|
1599
|
+
resolvedOpen: g,
|
|
1600
|
+
setIsCreateFlowActive: v
|
|
1574
1601
|
};
|
|
1575
1602
|
}
|
|
1576
1603
|
export {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
ya as
|
|
1604
|
+
ua as C,
|
|
1605
|
+
fa as E,
|
|
1606
|
+
Wt as L,
|
|
1607
|
+
ma as V,
|
|
1608
|
+
ga as a,
|
|
1609
|
+
ha as b,
|
|
1610
|
+
ba as c,
|
|
1611
|
+
Zt as d,
|
|
1612
|
+
xa as e,
|
|
1613
|
+
pa as f,
|
|
1614
|
+
ot as g,
|
|
1615
|
+
ya as h,
|
|
1616
|
+
va as u
|
|
1589
1617
|
};
|