@feedmepos/mf-report 5.4.15-beta.1 → 5.4.15-beta.3

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.
Files changed (45) hide show
  1. package/dist/App-DufL3Y8h.js +152 -0
  2. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DLDk5l4R.js +162 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-Bxuyjrkr.js → Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js} +2 -2
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js +999 -0
  5. package/dist/{InsightView-D78TK2E8.js → InsightView-tyeJBlRm.js} +1051 -1049
  6. package/dist/Integration-ILSIf-OL.js +3695 -0
  7. package/dist/Integrations-DwgNrM3U.js +334 -0
  8. package/dist/{Layout-DERpCrQk.js → Layout-Bw1oh6Q-.js} +1 -1
  9. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DurYBXa5.js → LocationSelect.vue_vue_type_script_setup_true_lang-BFj4d-UF.js} +1861 -1859
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DzZeasAK.js +277 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-C8yzWDXs.js → NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js} +5526 -5482
  12. package/dist/NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js +31 -0
  13. package/dist/OverviewView-Dl8oOobn.js +61 -0
  14. package/dist/Report-BqD8KVZ8.js +424 -0
  15. package/dist/ReportEditor-DkzFUgbO.js +532 -0
  16. package/dist/ReportView-DpWZHV0o.js +169 -0
  17. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-C3VG1mi_.js +104 -0
  18. package/dist/Setting-CYrg_50p.js +320 -0
  19. package/dist/TileEditor-CDrzLbqc.js +2320 -0
  20. package/dist/{TransitionFade-BLDfpF7R.js → TransitionFade-D19wC3tb.js} +225 -220
  21. package/dist/app.js +915 -27
  22. package/dist/{global-loader-CMC9fgBi.js → global-loader-C3JC7z-H.js} +4966 -2240
  23. package/dist/index-9IDzTnHw.js +147 -0
  24. package/dist/{report-schema-G0x3CoJb.js → report-schema-1zQJbLyB.js} +4 -4
  25. package/dist/style.css +1 -1
  26. package/dist/timeFormat-CjNvJMgk.js +9 -0
  27. package/dist/{v4-DF7wffYN.js → v4-D29FkHfi.js} +2666 -1927
  28. package/package.json +1 -1
  29. package/dist/App-mcSgbcVY.js +0 -133
  30. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DPuhMR6i.js +0 -160
  31. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B6IzlHmr.js +0 -996
  32. package/dist/HeaderTab.vue_vue_type_script_setup_true_lang-B5VBDNwX.js +0 -19
  33. package/dist/Integration-Cm6_YEEE.js +0 -3554
  34. package/dist/Integrations-WWnSho0Q.js +0 -334
  35. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-h87kWy1E.js +0 -261
  36. package/dist/NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js +0 -30
  37. package/dist/OverviewView-D7zAR7_7.js +0 -60
  38. package/dist/Report-BnX5amn0.js +0 -409
  39. package/dist/ReportEditor-DW7uWg_a.js +0 -530
  40. package/dist/ReportView-xSaJA5F6.js +0 -166
  41. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-DBI9op0g.js +0 -103
  42. package/dist/Setting-D8JspXTN.js +0 -326
  43. package/dist/TileEditor-DQ8C5I_M.js +0 -2301
  44. package/dist/index-SmIkb24L.js +0 -143
  45. package/dist/timeFormat-BF-F4Rnt.js +0 -9
