react-semaphor 0.1.590 → 0.1.592
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/analytics-protocol/index.js +254 -236
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{aggregate-measure-field-BrkXsSJp.js → aggregate-measure-field-DHlDj0Pc.js} +2 -2
- package/dist/chunks/{assistant-chat-C_6dBLUk.js → assistant-chat-BusR-5uT.js} +13 -13
- package/dist/chunks/bookmark-impact-DozXJZDS.js +76 -0
- package/dist/chunks/{bookmark-state-Bn7k3ttp.js → bookmark-state-Be2W3s6t.js} +632 -592
- package/dist/chunks/{card-filter-builder-6vflbF9O.js → card-filter-builder-DBTJ74yy.js} +916 -897
- package/dist/chunks/{comparison-window-caption-fqijZdVd.js → comparison-window-caption-h8w3ySL6.js} +90 -91
- package/dist/chunks/{dashboard-DpgRl65K.js → dashboard-CmzJzmph.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BLbhONJz.js → dashboard-briefing-launcher-BOQGpYr2.js} +160 -160
- package/dist/chunks/{dashboard-controls-kCTYEEsq.js → dashboard-controls-BxI3e2_o.js} +64 -64
- package/dist/chunks/{dashboard-json-CNIFresY.js → dashboard-json-BMqXV2Rx.js} +4 -4
- package/dist/chunks/{dates-BoeweqEo.js → dates-DBsscxL_.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-D0eWTlPL.js → edit-dashboard-visual-Dvc_Pkfg.js} +5443 -5417
- package/dist/chunks/filter-line-CYT7KIXb.js +133 -0
- package/dist/chunks/{filter-reach-copy-eMhDPTYH.js → filter-reach-copy-hEzlpBu7.js} +224 -224
- package/dist/chunks/filter-value-text-CHBm4IU7.js +153 -0
- package/dist/chunks/{index-D8LFjI8j.js → index-BoYJqc3F.js} +24 -24
- package/dist/chunks/{layout-grid-BG__sPkb.js → layout-grid-DoFIfQGd.js} +1 -1
- package/dist/chunks/{list-filter-Cb8i7N8f.js → list-filter-BeTQxjNy.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-D9Ll_9R-.js → matrix-analytical-definition-CyWOwLmE.js} +17 -17
- package/dist/chunks/{matrix-member-presentation-DVBJR0MA.js → matrix-member-presentation-Bj2YcHAP.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-JSmproo9.js → matrix-operation-contract-CAanJeCj.js} +60 -60
- package/dist/chunks/{metric-comparison-xE_J6hkg.js → metric-comparison-BeKnUD08.js} +27 -31
- package/dist/chunks/{paintbrush-C310xSuR.js → paintbrush-KeaU1L1a.js} +1 -1
- package/dist/chunks/{palette-Ci5P91Zb.js → palette-BcFJLeXB.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DbBahmgc.js → pivot-result-contract-expectations-CaS0y823.js} +522 -486
- package/dist/chunks/{pivot-result-identity-CUsMt_4r.js → pivot-result-identity-BKUjYO1u.js} +1 -1
- package/dist/chunks/raw-temporal-value-BzdgeDa7.js +454 -0
- package/dist/chunks/{report-preferences-dialog-dUlVLgEk.js → report-preferences-dialog-Cu_f-8Kw.js} +13 -13
- package/dist/chunks/{report-runtime-context-CrOgmuxO.js → report-runtime-context-g4Zp_TU9.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-NurwNg4I.js → resolve-dashboard-input-context-CkMk1RW6.js} +7600 -6398
- package/dist/chunks/{save-BhhXfp4s.js → save-C9CZAk6V.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CPp--vXU.js → saved-dashboard-context-RgBS_PIj.js} +19 -19
- package/dist/chunks/{selection-filter-compiler-CHG-8xnW.js → selection-filter-compiler-BclSpK3P.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-CXojR95M.js → semaphor-ready-indicator-DXpTZJ7R.js} +31502 -31453
- package/dist/chunks/{shelf-drop-preview-context-BDScAUdq.js → shelf-drop-preview-context-qdlJKaH7.js} +5 -5
- package/dist/chunks/stored-dashboard-Baw6Bp2A.js +4029 -0
- package/dist/chunks/{style-sheet-parts-CmXmKqGw.js → style-sheet-parts-DM_Mw_sm.js} +45 -42
- package/dist/chunks/{table-export-sheet-ClSgERQC.js → table-export-sheet-Cd6z7SsG.js} +1 -1
- package/dist/chunks/{token-types-DTocOcwt.js → token-types-BB2ImFx6.js} +1 -1
- package/dist/chunks/{upload-DDYc1Qjj.js → upload-CMTCg47S.js} +1 -1
- package/dist/chunks/{validators-CrYXNnNE.js → validators-BlEWWX9O.js} +576 -562
- package/dist/chunks/{variable-draft-Bi3RlULA.js → variable-draft-BxtN6YcG.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1672 -1633
- package/dist/format-utils/index.js +217 -218
- package/dist/index.js +62 -62
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -5
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +3 -3
- package/dist/types/components/visual/data-table/types/data-table.d.ts +24 -2
- package/dist/types/index.js +30 -29
- package/dist/types/lib/dashboard-inputs/dashboard-date-comparison-plan.d.ts +0 -1
- package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +27 -0
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +37 -1
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +2 -1
- package/dist/types/shared/analytics-protocol/relative-date/sentence.d.ts +81 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +0 -9
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/card-formats/detail-date-display.d.ts +84 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +36 -36
- package/dist/types/shared/dashboard-authoring/filter-model/date-filter-default.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +56 -0
- package/dist/types/shared/dashboard-viewer/table-settings.d.ts +7 -0
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/bookmark-impact-DkZABEd3.js +0 -75
- package/dist/chunks/filter-line-Dza3ee4w.js +0 -131
- package/dist/chunks/filter-value-text-DQw4v3nC.js +0 -146
- package/dist/chunks/pivot-header-presentation-D-DfPAjb.js +0 -42
- package/dist/chunks/raw-temporal-value-BnGCWJAL.js +0 -322
- package/dist/chunks/stored-dashboard-KkH4zOhq.js +0 -4998
- package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -53
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { c as nt, B as G, X as ce, x as Ne, q as
|
|
1
|
+
import { c as nt, B as G, X as ce, x as Ne, q as hn, a6 as gn, t as at, u as rt, v as st, w as ot, a7 as _t, F as Oe, s as le, y as ge, z as xe, A as be, D as ve, E as re, e as it, f as lt, h as dt, L as xn, d as bn } from "./style-sheet-parts-DM_Mw_sm.js";
|
|
2
2
|
import { jsx as t, jsxs as l, Fragment as fe } from "react/jsx-runtime";
|
|
3
3
|
import * as _e from "react";
|
|
4
|
-
import vt, { useMemo as
|
|
5
|
-
import { b8 as ct, u as ut, am as se, c8 as
|
|
6
|
-
import { D as
|
|
7
|
-
import {
|
|
8
|
-
import { c as
|
|
9
|
-
import { r as
|
|
10
|
-
import "./matrix-operation-contract-
|
|
4
|
+
import vt, { useMemo as P, useState as Y, useRef as $e, useCallback as ne, useEffect as de, forwardRef as vn, Fragment as yn } from "react";
|
|
5
|
+
import { b8 as ct, u as ut, am as se, c8 as Vt, cF as J, cG as Nn, c4 as Ie, cH as Ue, cI as Rt, cJ as Cn, b_ as Ve, cK as wn, an as Et, bG as kn, bH as Sn, bJ as Dn, bZ as In, cL as Tn, o as Ln, cM as $n, cN as An, cO as yt, bY as zt, cP as Fn, cQ as Mt, cR as qt, cS as On, cT as _n, cU as Vn, cV as Rn, cW as En, cX as zn, cY as Mn, bz as qn, cZ as Nt, c_ as jt, c$ as Ct, bC as jn, d0 as Un, d1 as Gn, d2 as Bn, d3 as ye, d4 as Ut, d5 as Wn, d6 as Kn, d7 as Qn, d8 as Pn, d9 as Hn, da as Je, db as he, dc as Xe, dd as et, de as tt, df as Yn, dg as Re, dh as Ee, di as ze, dj as Me, dk as Gt, dl as Bt, dm as Wt } from "./semaphor-ready-indicator-DXpTZJ7R.js";
|
|
6
|
+
import { D as Zn } from "./token-types-BB2ImFx6.js";
|
|
7
|
+
import { fZ as Kt, f_ as Jn, f$ as Xn, g0 as ea, g1 as ta, g2 as na, g3 as Ae, g4 as wt, g5 as kt, g6 as Ke, g7 as Qe, g8 as aa, g9 as ra, ga as St, gb as sa, gc as oa, gd as Fe, ge as ia, gf as Dt, gg as Qt, gh as Pt, gi as Ht, gj as Yt, gk as la, gl as da, gm as It, gn as ca, go as Tt, gp as ua, gq as ma, gr as pa, gs as fa, gt as Pe, a as qe, gu as He, bj as ha, gv as ga, gw as xa, gx as ba, gy as va } from "./resolve-dashboard-input-context-CkMk1RW6.js";
|
|
8
|
+
import { c as q } from "./pickers-DkqmtnTL.js";
|
|
9
|
+
import { r as Zt, l as ya, k as Jt, aE as Xt } from "./validators-BlEWWX9O.js";
|
|
10
|
+
import "./matrix-operation-contract-CAanJeCj.js";
|
|
11
11
|
import "./analytics-base-schemas-8wz9vqn_.js";
|
|
12
12
|
import "../value-format-preferences/index.js";
|
|
13
|
-
import { U as
|
|
14
|
-
import { r as
|
|
15
|
-
import {
|
|
13
|
+
import { U as Na } from "./upload-CMTCg47S.js";
|
|
14
|
+
import { r as en } from "./metric-comparison-BeKnUD08.js";
|
|
15
|
+
import { r as Ca, j as wa } from "./raw-temporal-value-BzdgeDa7.js";
|
|
16
|
+
import { a3 as tn } from "./filter-reach-copy-hEzlpBu7.js";
|
|
16
17
|
/**
|
|
17
18
|
* @license lucide-react v0.453.0 - ISC
|
|
18
19
|
*
|
|
19
20
|
* This source code is licensed under the ISC license.
|
|
20
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
22
|
*/
|
|
22
|
-
const
|
|
23
|
+
const ka = nt("Boxes", [
|
|
23
24
|
[
|
|
24
25
|
"path",
|
|
25
26
|
{
|
|
@@ -57,7 +58,7 @@ const va = nt("Boxes", [
|
|
|
57
58
|
* This source code is licensed under the ISC license.
|
|
58
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
60
|
*/
|
|
60
|
-
const
|
|
61
|
+
const Ir = nt("FilterX", [
|
|
61
62
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
62
63
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
63
64
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
@@ -68,13 +69,13 @@ const Nr = nt("FilterX", [
|
|
|
68
69
|
* This source code is licensed under the ISC license.
|
|
69
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
71
|
*/
|
|
71
|
-
const
|
|
72
|
+
const Sa = nt("Library", [
|
|
72
73
|
["path", { d: "m16 6 4 14", key: "ji33uf" }],
|
|
73
74
|
["path", { d: "M12 6v14", key: "1n7gus" }],
|
|
74
75
|
["path", { d: "M8 8v12", key: "1gg7y9" }],
|
|
75
76
|
["path", { d: "M4 4v16", key: "6qkkli" }]
|
|
76
77
|
]);
|
|
77
|
-
function
|
|
78
|
+
function Da(e, n, a) {
|
|
78
79
|
switch (e) {
|
|
79
80
|
case "none":
|
|
80
81
|
return !1;
|
|
@@ -87,15 +88,15 @@ function Na(e, n, a) {
|
|
|
87
88
|
return !0;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function Ia({
|
|
91
92
|
mode: e,
|
|
92
93
|
currentDomainId: n,
|
|
93
94
|
scopedDomainIds: a,
|
|
94
95
|
hasSelectedEntities: o
|
|
95
96
|
}) {
|
|
96
|
-
return e === "all" ? !1 : e === "none" ? !!n || o : n ? !
|
|
97
|
+
return e === "all" ? !1 : e === "none" ? !!n || o : n ? !Da(e, n, a) : o;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function nn(e) {
|
|
99
100
|
const { tokenProps: n } = ct(), a = ut((s) => s.authToken) || e;
|
|
100
101
|
se(
|
|
101
102
|
(s) => s.selectedConnectionId
|
|
@@ -111,9 +112,9 @@ function Zt(e) {
|
|
|
111
112
|
data: d,
|
|
112
113
|
isLoading: c,
|
|
113
114
|
isError: i
|
|
114
|
-
} =
|
|
115
|
+
} = Vt({
|
|
115
116
|
queryKey: ["semantic-domains"],
|
|
116
|
-
queryFn: () =>
|
|
117
|
+
queryFn: () => Kt(
|
|
117
118
|
`${n.apiServiceUrl}/v1/domains`,
|
|
118
119
|
(a == null ? void 0 : a.accessToken) || ""
|
|
119
120
|
),
|
|
@@ -130,7 +131,7 @@ function Zt(e) {
|
|
|
130
131
|
refetchSemanticDomains: o
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function an(e) {
|
|
134
135
|
const n = mt(e);
|
|
135
136
|
return n.size === 1 ? [...n][0] : void 0;
|
|
136
137
|
}
|
|
@@ -140,7 +141,7 @@ function mt(e) {
|
|
|
140
141
|
"domainId" in a && typeof a.domainId == "string" && a.domainId && n.add(a.domainId);
|
|
141
142
|
return n;
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function Ta(e, n) {
|
|
144
145
|
if (e.some(
|
|
145
146
|
(d) => J(d, n)
|
|
146
147
|
))
|
|
@@ -152,8 +153,8 @@ function wa(e, n) {
|
|
|
152
153
|
(d) => !("domainId" in d)
|
|
153
154
|
) || [...o].some((d) => d !== n.domainId) ? [n] : [...e, n];
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
-
const a =
|
|
156
|
+
function La(e, n) {
|
|
157
|
+
const a = an(n), o = mt(e), u = e.some(
|
|
157
158
|
(c) => !("domainId" in c)
|
|
158
159
|
);
|
|
159
160
|
if (a && (u || [...o].some(
|
|
@@ -165,23 +166,23 @@ function ka(e, n) {
|
|
|
165
166
|
d.some((i) => J(i, c)) || d.push(c);
|
|
166
167
|
return d;
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function $a({
|
|
169
170
|
domainAccess: e,
|
|
170
171
|
search: n,
|
|
171
172
|
scopeDomainId: a,
|
|
172
173
|
selectedEntities: o,
|
|
173
174
|
onSelectionChange: u
|
|
174
175
|
}) {
|
|
175
|
-
const { semanticDomains: d, isSemanticDomainsLoading: c } =
|
|
176
|
+
const { semanticDomains: d, isSemanticDomainsLoading: c } = nn(), i = P(() => Fa(d, e), [d, e]), s = P(() => a ? i.filter((f) => f.id === a) : i, [i, a]);
|
|
176
177
|
if (c && s.length === 0)
|
|
177
178
|
return /* @__PURE__ */ t("div", { className: "px-3 py-4 text-[11px] text-muted-foreground", children: "Loading semantic domains…" });
|
|
178
179
|
if (s.length === 0)
|
|
179
180
|
return null;
|
|
180
181
|
const m = !!a;
|
|
181
182
|
return /* @__PURE__ */ l("div", { children: [
|
|
182
|
-
/* @__PURE__ */ t(
|
|
183
|
+
/* @__PURE__ */ t(rn, { label: "Semantic Domains" }),
|
|
183
184
|
s.map((f) => /* @__PURE__ */ t(
|
|
184
|
-
|
|
185
|
+
Aa,
|
|
185
186
|
{
|
|
186
187
|
domain: f,
|
|
187
188
|
search: n,
|
|
@@ -193,71 +194,71 @@ function Sa({
|
|
|
193
194
|
))
|
|
194
195
|
] });
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function Aa({
|
|
197
198
|
domain: e,
|
|
198
199
|
search: n,
|
|
199
200
|
forceExpanded: a,
|
|
200
201
|
selectedEntities: o,
|
|
201
202
|
onSelectionChange: u
|
|
202
203
|
}) {
|
|
203
|
-
const [d, c] =
|
|
204
|
+
const [d, c] = Y(!1), i = d || n.length > 0 || !!a, { datasets: s, isPending: m } = Nn(
|
|
204
205
|
i ? e.id : void 0
|
|
205
|
-
), f =
|
|
206
|
+
), f = P(() => {
|
|
206
207
|
if (!n) return s;
|
|
207
|
-
const
|
|
208
|
+
const C = n.trim().toLowerCase();
|
|
208
209
|
return s.filter(
|
|
209
|
-
(
|
|
210
|
+
(I) => `${I.label ?? ""} ${I.name ?? ""} ${I.description ?? ""}`.toLowerCase().includes(C)
|
|
210
211
|
);
|
|
211
|
-
}, [s, n]),
|
|
212
|
-
(
|
|
213
|
-
(
|
|
212
|
+
}, [s, n]), k = n.length > 0 && f.length > 0, y = d || k || !!a, g = s.length, N = P(() => f.filter(
|
|
213
|
+
(C) => o.some(
|
|
214
|
+
(I) => J(I, Le(C))
|
|
214
215
|
)
|
|
215
|
-
).length, [f, o]),
|
|
216
|
+
).length, [f, o]), S = P(
|
|
216
217
|
() => f.map(Le),
|
|
217
218
|
[f]
|
|
218
|
-
),
|
|
219
|
-
(
|
|
220
|
-
),
|
|
221
|
-
if (
|
|
222
|
-
if (
|
|
219
|
+
), V = S.length > 0 && S.every(
|
|
220
|
+
(C) => o.some((I) => J(I, C))
|
|
221
|
+
), _ = () => {
|
|
222
|
+
if (S.length !== 0) {
|
|
223
|
+
if (V) {
|
|
223
224
|
u(
|
|
224
225
|
o.filter(
|
|
225
|
-
(
|
|
226
|
-
(
|
|
226
|
+
(C) => !S.some(
|
|
227
|
+
(I) => J(C, I)
|
|
227
228
|
)
|
|
228
229
|
)
|
|
229
230
|
);
|
|
230
231
|
return;
|
|
231
232
|
}
|
|
232
233
|
u(
|
|
233
|
-
|
|
234
|
+
La(
|
|
234
235
|
o,
|
|
235
|
-
|
|
236
|
+
S
|
|
236
237
|
)
|
|
237
238
|
);
|
|
238
239
|
}
|
|
239
|
-
},
|
|
240
|
-
const
|
|
240
|
+
}, Q = (C) => {
|
|
241
|
+
const I = Le(C);
|
|
241
242
|
u(
|
|
242
|
-
|
|
243
|
+
Ta(
|
|
243
244
|
o,
|
|
244
|
-
|
|
245
|
+
I
|
|
245
246
|
)
|
|
246
247
|
);
|
|
247
248
|
};
|
|
248
|
-
return n.length > 0 && !
|
|
249
|
+
return n.length > 0 && !k && !m ? null : /* @__PURE__ */ l("div", { children: [
|
|
249
250
|
/* @__PURE__ */ l("div", { className: "flex items-center rounded-[4px] px-3 py-1.5 transition-colors hover:bg-muted/50", children: [
|
|
250
251
|
/* @__PURE__ */ l(
|
|
251
252
|
"button",
|
|
252
253
|
{
|
|
253
254
|
type: "button",
|
|
254
|
-
onClick: () => c((
|
|
255
|
+
onClick: () => c((C) => !C),
|
|
255
256
|
className: "flex min-w-0 flex-1 items-center gap-1.5 text-left",
|
|
256
257
|
children: [
|
|
257
258
|
/* @__PURE__ */ t(
|
|
258
259
|
Ie,
|
|
259
260
|
{
|
|
260
|
-
className:
|
|
261
|
+
className: q(
|
|
261
262
|
"h-3 w-3 shrink-0 text-muted-foreground transition-transform",
|
|
262
263
|
y && "rotate-90"
|
|
263
264
|
),
|
|
@@ -265,55 +266,55 @@ function Da({
|
|
|
265
266
|
}
|
|
266
267
|
),
|
|
267
268
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || e.name }),
|
|
268
|
-
|
|
269
|
+
g > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: [
|
|
269
270
|
"· ",
|
|
270
|
-
|
|
271
|
+
g,
|
|
271
272
|
" dataset",
|
|
272
|
-
|
|
273
|
+
g === 1 ? "" : "s",
|
|
273
274
|
" · curated"
|
|
274
275
|
] })
|
|
275
276
|
]
|
|
276
277
|
}
|
|
277
278
|
),
|
|
278
|
-
y && !m &&
|
|
279
|
+
y && !m && S.length > 0 && /* @__PURE__ */ t(
|
|
279
280
|
"button",
|
|
280
281
|
{
|
|
281
282
|
type: "button",
|
|
282
|
-
onClick:
|
|
283
|
+
onClick: _,
|
|
283
284
|
className: "ml-2 shrink-0 rounded-[3px] px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground hover:bg-background hover:text-foreground",
|
|
284
|
-
children:
|
|
285
|
+
children: V ? "Clear" : "Select all"
|
|
285
286
|
}
|
|
286
287
|
),
|
|
287
288
|
/* @__PURE__ */ t("span", { className: "ml-auto font-mono text-[10px] tabular-nums text-muted-foreground", children: N > 0 ? N : "" })
|
|
288
289
|
] }),
|
|
289
|
-
y && /* @__PURE__ */ t("ul", { className: "space-y-px pb-1", children: m && s.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "Loading datasets…" }) : f.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "No datasets in this domain." }) : f.map((
|
|
290
|
-
const
|
|
291
|
-
(X) => J(X,
|
|
290
|
+
y && /* @__PURE__ */ t("ul", { className: "space-y-px pb-1", children: m && s.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "Loading datasets…" }) : f.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "No datasets in this domain." }) : f.map((C) => {
|
|
291
|
+
const I = Le(C), U = o.some(
|
|
292
|
+
(X) => J(X, I)
|
|
292
293
|
);
|
|
293
294
|
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("label", { className: "flex cursor-pointer items-start gap-2 rounded-[4px] px-9 py-1.5 transition-colors hover:bg-muted/40", children: [
|
|
294
295
|
/* @__PURE__ */ t(
|
|
295
296
|
Ue,
|
|
296
297
|
{
|
|
297
|
-
checked:
|
|
298
|
-
onCheckedChange: () =>
|
|
298
|
+
checked: U,
|
|
299
|
+
onCheckedChange: () => Q(C),
|
|
299
300
|
className: "mt-[3px] h-3.5 w-3.5 shrink-0"
|
|
300
301
|
}
|
|
301
302
|
),
|
|
302
303
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
303
304
|
/* @__PURE__ */ l("div", { className: "flex items-baseline gap-1.5", children: [
|
|
304
|
-
/* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground", children:
|
|
305
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children:
|
|
305
|
+
/* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground", children: C.label || C.name }),
|
|
306
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: C.type === "virtual" ? "virtual" : "dataset" })
|
|
306
307
|
] }),
|
|
307
|
-
|
|
308
|
+
C.description && /* @__PURE__ */ t("p", { className: "mt-0.5 text-[11px] leading-[1.4] text-muted-foreground", children: C.description })
|
|
308
309
|
] })
|
|
309
|
-
] }) },
|
|
310
|
+
] }) }, C.id);
|
|
310
311
|
}) })
|
|
311
312
|
] });
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function rn({ label: e }) {
|
|
314
315
|
return /* @__PURE__ */ t("div", { className: "px-3 pb-1.5 pt-2.5", children: /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: e }) });
|
|
315
316
|
}
|
|
316
|
-
function
|
|
317
|
+
function Fa(e, n) {
|
|
317
318
|
if (!n || n.mode === "all") return e;
|
|
318
319
|
const a = new Set(n.domainIds ?? []);
|
|
319
320
|
return n.mode === "include" ? e.filter((o) => a.has(o.id)) : n.mode === "exclude" ? e.filter((o) => !a.has(o.id)) : [];
|
|
@@ -337,22 +338,22 @@ function Le(e) {
|
|
|
337
338
|
sql: e.sql
|
|
338
339
|
};
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function Oa({
|
|
341
342
|
search: e,
|
|
342
343
|
scopeConnectionId: n,
|
|
343
344
|
selectedEntities: a,
|
|
344
345
|
onSelectionChange: o
|
|
345
346
|
}) {
|
|
346
|
-
const { connections: u, isConnectionsLoading: d } =
|
|
347
|
+
const { connections: u, isConnectionsLoading: d } = Rt(), c = P(() => n ? u.filter((s) => s.id === n) : u, [u, n]);
|
|
347
348
|
if (d && c.length === 0)
|
|
348
349
|
return /* @__PURE__ */ t("div", { className: "px-3 py-4 text-[11px] text-muted-foreground", children: "Loading connections…" });
|
|
349
350
|
if (c.length === 0)
|
|
350
351
|
return null;
|
|
351
352
|
const i = !!n;
|
|
352
353
|
return /* @__PURE__ */ l("div", { children: [
|
|
353
|
-
/* @__PURE__ */ t(
|
|
354
|
+
/* @__PURE__ */ t(rn, { label: "Direct Sources" }),
|
|
354
355
|
c.map((s) => /* @__PURE__ */ t(
|
|
355
|
-
|
|
356
|
+
_a,
|
|
356
357
|
{
|
|
357
358
|
connection: s,
|
|
358
359
|
search: e,
|
|
@@ -364,7 +365,7 @@ function Ta({
|
|
|
364
365
|
))
|
|
365
366
|
] });
|
|
366
367
|
}
|
|
367
|
-
function
|
|
368
|
+
function _a({
|
|
368
369
|
connection: e,
|
|
369
370
|
search: n,
|
|
370
371
|
forceExpanded: a,
|
|
@@ -372,8 +373,8 @@ function La({
|
|
|
372
373
|
onSelectionChange: u
|
|
373
374
|
}) {
|
|
374
375
|
var N;
|
|
375
|
-
const [d, c] =
|
|
376
|
-
() => o.filter((
|
|
376
|
+
const [d, c] = Y(!1), i = d || n.length > 0 || !!a, s = ((N = e.capabilities) == null ? void 0 : N.path) ?? [], m = s.includes("database"), f = s.includes("schema"), k = e.type === "upload", y = e.type === "url", g = P(
|
|
377
|
+
() => o.filter((S) => S.connectionId === e.id).length,
|
|
377
378
|
[o, e.id]
|
|
378
379
|
);
|
|
379
380
|
return /* @__PURE__ */ l("div", { className: "border-b border-border/60 last:border-b-0", children: [
|
|
@@ -381,13 +382,13 @@ function La({
|
|
|
381
382
|
"button",
|
|
382
383
|
{
|
|
383
384
|
type: "button",
|
|
384
|
-
onClick: () => c((
|
|
385
|
+
onClick: () => c((S) => !S),
|
|
385
386
|
className: "flex w-full items-center gap-2 px-4 py-1.5 text-left transition-colors hover:bg-muted/40",
|
|
386
387
|
children: [
|
|
387
388
|
/* @__PURE__ */ t(
|
|
388
389
|
Ie,
|
|
389
390
|
{
|
|
390
|
-
className:
|
|
391
|
+
className: q(
|
|
391
392
|
"h-3 w-3 shrink-0 text-muted-foreground transition-transform",
|
|
392
393
|
i && "rotate-90"
|
|
393
394
|
),
|
|
@@ -399,27 +400,27 @@ function La({
|
|
|
399
400
|
"· ",
|
|
400
401
|
e.type
|
|
401
402
|
] }),
|
|
402
|
-
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground", children:
|
|
403
|
+
/* @__PURE__ */ t("span", { className: "ml-auto shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground", children: g > 0 ? g : "" })
|
|
403
404
|
]
|
|
404
405
|
}
|
|
405
406
|
),
|
|
406
407
|
i && /* @__PURE__ */ l(fe, { children: [
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
k ? /* @__PURE__ */ t(
|
|
409
|
+
Va,
|
|
409
410
|
{
|
|
410
411
|
connection: e,
|
|
411
412
|
selectedEntities: o,
|
|
412
413
|
onSelectionChange: u
|
|
413
414
|
}
|
|
414
415
|
) : y ? /* @__PURE__ */ t(
|
|
415
|
-
|
|
416
|
+
Ra,
|
|
416
417
|
{
|
|
417
418
|
connection: e,
|
|
418
419
|
selectedEntities: o,
|
|
419
420
|
onSelectionChange: u
|
|
420
421
|
}
|
|
421
422
|
) : m ? /* @__PURE__ */ t(
|
|
422
|
-
|
|
423
|
+
Ea,
|
|
423
424
|
{
|
|
424
425
|
connection: e,
|
|
425
426
|
requiresSchema: f,
|
|
@@ -428,7 +429,7 @@ function La({
|
|
|
428
429
|
onSelectionChange: u
|
|
429
430
|
}
|
|
430
431
|
) : f ? /* @__PURE__ */ t(
|
|
431
|
-
|
|
432
|
+
sn,
|
|
432
433
|
{
|
|
433
434
|
connection: e,
|
|
434
435
|
databaseName: "",
|
|
@@ -447,8 +448,8 @@ function La({
|
|
|
447
448
|
onSelectionChange: u
|
|
448
449
|
}
|
|
449
450
|
),
|
|
450
|
-
!
|
|
451
|
-
|
|
451
|
+
!k && !y && /* @__PURE__ */ t(
|
|
452
|
+
za,
|
|
452
453
|
{
|
|
453
454
|
connection: e,
|
|
454
455
|
search: n,
|
|
@@ -459,7 +460,7 @@ function La({
|
|
|
459
460
|
] })
|
|
460
461
|
] });
|
|
461
462
|
}
|
|
462
|
-
function
|
|
463
|
+
function Va({
|
|
463
464
|
connection: e,
|
|
464
465
|
selectedEntities: n,
|
|
465
466
|
onSelectionChange: a
|
|
@@ -489,7 +490,7 @@ function Aa({
|
|
|
489
490
|
};
|
|
490
491
|
return /* @__PURE__ */ l("div", { className: "space-y-2 px-8 py-2", children: [
|
|
491
492
|
/* @__PURE__ */ l("div", { className: "rounded-[6px] border border-dashed border-border bg-muted/20 p-4 text-center", children: [
|
|
492
|
-
/* @__PURE__ */ t(
|
|
493
|
+
/* @__PURE__ */ t(Na, { className: "mx-auto mb-2 h-5 w-5 text-muted-foreground" }),
|
|
493
494
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Add CSV, JSON, or Excel files." }),
|
|
494
495
|
/* @__PURE__ */ t(
|
|
495
496
|
"input",
|
|
@@ -522,7 +523,7 @@ function Aa({
|
|
|
522
523
|
{
|
|
523
524
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 py-1.5",
|
|
524
525
|
children: [
|
|
525
|
-
/* @__PURE__ */ t(
|
|
526
|
+
/* @__PURE__ */ t(Cn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
526
527
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[12px]", children: i.originalName || i.name }),
|
|
527
528
|
/* @__PURE__ */ t(
|
|
528
529
|
"button",
|
|
@@ -540,16 +541,16 @@ function Aa({
|
|
|
540
541
|
)) })
|
|
541
542
|
] });
|
|
542
543
|
}
|
|
543
|
-
function
|
|
544
|
+
function Ra({
|
|
544
545
|
connection: e,
|
|
545
546
|
selectedEntities: n,
|
|
546
547
|
onSelectionChange: a
|
|
547
548
|
}) {
|
|
548
|
-
const [o, u] =
|
|
549
|
+
const [o, u] = Y(""), [d, c] = Y(""), [i, s] = Y("api"), m = n.filter(
|
|
549
550
|
(y) => y.connectionId === e.id && y.type === "url"
|
|
550
551
|
), f = () => {
|
|
551
|
-
const y = o.trim(),
|
|
552
|
-
if (!y || !
|
|
552
|
+
const y = o.trim(), g = d.trim();
|
|
553
|
+
if (!y || !g) return;
|
|
553
554
|
const N = {
|
|
554
555
|
id: `url-${Date.now()}-${Math.random()}`,
|
|
555
556
|
name: y,
|
|
@@ -559,14 +560,14 @@ function $a({
|
|
|
559
560
|
label: y,
|
|
560
561
|
description: `URL source of type ${i}`,
|
|
561
562
|
originalName: y,
|
|
562
|
-
url:
|
|
563
|
+
url: g,
|
|
563
564
|
sourceType: i
|
|
564
565
|
};
|
|
565
566
|
a([...n, N]), u(""), c(""), s("api");
|
|
566
|
-
},
|
|
567
|
+
}, k = (y) => {
|
|
567
568
|
a(
|
|
568
569
|
n.filter(
|
|
569
|
-
(
|
|
570
|
+
(g) => !("id" in g && g.id === y && g.connectionId === e.id && g.type === "url")
|
|
570
571
|
)
|
|
571
572
|
);
|
|
572
573
|
};
|
|
@@ -625,7 +626,7 @@ function $a({
|
|
|
625
626
|
{
|
|
626
627
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 py-1.5",
|
|
627
628
|
children: [
|
|
628
|
-
/* @__PURE__ */ t(
|
|
629
|
+
/* @__PURE__ */ t(wn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
629
630
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
630
631
|
/* @__PURE__ */ t("p", { className: "truncate text-[12px]", children: y.name }),
|
|
631
632
|
/* @__PURE__ */ t("p", { className: "truncate text-[11px] text-muted-foreground", children: y.url })
|
|
@@ -635,7 +636,7 @@ function $a({
|
|
|
635
636
|
{
|
|
636
637
|
type: "button",
|
|
637
638
|
"aria-label": `Remove ${y.name}`,
|
|
638
|
-
onClick: () =>
|
|
639
|
+
onClick: () => k(y.id),
|
|
639
640
|
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
640
641
|
children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
|
|
641
642
|
}
|
|
@@ -646,7 +647,7 @@ function $a({
|
|
|
646
647
|
)) })
|
|
647
648
|
] });
|
|
648
649
|
}
|
|
649
|
-
function
|
|
650
|
+
function Ea({
|
|
650
651
|
connection: e,
|
|
651
652
|
requiresSchema: n,
|
|
652
653
|
search: a,
|
|
@@ -662,13 +663,13 @@ function Fa({
|
|
|
662
663
|
return /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "Loading databases…" });
|
|
663
664
|
const c = ((i = d.data) == null ? void 0 : i.databases) ?? [];
|
|
664
665
|
return c.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No databases." }) : /* @__PURE__ */ t("div", { children: c.map((s) => /* @__PURE__ */ t(
|
|
665
|
-
|
|
666
|
+
on,
|
|
666
667
|
{
|
|
667
668
|
label: s.database_name,
|
|
668
669
|
indentLevel: 1,
|
|
669
670
|
search: a,
|
|
670
671
|
renderChildren: (m) => m && (n ? /* @__PURE__ */ t(
|
|
671
|
-
|
|
672
|
+
sn,
|
|
672
673
|
{
|
|
673
674
|
connection: e,
|
|
674
675
|
databaseName: s.database_name,
|
|
@@ -691,7 +692,7 @@ function Fa({
|
|
|
691
692
|
s.database_name
|
|
692
693
|
)) });
|
|
693
694
|
}
|
|
694
|
-
function
|
|
695
|
+
function sn({
|
|
695
696
|
connection: e,
|
|
696
697
|
databaseName: n,
|
|
697
698
|
search: a,
|
|
@@ -712,7 +713,7 @@ function nn({
|
|
|
712
713
|
return /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "Loading schemas…" });
|
|
713
714
|
const c = ((i = d.data) == null ? void 0 : i.schemas) ?? [];
|
|
714
715
|
return c.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No schemas." }) : /* @__PURE__ */ t("div", { children: c.map((s) => /* @__PURE__ */ t(
|
|
715
|
-
|
|
716
|
+
on,
|
|
716
717
|
{
|
|
717
718
|
label: s.schema_name,
|
|
718
719
|
indentLevel: n ? 2 : 1,
|
|
@@ -748,20 +749,20 @@ function pt({
|
|
|
748
749
|
schema_name: a || void 0
|
|
749
750
|
},
|
|
750
751
|
["tables", e.id, n, a]
|
|
751
|
-
), i =
|
|
752
|
-
var
|
|
753
|
-
const
|
|
754
|
-
if (!o) return
|
|
752
|
+
), i = P(() => {
|
|
753
|
+
var S;
|
|
754
|
+
const g = ((S = c.data) == null ? void 0 : S.tables) ?? [];
|
|
755
|
+
if (!o) return g;
|
|
755
756
|
const N = o.trim().toLowerCase();
|
|
756
|
-
return
|
|
757
|
-
}, [c.data, o]), s = (
|
|
757
|
+
return g.filter((V) => V.table_name.toLowerCase().includes(N));
|
|
758
|
+
}, [c.data, o]), s = (g, N) => ({
|
|
758
759
|
connectionId: e.id,
|
|
759
760
|
connectionType: e.type,
|
|
760
761
|
type: "table",
|
|
761
762
|
dialect: e.dialect,
|
|
762
763
|
database: n || void 0,
|
|
763
764
|
schema: a || void 0,
|
|
764
|
-
name:
|
|
765
|
+
name: g,
|
|
765
766
|
dbObjectType: N == null ? void 0 : N.toLowerCase()
|
|
766
767
|
});
|
|
767
768
|
if (c.isLoading)
|
|
@@ -769,15 +770,15 @@ function pt({
|
|
|
769
770
|
if (i.length === 0)
|
|
770
771
|
return o ? null : /* @__PURE__ */ t("div", { className: "px-10 py-1.5 text-[11px] text-muted-foreground", children: "No tables." });
|
|
771
772
|
const m = i.map(
|
|
772
|
-
(
|
|
773
|
+
(g) => s(g.table_name, g.table_type)
|
|
773
774
|
), f = m.length > 0 && m.every(
|
|
774
|
-
(
|
|
775
|
-
),
|
|
776
|
-
const
|
|
777
|
-
(
|
|
775
|
+
(g) => u.some((N) => J(N, g))
|
|
776
|
+
), k = (g, N) => {
|
|
777
|
+
const S = s(g, N), V = u.some(
|
|
778
|
+
(_) => J(_, S)
|
|
778
779
|
);
|
|
779
780
|
d(
|
|
780
|
-
|
|
781
|
+
V ? u.filter((_) => !J(_, S)) : [...u, S]
|
|
781
782
|
);
|
|
782
783
|
}, y = () => {
|
|
783
784
|
if (m.length === 0) return;
|
|
@@ -785,16 +786,16 @@ function pt({
|
|
|
785
786
|
d(
|
|
786
787
|
u.filter(
|
|
787
788
|
(N) => !m.some(
|
|
788
|
-
(
|
|
789
|
+
(S) => J(N, S)
|
|
789
790
|
)
|
|
790
791
|
)
|
|
791
792
|
);
|
|
792
793
|
return;
|
|
793
794
|
}
|
|
794
|
-
const
|
|
795
|
+
const g = [...u];
|
|
795
796
|
for (const N of m)
|
|
796
|
-
|
|
797
|
-
d(
|
|
797
|
+
g.some((S) => J(S, N)) || g.push(N);
|
|
798
|
+
d(g);
|
|
798
799
|
};
|
|
799
800
|
return /* @__PURE__ */ l("ul", { children: [
|
|
800
801
|
/* @__PURE__ */ l("li", { className: "flex items-center justify-between gap-2 py-1 pl-12 pr-4", children: [
|
|
@@ -813,35 +814,35 @@ function pt({
|
|
|
813
814
|
}
|
|
814
815
|
)
|
|
815
816
|
] }),
|
|
816
|
-
i.map((
|
|
817
|
-
const N = s(
|
|
818
|
-
(
|
|
817
|
+
i.map((g) => {
|
|
818
|
+
const N = s(g.table_name, g.table_type), S = u.some(
|
|
819
|
+
(V) => J(V, N)
|
|
819
820
|
);
|
|
820
821
|
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("label", { className: "flex cursor-pointer items-center gap-2.5 py-1.5 pl-12 pr-4 transition-colors hover:bg-muted/40", children: [
|
|
821
822
|
/* @__PURE__ */ t(
|
|
822
823
|
Ue,
|
|
823
824
|
{
|
|
824
|
-
checked:
|
|
825
|
-
onCheckedChange: () =>
|
|
825
|
+
checked: S,
|
|
826
|
+
onCheckedChange: () => k(g.table_name, g.table_type),
|
|
826
827
|
className: "h-3.5 w-3.5 shrink-0"
|
|
827
828
|
}
|
|
828
829
|
),
|
|
829
830
|
/* @__PURE__ */ t(
|
|
830
|
-
|
|
831
|
+
hn,
|
|
831
832
|
{
|
|
832
833
|
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground",
|
|
833
834
|
strokeWidth: 1.75
|
|
834
835
|
}
|
|
835
836
|
),
|
|
836
837
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-1.5", children: [
|
|
837
|
-
/* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children:
|
|
838
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children:
|
|
838
|
+
/* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children: g.table_name }),
|
|
839
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: g.table_type ?? "table" })
|
|
839
840
|
] })
|
|
840
|
-
] }) },
|
|
841
|
+
] }) }, g.table_name);
|
|
841
842
|
})
|
|
842
843
|
] });
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function za({
|
|
845
846
|
connection: e,
|
|
846
847
|
search: n,
|
|
847
848
|
selectedEntities: a,
|
|
@@ -850,7 +851,7 @@ function Oa({
|
|
|
850
851
|
const u = Ge("/v1/datamodels", { connection_id: e.id }, [
|
|
851
852
|
"datamodels",
|
|
852
853
|
e.id
|
|
853
|
-
]), d =
|
|
854
|
+
]), d = P(() => {
|
|
854
855
|
var m;
|
|
855
856
|
const i = ((m = u.data) == null ? void 0 : m.datamodels) ?? [];
|
|
856
857
|
if (!n) return i;
|
|
@@ -906,7 +907,7 @@ function Oa({
|
|
|
906
907
|
}
|
|
907
908
|
),
|
|
908
909
|
/* @__PURE__ */ t(
|
|
909
|
-
|
|
910
|
+
ka,
|
|
910
911
|
{
|
|
911
912
|
className: "mt-[2px] h-3.5 w-3.5 shrink-0 text-muted-foreground",
|
|
912
913
|
strokeWidth: 1.75
|
|
@@ -923,20 +924,20 @@ function Oa({
|
|
|
923
924
|
}) })
|
|
924
925
|
] });
|
|
925
926
|
}
|
|
926
|
-
function
|
|
927
|
+
function on({
|
|
927
928
|
label: e,
|
|
928
929
|
indentLevel: n,
|
|
929
930
|
search: a,
|
|
930
931
|
renderChildren: o
|
|
931
932
|
}) {
|
|
932
|
-
const [u, d] =
|
|
933
|
+
const [u, d] = Y(!1), c = u || a.length > 0;
|
|
933
934
|
return /* @__PURE__ */ l("div", { children: [
|
|
934
935
|
/* @__PURE__ */ l(
|
|
935
936
|
"button",
|
|
936
937
|
{
|
|
937
938
|
type: "button",
|
|
938
939
|
onClick: () => d((s) => !s),
|
|
939
|
-
className:
|
|
940
|
+
className: q(
|
|
940
941
|
"flex h-6 w-full items-center gap-1.5 pr-4 text-left transition-colors hover:bg-muted/40",
|
|
941
942
|
n === 1 ? "pl-8" : "pl-10"
|
|
942
943
|
),
|
|
@@ -944,7 +945,7 @@ function an({
|
|
|
944
945
|
/* @__PURE__ */ t(
|
|
945
946
|
Ie,
|
|
946
947
|
{
|
|
947
|
-
className:
|
|
948
|
+
className: q(
|
|
948
949
|
"h-2.5 w-2.5 shrink-0 text-muted-foreground transition-transform",
|
|
949
950
|
c && "rotate-90"
|
|
950
951
|
),
|
|
@@ -959,15 +960,15 @@ function an({
|
|
|
959
960
|
] });
|
|
960
961
|
}
|
|
961
962
|
function Ge(e, n, a, o = !0) {
|
|
962
|
-
const { tokenProps: u } = ct(), d = ut((i) => i.authToken), c =
|
|
963
|
+
const { tokenProps: u } = ct(), d = ut((i) => i.authToken), c = P(
|
|
963
964
|
() => Object.fromEntries(
|
|
964
965
|
Object.entries(n).filter(([, i]) => i !== void 0)
|
|
965
966
|
),
|
|
966
967
|
[n]
|
|
967
968
|
);
|
|
968
|
-
return
|
|
969
|
+
return Vt({
|
|
969
970
|
queryKey: a,
|
|
970
|
-
queryFn: () =>
|
|
971
|
+
queryFn: () => Kt(
|
|
971
972
|
`${u.apiServiceUrl}${e}`,
|
|
972
973
|
(d == null ? void 0 : d.accessToken) || "",
|
|
973
974
|
c
|
|
@@ -975,20 +976,20 @@ function Ge(e, n, a, o = !0) {
|
|
|
975
976
|
enabled: o && !!(d != null && d.accessToken) && Object.values(c).every((i) => i.length > 0)
|
|
976
977
|
});
|
|
977
978
|
}
|
|
978
|
-
function
|
|
979
|
+
function Ma(e) {
|
|
979
980
|
return e.type === "dataset" && e.label || e.name;
|
|
980
981
|
}
|
|
981
|
-
function
|
|
982
|
+
function qa(e, n) {
|
|
982
983
|
if (!(e.type !== "dataset" || !e.domainId || !n))
|
|
983
984
|
return n.get(e.domainId);
|
|
984
985
|
}
|
|
985
|
-
function
|
|
986
|
+
function ja({
|
|
986
987
|
selectedEntities: e,
|
|
987
988
|
onDeselectEntity: n,
|
|
988
989
|
semanticDomainLabels: a
|
|
989
990
|
}) {
|
|
990
991
|
return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: e.map((o, u) => /* @__PURE__ */ t(
|
|
991
|
-
|
|
992
|
+
Ua,
|
|
992
993
|
{
|
|
993
994
|
entity: o,
|
|
994
995
|
semanticDomainLabels: a,
|
|
@@ -997,12 +998,12 @@ function Ra({
|
|
|
997
998
|
`${o.type}-${o.name}-${u}`
|
|
998
999
|
)) });
|
|
999
1000
|
}
|
|
1000
|
-
function
|
|
1001
|
+
function Ua({
|
|
1001
1002
|
entity: e,
|
|
1002
1003
|
semanticDomainLabels: n,
|
|
1003
1004
|
onDeselect: a
|
|
1004
1005
|
}) {
|
|
1005
|
-
const o =
|
|
1006
|
+
const o = Ma(e), u = qa(e, n), d = u ? `${o} from ${u}` : o;
|
|
1006
1007
|
return /* @__PURE__ */ l(
|
|
1007
1008
|
"span",
|
|
1008
1009
|
{
|
|
@@ -1032,13 +1033,13 @@ function Ea({
|
|
|
1032
1033
|
}
|
|
1033
1034
|
);
|
|
1034
1035
|
}
|
|
1035
|
-
function
|
|
1036
|
+
function Ye(e) {
|
|
1036
1037
|
if (e != null && e.length)
|
|
1037
1038
|
return e.every((n) => n.type === "dataset") ? "semanticDomain" : e.every((n) => n.type === "url") ? "url" : e.every(
|
|
1038
1039
|
(n) => n.type === "upload" || n.type === "file"
|
|
1039
1040
|
) ? "upload" : "database";
|
|
1040
1041
|
}
|
|
1041
|
-
function
|
|
1042
|
+
function Tr({
|
|
1042
1043
|
open: e,
|
|
1043
1044
|
onOpenChange: n,
|
|
1044
1045
|
dataSource: a,
|
|
@@ -1046,86 +1047,86 @@ function Cr({
|
|
|
1046
1047
|
onDataSourceChange: u
|
|
1047
1048
|
}) {
|
|
1048
1049
|
var Se, me;
|
|
1049
|
-
const { tokenProps: d } = ct(), c = d.config, i = d.semanticDomainAccess ||
|
|
1050
|
+
const { tokenProps: d } = ct(), c = d.config, i = d.semanticDomainAccess || Zn, [s, m] = Y([]), [f, k] = Y(""), [y, g] = Y("all"), [N, S] = Y(
|
|
1050
1051
|
void 0
|
|
1051
|
-
),
|
|
1052
|
-
(
|
|
1053
|
-
|
|
1052
|
+
), V = $e(!1), { updateDataSource: _ } = Et(), Q = u ?? _, C = i.mode, I = (c == null ? void 0 : c.showDirectSource) !== !1, U = C === "include" || C === "exclude" || !I, X = C !== "all", p = I && !U, T = U ? "semanticDomain" : a.mode, $ = !I, D = C === "include" && (((Se = i.domainIds) == null ? void 0 : Se.length) || 0) === 1 ? (me = i.domainIds) == null ? void 0 : me[0] : void 0, v = ne(
|
|
1053
|
+
(A) => {
|
|
1054
|
+
V.current = !0, Q({
|
|
1054
1055
|
...a,
|
|
1055
1056
|
connectionId: (a == null ? void 0 : a.connectionId) || "",
|
|
1056
1057
|
connectionType: (a == null ? void 0 : a.connectionType) || "",
|
|
1057
|
-
mode:
|
|
1058
|
+
mode: A,
|
|
1058
1059
|
selectedEntities: (a == null ? void 0 : a.selectedEntities) || [],
|
|
1059
|
-
|
|
1060
|
+
...A !== "semanticDomain" && { semanticDomainId: void 0 }
|
|
1060
1061
|
});
|
|
1061
1062
|
},
|
|
1062
|
-
[a,
|
|
1063
|
-
),
|
|
1064
|
-
(
|
|
1065
|
-
|
|
1063
|
+
[a, Q]
|
|
1064
|
+
), h = ne(
|
|
1065
|
+
(A) => {
|
|
1066
|
+
Q({
|
|
1066
1067
|
...a,
|
|
1067
|
-
|
|
1068
|
+
...A
|
|
1068
1069
|
});
|
|
1069
1070
|
},
|
|
1070
|
-
[a,
|
|
1071
|
+
[a, Q]
|
|
1071
1072
|
);
|
|
1072
1073
|
de(() => {
|
|
1073
1074
|
var b;
|
|
1074
|
-
if (
|
|
1075
|
+
if (U && a.mode !== "semanticDomain") {
|
|
1075
1076
|
v("semanticDomain");
|
|
1076
1077
|
return;
|
|
1077
1078
|
}
|
|
1078
|
-
if (!X ||
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
mode:
|
|
1079
|
+
if (!X || T !== "semanticDomain") return;
|
|
1080
|
+
const A = i.domainIds ?? [], ae = (((b = a.selectedEntities) == null ? void 0 : b.length) ?? 0) > 0, r = ((s == null ? void 0 : s.length) ?? 0) > 0;
|
|
1081
|
+
Ia({
|
|
1082
|
+
mode: C,
|
|
1082
1083
|
currentDomainId: a.semanticDomainId,
|
|
1083
|
-
scopedDomainIds:
|
|
1084
|
+
scopedDomainIds: A,
|
|
1084
1085
|
hasSelectedEntities: ae
|
|
1085
|
-
}) && (
|
|
1086
|
+
}) && (h({
|
|
1086
1087
|
semanticDomainId: void 0,
|
|
1087
1088
|
selectedEntities: []
|
|
1088
1089
|
}), r && m([]));
|
|
1089
1090
|
}, [
|
|
1090
|
-
|
|
1091
|
+
U,
|
|
1091
1092
|
X,
|
|
1092
|
-
|
|
1093
|
+
T,
|
|
1093
1094
|
a.mode,
|
|
1094
1095
|
a.semanticDomainId,
|
|
1095
1096
|
a.selectedEntities,
|
|
1096
1097
|
s,
|
|
1097
1098
|
i.domainIds,
|
|
1098
|
-
|
|
1099
|
-
|
|
1099
|
+
C,
|
|
1100
|
+
h,
|
|
1100
1101
|
v
|
|
1101
1102
|
]), de(() => {
|
|
1102
|
-
|
|
1103
|
-
}, [
|
|
1103
|
+
D && !a.semanticDomainId && h({ semanticDomainId: D });
|
|
1104
|
+
}, [D, a.semanticDomainId, h]), de(() => {
|
|
1104
1105
|
if (!e) {
|
|
1105
|
-
|
|
1106
|
+
V.current = !1, k(""), S(void 0), g(U ? "semantic" : "all");
|
|
1106
1107
|
return;
|
|
1107
1108
|
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1109
|
+
V.current || (m([...o || []]), S(
|
|
1110
|
+
Ye(o)
|
|
1110
1111
|
));
|
|
1111
|
-
}, [e, o,
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
s.filter((ae) => !J(ae,
|
|
1112
|
+
}, [e, o, U]);
|
|
1113
|
+
const E = (A) => {
|
|
1114
|
+
V.current = !0, m(
|
|
1115
|
+
s.filter((ae) => !J(ae, A))
|
|
1115
1116
|
);
|
|
1116
|
-
},
|
|
1117
|
-
(
|
|
1118
|
-
|
|
1119
|
-
ae ??
|
|
1117
|
+
}, w = ne(
|
|
1118
|
+
(A, ae) => {
|
|
1119
|
+
V.current = !0, m(A), S(
|
|
1120
|
+
ae ?? Ye(A)
|
|
1120
1121
|
);
|
|
1121
1122
|
},
|
|
1122
1123
|
[]
|
|
1123
|
-
),
|
|
1124
|
+
), H = () => {
|
|
1124
1125
|
var ae, r;
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1127
|
-
const x =
|
|
1128
|
-
|
|
1126
|
+
const A = Ye(s) ?? N ?? T;
|
|
1127
|
+
if (A === "semanticDomain") {
|
|
1128
|
+
const x = an(s) || a.semanticDomainId, b = ((ae = s == null ? void 0 : s[0]) == null ? void 0 : ae.connectionId) || a.connectionId, L = ((r = s == null ? void 0 : s[0]) == null ? void 0 : r.connectionType) || a.connectionType;
|
|
1129
|
+
Q({
|
|
1129
1130
|
...a,
|
|
1130
1131
|
mode: "semanticDomain",
|
|
1131
1132
|
semanticDomainId: x,
|
|
@@ -1133,11 +1134,11 @@ function Cr({
|
|
|
1133
1134
|
connectionType: L,
|
|
1134
1135
|
selectedEntities: s
|
|
1135
1136
|
});
|
|
1136
|
-
} else if (
|
|
1137
|
+
} else if (A === "upload" || A === "url") {
|
|
1137
1138
|
const x = s == null ? void 0 : s[0];
|
|
1138
|
-
|
|
1139
|
+
Q({
|
|
1139
1140
|
...a,
|
|
1140
|
-
mode:
|
|
1141
|
+
mode: A,
|
|
1141
1142
|
semanticDomainId: void 0,
|
|
1142
1143
|
connectionId: (x == null ? void 0 : x.connectionId) || a.connectionId,
|
|
1143
1144
|
connectionType: (x == null ? void 0 : x.connectionType) || a.connectionType,
|
|
@@ -1145,7 +1146,7 @@ function Cr({
|
|
|
1145
1146
|
});
|
|
1146
1147
|
} else {
|
|
1147
1148
|
const x = s == null ? void 0 : s[0];
|
|
1148
|
-
|
|
1149
|
+
Q({
|
|
1149
1150
|
...a,
|
|
1150
1151
|
mode: "database",
|
|
1151
1152
|
semanticDomainId: void 0,
|
|
@@ -1155,28 +1156,28 @@ function Cr({
|
|
|
1155
1156
|
});
|
|
1156
1157
|
}
|
|
1157
1158
|
n(!1);
|
|
1158
|
-
}, { semanticDomains:
|
|
1159
|
+
}, { semanticDomains: O } = nn(), { connections: z } = Rt(), B = P(
|
|
1159
1160
|
() => new Map(
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1161
|
+
O.map((A) => [
|
|
1162
|
+
A.id,
|
|
1163
|
+
A.label || A.name
|
|
1163
1164
|
])
|
|
1164
1165
|
),
|
|
1165
|
-
[
|
|
1166
|
-
),
|
|
1167
|
-
|
|
1168
|
-
}, ee = y.startsWith("domain:"), te = y.startsWith("conn:"), Be = ee ? y.slice(7) : void 0, We = te ? y.slice(5) : void 0, oe = !p || y === "all" || y === "semantic" || ee, Te =
|
|
1169
|
-
return /* @__PURE__ */ t(
|
|
1170
|
-
|
|
1166
|
+
[O]
|
|
1167
|
+
), j = (A) => {
|
|
1168
|
+
g(A), A === "semantic" || A.startsWith("domain:") ? a.mode !== "semanticDomain" && v("semanticDomain") : (A === "direct" || A.startsWith("conn:")) && a.mode === "semanticDomain" && v("database");
|
|
1169
|
+
}, ee = y.startsWith("domain:"), te = y.startsWith("conn:"), Be = ee ? y.slice(7) : void 0, We = te ? y.slice(5) : void 0, oe = !p || y === "all" || y === "semantic" || ee, Te = I && !U && (y === "all" || y === "direct" || te), ue = ((o == null ? void 0 : o.length) ?? 0) > 0, Ce = s.length === 0 && !ue, we = s.length === 0 && ue ? "Clear" : "Add", ke = $ ? "Select dataset" : "Add data";
|
|
1170
|
+
return /* @__PURE__ */ t(kn, { open: e, onOpenChange: n, children: /* @__PURE__ */ l(
|
|
1171
|
+
Sn,
|
|
1171
1172
|
{
|
|
1172
1173
|
showCloseButton: !1,
|
|
1173
1174
|
className: "flex h-[560px] w-[620px] max-w-[620px] flex-col gap-0 overflow-hidden rounded-[6px] border border-border bg-popover p-0",
|
|
1174
1175
|
children: [
|
|
1175
|
-
/* @__PURE__ */ t(
|
|
1176
|
+
/* @__PURE__ */ t(gn, { children: /* @__PURE__ */ t(Dn, { children: ke }) }),
|
|
1176
1177
|
/* @__PURE__ */ l("div", { className: "flex items-start justify-between border-b border-border px-4 py-2.5", children: [
|
|
1177
1178
|
/* @__PURE__ */ l("div", { children: [
|
|
1178
1179
|
/* @__PURE__ */ t("p", { className: "text-[14px] font-semibold text-foreground", children: ke }),
|
|
1179
|
-
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children:
|
|
1180
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: $ ? "Choose a curated dataset to analyze" : "Search your semantic domains and connections" })
|
|
1180
1181
|
] }),
|
|
1181
1182
|
/* @__PURE__ */ t(
|
|
1182
1183
|
"button",
|
|
@@ -1191,13 +1192,13 @@ function Cr({
|
|
|
1191
1192
|
] }),
|
|
1192
1193
|
/* @__PURE__ */ l("div", { className: "border-b border-border px-4 py-2.5", children: [
|
|
1193
1194
|
/* @__PURE__ */ l("div", { className: "flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 focus-within:border-ring", children: [
|
|
1194
|
-
/* @__PURE__ */ t(
|
|
1195
|
+
/* @__PURE__ */ t(In, { className: "h-3 w-3 shrink-0 text-muted-foreground" }),
|
|
1195
1196
|
/* @__PURE__ */ t(
|
|
1196
1197
|
"input",
|
|
1197
1198
|
{
|
|
1198
1199
|
type: "text",
|
|
1199
1200
|
value: f,
|
|
1200
|
-
onChange: (
|
|
1201
|
+
onChange: (A) => k(A.target.value),
|
|
1201
1202
|
placeholder: "Search datasets, tables, views, models",
|
|
1202
1203
|
className: "h-full w-full bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none"
|
|
1203
1204
|
}
|
|
@@ -1206,7 +1207,7 @@ function Cr({
|
|
|
1206
1207
|
"button",
|
|
1207
1208
|
{
|
|
1208
1209
|
type: "button",
|
|
1209
|
-
onClick: () =>
|
|
1210
|
+
onClick: () => k(""),
|
|
1210
1211
|
"aria-label": "Clear search",
|
|
1211
1212
|
className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-control text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1212
1213
|
children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
|
|
@@ -1222,16 +1223,16 @@ function Cr({
|
|
|
1222
1223
|
{
|
|
1223
1224
|
label: "All",
|
|
1224
1225
|
active: y === "all",
|
|
1225
|
-
onClick: () =>
|
|
1226
|
+
onClick: () => j("all")
|
|
1226
1227
|
}
|
|
1227
1228
|
),
|
|
1228
|
-
(
|
|
1229
|
+
(O.length > 0 || z.length > 0) && /* @__PURE__ */ l(fe, { children: [
|
|
1229
1230
|
/* @__PURE__ */ t(
|
|
1230
1231
|
De,
|
|
1231
1232
|
{
|
|
1232
1233
|
label: "Semantic",
|
|
1233
1234
|
active: y === "semantic",
|
|
1234
|
-
onClick: () =>
|
|
1235
|
+
onClick: () => j("semantic")
|
|
1235
1236
|
}
|
|
1236
1237
|
),
|
|
1237
1238
|
/* @__PURE__ */ t(
|
|
@@ -1239,49 +1240,49 @@ function Cr({
|
|
|
1239
1240
|
{
|
|
1240
1241
|
label: "Direct",
|
|
1241
1242
|
active: y === "direct",
|
|
1242
|
-
onClick: () =>
|
|
1243
|
+
onClick: () => j("direct")
|
|
1243
1244
|
}
|
|
1244
1245
|
),
|
|
1245
1246
|
/* @__PURE__ */ t("span", { className: "shrink-0 px-0.5 text-muted-foreground/50", children: "·" })
|
|
1246
1247
|
] }),
|
|
1247
|
-
|
|
1248
|
+
O.map((A) => /* @__PURE__ */ t(
|
|
1248
1249
|
De,
|
|
1249
1250
|
{
|
|
1250
|
-
label:
|
|
1251
|
-
active: y === `domain:${
|
|
1252
|
-
onClick: () =>
|
|
1251
|
+
label: A.label || A.name,
|
|
1252
|
+
active: y === `domain:${A.id}`,
|
|
1253
|
+
onClick: () => j(`domain:${A.id}`)
|
|
1253
1254
|
},
|
|
1254
|
-
`domain:${
|
|
1255
|
+
`domain:${A.id}`
|
|
1255
1256
|
)),
|
|
1256
|
-
z.map((
|
|
1257
|
+
z.map((A) => /* @__PURE__ */ t(
|
|
1257
1258
|
De,
|
|
1258
1259
|
{
|
|
1259
|
-
label:
|
|
1260
|
-
active: y === `conn:${
|
|
1261
|
-
onClick: () =>
|
|
1260
|
+
label: A.name,
|
|
1261
|
+
active: y === `conn:${A.id}`,
|
|
1262
|
+
onClick: () => j(`conn:${A.id}`)
|
|
1262
1263
|
},
|
|
1263
|
-
`conn:${
|
|
1264
|
+
`conn:${A.id}`
|
|
1264
1265
|
))
|
|
1265
1266
|
] }) })
|
|
1266
1267
|
] }),
|
|
1267
1268
|
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto py-1", children: [
|
|
1268
1269
|
oe && /* @__PURE__ */ t(
|
|
1269
|
-
|
|
1270
|
+
$a,
|
|
1270
1271
|
{
|
|
1271
1272
|
domainAccess: i,
|
|
1272
1273
|
search: f,
|
|
1273
1274
|
scopeDomainId: Be,
|
|
1274
1275
|
selectedEntities: s,
|
|
1275
|
-
onSelectionChange: (
|
|
1276
|
+
onSelectionChange: (A) => w(A, "semanticDomain")
|
|
1276
1277
|
}
|
|
1277
1278
|
),
|
|
1278
1279
|
Te && /* @__PURE__ */ t(
|
|
1279
|
-
|
|
1280
|
+
Oa,
|
|
1280
1281
|
{
|
|
1281
1282
|
search: f,
|
|
1282
1283
|
scopeConnectionId: We,
|
|
1283
1284
|
selectedEntities: s,
|
|
1284
|
-
onSelectionChange: (
|
|
1285
|
+
onSelectionChange: (A) => w(A)
|
|
1285
1286
|
}
|
|
1286
1287
|
)
|
|
1287
1288
|
] }),
|
|
@@ -1308,9 +1309,9 @@ function Cr({
|
|
|
1308
1309
|
"button",
|
|
1309
1310
|
{
|
|
1310
1311
|
type: "button",
|
|
1311
|
-
onClick:
|
|
1312
|
+
onClick: H,
|
|
1312
1313
|
disabled: Ce,
|
|
1313
|
-
className:
|
|
1314
|
+
className: q(
|
|
1314
1315
|
"inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-2.5 text-[12px] font-medium text-primary-foreground transition-colors hover:bg-primary/90",
|
|
1315
1316
|
Ce && "cursor-not-allowed opacity-50 hover:bg-primary"
|
|
1316
1317
|
),
|
|
@@ -1326,11 +1327,11 @@ function Cr({
|
|
|
1326
1327
|
] })
|
|
1327
1328
|
] }),
|
|
1328
1329
|
s.length > 0 && /* @__PURE__ */ t(
|
|
1329
|
-
|
|
1330
|
+
ja,
|
|
1330
1331
|
{
|
|
1331
1332
|
selectedEntities: s,
|
|
1332
|
-
onDeselectEntity:
|
|
1333
|
-
semanticDomainLabels:
|
|
1333
|
+
onDeselectEntity: E,
|
|
1334
|
+
semanticDomainLabels: B
|
|
1334
1335
|
}
|
|
1335
1336
|
)
|
|
1336
1337
|
] })
|
|
@@ -1349,7 +1350,7 @@ function De({
|
|
|
1349
1350
|
type: "button",
|
|
1350
1351
|
onClick: a,
|
|
1351
1352
|
"aria-pressed": n,
|
|
1352
|
-
className:
|
|
1353
|
+
className: q(
|
|
1353
1354
|
"inline-flex h-6 shrink-0 items-center whitespace-nowrap rounded-control px-2 text-[11px] font-medium transition-colors",
|
|
1354
1355
|
n ? "bg-primary text-primary-foreground hover:bg-primary/90" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1355
1356
|
),
|
|
@@ -1357,18 +1358,18 @@ function De({
|
|
|
1357
1358
|
}
|
|
1358
1359
|
);
|
|
1359
1360
|
}
|
|
1360
|
-
function
|
|
1361
|
+
function Lr() {
|
|
1361
1362
|
const e = se((c) => c.card.dataSource), {
|
|
1362
1363
|
setSelectedConnectionId: n,
|
|
1363
1364
|
setSelectedDatabaseName: a,
|
|
1364
1365
|
setSelectedSchemaName: o,
|
|
1365
1366
|
setSelectedTableName: u,
|
|
1366
1367
|
setSelectedDatamodelId: d
|
|
1367
|
-
} =
|
|
1368
|
+
} = Et();
|
|
1368
1369
|
de(() => {
|
|
1369
|
-
var
|
|
1370
|
+
var g;
|
|
1370
1371
|
if (!e) return;
|
|
1371
|
-
const { tableName: c, schemaName: i, databaseName: s, connectionId: m } =
|
|
1372
|
+
const { tableName: c, schemaName: i, databaseName: s, connectionId: m } = Tn(e), f = (g = e.selectedEntities) == null ? void 0 : g[0], y = (f == null ? void 0 : f.type) === "model" && "id" in f ? f.id : "";
|
|
1372
1373
|
n(m || ""), a(s || ""), o(i || ""), u(c || ""), d(y);
|
|
1373
1374
|
}, [
|
|
1374
1375
|
e,
|
|
@@ -1379,14 +1380,14 @@ function wr() {
|
|
|
1379
1380
|
d
|
|
1380
1381
|
]);
|
|
1381
1382
|
}
|
|
1382
|
-
function
|
|
1383
|
+
function $r({
|
|
1383
1384
|
type: e,
|
|
1384
1385
|
isLinked: n,
|
|
1385
1386
|
className: a,
|
|
1386
1387
|
showLabel: o = !1,
|
|
1387
1388
|
showLocal: u = !1
|
|
1388
1389
|
}) {
|
|
1389
|
-
const d = ut((
|
|
1390
|
+
const d = ut((S) => S.selectedFrameId), c = Ln((S) => S.selectedVisual), i = se((S) => S.frame);
|
|
1390
1391
|
let s;
|
|
1391
1392
|
if (e)
|
|
1392
1393
|
s = e;
|
|
@@ -1412,7 +1413,7 @@ function kr({
|
|
|
1412
1413
|
local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
|
|
1413
1414
|
linked: "Linked to library: Changes made here update the library visual and all linked instances.",
|
|
1414
1415
|
library: "Library visual: Share and reuse this visual across multiple dashboards."
|
|
1415
|
-
},
|
|
1416
|
+
}, k = {
|
|
1416
1417
|
local: "border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",
|
|
1417
1418
|
linked: "border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",
|
|
1418
1419
|
library: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
|
|
@@ -1420,10 +1421,10 @@ function kr({
|
|
|
1420
1421
|
local: "fill-slate-50 dark:fill-slate-900",
|
|
1421
1422
|
linked: "fill-purple-50 dark:fill-purple-950",
|
|
1422
1423
|
library: "fill-blue-50 dark:fill-blue-950"
|
|
1423
|
-
},
|
|
1424
|
+
}, g = {
|
|
1424
1425
|
local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
|
|
1425
|
-
linked: /* @__PURE__ */ t(
|
|
1426
|
-
library: /* @__PURE__ */ t(
|
|
1426
|
+
linked: /* @__PURE__ */ t(An, { className: "h-3.5 w-3.5" }),
|
|
1427
|
+
library: /* @__PURE__ */ t(Sa, { className: "h-3.5 w-3.5" })
|
|
1427
1428
|
}, N = {
|
|
1428
1429
|
local: "Local",
|
|
1429
1430
|
linked: "Linked",
|
|
@@ -1431,16 +1432,16 @@ function kr({
|
|
|
1431
1432
|
};
|
|
1432
1433
|
return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ l(rt, { delayDuration: 300, children: [
|
|
1433
1434
|
/* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1434
|
-
|
|
1435
|
+
$n,
|
|
1435
1436
|
{
|
|
1436
1437
|
variant: "outline",
|
|
1437
|
-
className:
|
|
1438
|
+
className: q(
|
|
1438
1439
|
"cursor-help select-none transition-all",
|
|
1439
1440
|
m[s],
|
|
1440
1441
|
a
|
|
1441
1442
|
),
|
|
1442
1443
|
children: [
|
|
1443
|
-
|
|
1444
|
+
g[s],
|
|
1444
1445
|
o && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: N[s] })
|
|
1445
1446
|
]
|
|
1446
1447
|
}
|
|
@@ -1449,16 +1450,16 @@ function kr({
|
|
|
1449
1450
|
ot,
|
|
1450
1451
|
{
|
|
1451
1452
|
side: "bottom",
|
|
1452
|
-
className:
|
|
1453
|
+
className: q("max-w-xs", k[s]),
|
|
1453
1454
|
children: [
|
|
1454
|
-
/* @__PURE__ */ t(
|
|
1455
|
+
/* @__PURE__ */ t(_t, { className: y[s] }),
|
|
1455
1456
|
/* @__PURE__ */ t("p", { children: f[s] })
|
|
1456
1457
|
]
|
|
1457
1458
|
}
|
|
1458
1459
|
)
|
|
1459
1460
|
] }) });
|
|
1460
1461
|
}
|
|
1461
|
-
const
|
|
1462
|
+
const Ga = vn(
|
|
1462
1463
|
({
|
|
1463
1464
|
side: e = "bottom",
|
|
1464
1465
|
children: n,
|
|
@@ -1480,7 +1481,7 @@ const za = gn(
|
|
|
1480
1481
|
onClick: u,
|
|
1481
1482
|
...s,
|
|
1482
1483
|
...c,
|
|
1483
|
-
className:
|
|
1484
|
+
className: q(`${Jn}`, a),
|
|
1484
1485
|
children: n
|
|
1485
1486
|
}
|
|
1486
1487
|
) }),
|
|
@@ -1489,31 +1490,31 @@ const za = gn(
|
|
|
1489
1490
|
{
|
|
1490
1491
|
side: e,
|
|
1491
1492
|
sideOffset: 10,
|
|
1492
|
-
className:
|
|
1493
|
+
className: q(
|
|
1493
1494
|
"border-foreground/20 bg-foreground text-background"
|
|
1494
1495
|
),
|
|
1495
1496
|
children: [
|
|
1496
1497
|
o,
|
|
1497
|
-
/* @__PURE__ */ t(
|
|
1498
|
+
/* @__PURE__ */ t(_t, { className: "fill-foreground" })
|
|
1498
1499
|
]
|
|
1499
1500
|
}
|
|
1500
1501
|
)
|
|
1501
1502
|
] }) })
|
|
1502
1503
|
);
|
|
1503
|
-
|
|
1504
|
-
function
|
|
1504
|
+
Ga.displayName = "IconButton";
|
|
1505
|
+
function Ba(e, n) {
|
|
1505
1506
|
var s, m;
|
|
1506
|
-
const a = e.qualifiedFieldName || e.name, o = e.qualifiedFieldName ? e.qualifiedFieldName.split(".").slice(0, -1).join(".") : e.qualifiedEntityName || e.entityName, u = n.connectionId || ((s = n.dataSource) == null ? void 0 : s.connectionId) || "", d =
|
|
1507
|
+
const a = e.qualifiedFieldName || e.name, o = e.qualifiedFieldName ? e.qualifiedFieldName.split(".").slice(0, -1).join(".") : e.qualifiedEntityName || e.entityName, u = n.connectionId || ((s = n.dataSource) == null ? void 0 : s.connectionId) || "", d = Xn(e), c = ea(
|
|
1507
1508
|
n.dataSource,
|
|
1508
1509
|
{
|
|
1509
1510
|
connectionId: u,
|
|
1510
1511
|
connectionType: (m = n.dataSource) == null ? void 0 : m.connectionType
|
|
1511
1512
|
},
|
|
1512
1513
|
e
|
|
1513
|
-
), i =
|
|
1514
|
+
), i = ta(n.dataSource, c, e) || "";
|
|
1514
1515
|
return {
|
|
1515
1516
|
column: a,
|
|
1516
|
-
title:
|
|
1517
|
+
title: tn(e),
|
|
1517
1518
|
dataType: e.dataType,
|
|
1518
1519
|
...e.nativeDataType ? { nativeDataType: e.nativeDataType } : {},
|
|
1519
1520
|
table: e.entityName || "",
|
|
@@ -1526,7 +1527,7 @@ function Ma(e, n) {
|
|
|
1526
1527
|
semanticContext: c
|
|
1527
1528
|
};
|
|
1528
1529
|
}
|
|
1529
|
-
function
|
|
1530
|
+
function ln(e) {
|
|
1530
1531
|
const { control: n, onChange: a } = e;
|
|
1531
1532
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
1532
1533
|
/* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
@@ -1541,16 +1542,16 @@ function rn(e) {
|
|
|
1541
1542
|
)
|
|
1542
1543
|
] });
|
|
1543
1544
|
}
|
|
1544
|
-
function
|
|
1545
|
+
function Wa(e) {
|
|
1545
1546
|
const { currentStep: n, labels: a } = e;
|
|
1546
1547
|
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: a.map((o, u) => {
|
|
1547
1548
|
const d = u + 1, c = d === n, i = d < n;
|
|
1548
|
-
return /* @__PURE__ */ l(
|
|
1549
|
+
return /* @__PURE__ */ l(yn, { children: [
|
|
1549
1550
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
1550
1551
|
/* @__PURE__ */ t(
|
|
1551
1552
|
"span",
|
|
1552
1553
|
{
|
|
1553
|
-
className:
|
|
1554
|
+
className: q(
|
|
1554
1555
|
"flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
|
|
1555
1556
|
c ? "border-foreground bg-foreground text-background" : i ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
|
|
1556
1557
|
),
|
|
@@ -1560,7 +1561,7 @@ function qa(e) {
|
|
|
1560
1561
|
/* @__PURE__ */ t(
|
|
1561
1562
|
"span",
|
|
1562
1563
|
{
|
|
1563
|
-
className:
|
|
1564
|
+
className: q(
|
|
1564
1565
|
"text-[12px]",
|
|
1565
1566
|
c ? "font-medium text-foreground" : "text-muted-foreground"
|
|
1566
1567
|
),
|
|
@@ -1586,26 +1587,26 @@ function je(e) {
|
|
|
1586
1587
|
o
|
|
1587
1588
|
] });
|
|
1588
1589
|
}
|
|
1589
|
-
function
|
|
1590
|
+
function Ka(e) {
|
|
1590
1591
|
const { control: n, scope: a, detail: o } = e;
|
|
1591
1592
|
return /* @__PURE__ */ l("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
|
|
1592
|
-
/* @__PURE__ */ t(
|
|
1593
|
+
/* @__PURE__ */ t(zn, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
|
|
1593
1594
|
/* @__PURE__ */ l("div", { className: "min-w-0 space-y-0.5", children: [
|
|
1594
1595
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: n.label }),
|
|
1595
1596
|
/* @__PURE__ */ l("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
1596
|
-
|
|
1597
|
+
Qt(n.type).label,
|
|
1597
1598
|
" ·",
|
|
1598
1599
|
" ",
|
|
1599
1600
|
Ht(n),
|
|
1600
1601
|
" ·",
|
|
1601
1602
|
" ",
|
|
1602
|
-
|
|
1603
|
+
Pt(a, n.placement)
|
|
1603
1604
|
] }),
|
|
1604
1605
|
o ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: o }) : null
|
|
1605
1606
|
] })
|
|
1606
1607
|
] });
|
|
1607
1608
|
}
|
|
1608
|
-
function
|
|
1609
|
+
function Lt(e) {
|
|
1609
1610
|
const {
|
|
1610
1611
|
control: n,
|
|
1611
1612
|
defaultValue: a,
|
|
@@ -1617,13 +1618,13 @@ function Tt(e) {
|
|
|
1617
1618
|
onLabelChange: s,
|
|
1618
1619
|
onDefaultValueChange: m,
|
|
1619
1620
|
onBack: f,
|
|
1620
|
-
onNext:
|
|
1621
|
+
onNext: k,
|
|
1621
1622
|
nextDisabled: y
|
|
1622
1623
|
} = e;
|
|
1623
1624
|
return /* @__PURE__ */ l("div", { className: "space-y-3", children: [
|
|
1624
|
-
/* @__PURE__ */ t(
|
|
1625
|
+
/* @__PURE__ */ t(ln, { control: n, onChange: s }),
|
|
1625
1626
|
/* @__PURE__ */ t(
|
|
1626
|
-
|
|
1627
|
+
Mt,
|
|
1627
1628
|
{
|
|
1628
1629
|
control: n,
|
|
1629
1630
|
availableFieldChoices: o,
|
|
@@ -1635,7 +1636,7 @@ function Tt(e) {
|
|
|
1635
1636
|
}
|
|
1636
1637
|
),
|
|
1637
1638
|
/* @__PURE__ */ t(
|
|
1638
|
-
|
|
1639
|
+
qt,
|
|
1639
1640
|
{
|
|
1640
1641
|
control: n,
|
|
1641
1642
|
value: a,
|
|
@@ -1656,7 +1657,7 @@ function Tt(e) {
|
|
|
1656
1657
|
{
|
|
1657
1658
|
type: "button",
|
|
1658
1659
|
size: "xs",
|
|
1659
|
-
onClick:
|
|
1660
|
+
onClick: k,
|
|
1660
1661
|
disabled: y,
|
|
1661
1662
|
children: "Next"
|
|
1662
1663
|
}
|
|
@@ -1665,14 +1666,14 @@ function Tt(e) {
|
|
|
1665
1666
|
)
|
|
1666
1667
|
] });
|
|
1667
1668
|
}
|
|
1668
|
-
const
|
|
1669
|
+
const Qa = /* @__PURE__ */ new Set([
|
|
1669
1670
|
"grain_selector",
|
|
1670
1671
|
"aggregation_selector",
|
|
1671
1672
|
"field_selector",
|
|
1672
1673
|
"metric_selector"
|
|
1673
1674
|
]);
|
|
1674
|
-
function
|
|
1675
|
-
const { text: n, ariaLabel: a } = e, [o, u] =
|
|
1675
|
+
function $t(e) {
|
|
1676
|
+
const { text: n, ariaLabel: a } = e, [o, u] = Y(!1);
|
|
1676
1677
|
return /* @__PURE__ */ l(
|
|
1677
1678
|
"button",
|
|
1678
1679
|
{
|
|
@@ -1704,10 +1705,10 @@ function At(e) {
|
|
|
1704
1705
|
onBack: i,
|
|
1705
1706
|
onCancel: s,
|
|
1706
1707
|
onDone: m
|
|
1707
|
-
} = e, f =
|
|
1708
|
+
} = e, f = Qa.has(n.type), k = o.match(/\[\[param\.(.+?)\]\]/), y = k ? `{{ param('${k[1]}') }}` : "";
|
|
1708
1709
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
1709
1710
|
/* @__PURE__ */ t(
|
|
1710
|
-
|
|
1711
|
+
Ka,
|
|
1711
1712
|
{
|
|
1712
1713
|
control: n,
|
|
1713
1714
|
scope: a,
|
|
@@ -1724,14 +1725,14 @@ function At(e) {
|
|
|
1724
1725
|
/* @__PURE__ */ l("div", { className: "space-y-1.5 px-3 py-2.5", children: [
|
|
1725
1726
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
|
|
1726
1727
|
/* @__PURE__ */ t(
|
|
1727
|
-
|
|
1728
|
+
$t,
|
|
1728
1729
|
{
|
|
1729
1730
|
text: o,
|
|
1730
1731
|
ariaLabel: "Copy SQL control reference"
|
|
1731
1732
|
}
|
|
1732
1733
|
),
|
|
1733
1734
|
y ? /* @__PURE__ */ t(
|
|
1734
|
-
|
|
1735
|
+
$t,
|
|
1735
1736
|
{
|
|
1736
1737
|
text: y,
|
|
1737
1738
|
ariaLabel: "Copy Jinja control reference"
|
|
@@ -1765,26 +1766,26 @@ function At(e) {
|
|
|
1765
1766
|
)
|
|
1766
1767
|
] });
|
|
1767
1768
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const n =
|
|
1769
|
+
function Pa(e) {
|
|
1770
|
+
const n = Ae(
|
|
1770
1771
|
e.scope,
|
|
1771
1772
|
e.existingControls,
|
|
1772
1773
|
e.reservedIds
|
|
1773
1774
|
), a = e.type === n.type ? {
|
|
1774
1775
|
...n,
|
|
1775
|
-
label:
|
|
1776
|
+
label: Pe[e.type]
|
|
1776
1777
|
} : {
|
|
1777
1778
|
...Yt({
|
|
1778
1779
|
controls: [
|
|
1779
1780
|
{
|
|
1780
1781
|
...n,
|
|
1781
|
-
label:
|
|
1782
|
+
label: Pe[e.type]
|
|
1782
1783
|
}
|
|
1783
1784
|
],
|
|
1784
1785
|
controlId: n.id,
|
|
1785
1786
|
nextType: e.type
|
|
1786
1787
|
}).controls[0],
|
|
1787
|
-
label:
|
|
1788
|
+
label: Pe[e.type]
|
|
1788
1789
|
};
|
|
1789
1790
|
return {
|
|
1790
1791
|
step: 2,
|
|
@@ -1792,7 +1793,7 @@ function Ga(e) {
|
|
|
1792
1793
|
defaultValue: Fe(a, void 0)
|
|
1793
1794
|
};
|
|
1794
1795
|
}
|
|
1795
|
-
function
|
|
1796
|
+
function Ar({
|
|
1796
1797
|
scope: e,
|
|
1797
1798
|
controls: n,
|
|
1798
1799
|
reservedControlIds: a,
|
|
@@ -1804,59 +1805,59 @@ function Sr({
|
|
|
1804
1805
|
availableFieldChoices: s,
|
|
1805
1806
|
availableMetricChoices: m,
|
|
1806
1807
|
structuralParticipants: f,
|
|
1807
|
-
structuralParticipantIdsByControlId:
|
|
1808
|
+
structuralParticipantIdsByControlId: k,
|
|
1808
1809
|
card: y,
|
|
1809
|
-
allowedControlTypes:
|
|
1810
|
+
allowedControlTypes: g,
|
|
1810
1811
|
onCreateFlowActiveChange: N,
|
|
1811
|
-
onCreateFlowComplete:
|
|
1812
|
+
onCreateFlowComplete: S
|
|
1812
1813
|
}) {
|
|
1813
|
-
const
|
|
1814
|
+
const V = P(
|
|
1814
1815
|
() => new Set(a || []),
|
|
1815
1816
|
[a]
|
|
1816
|
-
),
|
|
1817
|
+
), _ = la(e), Q = na(e), [C, I] = Y(
|
|
1817
1818
|
null
|
|
1818
|
-
), [
|
|
1819
|
+
), [U, X] = Y(
|
|
1819
1820
|
null
|
|
1820
|
-
), [p,
|
|
1821
|
+
), [p, T] = Y(
|
|
1821
1822
|
() => c ? {
|
|
1822
1823
|
step: 1,
|
|
1823
|
-
control:
|
|
1824
|
+
control: Ae(e, n, Array.from(V))
|
|
1824
1825
|
} : null
|
|
1825
|
-
),
|
|
1826
|
-
const r =
|
|
1827
|
-
if (!
|
|
1826
|
+
), $ = $e({}), D = $e(void 0), v = $e(c), h = P(() => {
|
|
1827
|
+
const r = wt({ scope: e, card: y });
|
|
1828
|
+
if (!g)
|
|
1828
1829
|
return r;
|
|
1829
|
-
const x = new Set(
|
|
1830
|
+
const x = new Set(g);
|
|
1830
1831
|
return r.filter((b) => x.has(b.value));
|
|
1831
|
-
}, [
|
|
1832
|
+
}, [g, y, e]), E = ne(
|
|
1832
1833
|
(r) => {
|
|
1833
|
-
const x =
|
|
1834
|
+
const x = wt({
|
|
1834
1835
|
scope: e,
|
|
1835
1836
|
card: y,
|
|
1836
|
-
includeType:
|
|
1837
|
+
includeType: g ? void 0 : r
|
|
1837
1838
|
});
|
|
1838
|
-
if (!
|
|
1839
|
+
if (!g)
|
|
1839
1840
|
return x;
|
|
1840
|
-
const b = new Set(
|
|
1841
|
+
const b = new Set(g);
|
|
1841
1842
|
return x.filter((L) => b.has(L.value));
|
|
1842
1843
|
},
|
|
1843
|
-
[
|
|
1844
|
-
),
|
|
1844
|
+
[g, y, e]
|
|
1845
|
+
), w = ne(
|
|
1845
1846
|
(r) => e === "dashboard" && (r === "field_selector" || r === "metric_selector"),
|
|
1846
1847
|
[e]
|
|
1847
|
-
),
|
|
1848
|
-
() => p ?
|
|
1848
|
+
), H = P(
|
|
1849
|
+
() => p ? kt(
|
|
1849
1850
|
f || [],
|
|
1850
1851
|
p.control.type
|
|
1851
1852
|
) : [],
|
|
1852
1853
|
[p, f]
|
|
1853
|
-
),
|
|
1854
|
+
), O = P(() => {
|
|
1854
1855
|
if (!p)
|
|
1855
1856
|
return {
|
|
1856
1857
|
fields: s || [],
|
|
1857
1858
|
metrics: m || []
|
|
1858
1859
|
};
|
|
1859
|
-
if (!
|
|
1860
|
+
if (!w(p.control.type))
|
|
1860
1861
|
return {
|
|
1861
1862
|
fields: s || [],
|
|
1862
1863
|
metrics: m || []
|
|
@@ -1880,25 +1881,25 @@ function Sr({
|
|
|
1880
1881
|
s,
|
|
1881
1882
|
m,
|
|
1882
1883
|
p,
|
|
1883
|
-
|
|
1884
|
+
w,
|
|
1884
1885
|
f
|
|
1885
1886
|
]);
|
|
1886
1887
|
de(() => {
|
|
1887
1888
|
N == null || N(!!p);
|
|
1888
1889
|
}, [p, N]), de(() => {
|
|
1889
1890
|
const r = c && !v.current;
|
|
1890
|
-
v.current = c, r && (
|
|
1891
|
+
v.current = c, r && (T({
|
|
1891
1892
|
step: 1,
|
|
1892
|
-
control:
|
|
1893
|
-
}), X(null),
|
|
1894
|
-
}, [n, c,
|
|
1893
|
+
control: Ae(e, n, Array.from(V))
|
|
1894
|
+
}), X(null), I(null));
|
|
1895
|
+
}, [n, c, V, e]);
|
|
1895
1896
|
const z = (r) => {
|
|
1896
|
-
if (!
|
|
1897
|
+
if (!w(r.type))
|
|
1897
1898
|
return {
|
|
1898
1899
|
fields: s || [],
|
|
1899
1900
|
metrics: m || []
|
|
1900
1901
|
};
|
|
1901
|
-
const x = (
|
|
1902
|
+
const x = (k == null ? void 0 : k[r.id]) || [];
|
|
1902
1903
|
if (x.length === 0)
|
|
1903
1904
|
return {
|
|
1904
1905
|
fields: s || [],
|
|
@@ -1919,25 +1920,25 @@ function Sr({
|
|
|
1919
1920
|
target: b.metricTargetMap[L.value]
|
|
1920
1921
|
})) : []
|
|
1921
1922
|
};
|
|
1922
|
-
},
|
|
1923
|
-
if (!
|
|
1923
|
+
}, B = (r) => {
|
|
1924
|
+
if (!w(r.control.type))
|
|
1924
1925
|
return {
|
|
1925
1926
|
nextControl: r.control,
|
|
1926
1927
|
cardBindingsById: void 0
|
|
1927
1928
|
};
|
|
1928
|
-
const x = (
|
|
1929
|
+
const x = (k == null ? void 0 : k[r.control.id]) || [], b = Ke({
|
|
1929
1930
|
controlType: r.control.type,
|
|
1930
1931
|
participants: f || [],
|
|
1931
1932
|
selectedCardIds: r.nextSelectedCardIds
|
|
1932
|
-
}), L =
|
|
1933
|
+
}), L = pa({
|
|
1933
1934
|
control: r.control,
|
|
1934
1935
|
choices: b.choices
|
|
1935
1936
|
}), R = Object.fromEntries(
|
|
1936
|
-
x.filter((
|
|
1937
|
+
x.filter((M) => !r.nextSelectedCardIds.includes(M)).map((M) => [M, void 0])
|
|
1937
1938
|
);
|
|
1938
1939
|
return r.nextSelectedCardIds.length > 0 && L.source.kind === "manual" && L.source.options.length > 0 && Object.assign(
|
|
1939
1940
|
R,
|
|
1940
|
-
|
|
1941
|
+
Tt({
|
|
1941
1942
|
control: L,
|
|
1942
1943
|
participants: f || [],
|
|
1943
1944
|
selectedCardIds: r.nextSelectedCardIds,
|
|
@@ -1947,12 +1948,12 @@ function Sr({
|
|
|
1947
1948
|
nextControl: L,
|
|
1948
1949
|
cardBindingsById: R
|
|
1949
1950
|
};
|
|
1950
|
-
},
|
|
1951
|
+
}, j = ne(
|
|
1951
1952
|
(r, x = o, b = { type: "update" }) => {
|
|
1952
1953
|
const L = r.map((R) => (Qe({
|
|
1953
1954
|
control: R,
|
|
1954
1955
|
defaultValues: x
|
|
1955
|
-
}),
|
|
1956
|
+
}), aa(
|
|
1956
1957
|
R
|
|
1957
1958
|
)));
|
|
1958
1959
|
u(L, x, b);
|
|
@@ -1960,64 +1961,64 @@ function Sr({
|
|
|
1960
1961
|
[o, u]
|
|
1961
1962
|
), ee = (r, x) => {
|
|
1962
1963
|
const b = n.find(
|
|
1963
|
-
(
|
|
1964
|
+
(K) => K.id === r
|
|
1964
1965
|
);
|
|
1965
|
-
let L = n.map((
|
|
1966
|
+
let L = n.map((K) => K.id !== r ? K : x(K));
|
|
1966
1967
|
const R = L.find(
|
|
1967
|
-
(
|
|
1968
|
+
(K) => K.id === r
|
|
1968
1969
|
);
|
|
1969
|
-
let
|
|
1970
|
-
if (R && (!b ||
|
|
1971
|
-
const
|
|
1970
|
+
let M, F;
|
|
1971
|
+
if (R && (!b || ua({ control: b }, { control: R })) && e === "dashboard" && (R.type === "field_selector" || R.type === "metric_selector")) {
|
|
1972
|
+
const K = (k == null ? void 0 : k[R.id]) || [], pe = B({
|
|
1972
1973
|
control: R,
|
|
1973
|
-
nextSelectedCardIds:
|
|
1974
|
+
nextSelectedCardIds: K
|
|
1974
1975
|
});
|
|
1975
1976
|
L = L.map(
|
|
1976
1977
|
(ie) => ie.id === r ? pe.nextControl : ie
|
|
1977
|
-
),
|
|
1978
|
-
} else if (b && (!R || !
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
|
|
1978
|
+
), M = pe.cardBindingsById, F = [R.id];
|
|
1979
|
+
} else if (b && (!R || !ma(R.type)) && e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector")) {
|
|
1980
|
+
const K = (k == null ? void 0 : k[b.id]) || [];
|
|
1981
|
+
M = Object.fromEntries(
|
|
1982
|
+
K.map((pe) => [pe, void 0])
|
|
1982
1983
|
), F = [b.id];
|
|
1983
1984
|
}
|
|
1984
|
-
const
|
|
1985
|
-
(
|
|
1985
|
+
const W = L.find(
|
|
1986
|
+
(K) => K.id === r
|
|
1986
1987
|
);
|
|
1987
|
-
let
|
|
1988
|
-
if (b &&
|
|
1989
|
-
const
|
|
1988
|
+
let Z = o;
|
|
1989
|
+
if (b && W) {
|
|
1990
|
+
const K = Qe({
|
|
1990
1991
|
control: b,
|
|
1991
1992
|
defaultValues: o
|
|
1992
1993
|
});
|
|
1993
|
-
b.source.kind === "manual" &&
|
|
1994
|
-
const pe =
|
|
1994
|
+
b.source.kind === "manual" && W.source.kind === "sql_query" && ($.current[r] = K);
|
|
1995
|
+
const pe = K === void 0 && b.source.kind === "sql_query" && W.source.kind === "manual" ? $.current[r] : K, ie = It({
|
|
1995
1996
|
previousControl: b,
|
|
1996
|
-
nextControl:
|
|
1997
|
+
nextControl: W,
|
|
1997
1998
|
currentDefaultValue: pe
|
|
1998
1999
|
});
|
|
1999
|
-
|
|
2000
|
-
(bt) => bt.id === r ? { ...
|
|
2000
|
+
W.source.kind === "manual" && ($.current[r] = ie), o && (Z = { ...o }, ie === void 0 ? delete Z[r] : Z[r] = ie), L = L.map(
|
|
2001
|
+
(bt) => bt.id === r ? { ...W, defaultValue: ie } : bt
|
|
2001
2002
|
);
|
|
2002
2003
|
}
|
|
2003
|
-
|
|
2004
|
+
j(L, Z, {
|
|
2004
2005
|
type: "update",
|
|
2005
|
-
cardBindingsById:
|
|
2006
|
+
cardBindingsById: M,
|
|
2006
2007
|
affectedBindingControlIds: F
|
|
2007
2008
|
});
|
|
2008
2009
|
}, te = (r, x) => {
|
|
2009
2010
|
if (!x.trim())
|
|
2010
2011
|
return;
|
|
2011
|
-
const b =
|
|
2012
|
-
if (b === r ||
|
|
2013
|
-
(
|
|
2012
|
+
const b = fa(x);
|
|
2013
|
+
if (b === r || V.has(b) || n.some(
|
|
2014
|
+
(M) => M.id === b && M.id !== r
|
|
2014
2015
|
))
|
|
2015
2016
|
return;
|
|
2016
2017
|
const L = n.map(
|
|
2017
|
-
(
|
|
2018
|
+
(M) => M.id === r ? { ...M, id: b } : M
|
|
2018
2019
|
);
|
|
2019
2020
|
if (!o) {
|
|
2020
|
-
|
|
2021
|
+
j(L, void 0, {
|
|
2021
2022
|
type: "rename",
|
|
2022
2023
|
oldId: r,
|
|
2023
2024
|
newId: b
|
|
@@ -2025,7 +2026,7 @@ function Sr({
|
|
|
2025
2026
|
return;
|
|
2026
2027
|
}
|
|
2027
2028
|
const R = { ...o };
|
|
2028
|
-
Object.prototype.hasOwnProperty.call(R, r) && (R[b] = R[r], delete R[r]),
|
|
2029
|
+
Object.prototype.hasOwnProperty.call(R, r) && (R[b] = R[r], delete R[r]), j(L, R, {
|
|
2029
2030
|
type: "rename",
|
|
2030
2031
|
oldId: r,
|
|
2031
2032
|
newId: b
|
|
@@ -2033,27 +2034,27 @@ function Sr({
|
|
|
2033
2034
|
}, Be = (r) => {
|
|
2034
2035
|
const x = n.filter((L) => L.id !== r);
|
|
2035
2036
|
if (!o) {
|
|
2036
|
-
|
|
2037
|
+
j(x, void 0, { type: "remove", controlId: r });
|
|
2037
2038
|
return;
|
|
2038
2039
|
}
|
|
2039
2040
|
const b = { ...o };
|
|
2040
|
-
delete b[r],
|
|
2041
|
+
delete b[r], j(x, b, { type: "remove", controlId: r });
|
|
2041
2042
|
}, We = ne(() => {
|
|
2042
|
-
|
|
2043
|
+
D.current = void 0, T({
|
|
2043
2044
|
step: 1,
|
|
2044
|
-
control:
|
|
2045
|
-
}), X(null),
|
|
2046
|
-
}, [n,
|
|
2047
|
-
|
|
2045
|
+
control: Ae(e, n, Array.from(V))
|
|
2046
|
+
}), X(null), I(null);
|
|
2047
|
+
}, [n, V, e]), oe = (r) => {
|
|
2048
|
+
T(
|
|
2048
2049
|
(x) => x && (() => {
|
|
2049
2050
|
const b = r(x.control);
|
|
2050
|
-
x.control.source.kind === "manual" && b.source.kind === "sql_query" && (
|
|
2051
|
-
const L = x.defaultValue === void 0 && x.control.source.kind === "sql_query" && b.source.kind === "manual" ?
|
|
2051
|
+
x.control.source.kind === "manual" && b.source.kind === "sql_query" && (D.current = x.defaultValue);
|
|
2052
|
+
const L = x.defaultValue === void 0 && x.control.source.kind === "sql_query" && b.source.kind === "manual" ? D.current : x.defaultValue, R = It({
|
|
2052
2053
|
previousControl: x.control,
|
|
2053
2054
|
nextControl: b,
|
|
2054
2055
|
currentDefaultValue: L
|
|
2055
2056
|
});
|
|
2056
|
-
return b.source.kind === "manual" && (
|
|
2057
|
+
return b.source.kind === "manual" && (D.current = R), {
|
|
2057
2058
|
...x,
|
|
2058
2059
|
control: b,
|
|
2059
2060
|
defaultValue: R
|
|
@@ -2061,8 +2062,8 @@ function Sr({
|
|
|
2061
2062
|
})()
|
|
2062
2063
|
);
|
|
2063
2064
|
}, Te = (r) => {
|
|
2064
|
-
|
|
2065
|
-
(x) => x && (x.control.source.kind === "manual" && (
|
|
2065
|
+
T(
|
|
2066
|
+
(x) => x && (x.control.source.kind === "manual" && (D.current = r), {
|
|
2066
2067
|
...x,
|
|
2067
2068
|
defaultValue: r
|
|
2068
2069
|
})
|
|
@@ -2070,8 +2071,8 @@ function Sr({
|
|
|
2070
2071
|
}, ue = (() => {
|
|
2071
2072
|
if (!p)
|
|
2072
2073
|
return !1;
|
|
2073
|
-
if (p.step === 2 &&
|
|
2074
|
-
return (p.selectedCardIds || []).length > 0 &&
|
|
2074
|
+
if (p.step === 2 && w(p.control.type))
|
|
2075
|
+
return (p.selectedCardIds || []).length > 0 && ra({
|
|
2075
2076
|
participants: f || [],
|
|
2076
2077
|
selectedCardIds: p.selectedCardIds || [],
|
|
2077
2078
|
control: p.control,
|
|
@@ -2079,8 +2080,8 @@ function Sr({
|
|
|
2079
2080
|
});
|
|
2080
2081
|
if (p.step !== 2 && p.step !== 3 || !p.control.label.trim())
|
|
2081
2082
|
return !1;
|
|
2082
|
-
const x = p.control.source.kind === "sql_query" ? p.control :
|
|
2083
|
-
if (x.source.kind === "manual" && (
|
|
2083
|
+
const x = p.control.source.kind === "sql_query" ? p.control : St(p.control);
|
|
2084
|
+
if (x.source.kind === "manual" && (sa(x) && x.source.options.length === 0 || x.source.options.some(
|
|
2084
2085
|
(L) => L.label.trim().length === 0 || L.value.trim().length === 0
|
|
2085
2086
|
)))
|
|
2086
2087
|
return !1;
|
|
@@ -2088,22 +2089,22 @@ function Sr({
|
|
|
2088
2089
|
const { connectionId: b, sql: L, valueColumn: R } = x.source;
|
|
2089
2090
|
return b.trim().length > 0 && L.trim().length > 0 && R.trim().length > 0;
|
|
2090
2091
|
}
|
|
2091
|
-
return
|
|
2092
|
+
return oa(
|
|
2092
2093
|
Fe(x, p.defaultValue)
|
|
2093
2094
|
);
|
|
2094
2095
|
})(), Ce = () => {
|
|
2095
|
-
var
|
|
2096
|
+
var M;
|
|
2096
2097
|
if (!p)
|
|
2097
2098
|
return;
|
|
2098
|
-
const r =
|
|
2099
|
+
const r = St(p.control), x = ca({
|
|
2099
2100
|
label: r.label,
|
|
2100
2101
|
fallbackId: r.id,
|
|
2101
2102
|
existingControls: n,
|
|
2102
|
-
reservedIds: Array.from(
|
|
2103
|
+
reservedIds: Array.from(V)
|
|
2103
2104
|
}), b = {
|
|
2104
2105
|
...r,
|
|
2105
2106
|
id: x
|
|
2106
|
-
}, L = e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector") && ((
|
|
2107
|
+
}, L = e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector") && ((M = p.selectedCardIds) != null && M.length) ? Tt({
|
|
2107
2108
|
control: b,
|
|
2108
2109
|
participants: f || [],
|
|
2109
2110
|
selectedCardIds: p.selectedCardIds,
|
|
@@ -2112,7 +2113,7 @@ function Sr({
|
|
|
2112
2113
|
b,
|
|
2113
2114
|
p.defaultValue
|
|
2114
2115
|
);
|
|
2115
|
-
|
|
2116
|
+
T({
|
|
2116
2117
|
step: e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector") ? 4 : 3,
|
|
2117
2118
|
control: b,
|
|
2118
2119
|
defaultValue: R,
|
|
@@ -2122,10 +2123,10 @@ function Sr({
|
|
|
2122
2123
|
cardBindingsById: L
|
|
2123
2124
|
});
|
|
2124
2125
|
}, we = ne(() => {
|
|
2125
|
-
|
|
2126
|
+
T(null);
|
|
2126
2127
|
}, []), ke = ne(() => {
|
|
2127
2128
|
if (!(p != null && p.createdControlId)) {
|
|
2128
|
-
|
|
2129
|
+
T(null);
|
|
2129
2130
|
return;
|
|
2130
2131
|
}
|
|
2131
2132
|
const r = p.control, x = p.createdControlId, b = Fe(
|
|
@@ -2134,7 +2135,7 @@ function Sr({
|
|
|
2134
2135
|
);
|
|
2135
2136
|
if (o) {
|
|
2136
2137
|
const L = { ...o };
|
|
2137
|
-
b === void 0 ? delete L[x] : L[x] = b,
|
|
2138
|
+
b === void 0 ? delete L[x] : L[x] = b, j(
|
|
2138
2139
|
[
|
|
2139
2140
|
...n,
|
|
2140
2141
|
{
|
|
@@ -2149,7 +2150,7 @@ function Sr({
|
|
|
2149
2150
|
}
|
|
2150
2151
|
);
|
|
2151
2152
|
} else
|
|
2152
|
-
|
|
2153
|
+
j(
|
|
2153
2154
|
[
|
|
2154
2155
|
...n,
|
|
2155
2156
|
{
|
|
@@ -2163,12 +2164,12 @@ function Sr({
|
|
|
2163
2164
|
cardBindingsById: p.cardBindingsById
|
|
2164
2165
|
}
|
|
2165
2166
|
);
|
|
2166
|
-
X(x),
|
|
2167
|
-
}, [n, p, o,
|
|
2167
|
+
X(x), T(null), S == null || S();
|
|
2168
|
+
}, [n, p, o, j, S]), xt = p ? w(p.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Se = p != null && p.createdControlId ? `[[param.${p.createdControlId}]]` : p ? `[[param.${ia(p.control.label) || p.control.id}]]` : "", me = Dt({
|
|
2168
2169
|
controls: n,
|
|
2169
2170
|
defaultValues: o
|
|
2170
|
-
}),
|
|
2171
|
-
controls:
|
|
2171
|
+
}), A = p ? [...n, p.control] : n, ae = p ? Dt({
|
|
2172
|
+
controls: A,
|
|
2172
2173
|
defaultValues: o,
|
|
2173
2174
|
overrides: [
|
|
2174
2175
|
{
|
|
@@ -2180,7 +2181,7 @@ function Sr({
|
|
|
2180
2181
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
2181
2182
|
p ? /* @__PURE__ */ l("div", { className: "space-y-4 pb-1", children: [
|
|
2182
2183
|
/* @__PURE__ */ t(
|
|
2183
|
-
|
|
2184
|
+
Wa,
|
|
2184
2185
|
{
|
|
2185
2186
|
currentStep: p.step,
|
|
2186
2187
|
labels: xt
|
|
@@ -2197,29 +2198,29 @@ function Sr({
|
|
|
2197
2198
|
// keeping the shared definitions for existing controls.
|
|
2198
2199
|
"date",
|
|
2199
2200
|
"text"
|
|
2200
|
-
]), b =
|
|
2201
|
-
(
|
|
2202
|
-
), L =
|
|
2203
|
-
(
|
|
2204
|
-
), R = (
|
|
2201
|
+
]), b = h.filter(
|
|
2202
|
+
(M) => !r.has(M.value) && !x.has(M.value)
|
|
2203
|
+
), L = h.filter(
|
|
2204
|
+
(M) => r.has(M.value)
|
|
2205
|
+
), R = (M) => /* @__PURE__ */ l(
|
|
2205
2206
|
"button",
|
|
2206
2207
|
{
|
|
2207
2208
|
type: "button",
|
|
2208
2209
|
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",
|
|
2209
|
-
onClick: () =>
|
|
2210
|
-
|
|
2210
|
+
onClick: () => T(
|
|
2211
|
+
Pa({
|
|
2211
2212
|
scope: e,
|
|
2212
2213
|
existingControls: n,
|
|
2213
|
-
reservedIds: Array.from(
|
|
2214
|
-
type:
|
|
2214
|
+
reservedIds: Array.from(V),
|
|
2215
|
+
type: M.value
|
|
2215
2216
|
})
|
|
2216
2217
|
),
|
|
2217
2218
|
children: [
|
|
2218
|
-
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children:
|
|
2219
|
-
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children:
|
|
2219
|
+
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: M.label }),
|
|
2220
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: M.description })
|
|
2220
2221
|
]
|
|
2221
2222
|
},
|
|
2222
|
-
|
|
2223
|
+
M.value
|
|
2223
2224
|
);
|
|
2224
2225
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
2225
2226
|
e === "card" && (y == null ? void 0 : y.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,
|
|
@@ -2248,10 +2249,10 @@ function Sr({
|
|
|
2248
2249
|
)
|
|
2249
2250
|
] });
|
|
2250
2251
|
})(),
|
|
2251
|
-
p.step === 2 &&
|
|
2252
|
+
p.step === 2 && w(p.control.type) && /* @__PURE__ */ l("div", { className: "space-y-3", children: [
|
|
2252
2253
|
/* @__PURE__ */ l("div", { className: "space-y-3", children: [
|
|
2253
2254
|
/* @__PURE__ */ t(
|
|
2254
|
-
|
|
2255
|
+
ln,
|
|
2255
2256
|
{
|
|
2256
2257
|
control: p.control,
|
|
2257
2258
|
onChange: (r) => oe((x) => ({
|
|
@@ -2262,7 +2263,7 @@ function Sr({
|
|
|
2262
2263
|
),
|
|
2263
2264
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
|
|
2264
2265
|
] }),
|
|
2265
|
-
|
|
2266
|
+
H.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2.5 text-[12px] 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-1 rounded-control border border-border/60 bg-background p-2", children: H.map((r) => {
|
|
2266
2267
|
const x = (p.selectedCardIds || []).includes(r.cardId);
|
|
2267
2268
|
return /* @__PURE__ */ l(
|
|
2268
2269
|
"label",
|
|
@@ -2273,7 +2274,7 @@ function Sr({
|
|
|
2273
2274
|
Ue,
|
|
2274
2275
|
{
|
|
2275
2276
|
checked: x,
|
|
2276
|
-
onCheckedChange: (b) =>
|
|
2277
|
+
onCheckedChange: (b) => T(
|
|
2277
2278
|
(L) => L && {
|
|
2278
2279
|
...L,
|
|
2279
2280
|
selectedCardIds: b === !0 ? [
|
|
@@ -2298,11 +2299,11 @@ function Sr({
|
|
|
2298
2299
|
/* @__PURE__ */ t(
|
|
2299
2300
|
yt,
|
|
2300
2301
|
{
|
|
2301
|
-
participants:
|
|
2302
|
+
participants: H,
|
|
2302
2303
|
selectedCardIds: p.selectedCardIds || [],
|
|
2303
2304
|
control: p.control,
|
|
2304
2305
|
selected: p.matrixTargetIds,
|
|
2305
|
-
onChange: (r, x) =>
|
|
2306
|
+
onChange: (r, x) => T((b) => b && { ...b, matrixTargetIds: { ...b.matrixTargetIds, [r]: x } })
|
|
2306
2307
|
}
|
|
2307
2308
|
),
|
|
2308
2309
|
/* @__PURE__ */ t(
|
|
@@ -2314,7 +2315,7 @@ function Sr({
|
|
|
2314
2315
|
type: "button",
|
|
2315
2316
|
variant: "outline",
|
|
2316
2317
|
size: "xs",
|
|
2317
|
-
onClick: () =>
|
|
2318
|
+
onClick: () => T(
|
|
2318
2319
|
(r) => r && {
|
|
2319
2320
|
...r,
|
|
2320
2321
|
step: 1,
|
|
@@ -2329,7 +2330,7 @@ function Sr({
|
|
|
2329
2330
|
{
|
|
2330
2331
|
type: "button",
|
|
2331
2332
|
size: "xs",
|
|
2332
|
-
onClick: () =>
|
|
2333
|
+
onClick: () => T(
|
|
2333
2334
|
(r) => r && {
|
|
2334
2335
|
...r,
|
|
2335
2336
|
step: 3
|
|
@@ -2342,14 +2343,14 @@ function Sr({
|
|
|
2342
2343
|
}
|
|
2343
2344
|
)
|
|
2344
2345
|
] }),
|
|
2345
|
-
p.step === 2 && !
|
|
2346
|
-
|
|
2346
|
+
p.step === 2 && !w(p.control.type) && /* @__PURE__ */ t(
|
|
2347
|
+
Lt,
|
|
2347
2348
|
{
|
|
2348
2349
|
control: p.control,
|
|
2349
2350
|
defaultValue: p.defaultValue,
|
|
2350
|
-
availableFieldChoices:
|
|
2351
|
-
availableMetricChoices:
|
|
2352
|
-
previewControlDefinitions:
|
|
2351
|
+
availableFieldChoices: O.fields,
|
|
2352
|
+
availableMetricChoices: O.metrics,
|
|
2353
|
+
previewControlDefinitions: A,
|
|
2353
2354
|
previewControlValues: ae,
|
|
2354
2355
|
onControlChange: (r) => oe(() => r),
|
|
2355
2356
|
onLabelChange: (r) => oe((x) => ({
|
|
@@ -2357,7 +2358,7 @@ function Sr({
|
|
|
2357
2358
|
label: r
|
|
2358
2359
|
})),
|
|
2359
2360
|
onDefaultValueChange: Te,
|
|
2360
|
-
onBack: () =>
|
|
2361
|
+
onBack: () => T(
|
|
2361
2362
|
(r) => r && {
|
|
2362
2363
|
...r,
|
|
2363
2364
|
step: 1
|
|
@@ -2367,14 +2368,14 @@ function Sr({
|
|
|
2367
2368
|
nextDisabled: !ue
|
|
2368
2369
|
}
|
|
2369
2370
|
),
|
|
2370
|
-
p.step === 3 &&
|
|
2371
|
-
|
|
2371
|
+
p.step === 3 && w(p.control.type) && /* @__PURE__ */ t(
|
|
2372
|
+
Lt,
|
|
2372
2373
|
{
|
|
2373
2374
|
control: p.control,
|
|
2374
2375
|
defaultValue: p.defaultValue,
|
|
2375
|
-
availableFieldChoices:
|
|
2376
|
-
availableMetricChoices:
|
|
2377
|
-
previewControlDefinitions:
|
|
2376
|
+
availableFieldChoices: O.fields,
|
|
2377
|
+
availableMetricChoices: O.metrics,
|
|
2378
|
+
previewControlDefinitions: A,
|
|
2378
2379
|
previewControlValues: ae,
|
|
2379
2380
|
onControlChange: (r) => oe(() => r),
|
|
2380
2381
|
onLabelChange: (r) => oe((x) => ({
|
|
@@ -2382,7 +2383,7 @@ function Sr({
|
|
|
2382
2383
|
label: r
|
|
2383
2384
|
})),
|
|
2384
2385
|
onDefaultValueChange: Te,
|
|
2385
|
-
onBack: () =>
|
|
2386
|
+
onBack: () => T(
|
|
2386
2387
|
(r) => r && {
|
|
2387
2388
|
...r,
|
|
2388
2389
|
step: 2
|
|
@@ -2392,7 +2393,7 @@ function Sr({
|
|
|
2392
2393
|
nextDisabled: !ue
|
|
2393
2394
|
}
|
|
2394
2395
|
),
|
|
2395
|
-
p.step === 3 && !
|
|
2396
|
+
p.step === 3 && !w(p.control.type) && /* @__PURE__ */ t(
|
|
2396
2397
|
At,
|
|
2397
2398
|
{
|
|
2398
2399
|
control: p.control,
|
|
@@ -2406,7 +2407,7 @@ function Sr({
|
|
|
2406
2407
|
"to choose what this control changes."
|
|
2407
2408
|
] }),
|
|
2408
2409
|
sqlDescription: "Reference this control directly in the SQL editor.",
|
|
2409
|
-
onBack: () =>
|
|
2410
|
+
onBack: () => T(
|
|
2410
2411
|
(r) => r && {
|
|
2411
2412
|
...r,
|
|
2412
2413
|
step: 2
|
|
@@ -2416,7 +2417,7 @@ function Sr({
|
|
|
2416
2417
|
onDone: ke
|
|
2417
2418
|
}
|
|
2418
2419
|
),
|
|
2419
|
-
p.step === 4 &&
|
|
2420
|
+
p.step === 4 && w(p.control.type) && /* @__PURE__ */ t(
|
|
2420
2421
|
At,
|
|
2421
2422
|
{
|
|
2422
2423
|
control: p.control,
|
|
@@ -2430,7 +2431,7 @@ function Sr({
|
|
|
2430
2431
|
] }),
|
|
2431
2432
|
explorerContent: /* @__PURE__ */ t(fe, { children: "Selected cards have been set up to respond to this control automatically." }),
|
|
2432
2433
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
2433
|
-
onBack: () =>
|
|
2434
|
+
onBack: () => T(
|
|
2434
2435
|
(r) => r && {
|
|
2435
2436
|
...r,
|
|
2436
2437
|
step: 3
|
|
@@ -2446,7 +2447,7 @@ function Sr({
|
|
|
2446
2447
|
const x = z(r), b = i == null ? void 0 : i[r.id], L = Qe({
|
|
2447
2448
|
control: r,
|
|
2448
2449
|
defaultValues: o
|
|
2449
|
-
}), R =
|
|
2450
|
+
}), R = U === r.id, M = "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";
|
|
2450
2451
|
return /* @__PURE__ */ l(
|
|
2451
2452
|
"div",
|
|
2452
2453
|
{
|
|
@@ -2466,8 +2467,8 @@ function Sr({
|
|
|
2466
2467
|
/* @__PURE__ */ l("div", { className: "min-w-0", children: [
|
|
2467
2468
|
/* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
2468
2469
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: r.label || "Untitled control" }),
|
|
2469
|
-
/* @__PURE__ */ t("span", { className:
|
|
2470
|
-
/* @__PURE__ */ t("span", { className:
|
|
2470
|
+
/* @__PURE__ */ t("span", { className: M, children: Qt(r.type).label }),
|
|
2471
|
+
/* @__PURE__ */ t("span", { className: M, children: Pt(e, r.placement) })
|
|
2471
2472
|
] }),
|
|
2472
2473
|
/* @__PURE__ */ l("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
|
|
2473
2474
|
Ht(r),
|
|
@@ -2486,7 +2487,7 @@ function Sr({
|
|
|
2486
2487
|
className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
|
|
2487
2488
|
onClick: () => Be(r.id),
|
|
2488
2489
|
"aria-label": `Remove ${r.label}`,
|
|
2489
|
-
children: /* @__PURE__ */ t(
|
|
2490
|
+
children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
|
|
2490
2491
|
}
|
|
2491
2492
|
)
|
|
2492
2493
|
] }),
|
|
@@ -2500,8 +2501,8 @@ function Sr({
|
|
|
2500
2501
|
size: "xs",
|
|
2501
2502
|
value: r.label,
|
|
2502
2503
|
placeholder: "Control label",
|
|
2503
|
-
onChange: (F) => ee(r.id, (
|
|
2504
|
-
...
|
|
2504
|
+
onChange: (F) => ee(r.id, (W) => ({
|
|
2505
|
+
...W,
|
|
2505
2506
|
label: F.target.value
|
|
2506
2507
|
}))
|
|
2507
2508
|
}
|
|
@@ -2514,17 +2515,17 @@ function Sr({
|
|
|
2514
2515
|
{
|
|
2515
2516
|
value: r.type,
|
|
2516
2517
|
onValueChange: (F) => {
|
|
2517
|
-
const
|
|
2518
|
+
const W = Yt({
|
|
2518
2519
|
controls: n,
|
|
2519
2520
|
controlId: r.id,
|
|
2520
2521
|
nextType: F,
|
|
2521
2522
|
defaultValues: o
|
|
2522
2523
|
});
|
|
2523
|
-
|
|
2524
|
+
j(W.controls, W.defaultValues);
|
|
2524
2525
|
},
|
|
2525
2526
|
children: [
|
|
2526
2527
|
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
|
|
2527
|
-
/* @__PURE__ */ t(ve, { children:
|
|
2528
|
+
/* @__PURE__ */ t(ve, { children: E(r.type).map(
|
|
2528
2529
|
(F) => /* @__PURE__ */ t(
|
|
2529
2530
|
re,
|
|
2530
2531
|
{
|
|
@@ -2543,25 +2544,25 @@ function Sr({
|
|
|
2543
2544
|
/* @__PURE__ */ l(
|
|
2544
2545
|
ge,
|
|
2545
2546
|
{
|
|
2546
|
-
value: r.placement ||
|
|
2547
|
-
onValueChange: (F) => ee(r.id, (
|
|
2548
|
-
...
|
|
2547
|
+
value: r.placement || Q,
|
|
2548
|
+
onValueChange: (F) => ee(r.id, (W) => ({
|
|
2549
|
+
...W,
|
|
2549
2550
|
placement: F
|
|
2550
2551
|
})),
|
|
2551
2552
|
children: [
|
|
2552
2553
|
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
|
|
2553
|
-
/* @__PURE__ */ t(ve, { children:
|
|
2554
|
+
/* @__PURE__ */ t(ve, { children: _.map((F) => /* @__PURE__ */ t(re, { value: F.value, children: F.label }, F.value)) })
|
|
2554
2555
|
]
|
|
2555
2556
|
}
|
|
2556
2557
|
)
|
|
2557
2558
|
] })
|
|
2558
2559
|
] }),
|
|
2559
|
-
|
|
2560
|
+
w(r.type) ? /* @__PURE__ */ l(fe, { children: [
|
|
2560
2561
|
/* @__PURE__ */ t(
|
|
2561
|
-
|
|
2562
|
+
Fn,
|
|
2562
2563
|
{
|
|
2563
2564
|
type: r.type,
|
|
2564
|
-
participants:
|
|
2565
|
+
participants: kt(
|
|
2565
2566
|
f || [],
|
|
2566
2567
|
r.type
|
|
2567
2568
|
).map((F) => ({
|
|
@@ -2569,17 +2570,17 @@ function Sr({
|
|
|
2569
2570
|
title: F.title,
|
|
2570
2571
|
choiceCount: r.type === "field_selector" ? F.fieldChoices.length : F.metricChoices.length
|
|
2571
2572
|
})),
|
|
2572
|
-
selectedCardIds: (
|
|
2573
|
+
selectedCardIds: (k == null ? void 0 : k[r.id]) || [],
|
|
2573
2574
|
onChange: (F) => {
|
|
2574
|
-
const
|
|
2575
|
+
const W = B({
|
|
2575
2576
|
control: r,
|
|
2576
2577
|
nextSelectedCardIds: F
|
|
2577
|
-
}),
|
|
2578
|
-
(
|
|
2578
|
+
}), Z = n.map(
|
|
2579
|
+
(K) => K.id === r.id ? W.nextControl : K
|
|
2579
2580
|
);
|
|
2580
|
-
|
|
2581
|
+
j(Z, o, {
|
|
2581
2582
|
type: "update",
|
|
2582
|
-
cardBindingsById:
|
|
2583
|
+
cardBindingsById: W.cardBindingsById
|
|
2583
2584
|
});
|
|
2584
2585
|
}
|
|
2585
2586
|
}
|
|
@@ -2588,25 +2589,25 @@ function Sr({
|
|
|
2588
2589
|
yt,
|
|
2589
2590
|
{
|
|
2590
2591
|
participants: f || [],
|
|
2591
|
-
selectedCardIds: (
|
|
2592
|
+
selectedCardIds: (k == null ? void 0 : k[r.id]) || [],
|
|
2592
2593
|
control: r,
|
|
2593
|
-
onChange: (F,
|
|
2594
|
-
const
|
|
2594
|
+
onChange: (F, W) => {
|
|
2595
|
+
const Z = B({
|
|
2595
2596
|
control: r,
|
|
2596
|
-
nextSelectedCardIds: (
|
|
2597
|
-
matrixTargetIds: { [F]:
|
|
2597
|
+
nextSelectedCardIds: (k == null ? void 0 : k[r.id]) || [],
|
|
2598
|
+
matrixTargetIds: { [F]: W }
|
|
2598
2599
|
});
|
|
2599
|
-
|
|
2600
|
-
n.map((
|
|
2600
|
+
j(
|
|
2601
|
+
n.map((K) => K.id === r.id ? Z.nextControl : K),
|
|
2601
2602
|
o,
|
|
2602
|
-
{ type: "update", cardBindingsById:
|
|
2603
|
+
{ type: "update", cardBindingsById: Z.cardBindingsById }
|
|
2603
2604
|
);
|
|
2604
2605
|
}
|
|
2605
2606
|
}
|
|
2606
2607
|
)
|
|
2607
2608
|
] }) : null,
|
|
2608
2609
|
/* @__PURE__ */ t(
|
|
2609
|
-
|
|
2610
|
+
Mt,
|
|
2610
2611
|
{
|
|
2611
2612
|
control: r,
|
|
2612
2613
|
availableFieldChoices: x.fields,
|
|
@@ -2618,7 +2619,7 @@ function Sr({
|
|
|
2618
2619
|
}
|
|
2619
2620
|
),
|
|
2620
2621
|
r.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
|
|
2621
|
-
|
|
2622
|
+
qt,
|
|
2622
2623
|
{
|
|
2623
2624
|
control: r,
|
|
2624
2625
|
value: L,
|
|
@@ -2627,25 +2628,25 @@ function Sr({
|
|
|
2627
2628
|
previewControlDefinitions: n,
|
|
2628
2629
|
previewControlValues: me,
|
|
2629
2630
|
onChange: (F) => {
|
|
2630
|
-
const
|
|
2631
|
-
(
|
|
2631
|
+
const W = n.map(
|
|
2632
|
+
(Z) => Z.id === r.id ? { ...Z, defaultValue: F } : Z
|
|
2632
2633
|
);
|
|
2633
|
-
if (r.source.kind === "manual" && (
|
|
2634
|
-
const
|
|
2635
|
-
F === void 0 ? delete
|
|
2634
|
+
if (r.source.kind === "manual" && ($.current[r.id] = F), o) {
|
|
2635
|
+
const Z = { ...o };
|
|
2636
|
+
F === void 0 ? delete Z[r.id] : Z[r.id] = F, j(W, Z);
|
|
2636
2637
|
return;
|
|
2637
2638
|
}
|
|
2638
|
-
|
|
2639
|
+
j(W, void 0);
|
|
2639
2640
|
}
|
|
2640
2641
|
}
|
|
2641
2642
|
),
|
|
2642
2643
|
/* @__PURE__ */ l(
|
|
2643
|
-
|
|
2644
|
+
On,
|
|
2644
2645
|
{
|
|
2645
|
-
open:
|
|
2646
|
-
onOpenChange: (F) =>
|
|
2646
|
+
open: C === r.id,
|
|
2647
|
+
onOpenChange: (F) => I(F ? r.id : null),
|
|
2647
2648
|
children: [
|
|
2648
|
-
/* @__PURE__ */ t(
|
|
2649
|
+
/* @__PURE__ */ t(_n, { asChild: !0, children: /* @__PURE__ */ l(
|
|
2649
2650
|
G,
|
|
2650
2651
|
{
|
|
2651
2652
|
type: "button",
|
|
@@ -2653,17 +2654,17 @@ function Sr({
|
|
|
2653
2654
|
size: "xs",
|
|
2654
2655
|
className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
|
|
2655
2656
|
children: [
|
|
2656
|
-
|
|
2657
|
+
C === r.id ? /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Ie, { className: "h-3.5 w-3.5" }),
|
|
2657
2658
|
"Advanced"
|
|
2658
2659
|
]
|
|
2659
2660
|
}
|
|
2660
2661
|
) }),
|
|
2661
|
-
/* @__PURE__ */ l(
|
|
2662
|
+
/* @__PURE__ */ l(Vn, { className: "space-y-3 pt-2", children: [
|
|
2662
2663
|
/* @__PURE__ */ l("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
2663
2664
|
/* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
2664
2665
|
/* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
|
|
2665
2666
|
/* @__PURE__ */ t(
|
|
2666
|
-
|
|
2667
|
+
Rn,
|
|
2667
2668
|
{
|
|
2668
2669
|
controlId: r.id,
|
|
2669
2670
|
onCommit: (F) => te(r.id, F)
|
|
@@ -2677,13 +2678,13 @@ function Sr({
|
|
|
2677
2678
|
ge,
|
|
2678
2679
|
{
|
|
2679
2680
|
value: r.initialValueStrategy,
|
|
2680
|
-
onValueChange: (F) => ee(r.id, (
|
|
2681
|
-
...
|
|
2681
|
+
onValueChange: (F) => ee(r.id, (W) => ({
|
|
2682
|
+
...W,
|
|
2682
2683
|
initialValueStrategy: F
|
|
2683
2684
|
})),
|
|
2684
2685
|
children: [
|
|
2685
2686
|
/* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
|
|
2686
|
-
/* @__PURE__ */ t(ve, { children:
|
|
2687
|
+
/* @__PURE__ */ t(ve, { children: da.map((F) => /* @__PURE__ */ t(
|
|
2687
2688
|
re,
|
|
2688
2689
|
{
|
|
2689
2690
|
value: F.value,
|
|
@@ -2697,7 +2698,7 @@ function Sr({
|
|
|
2697
2698
|
] })
|
|
2698
2699
|
] }),
|
|
2699
2700
|
/* @__PURE__ */ t(
|
|
2700
|
-
|
|
2701
|
+
En,
|
|
2701
2702
|
{
|
|
2702
2703
|
control: r,
|
|
2703
2704
|
onChange: (F) => ee(r.id, () => F)
|
|
@@ -2728,15 +2729,15 @@ function Sr({
|
|
|
2728
2729
|
)
|
|
2729
2730
|
] });
|
|
2730
2731
|
}
|
|
2731
|
-
function
|
|
2732
|
+
function Fr(e) {
|
|
2732
2733
|
const {
|
|
2733
2734
|
open: n,
|
|
2734
2735
|
onOpenChange: a,
|
|
2735
2736
|
initialCreateFlowActive: o = !1,
|
|
2736
2737
|
dismissMode: u = "passive"
|
|
2737
|
-
} = e, d = n !== void 0, [c, i] =
|
|
2738
|
+
} = e, d = n !== void 0, [c, i] = Y(!1), [s, m] = Y(
|
|
2738
2739
|
o
|
|
2739
|
-
), f = d ? n : c,
|
|
2740
|
+
), f = d ? n : c, k = ne(
|
|
2740
2741
|
(N) => {
|
|
2741
2742
|
!N && s && u === "passive" || (d || i(N), N || m(!1), a == null || a(N));
|
|
2742
2743
|
},
|
|
@@ -2747,7 +2748,7 @@ function Dr(e) {
|
|
|
2747
2748
|
de(() => {
|
|
2748
2749
|
f || m(!1);
|
|
2749
2750
|
}, [f]);
|
|
2750
|
-
const
|
|
2751
|
+
const g = ne(
|
|
2751
2752
|
(N) => {
|
|
2752
2753
|
s && N.preventDefault();
|
|
2753
2754
|
},
|
|
@@ -2755,14 +2756,14 @@ function Dr(e) {
|
|
|
2755
2756
|
);
|
|
2756
2757
|
return {
|
|
2757
2758
|
forceClose: y,
|
|
2758
|
-
handleOpenChange:
|
|
2759
|
+
handleOpenChange: k,
|
|
2759
2760
|
isCreateFlowActive: s,
|
|
2760
|
-
preventPassiveDismissDuringCreate:
|
|
2761
|
+
preventPassiveDismissDuringCreate: g,
|
|
2761
2762
|
resolvedOpen: f,
|
|
2762
2763
|
setIsCreateFlowActive: m
|
|
2763
2764
|
};
|
|
2764
2765
|
}
|
|
2765
|
-
function
|
|
2766
|
+
function dn(e) {
|
|
2766
2767
|
const {
|
|
2767
2768
|
relativeMeta: n,
|
|
2768
2769
|
latestValue: a,
|
|
@@ -2771,26 +2772,26 @@ function sn(e) {
|
|
|
2771
2772
|
return o;
|
|
2772
2773
|
}
|
|
2773
2774
|
function ft(e, n) {
|
|
2774
|
-
const a =
|
|
2775
|
+
const a = dn(e);
|
|
2775
2776
|
return n.relativeMeta ? { ...a, value: n.value, relativeMeta: n.relativeMeta } : { ...a, value: n.value };
|
|
2776
2777
|
}
|
|
2777
|
-
function
|
|
2778
|
+
function Ha(e, n) {
|
|
2778
2779
|
const a = n === "in" || n === "not in" || n === "between" || n === "not between" ? [] : n === "isNull" || n === "isNotNull" ? null : "";
|
|
2779
2780
|
return ft({ ...e, operator: n }, { value: a });
|
|
2780
2781
|
}
|
|
2781
|
-
function
|
|
2782
|
+
function Ya(e, n) {
|
|
2782
2783
|
const a = qe(n.dataType) === "date";
|
|
2783
2784
|
return ft(
|
|
2784
2785
|
{ ...e, field: n, operator: a ? "between" : "=" },
|
|
2785
2786
|
{ value: "" }
|
|
2786
2787
|
);
|
|
2787
2788
|
}
|
|
2788
|
-
function
|
|
2789
|
+
function Za({
|
|
2789
2790
|
initialFilters: e,
|
|
2790
2791
|
availableFields: n,
|
|
2791
2792
|
onChange: a
|
|
2792
2793
|
} = {}) {
|
|
2793
|
-
const [o, u] =
|
|
2794
|
+
const [o, u] = Y(
|
|
2794
2795
|
e || {
|
|
2795
2796
|
id: `group-${Date.now()}`,
|
|
2796
2797
|
logicalOperator: "AND",
|
|
@@ -2798,11 +2799,11 @@ function Ka({
|
|
|
2798
2799
|
conditions: [],
|
|
2799
2800
|
groups: []
|
|
2800
2801
|
}
|
|
2801
|
-
), d = (
|
|
2802
|
-
u(
|
|
2802
|
+
), d = (T) => {
|
|
2803
|
+
u(T), a == null || a(T);
|
|
2803
2804
|
};
|
|
2804
|
-
se((
|
|
2805
|
-
const { filterableFields: c, isLoading: i } =
|
|
2805
|
+
se((T) => T.card.dataSource);
|
|
2806
|
+
const { filterableFields: c, isLoading: i } = Mn(), s = n || c || [], m = {
|
|
2806
2807
|
id: "default",
|
|
2807
2808
|
qualifiedFieldName: "default",
|
|
2808
2809
|
name: "default",
|
|
@@ -2811,37 +2812,37 @@ function Ka({
|
|
|
2811
2812
|
entityId: "default",
|
|
2812
2813
|
entityName: "Default",
|
|
2813
2814
|
entityType: "table"
|
|
2814
|
-
}, f = (
|
|
2815
|
-
const
|
|
2816
|
-
if (
|
|
2817
|
-
const v = s[0] || m,
|
|
2815
|
+
}, f = (T) => {
|
|
2816
|
+
const $ = (D) => {
|
|
2817
|
+
if (D.id === T) {
|
|
2818
|
+
const v = s[0] || m, h = qe(v.dataType) === "date";
|
|
2818
2819
|
return {
|
|
2819
|
-
...
|
|
2820
|
+
...D,
|
|
2820
2821
|
conditions: [
|
|
2821
|
-
...
|
|
2822
|
+
...D.conditions,
|
|
2822
2823
|
{
|
|
2823
2824
|
id: `condition-${Date.now()}`,
|
|
2824
2825
|
field: v,
|
|
2825
|
-
operator:
|
|
2826
|
-
value:
|
|
2826
|
+
operator: h ? "between" : "=",
|
|
2827
|
+
value: h ? [] : ""
|
|
2827
2828
|
}
|
|
2828
2829
|
]
|
|
2829
2830
|
};
|
|
2830
2831
|
}
|
|
2831
2832
|
return {
|
|
2832
|
-
...
|
|
2833
|
-
groups:
|
|
2833
|
+
...D,
|
|
2834
|
+
groups: D.groups.map($)
|
|
2834
2835
|
};
|
|
2835
2836
|
};
|
|
2836
|
-
d(
|
|
2837
|
-
},
|
|
2838
|
-
const
|
|
2839
|
-
if (
|
|
2840
|
-
const v = s[0] || m,
|
|
2837
|
+
d($(o));
|
|
2838
|
+
}, k = (T) => {
|
|
2839
|
+
const $ = (D) => {
|
|
2840
|
+
if (D.id === T) {
|
|
2841
|
+
const v = s[0] || m, h = qe(v.dataType) === "date";
|
|
2841
2842
|
return {
|
|
2842
|
-
...
|
|
2843
|
+
...D,
|
|
2843
2844
|
groups: [
|
|
2844
|
-
...
|
|
2845
|
+
...D.groups,
|
|
2845
2846
|
{
|
|
2846
2847
|
id: `group-${Date.now()}`,
|
|
2847
2848
|
logicalOperator: "AND",
|
|
@@ -2850,8 +2851,8 @@ function Ka({
|
|
|
2850
2851
|
{
|
|
2851
2852
|
id: `condition-${Date.now()}`,
|
|
2852
2853
|
field: v,
|
|
2853
|
-
operator:
|
|
2854
|
-
value:
|
|
2854
|
+
operator: h ? "between" : "=",
|
|
2855
|
+
value: h ? [] : ""
|
|
2855
2856
|
}
|
|
2856
2857
|
],
|
|
2857
2858
|
groups: []
|
|
@@ -2860,140 +2861,152 @@ function Ka({
|
|
|
2860
2861
|
};
|
|
2861
2862
|
}
|
|
2862
2863
|
return {
|
|
2863
|
-
...
|
|
2864
|
-
groups:
|
|
2864
|
+
...D,
|
|
2865
|
+
groups: D.groups.map($)
|
|
2865
2866
|
};
|
|
2866
2867
|
};
|
|
2867
|
-
d(
|
|
2868
|
-
}, y = (
|
|
2869
|
-
const
|
|
2868
|
+
d($(o));
|
|
2869
|
+
}, y = (T, $) => {
|
|
2870
|
+
const D = (v) => v.id === T ? {
|
|
2870
2871
|
...v,
|
|
2871
|
-
conditions: v.conditions.filter((
|
|
2872
|
+
conditions: v.conditions.filter((h) => h.id !== $)
|
|
2872
2873
|
} : {
|
|
2873
2874
|
...v,
|
|
2874
|
-
groups: v.groups.map(
|
|
2875
|
+
groups: v.groups.map(D)
|
|
2875
2876
|
};
|
|
2876
|
-
d(
|
|
2877
|
-
},
|
|
2878
|
-
const
|
|
2877
|
+
d(D(o));
|
|
2878
|
+
}, g = (T, $) => {
|
|
2879
|
+
const D = (v) => v.id === T ? {
|
|
2879
2880
|
...v,
|
|
2880
|
-
groups: v.groups.filter((
|
|
2881
|
+
groups: v.groups.filter((h) => h.id !== $)
|
|
2881
2882
|
} : {
|
|
2882
2883
|
...v,
|
|
2883
|
-
groups: v.groups.map(
|
|
2884
|
+
groups: v.groups.map(D)
|
|
2884
2885
|
};
|
|
2885
|
-
d(
|
|
2886
|
-
}, N = (
|
|
2887
|
-
const v = (
|
|
2888
|
-
...
|
|
2889
|
-
conditions:
|
|
2890
|
-
(
|
|
2886
|
+
d(D(o));
|
|
2887
|
+
}, N = (T, $, D) => {
|
|
2888
|
+
const v = (h) => h.id === T ? {
|
|
2889
|
+
...h,
|
|
2890
|
+
conditions: h.conditions.map(
|
|
2891
|
+
(E) => E.id === $ ? D(E) : E
|
|
2891
2892
|
)
|
|
2892
2893
|
} : {
|
|
2893
|
-
...
|
|
2894
|
-
groups:
|
|
2894
|
+
...h,
|
|
2895
|
+
groups: h.groups.map(v)
|
|
2895
2896
|
};
|
|
2896
2897
|
d(v(o));
|
|
2897
|
-
},
|
|
2898
|
-
..."value" in
|
|
2899
|
-
...
|
|
2900
|
-
})),
|
|
2901
|
-
const
|
|
2898
|
+
}, S = (T, $, D) => N(T, $, (v) => ({
|
|
2899
|
+
..."value" in D || "operator" in D || "field" in D ? dn(v) : v,
|
|
2900
|
+
...D
|
|
2901
|
+
})), V = (T, $, D) => N(T, $, () => D), _ = qn(), Q = (T, $) => {
|
|
2902
|
+
const D = (v) => v.id === T ? {
|
|
2902
2903
|
...v,
|
|
2903
|
-
logicalOperator:
|
|
2904
|
+
logicalOperator: $
|
|
2904
2905
|
} : {
|
|
2905
2906
|
...v,
|
|
2906
|
-
groups: v.groups.map(
|
|
2907
|
+
groups: v.groups.map(D)
|
|
2907
2908
|
};
|
|
2908
|
-
d(
|
|
2909
|
-
},
|
|
2910
|
-
const
|
|
2909
|
+
d(D(o));
|
|
2910
|
+
}, C = (T, $) => {
|
|
2911
|
+
const D = (v) => v.id === T ? {
|
|
2911
2912
|
...v,
|
|
2912
|
-
negate:
|
|
2913
|
+
negate: $
|
|
2913
2914
|
} : {
|
|
2914
2915
|
...v,
|
|
2915
|
-
groups: v.groups.map(
|
|
2916
|
+
groups: v.groups.map(D)
|
|
2916
2917
|
};
|
|
2917
|
-
d(
|
|
2918
|
-
},
|
|
2919
|
-
const v = (
|
|
2920
|
-
...
|
|
2921
|
-
conditions: Nt(
|
|
2918
|
+
d(D(o));
|
|
2919
|
+
}, I = (T, $, D) => {
|
|
2920
|
+
const v = (h) => h.id === T ? {
|
|
2921
|
+
...h,
|
|
2922
|
+
conditions: Nt(h.conditions, $, D)
|
|
2922
2923
|
} : {
|
|
2923
|
-
...
|
|
2924
|
-
groups:
|
|
2924
|
+
...h,
|
|
2925
|
+
groups: h.groups.map(v)
|
|
2925
2926
|
};
|
|
2926
2927
|
d(v(o));
|
|
2927
|
-
},
|
|
2928
|
-
const v = (
|
|
2929
|
-
...
|
|
2930
|
-
groups: Nt(
|
|
2928
|
+
}, U = (T, $, D) => {
|
|
2929
|
+
const v = (h) => h.id === T ? {
|
|
2930
|
+
...h,
|
|
2931
|
+
groups: Nt(h.groups, $, D)
|
|
2931
2932
|
} : {
|
|
2932
|
-
...
|
|
2933
|
-
groups:
|
|
2933
|
+
...h,
|
|
2934
|
+
groups: h.groups.map(v)
|
|
2934
2935
|
};
|
|
2935
2936
|
d(v(o));
|
|
2936
|
-
}, X = (
|
|
2937
|
-
if (!
|
|
2937
|
+
}, X = (T) => {
|
|
2938
|
+
if (!T || T.conditions.length === 0 && T.groups.length === 0)
|
|
2938
2939
|
return "-- No filters defined";
|
|
2939
|
-
const
|
|
2940
|
-
let
|
|
2941
|
-
typeof v.field == "object" ?
|
|
2942
|
-
const
|
|
2943
|
-
let
|
|
2944
|
-
if (v.latestValue &&
|
|
2945
|
-
return `${
|
|
2946
|
-
const
|
|
2947
|
-
if (
|
|
2948
|
-
const
|
|
2949
|
-
tz: (
|
|
2950
|
-
weekStart: (
|
|
2951
|
-
anchor: (
|
|
2940
|
+
const $ = (v) => {
|
|
2941
|
+
let h = "";
|
|
2942
|
+
typeof v.field == "object" ? h = v.field.entityName ? `${v.field.entityName}.${v.field.name}` : v.field.name : h = String(v.field);
|
|
2943
|
+
const E = v.operator;
|
|
2944
|
+
let w = v.value;
|
|
2945
|
+
if (v.latestValue && E === "=")
|
|
2946
|
+
return `${h} = ${jt} /* the latest value each time the card runs */`;
|
|
2947
|
+
const H = Zt(v.relativeMeta);
|
|
2948
|
+
if (H && ya(E) && Jt(E, H)) {
|
|
2949
|
+
const O = Ca(E, H), { label: z, range: B } = Ct(H, {
|
|
2950
|
+
tz: (_ == null ? void 0 : _.tz) ?? "UTC",
|
|
2951
|
+
weekStart: (_ == null ? void 0 : _.weekStart) ?? 1,
|
|
2952
|
+
anchor: (_ == null ? void 0 : _.anchor) ?? "now"
|
|
2953
|
+
}), j = O ? wa(O) : z;
|
|
2954
|
+
if (B) {
|
|
2955
|
+
const [ee] = Xt(E, [B.start, B.end]);
|
|
2956
|
+
return `${h} ${E} '${ee.toISOString()}' /* ${j}: the date updates each time the card runs */`;
|
|
2957
|
+
}
|
|
2958
|
+
return `${h} ${E} ${j} /* the date follows your calendar each time the card runs */`;
|
|
2959
|
+
}
|
|
2960
|
+
if (H && (E === "between" || E === "not between")) {
|
|
2961
|
+
const O = E === "between" ? "BETWEEN" : "NOT BETWEEN", { label: z, range: B } = Ct(H, {
|
|
2962
|
+
tz: (_ == null ? void 0 : _.tz) ?? "UTC",
|
|
2963
|
+
weekStart: (_ == null ? void 0 : _.weekStart) ?? 1,
|
|
2964
|
+
anchor: (_ == null ? void 0 : _.anchor) ?? "now"
|
|
2952
2965
|
});
|
|
2953
|
-
return
|
|
2966
|
+
return B ? `${h} ${O} '${B.start.toISOString()}' AND '${B.end.toISOString()}' /* ${z}: dates update each time the card runs */` : en(H).dataAnchored ? `${h} ${O} ${z} /* dates count back from the latest data each time the card runs */` : `${h} ${O} ${z} /* dates follow your calendar each time the card runs */`;
|
|
2954
2967
|
}
|
|
2955
2968
|
if (v.field.dataType === "string" && !["in", "not in"].includes(v.operator))
|
|
2956
|
-
typeof
|
|
2969
|
+
typeof w == "string" ? w = `'${w}'` : Array.isArray(w) && (w = `'${w.join(", ")}'`);
|
|
2957
2970
|
else if (v.field.dataType === "date" || v.field.dataType === "datetime" || v.field.dataType === "timestamp")
|
|
2958
|
-
if (v.operator === "between" && Array.isArray(
|
|
2959
|
-
const
|
|
2960
|
-
return `${
|
|
2961
|
-
} else if ((v.operator === "in" || v.operator === "not in") && Array.isArray(
|
|
2962
|
-
const
|
|
2963
|
-
return `${
|
|
2964
|
-
} else typeof
|
|
2971
|
+
if (v.operator === "between" && Array.isArray(w) && w.length === 2) {
|
|
2972
|
+
const O = w[0] ? `'${w[0]}'` : "NULL", z = w[1] ? `'${w[1]}'` : "NULL";
|
|
2973
|
+
return `${h} BETWEEN ${O} AND ${z}`;
|
|
2974
|
+
} else if ((v.operator === "in" || v.operator === "not in") && Array.isArray(w)) {
|
|
2975
|
+
const O = w.map((z) => z ? `'${z}'` : "NULL").join(", ");
|
|
2976
|
+
return `${h} ${E} (${O})`;
|
|
2977
|
+
} else typeof w == "string" || w instanceof Date ? w = `'${w}'` : Array.isArray(w) && w.length > 0 && (w = `'${w[0]}'`);
|
|
2965
2978
|
else if (["in", "not in"].includes(v.operator)) {
|
|
2966
|
-
let
|
|
2967
|
-
Array.isArray(
|
|
2979
|
+
let O = [];
|
|
2980
|
+
Array.isArray(w) ? O = w.map(
|
|
2968
2981
|
(z) => typeof z == "string" ? `'${z}'` : String(z)
|
|
2969
|
-
) : typeof
|
|
2970
|
-
const
|
|
2971
|
-
return v.field.dataType === "string" ? `'${
|
|
2972
|
-
}) : typeof
|
|
2982
|
+
) : typeof w == "string" ? O = w.split(",").map((z) => {
|
|
2983
|
+
const B = z.trim();
|
|
2984
|
+
return v.field.dataType === "string" ? `'${B}'` : B;
|
|
2985
|
+
}) : typeof w == "number" && (O = [String(w)]), w = `(${O.join(", ")})`;
|
|
2973
2986
|
}
|
|
2974
|
-
switch (
|
|
2987
|
+
switch (E) {
|
|
2975
2988
|
case "contains":
|
|
2976
|
-
return typeof
|
|
2989
|
+
return typeof w == "string" ? `${h} LIKE '%${w.replace(/'/g, "")}'` : `${h} LIKE '%${String(w)}'`;
|
|
2977
2990
|
case "startsWith":
|
|
2978
|
-
return typeof
|
|
2991
|
+
return typeof w == "string" ? `${h} LIKE '${w.replace(/'/g, "")}%'` : `${h} LIKE '${String(w)}%'`;
|
|
2979
2992
|
case "endsWith":
|
|
2980
|
-
return typeof
|
|
2993
|
+
return typeof w == "string" ? `${h} LIKE '%${w.replace(/'/g, "")}'` : `${h} LIKE '%${String(w)}'`;
|
|
2981
2994
|
case "isNull":
|
|
2982
|
-
return `${
|
|
2995
|
+
return `${h} IS NULL`;
|
|
2983
2996
|
case "isNotNull":
|
|
2984
|
-
return `${
|
|
2997
|
+
return `${h} IS NOT NULL`;
|
|
2985
2998
|
default:
|
|
2986
|
-
return `${
|
|
2999
|
+
return `${h} ${E} ${w}`;
|
|
2987
3000
|
}
|
|
2988
|
-
},
|
|
2989
|
-
const
|
|
2990
|
-
(z) =>
|
|
2991
|
-
),
|
|
2992
|
-
if (
|
|
2993
|
-
const
|
|
2994
|
-
return v.negate ? `NOT ${
|
|
3001
|
+
}, D = (v) => {
|
|
3002
|
+
const h = v.conditions.map($), E = v.groups.map(
|
|
3003
|
+
(z) => D(z)
|
|
3004
|
+
), w = [...h, ...E].filter(Boolean);
|
|
3005
|
+
if (w.length === 0) return "";
|
|
3006
|
+
const H = w.join(` ${v.logicalOperator} `), O = w.length > 1 ? `(${H})` : H;
|
|
3007
|
+
return v.negate ? `NOT ${O}` : O;
|
|
2995
3008
|
};
|
|
2996
|
-
return
|
|
3009
|
+
return D(T);
|
|
2997
3010
|
}, p = o.conditions.length > 0 || o.groups.length > 0;
|
|
2998
3011
|
return {
|
|
2999
3012
|
currentFilters: o,
|
|
@@ -3001,20 +3014,20 @@ function Ka({
|
|
|
3001
3014
|
availableFields: s,
|
|
3002
3015
|
isLoading: i,
|
|
3003
3016
|
addCondition: f,
|
|
3004
|
-
addGroup:
|
|
3017
|
+
addGroup: k,
|
|
3005
3018
|
removeCondition: y,
|
|
3006
|
-
removeGroup:
|
|
3007
|
-
updateConditionFields:
|
|
3008
|
-
replaceCondition:
|
|
3009
|
-
updateGroupOperator:
|
|
3010
|
-
updateGroupNegate:
|
|
3011
|
-
reorderConditions:
|
|
3012
|
-
reorderGroups:
|
|
3019
|
+
removeGroup: g,
|
|
3020
|
+
updateConditionFields: S,
|
|
3021
|
+
replaceCondition: V,
|
|
3022
|
+
updateGroupOperator: Q,
|
|
3023
|
+
updateGroupNegate: C,
|
|
3024
|
+
reorderConditions: I,
|
|
3025
|
+
reorderGroups: U,
|
|
3013
3026
|
generateSQLPreview: X,
|
|
3014
3027
|
hasAnyFilters: p
|
|
3015
3028
|
};
|
|
3016
3029
|
}
|
|
3017
|
-
function
|
|
3030
|
+
function Ja({
|
|
3018
3031
|
children: e,
|
|
3019
3032
|
className: n,
|
|
3020
3033
|
delayDuration: a
|
|
@@ -3023,7 +3036,7 @@ function Qa({
|
|
|
3023
3036
|
/* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ t(
|
|
3024
3037
|
"div",
|
|
3025
3038
|
{
|
|
3026
|
-
className:
|
|
3039
|
+
className: q(
|
|
3027
3040
|
"w-[200px] overflow-hidden text-ellipsis whitespace-nowrap text-sm",
|
|
3028
3041
|
n
|
|
3029
3042
|
),
|
|
@@ -3033,7 +3046,7 @@ function Qa({
|
|
|
3033
3046
|
/* @__PURE__ */ t(ot, { children: e })
|
|
3034
3047
|
] }) });
|
|
3035
3048
|
}
|
|
3036
|
-
function
|
|
3049
|
+
function Xa({
|
|
3037
3050
|
value: e,
|
|
3038
3051
|
onValueChange: n,
|
|
3039
3052
|
availableFields: a,
|
|
@@ -3043,7 +3056,7 @@ function Ha({
|
|
|
3043
3056
|
const [d, c] = vt.useState(!1), i = vt.useMemo(
|
|
3044
3057
|
() => new Set(e ? [e.id] : []),
|
|
3045
3058
|
[e]
|
|
3046
|
-
), s = e ?
|
|
3059
|
+
), s = e ? tn(e) : null;
|
|
3047
3060
|
return /* @__PURE__ */ l(it, { modal: !0, open: d, onOpenChange: c, children: [
|
|
3048
3061
|
/* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
|
|
3049
3062
|
G,
|
|
@@ -3053,14 +3066,14 @@ function Ha({
|
|
|
3053
3066
|
role: "combobox",
|
|
3054
3067
|
"aria-expanded": d,
|
|
3055
3068
|
title: e ? `${e.entityName}.${e.name}` : void 0,
|
|
3056
|
-
className:
|
|
3069
|
+
className: q(
|
|
3057
3070
|
"min-w-0 justify-between gap-1.5 font-normal",
|
|
3058
3071
|
!e && "text-muted-foreground",
|
|
3059
3072
|
u
|
|
3060
3073
|
),
|
|
3061
3074
|
children: [
|
|
3062
|
-
s ? /* @__PURE__ */ t(
|
|
3063
|
-
/* @__PURE__ */ t(
|
|
3075
|
+
s ? /* @__PURE__ */ t(Ja, { className: "w-auto min-w-0 flex-1 text-left text-[12px]", children: s }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-left", children: o }),
|
|
3076
|
+
/* @__PURE__ */ t(jn, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
3064
3077
|
]
|
|
3065
3078
|
}
|
|
3066
3079
|
) }),
|
|
@@ -3070,11 +3083,11 @@ function Ha({
|
|
|
3070
3083
|
className: "flex w-80 flex-col rounded-control p-1.5",
|
|
3071
3084
|
align: "start",
|
|
3072
3085
|
onOpenAutoFocus: (m) => {
|
|
3073
|
-
var f,
|
|
3074
|
-
m.preventDefault(), (
|
|
3086
|
+
var f, k;
|
|
3087
|
+
m.preventDefault(), (k = (f = m.currentTarget) == null ? void 0 : f.querySelector('input[type="text"]')) == null || k.focus();
|
|
3075
3088
|
},
|
|
3076
3089
|
children: /* @__PURE__ */ t(
|
|
3077
|
-
|
|
3090
|
+
Un,
|
|
3078
3091
|
{
|
|
3079
3092
|
fields: a,
|
|
3080
3093
|
selectedIds: i,
|
|
@@ -3090,28 +3103,28 @@ function Ha({
|
|
|
3090
3103
|
)
|
|
3091
3104
|
] });
|
|
3092
3105
|
}
|
|
3093
|
-
function
|
|
3106
|
+
function cn(e, n) {
|
|
3094
3107
|
var m;
|
|
3095
3108
|
const a = se((f) => f.card.dataSource), o = se(
|
|
3096
3109
|
(f) => f.card.connectionId
|
|
3097
3110
|
), u = se(
|
|
3098
3111
|
(f) => f.selectedConnectionId
|
|
3099
|
-
), d = n ? n.dataSource : a, c = n ? n.connectionId || ((m = n.dataSource) == null ? void 0 : m.connectionId) : u || (a == null ? void 0 : a.connectionId) || o, i =
|
|
3112
|
+
), d = n ? n.dataSource : a, c = n ? n.connectionId || ((m = n.dataSource) == null ? void 0 : m.connectionId) : u || (a == null ? void 0 : a.connectionId) || o, i = P(
|
|
3100
3113
|
() => ({
|
|
3101
3114
|
id: `card-filter-option:${e.id}`,
|
|
3102
|
-
...
|
|
3115
|
+
...Ba(e, { dataSource: d, connectionId: c })
|
|
3103
3116
|
}),
|
|
3104
3117
|
[c, d, e]
|
|
3105
|
-
), s =
|
|
3106
|
-
() =>
|
|
3118
|
+
), s = P(
|
|
3119
|
+
() => Gn({ filter: i }),
|
|
3107
3120
|
[i]
|
|
3108
3121
|
);
|
|
3109
|
-
return
|
|
3122
|
+
return Bn(i, {
|
|
3110
3123
|
inputContext: s,
|
|
3111
3124
|
currentSelectionPolicy: "exclude"
|
|
3112
3125
|
});
|
|
3113
3126
|
}
|
|
3114
|
-
function
|
|
3127
|
+
function er({
|
|
3115
3128
|
field: e,
|
|
3116
3129
|
source: n,
|
|
3117
3130
|
selected: a,
|
|
@@ -3119,18 +3132,18 @@ function Ya({
|
|
|
3119
3132
|
placeholder: u = "Select values…",
|
|
3120
3133
|
className: d
|
|
3121
3134
|
}) {
|
|
3122
|
-
const [c, i] = _e.useState(!1), s =
|
|
3123
|
-
() => new Set(a.map((
|
|
3135
|
+
const [c, i] = _e.useState(!1), s = cn(e, n), m = _e.useMemo(
|
|
3136
|
+
() => new Set(a.map((g) => ye(g))),
|
|
3124
3137
|
[a]
|
|
3125
|
-
), f = (
|
|
3126
|
-
var N,
|
|
3127
|
-
return ((
|
|
3128
|
-
},
|
|
3129
|
-
o(a.filter((N) => N !==
|
|
3130
|
-
}, y = (
|
|
3131
|
-
i(
|
|
3138
|
+
), f = (g) => {
|
|
3139
|
+
var N, S;
|
|
3140
|
+
return ((S = (N = s.allRecords.find((V) => ye(V.value) === ye(g))) == null ? void 0 : N.label) == null ? void 0 : S.toString()) ?? g;
|
|
3141
|
+
}, k = (g) => {
|
|
3142
|
+
o(a.filter((N) => N !== g));
|
|
3143
|
+
}, y = (g) => {
|
|
3144
|
+
i(g), !g && s.query && s.setQuery("");
|
|
3132
3145
|
};
|
|
3133
|
-
return /* @__PURE__ */ t("div", { className:
|
|
3146
|
+
return /* @__PURE__ */ t("div", { className: q("w-full", d), children: /* @__PURE__ */ l(it, { open: c, onOpenChange: y, modal: !0, children: [
|
|
3134
3147
|
/* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
|
|
3135
3148
|
G,
|
|
3136
3149
|
{
|
|
@@ -3140,8 +3153,8 @@ function Ya({
|
|
|
3140
3153
|
"aria-expanded": c,
|
|
3141
3154
|
className: "h-auto min-h-7 w-full justify-between gap-1.5 px-2 py-0.5 font-normal",
|
|
3142
3155
|
children: [
|
|
3143
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1", children: a.length > 0 ? a.map((
|
|
3144
|
-
const N = f(
|
|
3156
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1", children: a.length > 0 ? a.map((g) => {
|
|
3157
|
+
const N = f(g);
|
|
3145
3158
|
return (
|
|
3146
3159
|
// Selected values render as small square chips (4px
|
|
3147
3160
|
// radius), not pills. Pill badges are reserved for
|
|
@@ -3159,21 +3172,21 @@ function Ya({
|
|
|
3159
3172
|
tabIndex: 0,
|
|
3160
3173
|
"aria-label": `Remove ${N}`,
|
|
3161
3174
|
className: "shrink-0 rounded-[2px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring",
|
|
3162
|
-
onKeyDown: (
|
|
3163
|
-
|
|
3175
|
+
onKeyDown: (S) => {
|
|
3176
|
+
S.key === "Enter" && k(g);
|
|
3164
3177
|
},
|
|
3165
|
-
onMouseDown: (
|
|
3166
|
-
|
|
3178
|
+
onMouseDown: (S) => {
|
|
3179
|
+
S.preventDefault(), S.stopPropagation();
|
|
3167
3180
|
},
|
|
3168
|
-
onClick: (
|
|
3169
|
-
|
|
3181
|
+
onClick: (S) => {
|
|
3182
|
+
S.stopPropagation(), k(g);
|
|
3170
3183
|
},
|
|
3171
3184
|
children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
|
|
3172
3185
|
}
|
|
3173
3186
|
)
|
|
3174
3187
|
]
|
|
3175
3188
|
},
|
|
3176
|
-
|
|
3189
|
+
g
|
|
3177
3190
|
)
|
|
3178
3191
|
);
|
|
3179
3192
|
}) : /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: u }) }),
|
|
@@ -3186,18 +3199,18 @@ function Ya({
|
|
|
3186
3199
|
{
|
|
3187
3200
|
className: "w-[var(--radix-popover-trigger-width)] min-w-[240px] rounded-control p-1.5",
|
|
3188
3201
|
align: "start",
|
|
3189
|
-
onOpenAutoFocus: (
|
|
3190
|
-
var N,
|
|
3191
|
-
|
|
3202
|
+
onOpenAutoFocus: (g) => {
|
|
3203
|
+
var N, S;
|
|
3204
|
+
g.preventDefault(), (S = (N = g.currentTarget) == null ? void 0 : N.querySelector('input[type="text"]')) == null || S.focus();
|
|
3192
3205
|
},
|
|
3193
3206
|
children: /* @__PURE__ */ t(
|
|
3194
|
-
|
|
3207
|
+
Ut,
|
|
3195
3208
|
{
|
|
3196
3209
|
records: s.displayRecords,
|
|
3197
3210
|
selectedIdentities: m,
|
|
3198
|
-
onToggle: (
|
|
3199
|
-
const N = String(
|
|
3200
|
-
a.includes(N) ?
|
|
3211
|
+
onToggle: (g) => {
|
|
3212
|
+
const N = String(g.value);
|
|
3213
|
+
a.includes(N) ? k(N) : o([...a, N]);
|
|
3201
3214
|
},
|
|
3202
3215
|
browse: s,
|
|
3203
3216
|
searchPlaceholder: `Search ${(e.label || e.name).toLowerCase()}`,
|
|
@@ -3209,7 +3222,7 @@ function Ya({
|
|
|
3209
3222
|
)
|
|
3210
3223
|
] }) });
|
|
3211
3224
|
}
|
|
3212
|
-
function
|
|
3225
|
+
function tr({
|
|
3213
3226
|
field: e,
|
|
3214
3227
|
source: n,
|
|
3215
3228
|
value: a,
|
|
@@ -3217,16 +3230,16 @@ function Pa({
|
|
|
3217
3230
|
placeholder: u = "Select value…",
|
|
3218
3231
|
className: d
|
|
3219
3232
|
}) {
|
|
3220
|
-
var y,
|
|
3221
|
-
const [c, i] = _e.useState(!1), s =
|
|
3233
|
+
var y, g;
|
|
3234
|
+
const [c, i] = _e.useState(!1), s = cn(e, n), m = _e.useMemo(
|
|
3222
3235
|
() => new Set(a ? [ye(a)] : []),
|
|
3223
3236
|
[a]
|
|
3224
|
-
), f = a ? ((
|
|
3237
|
+
), f = a ? ((g = (y = s.allRecords.find(
|
|
3225
3238
|
(N) => ye(N.value) === ye(a)
|
|
3226
|
-
)) == null ? void 0 : y.label) == null ? void 0 :
|
|
3239
|
+
)) == null ? void 0 : y.label) == null ? void 0 : g.toString()) ?? a : "", k = (N) => {
|
|
3227
3240
|
i(N), !N && s.query && s.setQuery("");
|
|
3228
3241
|
};
|
|
3229
|
-
return /* @__PURE__ */ l(it, { open: c, onOpenChange:
|
|
3242
|
+
return /* @__PURE__ */ l(it, { open: c, onOpenChange: k, modal: !0, children: [
|
|
3230
3243
|
/* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
|
|
3231
3244
|
G,
|
|
3232
3245
|
{
|
|
@@ -3234,7 +3247,7 @@ function Pa({
|
|
|
3234
3247
|
size: "xs",
|
|
3235
3248
|
role: "combobox",
|
|
3236
3249
|
"aria-expanded": c,
|
|
3237
|
-
className:
|
|
3250
|
+
className: q(
|
|
3238
3251
|
"min-w-0 flex-1 justify-between gap-1.5 px-2 font-normal",
|
|
3239
3252
|
d
|
|
3240
3253
|
),
|
|
@@ -3242,7 +3255,7 @@ function Pa({
|
|
|
3242
3255
|
/* @__PURE__ */ t(
|
|
3243
3256
|
"span",
|
|
3244
3257
|
{
|
|
3245
|
-
className:
|
|
3258
|
+
className: q("truncate", !a && "text-muted-foreground"),
|
|
3246
3259
|
children: a ? f : u
|
|
3247
3260
|
}
|
|
3248
3261
|
),
|
|
@@ -3256,16 +3269,16 @@ function Pa({
|
|
|
3256
3269
|
className: "w-[var(--radix-popover-trigger-width)] min-w-[240px] rounded-control p-1.5",
|
|
3257
3270
|
align: "start",
|
|
3258
3271
|
onOpenAutoFocus: (N) => {
|
|
3259
|
-
var
|
|
3260
|
-
N.preventDefault(), (
|
|
3272
|
+
var S, V;
|
|
3273
|
+
N.preventDefault(), (V = (S = N.currentTarget) == null ? void 0 : S.querySelector('input[type="text"]')) == null || V.focus();
|
|
3261
3274
|
},
|
|
3262
3275
|
children: /* @__PURE__ */ t(
|
|
3263
|
-
|
|
3276
|
+
Ut,
|
|
3264
3277
|
{
|
|
3265
3278
|
records: s.displayRecords,
|
|
3266
3279
|
selectedIdentities: m,
|
|
3267
3280
|
onToggle: (N) => {
|
|
3268
|
-
o(String(N.value)),
|
|
3281
|
+
o(String(N.value)), k(!1);
|
|
3269
3282
|
},
|
|
3270
3283
|
selectionMode: "single",
|
|
3271
3284
|
browse: s,
|
|
@@ -3278,7 +3291,7 @@ function Pa({
|
|
|
3278
3291
|
)
|
|
3279
3292
|
] });
|
|
3280
3293
|
}
|
|
3281
|
-
function
|
|
3294
|
+
function nr({
|
|
3282
3295
|
value: e,
|
|
3283
3296
|
operator: n,
|
|
3284
3297
|
relativeMeta: a,
|
|
@@ -3287,84 +3300,90 @@ function Ja({
|
|
|
3287
3300
|
onChange: d,
|
|
3288
3301
|
className: c
|
|
3289
3302
|
}) {
|
|
3290
|
-
const i =
|
|
3303
|
+
const i = Wn(), s = Kn(), m = n === "between" || n === "not between", f = Jt(n), k = f ? a : void 0, y = P(() => {
|
|
3291
3304
|
if (!m || !a) return;
|
|
3292
|
-
const
|
|
3305
|
+
const C = s(a);
|
|
3293
3306
|
return {
|
|
3294
|
-
...
|
|
3295
|
-
tooltip:
|
|
3307
|
+
...C,
|
|
3308
|
+
tooltip: C.dates ? void 0 : en(a).dataAnchored ? Qn : Pn
|
|
3296
3309
|
};
|
|
3297
|
-
}, [m, a, s]),
|
|
3310
|
+
}, [m, a, s]), g = P(() => {
|
|
3298
3311
|
if (m) {
|
|
3299
|
-
if (
|
|
3300
|
-
const { range:
|
|
3301
|
-
return
|
|
3312
|
+
if (y) {
|
|
3313
|
+
const { range: C } = y;
|
|
3314
|
+
return C ? { from: C.start, to: C.end } : void 0;
|
|
3302
3315
|
}
|
|
3303
3316
|
if (e && Array.isArray(e) && e.length === 2) {
|
|
3304
|
-
const
|
|
3305
|
-
if (
|
|
3306
|
-
return { from:
|
|
3317
|
+
const C = He(e[0], i, "start"), I = He(e[1], i, "end");
|
|
3318
|
+
if (C && I)
|
|
3319
|
+
return { from: C, to: I };
|
|
3307
3320
|
}
|
|
3308
3321
|
}
|
|
3309
|
-
}, [e, m,
|
|
3322
|
+
}, [e, m, y, i]), N = P(() => {
|
|
3310
3323
|
if (!e || m || o) return;
|
|
3311
|
-
const
|
|
3312
|
-
return
|
|
3313
|
-
}, [e, m, o, i]),
|
|
3324
|
+
const C = Array.isArray(e) ? e[0] : e;
|
|
3325
|
+
return He(C, i, "start");
|
|
3326
|
+
}, [e, m, o, i]), S = (C) => n === "<=" || n === ">" ? xa(C, i) : ba(C, i);
|
|
3314
3327
|
return /* @__PURE__ */ t(
|
|
3315
|
-
|
|
3328
|
+
Hn,
|
|
3316
3329
|
{
|
|
3317
|
-
value: m ?
|
|
3330
|
+
value: m ? g : void 0,
|
|
3318
3331
|
selectionMode: m ? "range" : "single",
|
|
3319
|
-
singleValue: m ? void 0 :
|
|
3320
|
-
singleValueLabel: !m && o ?
|
|
3321
|
-
onChange: (
|
|
3322
|
-
if (
|
|
3323
|
-
d({ value: [
|
|
3332
|
+
singleValue: m ? void 0 : N,
|
|
3333
|
+
singleValueLabel: !m && o ? jt : void 0,
|
|
3334
|
+
onChange: (C) => {
|
|
3335
|
+
if (C != null && C.from && C.to) {
|
|
3336
|
+
d({ value: [C.from.toISOString(), C.to.toISOString()] });
|
|
3324
3337
|
return;
|
|
3325
3338
|
}
|
|
3326
3339
|
d({ value: [] });
|
|
3327
3340
|
},
|
|
3328
|
-
onSingleChange: (
|
|
3329
|
-
if (!
|
|
3341
|
+
onSingleChange: (C) => {
|
|
3342
|
+
if (!C) {
|
|
3330
3343
|
d({ value: "" });
|
|
3331
3344
|
return;
|
|
3332
3345
|
}
|
|
3333
|
-
const
|
|
3346
|
+
const I = S(C), U = ga(I, n, {
|
|
3334
3347
|
timezone: i
|
|
3335
3348
|
});
|
|
3336
|
-
d({ value: typeof
|
|
3349
|
+
d({ value: typeof U == "string" ? U : U.toISOString() });
|
|
3337
3350
|
},
|
|
3338
|
-
onRelativeSelect:
|
|
3339
|
-
if (!
|
|
3340
|
-
d({ value: [] });
|
|
3351
|
+
onRelativeSelect: f ? (C, I) => {
|
|
3352
|
+
if (!C.from || !C.to) {
|
|
3353
|
+
d({ value: m ? [] : "" });
|
|
3341
3354
|
return;
|
|
3342
3355
|
}
|
|
3356
|
+
const U = Xt(n, [
|
|
3357
|
+
C.from.toISOString(),
|
|
3358
|
+
C.to.toISOString()
|
|
3359
|
+
]);
|
|
3343
3360
|
d({
|
|
3344
|
-
value:
|
|
3345
|
-
relativeMeta:
|
|
3361
|
+
value: U.length === 1 ? U[0] : U,
|
|
3362
|
+
relativeMeta: I
|
|
3346
3363
|
});
|
|
3347
3364
|
} : void 0,
|
|
3348
|
-
relativeValue:
|
|
3349
|
-
|
|
3350
|
-
|
|
3365
|
+
relativeValue: k,
|
|
3366
|
+
comparisonValue: !m && f ? n : void 0,
|
|
3367
|
+
relativePoints: !m && f ? { operator: n } : "none",
|
|
3368
|
+
relativeSummary: y,
|
|
3369
|
+
supplementalFooter: f ? /* @__PURE__ */ t("p", { className: "border-t border-border px-3 py-2 text-[11px] text-muted-foreground", children: "Presets and Relative update each time the card runs. Static dates stay fixed." }) : void 0,
|
|
3351
3370
|
timezone: i,
|
|
3352
|
-
enableTimePrecision:
|
|
3371
|
+
enableTimePrecision: ha(u),
|
|
3353
3372
|
staticTimeInputs: !1,
|
|
3354
|
-
showRelativeTab:
|
|
3355
|
-
className:
|
|
3373
|
+
showRelativeTab: f,
|
|
3374
|
+
className: q("min-w-0", c),
|
|
3356
3375
|
buttonClassName: "h-7 text-[12px] [&>span]:text-[12px]",
|
|
3357
3376
|
placeholder: "Select date…"
|
|
3358
3377
|
}
|
|
3359
3378
|
);
|
|
3360
3379
|
}
|
|
3361
|
-
const
|
|
3380
|
+
const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
3362
3381
|
"contains",
|
|
3363
3382
|
"startsWith",
|
|
3364
3383
|
"endsWith",
|
|
3365
3384
|
"like",
|
|
3366
3385
|
"not like"
|
|
3367
|
-
],
|
|
3386
|
+
], rr = [
|
|
3368
3387
|
"=",
|
|
3369
3388
|
"!=",
|
|
3370
3389
|
">",
|
|
@@ -3376,7 +3395,7 @@ const Xa = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
|
3376
3395
|
"not in",
|
|
3377
3396
|
"isNull",
|
|
3378
3397
|
"isNotNull"
|
|
3379
|
-
],
|
|
3398
|
+
], sr = [
|
|
3380
3399
|
"=",
|
|
3381
3400
|
"!=",
|
|
3382
3401
|
...ht,
|
|
@@ -3384,7 +3403,7 @@ const Xa = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
|
3384
3403
|
"not in",
|
|
3385
3404
|
"isNull",
|
|
3386
3405
|
"isNotNull"
|
|
3387
|
-
],
|
|
3406
|
+
], or = [
|
|
3388
3407
|
"=",
|
|
3389
3408
|
"!=",
|
|
3390
3409
|
">",
|
|
@@ -3395,7 +3414,7 @@ const Xa = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
|
3395
3414
|
"not in",
|
|
3396
3415
|
"isNull",
|
|
3397
3416
|
"isNotNull"
|
|
3398
|
-
],
|
|
3417
|
+
], ir = ["=", "!=", "isNull", "isNotNull"], lr = [
|
|
3399
3418
|
"between",
|
|
3400
3419
|
// Default operator for dates
|
|
3401
3420
|
"=",
|
|
@@ -3406,7 +3425,7 @@ const Xa = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
|
3406
3425
|
">=",
|
|
3407
3426
|
"isNull",
|
|
3408
3427
|
"isNotNull"
|
|
3409
|
-
],
|
|
3428
|
+
], dr = {
|
|
3410
3429
|
"=": "Equals",
|
|
3411
3430
|
"!=": "Not equals",
|
|
3412
3431
|
">": "Greater than",
|
|
@@ -3425,25 +3444,25 @@ const Xa = (e) => e.conditions.length > 0 || e.groups.length > 0, ht = [
|
|
|
3425
3444
|
isNotNull: "Is not null",
|
|
3426
3445
|
"not between": "Not between"
|
|
3427
3446
|
};
|
|
3428
|
-
function
|
|
3429
|
-
return
|
|
3447
|
+
function Ze(e) {
|
|
3448
|
+
return dr[e] || va(e);
|
|
3430
3449
|
}
|
|
3431
|
-
function
|
|
3450
|
+
function cr(e) {
|
|
3432
3451
|
switch (e) {
|
|
3433
3452
|
case "string":
|
|
3434
|
-
return
|
|
3453
|
+
return sr;
|
|
3435
3454
|
case "number":
|
|
3436
|
-
return
|
|
3455
|
+
return or;
|
|
3437
3456
|
case "boolean":
|
|
3438
|
-
return
|
|
3457
|
+
return ir;
|
|
3439
3458
|
case "date":
|
|
3440
|
-
return
|
|
3459
|
+
return lr;
|
|
3441
3460
|
default:
|
|
3442
|
-
return
|
|
3461
|
+
return rr;
|
|
3443
3462
|
}
|
|
3444
3463
|
}
|
|
3445
|
-
const
|
|
3446
|
-
function
|
|
3464
|
+
const un = "w-[68px] shrink-0", Ft = "group-data-[inline]/filters:w-auto group-data-[inline]/filters:min-w-0 group-data-[inline]/filters:flex-1 group-data-[inline]/filters:shrink", gt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
3465
|
+
function mn({
|
|
3447
3466
|
value: e,
|
|
3448
3467
|
onValueChange: n,
|
|
3449
3468
|
"aria-label": a
|
|
@@ -3459,7 +3478,7 @@ function dn({
|
|
|
3459
3478
|
{
|
|
3460
3479
|
size: "xs",
|
|
3461
3480
|
"aria-label": a,
|
|
3462
|
-
className:
|
|
3481
|
+
className: q(un, "font-medium"),
|
|
3463
3482
|
children: /* @__PURE__ */ t(be, {})
|
|
3464
3483
|
}
|
|
3465
3484
|
),
|
|
@@ -3471,7 +3490,7 @@ function dn({
|
|
|
3471
3490
|
}
|
|
3472
3491
|
);
|
|
3473
3492
|
}
|
|
3474
|
-
function
|
|
3493
|
+
function pn({
|
|
3475
3494
|
condition: e,
|
|
3476
3495
|
index: n,
|
|
3477
3496
|
groupId: a,
|
|
@@ -3485,23 +3504,23 @@ function cn({
|
|
|
3485
3504
|
}) {
|
|
3486
3505
|
const {
|
|
3487
3506
|
attributes: f,
|
|
3488
|
-
listeners:
|
|
3507
|
+
listeners: k,
|
|
3489
3508
|
setNodeRef: y,
|
|
3490
|
-
transform:
|
|
3509
|
+
transform: g,
|
|
3491
3510
|
transition: N,
|
|
3492
|
-
isDragging:
|
|
3493
|
-
} =
|
|
3494
|
-
transform:
|
|
3511
|
+
isDragging: S
|
|
3512
|
+
} = Gt({ id: e.id }), V = {
|
|
3513
|
+
transform: Bt.Transform.toString(g),
|
|
3495
3514
|
transition: N
|
|
3496
|
-
},
|
|
3515
|
+
}, _ = qe(e.field.dataType), Q = e.operator === "isNull" || e.operator === "isNotNull", C = e.operator === "in" || e.operator === "not in";
|
|
3497
3516
|
return /* @__PURE__ */ l(
|
|
3498
3517
|
"div",
|
|
3499
3518
|
{
|
|
3500
3519
|
ref: y,
|
|
3501
|
-
style:
|
|
3502
|
-
className:
|
|
3520
|
+
style: V,
|
|
3521
|
+
className: q(
|
|
3503
3522
|
"flex items-center gap-2 rounded-control px-1.5 py-1 transition-colors hover:bg-muted/40",
|
|
3504
|
-
|
|
3523
|
+
S && "z-50 opacity-50"
|
|
3505
3524
|
),
|
|
3506
3525
|
children: [
|
|
3507
3526
|
/* @__PURE__ */ t(
|
|
@@ -3509,44 +3528,44 @@ function cn({
|
|
|
3509
3528
|
{
|
|
3510
3529
|
type: "button",
|
|
3511
3530
|
...f,
|
|
3512
|
-
...
|
|
3531
|
+
...k,
|
|
3513
3532
|
"aria-label": "Drag to reorder condition",
|
|
3514
3533
|
className: "flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded-control text-muted-foreground/60 hover:text-foreground focus-visible:outline-none active:cursor-grabbing",
|
|
3515
|
-
children: /* @__PURE__ */ t(
|
|
3534
|
+
children: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
|
|
3516
3535
|
}
|
|
3517
3536
|
),
|
|
3518
3537
|
n > 0 ? /* @__PURE__ */ t(
|
|
3519
|
-
|
|
3538
|
+
mn,
|
|
3520
3539
|
{
|
|
3521
3540
|
value: o,
|
|
3522
|
-
onValueChange: (
|
|
3541
|
+
onValueChange: (I) => d(a, I),
|
|
3523
3542
|
"aria-label": "Logical operator"
|
|
3524
3543
|
}
|
|
3525
|
-
) : /* @__PURE__ */ t("span", { className:
|
|
3544
|
+
) : /* @__PURE__ */ t("span", { className: q(un, "text-center", gt), children: "Where" }),
|
|
3526
3545
|
/* @__PURE__ */ t(
|
|
3527
|
-
|
|
3546
|
+
Xa,
|
|
3528
3547
|
{
|
|
3529
3548
|
value: e.field,
|
|
3530
|
-
onValueChange: (
|
|
3549
|
+
onValueChange: (I) => {
|
|
3531
3550
|
m(
|
|
3532
3551
|
a,
|
|
3533
3552
|
e.id,
|
|
3534
|
-
|
|
3553
|
+
Ya(e, I)
|
|
3535
3554
|
);
|
|
3536
3555
|
},
|
|
3537
3556
|
availableFields: c,
|
|
3538
3557
|
placeholder: "Select field",
|
|
3539
|
-
className:
|
|
3558
|
+
className: q("w-60 shrink-0", Ft)
|
|
3540
3559
|
}
|
|
3541
3560
|
),
|
|
3542
3561
|
/* @__PURE__ */ l(
|
|
3543
3562
|
ge,
|
|
3544
3563
|
{
|
|
3545
3564
|
value: e.operator,
|
|
3546
|
-
onValueChange: (
|
|
3565
|
+
onValueChange: (I) => m(
|
|
3547
3566
|
a,
|
|
3548
3567
|
e.id,
|
|
3549
|
-
|
|
3568
|
+
Ha(e, I)
|
|
3550
3569
|
),
|
|
3551
3570
|
children: [
|
|
3552
3571
|
/* @__PURE__ */ t(
|
|
@@ -3554,22 +3573,22 @@ function cn({
|
|
|
3554
3573
|
{
|
|
3555
3574
|
size: "xs",
|
|
3556
3575
|
"aria-label": "Operator",
|
|
3557
|
-
className:
|
|
3558
|
-
children: /* @__PURE__ */ t(be, { children: e.operator ?
|
|
3576
|
+
className: q("w-40 shrink-0", Ft),
|
|
3577
|
+
children: /* @__PURE__ */ t(be, { children: e.operator ? Ze(e.operator) : "" })
|
|
3559
3578
|
}
|
|
3560
3579
|
),
|
|
3561
|
-
/* @__PURE__ */ t(ve, { children:
|
|
3580
|
+
/* @__PURE__ */ t(ve, { children: cr(_).map((I) => /* @__PURE__ */ t(re, { value: I, children: Ze(I) }, I)) })
|
|
3562
3581
|
]
|
|
3563
3582
|
}
|
|
3564
3583
|
),
|
|
3565
|
-
|
|
3566
|
-
|
|
3584
|
+
Q ? /* @__PURE__ */ t("div", { className: "min-w-0 flex-1" }) : _ === "string" ? C ? /* @__PURE__ */ t(
|
|
3585
|
+
er,
|
|
3567
3586
|
{
|
|
3568
3587
|
field: e.field,
|
|
3569
3588
|
source: i,
|
|
3570
|
-
selected: Array.isArray(e.value) && e.value.every((
|
|
3571
|
-
onChange: (
|
|
3572
|
-
value:
|
|
3589
|
+
selected: Array.isArray(e.value) && e.value.every((I) => typeof I == "string") ? e.value : [],
|
|
3590
|
+
onChange: (I) => s(a, e.id, {
|
|
3591
|
+
value: I
|
|
3573
3592
|
}),
|
|
3574
3593
|
placeholder: "Select values…",
|
|
3575
3594
|
className: "min-w-0 flex-1"
|
|
@@ -3579,28 +3598,28 @@ function cn({
|
|
|
3579
3598
|
{
|
|
3580
3599
|
size: "xs",
|
|
3581
3600
|
value: typeof e.value == "string" ? e.value : "",
|
|
3582
|
-
onChange: (
|
|
3583
|
-
value:
|
|
3601
|
+
onChange: (I) => s(a, e.id, {
|
|
3602
|
+
value: I.target.value
|
|
3584
3603
|
}),
|
|
3585
3604
|
className: "min-w-0 flex-1",
|
|
3586
|
-
placeholder: `${
|
|
3605
|
+
placeholder: `${Ze(e.operator)}…`
|
|
3587
3606
|
}
|
|
3588
3607
|
) : /* @__PURE__ */ t(
|
|
3589
|
-
|
|
3608
|
+
tr,
|
|
3590
3609
|
{
|
|
3591
3610
|
field: e.field,
|
|
3592
3611
|
source: i,
|
|
3593
3612
|
value: typeof e.value == "string" ? e.value : "",
|
|
3594
|
-
onChange: (
|
|
3613
|
+
onChange: (I) => s(a, e.id, { value: I }),
|
|
3595
3614
|
placeholder: "Select value…",
|
|
3596
3615
|
className: "min-w-0 flex-1"
|
|
3597
3616
|
}
|
|
3598
|
-
) :
|
|
3617
|
+
) : _ === "boolean" ? /* @__PURE__ */ l(
|
|
3599
3618
|
ge,
|
|
3600
3619
|
{
|
|
3601
3620
|
value: typeof e.value == "boolean" ? String(e.value) : "",
|
|
3602
|
-
onValueChange: (
|
|
3603
|
-
value:
|
|
3621
|
+
onValueChange: (I) => s(a, e.id, {
|
|
3622
|
+
value: I === "true"
|
|
3604
3623
|
}),
|
|
3605
3624
|
children: [
|
|
3606
3625
|
/* @__PURE__ */ t(xe, { size: "xs", className: "min-w-0 flex-1", children: /* @__PURE__ */ t(be, { placeholder: "Select value…" }) }),
|
|
@@ -3610,23 +3629,23 @@ function cn({
|
|
|
3610
3629
|
] })
|
|
3611
3630
|
]
|
|
3612
3631
|
}
|
|
3613
|
-
) :
|
|
3632
|
+
) : _ === "date" ? (
|
|
3614
3633
|
// Date fields use CardDateFilter which:
|
|
3615
3634
|
// - Formats dates as ISO strings for backend compatibility
|
|
3616
3635
|
// - Handles different operators (=, !=, >, <, between, in, etc.)
|
|
3617
3636
|
// - Saves relative choices ("This month") with the range
|
|
3618
3637
|
/* @__PURE__ */ t(
|
|
3619
|
-
|
|
3638
|
+
nr,
|
|
3620
3639
|
{
|
|
3621
3640
|
value: e.value,
|
|
3622
3641
|
operator: e.operator,
|
|
3623
|
-
relativeMeta:
|
|
3642
|
+
relativeMeta: Zt(e.relativeMeta),
|
|
3624
3643
|
latestValue: e.latestValue === !0,
|
|
3625
3644
|
field: e.field,
|
|
3626
|
-
onChange: (
|
|
3645
|
+
onChange: (I) => m(
|
|
3627
3646
|
a,
|
|
3628
3647
|
e.id,
|
|
3629
|
-
ft(e,
|
|
3648
|
+
ft(e, I)
|
|
3630
3649
|
),
|
|
3631
3650
|
className: "min-w-0 flex-1"
|
|
3632
3651
|
}
|
|
@@ -3636,11 +3655,11 @@ function cn({
|
|
|
3636
3655
|
{
|
|
3637
3656
|
size: "xs",
|
|
3638
3657
|
value: typeof e.value == "string" || typeof e.value == "number" ? e.value : "",
|
|
3639
|
-
onChange: (
|
|
3640
|
-
value:
|
|
3658
|
+
onChange: (I) => s(a, e.id, {
|
|
3659
|
+
value: I.target.value
|
|
3641
3660
|
}),
|
|
3642
3661
|
className: "min-w-0 flex-1",
|
|
3643
|
-
placeholder:
|
|
3662
|
+
placeholder: C ? "value1, value2, value3" : "Value"
|
|
3644
3663
|
}
|
|
3645
3664
|
),
|
|
3646
3665
|
/* @__PURE__ */ t(
|
|
@@ -3658,8 +3677,8 @@ function cn({
|
|
|
3658
3677
|
}
|
|
3659
3678
|
);
|
|
3660
3679
|
}
|
|
3661
|
-
const
|
|
3662
|
-
function
|
|
3680
|
+
const Ot = "group-data-[inline]/filters:h-auto group-data-[inline]/filters:gap-1 group-data-[inline]/filters:border-0 group-data-[inline]/filters:bg-transparent group-data-[inline]/filters:px-0 group-data-[inline]/filters:py-0.5 group-data-[inline]/filters:text-[11px] group-data-[inline]/filters:font-medium group-data-[inline]/filters:text-muted-foreground group-data-[inline]/filters:shadow-none group-data-[inline]/filters:underline-offset-2 group-data-[inline]/filters:hover:bg-transparent group-data-[inline]/filters:hover:text-foreground group-data-[inline]/filters:hover:underline";
|
|
3681
|
+
function fn({
|
|
3663
3682
|
onAddCondition: e,
|
|
3664
3683
|
onAddGroup: n
|
|
3665
3684
|
}) {
|
|
@@ -3670,7 +3689,7 @@ function un({
|
|
|
3670
3689
|
type: "button",
|
|
3671
3690
|
size: "xs",
|
|
3672
3691
|
variant: "outline",
|
|
3673
|
-
className:
|
|
3692
|
+
className: q("gap-1.5", Ot),
|
|
3674
3693
|
onClick: e,
|
|
3675
3694
|
children: [
|
|
3676
3695
|
/* @__PURE__ */ t(Ve, { className: "h-3 w-3" }),
|
|
@@ -3684,7 +3703,7 @@ function un({
|
|
|
3684
3703
|
type: "button",
|
|
3685
3704
|
size: "xs",
|
|
3686
3705
|
variant: "ghost",
|
|
3687
|
-
className:
|
|
3706
|
+
className: q("gap-1.5 text-muted-foreground hover:text-foreground", Ot),
|
|
3688
3707
|
onClick: n,
|
|
3689
3708
|
children: [
|
|
3690
3709
|
/* @__PURE__ */ t(Ve, { className: "h-3 w-3" }),
|
|
@@ -3694,7 +3713,7 @@ function un({
|
|
|
3694
3713
|
)
|
|
3695
3714
|
] });
|
|
3696
3715
|
}
|
|
3697
|
-
function
|
|
3716
|
+
function ur({
|
|
3698
3717
|
group: e,
|
|
3699
3718
|
depth: n,
|
|
3700
3719
|
parentGroupId: a,
|
|
@@ -3706,47 +3725,47 @@ function or({
|
|
|
3706
3725
|
onReorderGroups: s,
|
|
3707
3726
|
onAddCondition: m,
|
|
3708
3727
|
onAddGroup: f,
|
|
3709
|
-
availableFields:
|
|
3728
|
+
availableFields: k,
|
|
3710
3729
|
source: y,
|
|
3711
|
-
renderFilterGroup:
|
|
3730
|
+
renderFilterGroup: g,
|
|
3712
3731
|
updateConditionFields: N,
|
|
3713
|
-
replaceCondition:
|
|
3732
|
+
replaceCondition: S
|
|
3714
3733
|
}) {
|
|
3715
3734
|
const {
|
|
3716
|
-
attributes:
|
|
3717
|
-
listeners:
|
|
3718
|
-
setNodeRef:
|
|
3719
|
-
transform:
|
|
3720
|
-
transition:
|
|
3721
|
-
isDragging:
|
|
3722
|
-
} =
|
|
3723
|
-
transform:
|
|
3724
|
-
transition:
|
|
3725
|
-
}, p = (
|
|
3726
|
-
const { active:
|
|
3727
|
-
if (v &&
|
|
3728
|
-
const
|
|
3729
|
-
(
|
|
3730
|
-
),
|
|
3731
|
-
(
|
|
3735
|
+
attributes: V,
|
|
3736
|
+
listeners: _,
|
|
3737
|
+
setNodeRef: Q,
|
|
3738
|
+
transform: C,
|
|
3739
|
+
transition: I,
|
|
3740
|
+
isDragging: U
|
|
3741
|
+
} = Gt({ id: e.id }), X = {
|
|
3742
|
+
transform: Bt.Transform.toString(C),
|
|
3743
|
+
transition: I
|
|
3744
|
+
}, p = ($) => {
|
|
3745
|
+
const { active: D, over: v } = $;
|
|
3746
|
+
if (v && D.id !== v.id) {
|
|
3747
|
+
const h = e.conditions.findIndex(
|
|
3748
|
+
(w) => w.id === D.id
|
|
3749
|
+
), E = e.conditions.findIndex(
|
|
3750
|
+
(w) => w.id === v.id
|
|
3732
3751
|
);
|
|
3733
|
-
|
|
3752
|
+
h !== -1 && E !== -1 && i(e.id, h, E);
|
|
3734
3753
|
}
|
|
3735
|
-
},
|
|
3736
|
-
const { active:
|
|
3737
|
-
if (v &&
|
|
3738
|
-
const
|
|
3739
|
-
|
|
3754
|
+
}, T = ($) => {
|
|
3755
|
+
const { active: D, over: v } = $;
|
|
3756
|
+
if (v && D.id !== v.id && a) {
|
|
3757
|
+
const h = e.groups.findIndex((w) => w.id === D.id), E = e.groups.findIndex((w) => w.id === v.id);
|
|
3758
|
+
h !== -1 && E !== -1 && s(a, h, E);
|
|
3740
3759
|
}
|
|
3741
3760
|
};
|
|
3742
3761
|
return /* @__PURE__ */ l(
|
|
3743
3762
|
"div",
|
|
3744
3763
|
{
|
|
3745
|
-
ref:
|
|
3764
|
+
ref: Q,
|
|
3746
3765
|
style: X,
|
|
3747
|
-
className:
|
|
3766
|
+
className: q(
|
|
3748
3767
|
n > 0 && "mt-2 overflow-hidden rounded-[6px] border border-border/60",
|
|
3749
|
-
|
|
3768
|
+
U && "z-50 opacity-50"
|
|
3750
3769
|
),
|
|
3751
3770
|
children: [
|
|
3752
3771
|
n > 0 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 border-b border-border/60 bg-muted/40 px-2 py-1", children: [
|
|
@@ -3755,11 +3774,11 @@ function or({
|
|
|
3755
3774
|
"button",
|
|
3756
3775
|
{
|
|
3757
3776
|
type: "button",
|
|
3777
|
+
...V,
|
|
3758
3778
|
..._,
|
|
3759
|
-
...D,
|
|
3760
3779
|
"aria-label": "Drag to reorder group",
|
|
3761
3780
|
className: "flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded-control text-muted-foreground/60 hover:text-foreground focus-visible:outline-none active:cursor-grabbing",
|
|
3762
|
-
children: /* @__PURE__ */ t(
|
|
3781
|
+
children: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
|
|
3763
3782
|
}
|
|
3764
3783
|
),
|
|
3765
3784
|
/* @__PURE__ */ t(
|
|
@@ -3775,10 +3794,10 @@ function or({
|
|
|
3775
3794
|
}
|
|
3776
3795
|
),
|
|
3777
3796
|
/* @__PURE__ */ t(
|
|
3778
|
-
|
|
3797
|
+
mn,
|
|
3779
3798
|
{
|
|
3780
3799
|
value: e.logicalOperator,
|
|
3781
|
-
onValueChange: (
|
|
3800
|
+
onValueChange: ($) => o(e.id, $),
|
|
3782
3801
|
"aria-label": "Group logical operator"
|
|
3783
3802
|
}
|
|
3784
3803
|
),
|
|
@@ -3793,18 +3812,18 @@ function or({
|
|
|
3793
3812
|
"aria-label": "Remove group",
|
|
3794
3813
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
3795
3814
|
onClick: () => a && d(a, e.id),
|
|
3796
|
-
children: /* @__PURE__ */ t(
|
|
3815
|
+
children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
|
|
3797
3816
|
}
|
|
3798
3817
|
)
|
|
3799
3818
|
] }),
|
|
3800
|
-
/* @__PURE__ */ l("div", { className:
|
|
3819
|
+
/* @__PURE__ */ l("div", { className: q(n > 0 && "p-2"), children: [
|
|
3801
3820
|
/* @__PURE__ */ t(
|
|
3802
3821
|
Re,
|
|
3803
3822
|
{
|
|
3804
|
-
sensors:
|
|
3823
|
+
sensors: Je(
|
|
3805
3824
|
he(tt),
|
|
3806
3825
|
he(et, {
|
|
3807
|
-
coordinateGetter:
|
|
3826
|
+
coordinateGetter: Xe
|
|
3808
3827
|
})
|
|
3809
3828
|
),
|
|
3810
3829
|
collisionDetection: Ee,
|
|
@@ -3812,23 +3831,23 @@ function or({
|
|
|
3812
3831
|
children: /* @__PURE__ */ t(
|
|
3813
3832
|
ze,
|
|
3814
3833
|
{
|
|
3815
|
-
items: e.conditions.map((
|
|
3834
|
+
items: e.conditions.map(($) => $.id),
|
|
3816
3835
|
strategy: Me,
|
|
3817
|
-
children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children: e.conditions.map((
|
|
3818
|
-
|
|
3836
|
+
children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children: e.conditions.map(($, D) => /* @__PURE__ */ t(
|
|
3837
|
+
pn,
|
|
3819
3838
|
{
|
|
3820
|
-
condition:
|
|
3821
|
-
index:
|
|
3839
|
+
condition: $,
|
|
3840
|
+
index: D,
|
|
3822
3841
|
groupId: e.id,
|
|
3823
3842
|
groupLogicalOperator: e.logicalOperator,
|
|
3824
3843
|
onRemoveCondition: c,
|
|
3825
3844
|
onUpdateGroupOperator: o,
|
|
3826
|
-
availableFields:
|
|
3845
|
+
availableFields: k,
|
|
3827
3846
|
source: y,
|
|
3828
3847
|
updateConditionFields: N,
|
|
3829
|
-
replaceCondition:
|
|
3848
|
+
replaceCondition: S
|
|
3830
3849
|
},
|
|
3831
|
-
|
|
3850
|
+
$.id
|
|
3832
3851
|
)) })
|
|
3833
3852
|
}
|
|
3834
3853
|
)
|
|
@@ -3837,21 +3856,21 @@ function or({
|
|
|
3837
3856
|
/* @__PURE__ */ t(
|
|
3838
3857
|
Re,
|
|
3839
3858
|
{
|
|
3840
|
-
sensors:
|
|
3859
|
+
sensors: Je(
|
|
3841
3860
|
he(tt),
|
|
3842
3861
|
he(et, {
|
|
3843
|
-
coordinateGetter:
|
|
3862
|
+
coordinateGetter: Xe
|
|
3844
3863
|
})
|
|
3845
3864
|
),
|
|
3846
3865
|
collisionDetection: Ee,
|
|
3847
|
-
onDragEnd:
|
|
3866
|
+
onDragEnd: T,
|
|
3848
3867
|
children: /* @__PURE__ */ t(
|
|
3849
3868
|
ze,
|
|
3850
3869
|
{
|
|
3851
|
-
items: e.groups.map((
|
|
3870
|
+
items: e.groups.map(($) => $.id),
|
|
3852
3871
|
strategy: Me,
|
|
3853
3872
|
children: e.groups.map(
|
|
3854
|
-
(
|
|
3873
|
+
($) => g($, n + 1, e.id)
|
|
3855
3874
|
)
|
|
3856
3875
|
}
|
|
3857
3876
|
)
|
|
@@ -3859,7 +3878,7 @@ function or({
|
|
|
3859
3878
|
),
|
|
3860
3879
|
e.conditions.length === 0 && e.groups.length === 0 && /* @__PURE__ */ t("p", { className: "rounded-control border border-dashed border-border/60 px-3 py-2 text-center text-[11.5px] text-muted-foreground", children: "No conditions in this group." }),
|
|
3861
3880
|
/* @__PURE__ */ t(
|
|
3862
|
-
|
|
3881
|
+
fn,
|
|
3863
3882
|
{
|
|
3864
3883
|
onAddCondition: () => m(e.id),
|
|
3865
3884
|
onAddGroup: () => f(e.id)
|
|
@@ -3870,7 +3889,7 @@ function or({
|
|
|
3870
3889
|
}
|
|
3871
3890
|
);
|
|
3872
3891
|
}
|
|
3873
|
-
function
|
|
3892
|
+
function Or({
|
|
3874
3893
|
filters: e,
|
|
3875
3894
|
availableFields: n,
|
|
3876
3895
|
source: a,
|
|
@@ -3883,69 +3902,69 @@ function Ir({
|
|
|
3883
3902
|
currentFilters: s,
|
|
3884
3903
|
availableFields: m,
|
|
3885
3904
|
isLoading: f,
|
|
3886
|
-
addCondition:
|
|
3905
|
+
addCondition: k,
|
|
3887
3906
|
addGroup: y,
|
|
3888
|
-
removeCondition:
|
|
3907
|
+
removeCondition: g,
|
|
3889
3908
|
removeGroup: N,
|
|
3890
|
-
updateConditionFields:
|
|
3891
|
-
replaceCondition:
|
|
3892
|
-
updateGroupOperator:
|
|
3893
|
-
updateGroupNegate:
|
|
3894
|
-
reorderConditions:
|
|
3895
|
-
reorderGroups:
|
|
3896
|
-
generateSQLPreview:
|
|
3909
|
+
updateConditionFields: S,
|
|
3910
|
+
replaceCondition: V,
|
|
3911
|
+
updateGroupOperator: _,
|
|
3912
|
+
updateGroupNegate: Q,
|
|
3913
|
+
reorderConditions: C,
|
|
3914
|
+
reorderGroups: I,
|
|
3915
|
+
generateSQLPreview: U,
|
|
3897
3916
|
hasAnyFilters: X
|
|
3898
|
-
} =
|
|
3917
|
+
} = Za({
|
|
3899
3918
|
initialFilters: e,
|
|
3900
3919
|
availableFields: n,
|
|
3901
3920
|
...c ? {
|
|
3902
|
-
onChange: (
|
|
3921
|
+
onChange: (h) => c(ar(h) ? h : null)
|
|
3903
3922
|
} : {}
|
|
3904
|
-
}), p =
|
|
3923
|
+
}), p = Je(
|
|
3905
3924
|
he(tt),
|
|
3906
3925
|
he(et, {
|
|
3907
|
-
coordinateGetter:
|
|
3926
|
+
coordinateGetter: Xe
|
|
3908
3927
|
})
|
|
3909
|
-
), [
|
|
3910
|
-
if (
|
|
3911
|
-
const
|
|
3928
|
+
), [T, $] = Y(!1), D = (h, E = 0, w) => {
|
|
3929
|
+
if (E === 0) {
|
|
3930
|
+
const H = h.conditions.length === 0 && h.groups.length === 0;
|
|
3912
3931
|
return /* @__PURE__ */ l("div", { children: [
|
|
3913
3932
|
/* @__PURE__ */ t(
|
|
3914
3933
|
Re,
|
|
3915
3934
|
{
|
|
3916
3935
|
sensors: p,
|
|
3917
3936
|
collisionDetection: Ee,
|
|
3918
|
-
onDragEnd: (
|
|
3919
|
-
const { active: z, over:
|
|
3920
|
-
if (
|
|
3921
|
-
const
|
|
3937
|
+
onDragEnd: (O) => {
|
|
3938
|
+
const { active: z, over: B } = O;
|
|
3939
|
+
if (B && z.id !== B.id) {
|
|
3940
|
+
const j = h.conditions.findIndex(
|
|
3922
3941
|
(te) => te.id === z.id
|
|
3923
|
-
), ee =
|
|
3924
|
-
(te) => te.id ===
|
|
3942
|
+
), ee = h.conditions.findIndex(
|
|
3943
|
+
(te) => te.id === B.id
|
|
3925
3944
|
);
|
|
3926
|
-
|
|
3945
|
+
j !== -1 && ee !== -1 && C(h.id, j, ee);
|
|
3927
3946
|
}
|
|
3928
3947
|
},
|
|
3929
3948
|
children: /* @__PURE__ */ t(
|
|
3930
3949
|
ze,
|
|
3931
3950
|
{
|
|
3932
|
-
items:
|
|
3951
|
+
items: h.conditions.map((O) => O.id),
|
|
3933
3952
|
strategy: Me,
|
|
3934
|
-
children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children:
|
|
3935
|
-
|
|
3953
|
+
children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children: h.conditions.map((O, z) => /* @__PURE__ */ t(
|
|
3954
|
+
pn,
|
|
3936
3955
|
{
|
|
3937
|
-
condition:
|
|
3956
|
+
condition: O,
|
|
3938
3957
|
index: z,
|
|
3939
|
-
groupId:
|
|
3940
|
-
groupLogicalOperator:
|
|
3941
|
-
onRemoveCondition:
|
|
3942
|
-
onUpdateGroupOperator:
|
|
3958
|
+
groupId: h.id,
|
|
3959
|
+
groupLogicalOperator: h.logicalOperator,
|
|
3960
|
+
onRemoveCondition: g,
|
|
3961
|
+
onUpdateGroupOperator: _,
|
|
3943
3962
|
availableFields: m,
|
|
3944
3963
|
source: a,
|
|
3945
|
-
updateConditionFields:
|
|
3946
|
-
replaceCondition:
|
|
3964
|
+
updateConditionFields: S,
|
|
3965
|
+
replaceCondition: V
|
|
3947
3966
|
},
|
|
3948
|
-
|
|
3967
|
+
O.id
|
|
3949
3968
|
)) })
|
|
3950
3969
|
}
|
|
3951
3970
|
)
|
|
@@ -3956,80 +3975,80 @@ function Ir({
|
|
|
3956
3975
|
{
|
|
3957
3976
|
sensors: p,
|
|
3958
3977
|
collisionDetection: Ee,
|
|
3959
|
-
onDragEnd: (
|
|
3960
|
-
const { active: z, over:
|
|
3961
|
-
if (
|
|
3962
|
-
const
|
|
3978
|
+
onDragEnd: (O) => {
|
|
3979
|
+
const { active: z, over: B } = O;
|
|
3980
|
+
if (B && z.id !== B.id) {
|
|
3981
|
+
const j = h.groups.findIndex(
|
|
3963
3982
|
(te) => te.id === z.id
|
|
3964
|
-
), ee =
|
|
3965
|
-
(te) => te.id ===
|
|
3983
|
+
), ee = h.groups.findIndex(
|
|
3984
|
+
(te) => te.id === B.id
|
|
3966
3985
|
);
|
|
3967
|
-
|
|
3986
|
+
j !== -1 && ee !== -1 && I(h.id, j, ee);
|
|
3968
3987
|
}
|
|
3969
3988
|
},
|
|
3970
3989
|
children: /* @__PURE__ */ t(
|
|
3971
3990
|
ze,
|
|
3972
3991
|
{
|
|
3973
|
-
items:
|
|
3992
|
+
items: h.groups.map((O) => O.id),
|
|
3974
3993
|
strategy: Me,
|
|
3975
|
-
children:
|
|
3976
|
-
(
|
|
3994
|
+
children: h.groups.map(
|
|
3995
|
+
(O) => D(O, E + 1, h.id)
|
|
3977
3996
|
)
|
|
3978
3997
|
}
|
|
3979
3998
|
)
|
|
3980
3999
|
}
|
|
3981
4000
|
),
|
|
3982
|
-
|
|
4001
|
+
H && !i && /* @__PURE__ */ t("p", { className: "rounded-control border border-dashed border-border/60 px-3 py-2 text-center text-[11.5px] text-muted-foreground", children: "No filters yet. Add a condition to limit the rows this card shows." }),
|
|
3983
4002
|
/* @__PURE__ */ t(
|
|
3984
|
-
|
|
4003
|
+
fn,
|
|
3985
4004
|
{
|
|
3986
|
-
onAddCondition: () =>
|
|
4005
|
+
onAddCondition: () => k(h.id),
|
|
3987
4006
|
onAddGroup: (
|
|
3988
4007
|
// In place, grouping is offered once there are two conditions to group,
|
|
3989
4008
|
// not as a mode to switch on first.
|
|
3990
|
-
(i ?
|
|
4009
|
+
(i ? h.conditions.length + h.groups.length >= 2 : T) ? () => y(h.id) : void 0
|
|
3991
4010
|
)
|
|
3992
4011
|
}
|
|
3993
4012
|
)
|
|
3994
|
-
] },
|
|
4013
|
+
] }, h.id);
|
|
3995
4014
|
}
|
|
3996
4015
|
return /* @__PURE__ */ t(
|
|
3997
|
-
|
|
4016
|
+
ur,
|
|
3998
4017
|
{
|
|
3999
|
-
group:
|
|
4000
|
-
depth:
|
|
4001
|
-
parentGroupId:
|
|
4002
|
-
onUpdateGroupOperator:
|
|
4003
|
-
onUpdateGroupNegate:
|
|
4018
|
+
group: h,
|
|
4019
|
+
depth: E,
|
|
4020
|
+
parentGroupId: w,
|
|
4021
|
+
onUpdateGroupOperator: _,
|
|
4022
|
+
onUpdateGroupNegate: Q,
|
|
4004
4023
|
onRemoveGroup: N,
|
|
4005
|
-
onRemoveCondition:
|
|
4006
|
-
onReorderConditions:
|
|
4007
|
-
onReorderGroups:
|
|
4008
|
-
onAddCondition:
|
|
4024
|
+
onRemoveCondition: g,
|
|
4025
|
+
onReorderConditions: C,
|
|
4026
|
+
onReorderGroups: I,
|
|
4027
|
+
onAddCondition: k,
|
|
4009
4028
|
onAddGroup: y,
|
|
4010
4029
|
availableFields: m,
|
|
4011
4030
|
source: a,
|
|
4012
|
-
renderFilterGroup:
|
|
4013
|
-
updateConditionFields:
|
|
4014
|
-
replaceCondition:
|
|
4031
|
+
renderFilterGroup: D,
|
|
4032
|
+
updateConditionFields: S,
|
|
4033
|
+
replaceCondition: V
|
|
4015
4034
|
},
|
|
4016
|
-
|
|
4035
|
+
h.id
|
|
4017
4036
|
);
|
|
4018
|
-
}, v =
|
|
4019
|
-
return /* @__PURE__ */ l("div", { className:
|
|
4037
|
+
}, v = Yn(e);
|
|
4038
|
+
return /* @__PURE__ */ l("div", { className: q("group/filters", i ? "flex flex-col" : "flex min-h-0 flex-1 flex-col"), "data-inline": i || void 0, children: [
|
|
4020
4039
|
/* @__PURE__ */ l("div", { className: i ? "" : "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: [
|
|
4021
4040
|
f ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center gap-2 py-6 text-[12px] text-muted-foreground", children: [
|
|
4022
|
-
/* @__PURE__ */ t(
|
|
4041
|
+
/* @__PURE__ */ t(xn, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
4023
4042
|
"Loading columns…"
|
|
4024
|
-
] }) :
|
|
4043
|
+
] }) : D(s),
|
|
4025
4044
|
!i && /* @__PURE__ */ l("div", { className: "mt-3 flex items-center gap-2 border-t border-border/60 pt-3", children: [
|
|
4026
4045
|
/* @__PURE__ */ t(
|
|
4027
|
-
|
|
4046
|
+
bn,
|
|
4028
4047
|
{
|
|
4029
4048
|
size: "xs",
|
|
4030
4049
|
id: "advanced-mode",
|
|
4031
|
-
checked:
|
|
4032
|
-
onCheckedChange: (
|
|
4050
|
+
checked: T,
|
|
4051
|
+
onCheckedChange: (h) => $(h)
|
|
4033
4052
|
}
|
|
4034
4053
|
),
|
|
4035
4054
|
/* @__PURE__ */ t(
|
|
@@ -4043,8 +4062,8 @@ function Ir({
|
|
|
4043
4062
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-muted-foreground", children: "Nest conditions in groups" })
|
|
4044
4063
|
] }),
|
|
4045
4064
|
X && !i && /* @__PURE__ */ l("div", { className: "mt-3 border-t border-border/60 pt-3", children: [
|
|
4046
|
-
/* @__PURE__ */ t("div", { className:
|
|
4047
|
-
/* @__PURE__ */ t("pre", { className: "overflow-x-auto whitespace-pre-wrap break-words rounded-[6px] border border-border bg-muted/40 px-3 py-2 font-mono text-[12px] leading-[1.55] text-foreground", children:
|
|
4065
|
+
/* @__PURE__ */ t("div", { className: q("mb-1.5", gt), children: "Where clause" }),
|
|
4066
|
+
/* @__PURE__ */ t("pre", { className: "overflow-x-auto whitespace-pre-wrap break-words rounded-[6px] border border-border bg-muted/40 px-3 py-2 font-mono text-[12px] leading-[1.55] text-foreground", children: U(s) })
|
|
4048
4067
|
] })
|
|
4049
4068
|
] }),
|
|
4050
4069
|
i ? null : /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-3 py-2.5", children: [
|
|
@@ -4073,17 +4092,17 @@ function Ir({
|
|
|
4073
4092
|
] });
|
|
4074
4093
|
}
|
|
4075
4094
|
export {
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4095
|
+
Tr as A,
|
|
4096
|
+
Ar as C,
|
|
4097
|
+
Ir as F,
|
|
4098
|
+
Ga as I,
|
|
4099
|
+
Sa as L,
|
|
4100
|
+
$r as V,
|
|
4101
|
+
Lr as a,
|
|
4102
|
+
Or as b,
|
|
4103
|
+
nn as c,
|
|
4104
|
+
Ba as d,
|
|
4105
|
+
qa as g,
|
|
4106
|
+
an as i,
|
|
4107
|
+
Fr as u
|
|
4089
4108
|
};
|