@feedmepos/mf-report 5.28.4-beta.4 → 5.28.4-beta.6

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