@feedmepos/mf-report 5.14.2 → 5.14.3-beta.0

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 (25) hide show
  1. package/dist/{App-B42aRUhC.js → App-BmniZkjD.js} +33 -33
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BRk-mwHe.js → BaseDialog.vue_vue_type_script_setup_true_lang-BfqoIHbA.js} +1 -1
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-BLPR2QZJ.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-D_vOomEW.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-CUUKwwv6.js → Default.vue_vue_type_script_setup_true_lang-SKf2r2G8.js} +2 -2
  5. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BE9jLROO.js → DynamicWidget.vue_vue_type_script_setup_true_lang-BMVhDJ_I.js} +5 -5
  6. package/dist/{InsightView-jcDgQV7R.js → InsightView-BFki5EUd.js} +5 -5
  7. package/dist/{Integration-BDxihj0c.js → Integration-C1vkCqlT.js} +2 -2
  8. package/dist/{Integrations-Cbzkedz3.js → Integrations-BTB-ZK56.js} +3 -3
  9. package/dist/{Layout-XwjMLwUh.js → Layout-V_HNhnDl.js} +1 -1
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-ChwL80JF.js +352 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-Bu64bEVK.js → NavigationTab.vue_vue_type_script_setup_true_lang-CCX9gZ52.js} +5 -5
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-qEkm--BH.js → NoData.vue_vue_type_script_setup_true_lang-DT2L1CAc.js} +1 -1
  13. package/dist/{OverviewView-N0NfgdDr.js → OverviewView-uVj6jdCi.js} +5 -5
  14. package/dist/{Report-emNwoHcT.js → Report-CNKUdP4L.js} +4 -4
  15. package/dist/{ReportEditor-Cms4XXsE.js → ReportEditor-BLwUfj38.js} +6 -6
  16. package/dist/{ReportView-nvpOI3qk.js → ReportView-ZDP3QOwI.js} +7 -7
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-C3hWhvK1.js → SelectComponent.vue_vue_type_script_setup_true_lang-CJaP9yq9.js} +1 -1
  18. package/dist/{Setting-B32ZmcuI.js → Setting-glu98b3A.js} +4 -4
  19. package/dist/{TileEditor-eYARHGC2.js → TileEditor-BmlqAFyc.js} +7 -7
  20. package/dist/{TransitionFade-BnQP-rN4.js → TransitionFade-DKCPXh2R.js} +5 -5
  21. package/dist/app.js +11 -11
  22. package/dist/{helper-8cjX1HJZ.js → helper-CZss0RvH.js} +1 -1
  23. package/dist/{vue-i18n-Fbuacdec.js → vue-i18n-CLA-22OG.js} +1 -1
  24. package/package.json +1 -1
  25. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-6I99YY2U.js +0 -361
