@feedmepos/mf-report 5.28.3 → 5.28.4-beta.1

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 (33) hide show
  1. package/dist/{App-D6KNCk3U.js → App-TTaomYWJ.js} +37 -37
  2. package/dist/{DateRangeSelect-DD_hwlxu.js → DateRangeSelect-CDWvx37Z.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-C7SaR61j.js → Default.vue_vue_type_script_setup_true_lang-B4GS0LAe.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-Bm1OooCI.js → DynamicWidget.vue_vue_type_script_setup_true_lang-BXb30lZS.js} +5 -5
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DJ393ci2.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Mkp4Nbem.js} +623 -604
  6. package/dist/{InsightView-BTFlNqxu.js → InsightView-DNJahikW.js} +5 -5
  7. package/dist/{Integration-CTxhJq_Z.js → Integration-BeErYlGf.js} +3 -3
  8. package/dist/{Integrations-BYGlfohx.js → Integrations-DFuALsa_.js} +2 -2
  9. package/dist/{Layout-CStIZUX-.js → Layout-BSfIs3TK.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-D6apLFYw.js → LocationSelect.vue_vue_type_script_setup_true_lang-C-DhURYX.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-A_VbksPH.js → MenuTab.vue_vue_type_script_setup_true_lang-By-I-Ye-.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CSMc0jtK.js → NavigationTab.vue_vue_type_script_setup_true_lang-BWLE2D5s.js} +5 -5
  13. package/dist/{OverviewView-BXnlGK7f.js → OverviewView-C6bc-nyW.js} +4 -4
  14. package/dist/Report-Cgrz4IUu.js +658 -0
  15. package/dist/{ReportCanvasView-CBbsxv--.js → ReportCanvasView-6ratBE_J.js} +3 -3
  16. package/dist/{ReportEditor-duj_-Q1M.js → ReportEditor-ChllQ8e0.js} +7 -7
  17. package/dist/ReportView-wesF2Wbp.js +307 -0
  18. package/dist/{ReportViewRoute-BUNwCFLs.js → ReportViewRoute-BgYwRrL6.js} +2 -2
  19. package/dist/{Setting-XMsaZeLK.js → Setting-DiWyp9vo.js} +3 -3
  20. package/dist/{Template-DQcQXA94.js → Template-Ce-SmgVJ.js} +3 -3
  21. package/dist/{TileEditor-1lFcdBWl.js → TileEditor-BBNuA1AB.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-D4KbxrPX.js → TilePageStack.vue_vue_type_script_setup_true_lang-nTBw3Jmd.js} +2 -2
  23. package/dist/{TransitionFade-qsqa6Mnc.js → TransitionFade-CDVNSlPY.js} +5 -5
  24. package/dist/{app-Cf5HuvZS.js → app-DI6EG74T.js} +396 -376
  25. package/dist/app.js +1 -1
  26. package/dist/assets/{formatChartData.worker-Dx1USoTn.js → formatChartData.worker-DYtOUTAT.js} +31 -31
  27. package/dist/assets/{processTableData.worker-clNopMr8.js → processTableData.worker-XtLK-E3T.js} +31 -31
  28. package/dist/{report-DhhomBCB.js → report-CFFZa-VL.js} +3 -3
  29. package/dist/style.css +1 -1
  30. package/dist/{useRestaurantPermission-CABpuml7.js → useRestaurantPermission-CmkLx2Hj.js} +1 -1
  31. package/package.json +1 -1
  32. package/dist/Report-DGkT9no2.js +0 -588
  33. package/dist/ReportView-C1N7pmiQ.js +0 -333
@@ -1,4 +1,4 @@
1
- import { u as p, F as m, r as v, p as be, a as ye, b as we, n as Se, h as Ie } from "./app-Cf5HuvZS.js";
1
+ import { u as p, F as m, r as v, p as be, a as ye, b as we, n as Se, h as Ie } from "./app-DI6EG74T.js";
2
2
  import { storeToRefs as l, defineStore as j } from "pinia";
