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