@feedmepos/mf-report 5.25.7 → 5.25.8

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-DVBc1rc0.js +302 -0
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-r5JrwnWY.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BRmKJJvc.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-D9MR-Tyr.js → Default.vue_vue_type_script_setup_true_lang-BUtavZIl.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D3zN3tqo.js → DynamicWidget.vue_vue_type_script_setup_true_lang-OIREDq6T.js} +1549 -1563
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ds2Rd7nK.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-ZAOWE1vp.js} +3263 -3161
  6. package/dist/{InsightView-CLkhmik2.js → InsightView-DctjGEzr.js} +5 -5
  7. package/dist/{Integration-BLjTOunk.js → Integration-CRd2_O5E.js} +3 -3
  8. package/dist/{Integrations-C_htzgLO.js → Integrations-CpMUHiCw.js} +3 -3
  9. package/dist/{Layout-B9AfrRso.js → Layout-DSXNbHHe.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-1G6ZNWRO.js → MenuTab.vue_vue_type_script_setup_true_lang-YjXH8vPq.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CBYyjcaw.js → NavigationTab.vue_vue_type_script_setup_true_lang-Ck7HaJRh.js} +4 -4
  12. package/dist/{OverviewView-CGen9md5.js → OverviewView-CLICdzyH.js} +5 -5
  13. package/dist/{Report-CujIJ861.js → Report-BvGQUoQF.js} +4 -4
  14. package/dist/{ReportEditor-cI0knIcX.js → ReportEditor-CIV7Sd_d.js} +4 -4
  15. package/dist/ReportView-ClTsRfJG.js +309 -0
  16. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Af_Z54a4.js → SelectComponent.vue_vue_type_script_setup_true_lang-BL1jpiXN.js} +2 -2
  17. package/dist/{Setting-C_mFfeHY.js → Setting-BYtSIDjs.js} +4 -4
  18. package/dist/Template-BVGvD8vx.js +482 -0
  19. package/dist/{TileEditor-Ra6Pw4Hb.js → TileEditor-n1lS7iNk.js} +274 -282
  20. package/dist/{TransitionFade-BjG4BHLj.js → TransitionFade-Dfm-zjeX.js} +5 -5
  21. package/dist/{app-CYlbtwt9.js → app-DMXIz8ol.js} +2693 -2360
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-BzuADGYi.js → formatChartData.worker-BlVUDagT.js} +15 -11
  24. package/dist/assets/{processTableData.worker-DTnbVu-a.js → processTableData.worker-CQMw9rvu.js} +15 -11
  25. package/dist/style.css +1 -1
  26. package/dist/{useRestaurantPermission-BoIwOw0q.js → useRestaurantPermission-DV3xL5r9.js} +1 -1
  27. package/package.json +1 -1
  28. package/dist/App-BMj1o_t6.js +0 -298
  29. package/dist/ReportView-BNCAume3.js +0 -264
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .glassmorphism{background:linear-gradient(135deg,#fffffff5,#fffffff5);box-shadow:0 8px 24px #0f172a2e}.chart-legend-text[data-v-a258ca90]{color:var(--legend-text-color);font-size:var(--legend-font-size)}.chart-legend-list[data-v-a258ca90]{scrollbar-width:none;-ms-overflow-style:none}.chart-legend-list[data-v-a258ca90]::-webkit-scrollbar{display:none;width:0;height:0}.circular{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;padding:0;width:var(--chart-width);height:var(--chart-height)}.circular .flex-col.gap-8{gap:0!important}.circular .fm-color-typo-primary:empty,.circular .fm-color-typo-secondary:empty{display:none}.circular .grow{height:100%}.sparkline{margin:0;padding:0}.sparkline .grow{height:50px;flex-grow:0}.scrollbar-hide-table>div{scrollbar-width:thin}.bar-chart{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;padding:0;width:var(--chart-width);height:var(--chart-height)}.bar-chart .grow{height:100%}.bar-chart .flex-col{gap:0}.widget-content{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}.chart-layout{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0}.chart-layout--side{flex-direction:row;align-items:stretch;gap:0;min-height:0}.line-chart{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;margin:0;padding:8px 0 0;width:var(--chart-width);height:var(--chart-height)}.line-chart .grow{height:100%}.line-chart .flex-col{gap:0}.card-container[data-v-818eab25]{overflow-y:auto;overflow-x:hidden}.fm-progress-linear-custom span[data-v-2f6d52e6]{width:auto;height:100%;position:absolute;display:inline-block;top:0;left:0}.fm-progress-linear-custom span.dash-1[data-v-2f6d52e6]{left:-35%;animation:progress-linear-dash-1-2f6d52e6 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.fm-progress-linear-custom span.dash-2[data-v-2f6d52e6]{left:100%;animation:progress-linear-dash-2-2f6d52e6 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite}@keyframes progress-linear-dash-1-2f6d52e6{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes progress-linear-dash-2-2f6d52e6{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes shimmer-2f6d52e6{0%{transform:translate(-100%)}to{transform:translate(400%)}}.progress-bar-fill[data-v-2f6d52e6]{position:relative;overflow:hidden}.progress-bar-fill[data-v-2f6d52e6]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;width:50%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.12) 30%,rgba(255,255,255,.28) 50%,rgba(255,255,255,.12) 70%,transparent 100%);animation:shimmer-2f6d52e6 1.5s infinite linear}.show-pin{visibility:hidden}.row:hover .show-pin{visibility:visible}.icon-btn{border-radius:100%}.overlay{background:#0006;position:absolute;top:0;left:0;height:100vh;width:100vw}.side-panel{position:fixed;right:0;top:0;height:100%;background:#fff}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease}.fade-enter-from,.fade-leave-to{opacity:0}.slide-enter-active,.slide-leave-active{transition:all .3s ease-out}.slide-enter-from,.slide-leave-to{transform:translate(100%)}.remove-line-clamping[data-v-8fe2479c] .line-clamp-1,.remove-line-clamping[data-v-8fe2479c] .line-clamp-2{display:block!important;-webkit-line-clamp:unset!important;line-clamp:unset!important;-webkit-box-orient:unset!important;overflow:visible!important;white-space:normal!important}.remove-line-clamping[data-v-8fe2479c] .flex.flex-col.flex-grow{min-width:0}.remove-line-clamping[data-v-8fe2479c] .cursor-pointer.flex.items-center.justify-center.relative{min-width:0;max-width:100%;overflow:hidden}.selected-widget[data-v-0535b07b]{background-color:#fff4e6;border-color:#ff7823}.slide-fade-enter-active[data-v-fa67a3a4],.slide-fade-leave-active[data-v-fa67a3a4]{transition:all .3s ease-in-out}.slide-fade-enter-from[data-v-fa67a3a4],.slide-fade-leave-to[data-v-fa67a3a4]{transform:translateY(-50px);opacity:0}.slide-fade-right-enter-active[data-v-a98ca9bc],.slide-fade-right-leave-active[data-v-a98ca9bc]{transition:all .3s ease-in-out}.slide-fade-right-enter-from[data-v-a98ca9bc],.slide-fade-right-leave-to[data-v-a98ca9bc]{position:absolute;transform:translate(-50px);opacity:.4}.slide-fade-left-enter-active[data-v-a98ca9bc]{transition-delay:.3s;transition:all .3s ease-in-out}.slide-fade-left-leave-active[data-v-a98ca9bc]{transition:all .3s ease-in-out}.slide-fade-left-enter-from[data-v-a98ca9bc],.slide-fade-left-leave-to[data-v-a98ca9bc]{position:absolute;transform:translate(-50px);opacity:.1}.toggleEditResize{border:2px dashed #3b82f6!important;position:relative}th:hover,td:hover{cursor:default}.col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:10}.highlight-hover-col,.highlight-col{border-right:2px solid #3b82f6!important}.row-resize-handle{position:absolute;bottom:0;left:0;width:100%;height:6px;cursor:row-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:10}.highlight-hover-row,.highlight-row{border-bottom:2px solid #3b82f6!important}.legend-color-input[data-v-0f6af12a]{-moz-appearance:none;appearance:none;-webkit-appearance:none;width:40px;height:24px;border:0;background:transparent;padding:0}.legend-color-input[data-v-0f6af12a]::-webkit-color-swatch-wrapper{padding:0}.legend-color-input[data-v-0f6af12a]::-webkit-color-swatch{border:1px solid rgb(var(--fm-color-neutral-gray-200));border-radius:4px}.legend-color-input[data-v-0f6af12a]::-moz-color-swatch{border:1px solid rgb(var(--fm-color-neutral-gray-200));border-radius:4px}.line-style-icon[data-v-f1c35513]{width:28px;border-top:2px solid currentColor;color:rgb(var(--fm-color-neutral-gray-300));flex-shrink:0}.line-style-icon--solid[data-v-f1c35513]{border-top-style:solid}.line-style-icon--dashed[data-v-f1c35513]{border-top-style:dashed}.line-style-icon--dotted[data-v-f1c35513]{border-top-style:dotted}.fm-top-sheet{height:100%}.integration-card[data-v-60c3aea9]{height:140px;width:140px;padding:0}.integration-card .logo-card[data-v-60c3aea9]{width:100%;padding:24px;background:#fff}.integration-card .title-card[data-v-60c3aea9]{height:36px;color:#fff}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}
1
+ .glassmorphism{background:linear-gradient(135deg,#fffffff5,#fffffff5);box-shadow:0 8px 24px #0f172a2e}.chart-legend-text[data-v-a258ca90]{color:var(--legend-text-color);font-size:var(--legend-font-size)}.chart-legend-list[data-v-a258ca90]{scrollbar-width:none;-ms-overflow-style:none}.chart-legend-list[data-v-a258ca90]::-webkit-scrollbar{display:none;width:0;height:0}.circular{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;padding:0;width:var(--chart-width);height:var(--chart-height)}.circular .flex-col.gap-8{gap:0!important}.circular .fm-color-typo-primary:empty,.circular .fm-color-typo-secondary:empty{display:none}.circular .grow{height:100%}.sparkline{margin:0;padding:0}.sparkline .grow{height:50px;flex-grow:0}.scrollbar-hide-table>div{scrollbar-width:thin}.bar-chart{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;padding:0;width:var(--chart-width);height:var(--chart-height)}.bar-chart .grow{height:100%}.bar-chart .flex-col{gap:0}.widget-content{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}.chart-layout{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0}.chart-layout--side{flex-direction:row;align-items:stretch;gap:0;min-height:0}.line-chart{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;overflow:hidden;margin:0;padding:8px 0 0;width:var(--chart-width);height:var(--chart-height)}.line-chart .grow{height:100%}.line-chart .flex-col{gap:0}.card-container[data-v-818eab25]{overflow-y:auto;overflow-x:hidden}.fm-progress-linear-custom span[data-v-2f6d52e6]{width:auto;height:100%;position:absolute;display:inline-block;top:0;left:0}.fm-progress-linear-custom span.dash-1[data-v-2f6d52e6]{left:-35%;animation:progress-linear-dash-1-2f6d52e6 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.fm-progress-linear-custom span.dash-2[data-v-2f6d52e6]{left:100%;animation:progress-linear-dash-2-2f6d52e6 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite}@keyframes progress-linear-dash-1-2f6d52e6{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes progress-linear-dash-2-2f6d52e6{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes shimmer-2f6d52e6{0%{transform:translate(-100%)}to{transform:translate(400%)}}.progress-bar-fill[data-v-2f6d52e6]{position:relative;overflow:hidden}.progress-bar-fill[data-v-2f6d52e6]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;width:50%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.12) 30%,rgba(255,255,255,.28) 50%,rgba(255,255,255,.12) 70%,transparent 100%);animation:shimmer-2f6d52e6 1.5s infinite linear}.show-pin{visibility:hidden}.row:hover .show-pin,.row:hover .show-actions{visibility:visible}.icon-btn{border-radius:100%}.overlay{background:#0006;position:absolute;top:0;left:0;height:100vh;width:100vw}.side-panel{position:fixed;right:0;top:0;height:100%;background:#fff}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease}.fade-enter-from,.fade-leave-to{opacity:0}.slide-enter-active,.slide-leave-active{transition:all .3s ease-out}.slide-enter-from,.slide-leave-to{transform:translate(100%)}.remove-line-clamping[data-v-0e7efa03] .line-clamp-1,.remove-line-clamping[data-v-0e7efa03] .line-clamp-2{display:block!important;-webkit-line-clamp:unset!important;line-clamp:unset!important;-webkit-box-orient:unset!important;overflow:visible!important;white-space:normal!important}.remove-line-clamping[data-v-0e7efa03] .flex.flex-col.flex-grow{min-width:0}.remove-line-clamping[data-v-0e7efa03] .cursor-pointer.flex.items-center.justify-center.relative{min-width:0;max-width:100%;overflow:hidden}.selected-widget[data-v-0535b07b]{background-color:#fff4e6;border-color:#ff7823}.slide-fade-enter-active[data-v-fa67a3a4],.slide-fade-leave-active[data-v-fa67a3a4]{transition:all .3s ease-in-out}.slide-fade-enter-from[data-v-fa67a3a4],.slide-fade-leave-to[data-v-fa67a3a4]{transform:translateY(-50px);opacity:0}.slide-fade-right-enter-active[data-v-a98ca9bc],.slide-fade-right-leave-active[data-v-a98ca9bc]{transition:all .3s ease-in-out}.slide-fade-right-enter-from[data-v-a98ca9bc],.slide-fade-right-leave-to[data-v-a98ca9bc]{position:absolute;transform:translate(-50px);opacity:.4}.slide-fade-left-enter-active[data-v-a98ca9bc]{transition-delay:.3s;transition:all .3s ease-in-out}.slide-fade-left-leave-active[data-v-a98ca9bc]{transition:all .3s ease-in-out}.slide-fade-left-enter-from[data-v-a98ca9bc],.slide-fade-left-leave-to[data-v-a98ca9bc]{position:absolute;transform:translate(-50px);opacity:.1}.toggleEditResize{border:2px dashed #3b82f6!important;position:relative}th:hover,td:hover{cursor:default}.col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:10}.highlight-hover-col,.highlight-col{border-right:2px solid #3b82f6!important}.row-resize-handle{position:absolute;bottom:0;left:0;width:100%;height:6px;cursor:row-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:10}.highlight-hover-row,.highlight-row{border-bottom:2px solid #3b82f6!important}.legend-color-input[data-v-0e072961]{-moz-appearance:none;appearance:none;-webkit-appearance:none;width:40px;height:24px;border:0;background:transparent;padding:0}.legend-color-input[data-v-0e072961]::-webkit-color-swatch-wrapper{padding:0}.legend-color-input[data-v-0e072961]::-webkit-color-swatch{border:1px solid rgb(var(--fm-color-neutral-gray-200));border-radius:4px}.legend-color-input[data-v-0e072961]::-moz-color-swatch{border:1px solid rgb(var(--fm-color-neutral-gray-200));border-radius:4px}.line-style-icon[data-v-f1c35513]{width:28px;border-top:2px solid currentColor;color:rgb(var(--fm-color-neutral-gray-300));flex-shrink:0}.line-style-icon--solid[data-v-f1c35513]{border-top-style:solid}.line-style-icon--dashed[data-v-f1c35513]{border-top-style:dashed}.line-style-icon--dotted[data-v-f1c35513]{border-top-style:dotted}.fm-top-sheet{height:100%}.integration-card[data-v-60c3aea9]{height:140px;width:140px;padding:0}.integration-card .logo-card[data-v-60c3aea9]{width:100%;padding:24px;background:#fff}.integration-card .title-card[data-v-60c3aea9]{height:36px;color:#fff}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
2
2
  import { u as c } from "./vue-i18n-DVWuTfed.js";
3
3
  import { useSnackbar as f } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as d } from "@feedmepos/mf-common";
5
- import { V as l, W as i } from "./app-CYlbtwt9.js";
5
+ import { V as l, W as i } from "./app-DMXIz8ol.js";
6
6
  function g(t) {
7
7
  return Array.isArray(t) ? t : [];
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.25.7",
3
+ "version": "5.25.8",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,298 +0,0 @@
1
- import { defineComponent as ue, resolveComponent as H, createBlock as de, openBlock as A, unref as d, isRef as Ee, withCtx as P, createElementVNode as ne, createVNode as X, toDisplayString as oe, createTextVNode as ke, onMounted as le, watch as C, ref as J, computed as re, onBeforeMount as Te, onBeforeUnmount as Ne, createElementBlock as G, Fragment as $e } from "vue";
2
- import { detectLocale as Q, useCoreStore as K } from "@feedmepos/mf-common";
3
- import { d as u, u as Be, a as ae, b as Fe, c as se, e as qe, f as xe, s as Je, t as W } from "./app-CYlbtwt9.js";
4
- import { storeToRefs as E } from "pinia";
5
- import { u as Qe, a as Ue } from "./vue-i18n-DVWuTfed.js";
6
- import { u as je, a as ze } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ds2Rd7nK.js";
7
- import { u as Ve, _ as Pe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CBYyjcaw.js";
8
- import { u as ie } from "./message-dialog-UoMWOnil.js";
9
- import { useRoute as Ge, useRouter as Ke } from "vue-router";
10
- const We = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, He = /* @__PURE__ */ ue({
11
- __name: "Dialog",
12
- setup(k) {
13
- const { t: c } = Qe(), p = ie(), { isOpened: g, message: _, title: L } = E(ie());
14
- return (O, I) => {
15
- const T = H("FmButton"), U = H("FmDialog");
16
- return A(), de(U, {
17
- modelValue: d(g),
18
- "onUpdate:modelValue": I[0] || (I[0] = (j) => Ee(g) ? g.value = j : null),
19
- overlay: "",
20
- "close-button": !1
21
- }, {
22
- "dialog-header": P(() => [
23
- ke(oe(d(L)), 1)
24
- ]),
25
- default: P(() => [
26
- ne("p", We, oe(d(_)), 1)
27
- ]),
28
- "dialog-footer": P(() => [
29
- I[1] || (I[1] = ne("div", { class: "grow" }, null, -1)),
30
- X(T, {
31
- label: d(c)("report.common.cancel"),
32
- variant: "tertiary",
33
- onClick: d(p).dismiss
34
- }, null, 8, ["label", "onClick"]),
35
- X(T, {
36
- label: d(c)("report.common.confirm"),
37
- onClick: d(p).confirm
38
- }, null, 8, ["label", "onClick"])
39
- ]),
40
- _: 1
41
- }, 8, ["modelValue"]);
42
- };
43
- }
44
- }), ce = J(Q());
45
- function Xe() {
46
- const k = (c) => {
47
- switch (ce.value = c, c) {
48
- case "zh-CN":
49
- u.locale("zh-cn");
50
- break;
51
- default:
52
- u.locale("en");
53
- break;
54
- }
55
- };
56
- return le(() => {
57
- k(Q());
58
- }), C(() => Q(), k, { deep: !0, immediate: !0 }), {
59
- currentLocale: ce
60
- };
61
- }
62
- u.locale(Q() === "zh-CN" ? "zh-cn" : "en");
63
- const Ye = ["src"], Ze = ["src"], lt = /* @__PURE__ */ ue({
64
- __name: "App",
65
- setup(k) {
66
- const { businessId: c, token: p, country: g } = E(Be()), { sessionUser: _, currentBusiness: L, currentCountry: O, registerSidebarComponent: I } = K(), { getRestaurantAndWarehouse: T, getBusinessSetting: U, beginBusinessLoad: j, completeBusinessLoad: fe } = ae(), { getFeatureFlags: me } = Fe(), { version: v } = E(se()), { getSettings: pe } = qe(), { promptLoader: ge } = Ue(), s = Ge(), z = Ke(), w = je(), Y = Ve(), a = ae(), N = se(), { suppressReportRouteSync: $ } = E(N), { getReports: ve, getOverviewReport: ye, getReportConfig: Se, currentReportId: Z } = w, { currentReportId: De, reports: Ie } = E(w), { getSchema: he } = ze(), { fetchSchedules: Re } = Y, { init: _e } = xe(), V = J("v5"), B = J(!1), F = J(!0), Le = re(() => `https://portal-v1.feedme.cc/b/${c.value}/report/CLOSE_UP?showHeader=false&country=${g.value.toUpperCase()}&menuOption=business-report&token=${p.value}&v2=true&reportV5Button=true`), Oe = re(() => `https://report-v4.feedme.cc?businessId=${c.value}&country=${g.value}&token=${p.value}&reportV3Button=true`);
67
- C(
68
- [() => L.value, () => _.value, () => O.value],
69
- () => {
70
- var e, n;
71
- const t = ((e = L.value) == null ? void 0 : e.id) ?? "";
72
- L.value && _.value && O.value && (Je(O.value), c.value !== t && (c.value = t), p.value = ((n = _.value) == null ? void 0 : n.token) ?? "", g.value = O.value ?? "");
73
- },
74
- { immediate: !0 }
75
- );
76
- function M(t) {
77
- if (typeof t.data == "string")
78
- try {
79
- const e = JSON.parse(t.data);
80
- (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (p.value = e.token);
81
- } catch (e) {
82
- console.error(e);
83
- }
84
- }
85
- function ee(t) {
86
- if (typeof t.data == "string")
87
- try {
88
- const e = JSON.parse(t.data);
89
- (e == null ? void 0 : e.v5) === !0 ? v.value = V.value : (e == null ? void 0 : e.v3) === !0 && (v.value = "v3");
90
- } catch (e) {
91
- console.error(e);
92
- }
93
- }
94
- C(v, () => {
95
- ["v3", "v4"].includes(v.value) ? K().hideSidebarToggle(!0) : K().hideSidebarToggle(!1);
96
- }), Te(() => {
97
- I(Pe);
98
- }), le(() => {
99
- console.log("5.25.7", !0), window.addEventListener("message", M), window.addEventListener("message", ee);
100
- }), Ne(() => {
101
- window.removeEventListener("message", M), window.removeEventListener("message", ee), w.$dispose(), Y.$dispose();
102
- });
103
- function we(t) {
104
- try {
105
- return decodeURIComponent(t);
106
- } catch {
107
- return t;
108
- }
109
- }
110
- function q(t) {
111
- if (typeof t != "string" || t.length === 0) return;
112
- const e = t.includes("%") ? [t, we(t)] : [t];
113
- for (const n of e)
114
- try {
115
- const o = JSON.parse(n);
116
- if (typeof o == "string")
117
- try {
118
- return JSON.parse(o);
119
- } catch {
120
- return o;
121
- }
122
- return o;
123
- } catch {
124
- }
125
- }
126
- function te(t) {
127
- if (!t || typeof t != "object") return !1;
128
- const e = t;
129
- return typeof e.hour == "number" && typeof e.minute == "number";
130
- }
131
- function be(t = s.query) {
132
- const e = t, n = e.startDate ? u(e.startDate).startOf("day").toISOString() : void 0, o = e.endDate ? u(e.endDate).endOf("day").toISOString() : void 0, l = typeof e.timeStart == "string", i = typeof e.timeEnd == "string", f = q(e.timeStart), y = q(e.timeEnd), m = te(f) ? f : null, x = te(y) ? y : null, b = e.compareStartDate ? u(e.compareStartDate).startOf("day").toISOString() : void 0, S = e.compareEndDate ? u(e.compareEndDate).endOf("day").toISOString() : void 0, h = e.isAllLocation === "true" || e.isAllLocation === void 0;
133
- let D = [];
134
- if (h)
135
- D = a.selectedLocationIds ?? [];
136
- else {
137
- const r = q(e.locationIds);
138
- D = Array.isArray(r) ? r : [];
139
- }
140
- let R = e.reportId || Z;
141
- if (Ie.value.find((r) => r.id === R) || (R = Z), R && R !== w.currentReportId && w.updateCurrentReportId(R), n || o) {
142
- const r = a.dateRange;
143
- (r.startDate !== n || r.endDate !== o) && a.setDateRange({ startDate: n, endDate: o });
144
- }
145
- if (l || i) {
146
- const r = a.timeRange;
147
- (r.start !== m || r.end !== x) && a.setTimeRange({ start: m, end: x });
148
- }
149
- if (b || S) {
150
- const r = a.compareDateRange;
151
- (r.startDate !== b || r.endDate !== S) && a.setCompareDateRange({
152
- startDate: b,
153
- endDate: S
154
- });
155
- }
156
- if (!h) {
157
- const r = a.selectedLocationIds;
158
- r.length === D.length && r.every((Ae, Ce) => Ae === D[Ce]) || a.setSelectedLocationIds(D);
159
- }
160
- return {
161
- // TODO: this returned value can used for getBusinessSetting
162
- reportId: R,
163
- startDate: e.startDate,
164
- endDate: e.endDate,
165
- timeStart: e.timeStart,
166
- timeEnd: e.timeEnd,
167
- compareStartDate: e.compareStartDate,
168
- compareEndDate: e.compareEndDate,
169
- locationIds: typeof e.locationIds == "string" ? e.locationIds : void 0,
170
- isAllLocation: e.isAllLocation
171
- };
172
- }
173
- return C(
174
- () => c.value,
175
- async (t, e) => {
176
- if (t !== "") {
177
- B.value = !1, j(t);
178
- const n = "mf-report-prev-business-id", o = (() => {
179
- try {
180
- return sessionStorage.getItem(n);
181
- } catch {
182
- return null;
183
- }
184
- })(), l = !!o && o !== t;
185
- let i = { ...s.query }, f = !1;
186
- if (!F.value || e !== void 0 || l) {
187
- a.setSelectedLocationIds([]);
188
- const { locationIds: y, ...m } = s.query;
189
- i = {
190
- ...m,
191
- isAllLocation: "true"
192
- }, f = !0, await z.replace({
193
- name: s.name,
194
- params: s.params,
195
- query: i
196
- });
197
- }
198
- $.value !== void 0 && ($.value = !0), await ge(async () => {
199
- await _e({
200
- apiKey: "6GhcttsJ9Rj9cTevcdrpin",
201
- url: "https://flag.feedme.farm/api/v1/",
202
- enableAnalytics: !1,
203
- cacheFlags: !1
204
- });
205
- const y = await Se();
206
- V.value = y.version, v.value = V.value, await me();
207
- const m = N.canAccess(
208
- W.report_accessOverview
209
- ), x = N.canAccess(
210
- W.report_accessSetting
211
- ), b = N.canAccess(
212
- W.report_accessIntegration
213
- ), S = [
214
- he(),
215
- Re(),
216
- ve(),
217
- T(
218
- (() => {
219
- const h = q(i.locationIds);
220
- return Array.isArray(h) ? h : void 0;
221
- })()
222
- )
223
- ];
224
- if (m && S.push(ye()), b && S.push(pe()), await Promise.all(S), x && await U(), be(i), f) {
225
- const { locationIds: h, ...D } = s.query;
226
- (s.query.locationIds !== void 0 || s.query.isAllLocation !== "true") && await z.replace({
227
- name: s.name,
228
- params: s.params,
229
- query: {
230
- ...D,
231
- isAllLocation: "true"
232
- }
233
- });
234
- }
235
- fe(t);
236
- try {
237
- sessionStorage.setItem(n, t);
238
- } catch {
239
- }
240
- }), B.value = !0, F.value && (F.value = !1);
241
- }
242
- },
243
- {
244
- immediate: !0
245
- }
246
- ), C(
247
- () => (B.value, {
248
- reportId: De.value,
249
- selectedLocationIds: a.selectedLocationIds,
250
- dateRange: a.dateRange,
251
- timeRange: a.timeRange,
252
- compareDateRange: a.compareDateRange
253
- }),
254
- (t) => {
255
- if (!B.value || !t.reportId || F.value) return;
256
- if ($.value) {
257
- $.value = !1;
258
- return;
259
- }
260
- const e = t.selectedLocationIds, n = t.dateRange, o = t.timeRange, l = t.compareDateRange, i = {
261
- ...s.query,
262
- reportId: t.reportId,
263
- startDate: n.startDate ? u(n.startDate).startOf("day").toISOString() : void 0,
264
- endDate: n.endDate ? u(n.endDate).endOf("day").toISOString() : void 0,
265
- compareStartDate: l.startDate ? u(l.startDate).startOf("day").toISOString() : void 0,
266
- compareEndDate: l.endDate ? u(l.endDate).endOf("day").toISOString() : void 0,
267
- timeStart: o.start ? JSON.stringify(o.start) : void 0,
268
- timeEnd: o.end ? JSON.stringify(o.end) : void 0
269
- }, f = e.length === a.locations.length;
270
- i.isAllLocation = String(f), f ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
271
- const y = JSON.stringify(s.query), m = JSON.stringify(i);
272
- y !== m && z.replace({
273
- name: s.name,
274
- params: s.params,
275
- query: i
276
- });
277
- },
278
- { deep: !0 }
279
- ), Xe(), (t, e) => {
280
- const n = H("router-view");
281
- return A(), G($e, null, [
282
- X(He),
283
- d(v) === "v3" ? (A(), G("iframe", {
284
- key: 0,
285
- class: "bg-white h-full w-full",
286
- src: Le.value
287
- }, null, 8, Ye)) : d(v) === "v4" ? (A(), G("iframe", {
288
- key: 1,
289
- class: "bg-white h-full w-full",
290
- src: Oe.value
291
- }, null, 8, Ze)) : (A(), de(n, { key: 2 }))
292
- ], 64);
293
- };
294
- }
295
- });
296
- export {
297
- lt as default
298
- };
@@ -1,264 +0,0 @@
1
- import { defineComponent as ee, ref as oe, computed as c, watch as te, resolveComponent as J, createBlock as _, openBlock as d, withCtx as w, createVNode as S, createElementVNode as k, unref as s, toDisplayString as re, normalizeStyle as ae, normalizeClass as T, createElementBlock as N, Fragment as se, renderList as ne } from "vue";
2
- import { _ as le } from "./MenuTab.vue_vue_type_script_setup_true_lang-1G6ZNWRO.js";
3
- import { _ as ie } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-D3zN3tqo.js";
4
- import { useRouter as ue, useRoute as ce } from "vue-router";
5
- import { _ as pe } from "./Default.vue_vue_type_script_setup_true_lang-D9MR-Tyr.js";
6
- import { u as me, s as de } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ds2Rd7nK.js";
7
- import { storeToRefs as f } from "pinia";
8
- import { b as ve, c as fe, u as ge, g as ye } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CBYyjcaw.js";
9
- import { _ as be, a as _e } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Af_Z54a4.js";
10
- import { useSnackbar as we, useBreakpoints as Se } from "@feedmepos/ui-library";
11
- import { u as ke, a as xe } from "./vue-i18n-DVWuTfed.js";
12
- import { u as he } from "./message-dialog-UoMWOnil.js";
13
- import { e as Ce, g as Re } from "./app-CYlbtwt9.js";
14
- import { r as Pe } from "./i18n-CI_sQ5d_.js";
15
- const De = { class: "fm-typo-en-title-md-600 block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap" }, Oe = { class: "sticky top-0 z-10 bg-white" }, Ie = /* @__PURE__ */ ee({
16
- __name: "ReportView",
17
- setup($e) {
18
- const { t: e, te: B } = ke(), g = ue(), v = ce(), l = we(), { promptMessage: q } = he(), p = me(), x = ve(), { promptLoader: y } = xe(), { breakpoints: i } = Se(), { isOpenAccountingDialog: F } = f(fe()), { isOpenScheduleDialog: h } = f(ge()), { disabled: C } = f(Ce()), R = oe(null), P = c(
19
- () => {
20
- var r;
21
- return ((r = R.value) == null ? void 0 : r.reportId) === u.value;
22
- }
23
- ), j = c(() => {
24
- var r;
25
- return !!((r = t.value) != null && r.isSupportPos);
26
- }), {
27
- currentReport: t,
28
- overviewReport: L,
29
- currentReportId: u,
30
- isOpenDownloadDialog: V,
31
- isOpenEmailDialog: z,
32
- editingReport: U,
33
- canCreateCustomReport: H,
34
- customReportQuota: D
35
- } = f(p), { canUpdate: M, canDuplicate: Y } = Re();
36
- te(
37
- () => u.value,
38
- async () => R.value = await ye(u.value),
39
- { immediate: !0 }
40
- );
41
- const G = c(() => {
42
- var n;
43
- const r = u.value === ((n = L.value) == null ? void 0 : n.id), o = [
44
- {
45
- icon: "mail",
46
- label: e("report.common.emailSchedule"),
47
- onClick: () => {
48
- h.value = !0;
49
- }
50
- },
51
- {
52
- icon: "article",
53
- label: e(r ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
54
- onClick: async () => {
55
- await y(async () => {
56
- if (t.value)
57
- try {
58
- await p.updateDefaultReport(r ? null : t.value.id), l.open({
59
- message: `Successfully ${r ? "unset" : "set"} ${t.value.name} as Overview`,
60
- type: "success"
61
- });
62
- } catch (m) {
63
- l.open({ message: JSON.stringify(m), type: "error" });
64
- }
65
- });
66
- }
67
- },
68
- {
69
- icon: "content_copy",
70
- label: e("report.common.copyID"),
71
- onClick: () => {
72
- t.value && (navigator.clipboard.writeText(u.value), l.open({ message: e("report.messages.copiedReportIdToClipboard"), type: "success" }));
73
- }
74
- },
75
- {
76
- icon: "report_jobs",
77
- label: e("report.common.reportStatus"),
78
- onClick: () => {
79
- O();
80
- }
81
- }
82
- ];
83
- return !C.value && P.value && o.splice(1, 0, {
84
- icon: "download",
85
- label: e("report.common.accountingExport"),
86
- onClick: I
87
- }), o;
88
- });
89
- async function O() {
90
- x.isOpenJobDialog = !0, await x.getJobs();
91
- }
92
- function Q() {
93
- if (!t.value || !M(t.value)) {
94
- l.open({
95
- message: e("report.messages.noPermissionUpdateReport"),
96
- type: "error"
97
- });
98
- return;
99
- }
100
- U.value = JSON.parse(JSON.stringify(t.value)), g.push({
101
- name: "reportEditor",
102
- query: v.query
103
- });
104
- }
105
- async function W() {
106
- if (!t.value || !Y(t.value)) {
107
- l.open({
108
- message: e("report.messages.noPermissionDuplicateReport"),
109
- type: "error"
110
- });
111
- return;
112
- }
113
- if (!H.value) {
114
- let o = `Your current plan only support up to ${D.value} custom reports.`;
115
- D.value === 0 && (o = "Your current plan does not support custom report."), l.open({
116
- message: o,
117
- type: "error"
118
- });
119
- return;
120
- }
121
- if (!t.value) {
122
- l.open({ message: "No Widget", type: "error" });
123
- return;
124
- }
125
- if (await q({
126
- title: `${e("report.messages.duplicateReport")}`,
127
- message: e("report.messages.confirmAction", {
128
- action: e("report.common.duplicate"),
129
- name: t.value.name
130
- })
131
- }) && t.value) {
132
- const o = JSON.parse(JSON.stringify(t.value));
133
- o.editable = !0, o.id = "", o.name = `${o.name} duplicate`, o.isDefault = !1;
134
- try {
135
- await y(async () => {
136
- const n = await p.createOrUpdateReport(o);
137
- p.updateCurrentReportId(n.id), g.push({
138
- name: "reportView",
139
- params: v.params,
140
- query: v.query
141
- });
142
- });
143
- } catch (n) {
144
- console.log(n), l.open({ message: "Failed to clone report", type: "error" });
145
- }
146
- }
147
- }
148
- function I() {
149
- F.value = !0;
150
- }
151
- function K() {
152
- t.value && (navigator.clipboard.writeText(u.value), l.open({ message: "Copied report ID to clipboard", type: "success" }));
153
- }
154
- async function X() {
155
- if (t.value)
156
- try {
157
- await y(async () => {
158
- await de(u.value, !j.value), await p.getReports();
159
- });
160
- } catch (r) {
161
- console.log(r), l.open({
162
- message: e("report.messages.failedToAction", { action: e("report.common.update") }),
163
- type: "error"
164
- });
165
- }
166
- }
167
- const $ = c(() => t.value ? t.value.tiles : []), Z = c(() => {
168
- var n;
169
- let o = [
170
- // TODO: In future once decided to support report showing configuration for POS,
171
- // uncomment this:
172
- // {
173
- // label: t("report.common.showInPOS"),
174
- // value: "show_in_pos",
175
- // isPrimary: false,
176
- // appendIcon: isCurrentReportShownInPOS.value
177
- // ? "radio_button_checked"
178
- // : "radio_button_unchecked"
179
- // },
180
- !!((n = t.value) != null && n.editable) ? { label: e("report.common.edit"), value: "edit", isPrimary: !1 } : {
181
- label: e("report.common.duplicate"),
182
- value: "duplicate",
183
- isPrimary: !1
184
- },
185
- {
186
- label: e("report.common.download"),
187
- value: "download",
188
- isPrimary: !0,
189
- prependIcon: "download"
190
- },
191
- { label: e("report.schedule.sendEmail"), value: "email", isPrimary: !0 }
192
- ];
193
- return i.value.xs && (o = [
194
- ...o,
195
- { label: e("report.schedule.sendEmail"), value: "email", isPrimary: !1 },
196
- { label: e("report.common.reportStatus"), value: "report_jobs", isPrimary: !1 },
197
- { label: e("report.common.emailSchedule"), value: "schedule_email", isPrimary: !1 },
198
- { label: e("report.common.copyID"), value: "content_copy", isPrimary: !1 }
199
- ], !C.value && P.value && o.push({ label: e("report.common.accountingExport"), value: "export", isPrimary: !1 }), o = o.filter((m) => m.value !== "edit")), o;
200
- }), b = c(() => {
201
- var r;
202
- return Pe(e, B, (r = t == null ? void 0 : t.value) == null ? void 0 : r.name, "other");
203
- });
204
- return (r, o) => {
205
- const n = J("FmTooltip"), m = J("FmPageHead");
206
- return d(), _(pe, null, {
207
- default: w(() => {
208
- var E;
209
- return [
210
- S(m, {
211
- title: b.value,
212
- "back-button": !0,
213
- actions: Z.value,
214
- "onClick:back": o[0] || (o[0] = (a) => s(g).push({ name: "reports", query: s(v).query })),
215
- "onClick:action": o[1] || (o[1] = (a) => {
216
- a === "show_in_pos" && X(), a === "duplicate" && W(), a === "download" && (V.value = !0), a === "email" && (z.value = !0), a === "edit" && Q(), a === "schedule_email" && (h.value = !0), a === "content_copy" && K(), a === "export" && I(), a === "report_jobs" && O();
217
- }),
218
- class: "remove-line-clamping"
219
- }, {
220
- title: w(() => [
221
- S(n, {
222
- content: b.value,
223
- placement: "bottom",
224
- "z-index": 2e3,
225
- class: "flex min-w-0 max-w-full justify-start"
226
- }, {
227
- default: w(() => [
228
- k("p", De, re(b.value), 1)
229
- ]),
230
- _: 1
231
- }, 8, ["content"])
232
- ]),
233
- _: 1
234
- }, 8, ["title", "actions"]),
235
- k("div", {
236
- class: T(`flex flex-col overflow-y-auto ${s(i).xs || s(i).sm ? "pb-20" : ""}`),
237
- style: ae({ height: `calc(100% - ${s(i).lg || s(i).md ? 72 : 64}px)` })
238
- }, [
239
- k("div", Oe, [
240
- S(le, {
241
- "model-value": s(i).lg || s(i).md ? G.value : []
242
- }, null, 8, ["model-value"])
243
- ]),
244
- s(t) && ((E = $.value) == null ? void 0 : E.length) > 0 ? (d(), N("div", {
245
- key: 0,
246
- class: T(["grid grid-cols-12", s(i).sm || s(i).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
247
- }, [
248
- (d(!0), N(se, null, ne($.value, (a, A) => (d(), _(ie, {
249
- key: `widget_${s(u)}_${A}`,
250
- "model-value": a,
251
- index: A
252
- }, null, 8, ["model-value", "index"]))), 128))
253
- ], 2)) : (d(), _(be, { key: 1 }))
254
- ], 6)
255
- ];
256
- }),
257
- _: 1
258
- });
259
- };
260
- }
261
- }), Me = /* @__PURE__ */ _e(Ie, [["__scopeId", "data-v-8fe2479c"]]);
262
- export {
263
- Me as default
264
- };