@feedmepos/mf-report 5.4.15-beta.1 → 5.4.15-beta.3

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 (45) hide show
  1. package/dist/App-DufL3Y8h.js +152 -0
  2. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DLDk5l4R.js +162 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-Bxuyjrkr.js → Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js} +2 -2
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js +999 -0
  5. package/dist/{InsightView-D78TK2E8.js → InsightView-tyeJBlRm.js} +1051 -1049
  6. package/dist/Integration-ILSIf-OL.js +3695 -0
  7. package/dist/Integrations-DwgNrM3U.js +334 -0
  8. package/dist/{Layout-DERpCrQk.js → Layout-Bw1oh6Q-.js} +1 -1
  9. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DurYBXa5.js → LocationSelect.vue_vue_type_script_setup_true_lang-BFj4d-UF.js} +1861 -1859
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DzZeasAK.js +277 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-C8yzWDXs.js → NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js} +5526 -5482
  12. package/dist/NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js +31 -0
  13. package/dist/OverviewView-Dl8oOobn.js +61 -0
  14. package/dist/Report-BqD8KVZ8.js +424 -0
  15. package/dist/ReportEditor-DkzFUgbO.js +532 -0
  16. package/dist/ReportView-DpWZHV0o.js +169 -0
  17. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-C3VG1mi_.js +104 -0
  18. package/dist/Setting-CYrg_50p.js +320 -0
  19. package/dist/TileEditor-CDrzLbqc.js +2320 -0
  20. package/dist/{TransitionFade-BLDfpF7R.js → TransitionFade-D19wC3tb.js} +225 -220
  21. package/dist/app.js +915 -27
  22. package/dist/{global-loader-CMC9fgBi.js → global-loader-C3JC7z-H.js} +4966 -2240
  23. package/dist/index-9IDzTnHw.js +147 -0
  24. package/dist/{report-schema-G0x3CoJb.js → report-schema-1zQJbLyB.js} +4 -4
  25. package/dist/style.css +1 -1
  26. package/dist/timeFormat-CjNvJMgk.js +9 -0
  27. package/dist/{v4-DF7wffYN.js → v4-D29FkHfi.js} +2666 -1927
  28. package/package.json +1 -1
  29. package/dist/App-mcSgbcVY.js +0 -133
  30. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DPuhMR6i.js +0 -160
  31. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B6IzlHmr.js +0 -996
  32. package/dist/HeaderTab.vue_vue_type_script_setup_true_lang-B5VBDNwX.js +0 -19
  33. package/dist/Integration-Cm6_YEEE.js +0 -3554
  34. package/dist/Integrations-WWnSho0Q.js +0 -334
  35. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-h87kWy1E.js +0 -261
  36. package/dist/NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js +0 -30
  37. package/dist/OverviewView-D7zAR7_7.js +0 -60
  38. package/dist/Report-BnX5amn0.js +0 -409
  39. package/dist/ReportEditor-DW7uWg_a.js +0 -530
  40. package/dist/ReportView-xSaJA5F6.js +0 -166
  41. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-DBI9op0g.js +0 -103
  42. package/dist/Setting-D8JspXTN.js +0 -326
  43. package/dist/TileEditor-DQ8C5I_M.js +0 -2301
  44. package/dist/index-SmIkb24L.js +0 -143
  45. package/dist/timeFormat-BF-F4Rnt.js +0 -9
