@feedmepos/mf-report 5.25.7 → 5.25.8

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 (29) hide show
  1. package/dist/App-DVBc1rc0.js +302 -0
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-r5JrwnWY.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BRmKJJvc.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-D9MR-Tyr.js → Default.vue_vue_type_script_setup_true_lang-BUtavZIl.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D3zN3tqo.js → DynamicWidget.vue_vue_type_script_setup_true_lang-OIREDq6T.js} +1549 -1563
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ds2Rd7nK.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-ZAOWE1vp.js} +3263 -3161
  6. package/dist/{InsightView-CLkhmik2.js → InsightView-DctjGEzr.js} +5 -5
  7. package/dist/{Integration-BLjTOunk.js → Integration-CRd2_O5E.js} +3 -3
  8. package/dist/{Integrations-C_htzgLO.js → Integrations-CpMUHiCw.js} +3 -3
  9. package/dist/{Layout-B9AfrRso.js → Layout-DSXNbHHe.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-1G6ZNWRO.js → MenuTab.vue_vue_type_script_setup_true_lang-YjXH8vPq.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CBYyjcaw.js → NavigationTab.vue_vue_type_script_setup_true_lang-Ck7HaJRh.js} +4 -4
  12. package/dist/{OverviewView-CGen9md5.js → OverviewView-CLICdzyH.js} +5 -5
  13. package/dist/{Report-CujIJ861.js → Report-BvGQUoQF.js} +4 -4
  14. package/dist/{ReportEditor-cI0knIcX.js → ReportEditor-CIV7Sd_d.js} +4 -4
  15. package/dist/ReportView-ClTsRfJG.js +309 -0
  16. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Af_Z54a4.js → SelectComponent.vue_vue_type_script_setup_true_lang-BL1jpiXN.js} +2 -2
  17. package/dist/{Setting-C_mFfeHY.js → Setting-BYtSIDjs.js} +4 -4
  18. package/dist/Template-BVGvD8vx.js +482 -0
  19. package/dist/{TileEditor-Ra6Pw4Hb.js → TileEditor-n1lS7iNk.js} +274 -282
  20. package/dist/{TransitionFade-BjG4BHLj.js → TransitionFade-Dfm-zjeX.js} +5 -5
  21. package/dist/{app-CYlbtwt9.js → app-DMXIz8ol.js} +2693 -2360
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-BzuADGYi.js → formatChartData.worker-BlVUDagT.js} +15 -11
  24. package/dist/assets/{processTableData.worker-DTnbVu-a.js → processTableData.worker-CQMw9rvu.js} +15 -11
  25. package/dist/style.css +1 -1
  26. package/dist/{useRestaurantPermission-BoIwOw0q.js → useRestaurantPermission-DV3xL5r9.js} +1 -1
  27. package/package.json +1 -1
  28. package/dist/App-BMj1o_t6.js +0 -298
  29. package/dist/ReportView-BNCAume3.js +0 -264
