@feedmepos/mf-report 5.3.15-rc.9 → 5.4.0-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/DateRangeSelect.vue_vue_type_script_setup_true_lang-G0LCMQmy.js +148 -0
- package/dist/Default.vue_vue_type_script_setup_true_lang-U8MvQ-Uz.js +32 -0
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-WNX1hHIm.js +990 -0
- package/dist/HeaderTab.vue_vue_type_script_setup_true_lang-pwHzeuLE.js +18 -0
- package/dist/InsightView-riOJbWA9.js +9683 -0
- package/dist/Integration-jUUBKs84.js +2585 -0
- package/dist/Integrations-0JKt6eet.js +335 -0
- package/dist/Layout-W7RwCrDD.js +21 -0
- package/dist/LocationSelect.vue_vue_type_script_setup_true_lang-VTjz4xCE.js +81 -0
- package/dist/MenuTab.vue_vue_type_script_setup_true_lang-GRUzIsKG.js +240 -0
- package/dist/NoData.vue_vue_type_script_setup_true_lang-FeKqFs4A.js +30 -0
- package/dist/OverviewView-yLAxCi0u.js +78 -0
- package/dist/Report-iaMxvukU.js +402 -0
- package/dist/ReportEditor-0l6N2bUP.js +524 -0
- package/dist/ReportView-kAjlmKii.js +183 -0
- package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-6i3u0Axg.js +103 -0
- package/dist/Setting-bs2gczqL.js +326 -0
- package/dist/TileEditor-J0YjUD7R.js +2298 -0
- package/dist/TransitionFade-ryomNLIZ.js +1982 -0
- package/dist/XeroRedirect-sLBv-Aqc.js +13 -0
- package/dist/app-eKZV2PPB.js +47435 -0
- package/dist/app.js +3 -67233
- package/dist/style.css +1 -1
- package/dist/timeFormat-chUhgTmK.js +9 -0
- package/package.json +5 -5
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { defineComponent as U, mergeModels as K, useModel as N, resolveComponent as g, unref as F, openBlock as C, createBlock as I, withCtx as x, createElementVNode as r, createVNode as s, createTextVNode as O, ref as D, computed as G, createElementBlock as H, Fragment as L, h as u } from "vue";
|
|
2
|
+
import { useRouter as W, useRoute as j } from "vue-router";
|
|
3
|
+
import { I as $, r as P, s as z, c as J, b as Q, t as M, w as X, l as Y } from "./app-eKZV2PPB.js";
|
|
4
|
+
import { useBreakpoints as T, useSnackbar as Z, FmButtonColorThemeVariant as ee, components as te } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as ae } from "./SelectComponent.vue_vue_type_script_setup_true_lang-6i3u0Axg.js";
|
|
6
|
+
import { _ as oe } from "./NoData.vue_vue_type_script_setup_true_lang-FeKqFs4A.js";
|
|
7
|
+
const le = { class: "flex gap-2 overflow-hidden flex-col" }, ne = { class: "flex gap-2 overflow-hidden" }, re = { class: "flex flex-col w-full" }, se = { class: "flex flex-col gap-5 p-6" }, ie = { class: "flex" }, me = /* @__PURE__ */ U({
|
|
8
|
+
__name: "AddIntegrationDialog",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: { type: Boolean, default: !1 },
|
|
11
|
+
modelModifiers: {},
|
|
12
|
+
form: {
|
|
13
|
+
default: () => ({ name: "", platform: $.AutoCount })
|
|
14
|
+
},
|
|
15
|
+
formModifiers: {}
|
|
16
|
+
},
|
|
17
|
+
emits: /* @__PURE__ */ K(["confirm"], ["update:modelValue", "update:form"]),
|
|
18
|
+
setup(S, { emit: k }) {
|
|
19
|
+
const m = N(S, "modelValue"), l = N(S, "form"), { breakpoints: c } = T(), p = P.map((y) => ({
|
|
20
|
+
label: y.name,
|
|
21
|
+
value: y.platform,
|
|
22
|
+
sublabel: y.type
|
|
23
|
+
})), v = k;
|
|
24
|
+
function f() {
|
|
25
|
+
m.value = !1;
|
|
26
|
+
}
|
|
27
|
+
function w() {
|
|
28
|
+
v("confirm");
|
|
29
|
+
}
|
|
30
|
+
return (y, e) => {
|
|
31
|
+
const V = g("FmTextField"), _ = g("FmSelect"), b = g("FmButton"), A = g("FmDialog"), h = g("FmBottomSheet");
|
|
32
|
+
return F(c).lg || F(c).md ? (C(), I(A, {
|
|
33
|
+
key: 0,
|
|
34
|
+
modelValue: m.value,
|
|
35
|
+
"onUpdate:modelValue": e[2] || (e[2] = (n) => m.value = n),
|
|
36
|
+
overlay: !0
|
|
37
|
+
}, {
|
|
38
|
+
"dialog-header": x(() => e[6] || (e[6] = [
|
|
39
|
+
r("div", { class: "flex flex-col" }, [
|
|
40
|
+
r("p", { class: "fm-typo-en-body-lg-600" }, "Add Integration")
|
|
41
|
+
], -1)
|
|
42
|
+
])),
|
|
43
|
+
default: x(() => [
|
|
44
|
+
r("div", le, [
|
|
45
|
+
s(V, {
|
|
46
|
+
modelValue: l.value.name,
|
|
47
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => l.value.name = n),
|
|
48
|
+
label: "Name",
|
|
49
|
+
placeholder: "Enter a name"
|
|
50
|
+
}, null, 8, ["modelValue"]),
|
|
51
|
+
s(_, {
|
|
52
|
+
modelValue: l.value.platform,
|
|
53
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => l.value.platform = n),
|
|
54
|
+
label: "App",
|
|
55
|
+
items: F(p)
|
|
56
|
+
}, null, 8, ["modelValue", "items"])
|
|
57
|
+
])
|
|
58
|
+
]),
|
|
59
|
+
"dialog-footer": x(() => [
|
|
60
|
+
e[7] || (e[7] = r("div", { class: "grow" }, null, -1)),
|
|
61
|
+
s(b, {
|
|
62
|
+
label: "Cancel",
|
|
63
|
+
variant: "tertiary",
|
|
64
|
+
onClick: f
|
|
65
|
+
}),
|
|
66
|
+
s(b, {
|
|
67
|
+
label: "Add",
|
|
68
|
+
variant: "primary",
|
|
69
|
+
disabled: l.value.name === "",
|
|
70
|
+
onClick: w
|
|
71
|
+
}, null, 8, ["disabled"])
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["modelValue"])) : (C(), I(h, {
|
|
75
|
+
key: 1,
|
|
76
|
+
modelValue: m.value,
|
|
77
|
+
"onUpdate:modelValue": e[5] || (e[5] = (n) => m.value = n)
|
|
78
|
+
}, {
|
|
79
|
+
"bottom-sheet-header": x(() => e[8] || (e[8] = [
|
|
80
|
+
O("Integration")
|
|
81
|
+
])),
|
|
82
|
+
default: x(() => [
|
|
83
|
+
r("div", ne, [
|
|
84
|
+
r("div", re, [
|
|
85
|
+
r("div", se, [
|
|
86
|
+
s(V, {
|
|
87
|
+
modelValue: l.value.name,
|
|
88
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => l.value.name = n),
|
|
89
|
+
label: "Name",
|
|
90
|
+
placeholder: "Enter a name"
|
|
91
|
+
}, null, 8, ["modelValue"]),
|
|
92
|
+
s(ae, {
|
|
93
|
+
modelValue: l.value.platform,
|
|
94
|
+
"onUpdate:modelValue": e[4] || (e[4] = (n) => l.value.platform = n),
|
|
95
|
+
label: "Integration",
|
|
96
|
+
items: F(p)
|
|
97
|
+
}, null, 8, ["modelValue", "items"])
|
|
98
|
+
]),
|
|
99
|
+
r("div", ie, [
|
|
100
|
+
e[9] || (e[9] = r("div", { class: "grow" }, null, -1)),
|
|
101
|
+
s(b, {
|
|
102
|
+
label: "Cancel",
|
|
103
|
+
variant: "tertiary",
|
|
104
|
+
onClick: f
|
|
105
|
+
}),
|
|
106
|
+
s(b, {
|
|
107
|
+
label: "Add Integration",
|
|
108
|
+
variant: "primary",
|
|
109
|
+
onClick: w
|
|
110
|
+
})
|
|
111
|
+
])
|
|
112
|
+
])
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["modelValue"]));
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}), de = { class: "gap-24 px-24 py-16 h-full" }, ue = /* @__PURE__ */ U({
|
|
120
|
+
__name: "Integrations",
|
|
121
|
+
setup(S) {
|
|
122
|
+
const k = W(), m = j(), l = z(), c = Z(), { promptLoader: p } = J(), v = D(!1), f = D({ name: "", platform: $.AutoCount }), w = G(() => l.settings.reduce((a, t) => {
|
|
123
|
+
const d = P.find((o) => o.platform === t.platform.name);
|
|
124
|
+
return d && a.push({
|
|
125
|
+
id: t._id,
|
|
126
|
+
name: t.name,
|
|
127
|
+
platform: d.platform,
|
|
128
|
+
asset: d.asset,
|
|
129
|
+
type: d.type
|
|
130
|
+
}), a;
|
|
131
|
+
}, []));
|
|
132
|
+
async function y() {
|
|
133
|
+
await p(async () => {
|
|
134
|
+
await l.getSettings();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
async function e() {
|
|
138
|
+
await p(async () => {
|
|
139
|
+
try {
|
|
140
|
+
const a = await M({
|
|
141
|
+
name: f.value.name,
|
|
142
|
+
platform: {
|
|
143
|
+
name: f.value.platform
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
await l.getSettings(), v.value = !1, k.push({
|
|
147
|
+
name: "integration",
|
|
148
|
+
params: { id: a._id },
|
|
149
|
+
query: m.query
|
|
150
|
+
});
|
|
151
|
+
} catch (a) {
|
|
152
|
+
c.open({ type: "error", message: a.message });
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const { promptMessage: V } = Q();
|
|
157
|
+
async function _(a) {
|
|
158
|
+
a === "new" ? v.value = !0 : a ? k.push({
|
|
159
|
+
name: "integration",
|
|
160
|
+
params: { id: a },
|
|
161
|
+
query: m.query
|
|
162
|
+
}) : c.open({ type: "error", message: "Invalid integration" });
|
|
163
|
+
}
|
|
164
|
+
const { FmButton: b, FmMenu: A, FmMenuItem: h, FmIcon: n, FmChip: q } = te, { breakpoints: B } = T(), E = [
|
|
165
|
+
{
|
|
166
|
+
accessorKey: "name",
|
|
167
|
+
header: "Name",
|
|
168
|
+
meta: {
|
|
169
|
+
maxWidth: "50px",
|
|
170
|
+
width: "50px"
|
|
171
|
+
},
|
|
172
|
+
enableSorting: !1
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
accessorKey: "tag",
|
|
176
|
+
header: "Platform",
|
|
177
|
+
cell: (a) => {
|
|
178
|
+
const t = a.row.original;
|
|
179
|
+
return u("div", { class: "flex flex-row items-center gap-x-16" }, [
|
|
180
|
+
u("img", { src: t.asset, class: "w-[60px]" }),
|
|
181
|
+
u(
|
|
182
|
+
q,
|
|
183
|
+
{
|
|
184
|
+
class: "text-fm-color-typo-info fm-typo-en-body-sm-600",
|
|
185
|
+
compact: !0
|
|
186
|
+
},
|
|
187
|
+
{ default: () => t.type }
|
|
188
|
+
)
|
|
189
|
+
]);
|
|
190
|
+
},
|
|
191
|
+
enableSorting: !1
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
accessorKey: "",
|
|
195
|
+
id: "Action",
|
|
196
|
+
header: "",
|
|
197
|
+
meta: {
|
|
198
|
+
maxWidth: "20px"
|
|
199
|
+
},
|
|
200
|
+
enableSorting: !1,
|
|
201
|
+
cell: (a) => {
|
|
202
|
+
const t = a.row.original, d = [
|
|
203
|
+
{
|
|
204
|
+
label: "Duplicate",
|
|
205
|
+
onClick: async () => {
|
|
206
|
+
await p(async () => {
|
|
207
|
+
try {
|
|
208
|
+
const o = l.settings.find(
|
|
209
|
+
(i) => i._id === t.id
|
|
210
|
+
);
|
|
211
|
+
o && (await M({
|
|
212
|
+
...o,
|
|
213
|
+
name: `${o == null ? void 0 : o.name} cloned`
|
|
214
|
+
}), await l.getSettings());
|
|
215
|
+
} catch (o) {
|
|
216
|
+
c.open({ type: "error", message: o.message });
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
class: ""
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: "Remove",
|
|
224
|
+
onClick: async () => {
|
|
225
|
+
await V({
|
|
226
|
+
message: `Confirm delete ${t.name}?`,
|
|
227
|
+
title: "Delete"
|
|
228
|
+
}) && await p(async () => {
|
|
229
|
+
try {
|
|
230
|
+
await X(t.id), await y();
|
|
231
|
+
} catch (i) {
|
|
232
|
+
c.open({ type: "error", message: i.message });
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
class: "text-fm-color-typo-error"
|
|
237
|
+
}
|
|
238
|
+
];
|
|
239
|
+
return u(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
class: `flex ${B.value.lg || B.value.md ? "justify-end" : ""} items-center`
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
default: () => [
|
|
246
|
+
u(
|
|
247
|
+
A,
|
|
248
|
+
{ stopClickPropagation: !0 },
|
|
249
|
+
{
|
|
250
|
+
default: () => d.map(
|
|
251
|
+
(o) => u(
|
|
252
|
+
h,
|
|
253
|
+
{
|
|
254
|
+
onClick: o.onClick,
|
|
255
|
+
label: o.label,
|
|
256
|
+
class: o.class
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: () => u("p", o.label)
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
),
|
|
263
|
+
"menu-button": () => u(
|
|
264
|
+
b,
|
|
265
|
+
{
|
|
266
|
+
variant: "tertiary",
|
|
267
|
+
size: "md",
|
|
268
|
+
icon: "more_vert",
|
|
269
|
+
iconColor: ee.NeutralGray400
|
|
270
|
+
},
|
|
271
|
+
{}
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
];
|
|
281
|
+
function R(a) {
|
|
282
|
+
a === "create" && _("new");
|
|
283
|
+
}
|
|
284
|
+
return (a, t) => {
|
|
285
|
+
const d = g("FmPageHead"), o = g("FmTable");
|
|
286
|
+
return C(), H(L, null, [
|
|
287
|
+
s(me, {
|
|
288
|
+
modelValue: v.value,
|
|
289
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => v.value = i),
|
|
290
|
+
form: f.value,
|
|
291
|
+
"onUpdate:form": t[1] || (t[1] = (i) => f.value = i),
|
|
292
|
+
onConfirm: e
|
|
293
|
+
}, null, 8, ["modelValue", "form"]),
|
|
294
|
+
s(d, {
|
|
295
|
+
title: "Integration",
|
|
296
|
+
class: "h-[68px]",
|
|
297
|
+
actions: [
|
|
298
|
+
{
|
|
299
|
+
label: "Add Integration",
|
|
300
|
+
value: "create",
|
|
301
|
+
isPrimary: !0,
|
|
302
|
+
prependIcon: "add"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"onClick:action": R
|
|
306
|
+
}, {
|
|
307
|
+
description: x(() => t[3] || (t[3] = [
|
|
308
|
+
r("div", null, null, -1)
|
|
309
|
+
])),
|
|
310
|
+
_: 1
|
|
311
|
+
}),
|
|
312
|
+
r("div", de, [
|
|
313
|
+
w.value.length > 0 ? (C(), I(o, {
|
|
314
|
+
key: 0,
|
|
315
|
+
ref: "table",
|
|
316
|
+
class: "h-[500px]",
|
|
317
|
+
"row-data": w.value,
|
|
318
|
+
"column-defs": E,
|
|
319
|
+
"shrink-at": !1,
|
|
320
|
+
onRowClick: t[2] || (t[2] = (i) => {
|
|
321
|
+
_(i.original.id);
|
|
322
|
+
})
|
|
323
|
+
}, null, 8, ["row-data"])) : (C(), I(oe, {
|
|
324
|
+
key: 1,
|
|
325
|
+
title: "No integration",
|
|
326
|
+
"sub-title": "No integration can be found"
|
|
327
|
+
}))
|
|
328
|
+
])
|
|
329
|
+
], 64);
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}), be = /* @__PURE__ */ Y(ue, [["__scopeId", "data-v-91795534"]]);
|
|
333
|
+
export {
|
|
334
|
+
be as default
|
|
335
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as o, resolveComponent as t, openBlock as r, createBlock as n, withCtx as l, createElementVNode as _, createVNode as c } from "vue";
|
|
2
|
+
import { _ as a } from "./Default.vue_vue_type_script_setup_true_lang-U8MvQ-Uz.js";
|
|
3
|
+
const s = { class: "h-full w-full overflow-x-auto flex flex-col" }, d = /* @__PURE__ */ o({
|
|
4
|
+
__name: "Layout",
|
|
5
|
+
setup(f) {
|
|
6
|
+
return (u, m) => {
|
|
7
|
+
const e = t("router-view");
|
|
8
|
+
return r(), n(a, null, {
|
|
9
|
+
default: l(() => [
|
|
10
|
+
_("div", s, [
|
|
11
|
+
c(e)
|
|
12
|
+
])
|
|
13
|
+
]),
|
|
14
|
+
_: 1
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
d as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as k, mergeModels as w, useModel as C, computed as v, ref as V, resolveComponent as i, openBlock as c, createBlock as f, withCtx as p, createVNode as n, createElementVNode as y, withDirectives as S, vShow as L, createElementBlock as A, Fragment as B, renderList as D } from "vue";
|
|
2
|
+
import { a as T } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-G0LCMQmy.js";
|
|
3
|
+
import "./app-eKZV2PPB.js";
|
|
4
|
+
const $ = { class: "flex flex-col bg-fm-color-neutral-white w-[260px] max-h-[408px] overflow-y-auto" }, N = /* @__PURE__ */ k({
|
|
5
|
+
__name: "LocationSelect",
|
|
6
|
+
props: /* @__PURE__ */ w({
|
|
7
|
+
options: {
|
|
8
|
+
type: Array,
|
|
9
|
+
default: () => []
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "Location"
|
|
14
|
+
}
|
|
15
|
+
}, {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default: () => []
|
|
19
|
+
},
|
|
20
|
+
modelModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:modelValue"],
|
|
23
|
+
setup(t) {
|
|
24
|
+
const e = C(t, "modelValue"), h = v(() => {
|
|
25
|
+
var l;
|
|
26
|
+
return e.value.length === 1 ? (l = t.options.find((o) => o.id === e.value[0])) == null ? void 0 : l.name : e.value.length > 1 ? `${e.value.length} selected` : "";
|
|
27
|
+
}), r = V(""), g = v(
|
|
28
|
+
() => t.options.filter((l) => l.name.toLowerCase().includes(r.value.toLowerCase()))
|
|
29
|
+
);
|
|
30
|
+
function b(l) {
|
|
31
|
+
!!e.value.find((a) => a === l.id) ? e.value = e.value.filter((a) => a !== l.id) : e.value = [...e.value, l.id];
|
|
32
|
+
}
|
|
33
|
+
function x() {
|
|
34
|
+
e.value.length > 0 ? e.value = [] : e.value = [...t.options.map((l) => l.id)];
|
|
35
|
+
}
|
|
36
|
+
return (l, o) => {
|
|
37
|
+
const a = i("FmSearch"), m = i("FmMenuDivider"), F = i("FmMenuHeader"), d = i("FmMenuItem"), M = i("FmMenu");
|
|
38
|
+
return c(), f(M, { "close-on-click": !1 }, {
|
|
39
|
+
"menu-button": p(() => [
|
|
40
|
+
n(T, {
|
|
41
|
+
"left-icon": "storefront",
|
|
42
|
+
"right-icon": "expand_more",
|
|
43
|
+
label: h.value
|
|
44
|
+
}, null, 8, ["label"])
|
|
45
|
+
]),
|
|
46
|
+
"menu-wrapper": p(() => [
|
|
47
|
+
y("div", $, [
|
|
48
|
+
n(a, {
|
|
49
|
+
modelValue: r.value,
|
|
50
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => r.value = u),
|
|
51
|
+
placeholder: "Filter"
|
|
52
|
+
}, null, 8, ["modelValue"]),
|
|
53
|
+
n(m),
|
|
54
|
+
n(F, { label: t.label }, null, 8, ["label"]),
|
|
55
|
+
n(m),
|
|
56
|
+
S(n(d, {
|
|
57
|
+
"model-value": e.value.length === t.options.length,
|
|
58
|
+
label: "All",
|
|
59
|
+
"has-checkbox": !0,
|
|
60
|
+
indeterminate: !0,
|
|
61
|
+
onClick: x
|
|
62
|
+
}, null, 8, ["model-value"]), [
|
|
63
|
+
[L, r.value === ""]
|
|
64
|
+
]),
|
|
65
|
+
(c(!0), A(B, null, D(g.value, (u, _) => (c(), f(d, {
|
|
66
|
+
key: _,
|
|
67
|
+
"model-value": !!e.value.find((s) => s === u.id),
|
|
68
|
+
label: u.name,
|
|
69
|
+
"has-checkbox": !0,
|
|
70
|
+
onClick: (s) => b(u)
|
|
71
|
+
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
N as _
|
|
81
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { defineComponent as D, mergeModels as K, useModel as z, ref as T, resolveComponent as i, openBlock as d, createBlock as R, withCtx as _, createVNode as m, createElementVNode as u, createElementBlock as $, Fragment as w, renderList as E, createTextVNode as Q, toDisplayString as x, withDirectives as W, vShow as X, unref as l, createCommentVNode as C, isRef as V, normalizeClass as B } from "vue";
|
|
2
|
+
import { d as k, a as J } from "./app-eKZV2PPB.js";
|
|
3
|
+
import { storeToRefs as j } from "pinia";
|
|
4
|
+
import { _ as Y } from "./LocationSelect.vue_vue_type_script_setup_true_lang-VTjz4xCE.js";
|
|
5
|
+
import { a as Z, _ as ee } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-G0LCMQmy.js";
|
|
6
|
+
import { t as P, s as te } from "./timeFormat-chUhgTmK.js";
|
|
7
|
+
import { useBreakpoints as oe } from "@feedmepos/ui-library";
|
|
8
|
+
const ne = { class: "px-24 py-16 rounded-lg shadow-light-300" }, le = { class: "text-fm-color-typo-primary" }, ae = { class: "text-fm-color-typo-secondary" }, me = { class: "flex items-center justify-center w-full" }, re = { class: "flex items-center justify-center" }, se = { class: "flex flex-row mb-4 px-4 gap-2" }, ue = "HH:mm", ie = /* @__PURE__ */ D({
|
|
9
|
+
__name: "TimeRangeSelect",
|
|
10
|
+
props: /* @__PURE__ */ K({
|
|
11
|
+
defaultDateRange: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => [
|
|
14
|
+
{
|
|
15
|
+
name: "All day",
|
|
16
|
+
isDefault: !0,
|
|
17
|
+
startTime: { hour: 0, minute: 0 },
|
|
18
|
+
endTime: { hour: 23, minute: 59 }
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => ({
|
|
26
|
+
start: { hour: 0, minute: 0 },
|
|
27
|
+
end: { hour: 23, minute: 59 }
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
modelModifiers: {}
|
|
31
|
+
}),
|
|
32
|
+
emits: ["update:modelValue"],
|
|
33
|
+
setup(F) {
|
|
34
|
+
const p = z(F, "modelValue"), s = F;
|
|
35
|
+
function g(a, e = ue) {
|
|
36
|
+
return k().set("hour", a.hour).set("minute", a.minute).format(e);
|
|
37
|
+
}
|
|
38
|
+
function f(a) {
|
|
39
|
+
a && (p.value = a), n();
|
|
40
|
+
}
|
|
41
|
+
function v(a) {
|
|
42
|
+
const e = a.split(":"), b = k().set("hour", Number(e[0])).set("minute", Number(e[1]));
|
|
43
|
+
return console.log(b.format("A")), {
|
|
44
|
+
hours: Number(b.format("h")),
|
|
45
|
+
minutes: Number(b.format("m")),
|
|
46
|
+
period: b.format("A")
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const c = T(
|
|
50
|
+
s.defaultDateRange.findIndex((a) => a.isDefault) + 1
|
|
51
|
+
), t = T(JSON.parse(JSON.stringify(p.value))), h = T();
|
|
52
|
+
function n() {
|
|
53
|
+
var a;
|
|
54
|
+
(a = h.value) == null || a.hide();
|
|
55
|
+
}
|
|
56
|
+
function r(a, e) {
|
|
57
|
+
t.value.start = JSON.parse(JSON.stringify(a)), t.value.end = JSON.parse(JSON.stringify(e));
|
|
58
|
+
}
|
|
59
|
+
const G = T(!1);
|
|
60
|
+
return (a, e) => {
|
|
61
|
+
const b = i("FmChip"), N = i("FmRadio"), H = i("FmMenuDivider"), L = i("FmRadioGroup"), S = i("FmTimeInput"), M = i("FmButton"), q = i("FmPopover");
|
|
62
|
+
return d(), R(q, {
|
|
63
|
+
ref_key: "dropdownRef",
|
|
64
|
+
ref: h,
|
|
65
|
+
placement: "bottom",
|
|
66
|
+
class: "min-w-[212px]",
|
|
67
|
+
"show-popover": G.value
|
|
68
|
+
}, {
|
|
69
|
+
"popover-button": _(() => [
|
|
70
|
+
m(Z, {
|
|
71
|
+
"left-icon": "schedule",
|
|
72
|
+
label: `${g(p.value.start ?? { hour: 0, minute: 0 }, "h:mmA")} - ${g(
|
|
73
|
+
p.value.end ?? { hour: 23, minute: 59 },
|
|
74
|
+
"h:mmA"
|
|
75
|
+
)}`
|
|
76
|
+
}, null, 8, ["label"])
|
|
77
|
+
]),
|
|
78
|
+
default: _(() => {
|
|
79
|
+
var O, A, I, U;
|
|
80
|
+
return [
|
|
81
|
+
u("div", ne, [
|
|
82
|
+
m(L, {
|
|
83
|
+
modelValue: c.value,
|
|
84
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => c.value = o)
|
|
85
|
+
}, {
|
|
86
|
+
default: _(() => [
|
|
87
|
+
(d(!0), $(w, null, E(s.defaultDateRange, (o, y) => (d(), R(N, {
|
|
88
|
+
key: `range_${y}`,
|
|
89
|
+
value: y + 1,
|
|
90
|
+
onClick: (fe) => r(o.startTime, o.endTime)
|
|
91
|
+
}, {
|
|
92
|
+
label: _(() => [
|
|
93
|
+
u("p", le, [
|
|
94
|
+
Q(x(o.name) + " ", 1),
|
|
95
|
+
W(m(b, {
|
|
96
|
+
label: "Default",
|
|
97
|
+
class: "bg-fm-color-system-info-100 border-fm-color-typo-info text-fm-color-typo-info",
|
|
98
|
+
compact: ""
|
|
99
|
+
}, null, 512), [
|
|
100
|
+
[X, o.isDefault]
|
|
101
|
+
])
|
|
102
|
+
]),
|
|
103
|
+
u("p", ae, x(l(P)(o.startTime)) + " - " + x(l(P)(o.endTime)) + " " + x(l(te)(o.startTime, o.endTime)), 1)
|
|
104
|
+
]),
|
|
105
|
+
_: 2
|
|
106
|
+
}, 1032, ["value", "onClick"]))), 128)),
|
|
107
|
+
m(H),
|
|
108
|
+
m(N, {
|
|
109
|
+
key: "range_custom",
|
|
110
|
+
label: "Custom",
|
|
111
|
+
value: s.defaultDateRange.length + 1
|
|
112
|
+
}, null, 8, ["value"])
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
}, 8, ["modelValue"]),
|
|
116
|
+
c.value === s.defaultDateRange.length + 1 ? (d(), $(w, { key: 0 }, [
|
|
117
|
+
e[5] || (e[5] = u("p", { class: "fm-typo-en-body-lg-600 mb-8" }, "Starting time", -1)),
|
|
118
|
+
u("div", me, [
|
|
119
|
+
m(S, {
|
|
120
|
+
"model-value": v(`${(O = t.value.start) == null ? void 0 : O.hour}:${(A = t.value.start) == null ? void 0 : A.minute}`),
|
|
121
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => {
|
|
122
|
+
if (t.value.start) {
|
|
123
|
+
const y = l(k)(`${o.hours}:${o.minutes} ${o.period}`, "h:m A");
|
|
124
|
+
t.value.start.hour = y.get("hour"), t.value.start.minute = y.get("minute");
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
}, null, 8, ["model-value"])
|
|
128
|
+
]),
|
|
129
|
+
e[6] || (e[6] = u("p", { class: "fm-typo-en-body-lg-600 mb-8" }, "Closing time", -1)),
|
|
130
|
+
u("div", re, [
|
|
131
|
+
m(S, {
|
|
132
|
+
"model-value": v(`${(I = t.value.end) == null ? void 0 : I.hour}:${(U = t.value.end) == null ? void 0 : U.minute}`),
|
|
133
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => {
|
|
134
|
+
if (t.value.end) {
|
|
135
|
+
const y = l(k)(`${o.hours}:${o.minutes} ${o.period}`, "h:m A");
|
|
136
|
+
t.value.end.hour = y.get("hour"), t.value.end.minute = y.get("minute");
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
}, null, 8, ["model-value"])
|
|
140
|
+
])
|
|
141
|
+
], 64)) : C("", !0),
|
|
142
|
+
u("div", se, [
|
|
143
|
+
e[7] || (e[7] = u("div", { class: "grow" }, null, -1)),
|
|
144
|
+
m(M, {
|
|
145
|
+
label: "Cancel",
|
|
146
|
+
variant: "tertiary",
|
|
147
|
+
onClick: e[3] || (e[3] = (o) => n())
|
|
148
|
+
}),
|
|
149
|
+
m(M, {
|
|
150
|
+
label: "Apply",
|
|
151
|
+
onClick: e[4] || (e[4] = () => f(JSON.parse(JSON.stringify(t.value))))
|
|
152
|
+
})
|
|
153
|
+
])
|
|
154
|
+
])
|
|
155
|
+
];
|
|
156
|
+
}),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["show-popover"]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}), de = { class: "flex gap-2 items-center overflow-x-auto overflow-y-hidden scrollbar-hide" }, pe = /* @__PURE__ */ D({
|
|
162
|
+
__name: "Filter",
|
|
163
|
+
setup(F) {
|
|
164
|
+
const p = J(), { locations: s, selectedLocationIds: g } = j(J()), { dateRange: f, compareDateRange: v, timeRange: c, defaultDateSetting: t } = j(p);
|
|
165
|
+
return (h, n) => (d(), $("div", de, [
|
|
166
|
+
m(Y, {
|
|
167
|
+
modelValue: l(g),
|
|
168
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => V(g) ? g.value = r : null),
|
|
169
|
+
options: l(s)
|
|
170
|
+
}, null, 8, ["modelValue", "options"]),
|
|
171
|
+
m(ee, {
|
|
172
|
+
dateRange: l(f),
|
|
173
|
+
"onUpdate:dateRange": n[1] || (n[1] = (r) => V(f) ? f.value = r : null),
|
|
174
|
+
"compare-date-range": l(v),
|
|
175
|
+
"onUpdate:compareDateRange": n[2] || (n[2] = (r) => V(v) ? v.value = r : null),
|
|
176
|
+
"compare-type": l(t).defaultCompareType,
|
|
177
|
+
"onUpdate:compareType": n[3] || (n[3] = (r) => l(t).defaultCompareType = r),
|
|
178
|
+
compare: ""
|
|
179
|
+
}, null, 8, ["dateRange", "compare-date-range", "compare-type"]),
|
|
180
|
+
m(ie, {
|
|
181
|
+
modelValue: l(c),
|
|
182
|
+
"onUpdate:modelValue": n[4] || (n[4] = (r) => V(c) ? c.value = r : null),
|
|
183
|
+
"default-date-range": l(t).timeOptions
|
|
184
|
+
}, null, 8, ["modelValue", "default-date-range"])
|
|
185
|
+
]));
|
|
186
|
+
}
|
|
187
|
+
}), ce = { class: "fm-typo-en-body-md-400" }, xe = /* @__PURE__ */ D({
|
|
188
|
+
__name: "MenuTab",
|
|
189
|
+
props: {
|
|
190
|
+
modelValue: { required: !1, default: [] },
|
|
191
|
+
modelModifiers: {}
|
|
192
|
+
},
|
|
193
|
+
emits: ["update:modelValue"],
|
|
194
|
+
setup(F) {
|
|
195
|
+
const p = z(F, "modelValue"), { breakpoints: s } = oe();
|
|
196
|
+
return (g, f) => {
|
|
197
|
+
const v = i("FmButton"), c = i("FmIcon"), t = i("FmMenuItem"), h = i("FmMenu");
|
|
198
|
+
return d(), $("div", {
|
|
199
|
+
class: B(["flex items-center pb-6 px-24", `${l(s).lg || l(s).md ? "px-24" : "pl-3"}`])
|
|
200
|
+
}, [
|
|
201
|
+
m(pe),
|
|
202
|
+
f[0] || (f[0] = u("div", { class: "flex grow" }, null, -1)),
|
|
203
|
+
p.value.length > 0 ? (d(), R(h, {
|
|
204
|
+
key: 0,
|
|
205
|
+
trigger: "click",
|
|
206
|
+
placement: "left",
|
|
207
|
+
class: B(l(s).sm || l(s).xs ? "pr-3" : "")
|
|
208
|
+
}, {
|
|
209
|
+
"menu-button": _(() => [
|
|
210
|
+
m(v, {
|
|
211
|
+
"append-icon": "more_vert",
|
|
212
|
+
variant: "tertiary",
|
|
213
|
+
size: "md",
|
|
214
|
+
class: "w-[36px] bg-none"
|
|
215
|
+
})
|
|
216
|
+
]),
|
|
217
|
+
default: _(() => [
|
|
218
|
+
(d(!0), $(w, null, E(p.value, (n, r) => (d(), R(t, {
|
|
219
|
+
key: `button-${r}`,
|
|
220
|
+
onClick: n.onClick
|
|
221
|
+
}, {
|
|
222
|
+
label: _(() => [
|
|
223
|
+
n.prependIcon ?? !1 ? (d(), R(c, {
|
|
224
|
+
key: 0,
|
|
225
|
+
name: n.icon
|
|
226
|
+
}, null, 8, ["name"])) : C("", !0),
|
|
227
|
+
u("p", ce, x(n.label), 1)
|
|
228
|
+
]),
|
|
229
|
+
_: 2
|
|
230
|
+
}, 1032, ["onClick"]))), 128))
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}, 8, ["class"])) : C("", !0)
|
|
234
|
+
], 2);
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
export {
|
|
239
|
+
xe as _
|
|
240
|
+
};
|