@@ -1,409 +0,0 @@
1
- import { defineComponent as re, ref as N, watch as H, computed as k, resolveComponent as x, createBlock as P, openBlock as $, withCtx as i, createVNode as n, createElementVNode as y, normalizeStyle as se, normalizeClass as _, unref as l, withDirectives as z, createElementBlock as ie, Fragment as ce, renderList as ue, toDisplayString as O, h as p, createTextVNode as me, vShow as T, withModifiers as de } from "vue";
2
- import { storeToRefs as Q } from "pinia";
3
- import { a as pe } from "./v4-DF7wffYN.js";
4
- import { _ as fe } from "./Default.vue_vue_type_script_setup_true_lang-Bxuyjrkr.js";
5
- import { u as ve } from "./message-dialog-UoMWOnil.js";
6
- import { a as ye, d as be } from "./global-loader-CMC9fgBi.js";
7
- import { useSnackbar as ge, useBreakpoints as Ce, components as xe, FmButtonColorThemeVariant as _e } from "@feedmepos/ui-library";
8
- import { _ as he } from "./NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js";
9
- import { useRouter as ke, useRoute as we, onBeforeRouteLeave as Ie } from "vue-router";
10
- const Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = { class: "w-[343px]" }, Fe = { class: "fm-typo-en-body-md-600" }, Be = /* @__PURE__ */ re({
11
- __name: "Report",
12
- setup(Se) {
13
- const U = ke(), B = we(), m = pe(), { business: W } = Q(ye()), {
14
- reports: d,
15
- categories: w,
16
- pinReport: I,
17
- isOpenAddReportDialog: X,
18
- scrollPositionY: A,
19
- customReportQuota: M,
20
- canCreateCustomReport: Z
21
- } = Q(m), { promptMessage: q } = ve(), { promptLoader: J } = be(), f = ge(), { breakpoints: r } = Ce(), b = N();
22
- Ie(() => {
23
- b.value && (A.value = b.value.$el.children[0].scrollTop);
24
- }), H(b, () => {
25
- b.value && setTimeout(() => {
26
- b.value.$el.children[0].scrollTop = A.value;
27
- }, 200);
28
- });
29
- const F = k(() => I.value && d.value ? d.value.filter((t) => {
30
- var e;
31
- return (e = I.value) == null ? void 0 : e.includes(t.id);
32
- }) : []);
33
- H(
34
- [() => W.value],
35
- () => {
36
- m.refreshPinReport();
37
- },
38
- { immediate: !0 }
39
- );
40
- const K = k(() => F.value.length > 0 ? d.value.filter(
41
- (t) => F.value.findIndex((e) => e.id === t.id) === -1
42
- ) : d.value), { FmButton: ee, FmMenu: S, FmMenuItem: h, FmIcon: L, FmChip: D } = xe, j = k(() => [
43
- { value: void 0, label: "All" },
44
- ...w.value.map((t) => ({ value: t.id, label: t.name }))
45
- ]), v = N(j.value[0]), R = N(""), g = k(() => K.value.length === 0 || w.value.length === 0 ? [] : [
46
- ...F.value.map((e) => {
47
- const o = w.value.find((s) => s.id === e.category);
48
- return {
49
- name: e.name,
50
- categoryId: (o == null ? void 0 : o.id) ?? "",
51
- category: (o == null ? void 0 : o.name) || "Uncategorized",
52
- reportId: e.id,
53
- editable: e.editable,
54
- pin: !0
55
- };
56
- }).filter((e) => v.value.value && e.categoryId !== v.value.value ? !1 : e.name.toLowerCase().indexOf(R.value.toLowerCase()) !== -1),
57
- ...K.value.map((e) => {
58
- const o = w.value.find((s) => s.id === e.category);
59
- return {
60
- name: e.name,
61
- categoryId: (o == null ? void 0 : o.id) ?? "",
62
- category: (o == null ? void 0 : o.name) || "Uncategorized",
63
- reportId: e.id,
64
- editable: e.editable,
65
- pin: !1
66
- };
67
- }).filter((e) => v.value.value && e.categoryId !== v.value.value ? !1 : e.name.toLowerCase().indexOf(R.value.toLowerCase()) !== -1)
68
- ]), te = k(
69
- () => g.value.map((t) => `${t.name}${t.category}`).toString()
70
- ), le = [
71
- {
72
- accessorKey: "name",
73
- header: "Name",
74
- enableSorting: !1,
75
- cell: (t) => t.getValue()
76
- },
77
- {
78
- accessorKey: "category",
79
- header: "Category",
80
- enableSorting: !1,
81
- meta: {
82
- width: "200px"
83
- },
84
- cell: (t) => p(
85
- D,
86
- {
87
- class: `${t.getValue() !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} fm-typo-en-body-sm-600`,
88
- compact: !0
89
- },
90
- { default: () => t.getValue() }
91
- )
92
- },
93
- {
94
- accessorKey: "",
95
- id: "Action",
96
- header: "",
97
- meta: {
98
- width: "100px"
99
- },
100
- cell: (t) => {
101
- const e = t.row.original, o = e.reportId, s = d.value.find((c) => c.id === o), V = [
102
- {
103
- label: "Duplicate",
104
- onClick: () => {
105
- s && Y(s);
106
- },
107
- variant: "",
108
- disabled: !1
109
- },
110
- {
111
- label: "Remove",
112
- onClick: () => {
113
- s && E(s);
114
- },
115
- variant: "destructive",
116
- disabled: !e.editable
117
- }
118
- ];
119
- return p(
120
- "div",
121
- {
122
- class: `flex ${r.value.lg || r.value.md ? "justify-end" : ""} items-center`
123
- },
124
- {
125
- default: () => [
126
- p(
127
- "button",
128
- {
129
- onClick: de(() => {
130
- s && G(s);
131
- }, ["stop"]),
132
- class: `text-fm-color-neutral-gray-400 ${e.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
133
- },
134
- {
135
- default: () => [
136
- p(
137
- L,
138
- {
139
- name: "keep",
140
- class: "px-12 p-8",
141
- outline: !e.pin,
142
- size: "md"
143
- },
144
- {}
145
- )
146
- ]
147
- }
148
- ),
149
- p(
150
- S,
151
- { stopClickPropagation: !0, shift: !0 },
152
- {
153
- default: () => V.map(
154
- (c) => p(
155
- h,
156
- {
157
- onClick: c.disabled ? {} : c.onClick,
158
- label: c.label,
159
- class: c.disabled ? "text-fm-color-typo-disabled" : c.variant === "destructive" ? "text-fm-color-typo-error" : "",
160
- disabled: c.disabled
161
- },
162
- {
163
- label: () => p("p", c.label)
164
- }
165
- )
166
- ),
167
- "menu-button": () => p(
168
- ee,
169
- {
170
- variant: "tertiary",
171
- size: "md",
172
- icon: "more_vert",
173
- iconColor: _e.NeutralGray400
174
- },
175
- {}
176
- )
177
- }
178
- )
179
- ]
180
- }
181
- );
182
- }
183
- }
184
- ];
185
- async function Y(t) {
186
- if (await q({
187
- title: "Duplicate report",
188
- message: `Confirm duplicate ${t.name} ?`
189
- })) {
190
- const o = JSON.parse(JSON.stringify(t));
191
- o.editable = !0, o.id = "", o.name = `${o.name} duplicate`, J(async () => {
192
- try {
193
- await m.createOrUpdateReport(o), f.open({ message: `Duplicate ${o.name} successful`, type: "success" });
194
- } catch (s) {
195
- f.open({ message: JSON.stringify(s), type: "error" });
196
- }
197
- });
198
- }
199
- }
200
- async function E(t) {
201
- await q({
202
- title: "Delete report",
203
- message: `Confirm delete ${t.name} ?`
204
- }) && J(async () => {
205
- try {
206
- await m.removeReport(t), f.open({ message: `Delete ${t.name} successful`, type: "success" });
207
- } catch (o) {
208
- f.open({ message: JSON.stringify(o), type: "error" });
209
- }
210
- });
211
- }
212
- function oe() {
213
- if (Z.value)
214
- X.value = !0;
215
- else {
216
- let t = `Your current plan only support up to ${M.value} custom reports.`;
217
- M.value === 0 && (t = "Your current plan does not support custom report."), f.open({
218
- message: t,
219
- type: "error"
220
- });
221
- }
222
- }
223
- function G(t) {
224
- I.value && I.value.includes(t.id) ? (f.open({ message: `Unpin ${t.name} successful`, type: "success" }), m.clearPinReport(t.id)) : (f.open({ message: `Pin ${t.name} successful`, type: "success" }), m.cachePinReport(t));
225
- }
226
- return (t, e) => {
227
- const o = x("FmPageHead"), s = x("FmSearch"), V = x("FmForm"), c = x("FmListItem"), ae = x("FmList"), ne = x("FmTable");
228
- return $(), P(fe, null, {
229
- default: i(() => [
230
- n(o, {
231
- title: "Reports",
232
- class: "h-[68px]",
233
- actions: [
234
- {
235
- label: "Add report",
236
- value: "add",
237
- isPrimary: !0,
238
- prependIcon: "add"
239
- }
240
- ],
241
- "onClick:action": e[0] || (e[0] = (a) => oe())
242
- }),
243
- y("div", {
244
- class: _(`overflow-y-hidden flex flex-col gap-8 ${l(r).sm || l(r).xs ? "mb-20" : ""}`),
245
- style: se({ height: `calc(100% - ${l(r).lg || l(r).md ? 72 : 64}px)` })
246
- }, [
247
- n(V, {
248
- class: _(`flex items-center gap-2 ${l(r).sm || l(r).xs ? "px-3" : "px-24"}`)
249
- }, {
250
- default: i(() => [
251
- n(l(S), null, {
252
- "menu-button": i(() => [
253
- n(l(D), {
254
- label: v.value.label,
255
- class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400"
256
- }, {
257
- default: i(() => [
258
- y("p", null, O(v.value.label), 1),
259
- n(l(L), { name: "expand_more" })
260
- ]),
261
- _: 1
262
- }, 8, ["label"])
263
- ]),
264
- default: i(() => [
265
- ($(!0), ie(ce, null, ue(j.value, (a, u) => ($(), P(l(h), {
266
- key: u,
267
- label: a.label,
268
- onClick: (C) => v.value = a
269
- }, null, 8, ["label", "onClick"]))), 128))
270
- ]),
271
- _: 1
272
- }),
273
- y("div", {
274
- class: _(`flex ${l(r).sm || l(r).xs ? "justify-center items-center" : ""}`)
275
- }, [
276
- y("p", Re, O(g.value.length) + " results ", 1)
277
- ], 2),
278
- e[3] || (e[3] = y("div", { class: "grow" }, null, -1)),
279
- y("div", $e, [
280
- n(s, {
281
- modelValue: R.value,
282
- "onUpdate:modelValue": e[1] || (e[1] = (a) => R.value = a),
283
- class: _(`${l(r).lg || l(r).md ? "grow" : ""}`)
284
- }, null, 8, ["modelValue", "class"])
285
- ])
286
- ]),
287
- _: 1
288
- }, 8, ["class"]),
289
- z(($(), P(ne, {
290
- key: te.value,
291
- ref_key: "table",
292
- ref: b,
293
- class: _([l(r).sm || l(r).xs ? "px-0" : "px-24", "report-table"]),
294
- style: { height: "calc(100% - 40px)" },
295
- "column-defs": le,
296
- "row-data": g.value,
297
- "page-size": g.value.length,
298
- "hide-footer": !0,
299
- "row-class-name": "row",
300
- onRowClick: e[2] || (e[2] = (a) => {
301
- l(m).updateCurrentReportId(a.original.reportId), l(U).push({
302
- name: "reportView",
303
- query: l(B).query
304
- });
305
- })
306
- }, {
307
- "list-row": i(({ original: a }) => [
308
- n(ae, {
309
- onClick: () => {
310
- a.reportId && (l(m).updateCurrentReportId(a.reportId), l(U).push({
311
- name: "reportView",
312
- query: l(B).query
313
- }));
314
- }
315
- }, {
316
- default: i(() => [
317
- n(c, {
318
- tag: "label",
319
- label: a.name,
320
- clickable: ""
321
- }, {
322
- append: i(() => [
323
- n(l(D), {
324
- class: _(
325
- a.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
326
- ),
327
- compact: !0
328
- }, {
329
- default: i(() => [
330
- y("p", Fe, O(a.category), 1)
331
- ]),
332
- _: 2
333
- }, 1032, ["class"]),
334
- n(l(S), {
335
- placement: "left",
336
- "stop-click-propagation": !0
337
- }, {
338
- "menu-button": i(() => [
339
- n(l(L), {
340
- name: "more_vert",
341
- class: "btn-color"
342
- })
343
- ]),
344
- default: i(() => [
345
- n(l(h), {
346
- label: a.pin ? "Unpin" : "Pin",
347
- onClick: () => {
348
- const u = l(d).find(
349
- (C) => C.id === a.reportId
350
- );
351
- u && G(u);
352
- }
353
- }, null, 8, ["label", "onClick"]),
354
- n(l(h), {
355
- label: "Duplicate",
356
- onClick: () => {
357
- const u = l(d).find(
358
- (C) => C.id === a.reportId
359
- );
360
- u && Y(u);
361
- }
362
- }, null, 8, ["onClick"]),
363
- z(n(l(h), {
364
- label: "Delete",
365
- class: "text-fm-color-typo-error",
366
- onClick: () => {
367
- const u = l(d).find(
368
- (C) => C.id === a.reportId
369
- );
370
- u && E(u);
371
- }
372
- }, {
373
- label: i(() => e[4] || (e[4] = [
374
- me(" Delete ")
375
- ])),
376
- _: 2
377
- }, 1032, ["onClick"]), [
378
- [T, a.editable]
379
- ])
380
- ]),
381
- _: 2
382
- }, 1024)
383
- ]),
384
- _: 2
385
- }, 1032, ["label"])
386
- ]),
387
- _: 2
388
- }, 1032, ["onClick"])
389
- ]),
390
- _: 1
391
- }, 8, ["class", "row-data", "page-size"])), [
392
- [T, g.value.length > 0]
393
- ]),
394
- z(n(he, {
395
- title: "No report",
396
- "sub-title": "No report can be found"
397
- }, null, 512), [
398
- [T, g.value.length === 0]
399
- ])
400
- ], 6)
401
- ]),
402
- _: 1
403
- });
404
- };
405
- }
406
- });
407
- export {
408
- Be as default
409
- };