@feedmepos/mf-report 5.27.13 → 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.
Files changed (30) hide show
  1. package/dist/{App-BlHs_KyM.js → App-CcdMlfSd.js} +96 -95
  2. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-OQRT1HAp.js +389 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CxR3luuJ.js → Default.vue_vue_type_script_setup_true_lang-BoZCI7kN.js} +1 -1
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DJTZFtNV.js +5079 -0
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-oCAIT-ax.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-faQ1wSGW.js} +5193 -4810
  6. package/dist/{InsightView-N5Lzz_b4.js → InsightView-B7hXryQe.js} +4 -4
  7. package/dist/{Integration-BotRTI4i.js → Integration-Cm0DNd94.js} +3 -3
  8. package/dist/{Integrations-B26o5QXd.js → Integrations-s2XnL_lQ.js} +2 -2
  9. package/dist/{Layout-6NKUqxol.js → Layout-BaxsdPkO.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BijCez3Y.js → MenuTab.vue_vue_type_script_setup_true_lang-D-uVoZ83.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CA9MugVT.js → NavigationTab.vue_vue_type_script_setup_true_lang-40Mxqpsi.js} +2795 -2779
  12. package/dist/{OverviewView-vdfq-4MN.js → OverviewView-YYCDda7Z.js} +4 -4
  13. package/dist/{Report-Dz8mKOpQ.js → Report-fQv1rMXB.js} +3 -3
  14. package/dist/ReportEditor-BQi5vZ5G.js +1828 -0
  15. package/dist/{ReportView-DHNMt0BV.js → ReportView-CePzSNVf.js} +6 -6
  16. package/dist/{Setting-Cpy5DtfI.js → Setting-DA1IUerO.js} +14 -14
  17. package/dist/{Template-6U_iB8qy.js → Template-BNwoCMjJ.js} +3 -3
  18. package/dist/TileEditor-EBbG7Odu.js +4064 -0
  19. package/dist/TileGrid.vue_vue_type_script_setup_true_lang-BseyYYvj.js +154 -0
  20. package/dist/{TransitionFade-C7B6bWjS.js → TransitionFade-vNYa-qkr.js} +760 -828
  21. package/dist/{app-Dz4qiCQj.js → app-D2QVuN8P.js} +388 -291
  22. package/dist/app.js +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useRestaurantPermission-DDTn3OLP.js → useRestaurantPermission-qFfSh5xv.js} +1 -1
  25. package/package.json +1 -1
  26. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-B9yWyW2A.js +0 -383
  27. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BZdgw5zR.js +0 -4922
  28. package/dist/ReportEditor-CSq4R2KR.js +0 -1826
  29. package/dist/TileEditor-REt2Wbx9.js +0 -4036
  30. package/dist/TileGrid.vue_vue_type_script_setup_true_lang-D0rrgUXG.js +0 -152
@@ -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-CA9MugVT.js";
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";