@feedmepos/mf-report 5.22.12 → 5.22.13-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{App-DDzVhXL7.js → App-Ci4TNGo-.js} +40 -40
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BZlvMBPW.js → BaseDialog.vue_vue_type_script_setup_true_lang-N4p0t07m.js} +3 -3
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-BM-li0d3.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-GTlzuFQB.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-BuFLfame.js → Default.vue_vue_type_script_setup_true_lang-COOzNYD3.js} +2 -2
  5. package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-BoX6fRDT.js → FilterSelector.vue_vue_type_script_setup_true_lang-lO1-P1LC.js} +6 -6
  6. package/dist/{InsightView-DBmUbSlP.js → InsightView-waXZnisb.js} +6 -6
  7. package/dist/{Integration-BDC13WLh.js → Integration-Dn9Ivqfx.js} +36 -35
  8. package/dist/{Integrations-C6gWnyhy.js → Integrations-B56QpwNs.js} +7 -6
  9. package/dist/{Layout-DbHEONpc.js → Layout-ydTDzEg9.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-G9CiV2LK.js → MenuTab.vue_vue_type_script_setup_true_lang-Bqbrinds.js} +5 -5
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-D9-002wn.js → NavigationTab.vue_vue_type_script_setup_true_lang-Cpa9H1ZR.js} +5 -5
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CdGpZdFx.js → NoData.vue_vue_type_script_setup_true_lang-C7GXgBKq.js} +1 -1
  13. package/dist/{OverviewView-B0dWJYNP.js → OverviewView-Y-KB6M-1.js} +5 -5
  14. package/dist/{Report-QeJVzX13.js → Report-DvSjPfbV.js} +202 -177
  15. package/dist/{ReportEditor-LupGO1_l.js → ReportEditor-Dj-pof8I.js} +6 -6
  16. package/dist/ReportView-DH8tcg-Q.js +265 -0
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-DMMP43KF.js → SelectComponent.vue_vue_type_script_setup_true_lang-DY50WPYu.js} +1 -1
  18. package/dist/{Setting-Dv-Eo5IX.js → Setting-Do5JShD8.js} +5 -5
  19. package/dist/{TileEditor-ZqOV5_Le.js → TileEditor-Do0x54jE.js} +8 -8
  20. package/dist/{TransitionFade-CsoI1XtQ.js → TransitionFade-lS2nSDyF.js} +6 -6
  21. package/dist/{useRestaurantPermission-8zTUt56b.js → access-Dw5cDt65-CQ5PE5GD.js} +386 -388
  22. package/dist/{app-Du0ALyx7.js → app-wKEwqUHq.js} +56 -36
  23. package/dist/app.js +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/useReportPermission-CRkYtDX0.js +60 -0
  26. package/dist/useRestaurantPermission-3Sf0GSc7.js +65 -0
  27. package/dist/{vue-i18n-kHBFKu4C.js → vue-i18n-wKxo3TA6.js} +7 -7
  28. package/package.json +2 -2
  29. package/dist/ReportView-BMgXES5v.js +0 -250
