@feedmepos/mf-report 5.27.13-beta.0 → 5.27.14-beta.0
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.
- package/dist/{App-ApkZ-DlH.js → App-CcdMlfSd.js} +47 -46
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-OQRT1HAp.js +389 -0
- package/dist/{Default.vue_vue_type_script_setup_true_lang-BKA2gTcF.js → Default.vue_vue_type_script_setup_true_lang-BoZCI7kN.js} +1 -1
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DJTZFtNV.js +5079 -0
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-2IwHfDHF.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-faQ1wSGW.js} +5193 -4810
- package/dist/{InsightView-CKMKQoJY.js → InsightView-B7hXryQe.js} +4 -4
- package/dist/{Integration-CWpo4oHm.js → Integration-Cm0DNd94.js} +3 -3
- package/dist/{Integrations-R80AIGPp.js → Integrations-s2XnL_lQ.js} +2 -2
- package/dist/{Layout-Bv8YMshv.js → Layout-BaxsdPkO.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DUlUnB6s.js → MenuTab.vue_vue_type_script_setup_true_lang-D-uVoZ83.js} +4 -4
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-TmoI4Hul.js → NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js} +2795 -2779
- package/dist/{OverviewView-Dq8qLG4l.js → OverviewView-YYCDda7Z.js} +4 -4
- package/dist/{Report-BhxIh6t4.js → Report-fQv1rMXB.js} +3 -3
- package/dist/ReportEditor-BQi5vZ5G.js +1828 -0
- package/dist/{ReportView-S9VhPpPU.js → ReportView-CePzSNVf.js} +6 -6
- package/dist/{Setting-Ckunjdpf.js → Setting-DA1IUerO.js} +14 -14
- package/dist/{Template-D294v9dv.js → Template-BNwoCMjJ.js} +3 -3
- package/dist/TileEditor-EBbG7Odu.js +4064 -0
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-BseyYYvj.js +154 -0
- package/dist/{TransitionFade-DMTsSP9O.js → TransitionFade-vNYa-qkr.js} +760 -828
- package/dist/{app-B2Kxf0WF.js → app-D2QVuN8P.js} +387 -290
- package/dist/app.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useRestaurantPermission-_SOzFhA0.js → useRestaurantPermission-qFfSh5xv.js} +1 -1
- package/package.json +1 -1
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DHhEBF3v.js +0 -383
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BWsif2Jh.js +0 -4922
- package/dist/ReportEditor-CkK3nJDz.js +0 -1826
- package/dist/TileEditor-ClDAJ6ZY.js +0 -4036
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-C0S-H5j6.js +0 -152
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as ue, resolveComponent as H, createBlock as de, openBlock as E, unref as d, isRef as ke, withCtx as W, createElementVNode as ne, createVNode as X, toDisplayString as ae, createTextVNode as Te, onMounted as le, watch as C, ref as Q, computed as oe, onBeforeMount as Ne, onBeforeUnmount as qe, createElementBlock as K, Fragment as Fe } from "vue";
|
|
2
2
|
import { detectLocale as U, useCoreStore as P } from "@feedmepos/mf-common";
|
|
3
|
-
import { d as u, u as $e, a as re, b as Be, c as se, e as xe, f as Je, s as Qe, t as G } from "./app-
|
|
3
|
+
import { d as u, u as $e, a as re, b as Be, c as se, e as xe, f as Je, s as Qe, t as G } from "./app-D2QVuN8P.js";
|
|
4
4
|
import { storeToRefs as k } from "pinia";
|
|
5
5
|
import { u as Ue, a as ze } from "./_plugin-vue_export-helper-onplcgja.js";
|
|
6
|
-
import { u as je, a as Ve } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { u as We, _ as Ke } from "./NavigationTab.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { u as je, a as Ve } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-faQ1wSGW.js";
|
|
7
|
+
import { u as We, _ as Ke } from "./NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js";
|
|
8
8
|
import { u as ie } from "./message-dialog-UoMWOnil.js";
|
|
9
9
|
import { useRoute as Pe, useRouter as Ge } from "vue-router";
|
|
10
10
|
const He = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Xe = /* @__PURE__ */ ue({
|
|
@@ -61,10 +61,10 @@ function Ye() {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
u.locale(U() === "zh-CN" ? "zh-cn" : "en");
|
|
64
|
-
const Ze = ["src"], Me = ["src"],
|
|
64
|
+
const Ze = ["src"], Me = ["src"], mt = /* @__PURE__ */ ue({
|
|
65
65
|
__name: "App",
|
|
66
66
|
setup(T) {
|
|
67
|
-
const { businessId: c, token: p, country: g } = k($e()), { sessionUser: _, currentBusiness: L, currentCountry: O, registerSidebarComponent: I } = P(), { getRestaurantAndWarehouse: N, getBusinessSetting: z, beginBusinessLoad: j, completeBusinessLoad:
|
|
67
|
+
const { businessId: c, token: p, country: g } = k($e()), { sessionUser: _, currentBusiness: L, currentCountry: O, registerSidebarComponent: I } = P(), { getRestaurantAndWarehouse: N, getBusinessSetting: z, beginBusinessLoad: j, completeBusinessLoad: me } = re(), fe = Be(), { getFeatureFlags: pe } = fe, { version: v } = k(se()), { getSettings: ge } = xe(), { promptLoader: ve } = ze(), a = Pe(), q = Ge(), w = je(), Y = We(), o = re(), b = se(), { suppressReportRouteSync: F } = k(b), { getReports: ye, getOverviewReport: Se, getReportConfig: De, currentReportId: Z } = w, { currentReportId: Ie, reports: he } = k(w), { getSchema: Re } = Ve(), { fetchSchedules: _e } = Y, { init: Le } = Je(), V = Q("v5"), $ = Q(!1), B = Q(!0), Oe = oe(() => `https://portal-v1.feedmedev.cc/b/${c.value}/report/CLOSE_UP?showHeader=false&country=${g.value.toUpperCase()}&menuOption=business-report&token=${p.value}&v2=true&reportV5Button=true`), we = oe(() => `https://report-v4.feedmedev.cc?businessId=${c.value}&country=${g.value}&token=${p.value}&reportV3Button=true`);
|
|
68
68
|
C(
|
|
69
69
|
[() => L.value, () => _.value, () => O.value],
|
|
70
70
|
() => {
|
|
@@ -97,7 +97,7 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
97
97
|
}), Ne(() => {
|
|
98
98
|
I(Ke);
|
|
99
99
|
}), le(() => {
|
|
100
|
-
console.log("5.27.
|
|
100
|
+
console.log("5.27.14-beta.0", !0), window.addEventListener("message", M), window.addEventListener("message", ee);
|
|
101
101
|
}), qe(() => {
|
|
102
102
|
window.removeEventListener("message", M), window.removeEventListener("message", ee), w.$dispose(), Y.$dispose();
|
|
103
103
|
});
|
|
@@ -113,14 +113,14 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
113
113
|
const e = t.includes("%") ? [t, be(t)] : [t];
|
|
114
114
|
for (const n of e)
|
|
115
115
|
try {
|
|
116
|
-
const
|
|
117
|
-
if (typeof
|
|
116
|
+
const r = JSON.parse(n);
|
|
117
|
+
if (typeof r == "string")
|
|
118
118
|
try {
|
|
119
|
-
return JSON.parse(
|
|
119
|
+
return JSON.parse(r);
|
|
120
120
|
} catch {
|
|
121
|
-
return
|
|
121
|
+
return r;
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return r;
|
|
124
124
|
} catch {
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -130,33 +130,33 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
130
130
|
return typeof e.hour == "number" && typeof e.minute == "number";
|
|
131
131
|
}
|
|
132
132
|
function Ae(t = a.query) {
|
|
133
|
-
const e = t, n = e.startDate ? u(e.startDate).startOf("day").toISOString() : void 0,
|
|
133
|
+
const e = t, n = e.startDate ? u(e.startDate).startOf("day").toISOString() : void 0, r = e.endDate ? u(e.endDate).endOf("day").toISOString() : void 0, l = typeof e.timeStart == "string", i = typeof e.timeEnd == "string", m = x(e.timeStart), y = x(e.timeEnd), f = te(m) ? m : null, J = te(y) ? y : null, A = 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;
|
|
134
134
|
let D = [];
|
|
135
135
|
if (h)
|
|
136
|
-
D =
|
|
136
|
+
D = o.selectedLocationIds ?? [];
|
|
137
137
|
else {
|
|
138
|
-
const
|
|
139
|
-
D = Array.isArray(
|
|
138
|
+
const s = x(e.locationIds);
|
|
139
|
+
D = Array.isArray(s) ? s : [];
|
|
140
140
|
}
|
|
141
141
|
let R = e.reportId || Z;
|
|
142
|
-
if (he.value.find((
|
|
143
|
-
const
|
|
144
|
-
(
|
|
142
|
+
if (he.value.find((s) => s.id === R) || (R = Z), R && R !== w.currentReportId && w.updateCurrentReportId(R), n || r) {
|
|
143
|
+
const s = o.dateRange;
|
|
144
|
+
(s.startDate !== n || s.endDate !== r) && o.setDateRange({ startDate: n, endDate: r });
|
|
145
145
|
}
|
|
146
146
|
if (l || i) {
|
|
147
|
-
const
|
|
148
|
-
(
|
|
147
|
+
const s = o.timeRange;
|
|
148
|
+
(s.start !== f || s.end !== J) && o.setTimeRange({ start: f, end: J });
|
|
149
149
|
}
|
|
150
150
|
if (A || S) {
|
|
151
|
-
const
|
|
152
|
-
(
|
|
151
|
+
const s = o.compareDateRange;
|
|
152
|
+
(s.startDate !== A || s.endDate !== S) && o.setCompareDateRange({
|
|
153
153
|
startDate: A,
|
|
154
154
|
endDate: S
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
if (!h) {
|
|
158
|
-
const
|
|
159
|
-
|
|
158
|
+
const s = o.selectedLocationIds;
|
|
159
|
+
s.length === D.length && s.every((Ee, Ce) => Ee === D[Ce]) || o.setSelectedLocationIds(D);
|
|
160
160
|
}
|
|
161
161
|
return {
|
|
162
162
|
// TODO: this returned value can used for getBusinessSetting
|
|
@@ -176,21 +176,21 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
176
176
|
async (t, e) => {
|
|
177
177
|
if (t !== "") {
|
|
178
178
|
$.value = !1, j(t);
|
|
179
|
-
const n = "mf-report-prev-business-id",
|
|
179
|
+
const n = "mf-report-prev-business-id", r = (() => {
|
|
180
180
|
try {
|
|
181
181
|
return sessionStorage.getItem(n);
|
|
182
182
|
} catch {
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
|
-
})(), l = !!
|
|
186
|
-
let i = { ...a.query },
|
|
185
|
+
})(), l = !!r && r !== t;
|
|
186
|
+
let i = { ...a.query }, m = !1;
|
|
187
187
|
if (!B.value || e !== void 0 || l) {
|
|
188
|
-
|
|
189
|
-
const { locationIds: y, ...
|
|
188
|
+
o.setSelectedLocationIds([]);
|
|
189
|
+
const { locationIds: y, ...f } = a.query;
|
|
190
190
|
i = {
|
|
191
|
-
...
|
|
191
|
+
...f,
|
|
192
192
|
isAllLocation: "true"
|
|
193
|
-
},
|
|
193
|
+
}, m = !0, await q.replace({
|
|
194
194
|
name: a.name,
|
|
195
195
|
params: a.params,
|
|
196
196
|
query: i
|
|
@@ -208,7 +208,7 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
208
208
|
name: "reports",
|
|
209
209
|
query: a.query
|
|
210
210
|
});
|
|
211
|
-
const
|
|
211
|
+
const f = b.canAccess(
|
|
212
212
|
G.report_accessOverview
|
|
213
213
|
), J = b.canAccess(
|
|
214
214
|
G.report_accessSetting
|
|
@@ -225,7 +225,7 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
225
225
|
})()
|
|
226
226
|
)
|
|
227
227
|
];
|
|
228
|
-
if (
|
|
228
|
+
if (f && S.push(Se()), A && S.push(ge()), await Promise.all(S), J && await z(), Ae(i), m) {
|
|
229
229
|
const { locationIds: h, ...D } = a.query;
|
|
230
230
|
(a.query.locationIds !== void 0 || a.query.isAllLocation !== "true") && await q.replace({
|
|
231
231
|
name: a.name,
|
|
@@ -236,7 +236,7 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
me(t);
|
|
240
240
|
try {
|
|
241
241
|
sessionStorage.setItem(n, t);
|
|
242
242
|
} catch {
|
|
@@ -250,10 +250,11 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
250
250
|
), C(
|
|
251
251
|
() => ($.value, {
|
|
252
252
|
reportId: Ie.value,
|
|
253
|
-
selectedLocationIds:
|
|
254
|
-
dateRange:
|
|
255
|
-
timeRange:
|
|
256
|
-
compareDateRange:
|
|
253
|
+
selectedLocationIds: o.selectedLocationIds,
|
|
254
|
+
dateRange: o.dateRange,
|
|
255
|
+
timeRange: o.timeRange,
|
|
256
|
+
compareDateRange: o.compareDateRange,
|
|
257
|
+
timezone: o.timezone
|
|
257
258
|
}),
|
|
258
259
|
(t) => {
|
|
259
260
|
if (!$.value || !t.reportId || B.value) return;
|
|
@@ -261,19 +262,19 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
261
262
|
F.value = !1;
|
|
262
263
|
return;
|
|
263
264
|
}
|
|
264
|
-
const e = t.selectedLocationIds, n = t.dateRange,
|
|
265
|
+
const e = t.selectedLocationIds, n = t.dateRange, r = t.timeRange, l = t.compareDateRange, i = {
|
|
265
266
|
...a.query,
|
|
266
267
|
reportId: t.reportId,
|
|
267
268
|
startDate: n.startDate ? u(n.startDate).startOf("day").toISOString() : void 0,
|
|
268
269
|
endDate: n.endDate ? u(n.endDate).endOf("day").toISOString() : void 0,
|
|
269
270
|
compareStartDate: l.startDate ? u(l.startDate).startOf("day").toISOString() : void 0,
|
|
270
271
|
compareEndDate: l.endDate ? u(l.endDate).endOf("day").toISOString() : void 0,
|
|
271
|
-
timeStart:
|
|
272
|
-
timeEnd:
|
|
273
|
-
},
|
|
274
|
-
i.isAllLocation = String(
|
|
275
|
-
const y = JSON.stringify(a.query),
|
|
276
|
-
y !==
|
|
272
|
+
timeStart: r.start ? JSON.stringify(r.start) : void 0,
|
|
273
|
+
timeEnd: r.end ? JSON.stringify(r.end) : void 0
|
|
274
|
+
}, m = e.length === o.locations.length;
|
|
275
|
+
i.isAllLocation = String(m), m ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
|
|
276
|
+
const y = JSON.stringify(a.query), f = JSON.stringify(i);
|
|
277
|
+
y !== f && q.replace({
|
|
277
278
|
name: a.name,
|
|
278
279
|
params: a.params,
|
|
279
280
|
query: i
|
|
@@ -298,5 +299,5 @@ const Ze = ["src"], Me = ["src"], ft = /* @__PURE__ */ ue({
|
|
|
298
299
|
}
|
|
299
300
|
});
|
|
300
301
|
export {
|
|
301
|
-
|
|
302
|
+
mt as default
|
|
302
303
|
};
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { defineComponent as j, resolveComponent as R, createBlock as v, openBlock as h, normalizeClass as W, withCtx as $, createCommentVNode as p, createElementVNode as M, toDisplayString as X, renderSlot as q, mergeModels as E, useModel as P, ref as I, watch as F, createElementBlock as G, unref as g, createVNode as L } from "vue";
|
|
2
|
+
import { d as f, a as H, U as K, C as J } from "./app-D2QVuN8P.js";
|
|
3
|
+
import { detectLocale as k } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as Q } from "./_plugin-vue_export-helper-onplcgja.js";
|
|
5
|
+
import { storeToRefs as Z } from "pinia";
|
|
6
|
+
const ee = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), ae = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), te = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), re = /[^\p{L}\d]+/giu, A = "$1\0$2", z = "";
|
|
7
|
+
function N(a) {
|
|
8
|
+
let e = a.trim();
|
|
9
|
+
e = e.replace(ee, A).replace(ae, A), e = e.replace(re, "\0");
|
|
10
|
+
let t = 0, r = e.length;
|
|
11
|
+
for (; e.charAt(t) === "\0"; )
|
|
12
|
+
t++;
|
|
13
|
+
if (t === r)
|
|
14
|
+
return [];
|
|
15
|
+
for (; e.charAt(r - 1) === "\0"; )
|
|
16
|
+
r--;
|
|
17
|
+
return e.slice(t, r).split(/\0/g);
|
|
18
|
+
}
|
|
19
|
+
function ne(a) {
|
|
20
|
+
const e = N(a);
|
|
21
|
+
for (let t = 0; t < e.length; t++) {
|
|
22
|
+
const r = e[t], n = te.exec(r);
|
|
23
|
+
if (n) {
|
|
24
|
+
const c = n.index + (n[1] ?? n[2]).length;
|
|
25
|
+
e.splice(t, 1, r.slice(0, c), r.slice(c));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return e;
|
|
29
|
+
}
|
|
30
|
+
function ge(a, e) {
|
|
31
|
+
const [t, r, n] = T(a, e), c = S(e == null ? void 0 : e.locale), s = Y(e == null ? void 0 : e.locale), l = e != null && e.mergeAmbiguousCharacters ? b(c, s) : V(c, s);
|
|
32
|
+
return t + r.map((d, u) => u === 0 ? c(d) : l(d, u)).join((e == null ? void 0 : e.delimiter) ?? "") + n;
|
|
33
|
+
}
|
|
34
|
+
function he(a, e) {
|
|
35
|
+
const [t, r, n] = T(a, e), c = S(e == null ? void 0 : e.locale), s = Y(e == null ? void 0 : e.locale), l = e != null && e.mergeAmbiguousCharacters ? b(c, s) : V(c, s);
|
|
36
|
+
return t + r.map(l).join((e == null ? void 0 : e.delimiter) ?? "") + n;
|
|
37
|
+
}
|
|
38
|
+
function ve(a, e) {
|
|
39
|
+
const [t, r, n] = T(a, e), c = S(e == null ? void 0 : e.locale), s = Y(e == null ? void 0 : e.locale);
|
|
40
|
+
return t + r.map(b(c, s)).join((e == null ? void 0 : e.delimiter) ?? " ") + n;
|
|
41
|
+
}
|
|
42
|
+
function xe(a, e) {
|
|
43
|
+
const [t, r, n] = T(a, e), c = S(e == null ? void 0 : e.locale), s = Y(e == null ? void 0 : e.locale), l = b(c, s);
|
|
44
|
+
return t + r.map((d, u) => u === 0 ? l(d) : c(d)).join((e == null ? void 0 : e.delimiter) ?? " ") + n;
|
|
45
|
+
}
|
|
46
|
+
function S(a) {
|
|
47
|
+
return a === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(a);
|
|
48
|
+
}
|
|
49
|
+
function Y(a) {
|
|
50
|
+
return a === !1 ? (e) => e.toUpperCase() : (e) => e.toLocaleUpperCase(a);
|
|
51
|
+
}
|
|
52
|
+
function b(a, e) {
|
|
53
|
+
return (t) => `${e(t[0])}${a(t.slice(1))}`;
|
|
54
|
+
}
|
|
55
|
+
function V(a, e) {
|
|
56
|
+
return (t, r) => {
|
|
57
|
+
const n = t[0];
|
|
58
|
+
return (r > 0 && n >= "0" && n <= "9" ? "_" + n : e(n)) + a(t.slice(1));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function T(a, e = {}) {
|
|
62
|
+
const t = e.split ?? (e.separateNumbers ? ne : N), r = e.prefixCharacters ?? z, n = e.suffixCharacters ?? z;
|
|
63
|
+
let c = 0, s = a.length;
|
|
64
|
+
for (; c < a.length; ) {
|
|
65
|
+
const l = a.charAt(c);
|
|
66
|
+
if (!r.includes(l))
|
|
67
|
+
break;
|
|
68
|
+
c++;
|
|
69
|
+
}
|
|
70
|
+
for (; s > c; ) {
|
|
71
|
+
const l = s - 1, d = a.charAt(l);
|
|
72
|
+
if (!n.includes(d))
|
|
73
|
+
break;
|
|
74
|
+
s = l;
|
|
75
|
+
}
|
|
76
|
+
return [
|
|
77
|
+
a.slice(0, c),
|
|
78
|
+
t(a.slice(c, s)),
|
|
79
|
+
a.slice(s)
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
var x = /* @__PURE__ */ ((a) => (a.Year = "YEAR", a.Month = "MONTH", a.Week = "WEEK", a.Day = "DAY", a))(x || {}), le = /* @__PURE__ */ ((a) => (a.Yesterday = "YESTERDAY", a.Today = "TODAY", a))(le || {});
|
|
83
|
+
function Ce(a, e = 100) {
|
|
84
|
+
let t = null;
|
|
85
|
+
const r = function(...n) {
|
|
86
|
+
return t && clearTimeout(t), new Promise((c) => {
|
|
87
|
+
t = setTimeout(() => {
|
|
88
|
+
t = null;
|
|
89
|
+
const s = a(...n);
|
|
90
|
+
c(s);
|
|
91
|
+
}, e);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return r.cancel = () => {
|
|
95
|
+
t && (clearTimeout(t), t = null);
|
|
96
|
+
}, r;
|
|
97
|
+
}
|
|
98
|
+
function ce() {
|
|
99
|
+
return [...Array(12).keys()].map((a) => f().month(a).format("MMM"));
|
|
100
|
+
}
|
|
101
|
+
function Re(a, e, t = "") {
|
|
102
|
+
const r = (l) => /^[\x00-\x7F]*$/.test(l) ? " " : "", n = (l) => /^每年/.test(l), c = (l) => /^每周|^每週/.test(l), s = (l) => /^每月/.test(l);
|
|
103
|
+
switch (a.type) {
|
|
104
|
+
case x.Day:
|
|
105
|
+
return e("report.schedule.everyDay");
|
|
106
|
+
case x.Week: {
|
|
107
|
+
const l = e("report.schedule.everyWeek"), d = c(l);
|
|
108
|
+
let u = `${l}${r(l)}`;
|
|
109
|
+
const o = [
|
|
110
|
+
e("report.days.sunday"),
|
|
111
|
+
e("report.days.monday"),
|
|
112
|
+
e("report.days.tuesday"),
|
|
113
|
+
e("report.days.wednesday"),
|
|
114
|
+
e("report.days.thursday"),
|
|
115
|
+
e("report.days.friday"),
|
|
116
|
+
e("report.days.saturday")
|
|
117
|
+
];
|
|
118
|
+
if (a.days)
|
|
119
|
+
for (let i = 0; i < a.days.length; i++) {
|
|
120
|
+
const w = d ? o[a.days[i]].replace(/^[周週]/, "") : o[a.days[i]];
|
|
121
|
+
u = u + w + (i !== a.days.length - 1 ? "," : "");
|
|
122
|
+
}
|
|
123
|
+
return u;
|
|
124
|
+
}
|
|
125
|
+
case x.Month: {
|
|
126
|
+
const l = e("report.schedule.everyMonth"), d = s(l);
|
|
127
|
+
let u = `${l}${r(l)}`;
|
|
128
|
+
return a.days && (u = u + (d ? a.days.map((o) => `${o}日`).join(",") : a.days.join(","))), u;
|
|
129
|
+
}
|
|
130
|
+
case x.Year: {
|
|
131
|
+
if (!a.months && !a.days)
|
|
132
|
+
return e("report.schedule.customDate");
|
|
133
|
+
const l = e("report.schedule.everyYear"), d = n(l);
|
|
134
|
+
let u = `${l}${d ? " " : r(l)}`;
|
|
135
|
+
if (a.months) {
|
|
136
|
+
const o = ce();
|
|
137
|
+
u = u + a.months.map((i) => o[i - 1]).join(",");
|
|
138
|
+
}
|
|
139
|
+
return a.months && a.days && (u = d ? `${u} 的 ` : `${u} ${e("report.common.and")} `), a.days && (u = u + (d ? a.days.map((o) => `${o}日`).join(",") : a.days.join(","))), u;
|
|
140
|
+
}
|
|
141
|
+
default:
|
|
142
|
+
return t;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function _(a = {
|
|
146
|
+
startDate: null,
|
|
147
|
+
endDate: null,
|
|
148
|
+
locale: "en-US",
|
|
149
|
+
timezone: void 0
|
|
150
|
+
}) {
|
|
151
|
+
if (!a.startDate || !a.endDate)
|
|
152
|
+
return "No comparison";
|
|
153
|
+
let e = f().subtract(1, "day").endOf("day"), t = f().endOf("day");
|
|
154
|
+
return a.startDate && (e = a.timezone ? f(a.startDate).tz(a.timezone).locale(a.locale) : f(a.startDate).locale(a.locale)), a.endDate && (t = a.timezone ? f(a.endDate).tz(a.timezone).locale(a.locale) : f(a.endDate).locale(a.locale)), e.format("YYYY") !== t.format("YYYY") ? `${e.format("DD MMM YYYY")} - ${t.format("DD MMM YYYY")}` : `${e.format("DD MMM")} - ${t.format("DD MMM YYYY")}`;
|
|
155
|
+
}
|
|
156
|
+
function pe(a = {
|
|
157
|
+
startTime: null,
|
|
158
|
+
endTime: null,
|
|
159
|
+
locale: "en-US"
|
|
160
|
+
}) {
|
|
161
|
+
const e = "hh:mmA", { startTime: t, endTime: r, locale: n } = a;
|
|
162
|
+
if (!t || !r) return "";
|
|
163
|
+
const c = f().set("hour", t.hour).set("minute", t.minute).locale(n), s = f().set("hour", r.hour).set("minute", r.minute).locale(n);
|
|
164
|
+
return `${c.format(e)}-${s.format(e)}`;
|
|
165
|
+
}
|
|
166
|
+
const se = { class: "fm-typo-en-body-md-600 flex items-center gap-1 flex-1 min-w-0" }, ue = { class: "text-ellipsis overflow-hidden whitespace-nowrap flex-1 min-w-0" }, de = { class: "whitespace-nowrap flex-none" }, O = /* @__PURE__ */ j({
|
|
167
|
+
__name: "FilterChip",
|
|
168
|
+
props: {
|
|
169
|
+
label: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: ""
|
|
172
|
+
},
|
|
173
|
+
leftIcon: {
|
|
174
|
+
type: String,
|
|
175
|
+
default: ""
|
|
176
|
+
},
|
|
177
|
+
rightIcon: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: ""
|
|
180
|
+
},
|
|
181
|
+
trailingIcon: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: ""
|
|
184
|
+
},
|
|
185
|
+
loading: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: !1
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
setup(a) {
|
|
191
|
+
const e = a;
|
|
192
|
+
return (t, r) => {
|
|
193
|
+
const n = R("FmIcon"), c = R("FmCircularProgress"), s = R("FmChip");
|
|
194
|
+
return h(), v(s, {
|
|
195
|
+
"aria-busy": e.loading,
|
|
196
|
+
class: W([
|
|
197
|
+
"bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400 max-w-[400px] flex items-center gap-1 transition-opacity",
|
|
198
|
+
e.loading && "opacity-80"
|
|
199
|
+
])
|
|
200
|
+
}, {
|
|
201
|
+
default: $(() => [
|
|
202
|
+
a.leftIcon ? (h(), v(n, {
|
|
203
|
+
key: 0,
|
|
204
|
+
name: e.leftIcon,
|
|
205
|
+
size: "sm",
|
|
206
|
+
outline: "",
|
|
207
|
+
class: "flex-none"
|
|
208
|
+
}, null, 8, ["name"])) : p("", !0),
|
|
209
|
+
M("div", se, [
|
|
210
|
+
M("span", ue, X(e.label), 1),
|
|
211
|
+
a.rightIcon ? (h(), v(n, {
|
|
212
|
+
key: 0,
|
|
213
|
+
name: a.rightIcon,
|
|
214
|
+
size: "sm",
|
|
215
|
+
outline: "",
|
|
216
|
+
class: "flex-none"
|
|
217
|
+
}, null, 8, ["name"])) : p("", !0),
|
|
218
|
+
M("span", de, [
|
|
219
|
+
q(t.$slots, "default")
|
|
220
|
+
]),
|
|
221
|
+
e.loading ? (h(), v(c, {
|
|
222
|
+
key: 1,
|
|
223
|
+
size: "md",
|
|
224
|
+
class: "flex-none scale-75"
|
|
225
|
+
})) : a.trailingIcon ? (h(), v(n, {
|
|
226
|
+
key: 2,
|
|
227
|
+
name: a.trailingIcon,
|
|
228
|
+
size: "sm",
|
|
229
|
+
outline: "",
|
|
230
|
+
class: "flex-none"
|
|
231
|
+
}, null, 8, ["name"])) : p("", !0)
|
|
232
|
+
])
|
|
233
|
+
]),
|
|
234
|
+
_: 3
|
|
235
|
+
}, 8, ["aria-busy", "class"]);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
}), oe = { class: "flex gap-2 items-center" }, U = "YYYY-MM-DD", Se = /* @__PURE__ */ j({
|
|
239
|
+
__name: "DateRangeSelect",
|
|
240
|
+
props: /* @__PURE__ */ E({
|
|
241
|
+
compare: {
|
|
242
|
+
type: Boolean,
|
|
243
|
+
default: !1
|
|
244
|
+
},
|
|
245
|
+
datePredefinedRanges: {
|
|
246
|
+
type: Array,
|
|
247
|
+
default: () => K()
|
|
248
|
+
},
|
|
249
|
+
label: {
|
|
250
|
+
type: String,
|
|
251
|
+
required: !1,
|
|
252
|
+
default: null
|
|
253
|
+
},
|
|
254
|
+
removable: {
|
|
255
|
+
type: Boolean,
|
|
256
|
+
required: !1,
|
|
257
|
+
default: !1
|
|
258
|
+
}
|
|
259
|
+
}, {
|
|
260
|
+
compareType: {
|
|
261
|
+
type: String,
|
|
262
|
+
default: J.PRECEDING_PERIOD
|
|
263
|
+
},
|
|
264
|
+
compareTypeModifiers: {},
|
|
265
|
+
dateRange: {
|
|
266
|
+
type: Object,
|
|
267
|
+
default: () => ({
|
|
268
|
+
startDate: void 0,
|
|
269
|
+
endDate: void 0
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
dateRangeModifiers: {},
|
|
273
|
+
compareDateRange: {
|
|
274
|
+
type: Object,
|
|
275
|
+
default: () => ({
|
|
276
|
+
startDate: void 0,
|
|
277
|
+
endDate: void 0
|
|
278
|
+
})
|
|
279
|
+
},
|
|
280
|
+
compareDateRangeModifiers: {}
|
|
281
|
+
}),
|
|
282
|
+
emits: /* @__PURE__ */ E(["update", "chip-closed"], ["update:compareType", "update:dateRange", "update:compareDateRange"]),
|
|
283
|
+
setup(a, { emit: e }) {
|
|
284
|
+
const { t, locale: r } = Q();
|
|
285
|
+
function n(m) {
|
|
286
|
+
return m ? m.includes("T") ? f(m).tz(u.value).format(U) : f(m).format(U) : null;
|
|
287
|
+
}
|
|
288
|
+
const c = e, s = P(a, "compareType"), l = P(a, "dateRange"), d = P(a, "compareDateRange"), { timezone: u } = Z(H()), o = I({
|
|
289
|
+
startDate: n(l.value.startDate),
|
|
290
|
+
endDate: n(l.value.endDate)
|
|
291
|
+
}), i = I({
|
|
292
|
+
startDate: d.value.startDate ? n(d.value.startDate) : null,
|
|
293
|
+
endDate: d.value.endDate ? n(d.value.endDate) : null
|
|
294
|
+
});
|
|
295
|
+
F(
|
|
296
|
+
[() => o.value],
|
|
297
|
+
() => {
|
|
298
|
+
o.value.endDate || (o.value.endDate = o.value.startDate);
|
|
299
|
+
const m = {
|
|
300
|
+
startDate: f.tz(o.value.startDate, u.value).startOf("day").utc().toISOString(),
|
|
301
|
+
endDate: f.tz(o.value.endDate, u.value).endOf("day").utc().toISOString()
|
|
302
|
+
};
|
|
303
|
+
l.value = m, c("update", m);
|
|
304
|
+
},
|
|
305
|
+
{ deep: !0 }
|
|
306
|
+
), F([() => i.value], () => {
|
|
307
|
+
const m = i.value.startDate, y = i.value.endDate, C = m ? f(
|
|
308
|
+
m instanceof Date ? m : f(m).toDate()
|
|
309
|
+
).startOf("day").tz(u.value, !0).toISOString() : void 0, D = y ? f(y instanceof Date ? y : f(y).toDate()).tz(u.value, !0).endOf("day").toISOString() : void 0;
|
|
310
|
+
d.value = {
|
|
311
|
+
startDate: C,
|
|
312
|
+
endDate: D
|
|
313
|
+
};
|
|
314
|
+
});
|
|
315
|
+
function w(m) {
|
|
316
|
+
s.value = m;
|
|
317
|
+
}
|
|
318
|
+
function B(m) {
|
|
319
|
+
c("chip-closed", m);
|
|
320
|
+
}
|
|
321
|
+
return (m, y) => {
|
|
322
|
+
const C = R("FmSimpleDateRangePicker");
|
|
323
|
+
return h(), G("div", oe, [
|
|
324
|
+
(h(), v(C, {
|
|
325
|
+
key: `date-picker-${g(r)}`,
|
|
326
|
+
modelValue: o.value,
|
|
327
|
+
"onUpdate:modelValue": y[1] || (y[1] = (D) => o.value = D),
|
|
328
|
+
"show-predefined-range": "",
|
|
329
|
+
"predefined-range": a.datePredefinedRanges.map((D) => ({
|
|
330
|
+
...D,
|
|
331
|
+
label: g(t)(`report.date.${D.label}`)
|
|
332
|
+
})),
|
|
333
|
+
class: "w-2/6"
|
|
334
|
+
}, {
|
|
335
|
+
"trigger-button": $(() => [
|
|
336
|
+
L(O, {
|
|
337
|
+
"left-icon": a.label ? "filter_alt" : "calendar_month",
|
|
338
|
+
label: a.label ?? g(_)({
|
|
339
|
+
startDate: o.value.startDate ?? "",
|
|
340
|
+
endDate: o.value.endDate ?? "",
|
|
341
|
+
locale: g(k)()
|
|
342
|
+
}),
|
|
343
|
+
removable: a.removable,
|
|
344
|
+
onChipClosed: y[0] || (y[0] = (D) => B(!0))
|
|
345
|
+
}, null, 8, ["left-icon", "label", "removable"])
|
|
346
|
+
]),
|
|
347
|
+
_: 1
|
|
348
|
+
}, 8, ["modelValue", "predefined-range"])),
|
|
349
|
+
a.compare ? (h(), v(C, {
|
|
350
|
+
key: `compare-date-picker-${g(r)}`,
|
|
351
|
+
modelValue: i.value,
|
|
352
|
+
"onUpdate:modelValue": y[2] || (y[2] = (D) => i.value = D),
|
|
353
|
+
"compare-type": s.value,
|
|
354
|
+
"onUpdate:compareType": y[3] || (y[3] = (D) => s.value = D),
|
|
355
|
+
"show-predefined-range": "",
|
|
356
|
+
"compare-target": o.value,
|
|
357
|
+
"default-compare-type": s.value,
|
|
358
|
+
onSelectComparison: w
|
|
359
|
+
}, {
|
|
360
|
+
"trigger-button": $(() => [
|
|
361
|
+
L(O, {
|
|
362
|
+
label: `${g(t)("report.common.compare")}: ${g(_)({
|
|
363
|
+
startDate: i.value.startDate ?? null,
|
|
364
|
+
endDate: i.value.endDate ?? null,
|
|
365
|
+
locale: g(k)()
|
|
366
|
+
})}`
|
|
367
|
+
}, null, 8, ["label"])
|
|
368
|
+
]),
|
|
369
|
+
_: 1
|
|
370
|
+
}, 8, ["modelValue", "compare-type", "compare-target", "default-compare-type"])) : p("", !0)
|
|
371
|
+
]);
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
export {
|
|
376
|
+
x as C,
|
|
377
|
+
Se as _,
|
|
378
|
+
ge as a,
|
|
379
|
+
le as b,
|
|
380
|
+
ve as c,
|
|
381
|
+
Ce as d,
|
|
382
|
+
Re as e,
|
|
383
|
+
O as f,
|
|
384
|
+
ce as g,
|
|
385
|
+
pe as h,
|
|
386
|
+
_ as i,
|
|
387
|
+
he as p,
|
|
388
|
+
xe as s
|
|
389
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as u, computed as p, resolveComponent as f, createElementBlock as s, openBlock as t, normalizeStyle as n, normalizeClass as d, unref as e, createBlock as y, createCommentVNode as _, createVNode as h, createElementVNode as k, toDisplayString as g, renderSlot as x } from "vue";
|
|
2
|
-
import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js";
|
|
3
3
|
import { useBreakpoints as b } from "@feedmepos/ui-library";
|
|
4
4
|
import { storeToRefs as C } from "pinia";
|
|
5
5
|
import { u as q, a as w } from "./_plugin-vue_export-helper-onplcgja.js";
|