@feedmepos/mf-report 5.18.2-beta.0 → 5.18.2-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 (19) hide show
  1. package/dist/App-2aEdytBx.js +157 -0
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BrHd550j.js → BaseDialog.vue_vue_type_script_setup_true_lang-djyc20Cp.js} +58 -58
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-4V19EFBP.js → Default.vue_vue_type_script_setup_true_lang-DpSgAipe.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-B75aeM0i.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DKA5lLXB.js} +1 -1
  5. package/dist/{InsightView-DCIgjpGL.js → InsightView-CxCeRQ-P.js} +2 -2
  6. package/dist/{Layout-Dco__bZI.js → Layout-B2cpQx3C.js} +1 -1
  7. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BJM6sKQU.js → MenuTab.vue_vue_type_script_setup_true_lang-C8oiHuOX.js} +2 -2
  8. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-4v9iLIA2.js → NavigationTab.vue_vue_type_script_setup_true_lang-CDxb2Mjg.js} +1 -1
  9. package/dist/{OverviewView-CUPsimnH.js → OverviewView-D8mA0P3y.js} +4 -4
  10. package/dist/{Report-BljRc1xi.js → Report-Cg9Fen7g.js} +2 -2
  11. package/dist/{ReportEditor-DgAWdCZe.js → ReportEditor-Db1Ll1hk.js} +183 -182
  12. package/dist/ReportView-BQb_myNM.js +246 -0
  13. package/dist/{Setting-BciZnr8l.js → Setting-BxLdkt7x.js} +2 -2
  14. package/dist/{TileEditor-DgawblCV.js → TileEditor-DbbSibJa.js} +3 -3
  15. package/dist/{TransitionFade-1tV8-j1Z.js → TransitionFade-CiVLb7cy.js} +2 -2
  16. package/dist/app.js +9 -9
  17. package/package.json +1 -1
  18. package/dist/App-Cts_hjbs.js +0 -157
  19. package/dist/ReportView-CMRcpoTz.js +0 -252
