@feedmepos/mf-report 5.28.4-beta.3 → 5.28.4-beta.5

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