@databrainhq/plugin 0.17.9-beta.33 → 0.17.9-beta.34
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/{Accordion-BdGcYoH_.mjs → Accordion-DtzU-kv3.mjs} +1 -1
- package/dist/{Chart-D3fn0ghg.mjs → Chart-BKjKglnR.mjs} +760 -760
- package/dist/{CreateGlobalFilter-8t6GSGyT.mjs → CreateGlobalFilter-COJr9pxx.mjs} +195 -195
- package/dist/{CreateMetricV2-BJoSn42i.mjs → CreateMetricV2-CfcDgw3E.mjs} +146 -146
- package/dist/{DraggableItem-CzPHM5Ek.mjs → DraggableItem-B8IW0_no.mjs} +139 -139
- package/dist/{HorizontalStackTable-DNBbrIFn.mjs → HorizontalStackTable-BgTor_KQ.mjs} +48 -48
- package/dist/{ManageMetricsV2-1fBC-FFm.mjs → ManageMetricsV2-DM8gofxF.mjs} +3 -3
- package/dist/{MetricCardV2-D7p6yAv5.mjs → MetricCardV2-Ff__3yWl.mjs} +146 -146
- package/dist/{NoDataFound-1gLzunO6.mjs → NoDataFound-Ifpvns9-.mjs} +1 -1
- package/dist/{NoDataState-rNtw1p0V.mjs → NoDataState-DPVhHP6M.mjs} +2 -2
- package/dist/{Panel-DQXH8IBE.mjs → Panel-BUwtA4r-.mjs} +1 -1
- package/dist/{PivotTableV2-DfzyY9RC.mjs → PivotTableV2-DQU2H33d.mjs} +2 -2
- package/dist/{PivotTableV3-B97O3ZLD.mjs → PivotTableV3-BLp5-cQr.mjs} +4 -4
- package/dist/{Portal-DE_CdG2S.mjs → Portal-BP2ivXF8.mjs} +2480 -2388
- package/dist/{RadioButton-BOkJ0ZLZ.mjs → RadioButton-oGBMxhHq.mjs} +2 -2
- package/dist/{ScheduleEmail-BpdnxS9q.mjs → ScheduleEmail-CiO6PMLd.mjs} +517 -517
- package/dist/{SearchMetricData-sBWIMhvT.mjs → SearchMetricData-C4stwNY9.mjs} +1272 -1272
- package/dist/{SortPanel-CNjSmhPX.mjs → SortPanel-Cy82r5dX.mjs} +1332 -1332
- package/dist/{Table-ODMPh1l7.mjs → Table-Cg4EZCAG.mjs} +296 -296
- package/dist/{TagInputField-DYDsUtvi.mjs → TagInputField-DuY_whs7.mjs} +9 -9
- package/dist/{TextAreaField-D4VprIA4.mjs → TextAreaField-D5O-kEVL.mjs} +297 -297
- package/dist/{TimeSeriesSettings-BTj3ofRS.mjs → TimeSeriesSettings-TXu0_07R.mjs} +11 -11
- package/dist/{arrayToCsvString-D9T6ms_d.mjs → arrayToCsvString-Bj2E5XgM.mjs} +1 -1
- package/dist/{cardActions-BLBLsjcd.mjs → cardActions-BPRHHm2G.mjs} +21 -7
- package/dist/{cardQueryError-tZcXyRqS.mjs → cardQueryError-DFKFCfFx.mjs} +1274 -1274
- package/dist/{charts-CY0Vq7Bn.mjs → charts-C2loGjFP.mjs} +3 -3
- package/dist/{chevron-down-mMC3ps2h.mjs → chevron-down-BWD1dxqC.mjs} +6 -6
- package/dist/{conditionalFormatting-LaI9Vca7.mjs → conditionalFormatting-Ca-leGbK.mjs} +1 -1
- package/dist/{contrast-Clo5ZlPI.mjs → contrast-EppiiunY.mjs} +117 -112
- package/dist/{createGlobalFilter.module-CWkuVq9m.mjs → createGlobalFilter.module-B3yI7_04.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-mz_HZpET.mjs → echarts-CsSfDZ5q.mjs} +2 -2
- package/dist/{metric.mutation-B8OUNYhj.mjs → metric.mutation-hYspHj1p.mjs} +1 -1
- package/dist/{option-ywDB8mz_.mjs → option-B1zeYJnm.mjs} +1 -1
- package/dist/{permissions-Rp1874rG.mjs → permissions-Bc9NDT2w.mjs} +359 -359
- package/dist/{pluginV3Request-CK6p_HfU.mjs → pluginV3Request-DFy6TETh.mjs} +1 -1
- package/dist/{renderer-DEc5om01.mjs → renderer-Bk8GbA94.mjs} +2 -2
- package/dist/{theme-CU-AvQm_.mjs → theme-BA-MvZE0.mjs} +1 -1
- package/dist/{timeseries-BBiiZaG9.mjs → timeseries-kGhqoQ6V.mjs} +1948 -1942
- package/dist/{toTasteAppearance-BnmM-nar.mjs → toTasteAppearance-CGUd4zvZ.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-CTqOyx82.mjs → useGuesTokenUsageLog-CVeQacbL.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-BsHt2ki1.mjs → usePublishArchivedMetrics-BGEBFLub.mjs} +2 -2
- package/dist/{useQuery-B_9KK0aG.mjs → useQuery-CNVFkkjT.mjs} +1 -1
- package/dist/webcomponents.es.js +3942 -3939
- package/dist/webcomponents.umd.js +184 -184
- package/package.json +2 -2
|
@@ -3,14 +3,14 @@ import "react-dom";
|
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { o as e } from "./rolldown-runtime-C1JUX4Ur.mjs";
|
|
5
5
|
import { s as t } from "./cardStates-DiUMQ7_o.mjs";
|
|
6
|
-
import { fn as n, rn as r } from "./pluginV3Request-
|
|
7
|
-
import { K as i, W as a, ct as o, et as s, ot as c } from "./metric.mutation-
|
|
8
|
-
import {
|
|
9
|
-
import { r as
|
|
10
|
-
import { c as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as Se } from "./Panel-
|
|
6
|
+
import { fn as n, rn as r } from "./pluginV3Request-DFy6TETh.mjs";
|
|
7
|
+
import { K as i, W as a, ct as o, et as s, ot as c } from "./metric.mutation-hYspHj1p.mjs";
|
|
8
|
+
import { A as l, D as u, E as d, En as f, Gn as p, Ha as m, I as h, Ia as g, J as _, K as v, Ki as y, Kn as b, L as x, La as S, M as C, Ma as w, N as T, O as E, Q as D, St as ee, T as O, Ua as k, Wa as A, Wt as j, Xa as M, bt as N, d as P, dr as F, ea as te, f as I, ga as L, h as ne, ia as re, j as ie, ja as R, k as ae, m as z, mr as B, n as oe, ot as se, p as ce, rt as le, ti as V, u as ue, ut as de, yt as fe, za as H } from "./Portal-BP2ivXF8.mjs";
|
|
9
|
+
import { r as pe } from "./timeseries-kGhqoQ6V.mjs";
|
|
10
|
+
import { c as me, d as he, l as ge, n as _e, p as ve, r as ye, t as U } from "./RadioButton-oGBMxhHq.mjs";
|
|
11
|
+
import { t as be } from "./useGuesTokenUsageLog-CVeQacbL.mjs";
|
|
12
|
+
import { t as xe } from "./NoDataFound-Ifpvns9-.mjs";
|
|
13
|
+
import { t as Se } from "./Panel-BUwtA4r-.mjs";
|
|
14
14
|
import { t as W } from "./Switch-CqsadJBs.mjs";
|
|
15
15
|
import { t as Ce } from "./Loader-CHJMbWv0.mjs";
|
|
16
16
|
import we, { useCallback as G, useEffect as K, useMemo as q, useRef as Te, useState as J } from "react";
|
|
@@ -90,7 +90,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
90
90
|
}, $e = (e) => Ze(e).replace(/;+\s*$/, "").includes(";"), et = (e) => {
|
|
91
91
|
let t = Ze(e).trim().toLowerCase();
|
|
92
92
|
return t.startsWith("select") || t.startsWith("with");
|
|
93
|
-
}, tt = (e) => $e(e) || !et(e) || Qe(e), nt = ({ isElement: e, isBlocked: t, query: n, companyId: r, dbName: i, message: a, decrypt: o =
|
|
93
|
+
}, tt = (e) => $e(e) || !et(e) || Qe(e), nt = ({ isElement: e, isBlocked: t, query: n, companyId: r, dbName: i, message: a, decrypt: o = S }) => {
|
|
94
94
|
if (e) return "";
|
|
95
95
|
if (t || rt({
|
|
96
96
|
companyId: r,
|
|
@@ -99,9 +99,9 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
99
99
|
})) return a || "Metric query is still generating. Please run or preview the metric before saving.";
|
|
100
100
|
let s = n?.trim() || "", c = r ? o(s, r).trim() : s.startsWith("U2FsdGVk") ? "" : s;
|
|
101
101
|
if (c) try {
|
|
102
|
-
|
|
102
|
+
b(c, "metric.query", i);
|
|
103
103
|
} catch (e) {
|
|
104
|
-
if (e instanceof
|
|
104
|
+
if (e instanceof p) return e.message;
|
|
105
105
|
throw e;
|
|
106
106
|
}
|
|
107
107
|
return "";
|
|
@@ -111,7 +111,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
111
111
|
}, it = ({ companyId: e, decrypt: t, previousQuery: n }) => {
|
|
112
112
|
let r = n?.trim() || "";
|
|
113
113
|
return r ? !r.startsWith("U2FsdGVk") || !e || !!t(r, e).trim() : !1;
|
|
114
|
-
}, at = ({ rawQuery: e, previousQuery: t, limit: n, dbName: r, companyId: i, isUpdate: a, getLimitedQuery: o =
|
|
114
|
+
}, at = ({ rawQuery: e, previousQuery: t, limit: n, dbName: r, companyId: i, isUpdate: a, getLimitedQuery: o = he, encrypt: s = H, decrypt: c = S }) => {
|
|
115
115
|
let l = e?.trim() || "", u = l && o({
|
|
116
116
|
query: l,
|
|
117
117
|
limit: n,
|
|
@@ -163,17 +163,17 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
163
163
|
cancel: "_cancel_1kcj9_24",
|
|
164
164
|
error: "_error_1kcj9_28"
|
|
165
165
|
}, st = ({ onSubmit: e, defaultValues: t, onCancel: n, error: r, isCreatingMetric: i }) => {
|
|
166
|
-
let { register: a, handleSubmit: o, setValue: s, formState: { errors: c }, watch: l } =
|
|
166
|
+
let { register: a, handleSubmit: o, setValue: s, formState: { errors: c }, watch: l } = ee(), u = l("name"), d = l("metricId");
|
|
167
167
|
return K(() => {
|
|
168
168
|
t && !i && (s("name", t.name), s("description", t.description), s("metricId", t.metricId));
|
|
169
169
|
}, [t]), K(() => {
|
|
170
|
-
!t && u?.trim()?.length >= 4 && !d && s("metricId", `${u}_${
|
|
170
|
+
!t && u?.trim()?.length >= 4 && !d && s("metricId", `${u}_${j(10)}`);
|
|
171
171
|
}, [t, u]), /* @__PURE__ */ Z("form", {
|
|
172
172
|
onSubmit: o((t) => e(t, !1)),
|
|
173
173
|
children: [
|
|
174
174
|
/* @__PURE__ */ Z("div", {
|
|
175
175
|
className: ot.container,
|
|
176
|
-
children: [/* @__PURE__ */ X(
|
|
176
|
+
children: [/* @__PURE__ */ X(_, {
|
|
177
177
|
name: "name",
|
|
178
178
|
type: "text",
|
|
179
179
|
placeholder: "What is the name of the metric?",
|
|
@@ -195,7 +195,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
195
195
|
defaultValue: t?.description
|
|
196
196
|
})]
|
|
197
197
|
}),
|
|
198
|
-
!!r && /* @__PURE__ */ X(
|
|
198
|
+
!!r && /* @__PURE__ */ X(M, {
|
|
199
199
|
variant: "body-text-2",
|
|
200
200
|
color: "alert",
|
|
201
201
|
children: r
|
|
@@ -204,13 +204,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
204
204
|
className: "dbn:absolute dbn:w-full dbn:h-full dbn:top-0 dbn:bg-black/[0.1]",
|
|
205
205
|
children: /* @__PURE__ */ X(Ce, {})
|
|
206
206
|
}),
|
|
207
|
-
/* @__PURE__ */ Z(
|
|
207
|
+
/* @__PURE__ */ Z(v, { children: [/* @__PURE__ */ X(k, {
|
|
208
208
|
type: "reset",
|
|
209
209
|
variant: "tab",
|
|
210
210
|
onClick: n,
|
|
211
211
|
className: "cta-secondary",
|
|
212
212
|
children: "Cancel"
|
|
213
|
-
}), /* @__PURE__ */ X(
|
|
213
|
+
}), /* @__PURE__ */ X(k, {
|
|
214
214
|
type: "submit",
|
|
215
215
|
variant: "primary",
|
|
216
216
|
isDisabled: i,
|
|
@@ -270,31 +270,31 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
270
270
|
}, pt = (e, t = []) => {
|
|
271
271
|
let n = e?.configuration?.rlsConditions, r = e?.newDatasetSettings?.configuration?.rlsConditions;
|
|
272
272
|
return n?.length ? n : r?.length ? r : n || r ? [] : t;
|
|
273
|
-
}, mt = ({ onSuccess: e, companyIntegrationId: a, selectedColumns: l, query: u, metricQuery:
|
|
274
|
-
let { token: P, data: F } =
|
|
273
|
+
}, mt = ({ onSuccess: e, companyIntegrationId: a, selectedColumns: l, query: u, metricQuery: d, integrationName: f, outputColumns: p, chartSettings: h, clientId: g, companyId: _, isLiveMode: v, timeGrain: b, dashboardIds: x, isEnableGroupBy: S, groupBy: C, selectedGroupBy: w, metric: T, datasetMetricSettings: E, drillDownSettings: O, onServerEvent: k, limit: A, isMetricQuerySaveBlocked: j, metricQuerySaveBlockReason: M, clickBehaviourConfigs: N }) => {
|
|
274
|
+
let { token: P, data: F } = m(), [te, I] = J(""), L = G((e) => {
|
|
275
275
|
let n = t(e);
|
|
276
|
-
i("metric_update_failed", { error_code: n?.code || "UNKNOWN" }),
|
|
277
|
-
}, []), { mutate: ne, isPending:
|
|
278
|
-
|
|
276
|
+
i("metric_update_failed", { error_code: n?.code || "UNKNOWN" }), I(ft(e, "Something went wrong! Please try again later."));
|
|
277
|
+
}, []), { mutate: ne, isPending: ie } = D(), { mutate: ae } = le(), { saveLogsAsync: z } = be(), { register: B, setValue: oe, watch: ce, handleSubmit: V, control: ue, reset: fe } = ee(), H = q(() => y(h), [h]), pe = (t) => {
|
|
278
|
+
I("");
|
|
279
279
|
let n = nt({
|
|
280
|
-
isBlocked:
|
|
280
|
+
isBlocked: j,
|
|
281
281
|
query: u,
|
|
282
|
-
companyId:
|
|
283
|
-
dbName:
|
|
284
|
-
message:
|
|
282
|
+
companyId: _,
|
|
283
|
+
dbName: f,
|
|
284
|
+
message: M
|
|
285
285
|
});
|
|
286
286
|
if (n) {
|
|
287
287
|
s("create-metric-blocked", {
|
|
288
|
-
isMetricQuerySaveBlocked: !!
|
|
288
|
+
isMetricQuerySaveBlocked: !!j,
|
|
289
289
|
hasQuery: !!u,
|
|
290
290
|
queryLength: u?.length || 0,
|
|
291
291
|
blockReasonLength: n.length
|
|
292
|
-
}),
|
|
292
|
+
}), I(n);
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
-
let
|
|
295
|
+
let m = h?.chartType === R.singleValue, y = pt(E), T = ve(E), D = Date.now();
|
|
296
296
|
s("create-metric-start", {
|
|
297
|
-
isSingleChartMetric:
|
|
297
|
+
isSingleChartMetric: m,
|
|
298
298
|
hasToken: !!P,
|
|
299
299
|
tokenLength: P?.length || 0,
|
|
300
300
|
...o({
|
|
@@ -303,113 +303,113 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
303
303
|
name: t.name,
|
|
304
304
|
description: t.description,
|
|
305
305
|
query: u,
|
|
306
|
-
metricQuery:
|
|
306
|
+
metricQuery: d,
|
|
307
307
|
chartOptions: h,
|
|
308
|
-
isLive:
|
|
309
|
-
isCreatedByClient: !!
|
|
308
|
+
isLive: v,
|
|
309
|
+
isCreatedByClient: !!g,
|
|
310
310
|
isEnableGroupBy: S,
|
|
311
311
|
inputFields: l,
|
|
312
|
-
rlsConditions:
|
|
312
|
+
rlsConditions: y,
|
|
313
313
|
externalDashboardIds: x,
|
|
314
314
|
drillDownSettings: O,
|
|
315
|
-
datasetMetricSettings:
|
|
316
|
-
limit:
|
|
315
|
+
datasetMetricSettings: T,
|
|
316
|
+
limit: A
|
|
317
317
|
})
|
|
318
318
|
}), ne({
|
|
319
319
|
data: {
|
|
320
|
-
companyId:
|
|
320
|
+
companyId: _,
|
|
321
321
|
companyIntegrationId: a,
|
|
322
322
|
description: t.description,
|
|
323
323
|
inputFields: l,
|
|
324
324
|
metricId: t.metricId,
|
|
325
325
|
name: t.name,
|
|
326
326
|
query: u,
|
|
327
|
-
metricQuery:
|
|
328
|
-
integrationName:
|
|
329
|
-
outputColumns:
|
|
330
|
-
createdBy:
|
|
331
|
-
isLive:
|
|
332
|
-
chartOptions:
|
|
333
|
-
datasetMetricSettings:
|
|
334
|
-
clientId:
|
|
335
|
-
isCreatedByClient: !!
|
|
336
|
-
isAutomaticClientScopeEnabled: !!
|
|
327
|
+
metricQuery: d,
|
|
328
|
+
integrationName: f,
|
|
329
|
+
outputColumns: p,
|
|
330
|
+
createdBy: g || "external user",
|
|
331
|
+
isLive: v || !1,
|
|
332
|
+
chartOptions: H,
|
|
333
|
+
datasetMetricSettings: T,
|
|
334
|
+
clientId: g || null,
|
|
335
|
+
isCreatedByClient: !!g,
|
|
336
|
+
isAutomaticClientScopeEnabled: !!g,
|
|
337
337
|
timeGrain: b || null,
|
|
338
338
|
externalDashboardIds: x?.map((e) => ({ externalDashboardId: e })),
|
|
339
339
|
isEnableGroupBy: S,
|
|
340
340
|
groupBy: C ?? {},
|
|
341
341
|
selectedGroupBy: w,
|
|
342
|
-
rlsConditions:
|
|
342
|
+
rlsConditions: y,
|
|
343
343
|
drillDownSettings: O,
|
|
344
|
-
limit:
|
|
344
|
+
limit: A,
|
|
345
345
|
clickActions: N
|
|
346
346
|
},
|
|
347
347
|
token: P
|
|
348
348
|
}, {
|
|
349
349
|
onSuccess: async (t) => {
|
|
350
350
|
!t?.error && !t?.errorDetail && t?.insert_externalMetrics_one?.id ? (s("create-metric-success", {
|
|
351
|
-
durationMs: Date.now() -
|
|
351
|
+
durationMs: Date.now() - D,
|
|
352
352
|
metricRowId: t?.insert_externalMetrics_one?.id
|
|
353
353
|
}), await z({
|
|
354
|
-
clientId:
|
|
354
|
+
clientId: g,
|
|
355
355
|
data: {
|
|
356
|
-
companyId:
|
|
356
|
+
companyId: _,
|
|
357
357
|
feature: "CREATE_METRIC",
|
|
358
358
|
metricId: t?.insert_externalMetrics_one?.metricId
|
|
359
359
|
},
|
|
360
360
|
isFrontendApp: !1,
|
|
361
361
|
token: P
|
|
362
|
-
}), await e?.(t?.insert_externalMetrics_one?.id),
|
|
363
|
-
durationMs: Date.now() -
|
|
362
|
+
}), await e?.(t?.insert_externalMetrics_one?.id), k?.(r)) : (s("create-metric-rejected", {
|
|
363
|
+
durationMs: Date.now() - D,
|
|
364
364
|
reason: "NO_ID_IN_RESPONSE",
|
|
365
365
|
responseKeys: Object.keys(t || {})
|
|
366
|
-
}),
|
|
366
|
+
}), I(ft(t, "Metric Id already exists")));
|
|
367
367
|
},
|
|
368
368
|
onError: (e) => {
|
|
369
369
|
s("create-metric-failed", {
|
|
370
|
-
durationMs: Date.now() -
|
|
370
|
+
durationMs: Date.now() - D,
|
|
371
371
|
...c(e)
|
|
372
372
|
});
|
|
373
373
|
let t = e?.status;
|
|
374
374
|
i("metric_create_failed", {
|
|
375
375
|
error_code: e?.code || (t ? `HTTP_${t}` : "UNKNOWN"),
|
|
376
376
|
status: t
|
|
377
|
-
}),
|
|
377
|
+
}), I && I(ft(e));
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
|
-
}, { mutateAsync:
|
|
381
|
-
|
|
380
|
+
}, { mutateAsync: he, isPending: U } = se(), { mutateAsync: xe, isPending: Se } = de(), W = G((t, r) => {
|
|
381
|
+
I("");
|
|
382
382
|
let i = nt({
|
|
383
383
|
isElement: r,
|
|
384
|
-
isBlocked:
|
|
384
|
+
isBlocked: j,
|
|
385
385
|
query: u,
|
|
386
|
-
companyId:
|
|
387
|
-
dbName:
|
|
388
|
-
message:
|
|
386
|
+
companyId: _,
|
|
387
|
+
dbName: f,
|
|
388
|
+
message: M
|
|
389
389
|
});
|
|
390
390
|
if (i) {
|
|
391
391
|
s("update-metric-blocked", {
|
|
392
392
|
reason: "QUERY_SAVE_BLOCKED",
|
|
393
393
|
isElement: !!r,
|
|
394
|
-
isMetricQuerySaveBlocked: !!
|
|
394
|
+
isMetricQuerySaveBlocked: !!j,
|
|
395
395
|
hasQuery: !!u,
|
|
396
396
|
queryLength: u?.length || 0
|
|
397
|
-
}),
|
|
397
|
+
}), I(i);
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
|
-
let
|
|
401
|
-
if (T?.isAutomaticClientScopeEnabled === !0 && T?.isCreatedByClient === !0 &&
|
|
402
|
-
let e =
|
|
400
|
+
let m = E?.configuration || E?.newDatasetSettings?.configuration || T?.datasetMetricSettings?.configuration || T?.datasetMetricSettings?.newDatasetSettings?.configuration, y = ve(E), b = F?.clientSubsetData?.relationships, S = F?.clientSubsetData?.tableList, C = F?.companyTenancyType || "TABLE";
|
|
401
|
+
if (T?.isAutomaticClientScopeEnabled === !0 && T?.isCreatedByClient === !0 && m) {
|
|
402
|
+
let e = ge(m?.table?.joins || [], b, T?.isCreatedByClient, C, T?.integrationName, m?.table), t = me(m, S, T?.isCreatedByClient, C, T?.integrationName);
|
|
403
403
|
if (!e || !t) {
|
|
404
404
|
s("update-metric-blocked", {
|
|
405
405
|
reason: "STALE_SCHEMA",
|
|
406
406
|
isRelationshipPresent: e,
|
|
407
407
|
isColumnPresent: t,
|
|
408
408
|
companyTenancyType: C,
|
|
409
|
-
joinCount:
|
|
409
|
+
joinCount: m?.table?.joins?.length || 0,
|
|
410
410
|
fetchedJoinCount: b?.length || 0,
|
|
411
411
|
fetchedTableCount: S?.length || 0
|
|
412
|
-
}),
|
|
412
|
+
}), I("Something went wrong! Please try again later.");
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
@@ -443,34 +443,34 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
443
443
|
name: t.name,
|
|
444
444
|
description: t.description,
|
|
445
445
|
query: u,
|
|
446
|
-
metricQuery:
|
|
446
|
+
metricQuery: d,
|
|
447
447
|
chartOptions: h,
|
|
448
|
-
isLive:
|
|
449
|
-
isCreatedByClient: !!
|
|
448
|
+
isLive: v || t.isLive,
|
|
449
|
+
isCreatedByClient: !!g,
|
|
450
450
|
inputFields: l,
|
|
451
451
|
externalDashboardIds: x,
|
|
452
452
|
drillDownSettings: O,
|
|
453
|
-
datasetMetricSettings:
|
|
454
|
-
limit:
|
|
453
|
+
datasetMetricSettings: y,
|
|
454
|
+
limit: A
|
|
455
455
|
})
|
|
456
456
|
}), T?.isCreatedByClient) {
|
|
457
457
|
let i = pt(E, T?.rlsConditions || []), a = pt(T?.datasetMetricSettings, T?.rlsConditions || []), o = {
|
|
458
|
-
chartOptions:
|
|
458
|
+
chartOptions: H,
|
|
459
459
|
clickActions: N,
|
|
460
|
-
datasetMetricSettings:
|
|
461
|
-
...
|
|
460
|
+
datasetMetricSettings: y,
|
|
461
|
+
...ye({
|
|
462
462
|
opened: a,
|
|
463
463
|
next: i
|
|
464
464
|
}),
|
|
465
|
-
limit:
|
|
465
|
+
limit: A,
|
|
466
466
|
description: t.description,
|
|
467
467
|
query: u,
|
|
468
|
-
metricQuery:
|
|
468
|
+
metricQuery: d,
|
|
469
469
|
drillDownSettings: O,
|
|
470
470
|
elementSettings: w,
|
|
471
471
|
isMetric: !r
|
|
472
472
|
};
|
|
473
|
-
t.description && (o.description = t.description), t.metricId && (o.metricId = t.metricId), t.name && !r && (o.name = t.name), t.elementTitle && r && (o.name = t?.elementTitle), Object.keys(w)?.length && (o.elementSettings = w),
|
|
473
|
+
t.description && (o.description = t.description), t.metricId && (o.metricId = t.metricId), t.name && !r && (o.name = t.name), t.elementTitle && r && (o.name = t?.elementTitle), Object.keys(w)?.length && (o.elementSettings = w), xe({
|
|
474
474
|
data: {
|
|
475
475
|
externalMetricId: T?.id,
|
|
476
476
|
set: o
|
|
@@ -484,30 +484,30 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
484
484
|
durationMs: Date.now() - D,
|
|
485
485
|
reason: "NO_ID_IN_RESPONSE",
|
|
486
486
|
responseKeys: Object.keys(t || {})
|
|
487
|
-
}),
|
|
487
|
+
}), L(t);
|
|
488
488
|
return;
|
|
489
489
|
}
|
|
490
490
|
s("update-metric-success", {
|
|
491
491
|
path: "client",
|
|
492
492
|
durationMs: Date.now() - D,
|
|
493
493
|
metricRowId: t?.update_externalMetrics_by_pk?.id
|
|
494
|
-
}),
|
|
495
|
-
clientId:
|
|
494
|
+
}), I(""), await z({
|
|
495
|
+
clientId: g,
|
|
496
496
|
data: {
|
|
497
|
-
companyId:
|
|
497
|
+
companyId: _,
|
|
498
498
|
feature: "UPDATE_METRIC",
|
|
499
499
|
metricId: t?.update_externalMetrics_by_pk?.metricId
|
|
500
500
|
},
|
|
501
501
|
isFrontendApp: !1,
|
|
502
502
|
token: P
|
|
503
|
-
}), await e?.(),
|
|
503
|
+
}), await e?.(), k?.(n);
|
|
504
504
|
},
|
|
505
505
|
onError: (e) => {
|
|
506
506
|
s("update-metric-failed", {
|
|
507
507
|
path: "client",
|
|
508
508
|
durationMs: Date.now() - D,
|
|
509
509
|
...c(e)
|
|
510
|
-
}),
|
|
510
|
+
}), L(e);
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
} else {
|
|
@@ -516,39 +516,39 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
516
516
|
s("update-metric-blocked", {
|
|
517
517
|
path: "admin",
|
|
518
518
|
reason: "MISSING_METRIC_ID"
|
|
519
|
-
}),
|
|
519
|
+
}), I("Something went wrong! Please try again later.");
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
|
-
let o = pt(E, T?.rlsConditions || []),
|
|
523
|
-
|
|
522
|
+
let o = pt(E, T?.rlsConditions || []), m = ct(T?.resizeAttributes, !!r);
|
|
523
|
+
he({
|
|
524
524
|
data: {
|
|
525
525
|
externalMetricId: i,
|
|
526
|
-
clientId:
|
|
526
|
+
clientId: g,
|
|
527
527
|
object: {
|
|
528
|
-
clientId:
|
|
529
|
-
companyId:
|
|
528
|
+
clientId: g,
|
|
529
|
+
companyId: _,
|
|
530
530
|
companyIntegrationId: a || T?.companyIntegrationId,
|
|
531
531
|
description: t.description,
|
|
532
532
|
inputFields: l,
|
|
533
|
-
metricId: t.metricId === T?.metricId ? `update_${t.metricId}_by_${
|
|
533
|
+
metricId: t.metricId === T?.metricId ? `update_${t.metricId}_by_${g}_${Date.now()}` : t.metricId,
|
|
534
534
|
name: r ? t?.elementTitle?.trim() : t?.name?.trim(),
|
|
535
535
|
query: u,
|
|
536
|
-
metricQuery:
|
|
537
|
-
datasetMetricSettings:
|
|
536
|
+
metricQuery: d,
|
|
537
|
+
datasetMetricSettings: y,
|
|
538
538
|
rlsConditions: o,
|
|
539
|
-
integrationName:
|
|
540
|
-
outputColumns:
|
|
541
|
-
createdBy:
|
|
542
|
-
isCreatedByClient: !!
|
|
543
|
-
isAutomaticClientScopeEnabled: !!
|
|
544
|
-
isLive:
|
|
545
|
-
chartOptions:
|
|
539
|
+
integrationName: f,
|
|
540
|
+
outputColumns: p,
|
|
541
|
+
createdBy: g || "external user",
|
|
542
|
+
isCreatedByClient: !!g,
|
|
543
|
+
isAutomaticClientScopeEnabled: !!g,
|
|
544
|
+
isLive: v || t.isLive,
|
|
545
|
+
chartOptions: H,
|
|
546
546
|
clickActions: N,
|
|
547
|
-
limit:
|
|
547
|
+
limit: A,
|
|
548
548
|
drillDownSettings: O,
|
|
549
549
|
elementSettings: w,
|
|
550
550
|
isMetric: !r,
|
|
551
|
-
resizeAttributes:
|
|
551
|
+
resizeAttributes: m,
|
|
552
552
|
externalDashboardMetrics: { data: x?.map((e) => ({ externalDashboardId: e })) }
|
|
553
553
|
}
|
|
554
554
|
},
|
|
@@ -563,17 +563,17 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
563
563
|
hasDeletedMetricRow: !!t?.insert_clientDeletedMetrics_one,
|
|
564
564
|
hasInsertedMetricRow: !!t?.insert_externalMetrics_one,
|
|
565
565
|
responseKeys: Object.keys(t || {})
|
|
566
|
-
}),
|
|
566
|
+
}), L(t);
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
s("update-metric-success", {
|
|
570
570
|
path: "admin",
|
|
571
571
|
durationMs: Date.now() - D,
|
|
572
572
|
metricRowId: t?.insert_externalMetrics_one?.id
|
|
573
|
-
}),
|
|
574
|
-
clientId:
|
|
573
|
+
}), I(""), await z({
|
|
574
|
+
clientId: g,
|
|
575
575
|
data: {
|
|
576
|
-
companyId:
|
|
576
|
+
companyId: _,
|
|
577
577
|
feature: "UPDATE_METRIC",
|
|
578
578
|
metricId: t?.insert_externalMetrics_one?.metricId
|
|
579
579
|
},
|
|
@@ -581,44 +581,44 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
581
581
|
token: P
|
|
582
582
|
}), await e?.(t.insert_externalMetrics_one.id, {
|
|
583
583
|
replacedMetricId: i,
|
|
584
|
-
resizeAttributes:
|
|
585
|
-
}),
|
|
584
|
+
resizeAttributes: m
|
|
585
|
+
}), k?.(n);
|
|
586
586
|
},
|
|
587
587
|
onError: (e) => {
|
|
588
588
|
s("update-metric-failed", {
|
|
589
589
|
path: "admin",
|
|
590
590
|
durationMs: Date.now() - D,
|
|
591
591
|
...c(e)
|
|
592
|
-
}),
|
|
592
|
+
}), L(e);
|
|
593
593
|
}
|
|
594
594
|
});
|
|
595
595
|
}
|
|
596
596
|
}, [
|
|
597
597
|
h,
|
|
598
|
-
|
|
598
|
+
H,
|
|
599
599
|
N,
|
|
600
600
|
T,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
xe,
|
|
602
|
+
he,
|
|
603
|
+
L,
|
|
604
|
+
g,
|
|
604
605
|
_,
|
|
605
|
-
v,
|
|
606
606
|
a,
|
|
607
|
-
|
|
608
|
-
|
|
607
|
+
f,
|
|
608
|
+
v,
|
|
609
609
|
x,
|
|
610
610
|
u,
|
|
611
611
|
l,
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
p,
|
|
613
|
+
d,
|
|
614
614
|
E,
|
|
615
|
+
A,
|
|
615
616
|
j,
|
|
616
|
-
M
|
|
617
|
-
te
|
|
617
|
+
M
|
|
618
618
|
]), Ce = G((t) => {
|
|
619
|
-
|
|
619
|
+
I("");
|
|
620
620
|
let n = { isPublished: !t?.isPublished };
|
|
621
|
-
|
|
621
|
+
xe({
|
|
622
622
|
data: {
|
|
623
623
|
externalMetricId: t?.id,
|
|
624
624
|
set: n
|
|
@@ -627,13 +627,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
627
627
|
}, {
|
|
628
628
|
onSuccess: async (t) => {
|
|
629
629
|
if (t?.error || t?.errorDetail || !t?.update_externalMetrics_by_pk?.id) {
|
|
630
|
-
|
|
630
|
+
L(t);
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
|
-
|
|
634
|
-
clientId:
|
|
633
|
+
I(""), await z({
|
|
634
|
+
clientId: g,
|
|
635
635
|
data: {
|
|
636
|
-
companyId:
|
|
636
|
+
companyId: _,
|
|
637
637
|
feature: "UPDATE_METRIC",
|
|
638
638
|
metricId: t?.update_externalMetrics_by_pk?.metricId
|
|
639
639
|
},
|
|
@@ -642,41 +642,41 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
642
642
|
}), e?.();
|
|
643
643
|
},
|
|
644
644
|
onError: (e) => {
|
|
645
|
-
|
|
645
|
+
L(e);
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
|
-
}, [T,
|
|
648
|
+
}, [T, L]);
|
|
649
649
|
return {
|
|
650
|
-
createExternalMetric:
|
|
650
|
+
createExternalMetric: pe,
|
|
651
651
|
updateExternalMetric: W,
|
|
652
|
-
error:
|
|
653
|
-
isLoading:
|
|
652
|
+
error: te,
|
|
653
|
+
isLoading: ie || U || Se,
|
|
654
654
|
clientSubsetData: F?.clientSubsetData,
|
|
655
|
-
previewTable:
|
|
655
|
+
previewTable: ae,
|
|
656
656
|
token: P,
|
|
657
657
|
workspaceId: F?.workspace?.id,
|
|
658
658
|
dashboardOptions: [{
|
|
659
659
|
value: F?.externalDashboard?.id,
|
|
660
660
|
label: F?.externalDashboard?.name || "Dashboard"
|
|
661
661
|
}],
|
|
662
|
-
isDatabaseTenancy: F?.companyTenancyType ===
|
|
663
|
-
isClientDatabaseScoped:
|
|
664
|
-
register:
|
|
662
|
+
isDatabaseTenancy: F?.companyTenancyType === re,
|
|
663
|
+
isClientDatabaseScoped: _e(F?.companyTenancyType),
|
|
664
|
+
register: B,
|
|
665
665
|
setValue: oe,
|
|
666
666
|
watch: ce,
|
|
667
|
-
handleSubmit:
|
|
668
|
-
control:
|
|
667
|
+
handleSubmit: V,
|
|
668
|
+
control: ue,
|
|
669
669
|
reset: fe,
|
|
670
670
|
onPublishMetric: Ce
|
|
671
671
|
};
|
|
672
|
-
}, ht =
|
|
672
|
+
}, ht = fe({
|
|
673
673
|
active: null,
|
|
674
674
|
over: null,
|
|
675
675
|
DragPreviewCreateRoot: null,
|
|
676
676
|
draggables: [],
|
|
677
677
|
droppables: []
|
|
678
678
|
}), gt = () => {
|
|
679
|
-
let [e, t] =
|
|
679
|
+
let [e, t] = N(ht);
|
|
680
680
|
return {
|
|
681
681
|
dndState: e,
|
|
682
682
|
setActive: (e) => {
|
|
@@ -859,7 +859,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
859
859
|
}, yt = ({ label: e, varaint: t = "success", size: n = "sm", onClick: r, className: i, indicator: a }) => /* @__PURE__ */ Z("div", {
|
|
860
860
|
className: `${vt.badge} ${vt[t]} ${i}`,
|
|
861
861
|
onClick: r,
|
|
862
|
-
children: [a || null, e ? /* @__PURE__ */ X(
|
|
862
|
+
children: [a || null, e ? /* @__PURE__ */ X(M, {
|
|
863
863
|
variant: {
|
|
864
864
|
xs: "input-label",
|
|
865
865
|
sm: "body-text-2",
|
|
@@ -888,7 +888,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
888
888
|
field: "_field_1aig0_16",
|
|
889
889
|
textField: "_textField_1aig0_20"
|
|
890
890
|
}, xt = ({ name: e, value: t, onChange: n, defaultValue: r, placeholder: i, label: a, className: o = "", isDisabled: s, zIndex: c = 10 }) => {
|
|
891
|
-
let [l, u] = J(t || r || ""), d =
|
|
891
|
+
let [l, u] = J(t || r || ""), d = P(l, 300);
|
|
892
892
|
return K(() => {
|
|
893
893
|
t !== void 0 && t !== l && u(t);
|
|
894
894
|
}, [t]), K(() => {
|
|
@@ -912,7 +912,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
912
912
|
disabled: s,
|
|
913
913
|
onChange: ({ target: e }) => u(e.value)
|
|
914
914
|
})
|
|
915
|
-
}), /* @__PURE__ */ X(
|
|
915
|
+
}), /* @__PURE__ */ X(_, {
|
|
916
916
|
type: "text",
|
|
917
917
|
id: e,
|
|
918
918
|
name: e,
|
|
@@ -979,8 +979,8 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
979
979
|
buttonIndicator: "_buttonIndicator_1xn07_16",
|
|
980
980
|
paletteOptions: "_paletteOptions_1xn07_26"
|
|
981
981
|
}, wt = ({ color: e, id: t, index: n }) => {
|
|
982
|
-
let { attributes: r, listeners: i, setNodeRef: a, transform: o, transition: s } =
|
|
983
|
-
transform:
|
|
982
|
+
let { attributes: r, listeners: i, setNodeRef: a, transform: o, transition: s } = ae({ id: t }), c = {
|
|
983
|
+
transform: C.Transform.toString(o),
|
|
984
984
|
transition: s
|
|
985
985
|
};
|
|
986
986
|
return /* @__PURE__ */ X("button", {
|
|
@@ -1003,7 +1003,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1003
1003
|
if (!i || r.id === i.id) return;
|
|
1004
1004
|
let a = e?.chartColors?.findIndex((e, t) => `${e}-${t}` === r.id), o = e?.chartColors?.findIndex((e, t) => `${e}-${t}` === i.id);
|
|
1005
1005
|
if (a === void 0 || o === void 0) return;
|
|
1006
|
-
let s =
|
|
1006
|
+
let s = u(e?.chartColors || [], a, o);
|
|
1007
1007
|
t((e) => ({
|
|
1008
1008
|
...e,
|
|
1009
1009
|
chartColors: s
|
|
@@ -1011,7 +1011,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1011
1011
|
}, s = (t, n) => /* @__PURE__ */ Z("div", {
|
|
1012
1012
|
className: Ct.chartColors,
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */ X(
|
|
1014
|
+
/* @__PURE__ */ X(M, {
|
|
1015
1015
|
variant: "body-text-2",
|
|
1016
1016
|
children: t?.name ?? "Default"
|
|
1017
1017
|
}),
|
|
@@ -1026,10 +1026,10 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1026
1026
|
}, e))
|
|
1027
1027
|
}) : /* @__PURE__ */ X("div", {
|
|
1028
1028
|
onClick: (e) => e.stopPropagation(),
|
|
1029
|
-
children: /* @__PURE__ */ X(
|
|
1030
|
-
collisionDetection:
|
|
1029
|
+
children: /* @__PURE__ */ X(l, {
|
|
1030
|
+
collisionDetection: ie,
|
|
1031
1031
|
onDragEnd: o,
|
|
1032
|
-
children: /* @__PURE__ */ X(
|
|
1032
|
+
children: /* @__PURE__ */ X(d, {
|
|
1033
1033
|
disabled: i,
|
|
1034
1034
|
items: e?.chartColors?.map((e, t) => `${e}-${t}`) || [],
|
|
1035
1035
|
strategy: E,
|
|
@@ -1051,7 +1051,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1051
1051
|
bottom: "2.5px",
|
|
1052
1052
|
left: "16px"
|
|
1053
1053
|
},
|
|
1054
|
-
children: /* @__PURE__ */ X(
|
|
1054
|
+
children: /* @__PURE__ */ X(M, {
|
|
1055
1055
|
variant: "small-text",
|
|
1056
1056
|
color: "secondary-dark",
|
|
1057
1057
|
className: "dbn:text-xxs",
|
|
@@ -1060,7 +1060,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1060
1060
|
})
|
|
1061
1061
|
]
|
|
1062
1062
|
}), c = q(() => n?.find((t) => t.colors.length === e?.chartColors?.length && De(t.colors || [], e?.chartColors || [])), [e?.chartColors, n]);
|
|
1063
|
-
return /* @__PURE__ */ X(
|
|
1063
|
+
return /* @__PURE__ */ X(z, {
|
|
1064
1064
|
buttonContent: /* @__PURE__ */ Z("div", {
|
|
1065
1065
|
className: Ct.paletteButton,
|
|
1066
1066
|
children: [
|
|
@@ -1090,7 +1090,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1090
1090
|
className: "dbn:gap-3 dbn:max-h-[350px] dbn:overflow-y-auto dbn:p-3",
|
|
1091
1091
|
children: n.length ? n?.map((e) => /* @__PURE__ */ X("div", {
|
|
1092
1092
|
className: "dbn:w-full",
|
|
1093
|
-
children: /* @__PURE__ */ Z(
|
|
1093
|
+
children: /* @__PURE__ */ Z(k, {
|
|
1094
1094
|
variant: "tab",
|
|
1095
1095
|
className: `${Ct.paletteOptions} ${e?.name === c?.name ? "dbn:border-primary dbn:bg-actionItem-active" : ""}`,
|
|
1096
1096
|
onClick: () => {
|
|
@@ -1102,7 +1102,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1102
1102
|
},
|
|
1103
1103
|
children: [s(e, !0), /* @__PURE__ */ X("div", {
|
|
1104
1104
|
style: { width: "40px" },
|
|
1105
|
-
children: /* @__PURE__ */ X(
|
|
1105
|
+
children: /* @__PURE__ */ X(U, {
|
|
1106
1106
|
id: `${e?.name}-radio`,
|
|
1107
1107
|
name: `${e?.name}-radio`,
|
|
1108
1108
|
checked: e?.name === c?.name,
|
|
@@ -1110,7 +1110,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1110
1110
|
})
|
|
1111
1111
|
})]
|
|
1112
1112
|
})
|
|
1113
|
-
}, e.name)) : /* @__PURE__ */ X(
|
|
1113
|
+
}, e.name)) : /* @__PURE__ */ X(M, {
|
|
1114
1114
|
variant: "subtext",
|
|
1115
1115
|
children: "Palette Options not yet configured."
|
|
1116
1116
|
})
|
|
@@ -1200,23 +1200,23 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1200
1200
|
icon: "align-bottom",
|
|
1201
1201
|
tooltip: "Switch axis to Bottom"
|
|
1202
1202
|
}], kt = ({ chartSettings: e, setChartSettings: t, axis: n, setMergeAxis: r }) => {
|
|
1203
|
-
let [i, a] = J(!1), [o, s] = J(!1), [c, l] = J(!1), [u,
|
|
1203
|
+
let [i, a] = J(!1), [o, s] = J(!1), [c, l] = J(!1), [u, d] = J([]), [f, p] = J({
|
|
1204
1204
|
label: "",
|
|
1205
1205
|
upperLimit: 0,
|
|
1206
1206
|
lowerLimit: 0
|
|
1207
|
-
}),
|
|
1207
|
+
}), m = () => {
|
|
1208
1208
|
let e = n?.labelFormatter || [];
|
|
1209
|
-
|
|
1209
|
+
f?.isEdit ? t((t) => ({
|
|
1210
1210
|
...t,
|
|
1211
1211
|
customSettings: {
|
|
1212
1212
|
...t.customSettings,
|
|
1213
1213
|
comboAxisSettings: t.customSettings?.comboAxisSettings?.map((t) => t.axis === n?.axis ? {
|
|
1214
1214
|
...n,
|
|
1215
|
-
labelFormatter: e?.map((e, t) => t ===
|
|
1216
|
-
upperLimit:
|
|
1217
|
-
lowerLimit:
|
|
1218
|
-
color:
|
|
1219
|
-
label:
|
|
1215
|
+
labelFormatter: e?.map((e, t) => t === f?.index ? {
|
|
1216
|
+
upperLimit: f?.upperLimit,
|
|
1217
|
+
lowerLimit: f?.lowerLimit,
|
|
1218
|
+
color: f?.color,
|
|
1219
|
+
label: f?.label
|
|
1220
1220
|
} : e)
|
|
1221
1221
|
} : t)
|
|
1222
1222
|
}
|
|
@@ -1226,15 +1226,15 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1226
1226
|
...t.customSettings,
|
|
1227
1227
|
comboAxisSettings: t.customSettings?.comboAxisSettings?.map((t) => t.axis === n?.axis ? {
|
|
1228
1228
|
...n,
|
|
1229
|
-
labelFormatter: [...e,
|
|
1229
|
+
labelFormatter: [...e, f]
|
|
1230
1230
|
} : t)
|
|
1231
1231
|
}
|
|
1232
|
-
})),
|
|
1232
|
+
})), p({
|
|
1233
1233
|
label: "",
|
|
1234
1234
|
upperLimit: 0,
|
|
1235
1235
|
lowerLimit: 0
|
|
1236
1236
|
}), a(!1);
|
|
1237
|
-
},
|
|
1237
|
+
}, h = (e) => {
|
|
1238
1238
|
let r = n?.labelFormatter?.filter((t) => t.label !== e.label && t.lowerLimit !== e.lowerLimit && t.upperLimit !== e.upperLimit);
|
|
1239
1239
|
t((e) => ({
|
|
1240
1240
|
...e,
|
|
@@ -1246,7 +1246,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1246
1246
|
} : e)
|
|
1247
1247
|
}
|
|
1248
1248
|
}));
|
|
1249
|
-
},
|
|
1249
|
+
}, g = () => {
|
|
1250
1250
|
let e = (n?.measures)?.map((e) => {
|
|
1251
1251
|
let t = n?.chartTypes?.find((t) => t.axis === e) || {
|
|
1252
1252
|
axis: e,
|
|
@@ -1270,7 +1270,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1270
1270
|
comboAxisSettings: t.customSettings?.comboAxisSettings?.map((t) => t.axis === n?.axis ? e : t).flat()
|
|
1271
1271
|
}
|
|
1272
1272
|
}));
|
|
1273
|
-
},
|
|
1273
|
+
}, v = q(() => e?.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n.axis), [e?.customSettings?.comboAxisSettings, n.axis]), y = () => {
|
|
1274
1274
|
let e = u?.map((e) => e.measures)?.flat(), i = u?.map((e) => e.axis), a = `${n.axis} and ${u?.map((e) => e.axis)?.join(" and ")}`;
|
|
1275
1275
|
t((t) => ({
|
|
1276
1276
|
...t,
|
|
@@ -1282,10 +1282,10 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1282
1282
|
axis: a
|
|
1283
1283
|
} : t).flat()
|
|
1284
1284
|
}
|
|
1285
|
-
})), l(!1), r(""),
|
|
1286
|
-
},
|
|
1285
|
+
})), l(!1), r(""), d([]);
|
|
1286
|
+
}, b = q(() => (n.chartTypes?.map((e) => e.type)?.filter((e) => e === "bar")?.length || 0) === n?.measures?.length, [n.chartTypes, n?.measures?.length]);
|
|
1287
1287
|
K(() => {
|
|
1288
|
-
!
|
|
1288
|
+
!b && n?.isEnableStackBar && t((e) => ({
|
|
1289
1289
|
...e,
|
|
1290
1290
|
customSettings: {
|
|
1291
1291
|
...e.customSettings,
|
|
@@ -1298,13 +1298,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1298
1298
|
}, [
|
|
1299
1299
|
n?.axis,
|
|
1300
1300
|
n?.isEnableStackBar,
|
|
1301
|
-
|
|
1301
|
+
b
|
|
1302
1302
|
]);
|
|
1303
|
-
let
|
|
1303
|
+
let S = q(() => e?.chartType === R.horizontalCombo ? Ot : Dt, [e?.chartType]);
|
|
1304
1304
|
return /* @__PURE__ */ Z(Y, { children: [c ? null : /* @__PURE__ */ Z("div", {
|
|
1305
1305
|
className: "dbn:w-full dbn:px-3 dbn:py-3 dbn:border dbn:border-secondary dbn:rounded-md dbn:flex dbn:flex-col dbn:gap-0",
|
|
1306
1306
|
"data-testid": `combo-axis-${n?.axis?.toLowerCase().replaceAll(" ", "-")}`,
|
|
1307
|
-
children: [/* @__PURE__ */ Z(
|
|
1307
|
+
children: [/* @__PURE__ */ Z(k, {
|
|
1308
1308
|
variant: "popover",
|
|
1309
1309
|
className: "dbn:w-full dbn:flex dbn:justify-between dbn:items-center",
|
|
1310
1310
|
onClick: () => s(!o),
|
|
@@ -1326,9 +1326,9 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1326
1326
|
]
|
|
1327
1327
|
}), /* @__PURE__ */ Z("div", {
|
|
1328
1328
|
className: "dbn:flex dbn:gap-0 dbn:items-center",
|
|
1329
|
-
children: [/* @__PURE__ */ X(
|
|
1329
|
+
children: [/* @__PURE__ */ X(x, {
|
|
1330
1330
|
text: "merge",
|
|
1331
|
-
children: /* @__PURE__ */ X(
|
|
1331
|
+
children: /* @__PURE__ */ X(k, {
|
|
1332
1332
|
variant: "popover",
|
|
1333
1333
|
className: `dbn:p-1.5 dbn:h-full dbn:border dbn:border-secondary dbn:rounded-md ${n?.measures?.length > 1 ? "dbn:rounded-r-none" : ""}`,
|
|
1334
1334
|
onClick: (e) => {
|
|
@@ -1339,13 +1339,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1339
1339
|
size: "xs"
|
|
1340
1340
|
})
|
|
1341
1341
|
})
|
|
1342
|
-
}), n?.measures?.length > 1 ? /* @__PURE__ */ X(
|
|
1342
|
+
}), n?.measures?.length > 1 ? /* @__PURE__ */ X(x, {
|
|
1343
1343
|
text: "split",
|
|
1344
|
-
children: /* @__PURE__ */ X(
|
|
1344
|
+
children: /* @__PURE__ */ X(k, {
|
|
1345
1345
|
variant: "popover",
|
|
1346
1346
|
className: "dbn:p-1.5 dbn:h-full dbn:border dbn:border-secondary dbn:rounded-md dbn:border-l-0 dbn:rounded-l-none",
|
|
1347
1347
|
onClick: (e) => {
|
|
1348
|
-
e.stopPropagation(),
|
|
1348
|
+
e.stopPropagation(), g();
|
|
1349
1349
|
},
|
|
1350
1350
|
children: /* @__PURE__ */ X(B, {
|
|
1351
1351
|
name: "unmerge",
|
|
@@ -1358,7 +1358,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1358
1358
|
/* @__PURE__ */ Z("div", {
|
|
1359
1359
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-2.5 dbn:py-3 dbn:border-b dbn:border-secondary",
|
|
1360
1360
|
children: [
|
|
1361
|
-
/* @__PURE__ */ X(
|
|
1361
|
+
/* @__PURE__ */ X(_, {
|
|
1362
1362
|
type: "text",
|
|
1363
1363
|
placeholder: "Enter Axis Name",
|
|
1364
1364
|
label: "Axis Name",
|
|
@@ -1395,7 +1395,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1395
1395
|
}));
|
|
1396
1396
|
}
|
|
1397
1397
|
}),
|
|
1398
|
-
n.isEnableTextBreak ? /* @__PURE__ */ X(
|
|
1398
|
+
n.isEnableTextBreak ? /* @__PURE__ */ X(_, {
|
|
1399
1399
|
type: "number",
|
|
1400
1400
|
placeholder: "Text Wrap",
|
|
1401
1401
|
label: "Text Wrap Value",
|
|
@@ -1416,7 +1416,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1416
1416
|
}) : null,
|
|
1417
1417
|
/* @__PURE__ */ Z("div", {
|
|
1418
1418
|
className: "dbn:w-full dbn:flex dbn:gap-1 dbn:flex-col",
|
|
1419
|
-
children: [/* @__PURE__ */ X(
|
|
1419
|
+
children: [/* @__PURE__ */ X(M, {
|
|
1420
1420
|
variant: "heading-6",
|
|
1421
1421
|
children: "Measures"
|
|
1422
1422
|
}), /* @__PURE__ */ X("div", {
|
|
@@ -1431,7 +1431,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1431
1431
|
let r = n?.chartTypes?.find((t) => t.axis === e)?.type;
|
|
1432
1432
|
return /* @__PURE__ */ X("div", {
|
|
1433
1433
|
className: Q.featTabsContainer,
|
|
1434
|
-
children: /* @__PURE__ */ X(
|
|
1434
|
+
children: /* @__PURE__ */ X(ne, {
|
|
1435
1435
|
label: `Chart Type (${e})`,
|
|
1436
1436
|
selectedOption: Et.find((e) => e.value === r) || Et[1],
|
|
1437
1437
|
isHideLabel: !0,
|
|
@@ -1461,12 +1461,12 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1461
1461
|
})
|
|
1462
1462
|
});
|
|
1463
1463
|
}),
|
|
1464
|
-
n?.measures?.length > 1 ? /* @__PURE__ */ X(
|
|
1465
|
-
text:
|
|
1464
|
+
n?.measures?.length > 1 ? /* @__PURE__ */ X(x, {
|
|
1465
|
+
text: b ? "" : "To enable stacking, change the Chart Type of all measures under this axis to Bar Chart.",
|
|
1466
1466
|
children: /* @__PURE__ */ X(W, {
|
|
1467
1467
|
name: `${n.axis} stack bar`,
|
|
1468
1468
|
placeholder: "Enable Stack Bar",
|
|
1469
|
-
isDisabled: !
|
|
1469
|
+
isDisabled: !b,
|
|
1470
1470
|
enabled: n.isEnableStackBar,
|
|
1471
1471
|
onChange: () => {
|
|
1472
1472
|
t((e) => ({
|
|
@@ -1482,7 +1482,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1482
1482
|
}
|
|
1483
1483
|
})
|
|
1484
1484
|
}) : null,
|
|
1485
|
-
n?.chartTypes?.some((e) => e?.type ===
|
|
1485
|
+
n?.chartTypes?.some((e) => e?.type === R.bar) ? /* @__PURE__ */ X(W, {
|
|
1486
1486
|
name: `${n.axis} barBg`,
|
|
1487
1487
|
placeholder: "Bar Background",
|
|
1488
1488
|
enabled: n.isEnableBarBg,
|
|
@@ -1504,7 +1504,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1504
1504
|
/* @__PURE__ */ Z("div", {
|
|
1505
1505
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-3 dbn:py-3 dbn:border-b dbn:border-secondary",
|
|
1506
1506
|
children: [
|
|
1507
|
-
/* @__PURE__ */ X(
|
|
1507
|
+
/* @__PURE__ */ X(M, {
|
|
1508
1508
|
variant: "heading-6",
|
|
1509
1509
|
children: "Axis Formatting"
|
|
1510
1510
|
}),
|
|
@@ -1516,7 +1516,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1516
1516
|
value: n?.numberFormatter || "original",
|
|
1517
1517
|
label: n?.numberFormatter || "original"
|
|
1518
1518
|
},
|
|
1519
|
-
options:
|
|
1519
|
+
options: L,
|
|
1520
1520
|
onChange: (e) => {
|
|
1521
1521
|
let r = {
|
|
1522
1522
|
...n,
|
|
@@ -1534,7 +1534,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1534
1534
|
menuWidth: "100%"
|
|
1535
1535
|
}), /* @__PURE__ */ Z("div", {
|
|
1536
1536
|
className: Q.prefixSuffixContainer,
|
|
1537
|
-
children: [/* @__PURE__ */ X(
|
|
1537
|
+
children: [/* @__PURE__ */ X(_, {
|
|
1538
1538
|
type: "text",
|
|
1539
1539
|
label: "Prefix",
|
|
1540
1540
|
placeholder: "Enter Text",
|
|
@@ -1552,7 +1552,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1552
1552
|
}
|
|
1553
1553
|
}));
|
|
1554
1554
|
}
|
|
1555
|
-
}), /* @__PURE__ */ X(
|
|
1555
|
+
}), /* @__PURE__ */ X(_, {
|
|
1556
1556
|
type: "text",
|
|
1557
1557
|
label: "Suffix",
|
|
1558
1558
|
placeholder: "Enter Text",
|
|
@@ -1575,15 +1575,15 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1575
1575
|
}),
|
|
1576
1576
|
/* @__PURE__ */ X("div", {
|
|
1577
1577
|
className: Q.featTabsContainer,
|
|
1578
|
-
children: /* @__PURE__ */ X(
|
|
1578
|
+
children: /* @__PURE__ */ X(ne, {
|
|
1579
1579
|
label: "Axis Position",
|
|
1580
|
-
selectedOption:
|
|
1580
|
+
selectedOption: S.find((e) => e.value === n?.axisPosition) || {
|
|
1581
1581
|
value: "",
|
|
1582
1582
|
label: ""
|
|
1583
1583
|
},
|
|
1584
1584
|
isHideLabel: !0,
|
|
1585
1585
|
tooltipPosition: "bottom",
|
|
1586
|
-
options:
|
|
1586
|
+
options: S,
|
|
1587
1587
|
tooltipClass: "dbn:w-1/2",
|
|
1588
1588
|
buttonClass: "dbn:w-full",
|
|
1589
1589
|
onChange: (e) => {
|
|
@@ -1603,7 +1603,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1603
1603
|
}),
|
|
1604
1604
|
/* @__PURE__ */ X("div", {
|
|
1605
1605
|
className: "dbn:w-full",
|
|
1606
|
-
children: /* @__PURE__ */ X(
|
|
1606
|
+
children: /* @__PURE__ */ X(_, {
|
|
1607
1607
|
label: "Axis Name - Label Gap",
|
|
1608
1608
|
type: "number",
|
|
1609
1609
|
min: "0",
|
|
@@ -1648,11 +1648,11 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1648
1648
|
}
|
|
1649
1649
|
}));
|
|
1650
1650
|
}
|
|
1651
|
-
}), /* @__PURE__ */ X(
|
|
1651
|
+
}), /* @__PURE__ */ X(M, {
|
|
1652
1652
|
variant: "body-text-2",
|
|
1653
1653
|
children: "Band Formatting"
|
|
1654
1654
|
})]
|
|
1655
|
-
}), i ? null : /* @__PURE__ */ X(
|
|
1655
|
+
}), i ? null : /* @__PURE__ */ X(k, {
|
|
1656
1656
|
variant: "tertiary",
|
|
1657
1657
|
onClick: () => a(!0),
|
|
1658
1658
|
size: "small",
|
|
@@ -1668,56 +1668,56 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1668
1668
|
children: [
|
|
1669
1669
|
/* @__PURE__ */ X("div", {
|
|
1670
1670
|
className: "dbn:col-span-2 dbn:flex dbn:items-end",
|
|
1671
|
-
children: /* @__PURE__ */ X(
|
|
1671
|
+
children: /* @__PURE__ */ X(_, {
|
|
1672
1672
|
label: "Lower Limit",
|
|
1673
|
-
onChange: (e) =>
|
|
1673
|
+
onChange: (e) => p((t) => ({
|
|
1674
1674
|
...t,
|
|
1675
1675
|
lowerLimit: Number.isNaN(Number(e.target.value)) ? e.target.value : Number(e.target.value)
|
|
1676
1676
|
})),
|
|
1677
|
-
value:
|
|
1677
|
+
value: f.lowerLimit
|
|
1678
1678
|
})
|
|
1679
1679
|
}),
|
|
1680
1680
|
/* @__PURE__ */ X("div", {
|
|
1681
1681
|
className: "dbn:col-span-2 dbn:flex dbn:items-end",
|
|
1682
|
-
children: /* @__PURE__ */ X(
|
|
1682
|
+
children: /* @__PURE__ */ X(_, {
|
|
1683
1683
|
label: "Upper Limit",
|
|
1684
|
-
onChange: (e) =>
|
|
1684
|
+
onChange: (e) => p((t) => ({
|
|
1685
1685
|
...t,
|
|
1686
1686
|
upperLimit: Number.isNaN(Number(e.target.value)) ? e.target.value : Number(e.target.value)
|
|
1687
1687
|
})),
|
|
1688
|
-
value:
|
|
1688
|
+
value: f.upperLimit
|
|
1689
1689
|
})
|
|
1690
1690
|
}),
|
|
1691
1691
|
/* @__PURE__ */ X("div", {
|
|
1692
1692
|
className: "dbn:col-span-4",
|
|
1693
|
-
children: /* @__PURE__ */ X(
|
|
1693
|
+
children: /* @__PURE__ */ X(_, {
|
|
1694
1694
|
type: "text",
|
|
1695
1695
|
label: "Label",
|
|
1696
1696
|
placeholder: "Enter Text",
|
|
1697
|
-
onChange: (e) =>
|
|
1697
|
+
onChange: (e) => p((t) => ({
|
|
1698
1698
|
...t,
|
|
1699
1699
|
label: e.target.value
|
|
1700
1700
|
})),
|
|
1701
|
-
value:
|
|
1701
|
+
value: f.label
|
|
1702
1702
|
})
|
|
1703
1703
|
}),
|
|
1704
1704
|
/* @__PURE__ */ Z("div", {
|
|
1705
1705
|
className: "dbn:col-span-4 dbn:mt-3 dbn:flex dbn:justify-end dbn:gap-2",
|
|
1706
|
-
children: [/* @__PURE__ */ X(
|
|
1706
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1707
1707
|
variant: "secondary",
|
|
1708
1708
|
onClick: () => {
|
|
1709
|
-
a(!1),
|
|
1709
|
+
a(!1), p({
|
|
1710
1710
|
label: "",
|
|
1711
1711
|
upperLimit: 0,
|
|
1712
1712
|
lowerLimit: 0
|
|
1713
1713
|
});
|
|
1714
1714
|
},
|
|
1715
1715
|
children: "Close"
|
|
1716
|
-
}), /* @__PURE__ */ X(
|
|
1716
|
+
}), /* @__PURE__ */ X(k, {
|
|
1717
1717
|
variant: "primary",
|
|
1718
|
-
onClick:
|
|
1719
|
-
isDisabled: !
|
|
1720
|
-
children:
|
|
1718
|
+
onClick: m,
|
|
1719
|
+
isDisabled: !f.label || !f.lowerLimit.toString() || !f.upperLimit.toString() || f.upperLimit === f.lowerLimit,
|
|
1720
|
+
children: f?.isEdit ? "Update" : "Save"
|
|
1721
1721
|
})]
|
|
1722
1722
|
})
|
|
1723
1723
|
]
|
|
@@ -1725,35 +1725,35 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1725
1725
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-2",
|
|
1726
1726
|
children: n?.labelFormatter?.map((e, t) => /* @__PURE__ */ Z("div", {
|
|
1727
1727
|
className: "dbn:w-full dbn:px-4 dbn:py-3 dbn:rounded-md dbn:flex dbn:gap-3 dbn:items-center dbn:justify-between dbn:border dbn:border-secondary",
|
|
1728
|
-
children: [/* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X(
|
|
1728
|
+
children: [/* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X(M, {
|
|
1729
1729
|
variant: "body-text-2",
|
|
1730
|
-
children:
|
|
1731
|
-
}), /* @__PURE__ */ X(
|
|
1730
|
+
children: pe(e.label, 22)
|
|
1731
|
+
}), /* @__PURE__ */ X(M, {
|
|
1732
1732
|
variant: "body-text-3",
|
|
1733
1733
|
children: `(${e.lowerLimit} - ${e.upperLimit})`
|
|
1734
1734
|
})] }), /* @__PURE__ */ Z("div", {
|
|
1735
1735
|
className: "dbn:flex dbn:gap-4 dbn:mx-3",
|
|
1736
|
-
children: [/* @__PURE__ */ X(
|
|
1736
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1737
1737
|
variant: "popover",
|
|
1738
1738
|
leftIcon: /* @__PURE__ */ X(B, {
|
|
1739
1739
|
name: "pencil-simple",
|
|
1740
1740
|
size: "sm"
|
|
1741
1741
|
}),
|
|
1742
1742
|
onClick: () => {
|
|
1743
|
-
|
|
1743
|
+
p({
|
|
1744
1744
|
...e,
|
|
1745
1745
|
isEdit: !0,
|
|
1746
1746
|
index: t
|
|
1747
1747
|
}), a(!0);
|
|
1748
1748
|
},
|
|
1749
1749
|
isDisabled: i
|
|
1750
|
-
}), /* @__PURE__ */ X(
|
|
1750
|
+
}), /* @__PURE__ */ X(k, {
|
|
1751
1751
|
variant: "popover",
|
|
1752
1752
|
leftIcon: /* @__PURE__ */ X(B, {
|
|
1753
1753
|
name: "delete",
|
|
1754
1754
|
color: "alert"
|
|
1755
1755
|
}),
|
|
1756
|
-
onClick: () =>
|
|
1756
|
+
onClick: () => h(e),
|
|
1757
1757
|
isDisabled: i
|
|
1758
1758
|
})]
|
|
1759
1759
|
})]
|
|
@@ -1766,13 +1766,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1766
1766
|
children: [/* @__PURE__ */ Z("div", {
|
|
1767
1767
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-2",
|
|
1768
1768
|
children: [
|
|
1769
|
-
/* @__PURE__ */ X(
|
|
1769
|
+
/* @__PURE__ */ X(M, {
|
|
1770
1770
|
variant: "heading-6",
|
|
1771
1771
|
children: "Merge with"
|
|
1772
1772
|
}),
|
|
1773
1773
|
/* @__PURE__ */ Z("div", {
|
|
1774
1774
|
className: "dbn:w-full dbn:px-3 dbn:py-3 dbn:border dbn:border-secondary dbn:rounded-md dbn:flex dbn:gap-2",
|
|
1775
|
-
children: [/* @__PURE__ */ X(
|
|
1775
|
+
children: [/* @__PURE__ */ X(ue, {
|
|
1776
1776
|
isDisabled: !0,
|
|
1777
1777
|
checked: !0
|
|
1778
1778
|
}), /* @__PURE__ */ X("span", {
|
|
@@ -1780,10 +1780,10 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1780
1780
|
children: n.axis
|
|
1781
1781
|
})]
|
|
1782
1782
|
}),
|
|
1783
|
-
|
|
1783
|
+
v?.map((e) => /* @__PURE__ */ Z("div", {
|
|
1784
1784
|
className: "dbn:w-full dbn:px-3 dbn:py-3 dbn:border dbn:border-secondary dbn:rounded-md dbn:flex dbn:gap-2",
|
|
1785
|
-
children: [/* @__PURE__ */ X(
|
|
1786
|
-
u?.find((t) => t.axis === e.axis) ?
|
|
1785
|
+
children: [/* @__PURE__ */ X(ue, { onClick: () => {
|
|
1786
|
+
u?.find((t) => t.axis === e.axis) ? d(u.filter((t) => t.axis !== e.axis)) : d((t) => [...t, e]);
|
|
1787
1787
|
} }), /* @__PURE__ */ X("span", {
|
|
1788
1788
|
className: "dbn:w-[cal(100%-80px)] dbn:block dbn:text-sm dbn:font-medium dbn:truncate",
|
|
1789
1789
|
children: e.axis
|
|
@@ -1792,15 +1792,15 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1792
1792
|
]
|
|
1793
1793
|
}), /* @__PURE__ */ Z("div", {
|
|
1794
1794
|
className: "dbn:w-full dbn:flex dbn:gap-2 dbn:items-center dbn:justify-end",
|
|
1795
|
-
children: [/* @__PURE__ */ X(
|
|
1795
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1796
1796
|
variant: "tab",
|
|
1797
1797
|
onClick: () => {
|
|
1798
1798
|
l(!1), r("");
|
|
1799
1799
|
},
|
|
1800
1800
|
children: "Cancel"
|
|
1801
|
-
}), /* @__PURE__ */ X(
|
|
1801
|
+
}), /* @__PURE__ */ X(k, {
|
|
1802
1802
|
variant: "primary",
|
|
1803
|
-
onClick:
|
|
1803
|
+
onClick: y,
|
|
1804
1804
|
children: "Merge Axis"
|
|
1805
1805
|
})]
|
|
1806
1806
|
})]
|
|
@@ -1810,7 +1810,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1810
1810
|
return /* @__PURE__ */ Z("div", {
|
|
1811
1811
|
className: "dbn:w-full dbn:px-3 dbn:py-3 dbn:border dbn:border-secondary dbn:rounded-md dbn:flex dbn:flex-col dbn:gap-0",
|
|
1812
1812
|
"data-testid": `combo-axis-${n?.axis?.toLowerCase().replaceAll(" ", "-")}`,
|
|
1813
|
-
children: [/* @__PURE__ */ X(
|
|
1813
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1814
1814
|
variant: "popover",
|
|
1815
1815
|
className: "dbn:w-full dbn:flex dbn:justify-between dbn:items-center",
|
|
1816
1816
|
onClick: () => i(!r),
|
|
@@ -1834,7 +1834,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1834
1834
|
value: n?.numberFormatter || "original",
|
|
1835
1835
|
label: n?.numberFormatter || "original"
|
|
1836
1836
|
},
|
|
1837
|
-
options:
|
|
1837
|
+
options: L,
|
|
1838
1838
|
onChange: (e) => {
|
|
1839
1839
|
let r = {
|
|
1840
1840
|
...n,
|
|
@@ -1852,7 +1852,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1852
1852
|
menuWidth: "100%"
|
|
1853
1853
|
}), /* @__PURE__ */ Z("div", {
|
|
1854
1854
|
className: Q.prefixSuffixContainer,
|
|
1855
|
-
children: [/* @__PURE__ */ X(
|
|
1855
|
+
children: [/* @__PURE__ */ X(_, {
|
|
1856
1856
|
type: "text",
|
|
1857
1857
|
label: "Prefix",
|
|
1858
1858
|
placeholder: "Enter Text",
|
|
@@ -1870,7 +1870,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1870
1870
|
}
|
|
1871
1871
|
}));
|
|
1872
1872
|
}
|
|
1873
|
-
}), /* @__PURE__ */ X(
|
|
1873
|
+
}), /* @__PURE__ */ X(_, {
|
|
1874
1874
|
type: "text",
|
|
1875
1875
|
label: "Suffix",
|
|
1876
1876
|
placeholder: "Enter Text",
|
|
@@ -1910,12 +1910,12 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1910
1910
|
axis: a,
|
|
1911
1911
|
setMergeAxis: i
|
|
1912
1912
|
}) }) })) });
|
|
1913
|
-
}, Mt = ({ chartSettings: e, conditionalFormatColumns: t, conditionalFormatting: n, setConditionalFormatting: r, tableFormatColumnOptions: i, isShowRuleFields: a, setShowRuleFields: o, conditionError: s, setConditionError: c, onSaveConditionRule: l, onClear: u, clearButtonClassName:
|
|
1913
|
+
}, Mt = ({ chartSettings: e, conditionalFormatColumns: t, conditionalFormatting: n, setConditionalFormatting: r, tableFormatColumnOptions: i, isShowRuleFields: a, setShowRuleFields: o, conditionError: s, setConditionError: c, onSaveConditionRule: l, onClear: u, clearButtonClassName: d, saveButtonClassName: f }) => /* @__PURE__ */ X(Y, { children: a && /* @__PURE__ */ Z("div", {
|
|
1914
1914
|
className: Q.formattingWrapper,
|
|
1915
1915
|
children: [
|
|
1916
1916
|
/* @__PURE__ */ X("div", {
|
|
1917
1917
|
className: "dbn:col-span-4",
|
|
1918
|
-
children: /* @__PURE__ */ X(
|
|
1918
|
+
children: /* @__PURE__ */ X(O, {
|
|
1919
1919
|
label: "Columns",
|
|
1920
1920
|
options: t,
|
|
1921
1921
|
selectedOption: n.columns?.map((e) => ({
|
|
@@ -1938,7 +1938,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1938
1938
|
return {
|
|
1939
1939
|
...n,
|
|
1940
1940
|
columns: r,
|
|
1941
|
-
operator: o ?
|
|
1941
|
+
operator: o ? V[0].value : n.operator
|
|
1942
1942
|
};
|
|
1943
1943
|
}),
|
|
1944
1944
|
isDisabled: n.isEdit,
|
|
@@ -1950,12 +1950,12 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1950
1950
|
className: "dbn:col-span-4",
|
|
1951
1951
|
children: /* @__PURE__ */ X(T, {
|
|
1952
1952
|
label: "Conditions",
|
|
1953
|
-
options: [...i?.map((e) => e?.value) || [], ...e?.dateColumns || []].includes(n.columns?.[0]) ?
|
|
1953
|
+
options: [...i?.map((e) => e?.value) || [], ...e?.dateColumns || []].includes(n.columns?.[0]) ? V.filter((e) => ![
|
|
1954
1954
|
"contains",
|
|
1955
1955
|
"doesNotContain",
|
|
1956
1956
|
"startsWith",
|
|
1957
1957
|
"endsWith"
|
|
1958
|
-
].includes(e.value)) :
|
|
1958
|
+
].includes(e.value)) : V.filter((e) => ![
|
|
1959
1959
|
"isLessThan",
|
|
1960
1960
|
"isGreaterThan",
|
|
1961
1961
|
"isLessThanOrEqualTo",
|
|
@@ -1979,7 +1979,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1979
1979
|
className: "dbn:col-span-4",
|
|
1980
1980
|
children: n.operator === "between" ? /* @__PURE__ */ Z("div", {
|
|
1981
1981
|
className: "dbn:grid dbn:grid-cols-2 dbn:gap-2",
|
|
1982
|
-
children: [/* @__PURE__ */ X(
|
|
1982
|
+
children: [/* @__PURE__ */ X(_, {
|
|
1983
1983
|
label: "From",
|
|
1984
1984
|
type: e?.dateColumns?.includes(n.columns?.[0]) ? "date" : "number",
|
|
1985
1985
|
placeholder: "Enter start value",
|
|
@@ -1991,7 +1991,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
1991
1991
|
};
|
|
1992
1992
|
}),
|
|
1993
1993
|
value: String(n.value ?? "").split(",")[0]?.trim()
|
|
1994
|
-
}), /* @__PURE__ */ X(
|
|
1994
|
+
}), /* @__PURE__ */ X(_, {
|
|
1995
1995
|
label: "To",
|
|
1996
1996
|
type: e?.dateColumns?.includes(n.columns?.[0]) ? "date" : "number",
|
|
1997
1997
|
placeholder: "Enter end value",
|
|
@@ -2004,7 +2004,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2004
2004
|
}),
|
|
2005
2005
|
value: String(n.value ?? "").split(",")[1]?.trim()
|
|
2006
2006
|
})]
|
|
2007
|
-
}) : /* @__PURE__ */ X(
|
|
2007
|
+
}) : /* @__PURE__ */ X(_, {
|
|
2008
2008
|
label: "Value",
|
|
2009
2009
|
type: e?.dateColumns?.includes(n.columns?.[0]) ? "date" : "text",
|
|
2010
2010
|
placeholder: "Enter Value",
|
|
@@ -2015,9 +2015,9 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2015
2015
|
value: n.value
|
|
2016
2016
|
})
|
|
2017
2017
|
}),
|
|
2018
|
-
![
|
|
2018
|
+
![R.trendAnalyzer].includes(e?.chartType) && e?.tableSettings?.isEnableNumberFormatting && e?.tableSettings?.tableNumberFormatter?.find((e) => n?.columns?.some((t) => e.columns?.includes(t))) ? /* @__PURE__ */ X("div", {
|
|
2019
2019
|
className: "dbn:col-span-4",
|
|
2020
|
-
children: /* @__PURE__ */ X(
|
|
2020
|
+
children: /* @__PURE__ */ X(ne, {
|
|
2021
2021
|
label: "Compare Value with",
|
|
2022
2022
|
size: "small",
|
|
2023
2023
|
buttonContainerClass: "dbn:w-full",
|
|
@@ -2044,7 +2044,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2044
2044
|
children: /* @__PURE__ */ Z(ce, {
|
|
2045
2045
|
direction: "row",
|
|
2046
2046
|
className: "dbn:gap-2 dbn:items-end",
|
|
2047
|
-
children: [/* @__PURE__ */ X(
|
|
2047
|
+
children: [/* @__PURE__ */ X(U, {
|
|
2048
2048
|
"data-testid": "bg-color",
|
|
2049
2049
|
id: "bg-color",
|
|
2050
2050
|
name: "bgColor",
|
|
@@ -2059,7 +2059,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2059
2059
|
},
|
|
2060
2060
|
defaultChecked: !!n?.isApplyBgColor,
|
|
2061
2061
|
checked: !!n?.isApplyBgColor
|
|
2062
|
-
}), /* @__PURE__ */ X(
|
|
2062
|
+
}), /* @__PURE__ */ X(U, {
|
|
2063
2063
|
"data-testid": "badge-color",
|
|
2064
2064
|
id: "badge-color",
|
|
2065
2065
|
name: "badgeColor",
|
|
@@ -2118,7 +2118,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2118
2118
|
}),
|
|
2119
2119
|
/* @__PURE__ */ Z("div", {
|
|
2120
2120
|
className: `${Q.prefixSuffixContainer} dbn:col-span-4`,
|
|
2121
|
-
children: [/* @__PURE__ */ X(
|
|
2121
|
+
children: [/* @__PURE__ */ X(_, {
|
|
2122
2122
|
type: "text",
|
|
2123
2123
|
label: "Prefix",
|
|
2124
2124
|
placeholder: "Add prefix",
|
|
@@ -2127,7 +2127,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2127
2127
|
...t,
|
|
2128
2128
|
prefix: e.target.value
|
|
2129
2129
|
}))
|
|
2130
|
-
}), /* @__PURE__ */ X(
|
|
2130
|
+
}), /* @__PURE__ */ X(_, {
|
|
2131
2131
|
type: "text",
|
|
2132
2132
|
label: "Suffix",
|
|
2133
2133
|
placeholder: "Add suffix",
|
|
@@ -2138,30 +2138,30 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2138
2138
|
}))
|
|
2139
2139
|
})]
|
|
2140
2140
|
}),
|
|
2141
|
-
s && /* @__PURE__ */ X(
|
|
2141
|
+
s && /* @__PURE__ */ X(I, {
|
|
2142
2142
|
text: s,
|
|
2143
2143
|
variant: "error",
|
|
2144
2144
|
className: "dbn:col-span-4"
|
|
2145
2145
|
}),
|
|
2146
2146
|
/* @__PURE__ */ Z("div", {
|
|
2147
2147
|
className: "dbn:col-span-4 dbn:mt-3 dbn:flex dbn:justify-end dbn:gap-2",
|
|
2148
|
-
children: [/* @__PURE__ */ X(
|
|
2148
|
+
children: [/* @__PURE__ */ X(k, {
|
|
2149
2149
|
variant: "secondary",
|
|
2150
2150
|
onClick: () => {
|
|
2151
2151
|
u(), c(""), o(!1);
|
|
2152
2152
|
},
|
|
2153
|
-
className:
|
|
2153
|
+
className: d,
|
|
2154
2154
|
children: "Clear"
|
|
2155
|
-
}), /* @__PURE__ */ Z(
|
|
2155
|
+
}), /* @__PURE__ */ Z(k, {
|
|
2156
2156
|
variant: "primary",
|
|
2157
2157
|
type: "button",
|
|
2158
2158
|
onClick: () => l(),
|
|
2159
|
-
className:
|
|
2159
|
+
className: f,
|
|
2160
2160
|
children: [n?.isEdit ? "Update" : "Save", " Rule"]
|
|
2161
2161
|
})]
|
|
2162
2162
|
})
|
|
2163
2163
|
]
|
|
2164
|
-
}) }), Nt = (e) => [
|
|
2164
|
+
}) }), Nt = (e) => [R.horizontalStackTable].includes(e) ? [
|
|
2165
2165
|
{
|
|
2166
2166
|
label: "",
|
|
2167
2167
|
value: "right",
|
|
@@ -2178,10 +2178,10 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2178
2178
|
icon: "align-bottom"
|
|
2179
2179
|
}
|
|
2180
2180
|
] : [
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2181
|
+
R.pie,
|
|
2182
|
+
R.doughnut,
|
|
2183
|
+
R.rose,
|
|
2184
|
+
R.funnel
|
|
2185
2185
|
].includes(e) ? [
|
|
2186
2186
|
{
|
|
2187
2187
|
label: "Outside",
|
|
@@ -2198,7 +2198,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2198
2198
|
value: "hidden",
|
|
2199
2199
|
icon: ""
|
|
2200
2200
|
}
|
|
2201
|
-
] : [
|
|
2201
|
+
] : [R.linearGauge].includes(e) ? [
|
|
2202
2202
|
{
|
|
2203
2203
|
label: "",
|
|
2204
2204
|
value: "hidden",
|
|
@@ -2322,7 +2322,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2322
2322
|
backgrounColor: "#FFFFFF",
|
|
2323
2323
|
color: "#000000",
|
|
2324
2324
|
columns: [],
|
|
2325
|
-
operator:
|
|
2325
|
+
operator: V[0].value,
|
|
2326
2326
|
value: "",
|
|
2327
2327
|
isApplyBgColor: !0,
|
|
2328
2328
|
isApplyBadgeColor: !1,
|
|
@@ -2372,9 +2372,9 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2372
2372
|
}));
|
|
2373
2373
|
}, s = G((t, n) => {
|
|
2374
2374
|
let i = r?.map((e) => e.value) || [], a = n.filter((e) => e && e !== "NONE" && i.includes(e)) || [], s = n.filter((e) => e && e !== "NONE") || [], c = [
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2375
|
+
R.pivotV2,
|
|
2376
|
+
R.horizontalStackTable,
|
|
2377
|
+
R.pivotV3
|
|
2378
2378
|
].includes(e?.chartType) ? s : a;
|
|
2379
2379
|
o("columns", t, c);
|
|
2380
2380
|
}, [
|
|
@@ -2398,7 +2398,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2398
2398
|
return /* @__PURE__ */ Z(Y, { children: [e?.tableSettings?.tableNumberFormatter?.map((t, n) => /* @__PURE__ */ Z("div", {
|
|
2399
2399
|
className: Bt.formatOptions,
|
|
2400
2400
|
children: [
|
|
2401
|
-
/* @__PURE__ */ X(
|
|
2401
|
+
/* @__PURE__ */ X(k, {
|
|
2402
2402
|
variant: "popover",
|
|
2403
2403
|
leftIcon: /* @__PURE__ */ X(B, {
|
|
2404
2404
|
name: "delete",
|
|
@@ -2410,7 +2410,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2410
2410
|
e.stopPropagation(), c(n);
|
|
2411
2411
|
}
|
|
2412
2412
|
}),
|
|
2413
|
-
/* @__PURE__ */ X(
|
|
2413
|
+
/* @__PURE__ */ X(O, {
|
|
2414
2414
|
label: "Columns",
|
|
2415
2415
|
buttonWidth: "100%",
|
|
2416
2416
|
menuWidth: "100%",
|
|
@@ -2430,7 +2430,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2430
2430
|
value: t.formatter || "original",
|
|
2431
2431
|
label: t.formatter || "original"
|
|
2432
2432
|
},
|
|
2433
|
-
options:
|
|
2433
|
+
options: L,
|
|
2434
2434
|
isDisabled: !e?.tableSettings?.isEnableNumberFormatting,
|
|
2435
2435
|
onChange: (e) => o("formatter", n, e.value),
|
|
2436
2436
|
buttonWidth: "100%",
|
|
@@ -2438,13 +2438,13 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2438
2438
|
}),
|
|
2439
2439
|
/* @__PURE__ */ Z("div", {
|
|
2440
2440
|
className: Bt.prefixSuffixContainer,
|
|
2441
|
-
children: [/* @__PURE__ */ X(
|
|
2441
|
+
children: [/* @__PURE__ */ X(_, {
|
|
2442
2442
|
type: "text",
|
|
2443
2443
|
label: "Prefix",
|
|
2444
2444
|
placeholder: "Add prefix to values",
|
|
2445
2445
|
value: t.prefix,
|
|
2446
2446
|
onChange: (e) => o("prefix", n, e.target.value)
|
|
2447
|
-
}), /* @__PURE__ */ X(
|
|
2447
|
+
}), /* @__PURE__ */ X(_, {
|
|
2448
2448
|
type: "text",
|
|
2449
2449
|
label: "Suffix",
|
|
2450
2450
|
placeholder: "Add suffix to values",
|
|
@@ -2453,7 +2453,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2453
2453
|
})]
|
|
2454
2454
|
})
|
|
2455
2455
|
]
|
|
2456
|
-
}, `formatter-${n}`)), a()?.length ? /* @__PURE__ */ X(
|
|
2456
|
+
}, `formatter-${n}`)), a()?.length ? /* @__PURE__ */ X(k, {
|
|
2457
2457
|
variant: "tab",
|
|
2458
2458
|
fitContainer: !0,
|
|
2459
2459
|
onClick: () => t((e) => ({
|
|
@@ -2563,17 +2563,17 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2563
2563
|
chartOptionBtnSelected: "_chartOptionBtnSelected_1qmry_32",
|
|
2564
2564
|
"chart-option": "_chart-option_1qmry_36",
|
|
2565
2565
|
overlay: "_overlay_1qmry_41"
|
|
2566
|
-
}, Wt = (e) =>
|
|
2566
|
+
}, Wt = (e) => f(e || []).numberKeys.map((e) => ({
|
|
2567
2567
|
name: e,
|
|
2568
2568
|
dataType: "number"
|
|
2569
2569
|
})), Gt = (e, t) => {
|
|
2570
2570
|
let n = e || [];
|
|
2571
|
-
return
|
|
2571
|
+
return F(n, Wt(n), t);
|
|
2572
2572
|
}, Kt = (e) => {
|
|
2573
|
-
let t =
|
|
2573
|
+
let t = g(e);
|
|
2574
2574
|
return !t || t.engines.v1 || t.engines.v2;
|
|
2575
2575
|
}, qt = (e, t) => {
|
|
2576
|
-
let n =
|
|
2576
|
+
let n = g(e);
|
|
2577
2577
|
if (n) {
|
|
2578
2578
|
let e = Fe(n);
|
|
2579
2579
|
if (e) return e;
|
|
@@ -2594,7 +2594,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2594
2594
|
(e?.value || []).forEach((e) => {
|
|
2595
2595
|
let t = e?.name?.toLowerCase() || "";
|
|
2596
2596
|
if (!Kt(t)) return;
|
|
2597
|
-
let n =
|
|
2597
|
+
let n = g(t);
|
|
2598
2598
|
if (!r.has(t) || !i(n)) {
|
|
2599
2599
|
s.push({
|
|
2600
2600
|
option: e,
|
|
@@ -2631,23 +2631,23 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2631
2631
|
options: s
|
|
2632
2632
|
}
|
|
2633
2633
|
].filter((e) => e.options.length > 0);
|
|
2634
|
-
}, Yt = ({ chartTypePanelProps: { onChartChange: e, enabledCharts: t, allowedChartTypes: n, selectedChart: r, isOpen: i, onClose: a, zIndex: o, inline: s, onClickSettings: c, resultData:
|
|
2635
|
-
let [
|
|
2634
|
+
}, Yt = ({ chartTypePanelProps: { onChartChange: e, enabledCharts: t, allowedChartTypes: n, selectedChart: r, isOpen: i, onClose: a, zIndex: o, inline: s, onClickSettings: c, resultData: l } }) => {
|
|
2635
|
+
let [u, d] = J(""), [f, p] = J(te || []), [m, g] = J("");
|
|
2636
2636
|
K(() => {
|
|
2637
|
-
let e = n?.length ? n.map((e) =>
|
|
2637
|
+
let e = n?.length ? n.map((e) => w[e]) : Object.values(w), t = te.map((t) => {
|
|
2638
2638
|
let n = t?.value?.filter((t) => e?.includes(t?.name?.toLowerCase()));
|
|
2639
2639
|
return n?.length > 0 ? {
|
|
2640
2640
|
...t,
|
|
2641
2641
|
value: n
|
|
2642
2642
|
} : null;
|
|
2643
2643
|
}).filter((e) => e !== null);
|
|
2644
|
-
if (
|
|
2645
|
-
let e = Le(t,
|
|
2646
|
-
|
|
2647
|
-
} else
|
|
2648
|
-
}, [
|
|
2649
|
-
let _ = we.useMemo(() =>
|
|
2650
|
-
|
|
2644
|
+
if (u) {
|
|
2645
|
+
let e = Le(t, u);
|
|
2646
|
+
p(e);
|
|
2647
|
+
} else p(t);
|
|
2648
|
+
}, [u, n]);
|
|
2649
|
+
let _ = we.useMemo(() => l?.length ? Gt(l) : void 0, [l]), v = we.useMemo(() => Jt(f, t, _), [
|
|
2650
|
+
f,
|
|
2651
2651
|
t,
|
|
2652
2652
|
_
|
|
2653
2653
|
]);
|
|
@@ -2663,28 +2663,28 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2663
2663
|
className: Ut.chartTypePanel,
|
|
2664
2664
|
id: "chart-types",
|
|
2665
2665
|
children: [
|
|
2666
|
-
/* @__PURE__ */ X(
|
|
2666
|
+
/* @__PURE__ */ X(I, {
|
|
2667
2667
|
variant: "warning",
|
|
2668
2668
|
text: "Dimensions and Measures will be trimmed for unsupported cases.",
|
|
2669
2669
|
contentClassName: "dbn:p-0"
|
|
2670
2670
|
}),
|
|
2671
|
-
/* @__PURE__ */ X(oe, { setSearchKeyword:
|
|
2672
|
-
|
|
2671
|
+
/* @__PURE__ */ X(oe, { setSearchKeyword: d }),
|
|
2672
|
+
v?.length ? v.map((t, n) => /* @__PURE__ */ Z("div", {
|
|
2673
2673
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-3",
|
|
2674
2674
|
"data-testid": `chart-tier-${t.tier}`,
|
|
2675
2675
|
children: [/* @__PURE__ */ Z("div", {
|
|
2676
2676
|
className: "dbn:w-full dbn:flex dbn:flex-col dbn:gap-1",
|
|
2677
2677
|
children: [/* @__PURE__ */ Z("div", {
|
|
2678
2678
|
className: "dbn:flex dbn:items-baseline dbn:gap-2",
|
|
2679
|
-
children: [/* @__PURE__ */ X(
|
|
2679
|
+
children: [/* @__PURE__ */ X(M, {
|
|
2680
2680
|
variant: "heading-6",
|
|
2681
2681
|
children: t.label
|
|
2682
|
-
}), /* @__PURE__ */ X(
|
|
2682
|
+
}), /* @__PURE__ */ X(M, {
|
|
2683
2683
|
variant: "body-text-3",
|
|
2684
2684
|
className: "dbn:text-secondary dbn:tabular-nums",
|
|
2685
2685
|
children: t.options.length
|
|
2686
2686
|
})]
|
|
2687
|
-
}), /* @__PURE__ */ X(
|
|
2687
|
+
}), /* @__PURE__ */ X(M, {
|
|
2688
2688
|
variant: "body-text-3",
|
|
2689
2689
|
className: "dbn:text-secondary",
|
|
2690
2690
|
children: t.hint
|
|
@@ -2696,8 +2696,8 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2696
2696
|
"top",
|
|
2697
2697
|
"top-left",
|
|
2698
2698
|
"top-right"
|
|
2699
|
-
].includes(t?.position || "") ? t?.position : n ===
|
|
2700
|
-
return /* @__PURE__ */ X(
|
|
2699
|
+
].includes(t?.position || "") ? t?.position : n === v.length - 1 ? Ie(o + 1)?.replace("bottom", "top") : Ie(o + 1);
|
|
2700
|
+
return /* @__PURE__ */ X(h, {
|
|
2701
2701
|
text: t.label,
|
|
2702
2702
|
subText: s ? a : "",
|
|
2703
2703
|
position: c,
|
|
@@ -2705,7 +2705,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2705
2705
|
className: Ut.chartOption,
|
|
2706
2706
|
"data-testid": t?.name?.toLowerCase()?.replaceAll(" ", "-"),
|
|
2707
2707
|
"data-chart-tier": i,
|
|
2708
|
-
children: /* @__PURE__ */ X(
|
|
2708
|
+
children: /* @__PURE__ */ X(k, {
|
|
2709
2709
|
id: t?.name?.replaceAll(" ", "-"),
|
|
2710
2710
|
type: "button",
|
|
2711
2711
|
variant: "popover",
|
|
@@ -2729,7 +2729,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2729
2729
|
}, t.name);
|
|
2730
2730
|
})
|
|
2731
2731
|
})]
|
|
2732
|
-
}, t.tier)) : /* @__PURE__ */ X(
|
|
2732
|
+
}, t.tier)) : /* @__PURE__ */ X(xe, {
|
|
2733
2733
|
message: "No Charts Available.",
|
|
2734
2734
|
subText: "Try adjusting your search.",
|
|
2735
2735
|
msgGap: "4px",
|
|
@@ -2739,7 +2739,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2739
2739
|
]
|
|
2740
2740
|
})
|
|
2741
2741
|
});
|
|
2742
|
-
}, Xt = /* @__PURE__ */ e(
|
|
2742
|
+
}, Xt = /* @__PURE__ */ e(A()), $ = {
|
|
2743
2743
|
container: "_container_1dncb_8",
|
|
2744
2744
|
label: "_label_1dncb_12",
|
|
2745
2745
|
textarea: "_textarea_1dncb_16",
|
|
@@ -2755,7 +2755,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2755
2755
|
className: $.label,
|
|
2756
2756
|
children: [
|
|
2757
2757
|
p,
|
|
2758
|
-
/* @__PURE__ */ Z(
|
|
2758
|
+
/* @__PURE__ */ Z(M, {
|
|
2759
2759
|
variant: "input-label",
|
|
2760
2760
|
children: [t, g ? /* @__PURE__ */ X("span", {
|
|
2761
2761
|
className: $.important,
|
|
@@ -2780,7 +2780,7 @@ var De = (e, t) => e?.length === t?.length && e?.every((e) => t?.includes(e)), O
|
|
|
2780
2780
|
onBlur: d,
|
|
2781
2781
|
disabled: h
|
|
2782
2782
|
}),
|
|
2783
|
-
s && /* @__PURE__ */ X(
|
|
2783
|
+
s && /* @__PURE__ */ X(M, {
|
|
2784
2784
|
variant: "body-text-2",
|
|
2785
2785
|
color: "alert",
|
|
2786
2786
|
children: s
|