react-semaphor 0.1.267 → 0.1.269
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/chunks/{dashboard-controls-BRv37g5w.js → dashboard-controls-DZbu0Qmg.js} +1 -1
- package/dist/chunks/{dashboard-controls-d8j31cnQ.js → dashboard-controls-KZ0jtgY5.js} +108 -108
- package/dist/chunks/{dashboard-filter-controls-button-BOs9T2hG.js → dashboard-filter-controls-button-COiuEk99.js} +209 -199
- package/dist/chunks/dashboard-filter-controls-button-oAas5cZQ.js +11 -0
- package/dist/chunks/{dashboard-json-DjNS3G-C.js → dashboard-json-Bx9GdUw1.js} +1 -1
- package/dist/chunks/{dashboard-json-CnEYIbNI.js → dashboard-json-DUItaes0.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-CrBOuggE.js → dashboard-summary-settings-dialog-B3LysUNE.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DOVwh8Cc.js → dashboard-summary-settings-dialog-DpQ0TcuD.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D4UMcS6R.js → edit-dashboard-visual-BHITqHZD.js} +7808 -7327
- package/dist/chunks/edit-dashboard-visual-BKm-cHkR.js +193 -0
- package/dist/chunks/{index-C2i6CRUk.js → index-D9ofksI5.js} +523 -326
- package/dist/chunks/{index-D5jdzvu3.js → index-DP6lD0f3.js} +35936 -34785
- package/dist/chunks/{resource-management-panel-3XD0FrTD.js → resource-management-panel-BqZmY8eT.js} +16 -16
- package/dist/chunks/{resource-management-panel-ZK4SWoad.js → resource-management-panel-ngkCnMCx.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bb83NOgW.js → use-create-flow-overlay-state-BthYK7_T.js} +589 -591
- package/dist/chunks/use-create-flow-overlay-state-D0Rv8oRN.js +21 -0
- package/dist/chunks/use-visual-utils-CIn8Ieax.js +1 -0
- package/dist/chunks/{use-visual-utils-Bj7eAUMG.js → use-visual-utils-CJdoP-Px.js} +111 -123
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- 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 +38 -0
- package/dist/types/main.d.ts +40 -0
- package/dist/types/shared.d.ts +38 -0
- package/dist/types/surfboard.d.ts +38 -0
- package/dist/types/types.d.ts +38 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-controls-button-DKRyKRsP.js +0 -11
- package/dist/chunks/edit-dashboard-visual-D6RokBEF.js +0 -188
- package/dist/chunks/use-create-flow-overlay-state-Cmt64wFE.js +0 -21
- package/dist/chunks/use-visual-utils-Bdwejpa1.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { bM as te, U as E, bN as Oe, bO as tt, bP as at, bQ as st, bR as lt, bS as rt, u as ve, af as nt, bT as dt, bU as it, bV as ot, ac as Z, c as q, bW as ct, bX as ut, B as I, s as mt, H as ae, N as Me, J as _e, bY as ze, w as Be, M as fe, bZ as Qe, X as je, x as _, b_ as pt, b$ as ht, c0 as J, c1 as we, c2 as Te, c3 as ie, c4 as Fe, c5 as ft, c6 as bt, c7 as P, c8 as yt, c9 as vt, a6 as Ve, ca as Ee, cb as ge, cc as Ue, cd as Re, ce as gt, L as R, I as $e, y as oe, z as ce, A as ue, E as me, F as pe, cf as Ke, cg as xt, ch as Ct, ci as He, cj as Ye, ck as Nt, cl as kt, cm as St, cn as Dt, co as It, cp as wt, cq as Tt, cr as Ft, cs as he, ct as Vt, cu as Le, cv as Et, cw as Lt, cx as At } from "./index-DP6lD0f3.js";
|
|
2
|
+
import { jsx as t, jsxs as d, Fragment as X } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as L, useState as j, useRef as qt, useCallback as M, useEffect as be, Fragment as Ot } from "react";
|
|
4
|
+
import { u as xe } from "./use-visual-utils-CJdoP-Px.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const Yt = te("CircleX", [
|
|
12
12
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
13
13
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
14
14
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -19,7 +19,7 @@ const Ht = ae("CircleX", [
|
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const Mt = te("Library", [
|
|
23
23
|
["path", { d: "m16 6 4 14", key: "ji33uf" }],
|
|
24
24
|
["path", { d: "M12 6v14", key: "1n7gus" }],
|
|
25
25
|
["path", { d: "M8 8v12", key: "1gg7y9" }],
|
|
@@ -31,7 +31,7 @@ const Ot = ae("Library", [
|
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
const _t =
|
|
34
|
+
const _t = te("Link2", [
|
|
35
35
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
36
36
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
37
37
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
@@ -42,7 +42,7 @@ const _t = ae("Link2", [
|
|
|
42
42
|
* This source code is licensed under the ISC license.
|
|
43
43
|
* See the LICENSE file in the root directory of this source tree.
|
|
44
44
|
*/
|
|
45
|
-
const
|
|
45
|
+
const Xe = te("Save", [
|
|
46
46
|
[
|
|
47
47
|
"path",
|
|
48
48
|
{
|
|
@@ -53,123 +53,123 @@ const Ye = ae("Save", [
|
|
|
53
53
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
54
54
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
55
55
|
]);
|
|
56
|
-
function
|
|
57
|
-
var
|
|
58
|
-
const s =
|
|
59
|
-
() =>
|
|
56
|
+
function Ge() {
|
|
57
|
+
var m, x;
|
|
58
|
+
const s = E((v) => v.card), l = E((v) => v.frame), r = L(
|
|
59
|
+
() => Oe(l, s),
|
|
60
60
|
[l, s]
|
|
61
|
-
), { manifest:
|
|
62
|
-
((
|
|
63
|
-
),
|
|
61
|
+
), { manifest: i } = tt(
|
|
62
|
+
((m = r == null ? void 0 : r.customCardPreferences) == null ? void 0 : m.url) || ""
|
|
63
|
+
), u = L(
|
|
64
64
|
() => {
|
|
65
|
-
var
|
|
66
|
-
return (
|
|
67
|
-
(
|
|
68
|
-
var
|
|
69
|
-
return
|
|
65
|
+
var v;
|
|
66
|
+
return (v = i == null ? void 0 : i.visuals) == null ? void 0 : v.find(
|
|
67
|
+
(b) => {
|
|
68
|
+
var y;
|
|
69
|
+
return b.name === ((y = r == null ? void 0 : r.customCardPreferences) == null ? void 0 : y.componentName);
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
},
|
|
73
|
-
[
|
|
74
|
-
),
|
|
75
|
-
() =>
|
|
73
|
+
[i, (x = r == null ? void 0 : r.customCardPreferences) == null ? void 0 : x.componentName]
|
|
74
|
+
), p = at(r, u), h = L(
|
|
75
|
+
() => st({
|
|
76
76
|
frame: l,
|
|
77
|
-
configCard:
|
|
78
|
-
isMultiInputVisual:
|
|
77
|
+
configCard: r,
|
|
78
|
+
isMultiInputVisual: p === "multiple"
|
|
79
79
|
}),
|
|
80
|
-
[l,
|
|
81
|
-
),
|
|
82
|
-
const
|
|
83
|
-
(
|
|
80
|
+
[l, r, p]
|
|
81
|
+
), f = L(() => {
|
|
82
|
+
const v = h.findIndex(
|
|
83
|
+
(b) => (b == null ? void 0 : b.id) === s.id
|
|
84
84
|
);
|
|
85
|
-
return
|
|
86
|
-
}, [
|
|
87
|
-
return
|
|
85
|
+
return v < 0 ? -1 : lt(s, v);
|
|
86
|
+
}, [h, s]);
|
|
87
|
+
return L(() => !r || p !== "multiple" || f < 0 ? s.type : rt(
|
|
88
88
|
s,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
) ?? s.type, [
|
|
89
|
+
f,
|
|
90
|
+
u == null ? void 0 : u.slots
|
|
91
|
+
) ?? s.type, [r, p, f, s, u == null ? void 0 : u.slots]);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Xt({
|
|
94
94
|
type: s,
|
|
95
95
|
isLinked: l,
|
|
96
|
-
className:
|
|
97
|
-
showLabel:
|
|
98
|
-
showLocal:
|
|
96
|
+
className: r,
|
|
97
|
+
showLabel: i = !1,
|
|
98
|
+
showLocal: u = !1
|
|
99
99
|
}) {
|
|
100
|
-
const
|
|
101
|
-
let
|
|
100
|
+
const p = ve((D) => D.selectedFrameId), h = nt((D) => D.selectedVisual), f = E((D) => D.frame);
|
|
101
|
+
let m;
|
|
102
102
|
if (s)
|
|
103
|
-
|
|
103
|
+
m = s;
|
|
104
104
|
else if (l !== void 0)
|
|
105
|
-
|
|
106
|
-
else if (!!!(
|
|
107
|
-
|
|
108
|
-
else if (
|
|
109
|
-
|
|
110
|
-
else if (
|
|
111
|
-
|
|
112
|
-
else if (
|
|
113
|
-
|
|
105
|
+
m = l ? "linked" : "library";
|
|
106
|
+
else if (!!!(f != null && f.visualId || h != null && h.id) && p)
|
|
107
|
+
m = "local";
|
|
108
|
+
else if (h && !p)
|
|
109
|
+
m = "library";
|
|
110
|
+
else if (f != null && f.visualId && p)
|
|
111
|
+
m = "linked";
|
|
112
|
+
else if (h != null && h.id && p)
|
|
113
|
+
m = "library";
|
|
114
114
|
else
|
|
115
115
|
return null;
|
|
116
|
-
if (
|
|
116
|
+
if (m === "local" && !u)
|
|
117
117
|
return null;
|
|
118
118
|
const x = {
|
|
119
119
|
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",
|
|
120
120
|
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",
|
|
121
121
|
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"
|
|
122
|
-
},
|
|
122
|
+
}, v = {
|
|
123
123
|
local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
|
|
124
124
|
linked: "Linked to library: Changes made here update the library visual and all linked instances.",
|
|
125
125
|
library: "Library visual: Share and reuse this visual across multiple dashboards."
|
|
126
|
-
},
|
|
126
|
+
}, b = {
|
|
127
127
|
local: "border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",
|
|
128
128
|
linked: "border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",
|
|
129
129
|
library: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
|
|
130
|
-
},
|
|
130
|
+
}, y = {
|
|
131
131
|
local: "fill-slate-50 dark:fill-slate-900",
|
|
132
132
|
linked: "fill-purple-50 dark:fill-purple-950",
|
|
133
133
|
library: "fill-blue-50 dark:fill-blue-950"
|
|
134
134
|
}, C = {
|
|
135
135
|
local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
|
|
136
136
|
linked: /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
|
|
137
|
-
library: /* @__PURE__ */ t(
|
|
137
|
+
library: /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" })
|
|
138
138
|
}, A = {
|
|
139
139
|
local: "Local",
|
|
140
140
|
linked: "Linked",
|
|
141
141
|
library: "Library"
|
|
142
142
|
};
|
|
143
|
-
return /* @__PURE__ */ t(
|
|
144
|
-
/* @__PURE__ */ t(
|
|
143
|
+
return /* @__PURE__ */ t(dt, { children: /* @__PURE__ */ d(it, { delayDuration: 300, children: [
|
|
144
|
+
/* @__PURE__ */ t(ot, { asChild: !0, children: /* @__PURE__ */ d(
|
|
145
145
|
Z,
|
|
146
146
|
{
|
|
147
147
|
variant: "outline",
|
|
148
148
|
className: q(
|
|
149
149
|
"cursor-help select-none transition-all",
|
|
150
|
-
x[
|
|
151
|
-
|
|
150
|
+
x[m],
|
|
151
|
+
r
|
|
152
152
|
),
|
|
153
153
|
children: [
|
|
154
|
-
C[
|
|
155
|
-
|
|
154
|
+
C[m],
|
|
155
|
+
i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: A[m] })
|
|
156
156
|
]
|
|
157
157
|
}
|
|
158
158
|
) }),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
159
|
+
/* @__PURE__ */ d(
|
|
160
|
+
ct,
|
|
161
161
|
{
|
|
162
162
|
side: "bottom",
|
|
163
|
-
className: q("max-w-xs",
|
|
163
|
+
className: q("max-w-xs", b[m]),
|
|
164
164
|
children: [
|
|
165
|
-
/* @__PURE__ */ t(
|
|
166
|
-
/* @__PURE__ */ t("p", { children:
|
|
165
|
+
/* @__PURE__ */ t(ut, { className: y[m] }),
|
|
166
|
+
/* @__PURE__ */ t("p", { children: v[m] })
|
|
167
167
|
]
|
|
168
168
|
}
|
|
169
169
|
)
|
|
170
170
|
] }) });
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function zt(s, l) {
|
|
173
173
|
return {
|
|
174
174
|
...s,
|
|
175
175
|
sql: "",
|
|
@@ -179,80 +179,74 @@ function Mt(s, l) {
|
|
|
179
179
|
preferences: {},
|
|
180
180
|
interactionConfig: void 0,
|
|
181
181
|
linkedInteractionTargetOverrides: void 0,
|
|
182
|
+
dynamicCardPreferences: void 0,
|
|
182
183
|
customCardPreferences: l ? s.customCardPreferences : void 0,
|
|
184
|
+
visualizationMode: "builtin",
|
|
183
185
|
type: l ? s.type : "bar"
|
|
184
186
|
};
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function Ce(s) {
|
|
189
|
+
const l = pt(s);
|
|
190
|
+
return l ? (_.error(l), !1) : !0;
|
|
191
|
+
}
|
|
192
|
+
function Gt({
|
|
187
193
|
className: s,
|
|
188
194
|
variant: l = "outline"
|
|
189
195
|
}) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Et(
|
|
195
|
-
((h = o.customCardPreferences) == null ? void 0 : h.url) || ""
|
|
196
|
-
), S(
|
|
197
|
-
(r) => r.selectedSchemaName
|
|
198
|
-
), S(
|
|
199
|
-
(r) => r.selectedDatamodelId
|
|
200
|
-
), S(
|
|
201
|
-
(r) => r.selectedDatabaseName
|
|
202
|
-
), S((r) => r.selectedTableName), S(
|
|
203
|
-
(r) => r.selectedConnectionId
|
|
204
|
-
), S((r) => r.isShowingVisual), o.sql;
|
|
205
|
-
const m = S((r) => r.onSave), { getUpdatedFrame: b } = xe();
|
|
206
|
-
function p() {
|
|
207
|
-
const r = b();
|
|
208
|
-
m == null || m(r);
|
|
196
|
+
const r = E((p) => p.onSave), { getUpdatedFrame: i } = xe();
|
|
197
|
+
function u() {
|
|
198
|
+
const p = i();
|
|
199
|
+
Ce(p) && (r == null || r(p));
|
|
209
200
|
}
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
|
|
201
|
+
return /* @__PURE__ */ d(
|
|
202
|
+
I,
|
|
212
203
|
{
|
|
213
|
-
onClick:
|
|
204
|
+
onClick: u,
|
|
214
205
|
className: q("h-8", s),
|
|
215
206
|
size: "sm",
|
|
216
207
|
variant: l,
|
|
217
208
|
children: [
|
|
218
|
-
/* @__PURE__ */ t(
|
|
209
|
+
/* @__PURE__ */ t(mt, { className: "mr-2 size-4 font-bold" }),
|
|
219
210
|
"Accept"
|
|
220
211
|
]
|
|
221
212
|
}
|
|
222
213
|
);
|
|
223
214
|
}
|
|
224
|
-
function
|
|
215
|
+
function Wt({
|
|
225
216
|
className: s,
|
|
226
217
|
variant: l = "default"
|
|
227
218
|
}) {
|
|
228
|
-
const
|
|
229
|
-
(
|
|
230
|
-
), { setIsVisualEditing:
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
219
|
+
const r = ae(), [i, u] = j(!1), p = ve(
|
|
220
|
+
(y) => y.actions.setIsDashboardPanelOpen
|
|
221
|
+
), { setIsVisualEditing: h } = Me(), { getUpdatedFrame: f } = xe(), m = _e(), x = E((y) => y.frame), v = ze();
|
|
222
|
+
return /* @__PURE__ */ d(
|
|
223
|
+
I,
|
|
233
224
|
{
|
|
234
225
|
onClick: () => {
|
|
235
|
-
const
|
|
226
|
+
const y = f();
|
|
227
|
+
if (!Ce(y))
|
|
228
|
+
return;
|
|
229
|
+
const C = (x == null ? void 0 : x.visualId) || (m == null ? void 0 : m.id);
|
|
236
230
|
if (!C) {
|
|
237
|
-
|
|
231
|
+
_.error("No visual to save");
|
|
238
232
|
return;
|
|
239
233
|
}
|
|
240
|
-
|
|
234
|
+
u(!0), v.mutate(
|
|
241
235
|
{
|
|
242
236
|
visualId: C,
|
|
243
237
|
data: {
|
|
244
|
-
frameObject:
|
|
238
|
+
frameObject: y
|
|
245
239
|
}
|
|
246
240
|
},
|
|
247
241
|
{
|
|
248
242
|
onSuccess: () => {
|
|
249
|
-
|
|
243
|
+
u(!1), p(!0), _.success("Visual updated successfully"), r.invalidateQueries({
|
|
250
244
|
queryKey: ["resource-by-id", "visual", C],
|
|
251
245
|
exact: !0
|
|
252
246
|
});
|
|
253
247
|
},
|
|
254
248
|
onError: () => {
|
|
255
|
-
|
|
249
|
+
u(!1), _.error("Failed to update visual");
|
|
256
250
|
}
|
|
257
251
|
}
|
|
258
252
|
);
|
|
@@ -261,154 +255,158 @@ function Gt({
|
|
|
261
255
|
size: "sm",
|
|
262
256
|
variant: l,
|
|
263
257
|
children: [
|
|
264
|
-
|
|
265
|
-
/* @__PURE__ */ t(
|
|
258
|
+
i && /* @__PURE__ */ d(X, { children: [
|
|
259
|
+
/* @__PURE__ */ t(Be, { className: "mr-2 size-4 animate-spin font-bold" }),
|
|
266
260
|
" Saving"
|
|
267
261
|
] }),
|
|
268
|
-
!
|
|
269
|
-
/* @__PURE__ */ t(
|
|
262
|
+
!i && /* @__PURE__ */ d(X, { children: [
|
|
263
|
+
/* @__PURE__ */ t(Xe, { className: "mr-2 size-4 font-bold" }),
|
|
270
264
|
"Save to Library"
|
|
271
265
|
] })
|
|
272
266
|
]
|
|
273
267
|
}
|
|
274
268
|
);
|
|
275
269
|
}
|
|
276
|
-
function
|
|
270
|
+
function Jt({
|
|
277
271
|
className: s
|
|
278
272
|
}) {
|
|
279
|
-
const l =
|
|
273
|
+
const l = ae(), [r, i] = j(!1), u = _e(), p = E((y) => y.frame), h = ve((y) => y.selectedSheetId), { updateFrame: f, setIsVisualEditing: m } = Me(), { getUpdatedFrame: x } = xe(), v = ze();
|
|
280
274
|
return /* @__PURE__ */ t(
|
|
281
|
-
|
|
275
|
+
I,
|
|
282
276
|
{
|
|
283
277
|
onClick: async () => {
|
|
284
|
-
if (!
|
|
285
|
-
|
|
278
|
+
if (!h) {
|
|
279
|
+
_.error("No sheet selected");
|
|
286
280
|
return;
|
|
287
281
|
}
|
|
288
|
-
const
|
|
289
|
-
if (!
|
|
290
|
-
|
|
282
|
+
const y = (p == null ? void 0 : p.visualId) || (u == null ? void 0 : u.id);
|
|
283
|
+
if (!y) {
|
|
284
|
+
_.error("No visual to update");
|
|
291
285
|
return;
|
|
292
286
|
}
|
|
293
|
-
|
|
287
|
+
i(!0);
|
|
294
288
|
try {
|
|
295
289
|
const C = x();
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
if (!Ce(C)) {
|
|
291
|
+
i(!1);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
await v.mutateAsync({
|
|
295
|
+
visualId: y,
|
|
298
296
|
data: {
|
|
299
297
|
frameObject: C
|
|
300
298
|
}
|
|
301
299
|
});
|
|
302
300
|
const A = {
|
|
303
301
|
...C,
|
|
304
|
-
visualId:
|
|
302
|
+
visualId: y
|
|
305
303
|
// Keep the link to library visual
|
|
306
304
|
};
|
|
307
|
-
h
|
|
308
|
-
|
|
305
|
+
f(h, A), l.invalidateQueries({ queryKey: ["visuals"] }), l.invalidateQueries({ queryKey: ["visual", y] }), _.success("Saved to library and applied locally"), setTimeout(() => {
|
|
306
|
+
m(!1);
|
|
309
307
|
}, 300);
|
|
310
308
|
} catch (C) {
|
|
311
|
-
console.error("Failed to save and apply:", C),
|
|
309
|
+
console.error("Failed to save and apply:", C), _.error("Failed to save and apply changes");
|
|
312
310
|
} finally {
|
|
313
|
-
|
|
311
|
+
i(!1);
|
|
314
312
|
}
|
|
315
313
|
},
|
|
316
314
|
className: q("h-8", s),
|
|
317
315
|
size: "sm",
|
|
318
316
|
variant: "default",
|
|
319
|
-
disabled:
|
|
320
|
-
children:
|
|
321
|
-
/* @__PURE__ */ t(
|
|
317
|
+
disabled: r,
|
|
318
|
+
children: r ? /* @__PURE__ */ d(X, { children: [
|
|
319
|
+
/* @__PURE__ */ t(Be, { className: "mr-2 size-4 animate-spin font-bold" }),
|
|
322
320
|
" Saving..."
|
|
323
|
-
] }) : /* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */ t(
|
|
321
|
+
] }) : /* @__PURE__ */ d(X, { children: [
|
|
322
|
+
/* @__PURE__ */ t(Xe, { className: "mr-2 size-4 font-bold" }),
|
|
325
323
|
"Save & Apply"
|
|
326
324
|
] })
|
|
327
325
|
}
|
|
328
326
|
);
|
|
329
327
|
}
|
|
330
|
-
function
|
|
331
|
-
const { setTempQueryData: l, setSqlGen:
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
334
|
-
const { queryKey:
|
|
335
|
-
|
|
328
|
+
function Pt({ className: s }) {
|
|
329
|
+
const { setTempQueryData: l, setSqlGen: r } = fe(), i = ae(), u = E((b) => b.tempQueryData), p = E((b) => b.onClose), h = E((b) => b.card), f = Ge(), m = L(() => f !== h.type ? { ...h, type: f } : h, [h, f]), { queryKey: x } = Qe(m);
|
|
330
|
+
function v() {
|
|
331
|
+
if (u) {
|
|
332
|
+
const { queryKey: b, queryData: y } = u;
|
|
333
|
+
b && y && i.setQueryData(b, y);
|
|
336
334
|
}
|
|
337
|
-
|
|
335
|
+
r({}), p == null || p();
|
|
338
336
|
}
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
|
|
337
|
+
return /* @__PURE__ */ d(
|
|
338
|
+
I,
|
|
341
339
|
{
|
|
342
|
-
onClick:
|
|
340
|
+
onClick: v,
|
|
343
341
|
className: q("h-8", s),
|
|
344
342
|
size: "sm",
|
|
345
343
|
variant: "outline",
|
|
346
344
|
children: [
|
|
347
|
-
/* @__PURE__ */ t(
|
|
345
|
+
/* @__PURE__ */ t(je, { className: "mr-2 size-4" }),
|
|
348
346
|
"Close"
|
|
349
347
|
]
|
|
350
348
|
}
|
|
351
349
|
);
|
|
352
350
|
}
|
|
353
|
-
function
|
|
351
|
+
function Zt({
|
|
354
352
|
label: s = "Clear",
|
|
355
353
|
variant: l = "secondary",
|
|
356
|
-
className:
|
|
354
|
+
className: r
|
|
357
355
|
} = {}) {
|
|
358
|
-
const { setTempQueryData:
|
|
359
|
-
setCardSql:
|
|
360
|
-
setSqlGen:
|
|
361
|
-
setCardPython:
|
|
356
|
+
const { setTempQueryData: i } = fe(), u = ae(), p = E((a) => a.tempQueryData), h = E((a) => a.card), f = Ge(), m = L(() => f !== h.type ? { ...h, type: f } : h, [h, f]), { queryKey: x } = Qe(m), {
|
|
357
|
+
setCardSql: v,
|
|
358
|
+
setSqlGen: b,
|
|
359
|
+
setCardPython: y,
|
|
362
360
|
setCardCustomCfg: C,
|
|
363
361
|
setCardPreferences: A,
|
|
364
|
-
clearQueryConfig:
|
|
365
|
-
setCardConfig:
|
|
366
|
-
setCardType:
|
|
362
|
+
clearQueryConfig: D,
|
|
363
|
+
setCardConfig: se,
|
|
364
|
+
setCardType: le,
|
|
367
365
|
setFrame: G,
|
|
368
366
|
setCard: $,
|
|
369
|
-
setActiveTabCardId:
|
|
370
|
-
} =
|
|
367
|
+
setActiveTabCardId: re
|
|
368
|
+
} = fe();
|
|
371
369
|
function U() {
|
|
372
|
-
var
|
|
373
|
-
const a =
|
|
374
|
-
|
|
370
|
+
var B, W, H, F;
|
|
371
|
+
const a = u.getQueryData(x);
|
|
372
|
+
p != null && p.queryData || i({
|
|
375
373
|
queryKey: x,
|
|
376
374
|
queryData: a
|
|
377
|
-
}),
|
|
378
|
-
const
|
|
375
|
+
}), u.setQueryData(x, null), u.removeQueries({ queryKey: x, exact: !0 }), v(""), b({}), D(), se(void 0), y(""), C(""), A({});
|
|
376
|
+
const S = E.getState().frame, K = E.getState().card, T = Oe(S, K), w = ((B = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : B.visualType) === "multiple" || !!((W = T == null ? void 0 : T.customCardPreferences) != null && W.dataInputCardIds) || (((H = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : H.minInputs) || 0) > 1 || (((F = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : F.maxInputs) || 0) > 1, z = zt(K, w);
|
|
379
377
|
G({
|
|
380
|
-
...
|
|
381
|
-
cards:
|
|
382
|
-
(O) => O.id ===
|
|
378
|
+
...S,
|
|
379
|
+
cards: S.cards.map(
|
|
380
|
+
(O) => O.id === z.id ? z : O
|
|
383
381
|
)
|
|
384
|
-
}),
|
|
382
|
+
}), re(z.id), $(z), w || le("bar");
|
|
385
383
|
}
|
|
386
|
-
return /* @__PURE__ */
|
|
387
|
-
|
|
384
|
+
return /* @__PURE__ */ d(
|
|
385
|
+
I,
|
|
388
386
|
{
|
|
389
387
|
onClick: U,
|
|
390
|
-
className: q("h-8",
|
|
388
|
+
className: q("h-8", r),
|
|
391
389
|
size: "sm",
|
|
392
390
|
variant: l,
|
|
393
391
|
children: [
|
|
394
|
-
/* @__PURE__ */ t(
|
|
392
|
+
/* @__PURE__ */ t(je, { className: "mr-2 size-3.5" }),
|
|
395
393
|
s
|
|
396
394
|
]
|
|
397
395
|
}
|
|
398
396
|
);
|
|
399
397
|
}
|
|
400
|
-
function
|
|
401
|
-
const { control: l, onChange:
|
|
402
|
-
return /* @__PURE__ */
|
|
398
|
+
function We(s) {
|
|
399
|
+
const { control: l, onChange: r } = s;
|
|
400
|
+
return /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
403
401
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Label" }),
|
|
404
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
405
403
|
/* @__PURE__ */ t(
|
|
406
|
-
|
|
404
|
+
$e,
|
|
407
405
|
{
|
|
408
406
|
className: "pr-40",
|
|
409
407
|
value: l.label,
|
|
410
408
|
placeholder: "Control label",
|
|
411
|
-
onChange: (
|
|
409
|
+
onChange: (i) => r(i.target.value)
|
|
412
410
|
}
|
|
413
411
|
),
|
|
414
412
|
/* @__PURE__ */ t(
|
|
@@ -422,20 +420,20 @@ function Ge(s) {
|
|
|
422
420
|
] })
|
|
423
421
|
] });
|
|
424
422
|
}
|
|
425
|
-
function
|
|
426
|
-
const { currentStep: l, labels:
|
|
427
|
-
return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b bg-background/95 px-1 pb-2 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-3", children:
|
|
428
|
-
const
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
423
|
+
function Bt(s) {
|
|
424
|
+
const { currentStep: l, labels: r } = s;
|
|
425
|
+
return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b bg-background/95 px-1 pb-2 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-3", children: r.map((i, u) => {
|
|
426
|
+
const p = u + 1, h = p === l, f = p < l;
|
|
427
|
+
return /* @__PURE__ */ d(Ot, { children: [
|
|
428
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
431
429
|
/* @__PURE__ */ t(
|
|
432
430
|
"span",
|
|
433
431
|
{
|
|
434
432
|
className: q(
|
|
435
433
|
"flex h-7 w-7 items-center justify-center rounded-full border text-[11px] font-semibold",
|
|
436
|
-
|
|
434
|
+
h ? "border-primary bg-primary text-primary-foreground" : f ? "border-primary/25 bg-primary/10 text-primary" : "border-border bg-muted/30 text-muted-foreground"
|
|
437
435
|
),
|
|
438
|
-
children:
|
|
436
|
+
children: p
|
|
439
437
|
}
|
|
440
438
|
),
|
|
441
439
|
/* @__PURE__ */ t(
|
|
@@ -443,467 +441,467 @@ function zt(s) {
|
|
|
443
441
|
{
|
|
444
442
|
className: q(
|
|
445
443
|
"text-xs font-medium",
|
|
446
|
-
|
|
444
|
+
h ? "text-foreground" : "text-muted-foreground"
|
|
447
445
|
),
|
|
448
|
-
children:
|
|
446
|
+
children: i
|
|
449
447
|
}
|
|
450
448
|
)
|
|
451
449
|
] }),
|
|
452
|
-
|
|
450
|
+
u < r.length - 1 ? /* @__PURE__ */ t(
|
|
453
451
|
"span",
|
|
454
452
|
{
|
|
455
453
|
className: "h-px w-5 bg-border/80 sm:w-8",
|
|
456
454
|
"aria-hidden": "true"
|
|
457
455
|
}
|
|
458
456
|
) : null
|
|
459
|
-
] },
|
|
457
|
+
] }, i);
|
|
460
458
|
}) }) });
|
|
461
459
|
}
|
|
462
|
-
function
|
|
463
|
-
const { secondary: l, tertiary:
|
|
464
|
-
return /* @__PURE__ */
|
|
460
|
+
function ee(s) {
|
|
461
|
+
const { secondary: l, tertiary: r, primary: i } = s;
|
|
462
|
+
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: [
|
|
465
463
|
l,
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
r,
|
|
465
|
+
i
|
|
468
466
|
] });
|
|
469
467
|
}
|
|
470
|
-
function
|
|
471
|
-
const { control: l, scope:
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */ t(
|
|
474
|
-
/* @__PURE__ */
|
|
468
|
+
function Qt(s) {
|
|
469
|
+
const { control: l, scope: r, detail: i } = s;
|
|
470
|
+
return /* @__PURE__ */ d("div", { className: "flex items-start gap-3 rounded-xl border border-border/40 bg-muted/20 p-3", children: [
|
|
471
|
+
/* @__PURE__ */ t(Lt, { className: "mt-0.5 h-4 w-4 text-emerald-600" }),
|
|
472
|
+
/* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
475
473
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium", children: l.label }),
|
|
476
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ d("div", { className: "text-xs text-muted-foreground", children: [
|
|
477
475
|
ge(l.type).label,
|
|
478
476
|
" ·",
|
|
479
477
|
" ",
|
|
480
|
-
|
|
478
|
+
Re(l),
|
|
481
479
|
" ·",
|
|
482
480
|
" ",
|
|
483
|
-
|
|
481
|
+
Ue(r, l.placement)
|
|
484
482
|
] }),
|
|
485
|
-
|
|
483
|
+
i ? /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: i }) : null
|
|
486
484
|
] })
|
|
487
485
|
] });
|
|
488
486
|
}
|
|
489
487
|
function ye(s) {
|
|
490
|
-
const { title: l, children:
|
|
491
|
-
return /* @__PURE__ */
|
|
488
|
+
const { title: l, children: r, className: i } = s;
|
|
489
|
+
return /* @__PURE__ */ d(
|
|
492
490
|
"div",
|
|
493
491
|
{
|
|
494
492
|
className: q(
|
|
495
493
|
"space-y-1 rounded-xl border border-border/40 bg-muted/20 p-3",
|
|
496
|
-
|
|
494
|
+
i
|
|
497
495
|
),
|
|
498
496
|
children: [
|
|
499
497
|
/* @__PURE__ */ t("div", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: l }),
|
|
500
|
-
|
|
498
|
+
r
|
|
501
499
|
]
|
|
502
500
|
}
|
|
503
501
|
);
|
|
504
502
|
}
|
|
505
|
-
function
|
|
506
|
-
const { createdReference: l, description:
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
503
|
+
function jt(s) {
|
|
504
|
+
const { createdReference: l, description: r } = s;
|
|
505
|
+
return /* @__PURE__ */ d(ye, { title: "SQL cards", className: "space-y-2", children: [
|
|
506
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 rounded-md border border-border/30 bg-muted/40 px-3 py-2", children: [
|
|
509
507
|
/* @__PURE__ */ t("code", { className: "min-w-0 truncate text-xs", children: l }),
|
|
510
508
|
/* @__PURE__ */ t(
|
|
511
|
-
|
|
509
|
+
At,
|
|
512
510
|
{
|
|
513
511
|
text: l,
|
|
514
512
|
ariaLabel: "Copy SQL control reference"
|
|
515
513
|
}
|
|
516
514
|
)
|
|
517
515
|
] }),
|
|
518
|
-
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children:
|
|
516
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: r })
|
|
519
517
|
] });
|
|
520
518
|
}
|
|
521
|
-
function
|
|
519
|
+
function Ae(s) {
|
|
522
520
|
const {
|
|
523
521
|
control: l,
|
|
524
|
-
defaultValue:
|
|
525
|
-
availableFieldChoices:
|
|
526
|
-
availableMetricChoices:
|
|
527
|
-
onControlChange:
|
|
528
|
-
onLabelChange:
|
|
529
|
-
onDefaultValueChange:
|
|
530
|
-
onBack:
|
|
522
|
+
defaultValue: r,
|
|
523
|
+
availableFieldChoices: i,
|
|
524
|
+
availableMetricChoices: u,
|
|
525
|
+
onControlChange: p,
|
|
526
|
+
onLabelChange: h,
|
|
527
|
+
onDefaultValueChange: f,
|
|
528
|
+
onBack: m,
|
|
531
529
|
onNext: x,
|
|
532
|
-
nextDisabled:
|
|
530
|
+
nextDisabled: v
|
|
533
531
|
} = s;
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */ t(
|
|
532
|
+
return /* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
533
|
+
/* @__PURE__ */ t(We, { control: l, onChange: h }),
|
|
536
534
|
/* @__PURE__ */ t(
|
|
537
|
-
|
|
535
|
+
He,
|
|
538
536
|
{
|
|
539
537
|
control: l,
|
|
540
|
-
availableFieldChoices:
|
|
541
|
-
availableMetricChoices:
|
|
542
|
-
onChange:
|
|
538
|
+
availableFieldChoices: i,
|
|
539
|
+
availableMetricChoices: u,
|
|
540
|
+
onChange: p
|
|
543
541
|
}
|
|
544
542
|
),
|
|
545
543
|
/* @__PURE__ */ t(
|
|
546
|
-
|
|
544
|
+
Ye,
|
|
547
545
|
{
|
|
548
546
|
control: l,
|
|
549
|
-
value:
|
|
550
|
-
onChange:
|
|
547
|
+
value: r,
|
|
548
|
+
onChange: f,
|
|
551
549
|
allowCardDefault: !0,
|
|
552
550
|
hint: "This is the value viewers will see first."
|
|
553
551
|
}
|
|
554
552
|
),
|
|
555
553
|
/* @__PURE__ */ t(
|
|
556
|
-
|
|
554
|
+
ee,
|
|
557
555
|
{
|
|
558
|
-
secondary: /* @__PURE__ */ t(
|
|
559
|
-
primary: /* @__PURE__ */ t(
|
|
556
|
+
secondary: /* @__PURE__ */ t(I, { type: "button", variant: "outline", onClick: m, children: "Back" }),
|
|
557
|
+
primary: /* @__PURE__ */ t(I, { type: "button", onClick: x, disabled: v, children: "Next" })
|
|
560
558
|
}
|
|
561
559
|
)
|
|
562
560
|
] });
|
|
563
561
|
}
|
|
564
|
-
function
|
|
562
|
+
function qe(s) {
|
|
565
563
|
const {
|
|
566
564
|
control: l,
|
|
567
|
-
scope:
|
|
568
|
-
createdReference:
|
|
569
|
-
explorerContent:
|
|
570
|
-
sqlDescription:
|
|
571
|
-
summaryDetail:
|
|
572
|
-
onBack:
|
|
573
|
-
onCancel:
|
|
565
|
+
scope: r,
|
|
566
|
+
createdReference: i,
|
|
567
|
+
explorerContent: u,
|
|
568
|
+
sqlDescription: p,
|
|
569
|
+
summaryDetail: h,
|
|
570
|
+
onBack: f,
|
|
571
|
+
onCancel: m,
|
|
574
572
|
onDone: x
|
|
575
573
|
} = s;
|
|
576
|
-
return /* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
577
575
|
/* @__PURE__ */ t(
|
|
578
|
-
|
|
576
|
+
Qt,
|
|
579
577
|
{
|
|
580
578
|
control: l,
|
|
581
|
-
scope:
|
|
582
|
-
detail:
|
|
579
|
+
scope: r,
|
|
580
|
+
detail: h
|
|
583
581
|
}
|
|
584
582
|
),
|
|
585
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
586
584
|
/* @__PURE__ */ t("p", { className: "text-sm font-medium", children: "How cards use this control" }),
|
|
587
|
-
|
|
585
|
+
u,
|
|
588
586
|
/* @__PURE__ */ t(
|
|
589
|
-
|
|
587
|
+
jt,
|
|
590
588
|
{
|
|
591
|
-
createdReference:
|
|
592
|
-
description:
|
|
589
|
+
createdReference: i,
|
|
590
|
+
description: p
|
|
593
591
|
}
|
|
594
592
|
)
|
|
595
593
|
] }),
|
|
596
594
|
/* @__PURE__ */ t(
|
|
597
|
-
|
|
595
|
+
ee,
|
|
598
596
|
{
|
|
599
|
-
secondary: /* @__PURE__ */ t(
|
|
600
|
-
tertiary: /* @__PURE__ */ t(
|
|
601
|
-
primary: /* @__PURE__ */ t(
|
|
597
|
+
secondary: /* @__PURE__ */ t(I, { type: "button", variant: "outline", onClick: f, children: "Back" }),
|
|
598
|
+
tertiary: /* @__PURE__ */ t(I, { type: "button", variant: "outline", onClick: m, children: "Cancel" }),
|
|
599
|
+
primary: /* @__PURE__ */ t(I, { type: "button", onClick: x, children: "Done" })
|
|
602
600
|
}
|
|
603
601
|
)
|
|
604
602
|
] });
|
|
605
603
|
}
|
|
606
|
-
function
|
|
604
|
+
function Ut(s) {
|
|
607
605
|
const l = J(
|
|
608
606
|
s.scope,
|
|
609
607
|
s.existingControls,
|
|
610
608
|
s.reservedIds
|
|
611
|
-
),
|
|
609
|
+
), r = s.type === l.type ? {
|
|
612
610
|
...l,
|
|
613
|
-
label:
|
|
611
|
+
label: he[s.type]
|
|
614
612
|
} : {
|
|
615
|
-
|
|
613
|
+
...Ke({
|
|
616
614
|
controls: [
|
|
617
615
|
{
|
|
618
616
|
...l,
|
|
619
|
-
label:
|
|
617
|
+
label: he[s.type]
|
|
620
618
|
}
|
|
621
619
|
],
|
|
622
620
|
controlId: l.id,
|
|
623
621
|
nextType: s.type
|
|
624
622
|
}).controls[0],
|
|
625
|
-
label:
|
|
623
|
+
label: he[s.type]
|
|
626
624
|
};
|
|
627
625
|
return {
|
|
628
626
|
step: 2,
|
|
629
|
-
control:
|
|
630
|
-
defaultValue: P(
|
|
627
|
+
control: r,
|
|
628
|
+
defaultValue: P(r, void 0)
|
|
631
629
|
};
|
|
632
630
|
}
|
|
633
|
-
function
|
|
631
|
+
function ea({
|
|
634
632
|
scope: s,
|
|
635
633
|
controls: l,
|
|
636
|
-
reservedControlIds:
|
|
637
|
-
defaultValues:
|
|
638
|
-
onChange:
|
|
639
|
-
emptyMessage:
|
|
640
|
-
initialCreateFlow:
|
|
641
|
-
usageByControlId:
|
|
642
|
-
availableFieldChoices:
|
|
634
|
+
reservedControlIds: r,
|
|
635
|
+
defaultValues: i,
|
|
636
|
+
onChange: u,
|
|
637
|
+
emptyMessage: p,
|
|
638
|
+
initialCreateFlow: h = !1,
|
|
639
|
+
usageByControlId: f,
|
|
640
|
+
availableFieldChoices: m,
|
|
643
641
|
availableMetricChoices: x,
|
|
644
|
-
structuralParticipants:
|
|
645
|
-
structuralParticipantIdsByControlId:
|
|
646
|
-
card:
|
|
642
|
+
structuralParticipants: v,
|
|
643
|
+
structuralParticipantIdsByControlId: b,
|
|
644
|
+
card: y,
|
|
647
645
|
onCreateFlowActiveChange: C,
|
|
648
646
|
onCreateFlowComplete: A
|
|
649
647
|
}) {
|
|
650
|
-
const
|
|
651
|
-
() => new Set(
|
|
652
|
-
[
|
|
653
|
-
),
|
|
648
|
+
const D = L(
|
|
649
|
+
() => new Set(r || []),
|
|
650
|
+
[r]
|
|
651
|
+
), se = xt(s), le = ht(s), [G, $] = j(
|
|
654
652
|
null
|
|
655
|
-
), [
|
|
653
|
+
), [re, U] = j(
|
|
656
654
|
null
|
|
657
|
-
), [a,
|
|
658
|
-
() =>
|
|
655
|
+
), [a, S] = j(
|
|
656
|
+
() => h ? {
|
|
659
657
|
step: 1,
|
|
660
|
-
control: J(s, l, Array.from(
|
|
658
|
+
control: J(s, l, Array.from(D))
|
|
661
659
|
} : null
|
|
662
|
-
), K =
|
|
663
|
-
() =>
|
|
664
|
-
[
|
|
665
|
-
),
|
|
660
|
+
), K = qt(h), T = L(
|
|
661
|
+
() => we({ scope: s, card: y }),
|
|
662
|
+
[y, s]
|
|
663
|
+
), w = M(
|
|
666
664
|
(e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
667
665
|
[s]
|
|
668
|
-
),
|
|
669
|
-
() => a ?
|
|
670
|
-
|
|
666
|
+
), z = L(
|
|
667
|
+
() => a ? Te(
|
|
668
|
+
v || [],
|
|
671
669
|
a.control.type
|
|
672
670
|
) : [],
|
|
673
|
-
[a,
|
|
674
|
-
),
|
|
671
|
+
[a, v]
|
|
672
|
+
), B = L(() => {
|
|
675
673
|
if (!a)
|
|
676
674
|
return {
|
|
677
|
-
fields:
|
|
675
|
+
fields: m || [],
|
|
678
676
|
metrics: x || []
|
|
679
677
|
};
|
|
680
|
-
if (!
|
|
678
|
+
if (!w(a.control.type))
|
|
681
679
|
return {
|
|
682
|
-
fields:
|
|
680
|
+
fields: m || [],
|
|
683
681
|
metrics: x || []
|
|
684
682
|
};
|
|
685
|
-
const e = a.selectedCardIds || [],
|
|
683
|
+
const e = a.selectedCardIds || [], c = ie({
|
|
686
684
|
controlType: a.control.type,
|
|
687
|
-
participants:
|
|
685
|
+
participants: v || [],
|
|
688
686
|
selectedCardIds: e
|
|
689
687
|
});
|
|
690
688
|
return {
|
|
691
|
-
fields: a.control.type === "field_selector" ?
|
|
692
|
-
option:
|
|
693
|
-
target:
|
|
689
|
+
fields: a.control.type === "field_selector" ? c.choices.map((o) => ({
|
|
690
|
+
option: o,
|
|
691
|
+
target: c.fieldTargetMap[o.value]
|
|
694
692
|
})) : [],
|
|
695
|
-
metrics: a.control.type === "metric_selector" ?
|
|
696
|
-
option:
|
|
697
|
-
target:
|
|
693
|
+
metrics: a.control.type === "metric_selector" ? c.choices.map((o) => ({
|
|
694
|
+
option: o,
|
|
695
|
+
target: c.metricTargetMap[o.value]
|
|
698
696
|
})) : []
|
|
699
697
|
};
|
|
700
698
|
}, [
|
|
701
|
-
|
|
699
|
+
m,
|
|
702
700
|
x,
|
|
703
701
|
a,
|
|
704
|
-
|
|
705
|
-
|
|
702
|
+
w,
|
|
703
|
+
v
|
|
706
704
|
]);
|
|
707
705
|
be(() => {
|
|
708
706
|
C == null || C(!!a);
|
|
709
707
|
}, [a, C]), be(() => {
|
|
710
|
-
const e =
|
|
711
|
-
K.current =
|
|
708
|
+
const e = h && !K.current;
|
|
709
|
+
K.current = h, e && (S({
|
|
712
710
|
step: 1,
|
|
713
|
-
control: J(s, l, Array.from(
|
|
711
|
+
control: J(s, l, Array.from(D))
|
|
714
712
|
}), U(null), $(null));
|
|
715
|
-
}, [l,
|
|
713
|
+
}, [l, h, D, s]);
|
|
716
714
|
const W = (e) => {
|
|
717
|
-
if (!
|
|
715
|
+
if (!w(e.type))
|
|
718
716
|
return {
|
|
719
|
-
fields:
|
|
717
|
+
fields: m || [],
|
|
720
718
|
metrics: x || []
|
|
721
719
|
};
|
|
722
|
-
const
|
|
723
|
-
if (
|
|
720
|
+
const c = (b == null ? void 0 : b[e.id]) || [];
|
|
721
|
+
if (c.length === 0)
|
|
724
722
|
return {
|
|
725
|
-
fields:
|
|
723
|
+
fields: m || [],
|
|
726
724
|
metrics: x || []
|
|
727
725
|
};
|
|
728
|
-
const
|
|
726
|
+
const o = ie({
|
|
729
727
|
controlType: e.type,
|
|
730
|
-
participants:
|
|
731
|
-
selectedCardIds:
|
|
728
|
+
participants: v || [],
|
|
729
|
+
selectedCardIds: c
|
|
732
730
|
});
|
|
733
731
|
return {
|
|
734
|
-
fields: e.type === "field_selector" ?
|
|
732
|
+
fields: e.type === "field_selector" ? o.choices.map((g) => ({
|
|
735
733
|
option: g,
|
|
736
|
-
target:
|
|
734
|
+
target: o.fieldTargetMap[g.value]
|
|
737
735
|
})) : [],
|
|
738
|
-
metrics: e.type === "metric_selector" ?
|
|
736
|
+
metrics: e.type === "metric_selector" ? o.choices.map((g) => ({
|
|
739
737
|
option: g,
|
|
740
|
-
target:
|
|
738
|
+
target: o.metricTargetMap[g.value]
|
|
741
739
|
})) : []
|
|
742
740
|
};
|
|
743
741
|
}, H = (e) => {
|
|
744
|
-
if (!
|
|
742
|
+
if (!w(e.control.type))
|
|
745
743
|
return {
|
|
746
744
|
nextControl: e.control,
|
|
747
745
|
cardBindingsById: void 0
|
|
748
746
|
};
|
|
749
|
-
const
|
|
747
|
+
const c = (b == null ? void 0 : b[e.control.id]) || [], o = ie({
|
|
750
748
|
controlType: e.control.type,
|
|
751
|
-
participants:
|
|
749
|
+
participants: v || [],
|
|
752
750
|
selectedCardIds: e.nextSelectedCardIds
|
|
753
|
-
}), g =
|
|
751
|
+
}), g = Et({
|
|
754
752
|
control: e.control,
|
|
755
|
-
choices:
|
|
753
|
+
choices: o.choices
|
|
756
754
|
}), N = Object.fromEntries(
|
|
757
|
-
|
|
755
|
+
c.filter((n) => !e.nextSelectedCardIds.includes(n)).map((n) => [n, void 0])
|
|
758
756
|
);
|
|
759
757
|
return e.nextSelectedCardIds.length > 0 && g.source.kind === "manual" && g.source.options.length > 0 && Object.assign(
|
|
760
758
|
N,
|
|
761
759
|
Le({
|
|
762
760
|
control: g,
|
|
763
|
-
participants:
|
|
761
|
+
participants: v || [],
|
|
764
762
|
selectedCardIds: e.nextSelectedCardIds
|
|
765
763
|
})
|
|
766
764
|
), {
|
|
767
765
|
nextControl: g,
|
|
768
766
|
cardBindingsById: N
|
|
769
767
|
};
|
|
770
|
-
}, F =
|
|
771
|
-
|
|
772
|
-
}, [
|
|
773
|
-
const
|
|
774
|
-
(
|
|
768
|
+
}, F = M((e, c = i, o = { type: "update" }) => {
|
|
769
|
+
u(e, c, o);
|
|
770
|
+
}, [i, u]), O = (e, c) => {
|
|
771
|
+
const o = l.find(
|
|
772
|
+
(V) => V.id === e
|
|
775
773
|
);
|
|
776
|
-
let g = l.map((
|
|
774
|
+
let g = l.map((V) => V.id !== e ? V : c(V));
|
|
777
775
|
const N = g.find(
|
|
778
|
-
(
|
|
776
|
+
(V) => V.id === e
|
|
779
777
|
);
|
|
780
|
-
let
|
|
778
|
+
let n, k;
|
|
781
779
|
if (N && s === "dashboard" && (N.type === "field_selector" || N.type === "metric_selector")) {
|
|
782
|
-
const
|
|
780
|
+
const V = (b == null ? void 0 : b[N.id]) || [], Q = H({
|
|
783
781
|
control: N,
|
|
784
|
-
nextSelectedCardIds:
|
|
782
|
+
nextSelectedCardIds: V
|
|
785
783
|
});
|
|
786
784
|
g = g.map(
|
|
787
|
-
(
|
|
788
|
-
),
|
|
789
|
-
} else if (
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
), k = [
|
|
785
|
+
(Ie) => Ie.id === e ? Q.nextControl : Ie
|
|
786
|
+
), n = Q.cardBindingsById, k = [N.id];
|
|
787
|
+
} else if (o && s === "dashboard" && (o.type === "field_selector" || o.type === "metric_selector")) {
|
|
788
|
+
const V = (b == null ? void 0 : b[o.id]) || [];
|
|
789
|
+
n = Object.fromEntries(
|
|
790
|
+
V.map((Q) => [Q, void 0])
|
|
791
|
+
), k = [o.id];
|
|
794
792
|
}
|
|
795
|
-
F(g,
|
|
793
|
+
F(g, i, {
|
|
796
794
|
type: "update",
|
|
797
|
-
cardBindingsById:
|
|
795
|
+
cardBindingsById: n,
|
|
798
796
|
affectedBindingControlIds: k
|
|
799
797
|
});
|
|
800
|
-
},
|
|
801
|
-
const
|
|
802
|
-
if (
|
|
803
|
-
(
|
|
798
|
+
}, Je = (e, c) => {
|
|
799
|
+
const o = c.trim();
|
|
800
|
+
if (o.length === 0 || o === e || D.has(o) || l.some(
|
|
801
|
+
(n) => n.id === o && n.id !== e
|
|
804
802
|
))
|
|
805
803
|
return;
|
|
806
804
|
const g = l.map(
|
|
807
|
-
(
|
|
805
|
+
(n) => n.id === e ? { ...n, id: o } : n
|
|
808
806
|
);
|
|
809
|
-
if (!
|
|
807
|
+
if (!i) {
|
|
810
808
|
F(g, void 0, {
|
|
811
809
|
type: "rename",
|
|
812
810
|
oldId: e,
|
|
813
|
-
newId:
|
|
811
|
+
newId: o
|
|
814
812
|
});
|
|
815
813
|
return;
|
|
816
814
|
}
|
|
817
|
-
const N = { ...
|
|
818
|
-
Object.prototype.hasOwnProperty.call(N, e) && (N[
|
|
815
|
+
const N = { ...i };
|
|
816
|
+
Object.prototype.hasOwnProperty.call(N, e) && (N[o] = N[e], delete N[e]), F(g, N, {
|
|
819
817
|
type: "rename",
|
|
820
818
|
oldId: e,
|
|
821
|
-
newId:
|
|
819
|
+
newId: o
|
|
822
820
|
});
|
|
823
|
-
},
|
|
824
|
-
const
|
|
825
|
-
if (!
|
|
826
|
-
F(
|
|
821
|
+
}, Pe = (e) => {
|
|
822
|
+
const c = l.filter((g) => g.id !== e);
|
|
823
|
+
if (!i) {
|
|
824
|
+
F(c, void 0, { type: "remove", controlId: e });
|
|
827
825
|
return;
|
|
828
826
|
}
|
|
829
|
-
const
|
|
830
|
-
delete
|
|
831
|
-
},
|
|
832
|
-
|
|
827
|
+
const o = { ...i };
|
|
828
|
+
delete o[e], F(c, o, { type: "remove", controlId: e });
|
|
829
|
+
}, Ze = M(() => {
|
|
830
|
+
S({
|
|
833
831
|
step: 1,
|
|
834
|
-
control: J(s, l, Array.from(
|
|
832
|
+
control: J(s, l, Array.from(D))
|
|
835
833
|
}), U(null), $(null);
|
|
836
|
-
}, [l,
|
|
837
|
-
|
|
838
|
-
(
|
|
839
|
-
...
|
|
840
|
-
control: e(
|
|
834
|
+
}, [l, D, s]), Y = (e) => {
|
|
835
|
+
S(
|
|
836
|
+
(c) => c && {
|
|
837
|
+
...c,
|
|
838
|
+
control: e(c.control)
|
|
841
839
|
}
|
|
842
840
|
);
|
|
843
|
-
},
|
|
844
|
-
|
|
845
|
-
(
|
|
846
|
-
...
|
|
841
|
+
}, Ne = (e) => {
|
|
842
|
+
S(
|
|
843
|
+
(c) => c && {
|
|
844
|
+
...c,
|
|
847
845
|
defaultValue: e
|
|
848
846
|
}
|
|
849
847
|
);
|
|
850
|
-
},
|
|
848
|
+
}, ne = (() => {
|
|
851
849
|
if (!a)
|
|
852
850
|
return !1;
|
|
853
|
-
if (a.step === 2 &&
|
|
851
|
+
if (a.step === 2 && w(a.control.type))
|
|
854
852
|
return (a.selectedCardIds || []).length > 0;
|
|
855
853
|
if (a.step !== 2 && a.step !== 3 || !a.control.label.trim())
|
|
856
854
|
return !1;
|
|
857
|
-
const
|
|
858
|
-
return
|
|
855
|
+
const c = Fe(a.control);
|
|
856
|
+
return c.source.kind === "manual" && (ft(c) && c.source.options.length === 0 || c.source.options.some(
|
|
859
857
|
(g) => g.label.trim().length === 0 || g.value.trim().length === 0
|
|
860
|
-
)) ? !1 :
|
|
861
|
-
P(
|
|
858
|
+
)) ? !1 : bt(
|
|
859
|
+
P(c, a.defaultValue)
|
|
862
860
|
);
|
|
863
|
-
})(),
|
|
864
|
-
var
|
|
861
|
+
})(), ke = () => {
|
|
862
|
+
var n;
|
|
865
863
|
if (!a)
|
|
866
864
|
return;
|
|
867
|
-
const e =
|
|
865
|
+
const e = Fe(a.control), c = Vt({
|
|
868
866
|
label: e.label,
|
|
869
867
|
fallbackId: e.id,
|
|
870
868
|
existingControls: l,
|
|
871
|
-
reservedIds: Array.from(
|
|
872
|
-
}),
|
|
869
|
+
reservedIds: Array.from(D)
|
|
870
|
+
}), o = {
|
|
873
871
|
...e,
|
|
874
|
-
id:
|
|
875
|
-
}, g = s === "dashboard" && (
|
|
876
|
-
control:
|
|
877
|
-
participants:
|
|
872
|
+
id: c
|
|
873
|
+
}, g = s === "dashboard" && (o.type === "field_selector" || o.type === "metric_selector") && ((n = a.selectedCardIds) != null && n.length) ? Le({
|
|
874
|
+
control: o,
|
|
875
|
+
participants: v || [],
|
|
878
876
|
selectedCardIds: a.selectedCardIds
|
|
879
877
|
}) : void 0, N = P(
|
|
880
|
-
|
|
878
|
+
o,
|
|
881
879
|
a.defaultValue
|
|
882
880
|
);
|
|
883
|
-
|
|
884
|
-
step: s === "dashboard" && (
|
|
885
|
-
control:
|
|
881
|
+
S({
|
|
882
|
+
step: s === "dashboard" && (o.type === "field_selector" || o.type === "metric_selector") ? 4 : 3,
|
|
883
|
+
control: o,
|
|
886
884
|
defaultValue: N,
|
|
887
|
-
createdControlId:
|
|
885
|
+
createdControlId: c,
|
|
888
886
|
selectedCardIds: a.selectedCardIds,
|
|
889
887
|
cardBindingsById: g
|
|
890
888
|
});
|
|
891
|
-
},
|
|
892
|
-
|
|
893
|
-
}, []),
|
|
889
|
+
}, de = M(() => {
|
|
890
|
+
S(null);
|
|
891
|
+
}, []), Se = M(() => {
|
|
894
892
|
if (!(a != null && a.createdControlId)) {
|
|
895
|
-
|
|
893
|
+
S(null);
|
|
896
894
|
return;
|
|
897
895
|
}
|
|
898
|
-
const e = a.control,
|
|
896
|
+
const e = a.control, c = a.createdControlId, o = P(
|
|
899
897
|
e,
|
|
900
898
|
a.defaultValue
|
|
901
899
|
);
|
|
902
|
-
|
|
900
|
+
i ? F(
|
|
903
901
|
[...l, e],
|
|
904
902
|
{
|
|
905
|
-
...
|
|
906
|
-
[
|
|
903
|
+
...i,
|
|
904
|
+
[c]: o
|
|
907
905
|
},
|
|
908
906
|
{
|
|
909
907
|
type: "add",
|
|
@@ -914,7 +912,7 @@ function Zt({
|
|
|
914
912
|
...l,
|
|
915
913
|
{
|
|
916
914
|
...e,
|
|
917
|
-
defaultValue:
|
|
915
|
+
defaultValue: o
|
|
918
916
|
}
|
|
919
917
|
],
|
|
920
918
|
void 0,
|
|
@@ -922,33 +920,33 @@ function Zt({
|
|
|
922
920
|
type: "add",
|
|
923
921
|
cardBindingsById: a.cardBindingsById
|
|
924
922
|
}
|
|
925
|
-
), U(
|
|
926
|
-
}, [l, a,
|
|
927
|
-
return /* @__PURE__ */
|
|
928
|
-
a ? /* @__PURE__ */
|
|
923
|
+
), U(c), S(null), A == null || A();
|
|
924
|
+
}, [l, a, i, F, A]), et = a ? w(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], De = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${yt(a.control.label) || a.control.id}]]` : "";
|
|
925
|
+
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
926
|
+
a ? /* @__PURE__ */ d("div", { className: "space-y-4 pb-1", children: [
|
|
929
927
|
/* @__PURE__ */ t(
|
|
930
|
-
|
|
928
|
+
Bt,
|
|
931
929
|
{
|
|
932
930
|
currentStep: a.step,
|
|
933
|
-
labels:
|
|
931
|
+
labels: et
|
|
934
932
|
}
|
|
935
933
|
),
|
|
936
|
-
a.step === 1 && /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
934
|
+
a.step === 1 && /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
935
|
+
/* @__PURE__ */ d("div", { children: [
|
|
938
936
|
/* @__PURE__ */ t("p", { className: "text-sm font-medium", children: "What kind of input should viewers see?" }),
|
|
939
937
|
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Choose the viewer experience first. You can fine-tune the details next." }),
|
|
940
|
-
s === "card" && (
|
|
938
|
+
s === "card" && (y == null ? void 0 : y.sql) == null ? /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null
|
|
941
939
|
] }),
|
|
942
|
-
/* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children:
|
|
940
|
+
/* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children: T.map((e) => /* @__PURE__ */ d(
|
|
943
941
|
"button",
|
|
944
942
|
{
|
|
945
943
|
type: "button",
|
|
946
944
|
className: "rounded-xl border border-border/50 bg-muted/20 p-3 text-left transition-colors hover:border-border/70 hover:bg-muted/35",
|
|
947
|
-
onClick: () =>
|
|
948
|
-
|
|
945
|
+
onClick: () => S(
|
|
946
|
+
Ut({
|
|
949
947
|
scope: s,
|
|
950
948
|
existingControls: l,
|
|
951
|
-
reservedIds: Array.from(
|
|
949
|
+
reservedIds: Array.from(D),
|
|
952
950
|
type: e.value
|
|
953
951
|
})
|
|
954
952
|
),
|
|
@@ -960,49 +958,49 @@ function Zt({
|
|
|
960
958
|
e.value
|
|
961
959
|
)) }),
|
|
962
960
|
/* @__PURE__ */ t(
|
|
963
|
-
|
|
961
|
+
ee,
|
|
964
962
|
{
|
|
965
963
|
secondary: /* @__PURE__ */ t(
|
|
966
|
-
|
|
964
|
+
I,
|
|
967
965
|
{
|
|
968
966
|
type: "button",
|
|
969
967
|
variant: "outline",
|
|
970
|
-
onClick:
|
|
968
|
+
onClick: de,
|
|
971
969
|
children: "Back to controls"
|
|
972
970
|
}
|
|
973
971
|
)
|
|
974
972
|
}
|
|
975
973
|
)
|
|
976
974
|
] }),
|
|
977
|
-
a.step === 2 &&
|
|
978
|
-
/* @__PURE__ */
|
|
975
|
+
a.step === 2 && w(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
976
|
+
/* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
979
977
|
/* @__PURE__ */ t(
|
|
980
|
-
|
|
978
|
+
We,
|
|
981
979
|
{
|
|
982
980
|
control: a.control,
|
|
983
|
-
onChange: (e) => Y((
|
|
984
|
-
...
|
|
981
|
+
onChange: (e) => Y((c) => ({
|
|
982
|
+
...c,
|
|
985
983
|
label: e
|
|
986
984
|
}))
|
|
987
985
|
}
|
|
988
986
|
),
|
|
989
987
|
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Choose which cards should respond to this shared control." })
|
|
990
988
|
] }),
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
return /* @__PURE__ */
|
|
989
|
+
z.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-xl bg-muted/20 p-3 text-xs text-muted-foreground", children: "No eligible cards are available yet. Add compatible metrics or group-by fields to cards first." }) : /* @__PURE__ */ t("div", { className: "space-y-2 rounded-xl bg-muted/20 p-3", children: z.map((e) => {
|
|
990
|
+
const c = (a.selectedCardIds || []).includes(e.cardId);
|
|
991
|
+
return /* @__PURE__ */ d(
|
|
994
992
|
"label",
|
|
995
993
|
{
|
|
996
994
|
className: "flex items-start gap-2 text-sm",
|
|
997
995
|
children: [
|
|
998
996
|
/* @__PURE__ */ t(
|
|
999
|
-
|
|
997
|
+
vt,
|
|
1000
998
|
{
|
|
1001
|
-
checked:
|
|
1002
|
-
onCheckedChange: (
|
|
999
|
+
checked: c,
|
|
1000
|
+
onCheckedChange: (o) => S(
|
|
1003
1001
|
(g) => g && {
|
|
1004
1002
|
...g,
|
|
1005
|
-
selectedCardIds:
|
|
1003
|
+
selectedCardIds: o === !0 ? [
|
|
1006
1004
|
...g.selectedCardIds || [],
|
|
1007
1005
|
e.cardId
|
|
1008
1006
|
] : (g.selectedCardIds || []).filter(
|
|
@@ -1012,7 +1010,7 @@ function Zt({
|
|
|
1012
1010
|
)
|
|
1013
1011
|
}
|
|
1014
1012
|
),
|
|
1015
|
-
/* @__PURE__ */
|
|
1013
|
+
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1016
1014
|
/* @__PURE__ */ t("div", { className: "font-medium", children: e.title }),
|
|
1017
1015
|
/* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: a.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
|
|
1018
1016
|
] })
|
|
@@ -1022,14 +1020,14 @@ function Zt({
|
|
|
1022
1020
|
);
|
|
1023
1021
|
}) }),
|
|
1024
1022
|
/* @__PURE__ */ t(
|
|
1025
|
-
|
|
1023
|
+
ee,
|
|
1026
1024
|
{
|
|
1027
1025
|
secondary: /* @__PURE__ */ t(
|
|
1028
|
-
|
|
1026
|
+
I,
|
|
1029
1027
|
{
|
|
1030
1028
|
type: "button",
|
|
1031
1029
|
variant: "outline",
|
|
1032
|
-
onClick: () =>
|
|
1030
|
+
onClick: () => S(
|
|
1033
1031
|
(e) => e && {
|
|
1034
1032
|
...e,
|
|
1035
1033
|
step: 1,
|
|
@@ -1040,75 +1038,75 @@ function Zt({
|
|
|
1040
1038
|
}
|
|
1041
1039
|
),
|
|
1042
1040
|
primary: /* @__PURE__ */ t(
|
|
1043
|
-
|
|
1041
|
+
I,
|
|
1044
1042
|
{
|
|
1045
1043
|
type: "button",
|
|
1046
|
-
onClick: () =>
|
|
1044
|
+
onClick: () => S(
|
|
1047
1045
|
(e) => e && {
|
|
1048
1046
|
...e,
|
|
1049
1047
|
step: 3
|
|
1050
1048
|
}
|
|
1051
1049
|
),
|
|
1052
|
-
disabled: !
|
|
1050
|
+
disabled: !ne,
|
|
1053
1051
|
children: "Next"
|
|
1054
1052
|
}
|
|
1055
1053
|
)
|
|
1056
1054
|
}
|
|
1057
1055
|
)
|
|
1058
1056
|
] }),
|
|
1059
|
-
a.step === 2 && !
|
|
1060
|
-
|
|
1057
|
+
a.step === 2 && !w(a.control.type) && /* @__PURE__ */ t(
|
|
1058
|
+
Ae,
|
|
1061
1059
|
{
|
|
1062
1060
|
control: a.control,
|
|
1063
1061
|
defaultValue: a.defaultValue,
|
|
1064
|
-
availableFieldChoices:
|
|
1065
|
-
availableMetricChoices:
|
|
1062
|
+
availableFieldChoices: B.fields,
|
|
1063
|
+
availableMetricChoices: B.metrics,
|
|
1066
1064
|
onControlChange: (e) => Y(() => e),
|
|
1067
|
-
onLabelChange: (e) => Y((
|
|
1068
|
-
...
|
|
1065
|
+
onLabelChange: (e) => Y((c) => ({
|
|
1066
|
+
...c,
|
|
1069
1067
|
label: e
|
|
1070
1068
|
})),
|
|
1071
|
-
onDefaultValueChange:
|
|
1072
|
-
onBack: () =>
|
|
1069
|
+
onDefaultValueChange: Ne,
|
|
1070
|
+
onBack: () => S(
|
|
1073
1071
|
(e) => e && {
|
|
1074
1072
|
...e,
|
|
1075
1073
|
step: 1
|
|
1076
1074
|
}
|
|
1077
1075
|
),
|
|
1078
|
-
onNext:
|
|
1079
|
-
nextDisabled: !
|
|
1076
|
+
onNext: ke,
|
|
1077
|
+
nextDisabled: !ne
|
|
1080
1078
|
}
|
|
1081
1079
|
),
|
|
1082
|
-
a.step === 3 &&
|
|
1083
|
-
|
|
1080
|
+
a.step === 3 && w(a.control.type) && /* @__PURE__ */ t(
|
|
1081
|
+
Ae,
|
|
1084
1082
|
{
|
|
1085
1083
|
control: a.control,
|
|
1086
1084
|
defaultValue: a.defaultValue,
|
|
1087
|
-
availableFieldChoices:
|
|
1088
|
-
availableMetricChoices:
|
|
1085
|
+
availableFieldChoices: B.fields,
|
|
1086
|
+
availableMetricChoices: B.metrics,
|
|
1089
1087
|
onControlChange: (e) => Y(() => e),
|
|
1090
|
-
onLabelChange: (e) => Y((
|
|
1091
|
-
...
|
|
1088
|
+
onLabelChange: (e) => Y((c) => ({
|
|
1089
|
+
...c,
|
|
1092
1090
|
label: e
|
|
1093
1091
|
})),
|
|
1094
|
-
onDefaultValueChange:
|
|
1095
|
-
onBack: () =>
|
|
1092
|
+
onDefaultValueChange: Ne,
|
|
1093
|
+
onBack: () => S(
|
|
1096
1094
|
(e) => e && {
|
|
1097
1095
|
...e,
|
|
1098
1096
|
step: 2
|
|
1099
1097
|
}
|
|
1100
1098
|
),
|
|
1101
|
-
onNext:
|
|
1102
|
-
nextDisabled: !
|
|
1099
|
+
onNext: ke,
|
|
1100
|
+
nextDisabled: !ne
|
|
1103
1101
|
}
|
|
1104
1102
|
),
|
|
1105
|
-
a.step === 3 && !
|
|
1106
|
-
|
|
1103
|
+
a.step === 3 && !w(a.control.type) && /* @__PURE__ */ t(
|
|
1104
|
+
qe,
|
|
1107
1105
|
{
|
|
1108
1106
|
control: a.control,
|
|
1109
1107
|
scope: s,
|
|
1110
|
-
createdReference:
|
|
1111
|
-
explorerContent: /* @__PURE__ */ t(ye, { title: "Explorer cards", children: /* @__PURE__ */
|
|
1108
|
+
createdReference: De,
|
|
1109
|
+
explorerContent: /* @__PURE__ */ t(ye, { title: "Explorer cards", children: /* @__PURE__ */ d("p", { className: "text-sm", children: [
|
|
1112
1110
|
"Open the card and use",
|
|
1113
1111
|
" ",
|
|
1114
1112
|
/* @__PURE__ */ t("span", { className: "font-medium", children: "Settings → Controls" }),
|
|
@@ -1116,23 +1114,23 @@ function Zt({
|
|
|
1116
1114
|
"to choose what this control changes."
|
|
1117
1115
|
] }) }),
|
|
1118
1116
|
sqlDescription: "Reference this control directly in the SQL editor.",
|
|
1119
|
-
onBack: () =>
|
|
1117
|
+
onBack: () => S(
|
|
1120
1118
|
(e) => e && {
|
|
1121
1119
|
...e,
|
|
1122
1120
|
step: 2
|
|
1123
1121
|
}
|
|
1124
1122
|
),
|
|
1125
|
-
onCancel:
|
|
1126
|
-
onDone:
|
|
1123
|
+
onCancel: de,
|
|
1124
|
+
onDone: Se
|
|
1127
1125
|
}
|
|
1128
1126
|
),
|
|
1129
|
-
a.step === 4 &&
|
|
1130
|
-
|
|
1127
|
+
a.step === 4 && w(a.control.type) && /* @__PURE__ */ t(
|
|
1128
|
+
qe,
|
|
1131
1129
|
{
|
|
1132
1130
|
control: a.control,
|
|
1133
1131
|
scope: s,
|
|
1134
|
-
createdReference:
|
|
1135
|
-
summaryDetail: /* @__PURE__ */
|
|
1132
|
+
createdReference: De,
|
|
1133
|
+
summaryDetail: /* @__PURE__ */ d(X, { children: [
|
|
1136
1134
|
"Used by ",
|
|
1137
1135
|
(a.selectedCardIds || []).length,
|
|
1138
1136
|
" ",
|
|
@@ -1141,141 +1139,141 @@ function Zt({
|
|
|
1141
1139
|
] }),
|
|
1142
1140
|
explorerContent: /* @__PURE__ */ t(ye, { title: "Explorer cards", children: /* @__PURE__ */ t("p", { className: "text-sm", children: "Selected cards have been set up to respond to this control automatically." }) }),
|
|
1143
1141
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
1144
|
-
onBack: () =>
|
|
1142
|
+
onBack: () => S(
|
|
1145
1143
|
(e) => e && {
|
|
1146
1144
|
...e,
|
|
1147
1145
|
step: 3
|
|
1148
1146
|
}
|
|
1149
1147
|
),
|
|
1150
|
-
onCancel:
|
|
1151
|
-
onDone:
|
|
1148
|
+
onCancel: de,
|
|
1149
|
+
onDone: Se
|
|
1152
1150
|
}
|
|
1153
1151
|
)
|
|
1154
1152
|
] }) : null,
|
|
1155
|
-
!a && l.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children:
|
|
1153
|
+
!a && l.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: p }) : null,
|
|
1156
1154
|
!a && l.map((e) => {
|
|
1157
|
-
const
|
|
1158
|
-
return /* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */
|
|
1155
|
+
const c = W(e), o = f == null ? void 0 : f[e.id], g = i && Object.prototype.hasOwnProperty.call(i, e.id) ? i[e.id] : e.defaultValue, N = re === e.id;
|
|
1156
|
+
return /* @__PURE__ */ d("div", { className: "rounded-md border", children: [
|
|
1157
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 py-3", children: [
|
|
1158
|
+
/* @__PURE__ */ d(
|
|
1161
1159
|
"button",
|
|
1162
1160
|
{
|
|
1163
1161
|
type: "button",
|
|
1164
1162
|
className: "flex min-w-0 flex-1 items-start gap-2 text-left",
|
|
1165
1163
|
onClick: () => U(
|
|
1166
|
-
(
|
|
1164
|
+
(n) => n === e.id ? null : e.id
|
|
1167
1165
|
),
|
|
1168
1166
|
children: [
|
|
1169
|
-
N ? /* @__PURE__ */ t(Ve, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1167
|
+
N ? /* @__PURE__ */ t(Ve, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Ee, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
1168
|
+
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1169
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1172
1170
|
/* @__PURE__ */ t("span", { className: "truncate text-sm font-medium", children: e.label || "Untitled control" }),
|
|
1173
1171
|
/* @__PURE__ */ t(Z, { variant: "outline", className: "text-[11px]", children: ge(e.type).label }),
|
|
1174
|
-
/* @__PURE__ */ t(Z, { variant: "secondary", className: "text-[11px]", children:
|
|
1172
|
+
/* @__PURE__ */ t(Z, { variant: "secondary", className: "text-[11px]", children: Ue(s, e.placement) })
|
|
1175
1173
|
] }),
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
|
|
1178
|
-
|
|
1174
|
+
/* @__PURE__ */ d("div", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
1175
|
+
Re(e),
|
|
1176
|
+
o != null && o.status ? ` · ${o.status}` : ""
|
|
1179
1177
|
] })
|
|
1180
1178
|
] })
|
|
1181
1179
|
]
|
|
1182
1180
|
}
|
|
1183
1181
|
),
|
|
1184
1182
|
/* @__PURE__ */ t(
|
|
1185
|
-
|
|
1183
|
+
I,
|
|
1186
1184
|
{
|
|
1187
1185
|
type: "button",
|
|
1188
1186
|
size: "icon",
|
|
1189
1187
|
variant: "ghost",
|
|
1190
1188
|
className: "h-8 w-8 shrink-0",
|
|
1191
|
-
onClick: () =>
|
|
1189
|
+
onClick: () => Pe(e.id),
|
|
1192
1190
|
"aria-label": `Remove ${e.label}`,
|
|
1193
|
-
children: /* @__PURE__ */ t(
|
|
1191
|
+
children: /* @__PURE__ */ t(gt, { className: "h-4 w-4" })
|
|
1194
1192
|
}
|
|
1195
1193
|
)
|
|
1196
1194
|
] }),
|
|
1197
|
-
N && /* @__PURE__ */
|
|
1198
|
-
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
1195
|
+
N && /* @__PURE__ */ d("div", { className: "space-y-4 border-t px-3 py-4", children: [
|
|
1196
|
+
o != null && o.helper ? /* @__PURE__ */ t("div", { className: "rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: o.helper }) : null,
|
|
1197
|
+
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
|
|
1198
|
+
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1201
1199
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Label" }),
|
|
1202
1200
|
/* @__PURE__ */ t(
|
|
1203
|
-
|
|
1201
|
+
$e,
|
|
1204
1202
|
{
|
|
1205
1203
|
value: e.label,
|
|
1206
1204
|
placeholder: "Control label",
|
|
1207
|
-
onChange: (
|
|
1205
|
+
onChange: (n) => O(e.id, (k) => ({
|
|
1208
1206
|
...k,
|
|
1209
|
-
label:
|
|
1207
|
+
label: n.target.value
|
|
1210
1208
|
}))
|
|
1211
1209
|
}
|
|
1212
1210
|
)
|
|
1213
1211
|
] }),
|
|
1214
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1215
1213
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Type" }),
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
|
|
1214
|
+
/* @__PURE__ */ d(
|
|
1215
|
+
oe,
|
|
1218
1216
|
{
|
|
1219
1217
|
value: e.type,
|
|
1220
|
-
onValueChange: (
|
|
1221
|
-
const k =
|
|
1218
|
+
onValueChange: (n) => {
|
|
1219
|
+
const k = Ke({
|
|
1222
1220
|
controls: l,
|
|
1223
1221
|
controlId: e.id,
|
|
1224
|
-
nextType:
|
|
1225
|
-
defaultValues:
|
|
1222
|
+
nextType: n,
|
|
1223
|
+
defaultValues: i
|
|
1226
1224
|
});
|
|
1227
1225
|
F(k.controls, k.defaultValues);
|
|
1228
1226
|
},
|
|
1229
1227
|
children: [
|
|
1230
|
-
/* @__PURE__ */ t(
|
|
1231
|
-
/* @__PURE__ */ t(
|
|
1228
|
+
/* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(ue, {}) }),
|
|
1229
|
+
/* @__PURE__ */ t(me, { children: we({
|
|
1232
1230
|
scope: s,
|
|
1233
|
-
card:
|
|
1231
|
+
card: y,
|
|
1234
1232
|
includeType: e.type
|
|
1235
|
-
}).map((
|
|
1233
|
+
}).map((n) => /* @__PURE__ */ t(pe, { value: n.value, children: n.label }, n.value)) })
|
|
1236
1234
|
]
|
|
1237
1235
|
}
|
|
1238
1236
|
)
|
|
1239
1237
|
] }),
|
|
1240
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1241
1239
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Show in" }),
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
|
|
1240
|
+
/* @__PURE__ */ d(
|
|
1241
|
+
oe,
|
|
1244
1242
|
{
|
|
1245
|
-
value: e.placement ||
|
|
1246
|
-
onValueChange: (
|
|
1243
|
+
value: e.placement || le,
|
|
1244
|
+
onValueChange: (n) => O(e.id, (k) => ({
|
|
1247
1245
|
...k,
|
|
1248
|
-
placement:
|
|
1246
|
+
placement: n
|
|
1249
1247
|
})),
|
|
1250
1248
|
children: [
|
|
1251
|
-
/* @__PURE__ */ t(
|
|
1252
|
-
/* @__PURE__ */ t(
|
|
1249
|
+
/* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(ue, {}) }),
|
|
1250
|
+
/* @__PURE__ */ t(me, { children: se.map((n) => /* @__PURE__ */ t(pe, { value: n.value, children: n.label }, n.value)) })
|
|
1253
1251
|
]
|
|
1254
1252
|
}
|
|
1255
1253
|
)
|
|
1256
1254
|
] })
|
|
1257
1255
|
] }),
|
|
1258
|
-
|
|
1259
|
-
|
|
1256
|
+
w(e.type) ? /* @__PURE__ */ t(
|
|
1257
|
+
Ct,
|
|
1260
1258
|
{
|
|
1261
1259
|
type: e.type,
|
|
1262
|
-
participants:
|
|
1263
|
-
|
|
1260
|
+
participants: Te(
|
|
1261
|
+
v || [],
|
|
1264
1262
|
e.type
|
|
1265
|
-
).map((
|
|
1266
|
-
cardId:
|
|
1267
|
-
title:
|
|
1268
|
-
choiceCount: e.type === "field_selector" ?
|
|
1263
|
+
).map((n) => ({
|
|
1264
|
+
cardId: n.cardId,
|
|
1265
|
+
title: n.title,
|
|
1266
|
+
choiceCount: e.type === "field_selector" ? n.fieldChoices.length : n.metricChoices.length
|
|
1269
1267
|
})),
|
|
1270
|
-
selectedCardIds: (
|
|
1271
|
-
onChange: (
|
|
1268
|
+
selectedCardIds: (b == null ? void 0 : b[e.id]) || [],
|
|
1269
|
+
onChange: (n) => {
|
|
1272
1270
|
const k = H({
|
|
1273
1271
|
control: e,
|
|
1274
|
-
nextSelectedCardIds:
|
|
1275
|
-
}),
|
|
1276
|
-
(
|
|
1272
|
+
nextSelectedCardIds: n
|
|
1273
|
+
}), V = l.map(
|
|
1274
|
+
(Q) => Q.id === e.id ? k.nextControl : Q
|
|
1277
1275
|
);
|
|
1278
|
-
F(
|
|
1276
|
+
F(V, i, {
|
|
1279
1277
|
type: "update",
|
|
1280
1278
|
cardBindingsById: k.cardBindingsById
|
|
1281
1279
|
});
|
|
@@ -1283,98 +1281,98 @@ function Zt({
|
|
|
1283
1281
|
}
|
|
1284
1282
|
) : null,
|
|
1285
1283
|
/* @__PURE__ */ t(
|
|
1286
|
-
|
|
1284
|
+
He,
|
|
1287
1285
|
{
|
|
1288
1286
|
control: e,
|
|
1289
|
-
availableFieldChoices:
|
|
1290
|
-
availableMetricChoices:
|
|
1291
|
-
onChange: (
|
|
1287
|
+
availableFieldChoices: c.fields,
|
|
1288
|
+
availableMetricChoices: c.metrics,
|
|
1289
|
+
onChange: (n) => O(e.id, () => n)
|
|
1292
1290
|
}
|
|
1293
1291
|
),
|
|
1294
1292
|
e.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
|
|
1295
|
-
|
|
1293
|
+
Ye,
|
|
1296
1294
|
{
|
|
1297
1295
|
control: e,
|
|
1298
1296
|
value: g,
|
|
1299
1297
|
allowNoDefault: !0,
|
|
1300
1298
|
allowCardDefault: !0,
|
|
1301
|
-
onChange: (
|
|
1302
|
-
if (
|
|
1303
|
-
const k = { ...
|
|
1304
|
-
|
|
1299
|
+
onChange: (n) => {
|
|
1300
|
+
if (i) {
|
|
1301
|
+
const k = { ...i };
|
|
1302
|
+
n === void 0 ? delete k[e.id] : k[e.id] = n, F(l, k);
|
|
1305
1303
|
return;
|
|
1306
1304
|
}
|
|
1307
1305
|
O(e.id, (k) => ({
|
|
1308
1306
|
...k,
|
|
1309
|
-
defaultValue:
|
|
1307
|
+
defaultValue: n
|
|
1310
1308
|
}));
|
|
1311
1309
|
}
|
|
1312
1310
|
}
|
|
1313
1311
|
),
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
|
|
1312
|
+
/* @__PURE__ */ d(
|
|
1313
|
+
Nt,
|
|
1316
1314
|
{
|
|
1317
1315
|
open: G === e.id,
|
|
1318
|
-
onOpenChange: (
|
|
1316
|
+
onOpenChange: (n) => $(n ? e.id : null),
|
|
1319
1317
|
children: [
|
|
1320
|
-
/* @__PURE__ */ t(
|
|
1321
|
-
|
|
1318
|
+
/* @__PURE__ */ t(kt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
1319
|
+
I,
|
|
1322
1320
|
{
|
|
1323
1321
|
type: "button",
|
|
1324
1322
|
variant: "ghost",
|
|
1325
1323
|
className: "h-auto px-0 text-xs text-muted-foreground hover:bg-transparent",
|
|
1326
1324
|
children: [
|
|
1327
|
-
G === e.id ? /* @__PURE__ */ t(Ve, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ t(
|
|
1325
|
+
G === e.id ? /* @__PURE__ */ t(Ve, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ t(Ee, { className: "mr-1 h-4 w-4" }),
|
|
1328
1326
|
"Advanced"
|
|
1329
1327
|
]
|
|
1330
1328
|
}
|
|
1331
1329
|
) }),
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ d(St, { className: "space-y-3 pt-2", children: [
|
|
1331
|
+
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
1332
|
+
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1335
1333
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Control ID" }),
|
|
1336
1334
|
/* @__PURE__ */ t(
|
|
1337
|
-
|
|
1335
|
+
Dt,
|
|
1338
1336
|
{
|
|
1339
1337
|
controlId: e.id,
|
|
1340
|
-
onCommit: (
|
|
1338
|
+
onCommit: (n) => Je(e.id, n)
|
|
1341
1339
|
},
|
|
1342
1340
|
e.id
|
|
1343
1341
|
)
|
|
1344
1342
|
] }),
|
|
1345
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
1346
1344
|
/* @__PURE__ */ t(R, { className: "text-xs", children: "Initial value" }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1345
|
+
/* @__PURE__ */ d(
|
|
1346
|
+
oe,
|
|
1349
1347
|
{
|
|
1350
1348
|
value: e.initialValueStrategy,
|
|
1351
|
-
onValueChange: (
|
|
1349
|
+
onValueChange: (n) => O(e.id, (k) => ({
|
|
1352
1350
|
...k,
|
|
1353
|
-
initialValueStrategy:
|
|
1351
|
+
initialValueStrategy: n
|
|
1354
1352
|
})),
|
|
1355
1353
|
children: [
|
|
1356
|
-
/* @__PURE__ */ t(
|
|
1357
|
-
/* @__PURE__ */ t(
|
|
1358
|
-
|
|
1354
|
+
/* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(ue, {}) }),
|
|
1355
|
+
/* @__PURE__ */ t(me, { children: It.map((n) => /* @__PURE__ */ t(
|
|
1356
|
+
pe,
|
|
1359
1357
|
{
|
|
1360
|
-
value:
|
|
1361
|
-
children:
|
|
1358
|
+
value: n.value,
|
|
1359
|
+
children: n.label
|
|
1362
1360
|
},
|
|
1363
|
-
|
|
1361
|
+
n.value
|
|
1364
1362
|
)) })
|
|
1365
1363
|
]
|
|
1366
1364
|
}
|
|
1367
1365
|
),
|
|
1368
|
-
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children:
|
|
1366
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: wt(
|
|
1369
1367
|
e.initialValueStrategy
|
|
1370
1368
|
) })
|
|
1371
1369
|
] })
|
|
1372
1370
|
] }),
|
|
1373
1371
|
/* @__PURE__ */ t(
|
|
1374
|
-
|
|
1372
|
+
Tt,
|
|
1375
1373
|
{
|
|
1376
1374
|
control: e,
|
|
1377
|
-
onChange: (
|
|
1375
|
+
onChange: (n) => O(e.id, () => n)
|
|
1378
1376
|
}
|
|
1379
1377
|
)
|
|
1380
1378
|
] })
|
|
@@ -1384,62 +1382,62 @@ function Zt({
|
|
|
1384
1382
|
] })
|
|
1385
1383
|
] }, e.id);
|
|
1386
1384
|
}),
|
|
1387
|
-
!a && /* @__PURE__ */
|
|
1388
|
-
|
|
1385
|
+
!a && /* @__PURE__ */ d(
|
|
1386
|
+
I,
|
|
1389
1387
|
{
|
|
1390
1388
|
type: "button",
|
|
1391
1389
|
variant: "outline",
|
|
1392
1390
|
size: "sm",
|
|
1393
|
-
onClick:
|
|
1391
|
+
onClick: Ze,
|
|
1394
1392
|
children: [
|
|
1395
|
-
/* @__PURE__ */ t(
|
|
1393
|
+
/* @__PURE__ */ t(Ft, { className: "mr-2 h-4 w-4" }),
|
|
1396
1394
|
"Add control"
|
|
1397
1395
|
]
|
|
1398
1396
|
}
|
|
1399
1397
|
)
|
|
1400
1398
|
] });
|
|
1401
1399
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const { open: l, onOpenChange:
|
|
1404
|
-
|
|
1405
|
-
), x =
|
|
1400
|
+
function ta(s) {
|
|
1401
|
+
const { open: l, onOpenChange: r, initialCreateFlowActive: i = !1 } = s, u = l !== void 0, [p, h] = j(!1), [f, m] = j(
|
|
1402
|
+
i
|
|
1403
|
+
), x = u ? l : p, v = M(
|
|
1406
1404
|
(C) => {
|
|
1407
|
-
!C &&
|
|
1405
|
+
!C && f || (u || h(C), C || m(!1), r == null || r(C));
|
|
1408
1406
|
},
|
|
1409
|
-
[
|
|
1410
|
-
),
|
|
1411
|
-
|
|
1412
|
-
}, [
|
|
1407
|
+
[u, f, r]
|
|
1408
|
+
), b = M(() => {
|
|
1409
|
+
u || h(!1), m(!1), r == null || r(!1);
|
|
1410
|
+
}, [u, r]);
|
|
1413
1411
|
be(() => {
|
|
1414
|
-
x ||
|
|
1412
|
+
x || m(!1);
|
|
1415
1413
|
}, [x]);
|
|
1416
|
-
const
|
|
1414
|
+
const y = M(
|
|
1417
1415
|
(C) => {
|
|
1418
|
-
|
|
1416
|
+
f && C.preventDefault();
|
|
1419
1417
|
},
|
|
1420
|
-
[
|
|
1418
|
+
[f]
|
|
1421
1419
|
);
|
|
1422
1420
|
return {
|
|
1423
|
-
forceClose:
|
|
1424
|
-
handleOpenChange:
|
|
1425
|
-
isCreateFlowActive:
|
|
1426
|
-
preventPassiveDismissDuringCreate:
|
|
1421
|
+
forceClose: b,
|
|
1422
|
+
handleOpenChange: v,
|
|
1423
|
+
isCreateFlowActive: f,
|
|
1424
|
+
preventPassiveDismissDuringCreate: y,
|
|
1427
1425
|
resolvedOpen: x,
|
|
1428
|
-
setIsCreateFlowActive:
|
|
1426
|
+
setIsCreateFlowActive: m
|
|
1429
1427
|
};
|
|
1430
1428
|
}
|
|
1431
1429
|
export {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1430
|
+
Yt as C,
|
|
1431
|
+
Gt as E,
|
|
1432
|
+
Mt as L,
|
|
1433
|
+
Xe as S,
|
|
1434
|
+
Xt as V,
|
|
1435
|
+
Wt as a,
|
|
1436
|
+
Jt as b,
|
|
1439
1437
|
_t as c,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1438
|
+
Pt as d,
|
|
1439
|
+
ea as e,
|
|
1440
|
+
Zt as f,
|
|
1441
|
+
Ge as g,
|
|
1442
|
+
ta as u
|
|
1445
1443
|
};
|