@@ -1,2301 +0,0 @@
1
- import { defineComponent as P, mergeModels as H, useModel as z, computed as N, ref as j, resolveComponent as f, createElementBlock as $, openBlock as d, createVNode as s, createElementVNode as F, withCtx as w, Fragment as G, renderList as ue, toDisplayString as X, withModifiers as Z, unref as T, createTextVNode as oe, watch as ie, createCommentVNode as x, createBlock as V, renderSlot as we, resolveDynamicComponent as xe, normalizeClass as Ce, onMounted as Oe, normalizeStyle as $e, isRef as Ie } from "vue";
2
- import { useRoute as Le, useRouter as Me } from "vue-router";
3
- import { h as Be, d as re, S as pe, W as Re, a as Ae, T as je, _ as Ee } from "./TransitionFade-BLDfpF7R.js";
4
- import { _ as qe } from "./HeaderTab.vue_vue_type_script_setup_true_lang-B5VBDNwX.js";
5
- import { W as C, a as Je } from "./v4-DF7wffYN.js";
6
- import { storeToRefs as ye } from "pinia";
7
- import { u as he } from "./message-dialog-UoMWOnil.js";
8
- import { c as Fe, d as Te, p as He } from "./index-SmIkb24L.js";
9
- import { useSnackbar as Pe, useBreakpoints as Se, FmButtonColorThemeVariant as se } from "@feedmepos/ui-library";
10
- import { u as _e } from "./report-schema-G0x3CoJb.js";
11
- import { _ as ne } from "./BaseDialog.vue_vue_type_script_setup_true_lang-DTNiGKgd.js";
12
- import { _ as q } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DBI9op0g.js";
13
- import { g as me, _ as De } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-B6IzlHmr.js";
14
- import { g as de } from "./global-loader-CMC9fgBi.js";
15
- import { _ as Ne } from "./NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js";
16
- var le = /* @__PURE__ */ ((u) => (u.DateTime = "DATE_TIME", u.Hour = "HOUR", u.Day = "DAY", u.Week = "WEEK", u.Month = "MONTH", u.TimeOfDay = "TIME_OF_DAY", u.HourOfDay = "HOUR_OF_DAY", u.DayOfWeek = "DAY_OF_WEEK", u.DayOfMonth = "DAY_OF_MONTH", u.MonthOfYear = "MONTH_OF_YEAR", u.Year = "YEAR", u))(le || {}), ve = /* @__PURE__ */ ((u) => (u.Asc = "ASC", u.Desc = "DESC", u))(ve || {}), Q = /* @__PURE__ */ ((u) => (u.Equal = "EQUAL", u.NotEqual = "NOT_EQUAL", u.GreaterThan = "GREATER_THAN", u.LessThan = "LESS_THAN", u.GreaterThanOrEqual = "GREATER_THAN_OR_EQUAL", u.LessThanOrEqual = "LESS_THAN_OR_EQUAL", u.Between = "BETWEEN", u.Like = "LIKE", u.NotLike = "NOT_LIKE", u.And = "AND", u.Or = "OR", u))(Q || {}), ae = /* @__PURE__ */ ((u) => (u.String = "STRING", u.Timestamp = "TIMESTAMP", u.Bool = "BOOL", u.Numeric = "NUMERIC", u))(ae || {});
17
- const Ve = [
18
- {
19
- type: C.Circular,
20
- maxDimension: null,
21
- maxMetric: 1,
22
- hasBreakdownDimension: !1,
23
- canTranspose: !1,
24
- isDrillConfigurable: !1,
25
- hasLabel: !0,
26
- canRollup: !1,
27
- showRollupPosition: !1,
28
- canSearch: !1
29
- },
30
- {
31
- type: C.Table,
32
- maxDimension: null,
33
- maxMetric: null,
34
- hasBreakdownDimension: !1,
35
- canTranspose: !1,
36
- isDrillConfigurable: !0,
37
- hasLabel: !1,
38
- canRollup: !0,
39
- showRollupPosition: !0,
40
- canSearch: !0
41
- },
42
- {
43
- type: C.BarChart,
44
- maxDimension: null,
45
- maxMetric: 1,
46
- hasBreakdownDimension: !0,
47
- canTranspose: !0,
48
- isDrillConfigurable: !1,
49
- hasLabel: !0,
50
- canRollup: !1,
51
- showRollupPosition: !1,
52
- canSearch: !1
53
- },
54
- {
55
- type: C.LineChart,
56
- maxDimension: null,
57
- maxMetric: 1,
58
- hasBreakdownDimension: !0,
59
- canTranspose: !0,
60
- isDrillConfigurable: !1,
61
- hasLabel: !0,
62
- canRollup: !1,
63
- showRollupPosition: !1,
64
- canSearch: !1
65
- },
66
- {
67
- type: C.StackBarChart,
68
- maxDimension: null,
69
- maxMetric: 1,
70
- hasBreakdownDimension: !0,
71
- canTranspose: !0,
72
- isDrillConfigurable: !1,
73
- hasLabel: !0,
74
- canRollup: !1,
75
- showRollupPosition: !1,
76
- canSearch: !1
77
- },
78
- {
79
- type: C.StackLineChart,
80
- maxDimension: null,
81
- maxMetric: 1,
82
- hasBreakdownDimension: !0,
83
- canTranspose: !0,
84
- isDrillConfigurable: !1,
85
- hasLabel: !0,
86
- canRollup: !1,
87
- showRollupPosition: !1,
88
- canSearch: !1
89
- },
90
- {
91
- type: C.Scorecard,
92
- maxDimension: null,
93
- maxMetric: 1,
94
- hasBreakdownDimension: !1,
95
- canTranspose: !1,
96
- isDrillConfigurable: !1,
97
- hasLabel: !1,
98
- canRollup: !1,
99
- showRollupPosition: !1,
100
- canSearch: !1
101
- },
102
- {
103
- type: C.Spacer,
104
- maxDimension: 0,
105
- maxMetric: 0,
106
- hasBreakdownDimension: !1,
107
- canTranspose: !1,
108
- isDrillConfigurable: !1,
109
- hasLabel: !1,
110
- canRollup: !1,
111
- showRollupPosition: !1,
112
- canSearch: !1
113
- }
114
- ], We = { class: "flex flex-col my-2 gap-8" }, ze = ["onClick"], Ge = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis" }, Ye = /* @__PURE__ */ P({
115
- __name: "SchemaSection",
116
- props: /* @__PURE__ */ H({
117
- options: {
118
- type: Array,
119
- default: () => []
120
- },
121
- label: {
122
- type: String,
123
- default: "Schema"
124
- }
125
- }, {
126
- modelValue: { required: !0 },
127
- modelModifiers: {}
128
- }),
129
- emits: ["update:modelValue"],
130
- setup(u) {
131
- const r = z(u, "modelValue"), n = u, { schemas: m } = ye(_e()), p = N(
132
- () => m.value.map((k) => ({
133
- labels: [k.label],
134
- value: k.name,
135
- raw: k
136
- }))
137
- ), y = N(() => {
138
- if (r.value.schemaNames.length === 0 || i.value === 0)
139
- return p.value.filter((k) => !k.raw.isJoinOnly);
140
- {
141
- const k = r.value.schemaNames[0], t = m.value.find((l) => l.name === k), c = ((t == null ? void 0 : t.joins) || []).map((l) => l);
142
- return p.value.filter((l) => c.includes(l.raw.name));
143
- }
144
- }), v = j(!1), a = j(""), i = j(), b = Pe();
145
- function h(k) {
146
- var t;
147
- return (t = m.value.find((c) => c.name === k)) == null ? void 0 : t.label;
148
- }
149
- function U(k) {
150
- i.value = k, v.value = !0, k !== void 0 ? a.value = r.value.schemaNames[k] : a.value = "";
151
- }
152
- function R() {
153
- a.value !== "" ? (i.value !== void 0 ? r.value.schemaNames[i.value] = a.value : r.value.schemaNames.push(a.value), v.value = !1) : b.open({ message: "Nothing is selected", type: "error" });
154
- }
155
- return (k, t) => {
156
- const c = f("FmForm"), l = f("FmIcon"), e = f("FmField");
157
- return d(), $("div", We, [
158
- s(ne, {
159
- modelValue: v.value,
160
- "onUpdate:modelValue": t[1] || (t[1] = (o) => v.value = o),
161
- title: n.label,
162
- onConfirm: R
163
- }, {
164
- content: w(() => [
165
- s(c, { ref: "form" }, {
166
- default: w(() => [
167
- s(q, {
168
- modelValue: a.value,
169
- "onUpdate:modelValue": t[0] || (t[0] = (o) => a.value = o),
170
- label: "schema",
171
- items: i.value === 0 ? p.value.map((o) => ({ label: o.labels[0], value: o.value })) : y.value.map((o) => ({
172
- label: o.labels[0],
173
- value: o.value
174
- }))
175
- }, null, 8, ["modelValue", "items"])
176
- ]),
177
- _: 1
178
- }, 512)
179
- ]),
180
- _: 1
181
- }, 8, ["modelValue", "title"]),
182
- t[5] || (t[5] = F("div", null, [
183
- F("p", { class: "fm-typo-en-body-lg-600" }, "Schema"),
184
- F("p", { class: "text-sm text-fm-color-neutral-gray-400" }, " Start to create your own reports by selecting a schema ")
185
- ], -1)),
186
- (d(!0), $(G, null, ue(r.value.schemaNames, (o, g) => (d(), $("div", {
187
- key: g,
188
- class: "flex flex-col gap-2 w-full"
189
- }, [
190
- F("div", {
191
- class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
192
- onClick: (M) => U(g)
193
- }, [
194
- F("p", Ge, X(h(o)), 1),
195
- t[3] || (t[3] = F("div", { class: "grow" }, null, -1)),
196
- s(l, {
197
- name: "close",
198
- onClick: Z(
199
- () => {
200
- r.value.schemaNames = T(Be)(r.value.schemaNames, g);
201
- },
202
- ["stop"]
203
- )
204
- }, null, 8, ["onClick"])
205
- ], 8, ze)
206
- ]))), 128)),
207
- s(e, {
208
- class: "text-fm-color-typo-tertiary",
209
- onClick: t[2] || (t[2] = () => {
210
- U();
211
- })
212
- }, {
213
- default: w(() => t[4] || (t[4] = [
214
- oe(" Add schema ")
215
- ])),
216
- _: 1
217
- })
218
- ]);
219
- };
220
- }
221
- }), Ke = {
222
- key: 0,
223
- class: "flex flex-col my-2 gap-8"
224
- }, Qe = { class: "fm-typo-en-body-lg-600" }, Xe = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Ze = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, ce = /* @__PURE__ */ P({
225
- __name: "DimensionSection",
226
- props: /* @__PURE__ */ H({
227
- options: {
228
- type: Array,
229
- default: () => []
230
- },
231
- label: {
232
- type: String,
233
- default: "Dimension"
234
- },
235
- max: {
236
- type: Number,
237
- default: void 0
238
- },
239
- config: {
240
- type: Object,
241
- default: () => {
242
- }
243
- },
244
- hasRowColumn: {
245
- type: Boolean,
246
- default: !1
247
- }
248
- }, {
249
- modelValue: {
250
- required: !1,
251
- default: []
252
- },
253
- modelModifiers: {}
254
- }),
255
- emits: ["update:modelValue"],
256
- setup(u) {
257
- const r = z(u, "modelValue"), n = u, m = j(!1), p = N(
258
- () => r.value.map((l, e) => ({
259
- index: e,
260
- labels: [l.label || l.name],
261
- value: l
262
- }))
263
- ), y = j(r.value.length > 0 ? 0 : void 0);
264
- function v(l) {
265
- var e, o;
266
- m.value = !0, a.value = l != null && l.value ? JSON.parse(JSON.stringify(l.value)) : void 0, y.value = l == null ? void 0 : l.index, i.value = !!((e = a.value) != null && e.dataFormula || (o = a.value) != null && o.displayFormula);
267
- }
268
- N(() => !!n.max && r.value.length === n.max);
269
- const a = j(void 0), i = j(!1), b = N(
270
- () => n.options.find(
271
- (l) => {
272
- var e, o;
273
- return l.schemaName === ((e = a.value) == null ? void 0 : e.schemaName) && l.name === ((o = a.value) == null ? void 0 : o.name);
274
- }
275
- ) ?? {}
276
- );
277
- ie(
278
- () => {
279
- var l;
280
- return (l = a.value) == null ? void 0 : l.option;
281
- },
282
- () => {
283
- !h.value && a.value && (a.value.fillGap = !1);
284
- }
285
- );
286
- const h = N(
287
- () => {
288
- var l, e, o;
289
- return (o = (l = b.value) == null ? void 0 : l.fillGapDimensionOptions) == null ? void 0 : o.includes(((e = a.value) == null ? void 0 : e.option) || "");
290
- }
291
- );
292
- function U(l) {
293
- var e, o;
294
- (l.schemaName !== ((e = a.value) == null ? void 0 : e.schemaName) || l.name !== ((o = a.value) == null ? void 0 : o.name)) && (a.value = {
295
- schemaName: l.schemaName,
296
- name: l.name,
297
- option: l.dimensionOptions[0],
298
- label: l.label,
299
- decimal: l.isNumericType ? 2 : void 0,
300
- hide: !1
301
- }, i.value = !1);
302
- }
303
- function R() {
304
- if (!a.value) {
305
- console.error("new field is undefined");
306
- return;
307
- }
308
- const l = [...p.value.map((e) => e.value)];
309
- y.value !== void 0 ? l[y.value] = a.value : l.push(a.value), r.value = l, m.value = !1;
310
- }
311
- function k(l) {
312
- const o = [...p.value.map((g) => g.value)].filter((g, M) => M !== l);
313
- r.value = o;
314
- }
315
- function t(l) {
316
- a.value && (a.value.decimal = Number(l));
317
- }
318
- const c = N(
319
- () => n.options.map((l) => ({ label: l.labels.join(" "), value: l }))
320
- );
321
- return (l, e) => {
322
- const o = f("FmTextField"), g = f("FmStepperField"), M = f("FmCheckbox"), E = f("FmTextarea"), W = f("FmForm"), K = f("FmIcon"), _ = f("FmButton"), A = f("FmListItem"), B = f("FmList"), J = f("FmField");
323
- return u.max !== 0 ? (d(), $("div", Ke, [
324
- s(ne, {
325
- modelValue: m.value,
326
- "onUpdate:modelValue": e[12] || (e[12] = (S) => m.value = S),
327
- title: n.label,
328
- onConfirm: R
329
- }, {
330
- content: w(() => [
331
- s(W, {
332
- ref: "form",
333
- class: "flex flex-col gap-2 w-[490px]"
334
- }, {
335
- default: w(() => {
336
- var S, I, D, ee, O, Y;
337
- return [
338
- s(q, {
339
- "model-value": b.value,
340
- items: c.value,
341
- placeholder: n.label,
342
- label: n.label,
343
- "onUpdate:modelValue": e[0] || (e[0] = (L) => U(L))
344
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
345
- a.value ? (d(), $(G, { key: 0 }, [
346
- s(o, {
347
- modelValue: a.value.label,
348
- "onUpdate:modelValue": e[1] || (e[1] = (L) => a.value.label = L),
349
- label: "Label"
350
- }, null, 8, ["modelValue"]),
351
- (((S = b.value) == null ? void 0 : S.dimensionOptions) || []).length > 0 ? (d(), V(q, {
352
- key: 0,
353
- modelValue: a.value.option,
354
- "onUpdate:modelValue": e[2] || (e[2] = (L) => a.value.option = L),
355
- items: ((I = b.value) == null ? void 0 : I.dimensionOptions.map((L) => ({
356
- label: L,
357
- value: L
358
- }))) ?? []
359
- }, null, 8, ["modelValue", "items"])) : x("", !0),
360
- (D = b.value) != null && D.isNumericType ? (d(), V(g, {
361
- key: 1,
362
- label: "Decimal",
363
- "model-value": ((ee = a.value) == null ? void 0 : ee.decimal) ?? 2,
364
- "onUpdate:modelValue": e[3] || (e[3] = (L) => {
365
- t(L);
366
- })
367
- }, null, 8, ["model-value"])) : x("", !0),
368
- (O = b.value) != null && O.isNumericType ? (d(), V(q, {
369
- key: 2,
370
- modelValue: a.value.timeFormatter,
371
- "onUpdate:modelValue": e[4] || (e[4] = (L) => a.value.timeFormatter = L),
372
- placeholder: "Time Formatter",
373
- label: "Time Formatter",
374
- items: b.value.timeFormatters.map((L) => ({ label: L, value: L }))
375
- }, null, 8, ["modelValue", "items"])) : x("", !0),
376
- h.value ? (d(), V(M, {
377
- key: 3,
378
- "model-value": a.value.fillGap ?? !1,
379
- label: "Fill gap",
380
- value: "",
381
- placeholder: "Fill gap",
382
- "onUpdate:modelValue": e[5] || (e[5] = (L) => {
383
- a.value && (a.value.fillGap = L);
384
- })
385
- }, null, 8, ["model-value"])) : x("", !0),
386
- ((Y = b.value) == null ? void 0 : Y.type) === T(ae).Timestamp ? (d(), V(M, {
387
- key: 4,
388
- "model-value": a.value.dateComparison ?? !1,
389
- label: "Date comparision",
390
- value: "",
391
- "onUpdate:modelValue": e[6] || (e[6] = (L) => {
392
- a.value && (a.value.dateComparison = L);
393
- })
394
- }, null, 8, ["model-value"])) : x("", !0),
395
- s(M, {
396
- modelValue: a.value.hide,
397
- "onUpdate:modelValue": e[7] || (e[7] = (L) => a.value.hide = L),
398
- label: "Hide",
399
- value: ""
400
- }, null, 8, ["modelValue"]),
401
- n.hasRowColumn ? (d(), V(M, {
402
- key: 5,
403
- modelValue: a.value.moveToColumn,
404
- "onUpdate:modelValue": e[8] || (e[8] = (L) => a.value.moveToColumn = L),
405
- label: "Move to column",
406
- value: ""
407
- }, null, 8, ["modelValue"])) : x("", !0),
408
- s(M, {
409
- modelValue: i.value,
410
- "onUpdate:modelValue": e[9] || (e[9] = (L) => i.value = L),
411
- label: "Advance",
412
- value: !0
413
- }, null, 8, ["modelValue"]),
414
- i.value ? (d(), V(E, {
415
- key: 6,
416
- modelValue: a.value.dataFormula,
417
- "onUpdate:modelValue": e[10] || (e[10] = (L) => a.value.dataFormula = L),
418
- placeholder: "Data Source Formula"
419
- }, null, 8, ["modelValue"])) : x("", !0),
420
- i.value ? (d(), V(E, {
421
- key: 7,
422
- modelValue: a.value.displayFormula,
423
- "onUpdate:modelValue": e[11] || (e[11] = (L) => a.value.displayFormula = L),
424
- placeholder: "Display Formula"
425
- }, null, 8, ["modelValue"])) : x("", !0)
426
- ], 64)) : x("", !0)
427
- ];
428
- }),
429
- _: 1
430
- }, 512)
431
- ]),
432
- _: 1
433
- }, 8, ["modelValue", "title"]),
434
- F("div", null, [
435
- F("p", Qe, X(n.label), 1),
436
- F("p", Xe, X(n.label) + " is the field of table ", 1)
437
- ]),
438
- s(B, null, {
439
- default: w(() => [
440
- s(T(re), {
441
- list: r.value,
442
- "item-key": "id",
443
- class: "flex flex-col gap-2"
444
- }, {
445
- item: w(({ element: S, index: I }) => [
446
- s(A, {
447
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
448
- onClick: Z((D) => v(p.value[I]), ["stop"])
449
- }, {
450
- default: w(() => [
451
- s(K, { name: "drag_handle" }),
452
- F("p", Ze, X(S.label), 1),
453
- e[14] || (e[14] = F("div", { class: "grow" }, null, -1)),
454
- s(_, {
455
- icon: "close",
456
- size: "md",
457
- variant: "tertiary",
458
- onClick: Z((D) => k(I), ["stop"])
459
- }, null, 8, ["onClick"])
460
- ]),
461
- _: 2
462
- }, 1032, ["onClick"])
463
- ]),
464
- _: 1
465
- }, 8, ["list"])
466
- ]),
467
- _: 1
468
- }),
469
- s(J, {
470
- class: "text-fm-color-typo-tertiary",
471
- onClick: e[13] || (e[13] = () => {
472
- v();
473
- })
474
- }, {
475
- default: w(() => e[15] || (e[15] = [
476
- oe(" Add dimension ")
477
- ])),
478
- _: 1
479
- })
480
- ])) : x("", !0);
481
- };
482
- }
483
- }), fe = {
484
- value: "_metric_name"
485
- };
486
- function el(u, r, n) {
487
- switch (u) {
488
- case C.BarChart:
489
- case C.StackBarChart:
490
- case C.LineChart:
491
- case C.StackLineChart:
492
- case C.Circular:
493
- return r.length > 1;
494
- default:
495
- return n;
496
- }
497
- }
498
- function ll(u) {
499
- var m;
500
- const { rowIds: r, columnIds: n } = ge(u.widget.config);
501
- return {
502
- ...u,
503
- widget: {
504
- ...u.widget,
505
- config: {
506
- ...u.widget.config,
507
- rowIds: r,
508
- columnIds: n,
509
- isDrillable: el(
510
- u.widget.type,
511
- u.widget.config.dimensions,
512
- u.widget.config.isDrillable
513
- ),
514
- joinDatasources: (m = u.widget.config.joinDatasources) == null ? void 0 : m.map((p) => {
515
- const { rowIds: y, columnIds: v } = ge(p);
516
- return {
517
- ...p,
518
- rowIds: y,
519
- columnIds: v
520
- };
521
- })
522
- }
523
- }
524
- };
525
- }
526
- function ge(u) {
527
- const r = u.dimensions.filter((v) => v.hide !== !0 && !v.moveToColumn).map((v) => me(v)), n = u.dimensions.filter((v) => v.hide !== !0 && v.moveToColumn == !0).map((v) => me(v)), m = u.metrics.length > 0;
528
- m && u.metrics.find((v) => v.moveToRow == !0) ? r.push(fe.value) : m && n.push(fe.value);
529
- const p = [], y = [];
530
- for (const v of r)
531
- p.push(v);
532
- for (const v of n)
533
- y.push(v);
534
- return {
535
- rowIds: p,
536
- columnIds: y
537
- };
538
- }
539
- const al = { class: "flex flex-col my-2 gap-8" }, ol = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, nl = /* @__PURE__ */ P({
540
- __name: "MetricSection",
541
- props: /* @__PURE__ */ H({
542
- options: {
543
- type: Array,
544
- default: () => []
545
- },
546
- max: {
547
- type: Number,
548
- default: void 0
549
- },
550
- config: {
551
- type: Object,
552
- default: () => {
553
- }
554
- },
555
- hasRowColumn: {
556
- type: Boolean,
557
- default: !1
558
- }
559
- }, {
560
- modelValue: { required: !1, default: [] },
561
- modelModifiers: {}
562
- }),
563
- emits: /* @__PURE__ */ H(["config"], ["update:modelValue"]),
564
- setup(u, { emit: r }) {
565
- const n = z(u, "modelValue"), m = u;
566
- N(() => !!m.max && n.value.length === m.max);
567
- const p = j(!1), y = N(
568
- () => n.value.map((e, o) => ({
569
- index: o,
570
- labels: [e.label || e.name],
571
- value: e
572
- }))
573
- ), v = j(n.value.length > 0 ? 0 : void 0);
574
- function a(e) {
575
- var o, g, M;
576
- p.value = !0, i.value = e != null && e.value ? JSON.parse(JSON.stringify(e.value)) : void 0, v.value = e == null ? void 0 : e.index, b.value = !!((o = i.value) != null && o.dataFormula || (g = i.value) != null && g.displayFormula), ((M = m.config.rowIds) == null ? void 0 : M.findIndex((E) => E === fe.value)) !== -1 && i.value && (i.value.moveToRow = !0);
577
- }
578
- const i = j(void 0), b = j(!1), h = N(
579
- () => m.options.find(
580
- (e) => {
581
- var o, g;
582
- return e.schemaName === ((o = i.value) == null ? void 0 : o.schemaName) && e.name === ((g = i.value) == null ? void 0 : g.name);
583
- }
584
- ) ?? {}
585
- );
586
- function U(e, o) {
587
- var g;
588
- return (e == null ? void 0 : e.isNumericType) || ((g = e == null ? void 0 : e.isNumericAggregations) == null ? void 0 : g.includes(o || ""));
589
- }
590
- const R = N(
591
- () => {
592
- var e;
593
- return U(h.value, (e = i.value) == null ? void 0 : e.aggregation);
594
- }
595
- );
596
- ie(R, (e) => {
597
- i.value && (e ? i.value.decimal = typeof i.value.decimal != "number" ? 2 : i.value.decimal : i.value.decimal = void 0);
598
- });
599
- function k(e) {
600
- var o, g;
601
- (e.schemaName !== ((o = i.value) == null ? void 0 : o.schemaName) || e.name !== ((g = i.value) == null ? void 0 : g.name)) && (i.value = {
602
- schemaName: e.schemaName,
603
- name: e.name,
604
- aggregation: e.aggregations[0],
605
- label: e.label,
606
- decimal: U(e, e.aggregations[0]) ? 2 : void 0,
607
- moveToRow: !1,
608
- hide: !1
609
- }, b.value = !1);
610
- }
611
- function t() {
612
- const e = [...y.value.map((o) => o.value)];
613
- i.value && (v.value !== void 0 ? e[v.value] = i.value : e.push(i.value)), n.value = e, p.value = !1;
614
- }
615
- function c(e) {
616
- const o = [...y.value.map((g) => g.value)];
617
- o.splice(e, 1), n.value = o;
618
- }
619
- const l = N(
620
- () => m.options.map((e) => ({ label: e.labels.join(" "), value: e }))
621
- );
622
- return (e, o) => {
623
- const g = f("FmTextField"), M = f("FmStepperField"), E = f("FmCheckbox"), W = f("FmTextarea"), K = f("FmForm"), _ = f("FmIcon"), A = f("FmButton"), B = f("FmListItem"), J = f("FmList"), S = f("FmField");
624
- return d(), $("div", al, [
625
- s(ne, {
626
- modelValue: p.value,
627
- "onUpdate:modelValue": o[10] || (o[10] = (I) => p.value = I),
628
- title: "Metric",
629
- onConfirm: t
630
- }, {
631
- content: w(() => [
632
- s(K, {
633
- ref: "form",
634
- class: "flex flex-col gap-2 w-[490px]"
635
- }, {
636
- default: w(() => {
637
- var I, D, ee;
638
- return [
639
- s(q, {
640
- "model-value": h.value,
641
- items: l.value,
642
- placeholder: "Metric",
643
- label: "Metric",
644
- "onUpdate:modelValue": o[0] || (o[0] = (O) => k(O))
645
- }, null, 8, ["model-value", "items"]),
646
- i.value ? (d(), $(G, { key: 0 }, [
647
- s(g, {
648
- modelValue: i.value.label,
649
- "onUpdate:modelValue": o[1] || (o[1] = (O) => i.value.label = O),
650
- label: "Label"
651
- }, null, 8, ["modelValue"]),
652
- (((I = h.value) == null ? void 0 : I.aggregations) || []).length > 0 ? (d(), V(q, {
653
- key: 0,
654
- modelValue: i.value.aggregation,
655
- "onUpdate:modelValue": o[2] || (o[2] = (O) => i.value.aggregation = O),
656
- items: ((D = h.value) == null ? void 0 : D.aggregations.map((O) => ({ label: O, value: O }))) ?? [],
657
- placeholder: "Aggregation",
658
- label: "Aggregation"
659
- }, null, 8, ["modelValue", "items"])) : x("", !0),
660
- R.value ? (d(), V(M, {
661
- key: 1,
662
- label: "Decimal",
663
- "model-value": i.value.decimal ?? 2,
664
- "onUpdate:modelValue": o[3] || (o[3] = (O) => {
665
- i.value && (i.value.decimal = O);
666
- })
667
- }, null, 8, ["model-value"])) : x("", !0),
668
- R.value ? (d(), V(q, {
669
- key: 2,
670
- modelValue: i.value.timeFormatter,
671
- "onUpdate:modelValue": o[4] || (o[4] = (O) => i.value.timeFormatter = O),
672
- placeholder: "Time Formatter",
673
- label: "Time Formatter",
674
- items: ((ee = h.value) == null ? void 0 : ee.timeFormatters.map((O) => ({ label: O, value: O }))) ?? []
675
- }, null, 8, ["modelValue", "items"])) : x("", !0),
676
- s(E, {
677
- modelValue: i.value.hide,
678
- "onUpdate:modelValue": o[5] || (o[5] = (O) => i.value.hide = O),
679
- label: "Hide",
680
- value: ""
681
- }, null, 8, ["modelValue"]),
682
- m.hasRowColumn ? (d(), V(E, {
683
- key: 3,
684
- modelValue: i.value.moveToRow,
685
- "onUpdate:modelValue": o[6] || (o[6] = (O) => i.value.moveToRow = O),
686
- label: "Move to row",
687
- value: ""
688
- }, null, 8, ["modelValue"])) : x("", !0),
689
- s(E, {
690
- modelValue: b.value,
691
- "onUpdate:modelValue": o[7] || (o[7] = (O) => b.value = O),
692
- label: "Advance",
693
- value: !0
694
- }, null, 8, ["modelValue"]),
695
- b.value ? (d(), V(W, {
696
- key: 4,
697
- modelValue: i.value.dataFormula,
698
- "onUpdate:modelValue": o[8] || (o[8] = (O) => i.value.dataFormula = O),
699
- placeholder: "Data Source Formula"
700
- }, null, 8, ["modelValue"])) : x("", !0),
701
- b.value ? (d(), V(W, {
702
- key: 5,
703
- modelValue: i.value.displayFormula,
704
- "onUpdate:modelValue": o[9] || (o[9] = (O) => i.value.displayFormula = O),
705
- placeholder: "Display Formula"
706
- }, null, 8, ["modelValue"])) : x("", !0)
707
- ], 64)) : x("", !0)
708
- ];
709
- }),
710
- _: 1
711
- }, 512)
712
- ]),
713
- _: 1
714
- }, 8, ["modelValue"]),
715
- o[14] || (o[14] = F("div", null, [
716
- F("p", { class: "fm-typo-en-body-lg-600" }, "Metric"),
717
- F("p", { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, " Metric is the field of table ")
718
- ], -1)),
719
- s(J, null, {
720
- default: w(() => [
721
- s(T(re), {
722
- list: n.value,
723
- "item-key": "id",
724
- class: "flex flex-col gap-2 w-full"
725
- }, {
726
- item: w(({ element: I, index: D }) => [
727
- s(B, {
728
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
729
- onClick: Z((ee) => a(y.value[D]), ["stop"])
730
- }, {
731
- default: w(() => [
732
- s(_, { name: "drag_handle" }),
733
- F("p", ol, X(I.label), 1),
734
- o[12] || (o[12] = F("div", { class: "grow" }, null, -1)),
735
- s(A, {
736
- icon: "close",
737
- size: "md",
738
- variant: "tertiary",
739
- onClick: Z((ee) => c(D), ["stop"])
740
- }, null, 8, ["onClick"])
741
- ]),
742
- _: 2
743
- }, 1032, ["onClick"])
744
- ]),
745
- _: 1
746
- }, 8, ["list"])
747
- ]),
748
- _: 1
749
- }),
750
- s(S, {
751
- class: "text-fm-color-typo-tertiary",
752
- onClick: o[11] || (o[11] = () => {
753
- a();
754
- })
755
- }, {
756
- default: w(() => o[13] || (o[13] = [
757
- oe(" Add metric ")
758
- ])),
759
- _: 1
760
- })
761
- ]);
762
- };
763
- }
764
- });
765
- var te = /* @__PURE__ */ ((u) => (u.Select = "Select", u.TextField = "TextField", u.Timestamp = "Timestamp", u))(te || {});
766
- function tl(u) {
767
- let r = !1, n = 1;
768
- switch (u) {
769
- case Q.Equal:
770
- case Q.NotEqual:
771
- case Q.Like:
772
- case Q.NotLike:
773
- r = !1, n = 1;
774
- break;
775
- case Q.GreaterThan:
776
- case Q.GreaterThanOrEqual:
777
- case Q.LessThan:
778
- case Q.LessThanOrEqual:
779
- r = !0, n = 1;
780
- break;
781
- case Q.Between:
782
- r = !0, n = 2;
783
- break;
784
- }
785
- return {
786
- fixed: r,
787
- count: n
788
- };
789
- }
790
- function ul({
791
- operator: u,
792
- dimensionOption: r,
793
- dataType: n
794
- }) {
795
- const { fixed: m, count: p } = tl(u);
796
- switch (n) {
797
- case ae.String:
798
- return {
799
- type: "TextField",
800
- fixed: m,
801
- count: p,
802
- dataType: void 0,
803
- default: ""
804
- };
805
- case ae.Numeric:
806
- return {
807
- type: "TextField",
808
- fixed: m,
809
- count: p,
810
- dataType: "number",
811
- default: 0
812
- };
813
- case ae.Bool:
814
- return {
815
- type: "Select",
816
- fixed: m,
817
- count: p,
818
- options: [
819
- { label: "Yes", value: !0 },
820
- { label: "No", value: !1 }
821
- ],
822
- default: !0
823
- };
824
- case ae.Timestamp:
825
- switch (r) {
826
- case le.HourOfDay:
827
- case le.DayOfWeek:
828
- case le.DayOfMonth:
829
- case le.MonthOfYear:
830
- return {
831
- type: "TextField",
832
- fixed: m,
833
- count: p,
834
- dataType: "number",
835
- default: "0"
836
- };
837
- case le.TimeOfDay:
838
- return {
839
- type: "Timestamp",
840
- fixed: m,
841
- count: p,
842
- default: (/* @__PURE__ */ new Date()).toISOString()
843
- };
844
- }
845
- }
846
- return {
847
- type: "TextField",
848
- fixed: m,
849
- count: p,
850
- dataType: void 0,
851
- default: ""
852
- };
853
- }
854
- const il = { class: "grow" }, sl = {
855
- key: 2,
856
- class: "w-full"
857
- }, ml = { key: 0 }, rl = /* @__PURE__ */ P({
858
- __name: "FilterValueInput",
859
- props: /* @__PURE__ */ H({
860
- config: {
861
- type: Object,
862
- default: () => {
863
- }
864
- }
865
- }, {
866
- modelValue: { required: !0, default: () => [] },
867
- modelModifiers: {}
868
- }),
869
- emits: ["update:modelValue"],
870
- setup(u) {
871
- const r = z(u, "modelValue"), n = u;
872
- function m(a) {
873
- return (a ? de(a) : de()).format("HH:mm");
874
- }
875
- function p({ hour: a, minute: i }) {
876
- return de().set("hour", a).set("minute", i).toISOString();
877
- }
878
- function y(a, i) {
879
- var h;
880
- const b = [...r.value];
881
- ((h = n.config) == null ? void 0 : h.type) === te.Timestamp ? b[a] = p({
882
- hour: Number(i.split(":")[0]),
883
- minute: Number(i.split(":")[1])
884
- }) : b[a] = i, r.value = b;
885
- }
886
- function v(a) {
887
- if (a === 0)
888
- r.value = [void 0, ...r.value];
889
- else {
890
- const i = [...r.value];
891
- i.splice(a, 1), r.value = i;
892
- }
893
- }
894
- return (a, i) => {
895
- const b = f("FmSelect"), h = f("FmTextField"), U = f("FmTimePicker"), R = f("FmButton");
896
- return d(!0), $(G, null, ue(new Array(r.value.length !== 0 ? r.value.length : 1), (k, t) => {
897
- var c, l, e, o;
898
- return d(), $("div", {
899
- key: t,
900
- class: "flex flex-row align-center gap-2 w-full"
901
- }, [
902
- F("div", il, [
903
- ((c = n.config) == null ? void 0 : c.type) === T(te).Select ? (d(), V(b, {
904
- key: 0,
905
- "model-value": r.value[t],
906
- items: n.config.options,
907
- "onUpdate:modelValue": (g) => y(t, g)
908
- }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((l = n.config) == null ? void 0 : l.type) === T(te).TextField ? (d(), V(h, {
909
- key: 1,
910
- "model-value": r.value[t],
911
- "onUpdate:modelValue": (g) => y(t, g)
912
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : ((e = n.config) == null ? void 0 : e.type) === T(te).Timestamp ? (d(), $("div", sl, [
913
- s(U, {
914
- "model-value": m(r.value[t]),
915
- "onUpdate:modelValue": (g) => y(t, g)
916
- }, null, 8, ["model-value", "onUpdate:modelValue"])
917
- ])) : x("", !0)
918
- ]),
919
- ((o = n.config) == null ? void 0 : o.fixed) === !1 ? (d(), $("div", ml, [
920
- s(R, {
921
- icon: t === 0 ? "add" : "remove",
922
- onClick: (g) => v(t)
923
- }, null, 8, ["icon", "onClick"])
924
- ])) : x("", !0)
925
- ]);
926
- }), 128);
927
- };
928
- }
929
- }), dl = { class: "flex flex-col my-2 gap-8" }, cl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, pl = /* @__PURE__ */ P({
930
- __name: "FilterSection",
931
- props: /* @__PURE__ */ H({
932
- options: {
933
- type: Array,
934
- default: () => []
935
- }
936
- }, {
937
- modelValue: { required: !1, default: () => [] },
938
- modelModifiers: {}
939
- }),
940
- emits: ["update:modelValue"],
941
- setup(u) {
942
- const r = z(u, "modelValue"), n = u, m = j(!1), p = N(
943
- () => r.value.map((l, e) => {
944
- const o = n.options.find(
945
- (g) => g.schemaName === l.schemaName && g.name === l.name
946
- );
947
- return {
948
- index: e,
949
- labels: (o == null ? void 0 : o.labels) || [l.schemaName, l.name],
950
- value: l
951
- };
952
- })
953
- ), y = j(r.value.length > 0 ? 0 : void 0);
954
- function v(l) {
955
- var e;
956
- m.value = !0, a.value = l != null && l.value ? JSON.parse(JSON.stringify(l.value)) : void 0, y.value = l == null ? void 0 : l.index, i.value = !!((e = a.value) != null && e.dataFormula), U();
957
- }
958
- const a = j(void 0), i = j(!1), b = j(void 0), h = N(
959
- () => n.options.find(
960
- (l) => {
961
- var e, o;
962
- return l.schemaName === ((e = a.value) == null ? void 0 : e.schemaName) && l.name === ((o = a.value) == null ? void 0 : o.name);
963
- }
964
- ) ?? {}
965
- );
966
- ie(
967
- () => {
968
- var l;
969
- return (l = a.value) == null ? void 0 : l.option;
970
- },
971
- (l, e) => {
972
- if (e !== void 0 && l !== e && a.value) {
973
- if (U(), !b.value)
974
- return;
975
- a.value = {
976
- ...a.value,
977
- values: (
978
- // only overwrite the value when it empty
979
- a.value.values.map((o) => {
980
- var g;
981
- return o === null ? (g = b.value) == null ? void 0 : g.default : o;
982
- })
983
- )
984
- };
985
- }
986
- }
987
- ), ie(
988
- () => {
989
- var l;
990
- return (l = a.value) == null ? void 0 : l.operator;
991
- },
992
- (l, e) => {
993
- if (l !== e && h.value && a.value) {
994
- if (U(), !b.value)
995
- return;
996
- const o = a.value.values.length - b.value.count;
997
- o > 0 && b.value.fixed ? a.value = {
998
- ...a.value,
999
- values: a.value.values.slice(0, b.value.count)
1000
- } : o < 0 && (a.value = {
1001
- ...a.value,
1002
- values: [
1003
- ...a.value.values,
1004
- ...Array(Math.abs(o)).fill(b.value.default)
1005
- ]
1006
- });
1007
- }
1008
- },
1009
- {
1010
- deep: !0
1011
- }
1012
- );
1013
- function U() {
1014
- h.value && a.value && (b.value = ul({
1015
- operator: a.value.operator,
1016
- dataType: h.value.type,
1017
- dimensionOption: a.value.option
1018
- }));
1019
- }
1020
- function R(l) {
1021
- var e, o, g;
1022
- (l.schemaName !== ((e = a.value) == null ? void 0 : e.schemaName) || l.name !== ((o = a.value) == null ? void 0 : o.name)) && (a.value = {
1023
- schemaName: l.schemaName,
1024
- name: l.name,
1025
- operator: l.filterOperators[0],
1026
- option: l.filterDimensionOptions[0],
1027
- values: []
1028
- }, U(), a.value.values = [(g = b.value) == null ? void 0 : g.default]);
1029
- }
1030
- function k() {
1031
- const l = [...p.value.map((e) => e.value)];
1032
- a.value && (a.value.values = a.value.values.filter(
1033
- (e) => e !== "" && e !== null
1034
- ), y.value !== void 0 ? l[Number(y.value)] = a.value : l.push(a.value), r.value = l), m.value = !1;
1035
- }
1036
- function t(l) {
1037
- const e = [...p.value.map((o) => o.value)];
1038
- e.splice(l, 1), r.value = e, m.value = !1;
1039
- }
1040
- const c = N(
1041
- () => n.options.map((l) => ({ label: l.labels.join(" "), value: l }))
1042
- );
1043
- return (l, e) => {
1044
- const o = f("FmCheckbox"), g = f("FmTextarea"), M = f("FmForm"), E = f("FmIcon"), W = f("FmButton"), K = f("FmListItem"), _ = f("FmList"), A = f("FmField");
1045
- return d(), $("div", dl, [
1046
- s(ne, {
1047
- modelValue: m.value,
1048
- "onUpdate:modelValue": e[6] || (e[6] = (B) => m.value = B),
1049
- title: "Filter",
1050
- onConfirm: k
1051
- }, {
1052
- content: w(() => [
1053
- s(M, {
1054
- ref: "form",
1055
- class: "flex flex-col gap-2 w-[490px]"
1056
- }, {
1057
- default: w(() => {
1058
- var B, J, S, I;
1059
- return [
1060
- s(q, {
1061
- "model-value": h.value,
1062
- items: c.value,
1063
- placeholder: "Filter",
1064
- label: "Filter",
1065
- "onUpdate:modelValue": e[0] || (e[0] = (D) => R(D))
1066
- }, null, 8, ["model-value", "items"]),
1067
- a.value ? (d(), $(G, { key: 0 }, [
1068
- s(o, {
1069
- modelValue: i.value,
1070
- "onUpdate:modelValue": e[1] || (e[1] = (D) => i.value = D),
1071
- label: "Advance",
1072
- value: !0
1073
- }, null, 8, ["modelValue"]),
1074
- i.value ? (d(), V(g, {
1075
- key: 0,
1076
- modelValue: a.value.dataFormula,
1077
- "onUpdate:modelValue": e[2] || (e[2] = (D) => a.value.dataFormula = D),
1078
- placeholder: "Data source formula"
1079
- }, null, 8, ["modelValue"])) : x("", !0),
1080
- (((B = h.value) == null ? void 0 : B.fillGapDimensionOptions) || []).length > 0 ? (d(), V(q, {
1081
- key: 1,
1082
- modelValue: a.value.option,
1083
- "onUpdate:modelValue": e[3] || (e[3] = (D) => a.value.option = D),
1084
- items: ((J = h.value) == null ? void 0 : J.filterDimensionOptions.map((D) => ({
1085
- label: D,
1086
- value: D
1087
- }))) ?? [],
1088
- label: "Time formatter",
1089
- "place-holder": "Time formatter"
1090
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1091
- (((S = h.value) == null ? void 0 : S.filterOperators) || []).length > 0 ? (d(), V(q, {
1092
- key: 2,
1093
- modelValue: a.value.operator,
1094
- "onUpdate:modelValue": e[4] || (e[4] = (D) => a.value.operator = D),
1095
- items: ((I = h.value) == null ? void 0 : I.filterOperators.map((D) => ({ label: D, value: D }))) ?? []
1096
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1097
- b.value ? (d(), V(rl, {
1098
- key: 3,
1099
- modelValue: a.value.values,
1100
- "onUpdate:modelValue": e[5] || (e[5] = (D) => a.value.values = D),
1101
- config: b.value
1102
- }, null, 8, ["modelValue", "config"])) : x("", !0)
1103
- ], 64)) : x("", !0)
1104
- ];
1105
- }),
1106
- _: 1
1107
- }, 512)
1108
- ]),
1109
- _: 1
1110
- }, 8, ["modelValue"]),
1111
- e[10] || (e[10] = F("div", null, [
1112
- F("p", { class: "fm-typo-en-body-lg-600" }, "Filter"),
1113
- F("p", { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, " Filter special value from the schema ")
1114
- ], -1)),
1115
- s(_, null, {
1116
- default: w(() => [
1117
- s(T(re), {
1118
- list: r.value,
1119
- "item-key": "id",
1120
- class: "flex flex-col gap-2 w-full"
1121
- }, {
1122
- item: w(({ element: B, index: J }) => [
1123
- s(K, {
1124
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1125
- onClick: Z((S) => v(p.value[J]), ["stop"])
1126
- }, {
1127
- default: w(() => [
1128
- s(E, { name: "drag_handle" }),
1129
- F("p", cl, X(T(Fe)(B.name)), 1),
1130
- e[8] || (e[8] = F("div", { class: "grow" }, null, -1)),
1131
- s(W, {
1132
- icon: "close",
1133
- size: "md",
1134
- variant: "tertiary",
1135
- onClick: Z((S) => t(J), ["stop"])
1136
- }, null, 8, ["onClick"])
1137
- ]),
1138
- _: 2
1139
- }, 1032, ["onClick"])
1140
- ]),
1141
- _: 1
1142
- }, 8, ["list"])
1143
- ]),
1144
- _: 1
1145
- }),
1146
- s(A, {
1147
- class: "text-fm-color-typo-tertiary",
1148
- onClick: e[7] || (e[7] = () => {
1149
- v();
1150
- })
1151
- }, {
1152
- default: w(() => e[9] || (e[9] = [
1153
- oe(" Add filter ")
1154
- ])),
1155
- _: 1
1156
- })
1157
- ]);
1158
- };
1159
- }
1160
- }), vl = { class: "flex flex-col my-2 gap-8" }, fl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, gl = /* @__PURE__ */ P({
1161
- __name: "SortSection",
1162
- props: /* @__PURE__ */ H({
1163
- options: {
1164
- type: Array,
1165
- default: () => []
1166
- }
1167
- }, {
1168
- modelValue: { required: !1, default: [] },
1169
- modelModifiers: {}
1170
- }),
1171
- emits: ["update:modelValue"],
1172
- setup(u) {
1173
- const r = z(u, "modelValue"), n = u, m = j(!1), p = N(
1174
- () => r.value.map((t, c) => {
1175
- const l = n.options.find(
1176
- (e) => e.schemaName === t.schemaName && e.name === t.name
1177
- );
1178
- return {
1179
- index: c,
1180
- labels: (l == null ? void 0 : l.labels) || [t.schemaName, t.name],
1181
- value: t
1182
- };
1183
- })
1184
- ), y = j(r.value.length > 0 ? 0 : void 0);
1185
- function v(t) {
1186
- var c;
1187
- m.value = !0, a.value = t != null && t.value ? JSON.parse(JSON.stringify(t.value)) : void 0, y.value = t == null ? void 0 : t.index, i.value = !!((c = a.value) != null && c.dataFormula);
1188
- }
1189
- const a = j(void 0), i = j(!1), b = N(
1190
- () => n.options.find(
1191
- (t) => {
1192
- var c, l;
1193
- return t.schemaName === ((c = a.value) == null ? void 0 : c.schemaName) && t.name === ((l = a.value) == null ? void 0 : l.name);
1194
- }
1195
- ) ?? {}
1196
- );
1197
- function h(t) {
1198
- var c, l;
1199
- (t.schemaName !== ((c = a.value) == null ? void 0 : c.schemaName) || t.name !== ((l = a.value) == null ? void 0 : l.name)) && (a.value = {
1200
- schemaName: t.schemaName,
1201
- name: t.name,
1202
- dimensionOption: t.dimensionOptions[0],
1203
- aggregation: null,
1204
- type: ve.Asc
1205
- });
1206
- }
1207
- function U() {
1208
- if (!a.value) {
1209
- console.log("new sort is undefined");
1210
- return;
1211
- }
1212
- const t = [...p.value.map((c) => c.value)];
1213
- y.value !== void 0 ? t[y.value] = a.value : t.push(a.value), r.value = t, m.value = !1;
1214
- }
1215
- function R(t) {
1216
- const c = [...p.value.map((l) => l.value)];
1217
- c.splice(t, 1), r.value = c, m.value = !1;
1218
- }
1219
- const k = N(
1220
- () => n.options.map((t) => ({ label: t.labels.join(" "), value: t }))
1221
- );
1222
- return (t, c) => {
1223
- const l = f("FmCheckbox"), e = f("FmTextarea"), o = f("FmForm"), g = f("FmIcon"), M = f("FmButton"), E = f("FmListItem"), W = f("FmList"), K = f("FmField");
1224
- return d(), $("div", vl, [
1225
- s(ne, {
1226
- modelValue: m.value,
1227
- "onUpdate:modelValue": c[6] || (c[6] = (_) => m.value = _),
1228
- title: "Sort",
1229
- onConfirm: U
1230
- }, {
1231
- content: w(() => [
1232
- s(o, {
1233
- ref: "form",
1234
- class: "flex flex-col gap-2 w-[490px]"
1235
- }, {
1236
- default: w(() => {
1237
- var _, A, B, J;
1238
- return [
1239
- s(q, {
1240
- "model-value": b.value,
1241
- items: k.value,
1242
- placeholder: "Sort",
1243
- label: "Sort",
1244
- "onUpdate:modelValue": c[0] || (c[0] = (S) => h(S))
1245
- }, null, 8, ["model-value", "items"]),
1246
- a.value ? (d(), $(G, { key: 0 }, [
1247
- (((_ = b.value) == null ? void 0 : _.dimensionOptions) || []).length > 0 ? (d(), V(q, {
1248
- key: 0,
1249
- modelValue: a.value.dimensionOption,
1250
- "onUpdate:modelValue": c[1] || (c[1] = (S) => a.value.dimensionOption = S),
1251
- items: ((A = b.value) == null ? void 0 : A.dimensionOptions.map((S) => ({ label: S, value: S }))) ?? [],
1252
- placeholder: "Format",
1253
- label: "Format"
1254
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1255
- (((B = b.value) == null ? void 0 : B.aggregations) || []).length > 0 ? (d(), V(q, {
1256
- key: 1,
1257
- modelValue: a.value.aggregation,
1258
- "onUpdate:modelValue": c[2] || (c[2] = (S) => a.value.aggregation = S),
1259
- items: ((J = b.value) == null ? void 0 : J.aggregations.map((S) => ({ label: S, value: S }))) ?? [],
1260
- label: "Aggregations",
1261
- placeholder: "Aggregations"
1262
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1263
- s(q, {
1264
- modelValue: a.value.type,
1265
- "onUpdate:modelValue": c[3] || (c[3] = (S) => a.value.type = S),
1266
- items: Object.values(T(ve)).map((S) => ({ label: S, value: S })),
1267
- "place-holder": "Order",
1268
- label: "Order"
1269
- }, null, 8, ["modelValue", "items"]),
1270
- s(l, {
1271
- modelValue: i.value,
1272
- "onUpdate:modelValue": c[4] || (c[4] = (S) => i.value = S),
1273
- label: "Advance",
1274
- value: !0
1275
- }, null, 8, ["modelValue"]),
1276
- i.value ? (d(), V(e, {
1277
- key: 2,
1278
- modelValue: a.value.dataFormula,
1279
- "onUpdate:modelValue": c[5] || (c[5] = (S) => a.value.dataFormula = S),
1280
- placeholder: "Data Source Formula"
1281
- }, null, 8, ["modelValue"])) : x("", !0)
1282
- ], 64)) : x("", !0)
1283
- ];
1284
- }),
1285
- _: 1
1286
- }, 512)
1287
- ]),
1288
- _: 1
1289
- }, 8, ["modelValue"]),
1290
- c[10] || (c[10] = F("div", null, [
1291
- F("p", { class: "fm-typo-en-body-lg-600" }, "Sort"),
1292
- F("p", { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, " Sort value from the accordinly the schema ")
1293
- ], -1)),
1294
- s(W, null, {
1295
- default: w(() => [
1296
- s(T(re), {
1297
- list: r.value,
1298
- "item-key": "id",
1299
- class: "flex flex-col gap-2 w-full"
1300
- }, {
1301
- item: w(({ element: _, index: A }) => [
1302
- s(E, {
1303
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1304
- onClick: Z((B) => v(p.value[A]), ["stop"])
1305
- }, {
1306
- default: w(() => [
1307
- s(g, { name: "drag_handle" }),
1308
- F("p", fl, X(T(Fe)(_.name)), 1),
1309
- c[8] || (c[8] = F("div", { class: "grow" }, null, -1)),
1310
- s(M, {
1311
- icon: "close",
1312
- size: "md",
1313
- variant: "tertiary",
1314
- onClick: Z((B) => R(A), ["stop"])
1315
- }, null, 8, ["onClick"])
1316
- ]),
1317
- _: 2
1318
- }, 1032, ["onClick"])
1319
- ]),
1320
- _: 1
1321
- }, 8, ["list"])
1322
- ]),
1323
- _: 1
1324
- }),
1325
- s(K, {
1326
- class: "text-fm-color-typo-tertiary",
1327
- onClick: c[7] || (c[7] = () => {
1328
- v();
1329
- })
1330
- }, {
1331
- default: w(() => c[9] || (c[9] = [
1332
- oe(" Add sort ")
1333
- ])),
1334
- _: 1
1335
- })
1336
- ]);
1337
- };
1338
- }
1339
- }), bl = /* @__PURE__ */ P({
1340
- __name: "LimitSection",
1341
- props: {
1342
- modelValue: { required: !0, default: null },
1343
- modelModifiers: {}
1344
- },
1345
- emits: ["update:modelValue"],
1346
- setup(u) {
1347
- const r = z(u, "modelValue"), n = Te((m) => {
1348
- m !== "" ? r.value = m : r.value = null;
1349
- }, 1e3);
1350
- return (m, p) => {
1351
- const y = f("FmTextField");
1352
- return d(), $(G, null, [
1353
- p[1] || (p[1] = F("div", null, [
1354
- F("p", { class: "fm-typo-en-body-lg-600" }, "Limit"),
1355
- F("p", { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, " Limit how many record return from the table ")
1356
- ], -1)),
1357
- s(y, {
1358
- "model-value": r.value,
1359
- inputmode: "numeric",
1360
- placeholder: "Limit",
1361
- "onUpdate:modelValue": p[0] || (p[0] = (v) => T(n)(v))
1362
- }, null, 8, ["model-value"])
1363
- ], 64);
1364
- };
1365
- }
1366
- }), yl = { class: "flex flex-col my-2 gap-8" }, Fl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Vl = /* @__PURE__ */ P({
1367
- __name: "ConditionSection",
1368
- props: /* @__PURE__ */ H({
1369
- joinFieldOptions: {
1370
- type: Array,
1371
- default: () => []
1372
- },
1373
- mainFieldOptions: {
1374
- type: Array,
1375
- default: () => []
1376
- }
1377
- }, {
1378
- modelValue: { required: !0 },
1379
- modelModifiers: {}
1380
- }),
1381
- emits: ["update:modelValue"],
1382
- setup(u) {
1383
- const r = z(u, "modelValue"), n = u, m = j(!1), p = N(
1384
- () => r.value.map((l, e) => {
1385
- var o, g;
1386
- return {
1387
- index: e,
1388
- labels: [(o = l.joinDimension) == null ? void 0 : o.schemaName, (g = l.joinDimension) == null ? void 0 : g.name],
1389
- value: l
1390
- };
1391
- })
1392
- ), y = j(r.value.length > 0 ? 0 : void 0);
1393
- function v(l) {
1394
- l ? (a.value = l != null && l.value ? JSON.parse(JSON.stringify(l.value)) : void 0, y.value = l == null ? void 0 : l.index) : (a.value = {
1395
- joinDimension: null,
1396
- operator: "",
1397
- mainDimensions: []
1398
- }, y.value = void 0), m.value = !0;
1399
- }
1400
- const a = j(void 0), i = N(
1401
- () => n.joinFieldOptions.find(
1402
- (l) => {
1403
- var e, o;
1404
- return l.schemaName === ((o = (e = a.value) == null ? void 0 : e.joinDimension) == null ? void 0 : o.schemaName) && l.name === a.value.joinDimension.name;
1405
- }
1406
- ) ?? {}
1407
- ), b = N(
1408
- () => {
1409
- var l;
1410
- return (((l = a.value) == null ? void 0 : l.mainDimensions) || []).map(
1411
- (e) => n.mainFieldOptions.find(
1412
- (o) => o.schemaName === (e == null ? void 0 : e.schemaName) && o.name === e.name
1413
- ) ?? {}
1414
- );
1415
- }
1416
- ), h = N(
1417
- () => n.joinFieldOptions.map((l) => ({ label: l.labels.join(" "), value: l }))
1418
- );
1419
- function U(l) {
1420
- var e, o, g, M;
1421
- a.value && (a.value && l.schemaName !== ((o = (e = a.value) == null ? void 0 : e.joinDimension) == null ? void 0 : o.schemaName) || l.name !== ((M = (g = a.value) == null ? void 0 : g.joinDimension) == null ? void 0 : M.name)) && (a.value = {
1422
- ...a.value,
1423
- joinDimension: {
1424
- schemaName: l.schemaName,
1425
- name: l.name,
1426
- option: l.dimensionOptions[0],
1427
- label: l.label,
1428
- hide: !0
1429
- }
1430
- }, l.joinConditionOperators.includes(a.value.operator) || k(l.joinConditionOperators[0]));
1431
- }
1432
- function R(l, e) {
1433
- var o, g, M, E;
1434
- if (a.value && e >= 0 && (a.value && l.schemaName !== ((g = (o = a.value) == null ? void 0 : o.mainDimensions[e]) == null ? void 0 : g.schemaName) || l.name !== ((E = (M = a.value) == null ? void 0 : M.mainDimensions[e]) == null ? void 0 : E.name))) {
1435
- const W = [...a.value.mainDimensions];
1436
- W[e] = {
1437
- schemaName: l.schemaName,
1438
- name: l.name,
1439
- option: l.dimensionOptions[0],
1440
- label: l.label,
1441
- hide: !0
1442
- }, a.value = {
1443
- ...a.value,
1444
- mainDimensions: W
1445
- };
1446
- }
1447
- }
1448
- function k(l) {
1449
- if (a.value)
1450
- switch (l) {
1451
- case Q.Between:
1452
- a.value = {
1453
- ...a.value,
1454
- operator: l,
1455
- mainDimensions: [null, null]
1456
- };
1457
- break;
1458
- default:
1459
- a.value = {
1460
- ...a.value,
1461
- operator: l,
1462
- mainDimensions: [null]
1463
- };
1464
- break;
1465
- }
1466
- }
1467
- function t() {
1468
- const l = [...p.value.map((e) => e.value)];
1469
- a.value && (a.value.mainDimensions = a.value.mainDimensions.filter(
1470
- (e) => e !== "" && e != null
1471
- ), y.value !== void 0 ? l[y.value] = a.value : l.push(a.value)), r.value = l, m.value = !1;
1472
- }
1473
- function c(l) {
1474
- const e = [...p.value.map((o) => o.value)];
1475
- e.splice(l, 1), r.value = e;
1476
- }
1477
- return (l, e) => {
1478
- const o = f("FmMenuDivider"), g = f("FmForm"), M = f("FmButton"), E = f("FmListItem"), W = f("FmList"), K = f("FmField");
1479
- return d(), $("div", yl, [
1480
- s(ne, {
1481
- modelValue: m.value,
1482
- "onUpdate:modelValue": e[2] || (e[2] = (_) => m.value = _),
1483
- title: "Condition",
1484
- onConfirm: t
1485
- }, {
1486
- content: w(() => [
1487
- s(g, {
1488
- ref: "form",
1489
- class: "flex flex-col gap-2 w-[490px]"
1490
- }, {
1491
- default: w(() => {
1492
- var _, A, B, J, S;
1493
- return [
1494
- s(q, {
1495
- label: "Join datasource",
1496
- "model-value": i.value,
1497
- items: h.value,
1498
- placeholder: "Join dimension",
1499
- "onUpdate:modelValue": e[0] || (e[0] = (I) => U(I))
1500
- }, null, 8, ["model-value", "items"]),
1501
- s(o),
1502
- (_ = a.value) != null && _.joinDimension && (((A = i.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (d(), V(q, {
1503
- key: 0,
1504
- modelValue: a.value.joinDimension.option,
1505
- "onUpdate:modelValue": e[1] || (e[1] = (I) => a.value.joinDimension.option = I),
1506
- label: "Format",
1507
- items: ((B = i.value) == null ? void 0 : B.dimensionOptions.map((I) => ({
1508
- label: I,
1509
- value: I
1510
- }))) ?? []
1511
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1512
- a.value && (((J = i.value) == null ? void 0 : J.joinConditionOperators) || []).length > 0 ? (d(), V(q, {
1513
- key: 1,
1514
- "model-value": a.value.operator,
1515
- label: "Operator",
1516
- items: i.value.joinConditionOperators.map((I) => ({
1517
- label: I,
1518
- value: I
1519
- })) ?? [],
1520
- "onUpdate:modelValue": k
1521
- }, null, 8, ["model-value", "items"])) : x("", !0),
1522
- (d(!0), $(G, null, ue(((S = a.value) == null ? void 0 : S.mainDimensions) || [], (I, D) => {
1523
- var ee, O;
1524
- return d(), $("div", {
1525
- key: D,
1526
- class: "flex flex-col gap-2"
1527
- }, [
1528
- s(q, {
1529
- "model-value": b.value[D],
1530
- label: `Main datasource ${D + 1}`,
1531
- items: n.mainFieldOptions.map((Y) => ({
1532
- label: Y.labels.join(" "),
1533
- value: Y
1534
- })),
1535
- "onUpdate:modelValue": (Y) => R(Y, D)
1536
- }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1537
- I && (((ee = b.value[D]) == null ? void 0 : ee.dimensionOptions) || []).length > 0 && I ? (d(), V(q, {
1538
- key: 0,
1539
- modelValue: I.option,
1540
- "onUpdate:modelValue": (Y) => I.option = Y,
1541
- items: (O = b.value[D]) == null ? void 0 : O.dimensionOptions.map((Y) => ({
1542
- label: Y,
1543
- value: Y
1544
- }))
1545
- }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : x("", !0),
1546
- s(o)
1547
- ]);
1548
- }), 128))
1549
- ];
1550
- }),
1551
- _: 1
1552
- }, 512)
1553
- ]),
1554
- _: 1
1555
- }, 8, ["modelValue"]),
1556
- e[6] || (e[6] = F("div", null, [
1557
- F("p", { class: "fm-typo-en-body-lg-600" }, "Condition"),
1558
- F("p", { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, " Join condition with the main datasource ")
1559
- ], -1)),
1560
- s(W, { class: "flex flex-col gap-2" }, {
1561
- default: w(() => [
1562
- (d(!0), $(G, null, ue(r.value, (_, A) => (d(), V(E, {
1563
- key: A,
1564
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1565
- onClick: (B) => v(p.value[A])
1566
- }, {
1567
- default: w(() => {
1568
- var B, J;
1569
- return [
1570
- F("p", Fl, X(T(He)(((B = _.joinDimension) == null ? void 0 : B.schemaName) ?? "")) + " " + X((J = _.joinDimension) == null ? void 0 : J.label), 1),
1571
- e[4] || (e[4] = F("div", { class: "grow" }, null, -1)),
1572
- s(M, {
1573
- icon: "close",
1574
- size: "md",
1575
- variant: "tertiary",
1576
- onClick: Z((S) => c(A), ["stop"])
1577
- }, null, 8, ["onClick"])
1578
- ];
1579
- }),
1580
- _: 2
1581
- }, 1032, ["onClick"]))), 128))
1582
- ]),
1583
- _: 1
1584
- }),
1585
- s(K, {
1586
- class: "text-fm-color-typo-tertiary cursor-pointer",
1587
- onClick: e[3] || (e[3] = (_) => v())
1588
- }, {
1589
- default: w(() => e[5] || (e[5] = [
1590
- oe(" Add condition ")
1591
- ])),
1592
- _: 1
1593
- })
1594
- ]);
1595
- };
1596
- }
1597
- }), ke = /* @__PURE__ */ P({
1598
- __name: "Datasource",
1599
- props: /* @__PURE__ */ H({
1600
- label: {
1601
- type: String,
1602
- default: "Label"
1603
- },
1604
- config: {
1605
- type: Object,
1606
- default: null
1607
- },
1608
- closeable: {
1609
- type: Boolean,
1610
- default: !1
1611
- },
1612
- mainDatasourceConfig: {
1613
- type: Object,
1614
- default: () => {
1615
- }
1616
- },
1617
- modelValue: {
1618
- type: Object,
1619
- default: () => {
1620
- }
1621
- }
1622
- }, {
1623
- modelValue: { required: !0 },
1624
- modelModifiers: {}
1625
- }),
1626
- emits: /* @__PURE__ */ H(["click-close"], ["update:modelValue"]),
1627
- setup(u, { emit: r }) {
1628
- const n = z(u, "modelValue");
1629
- ie(
1630
- [() => n.value.dimensions, () => n.value.metrics],
1631
- () => {
1632
- const { rowIds: k, columnIds: t } = ge(n.value);
1633
- n.value.rowIds = k, n.value.columnIds = t;
1634
- },
1635
- { deep: !0 }
1636
- );
1637
- const m = u, p = r, { schemas: y } = ye(_e()), v = N(() => !m.mainDatasourceConfig), a = N(
1638
- () => [C.BarChart, C.LineChart, C.Scorecard].includes(m.config.type)
1639
- ), i = N(() => {
1640
- const k = [...n.value.dimensions].filter((t) => !t.hide);
1641
- return k.sort(
1642
- (t, c) => (n.value.rowIds || []).indexOf(me(t)) - (n.value.rowIds || []).indexOf(me(c))
1643
- ), k;
1644
- }), b = N(() => m.config.type === C.Scorecard), h = N(
1645
- () => {
1646
- var k;
1647
- return (((k = m.mainDatasourceConfig) == null ? void 0 : k.schemaNames) || []).reduce(
1648
- (t, c) => {
1649
- const l = y.value.find((e) => e.name === c);
1650
- return l && (t = [
1651
- ...t,
1652
- ...l.fields.map((e) => ({
1653
- ...e,
1654
- labels: [l.label, e.label || e.name]
1655
- }))
1656
- ]), t;
1657
- },
1658
- []
1659
- );
1660
- }
1661
- ), U = N(
1662
- () => n.value.schemaNames.reduce((k, t) => {
1663
- const c = y.value.find((l) => l.name === t);
1664
- return c && (k = [
1665
- ...k,
1666
- ...c.fields.map((l) => ({
1667
- ...l,
1668
- labels: [c.label, l.label || l.name]
1669
- }))
1670
- ]), k;
1671
- }, [])
1672
- ), R = N(() => [
1673
- { labels: ["None"], value: null },
1674
- { labels: ["Grand total"], value: 0 },
1675
- ...[...i.value].slice(0, i.value.length - 1).map((k, t) => ({ labels: [k.label], value: t + 1 }))
1676
- ]);
1677
- return (k, t) => {
1678
- const c = f("FmButton"), l = f("FmSwitch"), e = f("FmSelect");
1679
- return d(), V(pe, null, {
1680
- header: w(() => [
1681
- F("p", null, X(m.label), 1),
1682
- t[18] || (t[18] = F("div", { class: "grow" }, null, -1)),
1683
- m.closeable ? (d(), V(c, {
1684
- key: 0,
1685
- icon: "close",
1686
- variant: "tertiary",
1687
- size: "md",
1688
- onClick: t[0] || (t[0] = Z((o) => p("click-close"), ["stop"]))
1689
- })) : x("", !0)
1690
- ]),
1691
- content: w(() => [
1692
- s(Ye, {
1693
- modelValue: n.value,
1694
- "onUpdate:modelValue": t[1] || (t[1] = (o) => n.value = o),
1695
- label: "Schema"
1696
- }, null, 8, ["modelValue"]),
1697
- s(ce, {
1698
- modelValue: n.value.dimensions,
1699
- "onUpdate:modelValue": t[2] || (t[2] = (o) => n.value.dimensions = o),
1700
- options: U.value,
1701
- config: n.value,
1702
- max: m.config.maxDimension,
1703
- "has-row-column": !0,
1704
- onConfig: t[3] || (t[3] = (o) => {
1705
- n.value = o;
1706
- })
1707
- }, null, 8, ["modelValue", "options", "config", "max"]),
1708
- s(l, {
1709
- "label-placement": "right",
1710
- label: "Comparable",
1711
- "model-value": n.value.isComparable ?? !1,
1712
- "onUpdate:modelValue": t[4] || (t[4] = (o) => {
1713
- n.value.isComparable = o;
1714
- })
1715
- }, null, 8, ["model-value"]),
1716
- a.value ? (d(), V(l, {
1717
- key: 0,
1718
- "label-placement": "right",
1719
- label: "Cumulative",
1720
- "model-value": n.value.isCumulative ?? !1,
1721
- "onUpdate:modelValue": t[5] || (t[5] = (o) => {
1722
- n.value.isCumulative = o;
1723
- })
1724
- }, null, 8, ["model-value"])) : x("", !0),
1725
- m.config.hasLabel ? (d(), V(l, {
1726
- key: 1,
1727
- label: "Show label",
1728
- "label-placement": "right",
1729
- "model-value": n.value.showLabel ?? !1,
1730
- "onUpdate:modelValue": t[6] || (t[6] = (o) => {
1731
- n.value.showLabel = o;
1732
- })
1733
- }, null, 8, ["model-value"])) : x("", !0),
1734
- m.config.isDrillConfigurable && v.value ? (d(), V(l, {
1735
- key: 2,
1736
- label: "Drill",
1737
- "label-placement": "right",
1738
- "model-value": n.value.isDrillable ?? !1,
1739
- "onUpdate:modelValue": t[7] || (t[7] = (o) => {
1740
- n.value.isDrillable = o;
1741
- })
1742
- }, null, 8, ["model-value"])) : x("", !0),
1743
- m.config.canRollup && v.value ? (d(), V(e, {
1744
- key: 3,
1745
- modelValue: n.value.rollup,
1746
- "onUpdate:modelValue": t[8] || (t[8] = (o) => n.value.rollup = o),
1747
- label: "SubTotal",
1748
- items: R.value.map((o) => ({ label: o.labels[0], value: o.value }))
1749
- }, null, 8, ["modelValue", "items"])) : x("", !0),
1750
- m.config.canTranspose && v.value ? (d(), V(l, {
1751
- key: 4,
1752
- modelValue: n.value.isTransposed,
1753
- "onUpdate:modelValue": t[9] || (t[9] = (o) => n.value.isTransposed = o),
1754
- label: "Tranpose",
1755
- "label-placement": "right"
1756
- }, null, 8, ["modelValue"])) : x("", !0),
1757
- m.config.hasBreakdownDimension ? (d(), V(ce, {
1758
- key: 5,
1759
- "model-value": n.value.breakdownDimension ? [n.value.breakdownDimension] : [],
1760
- label: "Breakdown Dimension",
1761
- max: 1,
1762
- options: U.value,
1763
- "onUpdate:modelValue": t[10] || (t[10] = (o) => {
1764
- n.value.breakdownDimension = o[0];
1765
- })
1766
- }, null, 8, ["model-value", "options"])) : x("", !0),
1767
- b.value ? (d(), V(ce, {
1768
- key: 6,
1769
- "model-value": n.value.sparklineDimension ? [n.value.sparklineDimension] : [],
1770
- label: "Sparkline dimension",
1771
- max: 1,
1772
- options: U.value,
1773
- "onUpdate:modelValue": t[11] || (t[11] = (o) => {
1774
- n.value.sparklineDimension = o[0];
1775
- })
1776
- }, null, 8, ["model-value", "options"])) : x("", !0),
1777
- s(nl, {
1778
- modelValue: n.value.metrics,
1779
- "onUpdate:modelValue": t[12] || (t[12] = (o) => n.value.metrics = o),
1780
- options: U.value,
1781
- max: m.config.maxMetric,
1782
- config: n.value,
1783
- "has-row-column": m.config.type === T(C).Table,
1784
- onConfig: t[13] || (t[13] = (o) => {
1785
- n.value = o;
1786
- })
1787
- }, null, 8, ["modelValue", "options", "max", "config", "has-row-column"]),
1788
- s(pl, {
1789
- modelValue: n.value.filters,
1790
- "onUpdate:modelValue": t[14] || (t[14] = (o) => n.value.filters = o),
1791
- options: U.value
1792
- }, null, 8, ["modelValue", "options"]),
1793
- s(gl, {
1794
- modelValue: n.value.sorts,
1795
- "onUpdate:modelValue": t[15] || (t[15] = (o) => n.value.sorts = o),
1796
- options: U.value
1797
- }, null, 8, ["modelValue", "options"]),
1798
- s(bl, {
1799
- modelValue: n.value.limit,
1800
- "onUpdate:modelValue": t[16] || (t[16] = (o) => n.value.limit = o)
1801
- }, null, 8, ["modelValue"]),
1802
- n.value.conditions ? (d(), V(Vl, {
1803
- key: 7,
1804
- modelValue: n.value.conditions,
1805
- "onUpdate:modelValue": t[17] || (t[17] = (o) => n.value.conditions = o),
1806
- "join-field-options": U.value,
1807
- "main-field-options": h.value
1808
- }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : x("", !0)
1809
- ]),
1810
- _: 1
1811
- });
1812
- };
1813
- }
1814
- }), be = /* @__PURE__ */ P({
1815
- __name: "TileEditorTabHeader",
1816
- props: /* @__PURE__ */ H({
1817
- icon: {
1818
- type: String,
1819
- required: !0
1820
- }
1821
- }, {
1822
- modelValue: { type: Boolean, required: !0, default: !1 },
1823
- modelModifiers: {}
1824
- }),
1825
- emits: ["update:modelValue"],
1826
- setup(u) {
1827
- const r = z(u, "modelValue"), n = u;
1828
- return (m, p) => {
1829
- const y = f("FmIcon");
1830
- return d(), $("div", {
1831
- class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1832
- onClick: p[0] || (p[0] = (v) => r.value = !r.value)
1833
- }, [
1834
- p[1] || (p[1] = F("p", { class: "fm-typo-en-title-sm-600" }, "Setting", -1)),
1835
- p[2] || (p[2] = F("div", { class: "grow" }, null, -1)),
1836
- s(y, {
1837
- name: n.icon
1838
- }, null, 8, ["name"])
1839
- ]);
1840
- };
1841
- }
1842
- }), kl = /* @__PURE__ */ P({
1843
- __name: "TileEditorTabDesktop",
1844
- props: {
1845
- modelValue: { required: !0, default: !1 },
1846
- modelModifiers: {}
1847
- },
1848
- emits: ["update:modelValue"],
1849
- setup(u) {
1850
- const r = z(u, "modelValue");
1851
- return (n, m) => (d(), $(G, null, [
1852
- s(be, {
1853
- modelValue: r.value,
1854
- "onUpdate:modelValue": m[0] || (m[0] = (p) => r.value = p),
1855
- icon: "keyboard_double_arrow_left"
1856
- }, null, 8, ["modelValue"]),
1857
- we(n.$slots, "default")
1858
- ], 64));
1859
- }
1860
- }), wl = { class: "fixed bottom-0 w-full" }, xl = /* @__PURE__ */ P({
1861
- __name: "TileEditorTabMobile",
1862
- props: {
1863
- modelValue: { required: !0, default: !1 },
1864
- modelModifiers: {}
1865
- },
1866
- emits: ["update:modelValue"],
1867
- setup(u) {
1868
- const r = z(u, "modelValue");
1869
- return (n, m) => {
1870
- const p = f("FmTopSheet");
1871
- return d(), $("div", wl, [
1872
- s(be, {
1873
- modelValue: r.value,
1874
- "onUpdate:modelValue": m[0] || (m[0] = (y) => r.value = y),
1875
- icon: "keyboard_double_arrow_up"
1876
- }, null, 8, ["modelValue"]),
1877
- s(p, {
1878
- modelValue: r.value,
1879
- "onUpdate:modelValue": m[2] || (m[2] = (y) => r.value = y),
1880
- "fullscreen-size": "sm"
1881
- }, {
1882
- default: w(() => [
1883
- s(be, {
1884
- modelValue: r.value,
1885
- "onUpdate:modelValue": m[1] || (m[1] = (y) => r.value = y),
1886
- icon: "keyboard_double_arrow_down"
1887
- }, null, 8, ["modelValue"]),
1888
- r.value ? we(n.$slots, "default", { key: 0 }) : x("", !0)
1889
- ]),
1890
- _: 3
1891
- }, 8, ["modelValue"])
1892
- ]);
1893
- };
1894
- }
1895
- }), Cl = { class: "h-[40x]" }, Ue = /* @__PURE__ */ P({
1896
- __name: "TileEditorTab",
1897
- props: /* @__PURE__ */ H({
1898
- hideConfiguration: {
1899
- type: Boolean,
1900
- default: !1
1901
- }
1902
- }, {
1903
- modelValue: {
1904
- required: !0
1905
- },
1906
- modelModifiers: {}
1907
- }),
1908
- emits: /* @__PURE__ */ H(["hideConfiguration"], ["update:modelValue"]),
1909
- setup(u, { emit: r }) {
1910
- const n = z(u, "modelValue"), { breakpoints: m } = Se(), p = u, { promptMessage: y } = he(), v = r;
1911
- function a(l) {
1912
- n.value = ll(l);
1913
- }
1914
- function i() {
1915
- const l = [...n.value.widget.config.joinDatasources || []];
1916
- l.push({ ...Ae(n.value.widget.type), conditions: [] }), a({
1917
- ...n.value,
1918
- widget: {
1919
- ...n.value.widget,
1920
- config: {
1921
- ...n.value.widget.config,
1922
- joinDatasources: l
1923
- }
1924
- }
1925
- });
1926
- }
1927
- async function b(l) {
1928
- if (!await y({
1929
- title: "Remove Datasource",
1930
- message: `Confirm remove Join datasource ${l + 1} ?`
1931
- })) return;
1932
- const o = [...n.value.widget.config.joinDatasources || []];
1933
- o.splice(l, 1), a({
1934
- ...n.value,
1935
- widget: {
1936
- ...n.value.widget,
1937
- config: {
1938
- ...n.value.widget.config,
1939
- joinDatasources: o
1940
- }
1941
- }
1942
- });
1943
- }
1944
- const h = (l, e) => {
1945
- let o = 1, g = 1;
1946
- switch (l) {
1947
- case C.Scorecard:
1948
- o = 1, g = 2;
1949
- break;
1950
- case C.BarChart:
1951
- case C.StackBarChart:
1952
- case C.LineChart:
1953
- case C.StackLineChart:
1954
- o = 4, g = 6;
1955
- break;
1956
- case C.Table:
1957
- o = 4, g = 12;
1958
- break;
1959
- case C.Circular:
1960
- o = 4, g = 4;
1961
- break;
1962
- case C.Spacer:
1963
- o = 0, g = 12;
1964
- break;
1965
- }
1966
- return {
1967
- size: {
1968
- height: o,
1969
- width: g
1970
- },
1971
- widget: {
1972
- ...e.widget,
1973
- type: l
1974
- }
1975
- };
1976
- }, U = N(
1977
- () => Ve.find((l) => l.type === n.value.widget.type)
1978
- ), R = N(() => n.value.widget.config.joinDatasources), k = N(() => {
1979
- switch (n.value.widget.type) {
1980
- case C.Table:
1981
- case C.BarChart:
1982
- case C.LineChart:
1983
- case C.StackBarChart:
1984
- case C.StackLineChart:
1985
- case C.Circular:
1986
- return 4;
1987
- case C.Scorecard:
1988
- return 2;
1989
- default:
1990
- return 1;
1991
- }
1992
- }), t = N(() => {
1993
- switch (n.value.widget.type) {
1994
- case C.Table:
1995
- case C.BarChart:
1996
- case C.LineChart:
1997
- case C.StackBarChart:
1998
- case C.StackLineChart:
1999
- case C.Circular:
2000
- return 4;
2001
- default:
2002
- return 1;
2003
- }
2004
- }), c = Te((l) => {
2005
- n.value.widget.title = l;
2006
- }, 500);
2007
- return (l, e) => {
2008
- const o = f("FmCircularProgress"), g = f("FmTextField"), M = f("FmTextarea"), E = f("FmStepperField"), W = f("FmButton"), K = f("FmForm");
2009
- return d(), V(xe(T(m).lg || T(m).md ? kl : xl), {
2010
- "model-value": p.hideConfiguration,
2011
- "onUpdate:modelValue": e[6] || (e[6] = (_) => v("hideConfiguration", _))
2012
- }, {
2013
- default: w(() => [
2014
- n.value ? (d(), V(K, {
2015
- key: 1,
2016
- ref: "form",
2017
- class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2018
- }, {
2019
- default: w(() => [
2020
- s(pe, null, {
2021
- header: w(() => e[7] || (e[7] = [
2022
- F("p", null, "Widget details", -1),
2023
- F("div", { class: "grow" }, null, -1)
2024
- ])),
2025
- content: w(() => [
2026
- s(g, {
2027
- "model-value": n.value.widget.title,
2028
- label: "Widget title",
2029
- placeholder: "Title here",
2030
- "onUpdate:modelValue": T(c)
2031
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
2032
- s(M, {
2033
- modelValue: n.value.widget.description,
2034
- "onUpdate:modelValue": e[0] || (e[0] = (_) => n.value.widget.description = _),
2035
- disabled: n.value.widget.title === "",
2036
- label: "Description (optional)",
2037
- placeholder: "Describe how your data is being collected",
2038
- "helper-text": "you can only add description when the title is enabled"
2039
- }, null, 8, ["modelValue", "disabled"]),
2040
- F("div", {
2041
- class: Ce(["flex flex-row", `${T(m).sm || T(m).xs ? "gap-16" : "gap-2"}`])
2042
- }, [
2043
- s(E, {
2044
- modelValue: n.value.size.width,
2045
- "onUpdate:modelValue": e[1] || (e[1] = (_) => n.value.size.width = _),
2046
- label: "Width",
2047
- min: k.value,
2048
- max: 12
2049
- }, null, 8, ["modelValue", "min"]),
2050
- s(E, {
2051
- modelValue: n.value.size.height,
2052
- "onUpdate:modelValue": e[2] || (e[2] = (_) => n.value.size.height = _),
2053
- label: "Height",
2054
- min: t.value,
2055
- max: 12,
2056
- disabled: n.value.widget.type === T(C).Scorecard
2057
- }, null, 8, ["modelValue", "min", "disabled"])
2058
- ], 2)
2059
- ]),
2060
- _: 1
2061
- }),
2062
- s(pe, null, {
2063
- header: w(() => e[8] || (e[8] = [
2064
- F("p", null, "Widget Type", -1),
2065
- F("div", { class: "grow" }, null, -1)
2066
- ])),
2067
- content: w(() => [
2068
- s(Re, {
2069
- "is-list": !0,
2070
- "model-value": n.value.widget.type,
2071
- class: "grid grid-cols-1 gap-2",
2072
- "child-class": "flex flex-row p-[8px] gap-2",
2073
- "exclude-widge-type": [T(C).Spacer],
2074
- "onUpdate:modelValue": e[3] || (e[3] = (_) => n.value = h(_, n.value))
2075
- }, null, 8, ["model-value", "exclude-widge-type"])
2076
- ]),
2077
- _: 1
2078
- }),
2079
- s(ke, {
2080
- modelValue: n.value.widget.config,
2081
- "onUpdate:modelValue": e[4] || (e[4] = (_) => n.value.widget.config = _),
2082
- label: "Main datasource",
2083
- config: U.value
2084
- }, null, 8, ["modelValue", "config"]),
2085
- R.value ? (d(!0), $(G, { key: 0 }, ue(R.value, (_, A) => (d(), $("div", { key: A }, [
2086
- s(ke, {
2087
- modelValue: R.value[A],
2088
- "onUpdate:modelValue": (B) => R.value[A] = B,
2089
- label: `Join datasource ${A + 1}`,
2090
- config: U.value,
2091
- "main-datasource-config": n.value.widget.config,
2092
- closeable: !0,
2093
- onClickClose: (B) => b(A)
2094
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2095
- ]))), 128)) : x("", !0),
2096
- F("div", Cl, [
2097
- s(W, {
2098
- label: "Join datasource",
2099
- variant: "secondary",
2100
- icon: "add",
2101
- "icon-position": "prepend",
2102
- "border-color": T(se).ColorPrimary,
2103
- "text-color": T(se).ColorPrimary,
2104
- class: "w-full",
2105
- onClick: e[5] || (e[5] = (_) => i())
2106
- }, null, 8, ["border-color", "text-color"])
2107
- ])
2108
- ]),
2109
- _: 1
2110
- }, 512)) : (d(), V(o, { key: 0 }))
2111
- ]),
2112
- _: 1
2113
- }, 8, ["model-value"]);
2114
- };
2115
- }
2116
- }), hl = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[400px]" }, Tl = { class: "flex bg-fm-color-neutral-white w-[88px]" }, Sl = { class: "w-full overflow-y-auto" }, _l = {
2117
- class: "grid grid-cols-12 w-full p-24",
2118
- style: { backgroundColor: "#F6F8FC" }
2119
- }, Dl = /* @__PURE__ */ P({
2120
- __name: "TileEditorDesktop",
2121
- props: /* @__PURE__ */ H({
2122
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
2123
- index: { type: Number, required: !0, default: 0 }
2124
- }, {
2125
- modelValue: {
2126
- required: !0
2127
- },
2128
- modelModifiers: {}
2129
- }),
2130
- emits: /* @__PURE__ */ H(["hideConfiguration"], ["update:modelValue"]),
2131
- setup(u, { emit: r }) {
2132
- const n = z(u, "modelValue"), m = u, p = N(
2133
- () => Ve.find((v) => {
2134
- var a;
2135
- return v.type === ((a = n.value) == null ? void 0 : a.widget.type);
2136
- })
2137
- ), y = r;
2138
- return (v, a) => {
2139
- const i = f("FmCircularProgress"), b = f("FmButton");
2140
- return d(), $("div", null, [
2141
- n.value ? (d(), $(G, { key: 1 }, [
2142
- s(je, {
2143
- "model-value": !u.hideConfiguration
2144
- }, {
2145
- right: w(() => [
2146
- F("div", hl, [
2147
- s(Ue, {
2148
- modelValue: n.value,
2149
- "onUpdate:modelValue": a[0] || (a[0] = (h) => n.value = h),
2150
- config: p.value,
2151
- "hide-configuration": u.hideConfiguration,
2152
- onHideConfiguration: a[1] || (a[1] = (h) => {
2153
- y("hideConfiguration", h);
2154
- })
2155
- }, null, 8, ["modelValue", "config", "hide-configuration"])
2156
- ])
2157
- ]),
2158
- left: w(() => [
2159
- F("div", Tl, [
2160
- s(b, {
2161
- variant: "secondary",
2162
- icon: "keyboard_double_arrow_right",
2163
- "border-color": T(se).ColorPrimary,
2164
- "text-color": T(se).ColorPrimary,
2165
- class: "m-24 my-16",
2166
- size: "md",
2167
- onClick: a[2] || (a[2] = (h) => y("hideConfiguration", !m.hideConfiguration))
2168
- }, null, 8, ["border-color", "text-color"])
2169
- ])
2170
- ]),
2171
- _: 1
2172
- }, 8, ["model-value"]),
2173
- F("div", Sl, [
2174
- F("div", _l, [
2175
- n.value ? (d(), V(De, {
2176
- key: 0,
2177
- "model-value": n.value,
2178
- index: m.index,
2179
- "hide-export": !0
2180
- }, null, 8, ["model-value", "index"])) : (d(), V(Ne, { key: 1 }))
2181
- ])
2182
- ])
2183
- ], 64)) : (d(), V(i, { key: 0 }))
2184
- ]);
2185
- };
2186
- }
2187
- }), Nl = {
2188
- key: 0,
2189
- class: "flex w-full justify-center items-center"
2190
- }, Ul = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, Ol = /* @__PURE__ */ P({
2191
- __name: "TileEditorMobile",
2192
- props: /* @__PURE__ */ H({
2193
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
2194
- index: { type: Number, required: !0, default: 0 }
2195
- }, {
2196
- modelValue: {
2197
- required: !0
2198
- },
2199
- modelModifiers: {}
2200
- }),
2201
- emits: /* @__PURE__ */ H(["hideConfiguration"], ["update:modelValue"]),
2202
- setup(u, { emit: r }) {
2203
- const n = z(u, "modelValue"), m = u, p = N(
2204
- () => Ve.find((v) => {
2205
- var a;
2206
- return v.type === ((a = n.value) == null ? void 0 : a.widget.type);
2207
- })
2208
- ), y = r;
2209
- return (v, a) => {
2210
- const i = f("FmCircularProgress");
2211
- return d(), $("div", null, [
2212
- n.value ? (d(), $(G, { key: 1 }, [
2213
- F("div", Ul, [
2214
- n.value ? (d(), V(De, {
2215
- key: 0,
2216
- "model-value": n.value,
2217
- index: m.index,
2218
- "hide-export": !0
2219
- }, null, 8, ["model-value", "index"])) : (d(), V(Ne, { key: 1 }))
2220
- ]),
2221
- s(Ue, {
2222
- modelValue: n.value,
2223
- "onUpdate:modelValue": a[0] || (a[0] = (b) => n.value = b),
2224
- config: p.value,
2225
- "hide-configuration": u.hideConfiguration,
2226
- onHideConfiguration: a[1] || (a[1] = (b) => {
2227
- y("hideConfiguration", b);
2228
- })
2229
- }, null, 8, ["modelValue", "config", "hide-configuration"])
2230
- ], 64)) : (d(), $("div", Nl, [
2231
- s(i)
2232
- ]))
2233
- ]);
2234
- };
2235
- }
2236
- }), $l = { key: 0 }, Yl = /* @__PURE__ */ P({
2237
- __name: "TileEditor",
2238
- setup(u) {
2239
- const r = Le(), n = Me(), m = Je(), { currentSelectWidgetType: p, editingReport: y, editingTile: v, editingIndex: a } = ye(m), { breakpoints: i } = Se(), { promptMessage: b } = he(), h = j(!1);
2240
- async function U() {
2241
- var t;
2242
- if (!y.value) return;
2243
- await b({
2244
- title: "Save widget",
2245
- message: `Confirm save ${(t = v.value) == null ? void 0 : t.widget.title}`
2246
- }) && (v.value && (y.value.tiles[a.value] = v.value), p.value = void 0, n.back());
2247
- }
2248
- async function R() {
2249
- var t;
2250
- if (!y.value) return;
2251
- await b({
2252
- title: "Cancel Widget",
2253
- message: `Current ${(t = v.value) == null ? void 0 : t.widget.title} is not saved, are you sure you want to quit?`
2254
- }) && (p.value = void 0, n.back());
2255
- }
2256
- return Oe(() => {
2257
- y.value || n.push({ name: "reports" });
2258
- }), (k, t) => {
2259
- const c = f("FmButton");
2260
- return d(), V(Ee, null, {
2261
- default: w(() => [
2262
- s(qe, null, {
2263
- title: w(() => {
2264
- var l;
2265
- return [
2266
- T(i).lg || T(i).md ? (d(), $("p", $l, X(T(Fe)(((l = T(v)) == null ? void 0 : l.widget.type) ?? "New report")), 1)) : x("", !0)
2267
- ];
2268
- }),
2269
- button: w(() => [
2270
- s(c, {
2271
- label: "Cancel",
2272
- variant: "tertiary",
2273
- "text-color": T(se).TypoSecondary,
2274
- onClick: R
2275
- }, null, 8, ["text-color"]),
2276
- s(c, {
2277
- label: "Save",
2278
- onClick: U
2279
- })
2280
- ]),
2281
- _: 1
2282
- }),
2283
- T(v) ? (d(), V(xe(T(i).lg || T(i).md ? Dl : Ol), {
2284
- key: 0,
2285
- modelValue: T(v),
2286
- "onUpdate:modelValue": t[0] || (t[0] = (l) => Ie(v) ? v.value = l : null),
2287
- class: Ce(`${T(i).lg || T(i).md ? "flex" : ""} w-full`),
2288
- style: $e({ height: `calc( 100% - ${T(i).lg || T(i).md ? 72 : 64}px)` }),
2289
- "hide-configuration": h.value,
2290
- index: Number(T(r).params.tileIndex),
2291
- onHideConfiguration: t[1] || (t[1] = (l) => h.value = l)
2292
- }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : x("", !0)
2293
- ]),
2294
- _: 1
2295
- });
2296
- };
2297
- }
2298
- });
2299
- export {
2300
- Yl as default
2301
- };