@@ -0,0 +1,482 @@
1
+ import { defineComponent as re, computed as p, resolveComponent as g, createElementBlock as H, openBlock as _, renderSlot as Ce, createVNode as n, withCtx as s, createCommentVNode as ne, createElementVNode as m, toDisplayString as y, ref as b, h as v, onMounted as Te, createBlock as z, unref as l, normalizeStyle as ke, normalizeClass as C, withDirectives as te, Fragment as Fe, renderList as Le, withModifiers as oe, vShow as le } from "vue";
2
+ import { a as Ve } from "./SelectComponent.vue_vue_type_script_setup_true_lang-BL1jpiXN.js";
3
+ import { u as se, a as $e } from "./vue-i18n-DVWuTfed.js";
4
+ import { _ as Se } from "./Default.vue_vue_type_script_setup_true_lang-BUtavZIl.js";
5
+ import { u as Re } from "./message-dialog-UoMWOnil.js";
6
+ import { u as Pe } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-ZAOWE1vp.js";
7
+ import { r as ae } from "./i18n-CI_sQ5d_.js";
8
+ import { useBreakpoints as ze, useSnackbar as De, components as Ie, FmButtonColorThemeVariant as Ne } from "@feedmepos/ui-library";
9
+ import { useRouter as Oe, useRoute as Be } from "vue-router";
10
+ import { storeToRefs as Ee } from "pinia";
11
+ import { g as Ke } from "./app-DMXIz8ol.js";
12
+ const Me = { class: "flex flex-col h-full" }, Ue = ["src"], je = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ae = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, He = /* @__PURE__ */ re({
13
+ __name: "NoTemplate",
14
+ props: {
15
+ title: { default: "report.view.template.noTemplates" },
16
+ subTitle: { default: "report.view.template.noTemplatesHint" },
17
+ svgPath: { default: "" }
18
+ },
19
+ setup(q) {
20
+ const { t: w, te: c } = se(), i = q;
21
+ function o(d) {
22
+ return c(d) ? w(d) : d;
23
+ }
24
+ const T = p(() => o(i.title)), D = p(() => o(i.subTitle));
25
+ return (d, u) => {
26
+ const $ = g("FmCard");
27
+ return _(), H("div", Me, [
28
+ Ce(d.$slots, "menu"),
29
+ n($, {
30
+ class: "p-24 h-full flex flex-col gap-2 items-center justify-center",
31
+ variant: "flat"
32
+ }, {
33
+ default: s(() => [
34
+ d.svgPath ? (_(), H("img", {
35
+ key: 0,
36
+ src: d.svgPath,
37
+ alt: "No data illustration",
38
+ class: "mb-4 w-80 h-80"
39
+ }, null, 8, Ue)) : ne("", !0),
40
+ m("p", je, y(T.value), 1),
41
+ m("p", Ae, y(D.value), 1)
42
+ ]),
43
+ _: 1
44
+ })
45
+ ]);
46
+ };
47
+ }
48
+ }), qe = { class: "flex items-center gap-2" }, Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Je = { class: "w-[343px]" }, Qe = { class: "flex items-center gap-2" }, We = { class: "fm-typo-en-body-md-600" }, Xe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = { class: "fm-typo-en-title-sm-600" }, Ze = { class: "flex flex-col gap-3" }, ut = /* @__PURE__ */ re({
49
+ __name: "Template",
50
+ setup(q) {
51
+ const w = Pe(), { isAdmin: c } = Ke(), { breakpoints: i } = ze(), { t: o, te: T } = se(), D = Oe(), d = Be(), u = De(), { promptLoader: $ } = $e(), { promptMessage: G } = Re(), { FmButton: I, FmMenu: N, FmMenuItem: k, FmIcon: O, FmChip: B, FmSearch: ie, FmTooltip: me } = Ie, { editingReport: ce, reportTemplates: ue, categories: pe } = Ee(w), E = p(() => pe.value ?? []), J = p(() => ue.value ?? []), K = p(() => [
52
+ {
53
+ label: o("report.common.all"),
54
+ value: void 0
55
+ },
56
+ ...E.value.map((t) => ({
57
+ label: M(t.name),
58
+ value: t.id
59
+ }))
60
+ ]), S = b(void 0), de = p(
61
+ () => {
62
+ var t, e;
63
+ return ((t = K.value.find((a) => a.value === S.value)) == null ? void 0 : t.label) ?? ((e = K.value[0]) == null ? void 0 : e.label) ?? "";
64
+ }
65
+ ), R = b(!1), F = b(null), x = b(""), L = b(""), V = b(""), fe = p(() => [
66
+ {
67
+ label: o("report.common.uncategorized"),
68
+ value: ""
69
+ },
70
+ ...E.value.map((t) => ({
71
+ label: M(t.name),
72
+ value: t.id
73
+ }))
74
+ ]), P = b(""), h = p(() => {
75
+ const t = P.value.toLowerCase(), e = o("report.common.uncategorized");
76
+ return J.value.map((a) => {
77
+ const f = E.value.find((j) => j.id === a.category);
78
+ return {
79
+ id: a.id,
80
+ name: ae(o, T, Q(a), "other"),
81
+ description: ae(o, T, a.description || "", "other"),
82
+ categoryId: a.category || "",
83
+ categoryLabel: f ? M(f.name) : e,
84
+ isOwner: a.isOwner ?? !1
85
+ };
86
+ }).filter((a) => S.value && a.categoryId !== S.value ? !1 : !P.value.trim() || a.name.toLowerCase().includes(t) || a.description.toLowerCase().includes(t));
87
+ }), ve = p(
88
+ () => h.value.map((t) => `${t.id}${t.name}${t.categoryLabel}`).join("")
89
+ ), ge = p(() => [
90
+ {
91
+ accessorKey: "name",
92
+ header: o("report.common.name"),
93
+ enableSorting: !1,
94
+ cell: (t) => v("span", t.getValue())
95
+ },
96
+ {
97
+ accessorKey: "categoryLabel",
98
+ header: o("report.common.category"),
99
+ enableSorting: !1,
100
+ meta: {
101
+ width: "100px"
102
+ },
103
+ cell: (t) => v(
104
+ B,
105
+ {
106
+ class: `${t.getValue() !== o("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} fm-typo-en-body-sm-600`,
107
+ compact: !0
108
+ },
109
+ { default: () => t.getValue() }
110
+ )
111
+ },
112
+ {
113
+ accessorKey: "description",
114
+ header: o("report.common.description"),
115
+ enableSorting: !1,
116
+ cell: (t) => v("span", t.getValue())
117
+ },
118
+ {
119
+ accessorKey: "",
120
+ id: "Action",
121
+ header: "",
122
+ meta: {
123
+ width: "0px"
124
+ },
125
+ cell: (t) => {
126
+ const e = t.row.original, a = c.value && !e.isOwner;
127
+ return v(
128
+ "div",
129
+ {
130
+ class: `flex ${i.value.lg || i.value.md ? "justify-end" : ""} items-center`
131
+ },
132
+ {
133
+ default: () => c.value ? [
134
+ v(
135
+ N,
136
+ {
137
+ stopClickPropagation: !0,
138
+ shift: !0,
139
+ disabled: a
140
+ },
141
+ {
142
+ default: () => [
143
+ v(k, {
144
+ label: o("report.common.edit"),
145
+ disabled: a,
146
+ onClick: () => X(e.id)
147
+ }),
148
+ v(k, {
149
+ label: o("report.common.delete"),
150
+ disabled: a,
151
+ onClick: () => Y(e.id)
152
+ })
153
+ ],
154
+ "menu-button": () => v(I, {
155
+ variant: "tertiary",
156
+ size: "md",
157
+ icon: "more_vert",
158
+ iconColor: Ne.NeutralGray400,
159
+ disabled: a
160
+ })
161
+ }
162
+ )
163
+ ] : []
164
+ }
165
+ );
166
+ }
167
+ }
168
+ ]);
169
+ function M(t) {
170
+ const e = `report.category.${t}`;
171
+ return T(e) ? o(e) : t;
172
+ }
173
+ function ye(t) {
174
+ return t.id;
175
+ }
176
+ function Q(t) {
177
+ return t.name;
178
+ }
179
+ function be(t) {
180
+ S.value = t;
181
+ }
182
+ function U(t) {
183
+ return J.value.find((e) => ye(e) === t);
184
+ }
185
+ function W(t) {
186
+ const e = U(t);
187
+ if (!e) return;
188
+ const a = {
189
+ ...e.report,
190
+ id: "",
191
+ isDefault: !1,
192
+ editable: !0
193
+ }, f = Q(e);
194
+ a.name = `${f} duplicate`, ce.value = a, D.push({
195
+ name: "reportEditor",
196
+ query: d.query
197
+ });
198
+ }
199
+ function X(t) {
200
+ if (!c.value) {
201
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
202
+ return;
203
+ }
204
+ const e = U(t);
205
+ if (!e) return;
206
+ if (c.value && !e.isOwner) {
207
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
208
+ return;
209
+ }
210
+ const a = JSON.parse(JSON.stringify(e));
211
+ F.value = a, x.value = a.name || "", L.value = a.description || "", V.value = a.category || "", R.value = !0;
212
+ }
213
+ async function Y(t) {
214
+ if (!c.value) {
215
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
216
+ return;
217
+ }
218
+ const e = U(t);
219
+ if (!e) return;
220
+ if (c.value && !e.isOwner) {
221
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
222
+ return;
223
+ }
224
+ await G({
225
+ title: o("report.messages.deleteReport"),
226
+ message: o("report.messages.confirmDelete", { name: e.name })
227
+ }) && await $(async () => {
228
+ await w.removeReportTemplates(e), u.open({
229
+ message: o("report.messages.deleteSuccess", { name: e.name }),
230
+ type: "success"
231
+ });
232
+ });
233
+ }
234
+ function Z() {
235
+ R.value = !1, F.value = null, x.value = "", L.value = "", V.value = "";
236
+ }
237
+ async function _e() {
238
+ if (!c.value) {
239
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
240
+ return;
241
+ }
242
+ if (!F.value) return;
243
+ if (c.value && !F.value.isOwner) {
244
+ u.open({ message: o("report.messages.noPermission"), type: "error" });
245
+ return;
246
+ }
247
+ const t = o("report.common.update"), e = {
248
+ ...F.value,
249
+ name: x.value,
250
+ description: L.value,
251
+ category: V.value
252
+ };
253
+ if (await G({
254
+ title: t,
255
+ message: o("report.messages.confirmAction", {
256
+ action: t,
257
+ name: e.name
258
+ })
259
+ }))
260
+ try {
261
+ await $(async () => {
262
+ await w.updateReportTemplate(e);
263
+ }), u.open({
264
+ message: o("report.messages.saveSuccess"),
265
+ type: "success"
266
+ }), Z();
267
+ } catch (f) {
268
+ console.error(f), u.open({
269
+ message: o("report.messages.failedToAction", { action: o("report.common.update") }),
270
+ type: "error"
271
+ });
272
+ }
273
+ }
274
+ return Te(async () => {
275
+ await w.getReportTemplates();
276
+ }), (t, e) => {
277
+ const a = g("FmPageHead"), f = g("FmForm"), j = g("FmListItem"), we = g("FmList"), xe = g("FmTable"), ee = g("FmTextField"), he = g("FmDialog");
278
+ return _(), z(Se, null, {
279
+ default: s(() => [
280
+ n(a, {
281
+ title: l(o)("report.view.template.title"),
282
+ class: "h-[68px] fm-typo-en-title-md-600"
283
+ }, {
284
+ title: s(() => [
285
+ m("div", qe, [
286
+ m("p", null, y(l(o)("report.view.template.title")), 1),
287
+ n(l(me), {
288
+ content: l(o)("report.view.template.sharedTooltip"),
289
+ placement: "bottom",
290
+ "z-index": 2e3
291
+ }, {
292
+ default: s(() => [
293
+ n(l(O), {
294
+ name: "info",
295
+ size: "md",
296
+ color: "primary"
297
+ })
298
+ ]),
299
+ _: 1
300
+ }, 8, ["content"])
301
+ ])
302
+ ]),
303
+ _: 1
304
+ }, 8, ["title"]),
305
+ m("div", {
306
+ class: C(`overflow-y-hidden flex flex-col gap-8 ${l(i).sm || l(i).xs ? "mb-20" : ""}`),
307
+ style: ke({ height: `calc(100% - ${l(i).lg || l(i).md ? 72 : 64}px)` })
308
+ }, [
309
+ n(f, {
310
+ class: C(`flex items-center gap-2 ${l(i).sm || l(i).xs ? "px-3" : "px-24"}`)
311
+ }, {
312
+ default: s(() => [
313
+ n(l(N), null, {
314
+ "menu-button": s(() => [
315
+ n(l(B), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
316
+ default: s(() => [
317
+ m("p", null, y(de.value), 1),
318
+ n(l(O), { name: "expand_more" })
319
+ ]),
320
+ _: 1
321
+ })
322
+ ]),
323
+ default: s(() => [
324
+ (_(!0), H(Fe, null, Le(K.value, (r, A) => (_(), z(l(k), {
325
+ key: A,
326
+ label: r.label,
327
+ onClick: () => be(r.value)
328
+ }, null, 8, ["label", "onClick"]))), 128))
329
+ ]),
330
+ _: 1
331
+ }),
332
+ m("div", {
333
+ class: C(`flex ${l(i).sm || l(i).xs ? "justify-center items-center" : ""}`)
334
+ }, [
335
+ m("p", Ge, y(l(o)("report.common.results", { count: h.value.length })), 1)
336
+ ], 2),
337
+ e[6] || (e[6] = m("div", { class: "grow" }, null, -1)),
338
+ m("div", Je, [
339
+ n(l(ie), {
340
+ modelValue: P.value,
341
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => P.value = r),
342
+ class: C(`${l(i).lg || l(i).md ? "grow" : ""}`)
343
+ }, null, 8, ["modelValue", "class"])
344
+ ])
345
+ ]),
346
+ _: 1
347
+ }, 8, ["class"]),
348
+ te((_(), z(xe, {
349
+ key: ve.value,
350
+ ref: "table",
351
+ class: C([l(i).sm || l(i).xs ? "px-0" : "px-24", "report-table"]),
352
+ style: { height: "calc(100% - 40px)" },
353
+ "column-defs": ge.value,
354
+ "row-data": h.value,
355
+ "page-size": h.value.length,
356
+ "hide-footer": !0,
357
+ "row-class-name": "row",
358
+ onRowClick: e[1] || (e[1] = (r) => W(r.original.id))
359
+ }, {
360
+ "list-row": s(({ original: r }) => [
361
+ n(we, {
362
+ onClick: () => W(r.id)
363
+ }, {
364
+ default: s(() => [
365
+ n(j, {
366
+ tag: "label",
367
+ label: r.name,
368
+ clickable: ""
369
+ }, {
370
+ append: s(() => [
371
+ m("div", Qe, [
372
+ n(l(B), {
373
+ class: C(
374
+ r.categoryLabel !== l(o)("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
375
+ ),
376
+ compact: !0
377
+ }, {
378
+ default: s(() => [
379
+ m("p", We, y(r.categoryLabel), 1)
380
+ ]),
381
+ _: 2
382
+ }, 1032, ["class"]),
383
+ l(c) ? (_(), z(l(N), {
384
+ key: 0,
385
+ placement: "left",
386
+ "stop-click-propagation": !0
387
+ }, {
388
+ "menu-button": s(() => [
389
+ n(l(O), { name: "more_vert" })
390
+ ]),
391
+ default: s(() => [
392
+ n(l(k), {
393
+ label: l(o)("report.common.edit"),
394
+ onClick: oe((A) => X(r.id), ["stop"])
395
+ }, null, 8, ["label", "onClick"]),
396
+ n(l(k), {
397
+ label: l(o)("report.common.delete"),
398
+ class: "text-fm-color-typo-error",
399
+ onClick: oe((A) => Y(r.id), ["stop"])
400
+ }, null, 8, ["label", "onClick"])
401
+ ]),
402
+ _: 2
403
+ }, 1024)) : ne("", !0)
404
+ ])
405
+ ]),
406
+ "sub-label": s(() => [
407
+ m("p", Xe, y(r.description), 1)
408
+ ]),
409
+ _: 2
410
+ }, 1032, ["label"])
411
+ ]),
412
+ _: 2
413
+ }, 1032, ["onClick"])
414
+ ]),
415
+ _: 1
416
+ }, 8, ["class", "column-defs", "row-data", "page-size"])), [
417
+ [le, h.value.length > 0]
418
+ ]),
419
+ te(n(He, {
420
+ title: "report.view.template.noTemplates",
421
+ "sub-title": "report.view.template.noTemplatesHint"
422
+ }, null, 512), [
423
+ [le, h.value.length === 0]
424
+ ])
425
+ ], 6),
426
+ n(he, {
427
+ modelValue: R.value,
428
+ "onUpdate:modelValue": e[5] || (e[5] = (r) => R.value = r),
429
+ overlay: !0,
430
+ "dismiss-away": !0
431
+ }, {
432
+ "dialog-header": s(() => [
433
+ m("p", Ye, y(l(o)("report.common.edit")), 1)
434
+ ]),
435
+ default: s(() => [
436
+ m("div", Ze, [
437
+ n(ee, {
438
+ modelValue: x.value,
439
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => x.value = r),
440
+ label: l(o)("report.common.name"),
441
+ placeholder: l(o)("report.view.report.enter")
442
+ }, null, 8, ["modelValue", "label", "placeholder"]),
443
+ n(ee, {
444
+ modelValue: L.value,
445
+ "onUpdate:modelValue": e[3] || (e[3] = (r) => L.value = r),
446
+ label: l(o)("report.common.description"),
447
+ placeholder: l(o)("report.common.description")
448
+ }, null, 8, ["modelValue", "label", "placeholder"]),
449
+ n(Ve, {
450
+ modelValue: V.value,
451
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => V.value = r),
452
+ label: l(o)("report.common.category"),
453
+ items: fe.value,
454
+ "disable-search": !0
455
+ }, null, 8, ["modelValue", "label", "items"])
456
+ ])
457
+ ]),
458
+ "dialog-footer": s(() => [
459
+ e[7] || (e[7] = m("div", { class: "grow" }, null, -1)),
460
+ n(l(I), {
461
+ label: l(o)("report.common.cancel"),
462
+ variant: "tertiary",
463
+ onClick: Z
464
+ }, null, 8, ["label"]),
465
+ n(l(I), {
466
+ label: l(o)("report.common.save"),
467
+ variant: "primary",
468
+ disabled: x.value.trim() === "",
469
+ onClick: _e
470
+ }, null, 8, ["label", "disabled"])
471
+ ]),
472
+ _: 1
473
+ }, 8, ["modelValue"])
474
+ ]),
475
+ _: 1
476
+ });
477
+ };
478
+ }
479
+ });
480
+ export {
481
+ ut as default
482
+ };