@databrainhq/plugin 0.17.9-beta.30 → 0.17.9-beta.31
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-D3DbH3Cx.mjs → Accordion-BhLebRAm.mjs} +32 -25
- package/dist/{Chart-7AGA9h2g.mjs → Chart-BLXiGOie.mjs} +361 -361
- package/dist/{CreateGlobalFilter-oHjA0P9O.mjs → CreateGlobalFilter-DJ75cI8r.mjs} +200 -200
- package/dist/{CreateMetricV2-BGDt9B3L.mjs → CreateMetricV2-DNSbMIqg.mjs} +20 -20
- package/dist/{DraggableItem-7fQUo0x4.mjs → DraggableItem-HJ4Wt8qx.mjs} +11 -11
- package/dist/{HorizontalStackTable-CH68bWy3.mjs → HorizontalStackTable-DadBH16u.mjs} +17 -17
- package/dist/{ManageMetricsV2-tyQYXoAT.mjs → ManageMetricsV2-DQ0F-Sxo.mjs} +3 -3
- package/dist/{MetricCardV2-C2n6LzkA.mjs → MetricCardV2-ndXX9kcc.mjs} +1251 -1170
- package/dist/{NoDataFound-N3gF0Pse.mjs → NoDataFound-C6lIIOZF.mjs} +1 -1
- package/dist/{NoDataState-C6hX-CHr.mjs → NoDataState-Dx5ksEt-.mjs} +2 -2
- package/dist/{Panel-BeWefwKs.mjs → Panel-oW--_1YF.mjs} +1 -1
- package/dist/{PivotTableV2-De4TXsMc.mjs → PivotTableV2-BufQEGso.mjs} +2 -2
- package/dist/{PivotTableV3-2nzDp4Nc.mjs → PivotTableV3-DwleqfW7.mjs} +4 -4
- package/dist/{Portal-C4N01WKg.mjs → Portal-CuJ3yA9x.mjs} +1222 -1200
- package/dist/{RadioButton-DvzkXfzO.mjs → RadioButton-BagXnWOk.mjs} +1 -1
- package/dist/{ScheduleEmail-PEzbadHC.mjs → ScheduleEmail-C_H0_DNM.mjs} +220 -220
- package/dist/{SearchMetricData-CxmDM20t.mjs → SearchMetricData-DPWkvX0c.mjs} +237 -237
- package/dist/{SortPanel-DQjM_vyk.mjs → SortPanel-DctP-Eyd.mjs} +110 -110
- package/dist/{Table-CvDTChaZ.mjs → Table-BSKvdU4q.mjs} +4 -4
- package/dist/{TagInputField-C9M_Ip9e.mjs → TagInputField-B09tGuSM.mjs} +6 -6
- package/dist/{TextAreaField-Q78INHKO.mjs → TextAreaField-CLmioFXe.mjs} +113 -113
- package/dist/{TimeSeriesSettings-C8lvzgja.mjs → TimeSeriesSettings-BS9LodDk.mjs} +2 -2
- package/dist/{cardQueryError-3MGl4pbM.mjs → cardQueryError-Jo2LkSBF.mjs} +810 -790
- package/dist/{chevron-down-Dxhk-Tao.mjs → chevron-down-CTH4bR6n.mjs} +107 -106
- package/dist/{conditionalFormatting-BuG_4wOq.mjs → conditionalFormatting-BU6BaaPb.mjs} +1 -1
- package/dist/{createGlobalFilter.module-DisUwLsO.mjs → createGlobalFilter.module-Cw_A7yeo.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-BE7AhqVy.mjs → echarts-Dw5Z2Ho-.mjs} +2 -2
- package/dist/{metric.mutation-BRWn1UMi.mjs → metric.mutation-cOoqy5Bi.mjs} +1 -1
- package/dist/{permissions-B5UHxn_4.mjs → permissions-CxZW60Bd.mjs} +289 -261
- package/dist/{pluginV3Request-Dfy8fkbS.mjs → pluginV3Request-CQzo3G0-.mjs} +1 -1
- package/dist/{renderer-qB-6Euan.mjs → renderer-D1fTygev.mjs} +1 -1
- package/dist/{timeseries-Clp-TrGQ.mjs → timeseries-D_nzmvUF.mjs} +1347 -1304
- package/dist/{toTasteAppearance-cIHX7fPm.mjs → toTasteAppearance-C4jy9fG3.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-BtooXte_.mjs → useGuesTokenUsageLog-BgjAaf3E.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-CM4KQARj.mjs → usePublishArchivedMetrics-CM7fUNzL.mjs} +2 -2
- package/dist/{useQuery-D3fpbSfw.mjs → useQuery-DhtsBbBi.mjs} +1 -1
- package/dist/webcomponents.css +2 -2
- package/dist/webcomponents.es.js +483 -459
- package/dist/webcomponents.umd.js +153 -153
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
|
-
import { At as e, Ci as t, Ct as n, Dt as r, H as i, Ia as a, Kr as o, Ln as s, Mr as c, N as l, Oi as ee, Ot as te, Pr as u, Tt as d, _r as f, bt as ne, f as re,
|
|
5
|
-
import { t as
|
|
6
|
-
import { r as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
4
|
+
import { At as e, Ci as t, Ct as n, Dt as r, H as i, Ia as a, Kr as o, Ln as s, Mr as c, N as l, Oi as ee, Ot as te, Pr as u, Tt as d, _r as f, bt as ne, f as re, h as p, jr as m, kt as ie, nt as ae, o as oe, ot as se, sr as h, vr as ce, wt as le, xt as ue } from "./Portal-CuJ3yA9x.mjs";
|
|
5
|
+
import { t as g } from "./Switch-CqsadJBs.mjs";
|
|
6
|
+
import { r as de, t as _ } from "./createGlobalFilter.module-Cw_A7yeo.mjs";
|
|
7
|
+
import { useEffect as fe, useMemo as v, useState as y } from "react";
|
|
8
|
+
import { Fragment as pe, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/CreateGlobalFilter/CreateGlobalFilter.tsx
|
|
10
|
-
var
|
|
10
|
+
var me = [
|
|
11
11
|
"auto",
|
|
12
12
|
"number",
|
|
13
13
|
"date"
|
|
14
|
-
],
|
|
14
|
+
], he = "TABLE", ge = o.filter((e) => me.includes(e.value)), _e = t, ve = c, S = u, C = m, w = ee.filter((e) => e.value !== "NONE"), T = ce, E = f, D = {
|
|
15
15
|
value: "",
|
|
16
16
|
label: ""
|
|
17
|
-
},
|
|
17
|
+
}, ye = (e) => e?.map((e) => typeof e == "string" ? {
|
|
18
18
|
label: e,
|
|
19
19
|
value: e
|
|
20
20
|
} : {
|
|
21
21
|
label: e.label,
|
|
22
22
|
value: e.value
|
|
23
|
-
}) || [],
|
|
23
|
+
}) || [], O = (e) => ({
|
|
24
24
|
label: e.schemaName ? `${e.schemaName}.${e.tableName}` : e.tableName,
|
|
25
25
|
value: e.schemaName ? `${e.schemaName}.${e.tableName}` : e.tableName
|
|
26
|
-
}),
|
|
26
|
+
}), be = (e, t) => {
|
|
27
27
|
let n = t || e[0]?.selectedTable || "";
|
|
28
28
|
return n ? [{
|
|
29
29
|
tableName: n,
|
|
@@ -32,39 +32,39 @@ var he = [
|
|
|
32
32
|
selectedTable: e.selectedTable || n
|
|
33
33
|
}))
|
|
34
34
|
}] : [];
|
|
35
|
-
},
|
|
35
|
+
}, xe = ({ selectedColumn: e, selectedTable: t, clientColumnType: n }) => {
|
|
36
36
|
let r = t?.columnsWithDataType?.find((e) => e.clientColumn) || void 0;
|
|
37
37
|
return {
|
|
38
38
|
clientColumn: e?.clientColumn || r?.clientColumn || "",
|
|
39
39
|
clientColumnType: e?.clientColumnType || r?.clientColumnType || n || ""
|
|
40
40
|
};
|
|
41
|
-
},
|
|
41
|
+
}, Se = (e) => e?.length ? e.map((e) => ({
|
|
42
42
|
...e,
|
|
43
|
-
type: e.type ||
|
|
43
|
+
type: e.type || C[0],
|
|
44
44
|
interval: e.interval?.toString?.() || "1",
|
|
45
|
-
timeGrain: d(e.timeGrain,
|
|
45
|
+
timeGrain: d(e.timeGrain, w),
|
|
46
46
|
label: e.label || ""
|
|
47
47
|
})) : [{
|
|
48
|
-
type:
|
|
48
|
+
type: C[0],
|
|
49
49
|
interval: "1",
|
|
50
|
-
timeGrain:
|
|
50
|
+
timeGrain: w[0],
|
|
51
51
|
label: ""
|
|
52
|
-
}],
|
|
53
|
-
let
|
|
54
|
-
type:
|
|
52
|
+
}], k = ({ dashboard: t, schemaList: o, isSchemaAccessLoaded: c = !1, token: ee, clientId: u, clientColumnType: d, tenancyLevel: f, filterToEdit: m, onCancel: ce, onSuccess: me }) => {
|
|
53
|
+
let k = ae(), [A, Ce] = y(""), [j, we] = y("auto"), [M, Te] = y(_e[0]), [N, Ee] = y(ve[0]), [P, De] = y(S[0]), [F, I] = y([{
|
|
54
|
+
type: C[0],
|
|
55
55
|
interval: "1",
|
|
56
|
-
timeGrain:
|
|
56
|
+
timeGrain: w[0],
|
|
57
57
|
label: ""
|
|
58
|
-
}]), [
|
|
58
|
+
}]), [Oe, L] = y(T[0]), [ke, R] = y(D), [z, B] = y({
|
|
59
59
|
min: null,
|
|
60
60
|
max: null
|
|
61
|
-
}), [
|
|
61
|
+
}), [V, H] = y(), [U, Ae] = y(D), [W, G] = y(D), [je, Me] = y(D), [Ne, Pe] = y(!0), [Fe, Ie] = y(!1), [K, Le] = y(!1), [Re, ze] = y(!1), [Be, Ve] = y(!1), [He, Ue] = y(!1), [We, q] = y(""), Ge = v(() => o.map((e) => O(e)), [o]), J = v(() => o.find((e) => O(e).value === U.value), [o, U.value]), Ke = v(() => J?.columnsWithDataType?.map((e) => ({
|
|
62
62
|
label: e.label || e.name,
|
|
63
63
|
value: `${e.dataType || e.as || ""}--${e.name}`
|
|
64
|
-
})) || [], [J]), Y =
|
|
65
|
-
let e =
|
|
64
|
+
})) || [], [J]), Y = v(() => {
|
|
65
|
+
let e = W.value.split("--")[1];
|
|
66
66
|
return J?.columnsWithDataType?.find((t) => t.name === e);
|
|
67
|
-
}, [
|
|
67
|
+
}, [W.value, J]), X = v(() => xe({
|
|
68
68
|
selectedColumn: Y,
|
|
69
69
|
selectedTable: J,
|
|
70
70
|
clientColumnType: d
|
|
@@ -73,71 +73,71 @@ var he = [
|
|
|
73
73
|
Y,
|
|
74
74
|
J
|
|
75
75
|
]);
|
|
76
|
-
|
|
76
|
+
fe(() => {
|
|
77
77
|
if (!m) return;
|
|
78
78
|
let e = o.find((e) => {
|
|
79
|
-
let t =
|
|
79
|
+
let t = O(e), n = $e(t.value);
|
|
80
80
|
return t.value === m.selectedTable || n === m.selectedTable || e.tableName === m.selectedTable;
|
|
81
81
|
}), t = e?.columnsWithDataType?.find((e) => e.name === m.name), n = m.labelColumnName ? e?.columnsWithDataType?.find((e) => e.name === m.labelColumnName) : void 0, r = m.filterType === "number" ? "number" : m.filterType === "date" ? "date" : "auto";
|
|
82
|
-
|
|
82
|
+
Ce(m.label || m.name || ""), we(r), Te(m.filterVariant || _e[0]), Ee(m.dateVariant || ve[0]), De(m.dateSelectionType || S[0]), I(Se(m.datePresetOptions)), L(m.autoSelectType || (m.filterVariant?.value === "IN" ? E[0] : T[0]));
|
|
83
83
|
let i = Array.isArray(m.defaultValue) ? m.defaultValue[0] : m.defaultValue;
|
|
84
|
-
|
|
84
|
+
R(typeof i == "object" && i && "value" in i && "label" in i ? i : i ? {
|
|
85
85
|
value: i,
|
|
86
86
|
label: i
|
|
87
|
-
} :
|
|
87
|
+
} : D), B(ie(m.defaultValue)), H(te(m.defaultValue)), Ae(e ? O(e) : D), G(t ? {
|
|
88
88
|
label: t.label || t.name,
|
|
89
89
|
value: `${t.dataType || t.as || ""}--${t.name}`
|
|
90
|
-
} :
|
|
90
|
+
} : D), Me(n ? {
|
|
91
91
|
label: n.label || n.name,
|
|
92
92
|
value: `${n.dataType || n.as || ""}--${n.name}`
|
|
93
|
-
} :
|
|
93
|
+
} : D), Pe(!!m.isEnableClearSelection), Ie(!!m.isAllowSorting), Le(!!m.isAutoSelectFilterValue), ze(!!m.isSelectAllMultiSelectOptions), Ve(!!m.isSelectAllMultiSelect), Ue(!1);
|
|
94
94
|
}, [m, o]);
|
|
95
|
-
let qe =
|
|
95
|
+
let qe = v(() => ye(Y?.options || Y?.manualOptions), [Y]), Je = v(() => F.map((e) => ({
|
|
96
96
|
value: e.label.trim(),
|
|
97
97
|
label: e.label.trim(),
|
|
98
98
|
presetDateOption: e
|
|
99
|
-
})).filter((e) => e.value), [
|
|
100
|
-
|
|
99
|
+
})).filter((e) => e.value), [F]), Ye = M.value === "IN" ? E : T, Z = (e, t) => {
|
|
100
|
+
I((n) => n.map((n, r) => r === e ? {
|
|
101
101
|
...n,
|
|
102
102
|
...t
|
|
103
103
|
} : n));
|
|
104
104
|
}, Xe = () => {
|
|
105
|
-
|
|
106
|
-
type:
|
|
105
|
+
I((e) => [...e, {
|
|
106
|
+
type: C[0],
|
|
107
107
|
interval: "1",
|
|
108
|
-
timeGrain:
|
|
108
|
+
timeGrain: w[0],
|
|
109
109
|
label: ""
|
|
110
110
|
}]);
|
|
111
111
|
}, Ze = (e) => {
|
|
112
|
-
|
|
112
|
+
I((t) => t.filter((t, n) => n !== e));
|
|
113
113
|
}, Qe = (e) => {
|
|
114
|
-
|
|
114
|
+
Ae(e), G(D), Me(D), R(D), B({
|
|
115
115
|
min: null,
|
|
116
116
|
max: null
|
|
117
|
-
}),
|
|
117
|
+
}), H(void 0);
|
|
118
118
|
}, $e = (e) => f !== "DATABASE" || !u ? e : `${u}.${s(e).name}`, et = () => {
|
|
119
119
|
if (!J || !Y) return;
|
|
120
|
-
let t = Y.name, r =
|
|
121
|
-
filterType:
|
|
122
|
-
autoVariant:
|
|
123
|
-
dateVariant:
|
|
120
|
+
let t = Y.name, r = j === "auto", i = j === "date", a = r ? "string" : i ? "date" : j === "number" ? "number" : n(Y.dataType, Y.as), o = e({
|
|
121
|
+
filterType: j,
|
|
122
|
+
autoVariant: M,
|
|
123
|
+
dateVariant: N,
|
|
124
124
|
isAutoSelectFilterValue: K,
|
|
125
|
-
selectedDefaultValue:
|
|
126
|
-
selectedRangeDefaultValue:
|
|
127
|
-
selectedDateDefaultValue:
|
|
128
|
-
}), s = $e(
|
|
129
|
-
return
|
|
125
|
+
selectedDefaultValue: ke,
|
|
126
|
+
selectedRangeDefaultValue: z,
|
|
127
|
+
selectedDateDefaultValue: V
|
|
128
|
+
}), s = $e(U.value), c = X.clientColumn, l = X.clientColumnType;
|
|
129
|
+
return ue({
|
|
130
130
|
id: m?.id,
|
|
131
|
-
filterType:
|
|
131
|
+
filterType: j,
|
|
132
132
|
selectedTable: s,
|
|
133
133
|
dataType: Y.dataType || "",
|
|
134
134
|
name: t,
|
|
135
135
|
columnName: t,
|
|
136
|
-
labelColumnToken: r ?
|
|
136
|
+
labelColumnToken: r ? je.value : "",
|
|
137
137
|
as: a,
|
|
138
138
|
isDefault: !1,
|
|
139
139
|
isShowHorizontal: !0,
|
|
140
|
-
label:
|
|
140
|
+
label: A.trim() || Y.label || t,
|
|
141
141
|
defaultValue: o,
|
|
142
142
|
isCreatedByClient: !0,
|
|
143
143
|
clientId: u,
|
|
@@ -149,21 +149,21 @@ var he = [
|
|
|
149
149
|
columnName: t,
|
|
150
150
|
dataType: Y.dataType
|
|
151
151
|
}),
|
|
152
|
-
filterVariant: r ?
|
|
153
|
-
isAutoSelectFilterValue: r || i &&
|
|
154
|
-
isSelectAllMultiSelectOptions: r &&
|
|
155
|
-
isSelectAllMultiSelect: r &&
|
|
156
|
-
isEnableClearSelection: r &&
|
|
157
|
-
isAllowSorting: r &&
|
|
152
|
+
filterVariant: r ? M : D,
|
|
153
|
+
isAutoSelectFilterValue: r || i && N.value === "preset" ? K : !1,
|
|
154
|
+
isSelectAllMultiSelectOptions: r && M.value === "IN" ? Re : !1,
|
|
155
|
+
isSelectAllMultiSelect: r && M.value === "IN" ? Be : !1,
|
|
156
|
+
isEnableClearSelection: r && M.value !== "like" || i && N.value === "preset" ? Ne : !1,
|
|
157
|
+
isAllowSorting: r && M.value !== "like" || i && N.value === "preset" ? Fe : !1,
|
|
158
158
|
isAppFilter: !1,
|
|
159
|
-
dateVariant: i ?
|
|
160
|
-
dateSelectionType: i &&
|
|
161
|
-
datePresetOptions: i &&
|
|
162
|
-
autoSelectType: K && (r &&
|
|
163
|
-
autoSelectCount:
|
|
159
|
+
dateVariant: i ? N : void 0,
|
|
160
|
+
dateSelectionType: i && N.value === "selection" ? P : void 0,
|
|
161
|
+
datePresetOptions: i && N.value === "preset" ? F : void 0,
|
|
162
|
+
autoSelectType: K && (r && M.value !== "like" || i && N.value === "preset") ? Oe : void 0,
|
|
163
|
+
autoSelectCount: M.value === "IN" ? 1 : void 0
|
|
164
164
|
});
|
|
165
165
|
}, tt = async () => {
|
|
166
|
-
if (q(""), !
|
|
166
|
+
if (q(""), !A.trim()) {
|
|
167
167
|
q("Please enter a filter name.");
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
@@ -172,8 +172,8 @@ var he = [
|
|
|
172
172
|
q("Please complete all required fields.");
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
if (
|
|
176
|
-
let e =
|
|
175
|
+
if (j === "number") {
|
|
176
|
+
let e = le(z);
|
|
177
177
|
if (e) {
|
|
178
178
|
q(e);
|
|
179
179
|
return;
|
|
@@ -184,30 +184,30 @@ var he = [
|
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
if (!r({
|
|
187
|
-
filterType:
|
|
187
|
+
filterType: j,
|
|
188
188
|
dataType: Y?.dataType,
|
|
189
189
|
fallback: Y?.as
|
|
190
190
|
})) {
|
|
191
|
-
if (
|
|
191
|
+
if (j === "number") {
|
|
192
192
|
q("Range filter can be created only for numeric columns.");
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
q("Date filter can be created only for date/time columns.");
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
if (f ===
|
|
198
|
+
if (f === he && (!X.clientColumn || !X.clientColumnType)) {
|
|
199
199
|
q("Client column mapping is missing for this table.");
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
203
|
-
let e =
|
|
202
|
+
if (j === "date" && N.value === "preset") {
|
|
203
|
+
let e = F.findIndex((e) => {
|
|
204
204
|
if (!e.label.trim()) return !0;
|
|
205
205
|
if (!["last", "next"].includes(e.type?.value || "")) return !1;
|
|
206
206
|
let t = Number(e.interval);
|
|
207
207
|
return !Number.isFinite(t) || !Number.isInteger(t) || t < 1;
|
|
208
208
|
});
|
|
209
209
|
if (e >= 0) {
|
|
210
|
-
let t =
|
|
210
|
+
let t = F[e];
|
|
211
211
|
q(t?.label.trim() ? `"${t.label.trim()}" needs a time interval of 1 or more.` : `Preset ${e + 1} needs a name in "Save As".`);
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
@@ -216,7 +216,7 @@ var he = [
|
|
|
216
216
|
q("Filter name already exists.");
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
let n =
|
|
219
|
+
let n = be([...t.filters?.flatMap((t) => (t.columns || []).filter((n) => n.isCreatedByClient && n.clientId === u && n.id !== e.id && de({
|
|
220
220
|
column: n,
|
|
221
221
|
isSchemaAccessLoaded: c,
|
|
222
222
|
tableName: t.tableName,
|
|
@@ -227,81 +227,81 @@ var he = [
|
|
|
227
227
|
selectedTable: e.selectedTable || t.tableName
|
|
228
228
|
}))) || [], e], t.filters?.[0]?.tableName || e.selectedTable || "");
|
|
229
229
|
try {
|
|
230
|
-
await
|
|
230
|
+
await k.mutateAsync({
|
|
231
231
|
token: ee,
|
|
232
232
|
data: {
|
|
233
233
|
externalDashboard: t.id,
|
|
234
234
|
filters: n
|
|
235
235
|
}
|
|
236
|
-
}),
|
|
236
|
+
}), me();
|
|
237
237
|
} catch (e) {
|
|
238
238
|
q(e?.message || "Unable to save dashboard filter.");
|
|
239
239
|
}
|
|
240
|
-
}, nt =
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
className:
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
-
className:
|
|
240
|
+
}, nt = j === "auto" && M.value !== "like", Q = j === "date" && N.value === "preset", rt = j === "date" && N.value === "selection", it = (nt || Q) && K, at = (nt || Q) && !K, ot = j === "number", st = Q ? Je : qe, ct = at || ot || rt, lt = j === "auto" && M.value !== "like" || Q, $ = !!A.trim(), ut = k.error?.message, dt = We || ut, ft = !$ || !Y;
|
|
241
|
+
return /* @__PURE__ */ x("div", {
|
|
242
|
+
className: _.form,
|
|
243
|
+
children: [/* @__PURE__ */ x("div", {
|
|
244
|
+
className: _.body,
|
|
245
245
|
children: [
|
|
246
|
-
ft ? /* @__PURE__ */
|
|
246
|
+
ft ? /* @__PURE__ */ b(re, {
|
|
247
247
|
variant: "info",
|
|
248
248
|
text: "Please complete all required fields to configure the filter."
|
|
249
249
|
}) : null,
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ b(i, {
|
|
251
251
|
label: "Filter Name",
|
|
252
252
|
placeholder: "eg: order purchased",
|
|
253
|
-
value:
|
|
253
|
+
value: A,
|
|
254
254
|
onChange: (e) => {
|
|
255
|
-
|
|
255
|
+
Ce(e.target.value), q("");
|
|
256
256
|
},
|
|
257
257
|
isImportant: !0
|
|
258
258
|
}),
|
|
259
|
-
$ ? null : /* @__PURE__ */
|
|
260
|
-
className:
|
|
259
|
+
$ ? null : /* @__PURE__ */ b("div", {
|
|
260
|
+
className: _.hint,
|
|
261
261
|
children: "Enter a filter name to choose an option type and configure the filter."
|
|
262
262
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
className:
|
|
263
|
+
/* @__PURE__ */ x("div", {
|
|
264
|
+
className: _.row,
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
className:
|
|
268
|
-
children: /* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ b("div", {
|
|
267
|
+
className: _.field,
|
|
268
|
+
children: /* @__PURE__ */ b(p, {
|
|
269
269
|
label: "Option Type",
|
|
270
|
-
options:
|
|
271
|
-
selectedOption:
|
|
270
|
+
options: ge,
|
|
271
|
+
selectedOption: ge.find((e) => e.value === j) || ge[0],
|
|
272
272
|
onChange: (e) => {
|
|
273
|
-
|
|
273
|
+
we(e.value), R(D), B({
|
|
274
274
|
min: null,
|
|
275
275
|
max: null
|
|
276
|
-
}),
|
|
276
|
+
}), H(void 0), Ue(!1);
|
|
277
277
|
},
|
|
278
278
|
size: "small",
|
|
279
279
|
isimportant: !0,
|
|
280
280
|
isDisabled: !$
|
|
281
281
|
})
|
|
282
282
|
}),
|
|
283
|
-
|
|
284
|
-
className:
|
|
285
|
-
children: /* @__PURE__ */
|
|
283
|
+
j === "auto" && /* @__PURE__ */ b("div", {
|
|
284
|
+
className: _.field,
|
|
285
|
+
children: /* @__PURE__ */ b(p, {
|
|
286
286
|
label: "Filter Variant",
|
|
287
|
-
options:
|
|
288
|
-
selectedOption:
|
|
287
|
+
options: _e,
|
|
288
|
+
selectedOption: M,
|
|
289
289
|
onChange: (e) => {
|
|
290
|
-
|
|
290
|
+
Te(e), R(D), L(e.value === "IN" ? E[0] : T[0]);
|
|
291
291
|
},
|
|
292
292
|
size: "small",
|
|
293
293
|
isimportant: !0,
|
|
294
294
|
isDisabled: !$
|
|
295
295
|
})
|
|
296
296
|
}),
|
|
297
|
-
|
|
298
|
-
className:
|
|
299
|
-
children: /* @__PURE__ */
|
|
297
|
+
j === "date" && /* @__PURE__ */ b("div", {
|
|
298
|
+
className: _.field,
|
|
299
|
+
children: /* @__PURE__ */ b(p, {
|
|
300
300
|
label: "Filter Variant",
|
|
301
|
-
options:
|
|
302
|
-
selectedOption:
|
|
301
|
+
options: ve,
|
|
302
|
+
selectedOption: N,
|
|
303
303
|
onChange: (e) => {
|
|
304
|
-
|
|
304
|
+
Ee(e), R(D), H(void 0);
|
|
305
305
|
},
|
|
306
306
|
size: "small",
|
|
307
307
|
isimportant: !0,
|
|
@@ -310,53 +310,53 @@ var he = [
|
|
|
310
310
|
})
|
|
311
311
|
]
|
|
312
312
|
}),
|
|
313
|
-
|
|
314
|
-
className:
|
|
315
|
-
children: /* @__PURE__ */
|
|
313
|
+
j === "date" && N.value === "selection" && /* @__PURE__ */ b("div", {
|
|
314
|
+
className: _.field,
|
|
315
|
+
children: /* @__PURE__ */ b(l, {
|
|
316
316
|
label: "Date Selection",
|
|
317
|
-
selectedOption:
|
|
318
|
-
options:
|
|
317
|
+
selectedOption: P,
|
|
318
|
+
options: S,
|
|
319
319
|
onChange: (e) => {
|
|
320
|
-
|
|
320
|
+
De(e), H(void 0);
|
|
321
321
|
},
|
|
322
322
|
buttonWidth: "100%",
|
|
323
323
|
menuWidth: "100%",
|
|
324
324
|
isDisabled: !$
|
|
325
325
|
})
|
|
326
326
|
}),
|
|
327
|
-
|
|
328
|
-
className:
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
className:
|
|
331
|
-
children: [
|
|
332
|
-
className:
|
|
327
|
+
j === "date" && N.value === "preset" && /* @__PURE__ */ b("div", {
|
|
328
|
+
className: _.section,
|
|
329
|
+
children: /* @__PURE__ */ x("div", {
|
|
330
|
+
className: _.presetOptions,
|
|
331
|
+
children: [F.map((e, t) => /* @__PURE__ */ b("div", {
|
|
332
|
+
className: _.presetOption,
|
|
333
333
|
children: (() => {
|
|
334
334
|
let n = e.type?.value === "custom", r = ["last", "next"].includes(e.type?.value || "");
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ x(pe, { children: [
|
|
336
|
+
/* @__PURE__ */ b(p, {
|
|
337
337
|
label: "Filter Range",
|
|
338
|
-
options:
|
|
338
|
+
options: C,
|
|
339
339
|
selectedOption: e.type,
|
|
340
340
|
onChange: (n) => Z(t, {
|
|
341
341
|
type: n,
|
|
342
|
-
customType: n.value === "custom" ? e.customType ||
|
|
342
|
+
customType: n.value === "custom" ? e.customType || S[0] : e.customType
|
|
343
343
|
}),
|
|
344
344
|
size: "small",
|
|
345
345
|
isimportant: !0,
|
|
346
346
|
isDisabled: !$
|
|
347
347
|
}),
|
|
348
|
-
n ? /* @__PURE__ */
|
|
349
|
-
className:
|
|
350
|
-
children: [/* @__PURE__ */
|
|
348
|
+
n ? /* @__PURE__ */ x("div", {
|
|
349
|
+
className: _.row,
|
|
350
|
+
children: [/* @__PURE__ */ b(l, {
|
|
351
351
|
label: "Date Variant",
|
|
352
|
-
selectedOption: e.customType ||
|
|
353
|
-
options:
|
|
352
|
+
selectedOption: e.customType || S[0],
|
|
353
|
+
options: S,
|
|
354
354
|
onChange: (e) => Z(t, { customType: e }),
|
|
355
355
|
buttonWidth: "100%",
|
|
356
356
|
menuWidth: "100%",
|
|
357
357
|
isDisabled: !$,
|
|
358
358
|
isImportant: !0
|
|
359
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ b(oe, {
|
|
360
360
|
label: e.customType?.value === "singleDate" ? "Set Date" : "Set Range",
|
|
361
361
|
isEnableSingleDate: e.customType?.value === "singleDate",
|
|
362
362
|
defaultValues: e.customDate?.startDate && e.customDate?.endDate ? {
|
|
@@ -366,19 +366,19 @@ var he = [
|
|
|
366
366
|
} : void 0,
|
|
367
367
|
onChange: (e) => Z(t, { customDate: e })
|
|
368
368
|
})]
|
|
369
|
-
}) : /* @__PURE__ */
|
|
370
|
-
className:
|
|
371
|
-
children: [r ? /* @__PURE__ */
|
|
369
|
+
}) : /* @__PURE__ */ x("div", {
|
|
370
|
+
className: _.row,
|
|
371
|
+
children: [r ? /* @__PURE__ */ b(i, {
|
|
372
372
|
label: "Time Interval",
|
|
373
373
|
type: "number",
|
|
374
374
|
value: e.interval,
|
|
375
375
|
onChange: (e) => Z(t, { interval: e.target.value }),
|
|
376
376
|
isDisabled: !$,
|
|
377
377
|
isImportant: !0
|
|
378
|
-
}) : null, /* @__PURE__ */
|
|
378
|
+
}) : null, /* @__PURE__ */ b(l, {
|
|
379
379
|
label: "Time Grain",
|
|
380
380
|
selectedOption: e.timeGrain,
|
|
381
|
-
options:
|
|
381
|
+
options: w,
|
|
382
382
|
onChange: (e) => Z(t, { timeGrain: e }),
|
|
383
383
|
buttonWidth: "100%",
|
|
384
384
|
menuWidth: "100%",
|
|
@@ -386,28 +386,28 @@ var he = [
|
|
|
386
386
|
isImportant: !0
|
|
387
387
|
})]
|
|
388
388
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
className:
|
|
391
|
-
children: [/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ x("div", {
|
|
390
|
+
className: _.saveAsRow,
|
|
391
|
+
children: [/* @__PURE__ */ b(i, {
|
|
392
392
|
label: "Save As",
|
|
393
393
|
value: e.label,
|
|
394
394
|
onChange: (e) => Z(t, { label: e.target.value }),
|
|
395
395
|
isDisabled: !$,
|
|
396
396
|
isImportant: !0
|
|
397
|
-
}),
|
|
397
|
+
}), F.length > 1 ? /* @__PURE__ */ b(a, {
|
|
398
398
|
variant: "tertiary",
|
|
399
399
|
onClick: () => Ze(t),
|
|
400
400
|
isDisabled: !$,
|
|
401
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ b(h, { name: "delete" })
|
|
402
402
|
}) : null]
|
|
403
403
|
})
|
|
404
404
|
] });
|
|
405
405
|
})()
|
|
406
|
-
}, `date-preset-option-${t}`)), /* @__PURE__ */
|
|
407
|
-
className:
|
|
408
|
-
children: /* @__PURE__ */
|
|
406
|
+
}, `date-preset-option-${t}`)), /* @__PURE__ */ b("div", {
|
|
407
|
+
className: _.addPresetOption,
|
|
408
|
+
children: /* @__PURE__ */ b(a, {
|
|
409
409
|
variant: "popover",
|
|
410
|
-
leftIcon: /* @__PURE__ */
|
|
410
|
+
leftIcon: /* @__PURE__ */ b(h, { name: "plus" }),
|
|
411
411
|
onClick: Xe,
|
|
412
412
|
isDisabled: !$,
|
|
413
413
|
children: "Add option"
|
|
@@ -415,13 +415,13 @@ var he = [
|
|
|
415
415
|
})]
|
|
416
416
|
})
|
|
417
417
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
className:
|
|
420
|
-
children: /* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ b("div", {
|
|
419
|
+
className: _.section,
|
|
420
|
+
children: /* @__PURE__ */ b(l, {
|
|
421
421
|
label: "Dataset",
|
|
422
422
|
isImportant: !0,
|
|
423
423
|
placeholder: "Select a Table",
|
|
424
|
-
selectedOption:
|
|
424
|
+
selectedOption: U,
|
|
425
425
|
options: Ge,
|
|
426
426
|
onChange: Qe,
|
|
427
427
|
isSearchEnabled: !0,
|
|
@@ -430,35 +430,35 @@ var he = [
|
|
|
430
430
|
isDisabled: !$
|
|
431
431
|
})
|
|
432
432
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
className:
|
|
435
|
-
children: [/* @__PURE__ */
|
|
436
|
-
className:
|
|
437
|
-
children: /* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ x("div", {
|
|
434
|
+
className: _.row,
|
|
435
|
+
children: [/* @__PURE__ */ b("div", {
|
|
436
|
+
className: _.field,
|
|
437
|
+
children: /* @__PURE__ */ b(l, {
|
|
438
438
|
label: "Choose a Column",
|
|
439
439
|
isImportant: !0,
|
|
440
440
|
placeholder: "Select a column",
|
|
441
|
-
selectedOption:
|
|
441
|
+
selectedOption: W,
|
|
442
442
|
options: Ke,
|
|
443
443
|
onChange: (e) => {
|
|
444
|
-
|
|
444
|
+
G(e), R(D), B({
|
|
445
445
|
min: null,
|
|
446
446
|
max: null
|
|
447
|
-
}),
|
|
447
|
+
}), H(void 0);
|
|
448
448
|
},
|
|
449
449
|
isSearchEnabled: !0,
|
|
450
450
|
buttonWidth: "100%",
|
|
451
451
|
menuWidth: "100%",
|
|
452
452
|
isDisabled: !$ || !J
|
|
453
453
|
})
|
|
454
|
-
}),
|
|
455
|
-
className:
|
|
456
|
-
children: /* @__PURE__ */
|
|
454
|
+
}), j === "auto" ? /* @__PURE__ */ b("div", {
|
|
455
|
+
className: _.field,
|
|
456
|
+
children: /* @__PURE__ */ b(l, {
|
|
457
457
|
label: "Choose a Unique Label Column",
|
|
458
458
|
placeholder: "Select a label column",
|
|
459
|
-
selectedOption:
|
|
459
|
+
selectedOption: je,
|
|
460
460
|
options: Ke,
|
|
461
|
-
onChange:
|
|
461
|
+
onChange: Me,
|
|
462
462
|
isSearchEnabled: !0,
|
|
463
463
|
isClearEnabled: !0,
|
|
464
464
|
buttonWidth: "100%",
|
|
@@ -467,96 +467,96 @@ var he = [
|
|
|
467
467
|
})
|
|
468
468
|
}) : null]
|
|
469
469
|
}),
|
|
470
|
-
(lt || ct ||
|
|
471
|
-
className:
|
|
472
|
-
children: [/* @__PURE__ */
|
|
470
|
+
(lt || ct || j === "date") && /* @__PURE__ */ x("div", {
|
|
471
|
+
className: _.advancedSection,
|
|
472
|
+
children: [/* @__PURE__ */ b(a, {
|
|
473
473
|
variant: "popover",
|
|
474
|
-
leftIcon: /* @__PURE__ */
|
|
475
|
-
className: He ? "" :
|
|
476
|
-
children: /* @__PURE__ */
|
|
474
|
+
leftIcon: /* @__PURE__ */ b("span", {
|
|
475
|
+
className: He ? "" : _.collapsedCaret,
|
|
476
|
+
children: /* @__PURE__ */ b(h, { name: "caret-down-fill" })
|
|
477
477
|
}),
|
|
478
478
|
onClick: () => Ue(!He),
|
|
479
479
|
isDisabled: !$,
|
|
480
480
|
children: "Advanced Options"
|
|
481
|
-
}), He ? /* @__PURE__ */
|
|
482
|
-
className:
|
|
481
|
+
}), He ? /* @__PURE__ */ x("div", {
|
|
482
|
+
className: _.options,
|
|
483
483
|
children: [
|
|
484
|
-
|
|
484
|
+
j === "auto" && M.value === "IN" && /* @__PURE__ */ x(pe, { children: [/* @__PURE__ */ b(g, {
|
|
485
485
|
name: "dashboard-filter-show-select-all",
|
|
486
486
|
placeholder: "Show 'Select All'",
|
|
487
487
|
enabled: Be,
|
|
488
488
|
onChange: Ve,
|
|
489
489
|
isDisabled: !$
|
|
490
|
-
}), /* @__PURE__ */
|
|
490
|
+
}), /* @__PURE__ */ b(g, {
|
|
491
491
|
name: "dashboard-filter-auto-select-all",
|
|
492
492
|
placeholder: "Auto Select All Options",
|
|
493
493
|
enabled: Re,
|
|
494
494
|
onChange: ze,
|
|
495
495
|
isDisabled: !$
|
|
496
496
|
})] }),
|
|
497
|
-
lt && /* @__PURE__ */
|
|
497
|
+
lt && /* @__PURE__ */ b(g, {
|
|
498
498
|
name: "dashboard-filter-enable-clear",
|
|
499
499
|
placeholder: "Enable the Clear Filter Option",
|
|
500
500
|
enabled: Ne,
|
|
501
501
|
onChange: Pe,
|
|
502
502
|
isDisabled: !$
|
|
503
503
|
}),
|
|
504
|
-
lt && /* @__PURE__ */
|
|
504
|
+
lt && /* @__PURE__ */ b(g, {
|
|
505
505
|
name: "dashboard-filter-allow-sorting",
|
|
506
506
|
placeholder: "Allow Sorting",
|
|
507
507
|
enabled: Fe,
|
|
508
508
|
onChange: Ie,
|
|
509
509
|
isDisabled: !$
|
|
510
510
|
}),
|
|
511
|
-
nt || Q ? /* @__PURE__ */
|
|
511
|
+
nt || Q ? /* @__PURE__ */ b(g, {
|
|
512
512
|
name: "dashboard-filter-auto-select-default",
|
|
513
513
|
placeholder: "Auto-Select the Default Value",
|
|
514
514
|
enabled: K,
|
|
515
515
|
onChange: (e) => {
|
|
516
|
-
Le(e), e &&
|
|
516
|
+
Le(e), e && R(D);
|
|
517
517
|
},
|
|
518
518
|
isDisabled: !$
|
|
519
519
|
}) : null,
|
|
520
|
-
it && /* @__PURE__ */
|
|
520
|
+
it && /* @__PURE__ */ b(l, {
|
|
521
521
|
label: "Auto Select Type",
|
|
522
|
-
selectedOption:
|
|
522
|
+
selectedOption: Oe,
|
|
523
523
|
options: Ye,
|
|
524
|
-
onChange:
|
|
524
|
+
onChange: L,
|
|
525
525
|
buttonWidth: "100%",
|
|
526
526
|
menuWidth: "100%",
|
|
527
527
|
isDisabled: !$
|
|
528
528
|
}),
|
|
529
|
-
at && /* @__PURE__ */
|
|
529
|
+
at && /* @__PURE__ */ b(l, {
|
|
530
530
|
label: "Default Value",
|
|
531
531
|
placeholder: "Default Value Dropdown",
|
|
532
|
-
selectedOption:
|
|
532
|
+
selectedOption: ke,
|
|
533
533
|
options: st,
|
|
534
|
-
onChange:
|
|
534
|
+
onChange: R,
|
|
535
535
|
isSearchEnabled: !0,
|
|
536
536
|
isClearEnabled: !0,
|
|
537
537
|
buttonWidth: "100%",
|
|
538
538
|
menuWidth: "100%",
|
|
539
539
|
isDisabled: !$
|
|
540
540
|
}),
|
|
541
|
-
ot && /* @__PURE__ */
|
|
541
|
+
ot && /* @__PURE__ */ b(se, {
|
|
542
542
|
label: "Default Value",
|
|
543
|
-
defaultValues:
|
|
544
|
-
onChange: (e) =>
|
|
543
|
+
defaultValues: z,
|
|
544
|
+
onChange: (e) => B(e || {
|
|
545
545
|
min: null,
|
|
546
546
|
max: null
|
|
547
547
|
}),
|
|
548
548
|
buttonWidth: "100%",
|
|
549
549
|
isDisabled: !$
|
|
550
550
|
}),
|
|
551
|
-
rt && /* @__PURE__ */
|
|
551
|
+
rt && /* @__PURE__ */ b(oe, {
|
|
552
552
|
label: "Default Value",
|
|
553
|
-
isEnableSingleDate:
|
|
554
|
-
defaultValues:
|
|
555
|
-
startDate:
|
|
556
|
-
endDate:
|
|
557
|
-
timeGrainValue:
|
|
553
|
+
isEnableSingleDate: P.value === "singleDate",
|
|
554
|
+
defaultValues: V?.startDate && V?.endDate ? {
|
|
555
|
+
startDate: V.startDate,
|
|
556
|
+
endDate: V.endDate,
|
|
557
|
+
timeGrainValue: V.timeGrainValue || "between"
|
|
558
558
|
} : void 0,
|
|
559
|
-
onChange:
|
|
559
|
+
onChange: H,
|
|
560
560
|
buttonWidth: "100%",
|
|
561
561
|
isDisabled: !$,
|
|
562
562
|
isImportant: !0
|
|
@@ -564,22 +564,22 @@ var he = [
|
|
|
564
564
|
]
|
|
565
565
|
}) : null]
|
|
566
566
|
}),
|
|
567
|
-
dt ? /* @__PURE__ */
|
|
568
|
-
className:
|
|
567
|
+
dt ? /* @__PURE__ */ b("div", {
|
|
568
|
+
className: _.error,
|
|
569
569
|
children: dt
|
|
570
570
|
}) : null
|
|
571
571
|
]
|
|
572
|
-
}), /* @__PURE__ */
|
|
573
|
-
className:
|
|
574
|
-
children: [/* @__PURE__ */
|
|
572
|
+
}), /* @__PURE__ */ x("div", {
|
|
573
|
+
className: _.footer,
|
|
574
|
+
children: [/* @__PURE__ */ b(a, {
|
|
575
575
|
variant: "secondary",
|
|
576
|
-
onClick:
|
|
576
|
+
onClick: ce,
|
|
577
577
|
className: "cta-secondary",
|
|
578
578
|
children: "Cancel"
|
|
579
|
-
}), /* @__PURE__ */
|
|
579
|
+
}), /* @__PURE__ */ b(a, {
|
|
580
580
|
variant: "primary",
|
|
581
581
|
onClick: tt,
|
|
582
|
-
isDisabled: !$ ||
|
|
582
|
+
isDisabled: !$ || k.isPending,
|
|
583
583
|
className: "cta-primary",
|
|
584
584
|
children: "Save"
|
|
585
585
|
})]
|
|
@@ -587,4 +587,4 @@ var he = [
|
|
|
587
587
|
});
|
|
588
588
|
};
|
|
589
589
|
//#endregion
|
|
590
|
-
export {
|
|
590
|
+
export { k as CreateGlobalFilter };
|