@feedmepos/mf-kitchen 1.0.3-beta.0 → 1.0.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.
- package/dist/{AdvanceModeView-e386f866.js → AdvanceModeView-4fbb592c.js} +1138 -1132
- package/dist/{NormalModeView-5ae53fb1.js → NormalModeView-9c657951.js} +81 -75
- package/dist/ReceiptTemplate-9d2103ec.js +111 -0
- package/dist/{restaurant-a106b257.js → TemplateHeader-88f309d9.js} +26906 -27006
- package/dist/app-57cd590d.js +686 -0
- package/dist/app.js +5 -705
- package/dist/components/Preview.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/receipt-template/AdvanceModeView.vue.d.ts +165 -2
- package/dist/views/receipt-template/NormalModeView.vue.d.ts +165 -2
- package/package.json +2 -2
- package/dist/ReceiptTemplate-ad04045a.js +0 -18
- package/dist/components/Navigator.vue.d.ts +0 -2
- package/dist/stores/restaurant.d.ts +0 -454
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { useI18n as P, useCoreStore as
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as F, resolveComponent as p, openBlock as x, createElementBlock as U, createElementVNode as u, createVNode as i, unref as t, toDisplayString as _, ref as y, onMounted as B, createBlock as w, createCommentVNode as S } from "vue";
|
|
2
|
+
import { u as C, _ as M, I as $, r as T, a as I, T as N, P as D } from "./TemplateHeader-88f309d9.js";
|
|
3
|
+
import { useI18n as P, useCoreStore as E } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as z } from "@feedmepos/ui-library";
|
|
5
|
+
import "./app-57cd590d.js";
|
|
6
|
+
const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[24px] py-[16px] overflow-y-auto gap-24" }, Q = { class: "flex flex-col gap-2" }, R = { class: "fm-typo-en-body-lg-600" }, W = { class: "gap" }, j = { class: "flex flex-row gap-[24px]" }, O = { class: "p-[16px] fm-shadow-light-300" }, q = /* @__PURE__ */ F({
|
|
7
7
|
__name: "NormalModeEditor",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {}
|
|
10
10
|
},
|
|
11
11
|
emits: ["update:model-value", "reset"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
12
|
+
setup(b, { emit: V }) {
|
|
13
|
+
const c = b, m = V, { t: a } = P();
|
|
14
14
|
function d(n) {
|
|
15
|
-
m("update:model-value", n(
|
|
15
|
+
m("update:model-value", n(c.modelValue));
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const s = C(() => {
|
|
18
18
|
m("reset");
|
|
19
19
|
});
|
|
20
20
|
return (n, l) => {
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
i(
|
|
21
|
+
const k = p("FmTextarea"), f = p("FmTextField"), v = p("FmStepperField"), r = p("FmSwitch"), g = p("FmButton");
|
|
22
|
+
return x(), U("div", A, [
|
|
23
|
+
u("div", H, [
|
|
24
|
+
i(k, {
|
|
25
25
|
"model-value": n.modelValue.headerText,
|
|
26
26
|
label: t(a)("mf-kitchen.editor.headerText"),
|
|
27
27
|
placeholder: t(a)("mf-kitchen.headerTextPlaceholder"),
|
|
28
28
|
"onUpdate:modelValue": l[0] || (l[0] = (e) => d((o) => ({ ...o, headerText: e })))
|
|
29
29
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
30
|
-
i(
|
|
30
|
+
i(f, {
|
|
31
31
|
"model-value": n.modelValue.invoicePrefix,
|
|
32
32
|
label: t(a)("mf-kitchen.editor.invoicePrefix"),
|
|
33
33
|
placeholder: t(a)("mf-kitchen.invoicePrefixPlaceholder"),
|
|
34
34
|
"onUpdate:modelValue": l[1] || (l[1] = (e) => d((o) => ({ ...o, invoicePrefix: e })))
|
|
35
35
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
36
|
-
i(
|
|
36
|
+
i(v, {
|
|
37
37
|
"model-value": n.modelValue.fontSize ?? 16,
|
|
38
38
|
max: 40,
|
|
39
39
|
min: 1,
|
|
@@ -42,58 +42,58 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
42
42
|
rules: [(e) => e <= 40 || t(a)("mf-kitchen.editor.validation.fontSizeMax")],
|
|
43
43
|
"onUpdate:modelValue": l[2] || (l[2] = (e) => {
|
|
44
44
|
const o = Math.min(e, 40);
|
|
45
|
-
d((
|
|
45
|
+
d((h) => ({ ...h, fontSize: o }));
|
|
46
46
|
})
|
|
47
47
|
}, null, 8, ["model-value", "label", "rules"]),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
i(
|
|
48
|
+
u("div", Q, [
|
|
49
|
+
u("label", R, _(t(a)("mf-kitchen.receiptSetting")), 1),
|
|
50
|
+
u("div", W, [
|
|
51
|
+
i(r, {
|
|
52
52
|
"model-value": n.modelValue.needPhoneNo,
|
|
53
53
|
label: t(a)("mf-kitchen.editor.showContact"),
|
|
54
54
|
"label-placement": "left",
|
|
55
55
|
class: "receiptSettingSwitch",
|
|
56
56
|
"onUpdate:modelValue": l[3] || (l[3] = (e) => d((o) => ({ ...o, needPhoneNo: e })))
|
|
57
57
|
}, null, 8, ["model-value", "label"]),
|
|
58
|
-
i(
|
|
58
|
+
i(r, {
|
|
59
59
|
"model-value": n.modelValue.needAddress,
|
|
60
60
|
label: t(a)("mf-kitchen.editor.showAddress"),
|
|
61
61
|
"label-placement": "left",
|
|
62
62
|
class: "receiptSettingSwitch",
|
|
63
63
|
"onUpdate:modelValue": l[4] || (l[4] = (e) => d((o) => ({ ...o, needAddress: e })))
|
|
64
64
|
}, null, 8, ["model-value", "label"]),
|
|
65
|
-
i(
|
|
65
|
+
i(r, {
|
|
66
66
|
"model-value": n.modelValue.needEmail,
|
|
67
67
|
label: t(a)("mf-kitchen.editor.showEmail"),
|
|
68
68
|
"label-placement": "left",
|
|
69
69
|
class: "receiptSettingSwitch",
|
|
70
70
|
"onUpdate:modelValue": l[5] || (l[5] = (e) => d((o) => ({ ...o, needEmail: e })))
|
|
71
71
|
}, null, 8, ["model-value", "label"]),
|
|
72
|
-
i(
|
|
72
|
+
i(M, {
|
|
73
73
|
"model-value": n.modelValue,
|
|
74
74
|
"onUpdate:modelValue": l[6] || (l[6] = (e) => m("update:model-value", e))
|
|
75
75
|
}, null, 8, ["model-value"])
|
|
76
76
|
])
|
|
77
77
|
]),
|
|
78
|
-
i(
|
|
78
|
+
i(k, {
|
|
79
79
|
"model-value": n.modelValue.footerText,
|
|
80
80
|
label: t(a)("mf-kitchen.editor.footerText"),
|
|
81
81
|
placeholder: t(a)("mf-kitchen.footerTextPlaceholder"),
|
|
82
82
|
"onUpdate:modelValue": l[7] || (l[7] = (e) => d((o) => ({ ...o, footerText: e })))
|
|
83
83
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
84
|
-
i(
|
|
84
|
+
i(f, {
|
|
85
85
|
"model-value": n.modelValue.footerQr ?? "",
|
|
86
86
|
label: t(a)("mf-kitchen.editor.footerQr"),
|
|
87
87
|
placeholder: t(a)("mf-kitchen.footerQrPlaceholder"),
|
|
88
88
|
"onUpdate:modelValue": l[8] || (l[8] = (e) => d((o) => ({ ...o, footerQr: e })))
|
|
89
89
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
90
|
-
i(
|
|
90
|
+
i($, {
|
|
91
91
|
"model-value": n.modelValue.imgData,
|
|
92
92
|
title: t(a)("mf-kitchen.editor.logoImage"),
|
|
93
93
|
"onUpdate:modelValue": l[9] || (l[9] = (e) => d((o) => ({ ...o, imgData: e })))
|
|
94
94
|
}, null, 8, ["model-value", "title"]),
|
|
95
|
-
|
|
96
|
-
i(
|
|
95
|
+
u("div", j, [
|
|
96
|
+
i(v, {
|
|
97
97
|
"model-value": n.modelValue.imgHeight ?? 160,
|
|
98
98
|
max: 999,
|
|
99
99
|
min: 0,
|
|
@@ -102,10 +102,10 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
102
102
|
rules: [(e) => e <= 999 || "More than 999"],
|
|
103
103
|
"onUpdate:modelValue": l[10] || (l[10] = (e) => {
|
|
104
104
|
const o = Math.min(e, 999);
|
|
105
|
-
d((
|
|
105
|
+
d((h) => ({ ...h, imgHeight: o }));
|
|
106
106
|
})
|
|
107
107
|
}, null, 8, ["model-value", "label", "rules"]),
|
|
108
|
-
i(
|
|
108
|
+
i(v, {
|
|
109
109
|
"model-value": n.modelValue.imgWidth ?? 160,
|
|
110
110
|
max: 999,
|
|
111
111
|
min: 0,
|
|
@@ -114,33 +114,39 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
114
114
|
rules: [(e) => e <= 999 || "More than 999"],
|
|
115
115
|
"onUpdate:modelValue": l[11] || (l[11] = (e) => {
|
|
116
116
|
const o = Math.min(e, 999);
|
|
117
|
-
d((
|
|
117
|
+
d((h) => ({ ...h, imgWidth: o }));
|
|
118
118
|
})
|
|
119
119
|
}, null, 8, ["model-value", "label", "rules"])
|
|
120
120
|
])
|
|
121
121
|
]),
|
|
122
|
-
|
|
123
|
-
i(
|
|
122
|
+
u("div", O, [
|
|
123
|
+
i(g, {
|
|
124
124
|
class: "w-full",
|
|
125
125
|
variant: "secondary",
|
|
126
126
|
label: t(a)("mf-kitchen.resetToDefault"),
|
|
127
127
|
size: "md",
|
|
128
|
-
onClick: t(
|
|
128
|
+
onClick: t(s)
|
|
129
129
|
}, null, 8, ["label", "onClick"])
|
|
130
130
|
])
|
|
131
131
|
]);
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
}),
|
|
134
|
+
}), G = { class: "h-full flex flex-col" }, J = { class: "flex flex-row min-h-0" }, K = { class: "flex flex-col flex-1" }, L = { class: "templateBuilderHeader" }, X = { class: "fm-typo-en-body-lg-600" }, Y = { class: "flex h-full justify-center py-10 overflow-y-auto bg-fm-color-neutral-gray-100" }, ae = /* @__PURE__ */ F({
|
|
135
135
|
__name: "NormalModeView",
|
|
136
|
+
props: {
|
|
137
|
+
profile: {
|
|
138
|
+
type: Object,
|
|
139
|
+
required: !0
|
|
140
|
+
}
|
|
141
|
+
},
|
|
136
142
|
emits: ["change-mode"],
|
|
137
|
-
setup(
|
|
138
|
-
const
|
|
139
|
-
async function
|
|
140
|
-
if (
|
|
143
|
+
setup(b, { emit: V }) {
|
|
144
|
+
const c = z(), { t: m } = P(), a = E(), d = y(), s = y();
|
|
145
|
+
async function n() {
|
|
146
|
+
if (s.value)
|
|
141
147
|
try {
|
|
142
|
-
const
|
|
143
|
-
|
|
148
|
+
const r = await T.updateInfo(s.value);
|
|
149
|
+
f(r), c.open(
|
|
144
150
|
{
|
|
145
151
|
title: m("mf-kitchen.template.save.success", { file: m("mf-kitchen.receiptTemplate") }),
|
|
146
152
|
type: "success"
|
|
@@ -148,7 +154,7 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
148
154
|
2e3
|
|
149
155
|
);
|
|
150
156
|
} catch {
|
|
151
|
-
|
|
157
|
+
c.open(
|
|
152
158
|
{
|
|
153
159
|
title: m("mf-kitchen.template.save.failed", { file: m("mf-kitchen.receiptTemplate") }),
|
|
154
160
|
type: "error"
|
|
@@ -157,58 +163,58 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
157
163
|
);
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
162
|
-
|
|
166
|
+
const l = V;
|
|
167
|
+
function k() {
|
|
168
|
+
l("change-mode", "advance");
|
|
163
169
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
170
|
+
function f(r) {
|
|
171
|
+
d.value = r, s.value = r;
|
|
166
172
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
173
|
+
function v() {
|
|
174
|
+
s.value = d.value;
|
|
169
175
|
}
|
|
170
|
-
return
|
|
176
|
+
return B(async () => {
|
|
171
177
|
try {
|
|
172
|
-
await a.readRestaurants(),
|
|
173
|
-
} catch (
|
|
174
|
-
|
|
178
|
+
await a.readRestaurants(), f(await T.readInfo());
|
|
179
|
+
} catch (r) {
|
|
180
|
+
c.open(
|
|
175
181
|
{
|
|
176
182
|
title: m("mf-kitchen.template.load.fail", { file: m("mf-kitchen.receiptTemplate") }),
|
|
177
|
-
message: `${
|
|
183
|
+
message: `${r}`,
|
|
178
184
|
type: "error"
|
|
179
185
|
},
|
|
180
186
|
1e3
|
|
181
187
|
);
|
|
182
188
|
}
|
|
183
|
-
}), (
|
|
184
|
-
const
|
|
185
|
-
return
|
|
186
|
-
i(
|
|
187
|
-
i(
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
}), (r, g) => {
|
|
190
|
+
const e = p("FmButton");
|
|
191
|
+
return x(), U("div", G, [
|
|
192
|
+
i(I),
|
|
193
|
+
i(N, { onUpdateTemplate: n }),
|
|
194
|
+
u("div", J, [
|
|
195
|
+
s.value ? (x(), w(q, {
|
|
190
196
|
key: 0,
|
|
191
|
-
modelValue:
|
|
192
|
-
"onUpdate:modelValue":
|
|
193
|
-
onReset:
|
|
197
|
+
modelValue: s.value,
|
|
198
|
+
"onUpdate:modelValue": g[0] || (g[0] = (o) => s.value = o),
|
|
199
|
+
onReset: v
|
|
194
200
|
}, null, 8, ["modelValue"])) : S("", !0),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
i(
|
|
201
|
+
u("div", K, [
|
|
202
|
+
u("div", L, [
|
|
203
|
+
u("label", X, _(t(m)("mf-kitchen.templateBuilder")), 1),
|
|
204
|
+
i(e, {
|
|
199
205
|
variant: "secondary",
|
|
200
206
|
label: t(m)("mf-kitchen.advanceBuilder"),
|
|
201
207
|
"text-color": "primary",
|
|
202
208
|
bgColor: "typo-white",
|
|
203
209
|
"border-color": "primary",
|
|
204
|
-
onClick:
|
|
210
|
+
onClick: k
|
|
205
211
|
}, null, 8, ["label"])
|
|
206
212
|
]),
|
|
207
|
-
|
|
208
|
-
|
|
213
|
+
u("div", Y, [
|
|
214
|
+
s.value && b.profile ? (x(), w(D, {
|
|
209
215
|
key: 0,
|
|
210
|
-
"receipt-info":
|
|
211
|
-
profile:
|
|
216
|
+
"receipt-info": s.value,
|
|
217
|
+
profile: b.profile
|
|
212
218
|
}, null, 8, ["receipt-info", "profile"])) : S("", !0)
|
|
213
219
|
])
|
|
214
220
|
])
|
|
@@ -218,5 +224,5 @@ const Q = { class: "flex flex-col w-[420px]" }, W = { class: "flex flex-col px-[
|
|
|
218
224
|
}
|
|
219
225
|
});
|
|
220
226
|
export {
|
|
221
|
-
|
|
227
|
+
ae as default
|
|
222
228
|
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent as d, defineAsyncComponent as s, computed as a, openBlock as h, createBlock as f, resolveDynamicComponent as R } from "vue";
|
|
2
|
+
import { useCoreStore as _ } from "@feedmepos/mf-common";
|
|
3
|
+
import { useRoute as v, useRouter as A } from "vue-router";
|
|
4
|
+
const N = "mProfile_2021-08-11T03:00:54.471Z", g = "25-b8e114a8abdd0f62619314e6e057ee7a", b = "Mock Receipt Template", O = {
|
|
5
|
+
line1: "NO. 99, JALAN CONTOH",
|
|
6
|
+
line2: "TAMAN CONTOH JAYA",
|
|
7
|
+
state: "JOHOR",
|
|
8
|
+
city: "JOHOR BAHRU",
|
|
9
|
+
postcode: "81300",
|
|
10
|
+
country: "MALAYSIA",
|
|
11
|
+
coordinates: []
|
|
12
|
+
}, P = "+60123456789", y = "-", M = "", T = !0, C = [], H = [], k = {
|
|
13
|
+
0: {
|
|
14
|
+
enable: !0,
|
|
15
|
+
hours: [
|
|
16
|
+
{
|
|
17
|
+
start: "12:00",
|
|
18
|
+
end: "19:00"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
1: {
|
|
23
|
+
enable: !1,
|
|
24
|
+
hours: []
|
|
25
|
+
},
|
|
26
|
+
2: {
|
|
27
|
+
enable: !0,
|
|
28
|
+
hours: [
|
|
29
|
+
{
|
|
30
|
+
start: "12:00",
|
|
31
|
+
end: "19:00"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
3: {
|
|
36
|
+
enable: !0,
|
|
37
|
+
hours: [
|
|
38
|
+
{
|
|
39
|
+
start: "12:00",
|
|
40
|
+
end: "07:00"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
4: {
|
|
45
|
+
enable: !0,
|
|
46
|
+
hours: [
|
|
47
|
+
{
|
|
48
|
+
start: "12:00",
|
|
49
|
+
end: "19:00"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
5: {
|
|
54
|
+
enable: !0,
|
|
55
|
+
hours: [
|
|
56
|
+
{
|
|
57
|
+
start: "12:00",
|
|
58
|
+
end: "19:00"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
6: {
|
|
63
|
+
enable: !0,
|
|
64
|
+
hours: [
|
|
65
|
+
{
|
|
66
|
+
start: "12:00",
|
|
67
|
+
end: "19:00"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}, J = "", B = "Mock Receipt Template", S = null, q = "mockReceiptTemplate", x = "", L = "", Y = {
|
|
72
|
+
_id: N,
|
|
73
|
+
_rev: g,
|
|
74
|
+
name: b,
|
|
75
|
+
address: O,
|
|
76
|
+
phoneNo: P,
|
|
77
|
+
regNo: y,
|
|
78
|
+
email: M,
|
|
79
|
+
type_mProfile: T,
|
|
80
|
+
photos: C,
|
|
81
|
+
tags: H,
|
|
82
|
+
operatingHours: k,
|
|
83
|
+
description: J,
|
|
84
|
+
legalName: B,
|
|
85
|
+
sstRegNo: S,
|
|
86
|
+
url: q,
|
|
87
|
+
coverPhoto: x,
|
|
88
|
+
thumbnailPhoto: L
|
|
89
|
+
}, j = /* @__PURE__ */ d({
|
|
90
|
+
__name: "ReceiptTemplate",
|
|
91
|
+
setup(D) {
|
|
92
|
+
const c = v(), u = s(() => import("./NormalModeView-9c657951.js")), l = s(() => import("./AdvanceModeView-4fbb592c.js")), i = a(() => c.query.mode === "advance" ? l : u), o = _(), p = a(() => {
|
|
93
|
+
var r;
|
|
94
|
+
const e = o.currentRestaurant.value, [n] = o.restaurants.value;
|
|
95
|
+
return ((r = e ?? n) == null ? void 0 : r.profile) || Y;
|
|
96
|
+
}), t = A();
|
|
97
|
+
function m(e) {
|
|
98
|
+
t.replace({
|
|
99
|
+
name: t.currentRoute.value.name,
|
|
100
|
+
query: { mode: e }
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return (e, n) => (h(), f(R(i.value), {
|
|
104
|
+
onChangeMode: m,
|
|
105
|
+
profile: p.value
|
|
106
|
+
}, null, 40, ["profile"]));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
j as default
|
|
111
|
+
};
|