@@ -1,250 +0,0 @@
1
- import { defineComponent as te, ref as y, computed as p, watch as J, onMounted as re, onUnmounted as ae, resolveComponent as ne, createBlock as k, openBlock as d, withCtx as se, createVNode as B, createElementVNode as N, unref as a, normalizeStyle as le, normalizeClass as T, createElementBlock as q, Fragment as ie, renderList as ue } from "vue";
2
- import { _ as ce } from "./MenuTab.vue_vue_type_script_setup_true_lang-G9CiV2LK.js";
3
- import { _ as pe } from "./FilterSelector.vue_vue_type_script_setup_true_lang-BoX6fRDT.js";
4
- import { useRouter as me, useRoute as de } from "vue-router";
5
- import { _ as ve } from "./Default.vue_vue_type_script_setup_true_lang-BuFLfame.js";
6
- import { a as fe, s as ge } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BZlvMBPW.js";
7
- import { storeToRefs as b } from "pinia";
8
- import { b as ye, c as be, u as _e, g as we } from "./NavigationTab.vue_vue_type_script_setup_true_lang-D9-002wn.js";
9
- import { _ as Se } from "./NoData.vue_vue_type_script_setup_true_lang-CdGpZdFx.js";
10
- import { useSnackbar as ke, useBreakpoints as he } from "@feedmepos/ui-library";
11
- import { u as Ce, e as xe, d as Re } from "./vue-i18n-kHBFKu4C.js";
12
- import { u as Oe } from "./message-dialog-UoMWOnil.js";
13
- import { r as Pe } from "./i18n-CI_sQ5d_.js";
14
- import { _ as De } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DMMP43KF.js";
15
- const Ie = /* @__PURE__ */ te({
16
- __name: "ReportView",
17
- setup($e) {
18
- const { t: o, te: L } = Ce(), _ = me(), v = de(), i = ke(), { promptMessage: V } = Oe(), m = fe(), h = ye(), { promptLoader: w } = xe(), { breakpoints: s } = he(), { isOpenAccountingDialog: j } = b(be()), { isOpenScheduleDialog: C } = b(_e()), { disabled: x } = b(Re()), f = y(null), F = y(0), R = y(0);
19
- let u = null;
20
- const O = y(null), P = p(() => {
21
- var e;
22
- return ((e = O.value) == null ? void 0 : e.reportId) === c.value;
23
- }), H = p(
24
- () => {
25
- var e;
26
- return !!((e = t.value) != null && e.isSupportPos);
27
- }
28
- ), {
29
- currentReport: t,
30
- overviewReport: M,
31
- currentReportId: c,
32
- isOpenDownloadDialog: U,
33
- isOpenEmailDialog: Y,
34
- editingReport: z,
35
- canCreateCustomReport: G,
36
- customReportQuota: D
37
- } = b(m);
38
- J(f, (e) => {
39
- u == null || u.disconnect(), e && (u = new ResizeObserver(() => {
40
- S();
41
- }), u.observe(e), S());
42
- }), J(
43
- () => c.value,
44
- async () => O.value = await we(c.value),
45
- { immediate: !0 }
46
- ), re(() => {
47
- S();
48
- }), ae(() => {
49
- u == null || u.disconnect();
50
- });
51
- function S() {
52
- if (f.value) {
53
- const e = f.value.getBoundingClientRect();
54
- F.value = e.height, R.value = e.bottom;
55
- }
56
- }
57
- const Q = p(() => s.value.xs || s.value.sm ? 1 : R.value), W = p(() => {
58
- var l;
59
- const e = c.value === ((l = M.value) == null ? void 0 : l.id), r = [
60
- {
61
- icon: "mail",
62
- label: o("report.common.emailSchedule"),
63
- onClick: () => {
64
- C.value = !0;
65
- }
66
- },
67
- {
68
- icon: "article",
69
- label: o(e ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
70
- onClick: async () => {
71
- await w(async () => {
72
- if (t.value)
73
- try {
74
- await m.updateDefaultReport(e ? null : t.value.id), i.open({
75
- message: `Successfully ${e ? "unset" : "set"} ${t.value.name} as Overview`,
76
- type: "success"
77
- });
78
- } catch (g) {
79
- i.open({ message: JSON.stringify(g), type: "error" });
80
- }
81
- });
82
- }
83
- },
84
- {
85
- icon: "content_copy",
86
- label: o("report.common.copyID"),
87
- onClick: () => {
88
- t.value && (navigator.clipboard.writeText(c.value), i.open({ message: o("report.messages.copiedReportIdToClipboard"), type: "success" }));
89
- }
90
- },
91
- {
92
- icon: "report_jobs",
93
- label: o("report.common.reportStatus"),
94
- onClick: () => {
95
- I();
96
- }
97
- }
98
- ];
99
- return !x.value && P.value && r.splice(1, 0, {
100
- icon: "download",
101
- label: o("report.common.accountingExport"),
102
- onClick: $
103
- }), r;
104
- });
105
- async function I() {
106
- h.isOpenJobDialog = !0, await h.getJobs();
107
- }
108
- function K() {
109
- z.value = JSON.parse(JSON.stringify(t.value)), _.push({
110
- name: "reportEditor",
111
- query: v.query
112
- });
113
- }
114
- async function X() {
115
- if (!G.value) {
116
- let r = `Your current plan only support up to ${D.value} custom reports.`;
117
- D.value === 0 && (r = "Your current plan does not support custom report."), i.open({
118
- message: r,
119
- type: "error"
120
- });
121
- return;
122
- }
123
- if (!t.value) {
124
- i.open({ message: "No Widget", type: "error" });
125
- return;
126
- }
127
- if (await V({
128
- title: `${o("report.messages.saveReport")}`,
129
- message: o("report.messages.confirmAction", {
130
- action: o("report.common.duplicate"),
131
- name: t.value.name
132
- })
133
- }) && t.value) {
134
- const r = JSON.parse(JSON.stringify(t.value));
135
- r.editable = !0, r.id = "", r.name = `${r.name} duplicate`;
136
- try {
137
- await w(async () => {
138
- const l = await m.createOrUpdateReport(r);
139
- m.updateCurrentReportId(l.id), _.push({
140
- name: "reportView",
141
- params: v.params,
142
- query: v.query
143
- });
144
- });
145
- } catch (l) {
146
- console.log(l), i.open({ message: "Failed to clone report", type: "error" });
147
- }
148
- }
149
- }
150
- function $() {
151
- j.value = !0;
152
- }
153
- function Z() {
154
- t.value && (navigator.clipboard.writeText(c.value), i.open({ message: "Copied report ID to clipboard", type: "success" }));
155
- }
156
- async function ee() {
157
- if (t.value)
158
- try {
159
- await w(async () => {
160
- await ge(c.value, !H.value), await m.getReports();
161
- });
162
- } catch (e) {
163
- console.log(e), i.open({ message: o("report.messages.failedToAction", { action: o("report.common.update") }), type: "error" });
164
- }
165
- }
166
- const E = p(() => t.value ? t.value.tiles : []), oe = p(() => {
167
- var r;
168
- let e = [
169
- // TODO: In future once decided to support report showing configuration for POS,
170
- // uncomment this:
171
- // {
172
- // label: t("report.common.showInPOS"),
173
- // value: "show_in_pos",
174
- // isPrimary: false,
175
- // appendIcon: isCurrentReportShownInPOS.value
176
- // ? "radio_button_checked"
177
- // : "radio_button_unchecked"
178
- // },
179
- (r = t == null ? void 0 : t.value) != null && r.editable ? { label: o("report.common.edit"), value: "edit", isPrimary: !1 } : {
180
- label: o("report.common.duplicate"),
181
- value: "duplicate",
182
- isPrimary: !1
183
- },
184
- {
185
- label: o("report.common.download"),
186
- value: "download",
187
- isPrimary: !0,
188
- prependIcon: "download"
189
- },
190
- { label: o("report.schedule.sendEmail"), value: "email", isPrimary: !0 }
191
- ];
192
- return s.value.xs && (e = [
193
- ...e,
194
- { label: o("report.schedule.sendEmail"), value: "email", isPrimary: !1 },
195
- { label: o("report.common.reportStatus"), value: "report_jobs", isPrimary: !1 },
196
- { label: o("report.common.emailSchedule"), value: "schedule_email", isPrimary: !1 },
197
- { label: o("report.common.copyID"), value: "content_copy", isPrimary: !1 }
198
- ], !x.value && P.value && e.push({ label: o("report.common.accountingExport"), value: "export", isPrimary: !1 }), e = e.filter((l) => l.value !== "edit")), e;
199
- });
200
- return (e, r) => {
201
- const l = ne("FmPageHead");
202
- return d(), k(ve, null, {
203
- default: se(() => {
204
- var g;
205
- return [
206
- B(l, {
207
- title: a(Pe)(a(o), a(L), (g = a(t)) == null ? void 0 : g.name, "other"),
208
- "back-button": !0,
209
- actions: oe.value,
210
- "onClick:back": r[0] || (r[0] = (n) => a(_).push({ name: "reports", query: a(v).query })),
211
- "onClick:action": r[1] || (r[1] = (n) => {
212
- n === "show_in_pos" && ee(), n === "duplicate" && X(), n === "download" && (U.value = !0), n === "email" && (Y.value = !0), n === "edit" && K(), n === "schedule_email" && (C.value = !0), n === "content_copy" && Z(), n === "export" && $(), n === "report_jobs" && I();
213
- }),
214
- class: "remove-line-clamping"
215
- }, null, 8, ["title", "actions"]),
216
- N("div", {
217
- class: T(`flex flex-col overflow-y-auto ${a(s).xs || a(s).sm ? "pb-20" : ""}`),
218
- style: le({ height: `calc(100% - ${a(s).lg || a(s).md ? 72 : 64}px)` })
219
- }, [
220
- N("div", {
221
- ref_key: "menuTabRef",
222
- ref: f,
223
- class: "sticky top-0 z-10 bg-white"
224
- }, [
225
- B(ce, {
226
- "model-value": a(s).lg || a(s).md ? W.value : []
227
- }, null, 8, ["model-value"])
228
- ], 512),
229
- a(t) && E.value.length > 0 ? (d(), q("div", {
230
- key: 0,
231
- class: T(["grid grid-cols-12", a(s).sm || a(s).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
232
- }, [
233
- (d(!0), q(ie, null, ue(E.value, (n, A) => (d(), k(pe, {
234
- key: `widget_${a(c)}_${A}`,
235
- "model-value": n,
236
- index: A,
237
- "sticky-header-offset": Q.value
238
- }, null, 8, ["model-value", "index", "sticky-header-offset"]))), 128))
239
- ], 2)) : (d(), k(Se, { key: 1 }))
240
- ], 6)
241
- ];
242
- }),
243
- _: 1
244
- });
245
- };
246
- }
247
- }), Ye = /* @__PURE__ */ De(Ie, [["__scopeId", "data-v-57161c29"]]);
248
- export {
249
- Ye as default
250
- };