@feedmepos/mf-report 5.28.4-beta.0 → 5.28.4-beta.2

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-BMuIFkZp.js → App-CO0rIxWA.js} +4 -4
  2. package/dist/{DateRangeSelect-BcFNAiP2.js → DateRangeSelect-j_1JPSHY.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-zrGNDnBJ.js → Default.vue_vue_type_script_setup_true_lang-BTRNbPiK.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-Bj8q32if.js → DynamicWidget.vue_vue_type_script_setup_true_lang-D1MP0Koc.js} +4 -4
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DLl0Smpg.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CQgXdnVJ.js} +3 -3
  6. package/dist/{InsightView-DfJ12343.js → InsightView-D3Cq98b1.js} +5 -5
  7. package/dist/{Integration-DAEhKE4f.js → Integration-D1-45oFB.js} +3 -3
  8. package/dist/{Integrations-8b1zB9XX.js → Integrations-OQyPdZh-.js} +2 -2
  9. package/dist/{Layout-B5VlBrqA.js → Layout-Bbhc8Z8O.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-R13mIsrh.js → LocationSelect.vue_vue_type_script_setup_true_lang-Bv4_DVSD.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-D7AU_s8g.js → MenuTab.vue_vue_type_script_setup_true_lang-DsWBKmfz.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CacaNzx_.js → NavigationTab.vue_vue_type_script_setup_true_lang-CplZ_0DK.js} +5 -5
  13. package/dist/{OverviewView-BGtir-m6.js → OverviewView-DAYR_-3O.js} +4 -4
  14. package/dist/Report-4NU9XLHT.js +657 -0
  15. package/dist/{ReportCanvasView-DLVppEQE.js → ReportCanvasView-B-meSoDE.js} +3 -3
  16. package/dist/{ReportEditor-DAZHakgE.js → ReportEditor-E-LrtdYl.js} +7 -7
  17. package/dist/{ReportView-CcIBctoI.js → ReportView-BOBv-FMc.js} +6 -6
  18. package/dist/{ReportViewRoute-Cxp21_CC.js → ReportViewRoute-B5yL1meP.js} +2 -2
  19. package/dist/{Setting-DbKP30rF.js → Setting-DIUJFKvF.js} +3 -3
  20. package/dist/{Template-lzCS_aWv.js → Template-BXHt9ILt.js} +3 -3
  21. package/dist/{TileEditor-DwKZZgYN.js → TileEditor-Dfd00DF1.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-CJOoh4wX.js → TilePageStack.vue_vue_type_script_setup_true_lang-CcGtQ7-x.js} +2 -2
  23. package/dist/{TransitionFade-BcYwBfZV.js → TransitionFade-C0h34wzI.js} +5 -5
  24. package/dist/{app-z-voggLY.js → app-DCn4N0uO.js} +12 -12
  25. package/dist/app.js +1 -1
  26. package/dist/{report-DSXB-7r9.js → report-Dt0VwwmM.js} +1 -1
  27. package/dist/{useRestaurantPermission-CVoe7qGo.js → useRestaurantPermission-BAEw8_HZ.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/Report-BAKreW0-.js +0 -682
@@ -0,0 +1,657 @@
1
+ import { defineComponent as Ne, ref as z, watch as be, computed as R, h as f, withModifiers as ge, resolveComponent as k, createBlock as Z, openBlock as J, withCtx as u, createVNode as i, createElementVNode as C, unref as t, normalizeStyle as Ue, normalizeClass as y, withDirectives as Se, createElementBlock as Te, Fragment as Ae, renderList as ze, toDisplayString as _, createTextVNode as Je, vShow as Ce } from "vue";
2
+ import { storeToRefs as he } from "pinia";
3
+ import { u as Be, s as Ee } from "./report-Dt0VwwmM.js";
4
+ import { _ as Ke } from "./Default.vue_vue_type_script_setup_true_lang-BTRNbPiK.js";
5
+ import { u as Me } from "./message-dialog-UoMWOnil.js";
6
+ import { u as Ye } from "./global-loader-BuxFfehu.js";
7
+ import { useSnackbar as qe, useBreakpoints as He, components as je, FmButtonColorThemeVariant as Ge } from "@feedmepos/ui-library";
8
+ import { _ as Qe } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
+ import { c as We, a as we, h as Xe } from "./app-DCn4N0uO.js";
10
+ import { useRouter as Ze, useRoute as et, onBeforeRouteLeave as tt } from "vue-router";
11
+ import { useI18n as ot } from "@feedmepos/mf-common";
12
+ import { r as ee } from "./i18n-DbyciK4x.js";
13
+ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st = { class: "w-[343px]" }, rt = { class: "fm-typo-en-body-md-600" }, St = /* @__PURE__ */ Ne({
14
+ __name: "Report",
15
+ setup(nt) {
16
+ const { t: a, te: B } = ot(), te = Ze(), oe = et(), b = Be(), Re = We(), { business: Ie } = he(we()), {
17
+ reports: d,
18
+ overviewReport: E,
19
+ categories: $,
20
+ pinReport: O,
21
+ isOpenAddReportDialog: Pe,
22
+ scrollPositionY: ae,
23
+ customReportQuota: F,
24
+ canCreateCustomReport: se
25
+ } = he(b), { promptMessage: re } = Me(), { promptLoader: K } = Ye(), l = qe(), { breakpoints: p } = He(), { canRead: ne, canUpdate: le, canDuplicate: ie, canDelete: M, canCreateReport: ke } = Xe(), h = z();
26
+ tt(() => {
27
+ h.value && (ae.value = h.value.$el.children[0].scrollTop);
28
+ }), be(h, () => {
29
+ h.value && setTimeout(() => {
30
+ h.value && (h.value.$el.children[0].scrollTop = ae.value);
31
+ }, 200);
32
+ });
33
+ const Y = R(() => O.value && d.value ? d.value.filter((o) => {
34
+ var e;
35
+ return (e = O.value) == null ? void 0 : e.includes(o.id);
36
+ }) : []);
37
+ be(
38
+ [() => Ie.value],
39
+ () => {
40
+ b.refreshPinReport();
41
+ },
42
+ { immediate: !0 }
43
+ );
44
+ const ce = R(() => Y.value.length > 0 ? d.value.filter(
45
+ (o) => Y.value.findIndex((e) => e.id === o.id) === -1
46
+ ) : d.value), { FmButton: xe, FmMenu: q, FmMenuItem: w, FmIcon: H, FmChip: j, FmTooltip: De, FmSwitch: pe } = je, v = z(/* @__PURE__ */ new Set()), ue = R(() => [
47
+ { value: void 0, label: "All" },
48
+ ...$.value.map((o) => ({
49
+ value: o.id,
50
+ label: o.name
51
+ }))
52
+ ]), L = z(ue.value[0]), G = z(""), I = R(() => ce.value.length === 0 || $.value.length === 0 ? [] : [
53
+ ...Y.value.map((e) => {
54
+ const r = $.value.find((n) => n.id === e.category);
55
+ return {
56
+ name: ee(a, B, e.name, "other"),
57
+ categoryId: (r == null ? void 0 : r.id) ?? "",
58
+ category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
59
+ reportId: e.id,
60
+ editable: e.editable,
61
+ description: e.description || "",
62
+ pin: !0,
63
+ canUpdate: le(e),
64
+ canRead: ne(e),
65
+ isSupportPos: !!e.isSupportPos,
66
+ isPosSupportConfigurable: e.isPosSupportConfigurable !== !1,
67
+ reportType: e.reportType
68
+ };
69
+ }),
70
+ ...ce.value.map((e) => {
71
+ const r = $.value.find((n) => n.id === e.category);
72
+ return {
73
+ name: ee(a, B, e.name, "other"),
74
+ categoryId: (r == null ? void 0 : r.id) ?? "",
75
+ category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
76
+ reportId: e.id,
77
+ editable: e.editable,
78
+ description: e.description || "",
79
+ pin: !1,
80
+ canUpdate: le(e),
81
+ canRead: ne(e),
82
+ isSupportPos: !!e.isSupportPos,
83
+ isPosSupportConfigurable: e.isPosSupportConfigurable !== !1,
84
+ reportType: e.reportType
85
+ };
86
+ })
87
+ ].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(G.value.toLowerCase()) !== -1)), _e = R(
88
+ () => I.value.map((o) => `${o.name}${o.category}`).toString()
89
+ ), $e = R(() => [
90
+ {
91
+ accessorKey: "name",
92
+ header: a("report.common.name"),
93
+ enableSorting: !1,
94
+ cell: (o) => {
95
+ const e = o.row.original;
96
+ return f(
97
+ "span",
98
+ { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
99
+ o.getValue()
100
+ );
101
+ }
102
+ },
103
+ {
104
+ accessorKey: "category",
105
+ header: a("report.common.category"),
106
+ enableSorting: !1,
107
+ meta: {
108
+ width: "100px"
109
+ },
110
+ cell: (o) => f(
111
+ j,
112
+ {
113
+ // grey out chip text when user cannot read report
114
+ class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${o.row.original.canRead ? "" : "opacity-40 cursor-not-allowed"} fm-typo-en-body-sm-600`,
115
+ compact: !0
116
+ },
117
+ { default: () => o.getValue() }
118
+ )
119
+ },
120
+ {
121
+ accessorKey: "description",
122
+ header: a("report.common.description"),
123
+ enableSorting: !1,
124
+ cell: (o) => {
125
+ const e = o.row.original;
126
+ return f(
127
+ "span",
128
+ { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
129
+ o.getValue()
130
+ );
131
+ }
132
+ },
133
+ {
134
+ accessorKey: "",
135
+ id: "Action",
136
+ header: a("report.common.actions"),
137
+ meta: {
138
+ width: "140px"
139
+ },
140
+ cell: (o) => {
141
+ var m;
142
+ const e = o.row.original, r = e.reportId, n = d.value.find((g) => g.id === r), X = r === ((m = E.value) == null ? void 0 : m.id), T = !e.canRead, D = n ? ie(n) : !1, A = n ? M(n) : !1, s = !e.canUpdate || !e.isPosSupportConfigurable || v.value.has(r), P = e.isPosSupportConfigurable ? a("reportV5.reportList.posV8Hint") : a("reportV5.reportList.mandatoryPosReportHint"), c = [
143
+ {
144
+ label: a("report.common.duplicate"),
145
+ onClick: () => {
146
+ n && D ? ve(n) : D || l.open({
147
+ message: a("report.messages.noPermissionDuplicateReport"),
148
+ type: "error"
149
+ });
150
+ },
151
+ variant: "",
152
+ disabled: !D
153
+ },
154
+ {
155
+ label: a(X ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
156
+ onClick: async () => {
157
+ n && de(n);
158
+ },
159
+ variant: "",
160
+ disabled: !1
161
+ },
162
+ {
163
+ label: a("report.common.remove"),
164
+ onClick: () => {
165
+ n && (A ? fe(n) : l.open({
166
+ message: a("report.messages.noPermissionDeleteReport"),
167
+ type: "error"
168
+ }));
169
+ },
170
+ variant: "destructive",
171
+ disabled: !e.editable || !A
172
+ }
173
+ ];
174
+ return f(
175
+ "div",
176
+ {
177
+ class: `flex ${p.value.lg || p.value.md ? "justify-end" : ""} items-center`
178
+ },
179
+ {
180
+ default: () => [
181
+ f(
182
+ De,
183
+ { content: P, placement: "bottom", zIndex: 2e3 },
184
+ {
185
+ default: () => f(pe, {
186
+ modelValue: e.isSupportPos,
187
+ disabled: s,
188
+ "aria-label": a("report.common.showInPOS"),
189
+ class: "mr-2 scale-75",
190
+ "onUpdate:modelValue": () => {
191
+ n && me(n);
192
+ },
193
+ onClick: ge(() => {
194
+ }, ["stop"])
195
+ })
196
+ }
197
+ ),
198
+ f(
199
+ "button",
200
+ {
201
+ disabled: T,
202
+ title: T ? a("report.messages.noPermission") : void 0,
203
+ onClick: ge(() => {
204
+ n && ye(n);
205
+ }, ["stop"]),
206
+ class: `text-fm-color-neutral-gray-400 ${e.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
207
+ },
208
+ {
209
+ default: () => [
210
+ f(
211
+ H,
212
+ {
213
+ name: "keep",
214
+ class: "px-12 p-8",
215
+ outline: !e.pin,
216
+ size: "md"
217
+ },
218
+ {}
219
+ )
220
+ ]
221
+ }
222
+ ),
223
+ f(
224
+ q,
225
+ {
226
+ stopClickPropagation: !0,
227
+ shift: !0,
228
+ disabled: !1
229
+ },
230
+ {
231
+ default: () => c.map(
232
+ (g) => f(
233
+ w,
234
+ {
235
+ onClick: g.disabled ? {} : g.onClick,
236
+ label: g.label,
237
+ class: g.disabled ? "text-fm-color-typo-disabled" : g.variant === "destructive" ? "text-fm-color-typo-error" : "",
238
+ disabled: g.disabled
239
+ },
240
+ {
241
+ label: () => f("p", g.label)
242
+ }
243
+ )
244
+ ),
245
+ "menu-button": () => f(
246
+ xe,
247
+ {
248
+ variant: "tertiary",
249
+ size: "md",
250
+ icon: "more_vert",
251
+ iconColor: Ge.NeutralGray400,
252
+ disabled: !1
253
+ },
254
+ {}
255
+ )
256
+ }
257
+ )
258
+ ]
259
+ }
260
+ );
261
+ }
262
+ }
263
+ ]);
264
+ async function de(o) {
265
+ await K(async () => {
266
+ var e;
267
+ try {
268
+ const r = o.id === ((e = E.value) == null ? void 0 : e.id);
269
+ await b.updateDefaultReport(r ? null : o.id), l.open({
270
+ message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
271
+ type: "success"
272
+ });
273
+ } catch (r) {
274
+ l.open({ message: JSON.stringify(r), type: "error" });
275
+ }
276
+ });
277
+ }
278
+ async function me(o) {
279
+ if (!v.value.has(o.id)) {
280
+ v.value = new Set(v.value).add(o.id);
281
+ try {
282
+ const e = !o.isSupportPos;
283
+ await Ee(o.id, e), o.isSupportPos = e;
284
+ } catch (e) {
285
+ console.log(e), l.open({
286
+ message: a("report.messages.failedToAction", { action: a("report.common.update") }),
287
+ type: "error"
288
+ });
289
+ } finally {
290
+ const e = new Set(v.value);
291
+ e.delete(o.id), v.value = e;
292
+ }
293
+ }
294
+ }
295
+ async function Oe(o) {
296
+ if (await re({
297
+ title: a("report.common.duplicate"),
298
+ message: a("report.messages.confirmAction", {
299
+ action: a("report.common.duplicate"),
300
+ name: o.name
301
+ })
302
+ })) {
303
+ const r = JSON.parse(JSON.stringify(o));
304
+ r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, K(async () => {
305
+ try {
306
+ await b.createOrUpdateReport(r), l.open({
307
+ message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
308
+ type: "success"
309
+ });
310
+ } catch (n) {
311
+ l.open({ message: JSON.stringify(n), type: "error" });
312
+ }
313
+ });
314
+ }
315
+ }
316
+ function Q(o) {
317
+ const e = d.value.find((r) => r.id === o.reportId);
318
+ return !e || !ie(e);
319
+ }
320
+ function W(o) {
321
+ const e = d.value.find((r) => r.id === o.reportId);
322
+ return !o.editable || !e || !M(e);
323
+ }
324
+ async function fe(o) {
325
+ if (!M(o)) {
326
+ l.open({
327
+ message: a("report.messages.noPermissionDeleteReport"),
328
+ type: "error"
329
+ });
330
+ return;
331
+ }
332
+ await re({
333
+ title: a("report.messages.deleteReport"),
334
+ message: a("report.messages.confirmDelete", { name: o.name })
335
+ }) && K(async () => {
336
+ try {
337
+ await b.removeReport(o), l.open({
338
+ message: a("report.messages.deleteSuccess", { name: o.name }),
339
+ type: "success"
340
+ });
341
+ } catch (r) {
342
+ l.open({ message: JSON.stringify(r), type: "error" });
343
+ }
344
+ });
345
+ }
346
+ async function ve(o) {
347
+ if (se.value)
348
+ await Oe(o);
349
+ else {
350
+ let e = `Your current plan only support up to ${F.value} custom reports.`;
351
+ F.value === 0 && (e = "Your current plan does not support custom report."), l.open({
352
+ message: e,
353
+ type: "error"
354
+ });
355
+ }
356
+ }
357
+ function Fe() {
358
+ if (!ke.value) {
359
+ l.open({
360
+ message: a("report.messages.noPermission"),
361
+ type: "error"
362
+ });
363
+ return;
364
+ }
365
+ if (se.value)
366
+ Pe.value = !0;
367
+ else {
368
+ let o = `Your current plan only support up to ${F.value} custom reports.`;
369
+ F.value === 0 && (o = "Your current plan does not support custom report."), l.open({
370
+ message: o,
371
+ type: "error"
372
+ });
373
+ }
374
+ }
375
+ function ye(o) {
376
+ const e = ee(a, B, o.name, "other") ?? "";
377
+ O.value && O.value.includes(o.id) ? (l.open({
378
+ message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
379
+ type: "success"
380
+ }), b.clearPinReport(o.id)) : (l.open({
381
+ message: `${a("report.common.pin")} ${e} ${a("report.common.successful")}`,
382
+ type: "success"
383
+ }), b.cachePinReport(o));
384
+ }
385
+ function Le(o) {
386
+ L.value = o;
387
+ }
388
+ const { selectedLocationIds: x, dateRange: V, compareDateRange: N, timeRange: S, locations: Ve } = we(), U = R(() => x.length === Ve.length);
389
+ return (o, e) => {
390
+ const r = k("FmPageHead"), n = k("FmSearch"), X = k("FmForm"), T = k("FmListItem"), D = k("FmList"), A = k("FmTable");
391
+ return J(), Z(Ke, null, {
392
+ default: u(() => [
393
+ i(r, {
394
+ title: t(a)("report.common.report", 1),
395
+ class: "h-[68px]",
396
+ actions: [
397
+ {
398
+ label: `${t(a)("report.view.report.add")}`,
399
+ value: "add",
400
+ isPrimary: !0,
401
+ prependIcon: "add"
402
+ }
403
+ ],
404
+ "onClick:action": e[0] || (e[0] = (s) => Fe())
405
+ }, null, 8, ["title", "actions"]),
406
+ C("div", {
407
+ class: y(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
408
+ style: Ue({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
409
+ }, [
410
+ i(X, {
411
+ class: y(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
412
+ }, {
413
+ default: u(() => [
414
+ i(t(q), null, {
415
+ "menu-button": u(() => [
416
+ i(t(j), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
417
+ default: u(() => [
418
+ C("p", null, _(t(a)(`report.category.${L.value.label}`)), 1),
419
+ i(t(H), { name: "expand_more" })
420
+ ]),
421
+ _: 1
422
+ })
423
+ ]),
424
+ default: u(() => [
425
+ (J(!0), Te(Ae, null, ze(ue.value, (s, P) => (J(), Z(t(w), {
426
+ key: P,
427
+ label: t(a)(`report.category.${s.label}`),
428
+ onClick: () => Le(s)
429
+ }, null, 8, ["label", "onClick"]))), 128))
430
+ ]),
431
+ _: 1
432
+ }),
433
+ C("div", {
434
+ class: y(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
435
+ }, [
436
+ C("p", at, _(t(a)("report.common.results", { count: I.value.length })), 1)
437
+ ], 2),
438
+ e[3] || (e[3] = C("div", { class: "grow" }, null, -1)),
439
+ C("div", st, [
440
+ i(n, {
441
+ modelValue: G.value,
442
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => G.value = s),
443
+ class: y(`${t(p).lg || t(p).md ? "grow" : ""}`)
444
+ }, null, 8, ["modelValue", "class"])
445
+ ])
446
+ ]),
447
+ _: 1
448
+ }, 8, ["class"]),
449
+ Se((J(), Z(A, {
450
+ key: _e.value,
451
+ ref_key: "table",
452
+ ref: h,
453
+ class: y([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
454
+ style: { height: "calc(100% - 40px)" },
455
+ "column-defs": $e.value,
456
+ "row-data": I.value,
457
+ "page-size": I.value.length,
458
+ "hide-footer": !0,
459
+ "row-class-name": "row",
460
+ onRowClick: e[2] || (e[2] = (s) => {
461
+ if (!s.original.canRead) {
462
+ t(l).open({
463
+ message: t(a)("report.messages.noPermission"),
464
+ type: "error"
465
+ });
466
+ return;
467
+ }
468
+ t(Re).suppressReportRouteSync = !0, t(b).updateCurrentReportId(s.original.reportId), t(te).push({
469
+ name: "reportView",
470
+ query: {
471
+ ...t(oe).query,
472
+ reportId: s.original.reportId,
473
+ startDate: t(V).startDate,
474
+ endDate: t(V).endDate,
475
+ compareStartDate: t(N).startDate,
476
+ compareEndDate: t(N).endDate,
477
+ timeStart: t(S).start ? JSON.stringify(t(S).start) : null,
478
+ timeEnd: t(S).end ? JSON.stringify(t(S).end) : null,
479
+ isAllLocation: U.value.toString(),
480
+ locationIds: U.value ? void 0 : t(x) ? JSON.stringify(t(x)) : void 0
481
+ }
482
+ });
483
+ })
484
+ }, {
485
+ "list-row": u(({ original: s }) => [
486
+ i(D, {
487
+ onClick: () => {
488
+ if (!s.canRead) {
489
+ t(l).open({
490
+ message: t(a)("report.messages.noPermission"),
491
+ type: "error"
492
+ });
493
+ return;
494
+ }
495
+ s.reportId && (t(b).updateCurrentReportId(s.reportId), t(te).push({
496
+ name: "reportView",
497
+ query: {
498
+ ...t(oe).query,
499
+ reportId: s.reportId,
500
+ startDate: t(V).startDate,
501
+ endDate: t(V).endDate,
502
+ compareStartDate: t(N).startDate,
503
+ compareEndDate: t(N).endDate,
504
+ timeStart: t(S).start ? JSON.stringify(t(S).start) : null,
505
+ timeEnd: t(S).end ? JSON.stringify(t(S).end) : null,
506
+ isAllLocation: U.value.toString(),
507
+ locationIds: U.value ? void 0 : t(x) ? JSON.stringify(t(x)) : void 0
508
+ }
509
+ }));
510
+ }
511
+ }, {
512
+ default: u(() => [
513
+ i(T, {
514
+ tag: "label",
515
+ clickable: ""
516
+ }, {
517
+ append: u(() => [
518
+ i(t(j), {
519
+ class: y(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
520
+ compact: !0
521
+ }, {
522
+ default: u(() => [
523
+ C("p", rt, _(s.category), 1)
524
+ ]),
525
+ _: 2
526
+ }, 1032, ["class"]),
527
+ i(t(q), {
528
+ placement: "left",
529
+ "stop-click-propagation": !0
530
+ }, {
531
+ "menu-button": u(() => [
532
+ i(t(H), {
533
+ name: "more_vert",
534
+ class: "btn-color"
535
+ })
536
+ ]),
537
+ default: u(() => {
538
+ var P;
539
+ return [
540
+ i(t(w), {
541
+ label: s.pin ? "Unpin" : "Pin",
542
+ onClick: () => {
543
+ const c = t(d).find(
544
+ (m) => m.id === s.reportId
545
+ );
546
+ c && ye(c);
547
+ }
548
+ }, null, 8, ["label", "onClick"]),
549
+ i(t(w), {
550
+ label: t(a)("report.common.showInPOS"),
551
+ disabled: !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
552
+ "aria-disabled": !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
553
+ class: y(
554
+ !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId) ? "text-fm-color-typo-disabled" : ""
555
+ ),
556
+ onClick: () => {
557
+ if (!s.canUpdate) {
558
+ t(l).open({
559
+ message: t(a)("report.messages.noPermissionUpdateReport"),
560
+ type: "error"
561
+ });
562
+ return;
563
+ }
564
+ const c = t(d).find(
565
+ (m) => m.id === s.reportId
566
+ );
567
+ c && me(c);
568
+ }
569
+ }, {
570
+ append: u(() => [
571
+ i(t(pe), {
572
+ "model-value": s.isSupportPos,
573
+ disabled: !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
574
+ "aria-label": "Show in POS v8",
575
+ class: "pointer-events-none"
576
+ }, null, 8, ["model-value", "disabled"])
577
+ ]),
578
+ _: 2
579
+ }, 1032, ["label", "disabled", "aria-disabled", "class", "onClick"]),
580
+ i(t(w), {
581
+ label: t(a)("report.common.duplicate"),
582
+ disabled: Q(s),
583
+ class: y(
584
+ Q(s) ? "text-fm-color-typo-disabled" : ""
585
+ ),
586
+ onClick: () => {
587
+ const c = t(d).find(
588
+ (m) => m.id === s.reportId
589
+ );
590
+ c && !Q(s) ? ve(c) : t(l).open({
591
+ message: t(a)("report.messages.noPermissionDuplicateReport"),
592
+ type: "error"
593
+ });
594
+ }
595
+ }, null, 8, ["label", "disabled", "class", "onClick"]),
596
+ i(t(w), {
597
+ label: t(a)(
598
+ s.reportId === ((P = t(E)) == null ? void 0 : P.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
599
+ ),
600
+ onClick: () => {
601
+ const c = t(d).find(
602
+ (m) => m.id === s.reportId
603
+ );
604
+ c && de(c);
605
+ }
606
+ }, null, 8, ["label", "onClick"]),
607
+ i(t(w), {
608
+ label: t(a)("report.common.delete"),
609
+ disabled: W(s),
610
+ class: y(
611
+ W(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
612
+ ),
613
+ onClick: () => {
614
+ const c = t(d).find(
615
+ (m) => m.id === s.reportId
616
+ );
617
+ c && !W(s) && fe(c);
618
+ }
619
+ }, {
620
+ label: u(() => [
621
+ Je(_(t(a)("report.common.delete")), 1)
622
+ ]),
623
+ _: 2
624
+ }, 1032, ["label", "disabled", "class", "onClick"])
625
+ ];
626
+ }),
627
+ _: 2
628
+ }, 1024)
629
+ ]),
630
+ default: u(() => [
631
+ C("span", {
632
+ class: y(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
633
+ }, _(s.name), 3)
634
+ ]),
635
+ _: 2
636
+ }, 1024)
637
+ ]),
638
+ _: 2
639
+ }, 1032, ["onClick"])
640
+ ]),
641
+ _: 1
642
+ }, 8, ["class", "column-defs", "row-data", "page-size"])), [
643
+ [Ce, I.value.length > 0]
644
+ ]),
645
+ Se(i(Qe, null, null, 512), [
646
+ [Ce, I.value.length === 0]
647
+ ])
648
+ ], 6)
649
+ ]),
650
+ _: 1
651
+ });
652
+ };
653
+ }
654
+ });
655
+ export {
656
+ St as default
657
+ };
@@ -2,9 +2,9 @@ import { ref as q, shallowRef as en, onMounted as W, onBeforeUnmount as tn, defi
2
2
  import { useRoute as cn } from "vue-router";
3
3
  import { u as ln } from "./_plugin-vue_export-helper-C6QDExPN.js";
4
4
  import { storeToRefs as N } from "pinia";
5
- import { _ as un } from "./LocationSelect.vue_vue_type_script_setup_true_lang-R13mIsrh.js";
6
- import { D as fn } from "./DateRangeSelect-BcFNAiP2.js";
7
- import { F as B, r as D, u as G, a as X, a0 as mn } from "./app-z-voggLY.js";
5
+ import { _ as un } from "./LocationSelect.vue_vue_type_script_setup_true_lang-Bv4_DVSD.js";
6
+ import { D as fn } from "./DateRangeSelect-j_1JPSHY.js";
7
+ import { F as B, r as D, u as G, a as X, a0 as mn } from "./app-DCn4N0uO.js";
8
8
  function $(r) {
9
9
  const { businessId: c } = N(G());
10
10
  if (!c.value) throw new Error("Business Id is not defined");