@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
@@ -0,0 +1,169 @@
1
+ import { defineComponent as V, computed as v, resolveComponent as z, createBlock as g, openBlock as u, withCtx as H, createVNode as $, createElementVNode as M, unref as t, normalizeStyle as Y, normalizeClass as D, createElementBlock as R, Fragment as G, renderList as Q } from "vue";
2
+ import { _ as U } from "./MenuTab.vue_vue_type_script_setup_true_lang-DzZeasAK.js";
3
+ import { _ as W } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js";
4
+ import { useRouter as j, useRoute as K } from "vue-router";
5
+ import { _ as X } from "./Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js";
6
+ import { a as Z } from "./v4-D29FkHfi.js";
7
+ import { storeToRefs as p } from "pinia";
8
+ import { a as ee, u as oe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js";
9
+ import { _ as te } from "./NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js";
10
+ import { useSnackbar as ae, useBreakpoints as re } from "@feedmepos/ui-library";
11
+ import { u as le, f as ne, e as ie } from "./global-loader-C3JC7z-H.js";
12
+ import { u as se } from "./message-dialog-UoMWOnil.js";
13
+ const Ce = /* @__PURE__ */ V({
14
+ __name: "ReportView",
15
+ setup(ue) {
16
+ const { t: l } = le(), m = j(), d = K(), i = ae(), { promptMessage: h } = se(), f = Z(), { promptLoader: E } = ne(), { breakpoints: n } = re(), {
17
+ currentReport: e,
18
+ currentReportId: c,
19
+ isOpenDownloadDialog: P,
20
+ isOpenEmailDialog: I,
21
+ editingReport: O,
22
+ canCreateCustomReport: N,
23
+ customReportQuota: y
24
+ } = p(f), { isOpenAccountingDialog: q } = p(ee()), { isOpenScheduleDialog: b } = p(oe()), { disabled: A } = p(ie()), B = v(() => {
25
+ const a = [
26
+ {
27
+ icon: "mail",
28
+ label: l("report.common.emailSchedule"),
29
+ onClick: () => {
30
+ b.value = !0;
31
+ }
32
+ },
33
+ // {
34
+ // icon: "article",
35
+ // label: "Set as Default",
36
+ // onClick: async () => {
37
+ // await promptLoader(async () => {
38
+ // if (currentReport.value) {
39
+ // try {
40
+ // await reportStore.updateDefaultReport(currentReport.value.id)
41
+ // snackbar.open({
42
+ // message: `Set ${currentReport.value.name} as default successful`,
43
+ // type: "success"
44
+ // })
45
+ // } catch (err) {
46
+ // snackbar.open({ message: JSON.stringify(err), type: "error" })
47
+ // }
48
+ // }
49
+ // })
50
+ // }
51
+ // },
52
+ {
53
+ icon: "content_copy",
54
+ label: l("report.common.copyID"),
55
+ onClick: () => {
56
+ e.value && (navigator.clipboard.writeText(c.value), i.open({ message: l("report.messages.copiedReportIdToClipboard"), type: "success" }));
57
+ }
58
+ }
59
+ ];
60
+ return A.value || a.splice(1, 0, {
61
+ icon: "download",
62
+ label: l("report.common.accountingExport"),
63
+ onClick: _
64
+ }), a;
65
+ });
66
+ function T() {
67
+ O.value = JSON.parse(JSON.stringify(e.value)), m.push({
68
+ name: "reportEditor",
69
+ query: d.query
70
+ });
71
+ }
72
+ async function F() {
73
+ if (!N.value) {
74
+ let o = `Your current plan only support up to ${y.value} custom reports.`;
75
+ y.value === 0 && (o = "Your current plan does not support custom report."), i.open({
76
+ message: o,
77
+ type: "error"
78
+ });
79
+ return;
80
+ }
81
+ if (!e.value) {
82
+ i.open({ message: "No Widget", type: "error" });
83
+ return;
84
+ }
85
+ if (await h({
86
+ title: `${l("report.messages.saveReport")}`,
87
+ message: l("report.messages.confirmAction", {
88
+ action: l("report.common.duplicate"),
89
+ name: e.value.editable ? e.value.name : l(`report.dynamic.${e.value.name}`)
90
+ })
91
+ }) && e.value) {
92
+ const o = JSON.parse(JSON.stringify(e.value));
93
+ o.editable = !0, o.id = "", o.name = `${o.name} duplicate`;
94
+ try {
95
+ await E(async () => {
96
+ await f.createOrUpdateReport(o), f.updateCurrentReportId(c.value), m.push({
97
+ name: "reportView",
98
+ query: d.query
99
+ });
100
+ });
101
+ } catch (s) {
102
+ console.log(s), i.open({ message: "Failed to clone report", type: "error" });
103
+ }
104
+ }
105
+ }
106
+ function _() {
107
+ q.value = !0;
108
+ }
109
+ function J() {
110
+ e.value && (navigator.clipboard.writeText(c.value), i.open({ message: "Copied report ID to clipboard", type: "success" }));
111
+ }
112
+ const k = v(() => e.value ? e.value.tiles : []), L = v(() => {
113
+ var o;
114
+ let a = [
115
+ (o = e == null ? void 0 : e.value) != null && o.editable ? { label: "Edit", value: "edit", isPrimary: !1 } : { label: "Duplicate", value: "duplicate", isPrimary: !1 },
116
+ { label: "Download", value: "download", isPrimary: !0, prependIcon: "download" },
117
+ { label: "Send Email", value: "email", isPrimary: !0 }
118
+ ];
119
+ return n.value.xs && (a = [
120
+ ...a,
121
+ { label: "Email schedule", value: "schedule_email", isPrimary: !1 },
122
+ { label: "Copy ID", value: "content_copy", isPrimary: !1 },
123
+ { label: "Accounting export", value: "export", isPrimary: !1 },
124
+ { label: "Send Email", value: "email", isPrimary: !1 }
125
+ ], a = a.filter((s) => s.value !== "edit")), a;
126
+ });
127
+ return (a, o) => {
128
+ const s = z("FmPageHead");
129
+ return u(), g(X, null, {
130
+ default: H(() => {
131
+ var x, C, S;
132
+ return [
133
+ $(s, {
134
+ title: (x = t(e)) != null && x.editable ? (S = t(e)) == null ? void 0 : S.name : t(l)(`report.dynamic.${(C = t(e)) == null ? void 0 : C.name}`),
135
+ "back-button": !0,
136
+ actions: L.value,
137
+ "onClick:back": o[0] || (o[0] = (r) => t(m).push({ name: "reports", query: t(d).query })),
138
+ "onClick:action": o[1] || (o[1] = (r) => {
139
+ r === "duplicate" && F(), r === "download" && (P.value = !0), r === "email" && (I.value = !0), r === "edit" && T(), r === "schedule_email" && (b.value = !0), r === "content_copy" && J(), r === "export" && _();
140
+ })
141
+ }, null, 8, ["title", "actions"]),
142
+ M("div", {
143
+ class: D(`flex flex-col overflow-y-auto ${t(n).xs || t(n).sm ? "pb-20" : ""}`),
144
+ style: Y({ height: `calc(100% - ${t(n).lg || t(n).md ? 72 : 64}px)` })
145
+ }, [
146
+ $(U, {
147
+ "model-value": t(n).lg || t(n).md ? B.value : []
148
+ }, null, 8, ["model-value"]),
149
+ t(e) && k.value.length > 0 ? (u(), R("div", {
150
+ key: 0,
151
+ class: D(["grid grid-cols-12", t(n).sm || t(n).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
152
+ }, [
153
+ (u(!0), R(G, null, Q(k.value, (r, w) => (u(), g(W, {
154
+ key: `widget_${t(c)}_${w}`,
155
+ "model-value": r,
156
+ index: w
157
+ }, null, 8, ["model-value", "index"]))), 128))
158
+ ], 2)) : (u(), g(te, { key: 1 }))
159
+ ], 6)
160
+ ];
161
+ }),
162
+ _: 1
163
+ });
164
+ };
165
+ }
166
+ });
167
+ export {
168
+ Ce as default
169
+ };
@@ -0,0 +1,104 @@
1
+ import { defineComponent as B, mergeModels as D, useModel as z, ref as _, computed as i, resolveComponent as t, createBlock as b, openBlock as p, withCtx as s, createElementVNode as r, normalizeStyle as L, withDirectives as U, createElementBlock as $, createVNode as u, unref as E, vShow as H, Fragment as N, renderList as q, toDisplayString as y, normalizeClass as A } from "vue";
2
+ import { u as O } from "./global-loader-C3JC7z-H.js";
3
+ const P = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary" }, T = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, j = { class: "sticky top-0" }, K = /* @__PURE__ */ B({
4
+ __name: "SelectComponent",
5
+ props: /* @__PURE__ */ D({
6
+ items: {
7
+ type: Array,
8
+ default: () => []
9
+ },
10
+ placeHolder: {
11
+ type: String,
12
+ default: ""
13
+ },
14
+ label: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ disableSearch: {
19
+ type: Boolean,
20
+ default: !1
21
+ }
22
+ }, {
23
+ modelValue: { required: !0 },
24
+ modelModifiers: {}
25
+ }),
26
+ emits: ["update:modelValue"],
27
+ setup(v) {
28
+ const { t: f } = O(), m = z(v, "modelValue"), a = v, g = (e) => {
29
+ m.value = e.value, setTimeout(() => {
30
+ n.value = !1;
31
+ }, 0);
32
+ }, n = _(!1), d = _(""), F = i(
33
+ () => a.items.filter(
34
+ (e) => e.label.toLowerCase().indexOf(d.value.toLowerCase()) !== -1
35
+ )
36
+ ), w = i(
37
+ () => {
38
+ var e;
39
+ return ((e = a.items.find((o) => o.value === m.value)) == null ? void 0 : e.label) ?? f("report.common.select");
40
+ }
41
+ ), x = i(() => a.items.filter((e) => e.value === m.value));
42
+ return (e, o) => {
43
+ const M = t("FmIcon"), V = t("FmField"), S = t("FmSearch"), C = t("FmMenuDivider"), I = t("FmMenuItem"), k = t("FmMenu");
44
+ return p(), b(k, {
45
+ trigger: "click",
46
+ shift: !0,
47
+ "max-height": 300,
48
+ width: 200,
49
+ onMenuChanged: o[1] || (o[1] = (c) => {
50
+ n.value = c;
51
+ })
52
+ }, {
53
+ "menu-button": s(() => [
54
+ r("p", P, y(a.label), 1),
55
+ u(V, {
56
+ class: A(["cursor-pointer", `${n.value ? "border-fm-color-primary" : ""}`]),
57
+ focused: n.value
58
+ }, {
59
+ append: s(() => [
60
+ u(M, {
61
+ color: "black",
62
+ name: n.value ? "expand_less" : "expand_more",
63
+ size: "md"
64
+ }, null, 8, ["name"])
65
+ ]),
66
+ default: s(() => [
67
+ r("div", T, y(w.value), 1)
68
+ ]),
69
+ _: 1
70
+ }, 8, ["class", "focused"])
71
+ ]),
72
+ "menu-wrapper": s(({ maxHeight: c }) => [
73
+ r("div", {
74
+ style: L({ maxHeight: `${c}px` }),
75
+ class: "bg-fm-color-neutral-white overflow-y-auto overflow-x-hidden rounded-md shadow-light-300 w-[250px]"
76
+ }, [
77
+ U(r("div", j, [
78
+ u(S, {
79
+ modelValue: d.value,
80
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => d.value = l),
81
+ placeholder: E(f)("report.select.filterPlaceholder")
82
+ }, null, 8, ["modelValue", "placeholder"]),
83
+ u(C)
84
+ ], 512), [
85
+ [H, !a.disableSearch]
86
+ ]),
87
+ (p(!0), $(N, null, q(F.value, (l) => (p(), b(I, {
88
+ key: l.value,
89
+ label: l.label,
90
+ sublabel: l.sublabel,
91
+ "model-value": x.value.some((h) => h.value === l.value),
92
+ value: l.value,
93
+ "onUpdate:modelValue": (h) => g(l)
94
+ }, null, 8, ["label", "sublabel", "model-value", "value", "onUpdate:modelValue"]))), 128))
95
+ ], 4)
96
+ ]),
97
+ _: 1
98
+ });
99
+ };
100
+ }
101
+ });
102
+ export {
103
+ K as _
104
+ };
@@ -0,0 +1,320 @@
1
+ import { defineComponent as B, ref as H, useModel as J, resolveComponent as h, createElementBlock as k, openBlock as x, createBlock as M, createElementVNode as t, resolveDynamicComponent as ne, unref as e, withCtx as y, createVNode as a, normalizeClass as O, toDisplayString as s, Fragment as K, renderList as Q, withDirectives as E, createTextVNode as ie, vShow as j, watch as me, normalizeStyle as ue } from "vue";
2
+ import { _ as de } from "./Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js";
3
+ import { u as U, d as z, C as A, D as pe, b as ce } from "./global-loader-C3JC7z-H.js";
4
+ import { components as I, useSnackbar as W, useBreakpoints as X, FmButtonColorThemeVariant as G } from "@feedmepos/ui-library";
5
+ import { t as N, s as fe } from "./timeFormat-CjNvJMgk.js";
6
+ import { u as ve } from "./message-dialog-UoMWOnil.js";
7
+ import { detectLocale as F } from "@feedmepos/mf-common";
8
+ import { _ as Y } from "./SelectComponent.vue_vue_type_script_setup_true_lang-C3VG1mi_.js";
9
+ import { storeToRefs as _e } from "pinia";
10
+ const ge = { class: "px-5 py-2" }, ye = { class: "flex" }, he = { class: "flex px-5 gap-2" }, xe = { class: "flex flex-col gap-2" }, be = { class: "fm-typo-en-title-sm-600" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "w-full gap-[24px] flex flex-col pt-2" }, Te = { class: "flex items-center w-full gap-3" }, De = { class: "text-fm-color-typo-primary" }, $e = { class: "text-fm-color-typo-secondary" }, Se = { class: "flex items-center gap-2" }, ke = /* @__PURE__ */ B({
11
+ __name: "ReportHour",
12
+ props: {
13
+ modelValue: {
14
+ required: !0,
15
+ default: () => []
16
+ },
17
+ modelModifiers: {}
18
+ },
19
+ emits: ["update:modelValue"],
20
+ setup(T) {
21
+ const o = H(!1), p = H(), l = {
22
+ name: "",
23
+ isDefault: !1,
24
+ startTime: { hour: 0, minute: 0 },
25
+ endTime: { hour: 0, minute: 0 }
26
+ }, { FmForm: c } = I, n = H(), { promptMessage: D } = ve(), b = W(), r = H(JSON.parse(JSON.stringify(l))), i = J(T, "modelValue"), { t: m } = U(), d = () => {
27
+ o.value = !1, r.value && p.value === void 0 ? i.value.push(r.value) : i.value[p.value] = r.value;
28
+ }, R = () => {
29
+ var v;
30
+ (v = n.value) == null || v.validateInputs();
31
+ }, L = () => {
32
+ o.value = !1, r.value = l;
33
+ }, Z = (v) => {
34
+ p.value = v, r.value = JSON.parse(JSON.stringify(i.value[p.value])), o.value = !0;
35
+ }, ee = () => {
36
+ r.value = l, o.value = !0;
37
+ }, te = async (v) => {
38
+ const u = i.value.find((C, f) => f === v);
39
+ if (!u) {
40
+ b.open({ message: `index ${v} cannot be found`, type: "error" });
41
+ return;
42
+ }
43
+ await D({
44
+ title: m("report.setting.reportHour.deleteTitle"),
45
+ message: m("report.setting.reportHour.deleteConfirm", { name: u.name })
46
+ }) && (i.value = i.value.filter((f, P) => P !== v), i.value.find((f) => f.isDefault) || (i.value[0].isDefault = !0), r.value = l);
47
+ }, oe = (v, u) => {
48
+ v ? i.value = i.value.map(($, C) => ({
49
+ ...$,
50
+ isDefault: u === C
51
+ })) : i.value = i.value.map(($, C) => ({
52
+ ...$,
53
+ isDefault: C === 0
54
+ }));
55
+ }, { breakpoints: w } = X(), { FmSideSheet: le, FmTopSheet: ae } = I;
56
+ return (v, u) => {
57
+ const $ = h("FmTextField"), C = h("FmTimePicker"), f = h("FmButton"), P = h("FmSwitch"), se = h("FmChip"), re = h("FmCard");
58
+ return x(), k("div", null, [
59
+ (x(), M(ne(e(w).lg || e(w).md ? e(le) : e(ae)), {
60
+ modelValue: o.value,
61
+ "onUpdate:modelValue": u[3] || (u[3] = (g) => o.value = g),
62
+ "fullscreen-size": "sm",
63
+ "dismiss-away": !0
64
+ }, {
65
+ "side-sheet-header": y(() => [
66
+ t("p", null, s(e(m)("report.setting.reportHour.addTitle")), 1)
67
+ ]),
68
+ "top-sheet-header": y(() => [
69
+ t("div", ge, [
70
+ t("p", null, s(e(m)("report.setting.reportHour.addTitle")), 1)
71
+ ])
72
+ ]),
73
+ "side-sheet-footer": y(() => [
74
+ t("div", ye, [
75
+ a(f, {
76
+ label: "Save",
77
+ variant: "primary",
78
+ onClick: R
79
+ }),
80
+ a(f, {
81
+ label: "Cancel",
82
+ variant: "tertiary",
83
+ onClick: L
84
+ })
85
+ ])
86
+ ]),
87
+ "top-sheet-footer": y(() => [
88
+ t("div", he, [
89
+ a(f, {
90
+ label: "Save",
91
+ variant: "primary",
92
+ onClick: R
93
+ }),
94
+ a(f, {
95
+ label: "Cancel",
96
+ variant: "tertiary",
97
+ onClick: L
98
+ })
99
+ ])
100
+ ]),
101
+ default: y(() => [
102
+ a(e(c), {
103
+ ref_key: "form",
104
+ ref: n,
105
+ class: O(["flex flex-col gap-2", `${e(w).sm || e(w).xs ? "px-24" : ""}`]),
106
+ onValidationSuccess: d
107
+ }, {
108
+ default: y(() => {
109
+ var g, V, S, q;
110
+ return [
111
+ a($, {
112
+ modelValue: r.value.name,
113
+ "onUpdate:modelValue": u[0] || (u[0] = (_) => r.value.name = _),
114
+ label: e(m)("report.setting.reportHour.hourSetName"),
115
+ placeholder: e(m)("report.setting.reportHour.namePlaceholder"),
116
+ rules: [(_) => _ !== "" || e(m)("report.setting.reportHour.cannotBeEmpty")]
117
+ }, null, 8, ["modelValue", "label", "placeholder", "rules"]),
118
+ a(C, {
119
+ "model-value": e(z)().hour(((g = r.value.startTime) == null ? void 0 : g.hour) ?? 0).minute(((V = r.value.startTime) == null ? void 0 : V.minute) ?? 0).locale(e(F)()).format("HH:mm"),
120
+ class: "grow",
121
+ label: e(m)("report.setting.reportHour.startTime"),
122
+ "onUpdate:modelValue": u[1] || (u[1] = (_) => {
123
+ _ && (r.value.startTime.hour = Number(_.split(":")[0]), r.value.startTime.minute = Number(_.split(":")[1]));
124
+ })
125
+ }, null, 8, ["model-value", "label"]),
126
+ a(C, {
127
+ "model-value": e(z)().hour(((S = r.value.endTime) == null ? void 0 : S.hour) ?? 0).minute(((q = r.value.endTime) == null ? void 0 : q.minute) ?? 0).format("HH:mm"),
128
+ class: "grow",
129
+ label: e(m)("report.setting.reportHour.closeTime"),
130
+ "onUpdate:modelValue": u[2] || (u[2] = (_) => {
131
+ _ && (r.value.endTime.hour = Number(_.split(":")[0]), r.value.endTime.minute = Number(_.split(":")[1]));
132
+ })
133
+ }, null, 8, ["model-value", "label"])
134
+ ];
135
+ }),
136
+ _: 1
137
+ }, 8, ["class"])
138
+ ]),
139
+ _: 1
140
+ }, 8, ["modelValue"])),
141
+ t("div", xe, [
142
+ t("p", be, s(e(m)("report.setting.reportHour.title")), 1),
143
+ t("p", Ce, s(e(m)("report.setting.reportHour.description")), 1)
144
+ ]),
145
+ t("div", Ve, [
146
+ (x(!0), k(K, null, Q(i.value, (g, V) => (x(), M(re, {
147
+ key: `report_${V}`,
148
+ class: "flex p-4",
149
+ variant: "outlined"
150
+ }, {
151
+ default: y(() => [
152
+ t("div", Te, [
153
+ a(P, {
154
+ "model-value": g.isDefault,
155
+ "onUpdate:modelValue": (S) => oe(S, V)
156
+ }, null, 8, ["model-value", "onUpdate:modelValue"]),
157
+ t("div", null, [
158
+ t("p", De, [
159
+ ie(s(g.name) + " ", 1),
160
+ E(a(se, {
161
+ label: e(m)("report.common.default"),
162
+ class: "bg-fm-color-system-info-100 border-fm-color-typo-info text-fm-color-typo-info",
163
+ compact: ""
164
+ }, null, 8, ["label"]), [
165
+ [j, g.isDefault]
166
+ ])
167
+ ]),
168
+ t("p", $e, s(e(N)(g.startTime, e(F)())) + " - " + s(e(N)(g.endTime, e(F)())), 1)
169
+ ]),
170
+ u[4] || (u[4] = t("div", { class: "grow" }, null, -1)),
171
+ E(t("div", Se, [
172
+ a(f, {
173
+ icon: "edit",
174
+ variant: "tertiary",
175
+ onClick: (S) => Z(V)
176
+ }, null, 8, ["onClick"]),
177
+ a(f, {
178
+ icon: "delete",
179
+ variant: "tertiary",
180
+ onClick: (S) => te(V)
181
+ }, null, 8, ["onClick"])
182
+ ], 512), [
183
+ [j, V !== 0]
184
+ ])
185
+ ])
186
+ ]),
187
+ _: 2
188
+ }, 1024))), 128)),
189
+ t("div", null, [
190
+ a(f, {
191
+ label: e(m)("report.setting.reportHour.add"),
192
+ variant: "secondary",
193
+ icon: "add",
194
+ "icon-position": "prepend",
195
+ "border-color": e(G).ColorPrimary,
196
+ "text-color": e(G).ColorPrimary,
197
+ onClick: ee
198
+ }, null, 8, ["label", "border-color", "text-color"])
199
+ ])
200
+ ])
201
+ ]);
202
+ };
203
+ }
204
+ }), Fe = { class: "py-2 w-full gap-2 flex flex-col" }, Re = { class: "fm-typo-en-title-sm-600" }, we = /* @__PURE__ */ B({
205
+ __name: "CompareRangeSetting",
206
+ props: {
207
+ modelValue: { required: !0, default: A.PrecedingPeriod },
208
+ modelModifiers: {}
209
+ },
210
+ emits: ["update:modelValue"],
211
+ setup(T) {
212
+ const { t: o } = U(), p = J(T, "modelValue"), l = Object.values(A).map((c) => ({
213
+ label: o(`report.compare.${c}`),
214
+ value: c
215
+ })).slice(0, -1);
216
+ return (c, n) => (x(), k("div", Fe, [
217
+ t("p", Re, s(e(o)("report.setting.summary.comparisonDateRange")), 1),
218
+ a(Y, {
219
+ modelValue: p.value,
220
+ "onUpdate:modelValue": n[0] || (n[0] = (D) => p.value = D),
221
+ label: e(o)("report.setting.summary.comparisonDateRange"),
222
+ items: e(l),
223
+ "disable-search": !0
224
+ }, null, 8, ["modelValue", "label", "items"])
225
+ ]));
226
+ }
227
+ }), He = { class: "py-2 w-full gap-2 flex flex-col" }, Oe = { class: "fm-typo-en-title-sm-600" }, Ne = /* @__PURE__ */ B({
228
+ __name: "DateRangeSetting",
229
+ props: {
230
+ modelValue: { required: !0 },
231
+ modelModifiers: {}
232
+ },
233
+ emits: ["update:modelValue"],
234
+ setup(T) {
235
+ const { t: o } = U(), p = J(T, "modelValue"), l = Object.values(pe).filter((c) => !["This month", "Last month"].includes(c)).map((c) => ({
236
+ label: o(`report.date.${c}`),
237
+ value: c
238
+ }));
239
+ return (c, n) => (x(), k("div", He, [
240
+ t("p", Oe, s(e(o)("report.setting.summary.defaultDateRange")), 1),
241
+ a(Y, {
242
+ modelValue: p.value,
243
+ "onUpdate:modelValue": n[0] || (n[0] = (D) => p.value = D),
244
+ label: e(o)("report.setting.summary.defaultDateRange"),
245
+ items: e(l),
246
+ "disable-search": !0
247
+ }, null, 8, ["modelValue", "label", "items"])
248
+ ]));
249
+ }
250
+ }), Be = { class: "w-2/4" }, Ue = { class: "fm-typo-en-title-sm-600" }, Pe = { class: "text-fm-color-typo-secondary" }, Me = { class: "fm-typo-en-body-lg-600" }, Ee = { class: "text-fm-color-typo-secondary" }, je = { class: "fm-typo-en-body-lg-600" }, Je = { class: "text-fm-color-typo-secondary" }, Le = { class: "fm-typo-en-body-lg-600" }, Ye = /* @__PURE__ */ B({
251
+ __name: "Setting",
252
+ setup(T) {
253
+ const { breakpoints: o } = X(), p = ce(), { defaultDateSetting: l } = _e(p), c = W(), { t: n } = U();
254
+ return me(
255
+ [
256
+ () => l.value.defaultCompareType,
257
+ () => l.value.defaultDateRange,
258
+ () => l.value.timeOptions
259
+ ],
260
+ () => {
261
+ l.value.timeOptions.length === 0 ? c.open({ message: n("report.setting.reportHour.cannotBeEmptyError"), type: "error" }) : p.createOrUpdateBusinessSetting(l.value);
262
+ },
263
+ { deep: !0 }
264
+ ), (D, b) => {
265
+ const r = h("FmPageHead"), i = h("FmMenuDivider"), m = h("FmCard");
266
+ return x(), M(de, null, {
267
+ default: y(() => [
268
+ a(r, { title: "Settings" }),
269
+ t("div", {
270
+ class: O(`${e(o).sm || e(o).xs ? "pb-20" : ""} overflow-y-auto flex`),
271
+ style: ue({ height: `calc(100% - ${e(o).sm || e(o).xs ? 60 : 72}px)` })
272
+ }, [
273
+ t("div", {
274
+ class: O(`${e(o).lg || e(o).md ? "px-24" : "px-3"} w-full flex flex-col gap-[40px]`)
275
+ }, [
276
+ a(ke, {
277
+ modelValue: e(l).timeOptions,
278
+ "onUpdate:modelValue": b[0] || (b[0] = (d) => e(l).timeOptions = d)
279
+ }, null, 8, ["modelValue"]),
280
+ a(Ne, {
281
+ modelValue: e(l).defaultDateRange,
282
+ "onUpdate:modelValue": b[1] || (b[1] = (d) => e(l).defaultDateRange = d)
283
+ }, null, 8, ["modelValue"]),
284
+ a(we, {
285
+ modelValue: e(l).defaultCompareType,
286
+ "onUpdate:modelValue": b[2] || (b[2] = (d) => e(l).defaultCompareType = d)
287
+ }, null, 8, ["modelValue"])
288
+ ], 2),
289
+ E(t("div", Be, [
290
+ a(m, {
291
+ variant: "outlined",
292
+ class: O(["flex flex-col gap-3", `${e(o).lg || e(o).md ? "mr-5 p-6" : ""}`])
293
+ }, {
294
+ default: y(() => [
295
+ t("p", Ue, s(e(n)("report.setting.summary.title")), 1),
296
+ a(i),
297
+ t("p", Pe, s(e(n)("report.setting.summary.reportHour")), 1),
298
+ (x(!0), k(K, null, Q(e(l).timeOptions, (d, R) => (x(), k("div", { key: R }, [
299
+ t("p", Me, s(d.name) + s(d.isDefault ? `(${e(n)("report.setting.reportHour.default")})` : "") + " " + s(e(N)(d.startTime, e(F)())) + " " + s(e(N)(d.endTime, e(F)())) + " " + s(e(fe)(d.startTime, d.endTime)), 1)
300
+ ]))), 128)),
301
+ t("p", Ee, s(e(n)("report.setting.summary.defaultDateRange")), 1),
302
+ t("p", je, s(e(n)(`report.date.${e(l).defaultDateRange ?? ""}`)), 1),
303
+ t("p", Je, s(e(n)("report.setting.summary.comparisonDateRange")), 1),
304
+ t("p", Le, s(e(n)(`report.compare.${e(l).defaultCompareType ?? ""}`)), 1)
305
+ ]),
306
+ _: 1
307
+ }, 8, ["class"])
308
+ ], 512), [
309
+ [j, e(o).lg || e(o).md]
310
+ ])
311
+ ], 6)
312
+ ]),
313
+ _: 1
314
+ });
315
+ };
316
+ }
317
+ });
318
+ export {
319
+ Ye as default
320
+ };