3
3
  import { ref as i, computed as $, watch as Ae } from "vue";
4
4
  import { useSnackbar as W } from "@feedmepos/ui-library";
@@ -628,8 +628,8 @@ export {
628
628
  te as p,
629
629
  H as q,
630
630
  St as r,
631
- yt as s,
632
- Rt as t,
631
+ Rt as s,
632
+ yt as t,
633
633
  _t as u,
634
634
  D as v,
635
635
  Ge as w,
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- [data-v-e0ce1b3c] .report-date-access-disabled{color:var(--fm-color-typo-disabled, #a8a8a8);opacity:.45}[data-v-e0ce1b3c] .report-date-access-disabled .fm-calendar__cell__button{cursor:not-allowed;color:var(--fm-color-typo-disabled, #a8a8a8);text-decoration:line-through}.glassmorphism{background:linear-gradient(135deg,#fffffff5,#fffffff5);box-shadow:0 8px 24px #0f172a2e}.chart-legend-text[data-v-706fa016]{color:var(--legend-text-color);font-size:var(--legend-font-size)}.chart-legend-list[data-v-706fa016]{scrollbar-width:none;-ms-overflow-style:none}.chart-legend-list[data-v-706fa016]::-webkit-scrollbar{display:none;width:0;height:0}.circular.circular{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;max-width:100%;overflow:hidden;padding:0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.circular.circular .flex-col.gap-8{gap:0!important}.circular.circular .fm-color-typo-primary:empty,.circular.circular .fm-color-typo-secondary:empty{display:none}.circular.circular .grow{height:100%}.sparkline.sparkline{margin:0;padding:0}.sparkline.sparkline .grow{height:50px;flex-grow:1;min-height:0}.sparkline-chart>div:not(.grow){display:none}.sparkline-chart canvas{display:block}.scrollbar-hide-table>div{scrollbar-width:thin}.bar-chart.bar-chart{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;max-height:100%;overflow:hidden;padding:0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.bar-chart.bar-chart .grow{height:100%}.bar-chart.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.line-chart{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;max-height:100%;overflow:hidden;margin:0;padding:8px 0 0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.line-chart.line-chart .grow{height:100%}.line-chart.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%)}.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}.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}@keyframes project-mapping-highlight-5aaec20d{0%{box-shadow:0 0 0 0 transparent;border-color:transparent}20%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}35%{box-shadow:0 0 0 0 transparent;border-color:transparent}50%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}65%{box-shadow:0 0 0 0 transparent;border-color:transparent}70%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}to{box-shadow:0 0 0 0 transparent;border-color:transparent}}.animate-project-mapping-highlight[data-v-5aaec20d]{animation:project-mapping-highlight-5aaec20d 1.4s ease-out;border:1px solid transparent}.ap-project-shared-field[data-v-5aaec20d] .inline-flex>div:last-child{text-decoration:underline}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.remove-line-clamping[data-v-2d4d3abc] .line-clamp-1,.remove-line-clamping[data-v-2d4d3abc] .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-2d4d3abc] .flex.flex-col.flex-grow{min-width:0}.remove-line-clamping[data-v-2d4d3abc] .cursor-pointer.flex.items-center.justify-center.relative{min-width:0;max-width:100%;overflow:hidden}
1
+ [data-v-e0ce1b3c] .report-date-access-disabled{color:var(--fm-color-typo-disabled, #a8a8a8);opacity:.45}[data-v-e0ce1b3c] .report-date-access-disabled .fm-calendar__cell__button{cursor:not-allowed;color:var(--fm-color-typo-disabled, #a8a8a8);text-decoration:line-through}.glassmorphism{background:linear-gradient(135deg,#fffffff5,#fffffff5);box-shadow:0 8px 24px #0f172a2e}.chart-legend-text[data-v-706fa016]{color:var(--legend-text-color);font-size:var(--legend-font-size)}.chart-legend-list[data-v-706fa016]{scrollbar-width:none;-ms-overflow-style:none}.chart-legend-list[data-v-706fa016]::-webkit-scrollbar{display:none;width:0;height:0}.circular.circular{flex:1 1 auto;min-height:0;min-width:0;max-height:100%;max-width:100%;overflow:hidden;padding:0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.circular.circular .flex-col.gap-8{gap:0!important}.circular.circular .fm-color-typo-primary:empty,.circular.circular .fm-color-typo-secondary:empty{display:none}.circular.circular .grow{height:100%}.sparkline.sparkline{margin:0;padding:0}.sparkline.sparkline .grow{height:50px;flex-grow:1;min-height:0}.sparkline-chart>div:not(.grow){display:none}.sparkline-chart canvas{display:block}.scrollbar-hide-table>div{scrollbar-width:thin}.bar-chart.bar-chart{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;max-height:100%;overflow:hidden;padding:0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.bar-chart.bar-chart .grow{height:100%}.bar-chart.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.line-chart{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;max-height:100%;overflow:hidden;margin:0;padding:8px 0 0;width:calc(100% - var(--legend-panel-width, 0px));height:calc(100% - var(--legend-panel-height, 0px))}.line-chart.line-chart .grow{height:100%}.line-chart.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%)}.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}.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}@keyframes project-mapping-highlight-5aaec20d{0%{box-shadow:0 0 0 0 transparent;border-color:transparent}20%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}35%{box-shadow:0 0 0 0 transparent;border-color:transparent}50%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}65%{box-shadow:0 0 0 0 transparent;border-color:transparent}70%{box-shadow:0 0 0 2px var(--fm-color-primary);border-color:var(--fm-color-primary)}to{box-shadow:0 0 0 0 transparent;border-color:transparent}}.animate-project-mapping-highlight[data-v-5aaec20d]{animation:project-mapping-highlight-5aaec20d 1.4s ease-out;border:1px solid transparent}.ap-project-shared-field[data-v-5aaec20d] .inline-flex>div:last-child{text-decoration:underline}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.remove-line-clamping[data-v-9c5593f0] .line-clamp-1,.remove-line-clamping[data-v-9c5593f0] .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-9c5593f0] .flex.flex-col.flex-grow{min-width:0}.remove-line-clamping[data-v-9c5593f0] .cursor-pointer.flex.items-center.justify-center.relative{min-width:0;max-width:100%;overflow:hidden}
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
2
2
  import { u as c } from "./_plugin-vue_export-helper-C6QDExPN.js";
3
3
  import { useSnackbar as f } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as d } from "@feedmepos/mf-common";
5
- import { T as l, U as i } from "./app-Cf5HuvZS.js";
5
+ import { T as l, U as i } from "./app-DI6EG74T.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.28.3",
3
+ "version": "5.28.4-beta.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,588 +0,0 @@
1
- import { defineComponent as Ie, ref as Q, watch as de, computed as h, h as d, withModifiers as Fe, resolveComponent as x, createBlock as W, openBlock as T, withCtx as m, createVNode as i, createElementVNode as g, unref as e, normalizeStyle as Oe, normalizeClass as y, withDirectives as fe, createElementBlock as Pe, Fragment as Le, renderList as Ne, toDisplayString as _, createTextVNode as Ve, vShow as ye } from "vue";
2
- import { storeToRefs as ve } from "pinia";
3
- import { u as Ae } from "./report-DhhomBCB.js";
4
- import { _ as Te } from "./Default.vue_vue_type_script_setup_true_lang-C7SaR61j.js";
5
- import { u as Je } from "./message-dialog-UoMWOnil.js";
6
- import { u as ze } from "./global-loader-BuxFfehu.js";
7
- import { useSnackbar as Be, useBreakpoints as Ue, components as Ee, FmButtonColorThemeVariant as Ke } from "@feedmepos/ui-library";
8
- import { _ as Me } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
- import { c as Ye, a as ge, h as qe } from "./app-Cf5HuvZS.js";
10
- import { useRouter as je, useRoute as Ge, onBeforeRouteLeave as He } from "vue-router";
11
- import { useI18n as Qe } from "@feedmepos/mf-common";
12
- import { r as X } from "./i18n-DbyciK4x.js";
13
- const We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "w-[343px]" }, Ze = { class: "fm-typo-en-body-md-600" }, dt = /* @__PURE__ */ Ie({
14
- __name: "Report",
15
- setup(et) {
16
- const { t: a, te: J } = Qe(), Z = je(), ee = Ge(), f = Ae(), be = Ye(), { business: we } = ve(ge()), {
17
- reports: p,
18
- overviewReport: z,
19
- categories: $,
20
- pinReport: I,
21
- isOpenAddReportDialog: Re,
22
- scrollPositionY: te,
23
- customReportQuota: F,
24
- canCreateCustomReport: oe
25
- } = ve(f), { promptMessage: ae } = Je(), { promptLoader: B } = ze(), c = Be(), { breakpoints: u } = Ue(), { canRead: re, canUpdate: ne, canDuplicate: se, canDelete: U, canCreateReport: he } = qe(), b = Q();
26
- He(() => {
27
- b.value && (te.value = b.value.$el.children[0].scrollTop);
28
- }), de(b, () => {
29
- b.value && setTimeout(() => {
30
- b.value && (b.value.$el.children[0].scrollTop = te.value);
31
- }, 200);
32
- });
33
- const E = h(() => I.value && p.value ? p.value.filter((o) => {
34
- var t;
35
- return (t = I.value) == null ? void 0 : t.includes(o.id);
36
- }) : []);
37
- de(
38
- [() => we.value],
39
- () => {
40
- f.refreshPinReport();
41
- },
42
- { immediate: !0 }
43
- );
44
- const le = h(() => E.value.length > 0 ? p.value.filter(
45
- (o) => E.value.findIndex((t) => t.id === o.id) === -1
46
- ) : p.value), { FmButton: Ce, FmMenu: K, FmMenuItem: C, FmIcon: M, FmChip: Y } = Ee, ce = h(() => [
47
- { value: void 0, label: "All" },
48
- ...$.value.map((o) => ({
49
- value: o.id,
50
- label: o.name
51
- }))
52
- ]), O = Q(ce.value[0]), q = Q(""), S = h(() => le.value.length === 0 || $.value.length === 0 ? [] : [
53
- ...E.value.map((t) => {
54
- const r = $.value.find((l) => l.id === t.category);
55
- return {
56
- name: X(a, J, t.name, "other"),
57
- categoryId: (r == null ? void 0 : r.id) ?? "",
58
- category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
59
- reportId: t.id,
60
- editable: t.editable,
61
- description: t.description || "",
62
- pin: !0,
63
- canUpdate: ne(t),
64
- canRead: re(t),
65
- reportType: t.reportType
66
- };
67
- }),
68
- ...le.value.map((t) => {
69
- const r = $.value.find((l) => l.id === t.category);
70
- return {
71
- name: X(a, J, t.name, "other"),
72
- categoryId: (r == null ? void 0 : r.id) ?? "",
73
- category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
74
- reportId: t.id,
75
- editable: t.editable,
76
- description: t.description || "",
77
- pin: !1,
78
- canUpdate: ne(t),
79
- canRead: re(t),
80
- reportType: t.reportType
81
- };
82
- })
83
- ].filter((t) => O.value.value && t.categoryId !== O.value.value ? !1 : `${(t == null ? void 0 : t.name) || ""}${(t == null ? void 0 : t.description) || ""}`.toLowerCase().indexOf(q.value.toLowerCase()) !== -1)), Se = h(
84
- () => S.value.map((o) => `${o.name}${o.category}`).toString()
85
- ), xe = h(() => [
86
- {
87
- accessorKey: "name",
88
- header: a("report.common.name"),
89
- enableSorting: !1,
90
- cell: (o) => {
91
- const t = o.row.original;
92
- return d(
93
- "span",
94
- { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
95
- o.getValue()
96
- );
97
- }
98
- },
99
- {
100
- accessorKey: "category",
101
- header: a("report.common.category"),
102
- enableSorting: !1,
103
- meta: {
104
- width: "100px"
105
- },
106
- cell: (o) => d(
107
- Y,
108
- {
109
- // grey out chip text when user cannot read report
110
- 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`,
111
- compact: !0
112
- },
113
- { default: () => o.getValue() }
114
- )
115
- },
116
- {
117
- accessorKey: "description",
118
- header: a("report.common.description"),
119
- enableSorting: !1,
120
- cell: (o) => {
121
- const t = o.row.original;
122
- return d(
123
- "span",
124
- { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
125
- o.getValue()
126
- );
127
- }
128
- },
129
- {
130
- accessorKey: "",
131
- id: "Action",
132
- header: a("report.common.actions"),
133
- meta: {
134
- width: "80px"
135
- },
136
- cell: (o) => {
137
- var w;
138
- const t = o.row.original, r = t.reportId, l = p.value.find((s) => s.id === r), H = r === ((w = z.value) == null ? void 0 : w.id), V = !t.canRead, D = l ? se(l) : !1, A = l ? U(l) : !1, n = [
139
- {
140
- label: a("report.common.duplicate"),
141
- onClick: () => {
142
- l && D ? me(l) : D || c.open({
143
- message: a("report.messages.noPermissionDuplicateReport"),
144
- type: "error"
145
- });
146
- },
147
- variant: "",
148
- disabled: !D
149
- },
150
- {
151
- label: a(H ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
152
- onClick: async () => {
153
- l && ie(l);
154
- },
155
- variant: "",
156
- disabled: !1
157
- },
158
- {
159
- label: a("report.common.remove"),
160
- onClick: () => {
161
- l && (A ? ue(l) : c.open({
162
- message: a("report.messages.noPermissionDeleteReport"),
163
- type: "error"
164
- }));
165
- },
166
- variant: "destructive",
167
- disabled: !t.editable || !A
168
- }
169
- ];
170
- return d(
171
- "div",
172
- {
173
- class: `flex ${u.value.lg || u.value.md ? "justify-end" : ""} items-center`
174
- },
175
- {
176
- default: () => [
177
- d(
178
- "button",
179
- {
180
- disabled: V,
181
- title: V ? a("report.messages.noPermission") : void 0,
182
- onClick: Fe(() => {
183
- l && pe(l);
184
- }, ["stop"]),
185
- class: `text-fm-color-neutral-gray-400 ${t.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
186
- },
187
- {
188
- default: () => [
189
- d(
190
- M,
191
- {
192
- name: "keep",
193
- class: "px-12 p-8",
194
- outline: !t.pin,
195
- size: "md"
196
- },
197
- {}
198
- )
199
- ]
200
- }
201
- ),
202
- d(
203
- K,
204
- {
205
- stopClickPropagation: !0,
206
- shift: !0,
207
- disabled: !1
208
- },
209
- {
210
- default: () => n.map(
211
- (s) => d(
212
- C,
213
- {
214
- onClick: s.disabled ? {} : s.onClick,
215
- label: s.label,
216
- class: s.disabled ? "text-fm-color-typo-disabled" : s.variant === "destructive" ? "text-fm-color-typo-error" : "",
217
- disabled: s.disabled
218
- },
219
- {
220
- label: () => d("p", s.label)
221
- }
222
- )
223
- ),
224
- "menu-button": () => d(
225
- Ce,
226
- {
227
- variant: "tertiary",
228
- size: "md",
229
- icon: "more_vert",
230
- iconColor: Ke.NeutralGray400,
231
- disabled: !1
232
- },
233
- {}
234
- )
235
- }
236
- )
237
- ]
238
- }
239
- );
240
- }
241
- }
242
- ]);
243
- async function ie(o) {
244
- await B(async () => {
245
- var t;
246
- try {
247
- const r = o.id === ((t = z.value) == null ? void 0 : t.id);
248
- await f.updateDefaultReport(r ? null : o.id), c.open({
249
- message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
250
- type: "success"
251
- });
252
- } catch (r) {
253
- c.open({ message: JSON.stringify(r), type: "error" });
254
- }
255
- });
256
- }
257
- async function ke(o) {
258
- if (await ae({
259
- title: a("report.common.duplicate"),
260
- message: a("report.messages.confirmAction", {
261
- action: a("report.common.duplicate"),
262
- name: o.name
263
- })
264
- })) {
265
- const r = JSON.parse(JSON.stringify(o));
266
- r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, B(async () => {
267
- try {
268
- await f.createOrUpdateReport(r), c.open({
269
- message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
270
- type: "success"
271
- });
272
- } catch (l) {
273
- c.open({ message: JSON.stringify(l), type: "error" });
274
- }
275
- });
276
- }
277
- }
278
- function j(o) {
279
- const t = p.value.find((r) => r.id === o.reportId);
280
- return !t || !se(t);
281
- }
282
- function G(o) {
283
- const t = p.value.find((r) => r.id === o.reportId);
284
- return !o.editable || !t || !U(t);
285
- }
286
- async function ue(o) {
287
- if (!U(o)) {
288
- c.open({
289
- message: a("report.messages.noPermissionDeleteReport"),
290
- type: "error"
291
- });
292
- return;
293
- }
294
- await ae({
295
- title: a("report.messages.deleteReport"),
296
- message: a("report.messages.confirmDelete", { name: o.name })
297
- }) && B(async () => {
298
- try {
299
- await f.removeReport(o), c.open({
300
- message: a("report.messages.deleteSuccess", { name: o.name }),
301
- type: "success"
302
- });
303
- } catch (r) {
304
- c.open({ message: JSON.stringify(r), type: "error" });
305
- }
306
- });
307
- }
308
- async function me(o) {
309
- if (oe.value)
310
- await ke(o);
311
- else {
312
- let t = `Your current plan only support up to ${F.value} custom reports.`;
313
- F.value === 0 && (t = "Your current plan does not support custom report."), c.open({
314
- message: t,
315
- type: "error"
316
- });
317
- }
318
- }
319
- function De() {
320
- if (!he.value) {
321
- c.open({
322
- message: a("report.messages.noPermission"),
323
- type: "error"
324
- });
325
- return;
326
- }
327
- if (oe.value)
328
- Re.value = !0;
329
- else {
330
- let o = `Your current plan only support up to ${F.value} custom reports.`;
331
- F.value === 0 && (o = "Your current plan does not support custom report."), c.open({
332
- message: o,
333
- type: "error"
334
- });
335
- }
336
- }
337
- function pe(o) {
338
- const t = X(a, J, o.name, "other") ?? "";
339
- I.value && I.value.includes(o.id) ? (c.open({
340
- message: `${a("report.common.unpin")} ${t} ${a("report.common.successful")}`,
341
- type: "success"
342
- }), f.clearPinReport(o.id)) : (c.open({
343
- message: `${a("report.common.pin")} ${t} ${a("report.common.successful")}`,
344
- type: "success"
345
- }), f.cachePinReport(o));
346
- }
347
- function _e(o) {
348
- O.value = o;
349
- }
350
- const { selectedLocationIds: k, dateRange: P, compareDateRange: L, timeRange: v, locations: $e } = ge(), N = h(() => k.length === $e.length);
351
- return (o, t) => {
352
- const r = x("FmPageHead"), l = x("FmSearch"), H = x("FmForm"), V = x("FmListItem"), D = x("FmList"), A = x("FmTable");
353
- return T(), W(Te, null, {
354
- default: m(() => [
355
- i(r, {
356
- title: e(a)("report.common.report", 1),
357
- class: "h-[68px]",
358
- actions: [
359
- {
360
- label: `${e(a)("report.view.report.add")}`,
361
- value: "add",
362
- isPrimary: !0,
363
- prependIcon: "add"
364
- }
365
- ],
366
- "onClick:action": t[0] || (t[0] = (n) => De())
367
- }, null, 8, ["title", "actions"]),
368
- g("div", {
369
- class: y(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
370
- style: Oe({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
371
- }, [
372
- i(H, {
373
- class: y(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
374
- }, {
375
- default: m(() => [
376
- i(e(K), null, {
377
- "menu-button": m(() => [
378
- i(e(Y), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
379
- default: m(() => [
380
- g("p", null, _(e(a)(`report.category.${O.value.label}`)), 1),
381
- i(e(M), { name: "expand_more" })
382
- ]),
383
- _: 1
384
- })
385
- ]),
386
- default: m(() => [
387
- (T(!0), Pe(Le, null, Ne(ce.value, (n, w) => (T(), W(e(C), {
388
- key: w,
389
- label: e(a)(`report.category.${n.label}`),
390
- onClick: () => _e(n)
391
- }, null, 8, ["label", "onClick"]))), 128))
392
- ]),
393
- _: 1
394
- }),
395
- g("div", {
396
- class: y(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
397
- }, [
398
- g("p", We, _(e(a)("report.common.results", { count: S.value.length })), 1)
399
- ], 2),
400
- t[3] || (t[3] = g("div", { class: "grow" }, null, -1)),
401
- g("div", Xe, [
402
- i(l, {
403
- modelValue: q.value,
404
- "onUpdate:modelValue": t[1] || (t[1] = (n) => q.value = n),
405
- class: y(`${e(u).lg || e(u).md ? "grow" : ""}`)
406
- }, null, 8, ["modelValue", "class"])
407
- ])
408
- ]),
409
- _: 1
410
- }, 8, ["class"]),
411
- fe((T(), W(A, {
412
- key: Se.value,
413
- ref_key: "table",
414
- ref: b,
415
- class: y([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
416
- style: { height: "calc(100% - 40px)" },
417
- "column-defs": xe.value,
418
- "row-data": S.value,
419
- "page-size": S.value.length,
420
- "hide-footer": !0,
421
- "row-class-name": "row",
422
- onRowClick: t[2] || (t[2] = (n) => {
423
- if (!n.original.canRead) {
424
- e(c).open({
425
- message: e(a)("report.messages.noPermission"),
426
- type: "error"
427
- });
428
- return;
429
- }
430
- e(be).suppressReportRouteSync = !0, e(f).updateCurrentReportId(n.original.reportId), e(Z).push({
431
- name: "reportView",
432
- query: {
433
- ...e(ee).query,
434
- reportId: n.original.reportId,
435
- startDate: e(P).startDate,
436
- endDate: e(P).endDate,
437
- compareStartDate: e(L).startDate,
438
- compareEndDate: e(L).endDate,
439
- timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
440
- timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
441
- isAllLocation: N.value.toString(),
442
- locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
443
- }
444
- });
445
- })
446
- }, {
447
- "list-row": m(({ original: n }) => [
448
- i(D, {
449
- onClick: () => {
450
- if (!n.canRead) {
451
- e(c).open({
452
- message: e(a)("report.messages.noPermission"),
453
- type: "error"
454
- });
455
- return;
456
- }
457
- n.reportId && (e(f).updateCurrentReportId(n.reportId), e(Z).push({
458
- name: "reportView",
459
- query: {
460
- ...e(ee).query,
461
- reportId: n.reportId,
462
- startDate: e(P).startDate,
463
- endDate: e(P).endDate,
464
- compareStartDate: e(L).startDate,
465
- compareEndDate: e(L).endDate,
466
- timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
467
- timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
468
- isAllLocation: N.value.toString(),
469
- locationIds: N.value ? void 0 : e(k) ? JSON.stringify(e(k)) : void 0
470
- }
471
- }));
472
- }
473
- }, {
474
- default: m(() => [
475
- i(V, {
476
- tag: "label",
477
- clickable: ""
478
- }, {
479
- append: m(() => [
480
- i(e(Y), {
481
- class: y(`${n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${n.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
482
- compact: !0
483
- }, {
484
- default: m(() => [
485
- g("p", Ze, _(n.category), 1)
486
- ]),
487
- _: 2
488
- }, 1032, ["class"]),
489
- i(e(K), {
490
- placement: "left",
491
- "stop-click-propagation": !0
492
- }, {
493
- "menu-button": m(() => [
494
- i(e(M), {
495
- name: "more_vert",
496
- class: "btn-color"
497
- })
498
- ]),
499
- default: m(() => {
500
- var w;
501
- return [
502
- i(e(C), {
503
- label: n.pin ? "Unpin" : "Pin",
504
- onClick: () => {
505
- const s = e(p).find(
506
- (R) => R.id === n.reportId
507
- );
508
- s && pe(s);
509
- }
510
- }, null, 8, ["label", "onClick"]),
511
- i(e(C), {
512
- label: e(a)("report.common.duplicate"),
513
- disabled: j(n),
514
- class: y(
515
- j(n) ? "text-fm-color-typo-disabled" : ""
516
- ),
517
- onClick: () => {
518
- const s = e(p).find(
519
- (R) => R.id === n.reportId
520
- );
521
- s && !j(n) ? me(s) : e(c).open({
522
- message: e(a)("report.messages.noPermissionDuplicateReport"),
523
- type: "error"
524
- });
525
- }
526
- }, null, 8, ["label", "disabled", "class", "onClick"]),
527
- i(e(C), {
528
- label: e(a)(
529
- n.reportId === ((w = e(z)) == null ? void 0 : w.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
530
- ),
531
- onClick: () => {
532
- const s = e(p).find(
533
- (R) => R.id === n.reportId
534
- );
535
- s && ie(s);
536
- }
537
- }, null, 8, ["label", "onClick"]),
538
- i(e(C), {
539
- label: e(a)("report.common.delete"),
540
- disabled: G(n),
541
- class: y(
542
- G(n) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
543
- ),
544
- onClick: () => {
545
- const s = e(p).find(
546
- (R) => R.id === n.reportId
547
- );
548
- s && !G(n) && ue(s);
549
- }
550
- }, {
551
- label: m(() => [
552
- Ve(_(e(a)("report.common.delete")), 1)
553
- ]),
554
- _: 2
555
- }, 1032, ["label", "disabled", "class", "onClick"])
556
- ];
557
- }),
558
- _: 2
559
- }, 1024)
560
- ]),
561
- default: m(() => [
562
- g("span", {
563
- class: y(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", n.canRead ? "" : "opacity-40 cursor-not-allowed"])
564
- }, _(n.name), 3)
565
- ]),
566
- _: 2
567
- }, 1024)
568
- ]),
569
- _: 2
570
- }, 1032, ["onClick"])
571
- ]),
572
- _: 1
573
- }, 8, ["class", "column-defs", "row-data", "page-size"])), [
574
- [ye, S.value.length > 0]
575
- ]),
576
- fe(i(Me, null, null, 512), [
577
- [ye, S.value.length === 0]
578
- ])
579
- ], 6)
580
- ]),
581
- _: 1
582
- });
583
- };
584
- }
585
- });
586
- export {
587
- dt as default
588
- };