@@ -1,361 +0,0 @@
1
- import { defineComponent as R, computed as q, ref as oe, watch as z, resolveComponent as h, createElementBlock as v, openBlock as i, renderSlot as re, Fragment as D, renderList as I, createBlock as g, unref as r, withCtx as S, createElementVNode as T, createCommentVNode as U, createVNode as p, isRef as C, useModel as ie, normalizeClass as E, toDisplayString as ue } from "vue";
2
- import { u as me, b as J, d as Y, j as de } from "./vue-i18n-Fbuacdec.js";
3
- import { storeToRefs as N } from "pinia";
4
- import { a as pe, d as ce } from "./NavigationTab.vue_vue_type_script_setup_true_lang-Bu64bEVK.js";
5
- import { _ as K, a as fe } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BLPR2QZJ.js";
6
- import { a as ve, b as be, D as w, q as he, W as H, S as _e } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BRk-mwHe.js";
7
- import { _ as ye } from "./NoData.vue_vue_type_script_setup_true_lang-qEkm--BH.js";
8
- import { d as Fe } from "./helper-8cjX1HJZ.js";
9
- import { detectLocale as ge } from "@feedmepos/mf-common";
10
- import { useBreakpoints as ke } from "@feedmepos/ui-library";
11
- const xe = { class: "flex flex-wrap gap-2" }, we = { class: "flex flex-col gap-1 p-2 bg-fm-color-neutral-white max-h-[300px] overflow-y-auto relative fm-shadow-light-300" }, Se = {
12
- key: 0,
13
- class: "flex justify-center my-2"
14
- }, Ce = /* @__PURE__ */ R({
15
- __name: "FilterSelector",
16
- setup(V) {
17
- var G;
18
- const { t: b } = me(), { currentReport: d } = N(ve());
19
- let { globalFilters: k, isGlobalFiltersLoading: m, timeRange: _, dateRange: y, selectedLocationIds: F } = N(J()), { schemas: L } = N(be());
20
- const n = q(() => {
21
- var e;
22
- return ((e = d.value) == null ? void 0 : e.id) ?? "";
23
- }), o = oe([]);
24
- z(
25
- ((G = d.value) == null ? void 0 : G.globalFilters) || [],
26
- () => {
27
- o.value = k.value.map((e) => ({
28
- filter: e,
29
- search: "",
30
- options: [],
31
- type: Q(e)
32
- }));
33
- },
34
- { deep: !0, immediate: !0 }
35
- ), z(
36
- [_, y, F],
37
- async () => {
38
- await le();
39
- },
40
- { deep: !0, immediate: !0 }
41
- );
42
- var x = void 0;
43
- function Q(e) {
44
- var a;
45
- const t = (a = L.value.find((s) => s.name === e.schemaName)) == null ? void 0 : a.fields.find((s) => s.name === e.name);
46
- return t == null ? void 0 : t.type;
47
- }
48
- function X(e) {
49
- return {
50
- type: H.Table,
51
- config: {
52
- schemaNames: Array.from(
53
- /* @__PURE__ */ new Set([e.schemaName, ...(e.filters ?? []).map((t) => t.schemaName)])
54
- ),
55
- dimensions: [
56
- {
57
- name: e.name ?? "",
58
- schemaName: e.schemaName ?? "",
59
- label: e.name ?? "",
60
- hide: !1,
61
- option: null
62
- }
63
- ],
64
- rowIds: [],
65
- metrics: [],
66
- filters: e.filters || [],
67
- sorts: [
68
- {
69
- name: e.name ?? "",
70
- schemaName: e.schemaName ?? "",
71
- type: _e.Asc,
72
- aggregation: null,
73
- dimensionOption: null
74
- }
75
- ],
76
- joinDatasources: [],
77
- limit: null,
78
- rollup: void 0,
79
- drillDimension: void 0,
80
- showGrandTotal: !1,
81
- breakdownDimension: void 0,
82
- sparklineDimension: void 0,
83
- isTransposed: !1,
84
- isDrillable: !1
85
- },
86
- title: ""
87
- };
88
- }
89
- function M(e) {
90
- return e.options.every((t) => {
91
- var a;
92
- return (a = e.filter.values) == null ? void 0 : a.includes(t.value);
93
- });
94
- }
95
- function Z(e) {
96
- M(e) ? e.filter.values = ["NULL"] : e.filter.values = e.options.map((t) => t.value);
97
- }
98
- const ee = q(
99
- () => o.value.map((e) => {
100
- const t = e.options, a = e.search.toLowerCase() ?? "";
101
- return t.filter((s) => s.label.toLowerCase().includes(a.toLowerCase()));
102
- })
103
- );
104
- async function te(e) {
105
- switch (e.type) {
106
- case w.String:
107
- case w.Numeric:
108
- {
109
- const t = await he(
110
- X(e.filter),
111
- x.signal
112
- ), a = (t == null ? void 0 : t.type) === H.Table ? t.rows.map((u) => {
113
- var l;
114
- return ((l = u.cells) == null ? void 0 : l[0]) ?? "";
115
- }) : [];
116
- e.options = a.map((u) => ({
117
- label: u,
118
- value: u
119
- }));
120
- const s = e.filter.values || [];
121
- if (!s.some((u) => u !== "NULL"))
122
- e.filter.values = a.length ? a : ["NULL"];
123
- else {
124
- const u = new Set(a), l = s.filter(
125
- ($) => $ === "NULL" || u.has($)
126
- );
127
- e.filter.values = l.length ? l : ["NULL"];
128
- }
129
- }
130
- break;
131
- case w.Bool:
132
- e.options = [
133
- { label: "Yes", value: !0 },
134
- { label: "No", value: !1 }
135
- ], (!e.filter.values || e.filter.values.length === 0) && (e.filter.values = [!0, !1]);
136
- break;
137
- case w.Timestamp:
138
- break;
139
- }
140
- }
141
- async function le() {
142
- if (!(!n.value || !o.value.length)) {
143
- x && (x == null || x.abort()), x = new AbortController();
144
- try {
145
- m.value = !0;
146
- const e = o.value.map(async (t) => {
147
- await te(t);
148
- });
149
- await Promise.all(e);
150
- } finally {
151
- m.value = !1;
152
- }
153
- }
154
- }
155
- function ae(e, t) {
156
- var s, c;
157
- if ((s = e.filter.values) == null ? void 0 : s.includes(t)) {
158
- let u = (e.filter.values || []).filter((l) => l !== t);
159
- u.length === 0 && (u = ["NULL"]), e.filter.values = u;
160
- } else
161
- (c = e.filter.values) == null || c.push(t);
162
- }
163
- function O(e, t) {
164
- if (t === null)
165
- e.values = [];
166
- else {
167
- const a = Y(t.startDate).startOf("day").utc().toISOString(), s = Y(t.endDate).endOf("day").utc().toISOString();
168
- e.values = [a, s];
169
- }
170
- }
171
- function se(e) {
172
- var a;
173
- const t = (a = e.filter.values) == null ? void 0 : a.filter((s) => s !== "NULL");
174
- return `${b("report.section.filter.selectAll")} (${t == null ? void 0 : t.length}/${e.options.length})`;
175
- }
176
- function ne(e) {
177
- const t = e.options.length, a = b("report.section.filter.search"), s = b("report.common.results", { count: t });
178
- return `${a} (${s})`;
179
- }
180
- function A(e) {
181
- var a, s, c;
182
- const t = de(e.filter);
183
- switch (e.type) {
184
- case w.Timestamp:
185
- return ((a = e.filter.values) == null ? void 0 : a.length) === 2 ? `${t} is between ${Fe({
186
- startDate: (s = e.filter.values) == null ? void 0 : s[0],
187
- endDate: (c = e.filter.values) == null ? void 0 : c[1],
188
- locale: ge()
189
- })}` : t;
190
- default:
191
- return t;
192
- }
193
- }
194
- return (e, t) => {
195
- const a = h("FmCircularProgress"), s = h("FmTextField"), c = h("FmMenuItem"), u = h("FmMenu");
196
- return i(), v("div", xe, [
197
- (i(!0), v(D, null, I(o.value, (l, $) => {
198
- var B, j, P;
199
- return i(), v("div", {
200
- key: `${l.filter.schemaName}-${l.filter.name}`
201
- }, [
202
- l.type === r(w).Timestamp ? (i(), g(K, {
203
- key: 0,
204
- "model-value": { startDate: (B = l.filter.values) == null ? void 0 : B[0], endDate: (j = l.filter.values) == null ? void 0 : j[1] },
205
- class: "w-full",
206
- label: A(l),
207
- removable: ((P = l.filter.values) == null ? void 0 : P.length) === 2,
208
- onUpdate: (f) => O(l.filter, f),
209
- onChipClosed: () => O(l.filter, null)
210
- }, null, 8, ["model-value", "label", "removable", "onUpdate", "onChipClosed"])) : (i(), g(u, {
211
- key: 1,
212
- "close-on-click": !1,
213
- shift: !0
214
- }, {
215
- "menu-button": S(() => [
216
- p(fe, {
217
- "left-icon": "filter_alt",
218
- "right-icon": "expand_more",
219
- label: A(l)
220
- }, null, 8, ["label"])
221
- ]),
222
- "menu-wrapper": S(() => [
223
- T("div", we, [
224
- r(m) ? (i(), v("div", Se, [
225
- p(a)
226
- ])) : U("", !0),
227
- l.options.length > 0 && !r(m) ? (i(), v(D, { key: 1 }, [
228
- p(s, {
229
- modelValue: l.search,
230
- "onUpdate:modelValue": (f) => l.search = f,
231
- type: "text",
232
- "prepend-icon": "search",
233
- placeholder: ne(l),
234
- class: "border px-2 py-1 text-sm mb-1 rounded"
235
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]),
236
- p(c, {
237
- label: se(l),
238
- "has-checkbox": !0,
239
- "model-value": M(l),
240
- indeterminate: !0,
241
- onClick: (f) => Z(l)
242
- }, null, 8, ["label", "model-value", "onClick"]),
243
- (i(!0), v(D, null, I(ee.value[$], (f) => {
244
- var W;
245
- return i(), g(c, {
246
- key: f.value,
247
- label: f.label,
248
- "has-checkbox": !0,
249
- "model-value": (W = l.filter.values) == null ? void 0 : W.includes(f.value),
250
- onClick: () => ae(l, f.value)
251
- }, null, 8, ["label", "model-value", "onClick"]);
252
- }), 128))
253
- ], 64)) : r(m) ? U("", !0) : (i(), g(ye, { key: 2 }))
254
- ])
255
- ]),
256
- _: 2
257
- }, 1024))
258
- ]);
259
- }), 128)),
260
- re(e.$slots, "default")
261
- ]);
262
- };
263
- }
264
- }), Le = { class: "flex flex-col gap-2 overflow-x-auto overflow-y-hidden scrollbar-hide" }, $e = { class: "flex flex-col gap-2 py-2" }, De = /* @__PURE__ */ R({
265
- __name: "Filter",
266
- setup(V) {
267
- const {
268
- locations: b,
269
- selectedLocationIds: d,
270
- dateRange: k,
271
- compareDateRange: m,
272
- timeRange: _,
273
- defaultDateSetting: y,
274
- selectTimeDefault: F
275
- } = N(J());
276
- return (L, n) => (i(), v("div", Le, [
277
- T("div", $e, [
278
- p(pe, {
279
- modelValue: r(d),
280
- "onUpdate:modelValue": n[5] || (n[5] = (o) => C(d) ? d.value = o : null),
281
- options: r(b)
282
- }, {
283
- default: S(() => [
284
- p(K, {
285
- "date-range": r(k),
286
- "onUpdate:dateRange": n[0] || (n[0] = (o) => C(k) ? k.value = o : null),
287
- "compare-date-range": r(m),
288
- "onUpdate:compareDateRange": n[1] || (n[1] = (o) => C(m) ? m.value = o : null),
289
- "compare-type": r(y).defaultCompareType,
290
- "onUpdate:compareType": n[2] || (n[2] = (o) => r(y).defaultCompareType = o),
291
- compare: ""
292
- }, null, 8, ["date-range", "compare-date-range", "compare-type"]),
293
- p(ce, {
294
- "time-range": r(_),
295
- "onUpdate:timeRange": n[3] || (n[3] = (o) => C(_) ? _.value = o : null),
296
- "select-time-default": r(F),
297
- "onUpdate:selectTimeDefault": n[4] || (n[4] = (o) => C(F) ? F.value = o : null),
298
- "default-date-range": r(y).timeOptions
299
- }, null, 8, ["time-range", "select-time-default", "default-date-range"]),
300
- p(Ce)
301
- ]),
302
- _: 1
303
- }, 8, ["modelValue", "options"])
304
- ])
305
- ]));
306
- }
307
- }), Ne = { class: "fm-typo-en-body-md-400" }, je = /* @__PURE__ */ R({
308
- __name: "MenuTab",
309
- props: {
310
- modelValue: { required: !1, default: [] },
311
- modelModifiers: {}
312
- },
313
- emits: ["update:modelValue"],
314
- setup(V) {
315
- const b = ie(V, "modelValue"), { breakpoints: d } = ke();
316
- return (k, m) => {
317
- const _ = h("FmButton"), y = h("FmIcon"), F = h("FmMenuItem"), L = h("FmMenu");
318
- return i(), v("div", {
319
- class: E(["flex items-start pb-2 px-24", `${r(d).lg || r(d).md ? "px-24" : "pl-3"}`])
320
- }, [
321
- p(De),
322
- m[0] || (m[0] = T("div", { class: "flex grow" }, null, -1)),
323
- b.value.length > 0 ? (i(), g(L, {
324
- key: 0,
325
- trigger: "click",
326
- placement: "left",
327
- shift: !0,
328
- class: E(r(d).sm || r(d).xs ? "pr-3" : "")
329
- }, {
330
- "menu-button": S(() => [
331
- p(_, {
332
- "append-icon": "more_vert",
333
- variant: "tertiary",
334
- size: "md",
335
- class: "w-[36px] bg-none"
336
- })
337
- ]),
338
- default: S(() => [
339
- (i(!0), v(D, null, I(b.value, (n, o) => (i(), g(F, {
340
- key: `button-${o}`,
341
- onClick: n.onClick
342
- }, {
343
- label: S(() => [
344
- n.prependIcon ?? !1 ? (i(), g(y, {
345
- key: 0,
346
- name: n.icon
347
- }, null, 8, ["name"])) : U("", !0),
348
- T("p", Ne, ue(n.label), 1)
349
- ]),
350
- _: 2
351
- }, 1032, ["onClick"]))), 128))
352
- ]),
353
- _: 1
354
- }, 8, ["class"])) : U("", !0)
355
- ], 2);
356
- };
357
- }
358
- });
359
- export {
360
- je as _
361
- };