@@ -1,252 +0,0 @@
1
- import { defineComponent as ee, computed as c, watch as J, resolveComponent as te, createBlock as _, openBlock as y, withCtx as ae, createVNode as E, createElementVNode as L, unref as n, normalizeStyle as re, normalizeClass as N, createElementBlock as $, Fragment as oe, renderList as ne } from "vue";
2
- import { _ as ie } from "./MenuTab.vue_vue_type_script_setup_true_lang-BJM6sKQU.js";
3
- import { _ as se } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-B75aeM0i.js";
4
- import { useRouter as le, useRoute as ue } from "vue-router";
5
- import { _ as ce } from "./Default.vue_vue_type_script_setup_true_lang-4V19EFBP.js";
6
- import { a as de } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BrHd550j.js";
7
- import { storeToRefs as I } from "pinia";
8
- import { b as pe, c as me, u as fe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-4v9iLIA2.js";
9
- import { _ as ge } from "./NoData.vue_vue_type_script_setup_true_lang-Divo8W18.js";
10
- import { useSnackbar as ye, useBreakpoints as ve } from "@feedmepos/ui-library";
11
- import { u as De, b as Se, f as be, d, e as Re } from "./vue-i18n-CTLGxUiF.js";
12
- import { u as Ie } from "./message-dialog-UoMWOnil.js";
13
- import { r as _e } from "./i18n-Cif1I9J2.js";
14
- const qe = { class: "sticky top-0 z-10 bg-white" }, Ae = /* @__PURE__ */ ee({
15
- __name: "ReportView",
16
- setup(Ce) {
17
- const { t: i, te: P } = De(), v = le(), e = ue(), m = ye(), { promptMessage: M } = Ie(), f = de(), q = pe(), l = Se(), { promptLoader: A } = be(), { breakpoints: u } = ve(), {
18
- currentReport: o,
19
- currentReportId: C,
20
- isOpenDownloadDialog: T,
21
- isOpenEmailDialog: F,
22
- editingReport: j,
23
- canCreateCustomReport: B,
24
- customReportQuota: O
25
- } = I(f), D = c(() => e.query.reportId || C.value), S = c(() => ({
26
- startDate: e.query.startDate ? d(e.query.startDate).startOf("day").toISOString() : void 0,
27
- endDate: e.query.endDate ? d(e.query.endDate).endOf("day").toISOString() : void 0
28
- })), b = c(() => ({
29
- startDate: e.query.compareStartDate ? d(e.query.compareStartDate).startOf("day").toISOString() : void 0,
30
- endDate: e.query.compareEndDate ? d(e.query.compareEndDate).endOf("day").toISOString() : void 0
31
- })), R = c(() => ({
32
- start: e.query.timeStart ? JSON.parse(e.query.timeStart) : void 0,
33
- end: e.query.timeEnd ? JSON.parse(e.query.timeEnd) : void 0
34
- })), k = c(() => e.query.isAllLocation === "true"), Q = c(() => k.value ? l.selectedLocationIds : e.query.locationIds ? JSON.parse(e.query.locationIds) : void 0);
35
- J(
36
- () => f.reports.length,
37
- (a) => {
38
- if (a > 0) {
39
- const t = e.query.reportId;
40
- t && t !== C.value && (f.updateCurrentReportId(t), (S.value.startDate || S.value.endDate) && l.setDateRange({
41
- startDate: S.value.startDate,
42
- endDate: S.value.endDate
43
- }), (b.value.startDate || b.value.endDate) && l.setCompareDateRange({
44
- startDate: b.value.startDate,
45
- endDate: b.value.endDate
46
- }), (R.value.start || R.value.end) && l.setTimeRange({
47
- start: R.value.start,
48
- end: R.value.end
49
- }), k.value || l.setSelectedLocationIds(Q.value));
50
- }
51
- },
52
- { immediate: !0 }
53
- ), J(
54
- () => ({
55
- selectedLocationIds: l.selectedLocationIds,
56
- dateRange: l.dateRange,
57
- timeRange: l.timeRange,
58
- compareDateRange: l.compareDateRange
59
- }),
60
- (a) => {
61
- const t = a.selectedLocationIds, s = a.dateRange, p = a.timeRange, r = a.compareDateRange;
62
- if (!o.value) return;
63
- const g = {
64
- ...e.query,
65
- reportId: D.value,
66
- startDate: s.startDate ? d(s.startDate).format("YYYY-MM-DD") : void 0,
67
- endDate: s.endDate ? d(s.endDate).format("YYYY-MM-DD") : void 0,
68
- compareStartDate: r.startDate ? d(r.startDate).format("YYYY-MM-DD") : void 0,
69
- compareEndDate: r.endDate ? d(r.endDate).format("YYYY-MM-DD") : void 0,
70
- timeStart: p.start ? JSON.stringify(p.start) : void 0,
71
- timeEnd: p.end ? JSON.stringify(p.end) : void 0,
72
- locationIds: t.length === l.locations.length ? null : t.length > 0 ? JSON.stringify(t) : void 0,
73
- isAllLocation: String(t.length === l.locations.length)
74
- }, X = JSON.stringify(e.query), Z = JSON.stringify(g);
75
- X !== Z && v.replace({
76
- name: e.name,
77
- params: e.params,
78
- query: g
79
- });
80
- },
81
- { deep: !0 }
82
- );
83
- const { isOpenAccountingDialog: z } = I(me()), { isOpenScheduleDialog: w } = I(fe()), { disabled: H } = I(Re()), G = c(() => {
84
- const a = [
85
- {
86
- icon: "mail",
87
- label: i("report.common.emailSchedule"),
88
- onClick: () => {
89
- w.value = !0;
90
- }
91
- },
92
- // {
93
- // icon: "article",
94
- // label: "Set as Default",
95
- // onClick: async () => {
96
- // await promptLoader(async () => {
97
- // if (currentReport.value) {
98
- // try {
99
- // await reportStore.updateDefaultReport(currentReport.value.id)
100
- // snackbar.open({
101
- // message: `Set ${currentReport.value.name} as default successful`,
102
- // type: "success"
103
- // })
104
- // } catch (err) {
105
- // snackbar.open({ message: JSON.stringify(err), type: "error" })
106
- // }
107
- // }
108
- // })
109
- // }
110
- // },
111
- {
112
- icon: "content_copy",
113
- label: i("report.common.copyID"),
114
- onClick: () => {
115
- o.value && (navigator.clipboard.writeText(D.value), m.open({ message: i("report.messages.copiedReportIdToClipboard"), type: "success" }));
116
- }
117
- },
118
- {
119
- icon: "report_jobs",
120
- label: i("report.common.reportStatus"),
121
- onClick: () => {
122
- h();
123
- }
124
- }
125
- ];
126
- return H.value || a.splice(1, 0, {
127
- icon: "download",
128
- label: i("report.common.accountingExport"),
129
- onClick: x
130
- }), a;
131
- });
132
- async function h() {
133
- q.isOpenJobDialog = !0, await q.getJobs();
134
- }
135
- function U() {
136
- j.value = JSON.parse(JSON.stringify(o.value)), v.push({
137
- name: "reportEditor",
138
- query: e.query
139
- });
140
- }
141
- async function V() {
142
- if (!B.value) {
143
- let t = `Your current plan only support up to ${O.value} custom reports.`;
144
- O.value === 0 && (t = "Your current plan does not support custom report."), m.open({
145
- message: t,
146
- type: "error"
147
- });
148
- return;
149
- }
150
- if (!o.value) {
151
- m.open({ message: "No Widget", type: "error" });
152
- return;
153
- }
154
- if (await M({
155
- title: `${i("report.messages.saveReport")}`,
156
- message: i("report.messages.confirmAction", {
157
- action: i("report.common.duplicate"),
158
- name: o.value.name
159
- })
160
- }) && o.value) {
161
- const t = JSON.parse(JSON.stringify(o.value));
162
- t.editable = !0, t.id = "", t.name = `${t.name} duplicate`;
163
- try {
164
- await A(async () => {
165
- const s = await f.createOrUpdateReport(t);
166
- f.updateCurrentReportId(s.id), v.push({
167
- name: "reportView",
168
- params: { reportId: s.id, ...e.params },
169
- query: e.query
170
- });
171
- });
172
- } catch (s) {
173
- console.log(s), m.open({ message: "Failed to clone report", type: "error" });
174
- }
175
- }
176
- }
177
- function x() {
178
- z.value = !0;
179
- }
180
- function W() {
181
- o.value && (navigator.clipboard.writeText(D.value), m.open({ message: "Copied report ID to clipboard", type: "success" }));
182
- }
183
- const Y = c(() => o.value ? o.value.tiles : []), K = c(() => {
184
- var t;
185
- let a = [
186
- (t = o == null ? void 0 : o.value) != null && t.editable ? { label: i("report.common.edit"), value: "edit", isPrimary: !1 } : {
187
- label: i("report.common.duplicate"),
188
- value: "duplicate",
189
- isPrimary: !1
190
- },
191
- {
192
- label: i("report.common.download"),
193
- value: "download",
194
- isPrimary: !0,
195
- prependIcon: "download"
196
- },
197
- { label: i("report.schedule.sendEmail"), value: "email", isPrimary: !0 }
198
- ];
199
- return u.value.xs && (a = [
200
- ...a,
201
- { label: "Send Email", value: "email", isPrimary: !1 },
202
- { label: "Job Delivery Status", value: "report_jobs", isPrimary: !1 },
203
- { label: "Email schedule", value: "schedule_email", isPrimary: !1 },
204
- { label: "Accounting export", value: "export", isPrimary: !1 },
205
- { label: "Copy ID", value: "content_copy", isPrimary: !1 }
206
- ], a = a.filter((s) => s.value !== "edit")), a;
207
- });
208
- return (a, t) => {
209
- const s = te("FmPageHead");
210
- return y(), _(ce, null, {
211
- default: ae(() => {
212
- var p;
213
- return [
214
- E(s, {
215
- title: n(_e)(n(i), n(P), (p = n(o)) == null ? void 0 : p.name, "other"),
216
- "back-button": !0,
217
- actions: K.value,
218
- "onClick:back": t[0] || (t[0] = (r) => n(v).push({ name: "reports", query: n(e).query })),
219
- "onClick:action": t[1] || (t[1] = (r) => {
220
- r === "duplicate" && V(), r === "download" && (T.value = !0), r === "email" && (F.value = !0), r === "edit" && U(), r === "schedule_email" && (w.value = !0), r === "content_copy" && W(), r === "export" && x(), r === "report_jobs" && h();
221
- })
222
- }, null, 8, ["title", "actions"]),
223
- L("div", {
224
- class: N(`flex flex-col overflow-y-auto ${n(u).xs || n(u).sm ? "pb-20" : ""}`),
225
- style: re({ height: `calc(100% - ${n(u).lg || n(u).md ? 72 : 64}px)` })
226
- }, [
227
- L("div", qe, [
228
- E(ie, {
229
- "model-value": n(u).lg || n(u).md ? G.value : []
230
- }, null, 8, ["model-value"])
231
- ]),
232
- n(o) && Y.value.length > 0 ? (y(), $("div", {
233
- key: 0,
234
- class: N(["grid grid-cols-12", n(u).sm || n(u).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
235
- }, [
236
- (y(!0), $(oe, null, ne(Y.value, (r, g) => (y(), _(se, {
237
- key: `widget_${D.value}_${g}`,
238
- "model-value": r,
239
- index: g
240
- }, null, 8, ["model-value", "index"]))), 128))
241
- ], 2)) : (y(), _(ge, { key: 1 }))
242
- ], 6)
243
- ];
244
- }),
245
- _: 1
246
- });
247
- };
248
- }
249
- });
250
- export {
251
- Ae as default
252
- };