@feedmepos/mf-kitchen 1.0.4 → 1.0.5-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/{AdvanceModeView-4fbb592c.js → AdvanceModeView-bf31793f.js} +1058 -1024
- package/dist/{NormalModeView-9c657951.js → NormalModeView-c9e891a1.js} +58 -57
- package/dist/ReceiptTemplate-aed86f36.js +113 -0
- package/dist/TemplateHeader-3a3b15b3.js +72655 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/{app-57cd590d.js → app-70a6f50f.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/components/EditingPanel.vue.d.ts +56 -42
- package/dist/components/Preview.vue.d.ts +128 -46
- package/dist/components/ReceiptEditor.vue.d.ts +56 -42
- package/dist/components/advance/AdvanceModeLeftPanel.vue.d.ts +196 -50
- package/dist/components/normal/NormalModeEditor.vue.d.ts +64 -0
- package/dist/editors/CheckboxWidgetEditor.vue.d.ts +60 -46
- package/dist/editors/CommonWidgetEditor.vue.d.ts +60 -46
- package/dist/editors/DividerWidgetEditor.vue.d.ts +60 -46
- package/dist/editors/ImageWidgetEditor.vue.d.ts +74 -46
- package/dist/editors/QrCodeWidgetEditor.vue.d.ts +62 -48
- package/dist/editors/SpacerWidgetEditor.vue.d.ts +60 -46
- package/dist/editors/TextWidgetEditor.vue.d.ts +62 -48
- package/dist/shared/ReceiptSettingBase.vue.d.ts +68 -0
- package/dist/shared/SaveDialogPopUp.vue.d.ts +128 -46
- package/dist/shared/TemplateHeader.vue.d.ts +128 -46
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/ReceiptTemplate-9d2103ec.js +0 -111
- package/dist/TemplateHeader-88f309d9.js +0 -40370
|
@@ -1,27 +1,27 @@
|
|
|
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
|
|
2
|
-
import { u as
|
|
3
|
-
import { useI18n as P, useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import "./app-
|
|
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 M, createBlock as w, createCommentVNode as S } from "vue";
|
|
2
|
+
import { u as B, _ as C, I as $, r as T, a as I, T as E, P as N, g as D } from "./TemplateHeader-3a3b15b3.js";
|
|
3
|
+
import { useI18n as P, useCoreStore as z } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as A } from "@feedmepos/ui-library";
|
|
5
|
+
import "./app-70a6f50f.js";
|
|
6
|
+
const H = { class: "flex flex-col w-[420px]" }, Q = { class: "flex flex-col px-[24px] py-[16px] overflow-y-auto gap-24" }, R = { class: "flex flex-col gap-2" }, W = { class: "fm-typo-en-body-lg-600" }, j = { class: "gap" }, O = { class: "flex flex-row gap-[24px]" }, q = { class: "p-[16px] fm-shadow-light-300" }, G = /* @__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 c =
|
|
12
|
+
setup(g, { emit: V }) {
|
|
13
|
+
const c = g, r = V, { t: a } = P();
|
|
14
14
|
function d(n) {
|
|
15
|
-
|
|
15
|
+
r("update:model-value", n(c.modelValue));
|
|
16
16
|
}
|
|
17
|
-
const s =
|
|
18
|
-
|
|
17
|
+
const s = B(() => {
|
|
18
|
+
r("reset");
|
|
19
19
|
});
|
|
20
20
|
return (n, l) => {
|
|
21
|
-
const
|
|
22
|
-
return x(), U("div",
|
|
23
|
-
u("div",
|
|
24
|
-
i(
|
|
21
|
+
const b = p("FmTextarea"), f = p("FmTextField"), v = p("FmStepperField"), m = p("FmSwitch"), k = p("FmButton");
|
|
22
|
+
return x(), U("div", H, [
|
|
23
|
+
u("div", Q, [
|
|
24
|
+
i(b, {
|
|
25
25
|
"model-value": n.modelValue.headerText,
|
|
26
26
|
label: t(a)("mf-kitchen.editor.headerText"),
|
|
27
27
|
placeholder: t(a)("mf-kitchen.headerTextPlaceholder"),
|
|
@@ -45,37 +45,37 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
45
45
|
d((h) => ({ ...h, fontSize: o }));
|
|
46
46
|
})
|
|
47
47
|
}, null, 8, ["model-value", "label", "rules"]),
|
|
48
|
-
u("div",
|
|
49
|
-
u("label",
|
|
50
|
-
u("div",
|
|
51
|
-
i(
|
|
48
|
+
u("div", R, [
|
|
49
|
+
u("label", W, _(t(a)("mf-kitchen.receiptSetting")), 1),
|
|
50
|
+
u("div", j, [
|
|
51
|
+
i(m, {
|
|
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(m, {
|
|
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(m, {
|
|
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(C, {
|
|
73
73
|
"model-value": n.modelValue,
|
|
74
|
-
"onUpdate:modelValue": l[6] || (l[6] = (e) =>
|
|
74
|
+
"onUpdate:modelValue": l[6] || (l[6] = (e) => r("update:model-value", e))
|
|
75
75
|
}, null, 8, ["model-value"])
|
|
76
76
|
])
|
|
77
77
|
]),
|
|
78
|
-
i(
|
|
78
|
+
i(b, {
|
|
79
79
|
"model-value": n.modelValue.footerText,
|
|
80
80
|
label: t(a)("mf-kitchen.editor.footerText"),
|
|
81
81
|
placeholder: t(a)("mf-kitchen.footerTextPlaceholder"),
|
|
@@ -92,7 +92,7 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
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
|
-
u("div",
|
|
95
|
+
u("div", O, [
|
|
96
96
|
i(v, {
|
|
97
97
|
"model-value": n.modelValue.imgHeight ?? 160,
|
|
98
98
|
max: 999,
|
|
@@ -119,8 +119,8 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
119
119
|
}, null, 8, ["model-value", "label", "rules"])
|
|
120
120
|
])
|
|
121
121
|
]),
|
|
122
|
-
u("div",
|
|
123
|
-
i(
|
|
122
|
+
u("div", q, [
|
|
123
|
+
i(k, {
|
|
124
124
|
class: "w-full",
|
|
125
125
|
variant: "secondary",
|
|
126
126
|
label: t(a)("mf-kitchen.resetToDefault"),
|
|
@@ -131,7 +131,7 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
131
131
|
]);
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
}),
|
|
134
|
+
}), J = { class: "h-full flex flex-col" }, K = { class: "flex flex-row min-h-0" }, L = { class: "flex flex-col flex-1" }, X = { class: "templateBuilderHeader" }, Y = { class: "fm-typo-en-body-lg-600" }, Z = { class: "flex h-full justify-center py-10 overflow-y-auto bg-fm-color-neutral-gray-100" }, ne = /* @__PURE__ */ F({
|
|
135
135
|
__name: "NormalModeView",
|
|
136
136
|
props: {
|
|
137
137
|
profile: {
|
|
@@ -140,23 +140,24 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
emits: ["change-mode"],
|
|
143
|
-
setup(
|
|
144
|
-
const c =
|
|
143
|
+
setup(g, { emit: V }) {
|
|
144
|
+
const c = A(), { t: r } = P(), a = z(), d = y(), s = y();
|
|
145
145
|
async function n() {
|
|
146
146
|
if (s.value)
|
|
147
147
|
try {
|
|
148
|
-
const
|
|
149
|
-
f(
|
|
148
|
+
const m = await T.updateInfo(s.value);
|
|
149
|
+
f(m), c.open(
|
|
150
150
|
{
|
|
151
|
-
title:
|
|
151
|
+
title: r("mf-kitchen.template.save.success", { file: r("mf-kitchen.receiptTemplate") }),
|
|
152
152
|
type: "success"
|
|
153
153
|
},
|
|
154
154
|
2e3
|
|
155
155
|
);
|
|
156
|
-
} catch {
|
|
156
|
+
} catch (m) {
|
|
157
157
|
c.open(
|
|
158
158
|
{
|
|
159
|
-
title:
|
|
159
|
+
title: r("mf-kitchen.template.save.failed", { file: r("mf-kitchen.receiptTemplate") }),
|
|
160
|
+
message: D(m),
|
|
160
161
|
type: "error"
|
|
161
162
|
},
|
|
162
163
|
3e3
|
|
@@ -164,57 +165,57 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
const l = V;
|
|
167
|
-
function
|
|
168
|
+
function b() {
|
|
168
169
|
l("change-mode", "advance");
|
|
169
170
|
}
|
|
170
|
-
function f(
|
|
171
|
-
d.value =
|
|
171
|
+
function f(m) {
|
|
172
|
+
d.value = m, s.value = m;
|
|
172
173
|
}
|
|
173
174
|
function v() {
|
|
174
175
|
s.value = d.value;
|
|
175
176
|
}
|
|
176
|
-
return
|
|
177
|
+
return M(async () => {
|
|
177
178
|
try {
|
|
178
179
|
await a.readRestaurants(), f(await T.readInfo());
|
|
179
|
-
} catch (
|
|
180
|
+
} catch (m) {
|
|
180
181
|
c.open(
|
|
181
182
|
{
|
|
182
|
-
title:
|
|
183
|
-
message: `${
|
|
183
|
+
title: r("mf-kitchen.template.load.fail", { file: r("mf-kitchen.receiptTemplate") }),
|
|
184
|
+
message: `${m}`,
|
|
184
185
|
type: "error"
|
|
185
186
|
},
|
|
186
187
|
1e3
|
|
187
188
|
);
|
|
188
189
|
}
|
|
189
|
-
}), (
|
|
190
|
+
}), (m, k) => {
|
|
190
191
|
const e = p("FmButton");
|
|
191
|
-
return x(), U("div",
|
|
192
|
+
return x(), U("div", J, [
|
|
192
193
|
i(I),
|
|
193
|
-
i(
|
|
194
|
-
u("div",
|
|
195
|
-
s.value ? (x(), w(
|
|
194
|
+
i(E, { onUpdateTemplate: n }),
|
|
195
|
+
u("div", K, [
|
|
196
|
+
s.value ? (x(), w(G, {
|
|
196
197
|
key: 0,
|
|
197
198
|
modelValue: s.value,
|
|
198
|
-
"onUpdate:modelValue":
|
|
199
|
+
"onUpdate:modelValue": k[0] || (k[0] = (o) => s.value = o),
|
|
199
200
|
onReset: v
|
|
200
201
|
}, null, 8, ["modelValue"])) : S("", !0),
|
|
201
|
-
u("div",
|
|
202
|
-
u("div",
|
|
203
|
-
u("label",
|
|
202
|
+
u("div", L, [
|
|
203
|
+
u("div", X, [
|
|
204
|
+
u("label", Y, _(t(r)("mf-kitchen.templateBuilder")), 1),
|
|
204
205
|
i(e, {
|
|
205
206
|
variant: "secondary",
|
|
206
|
-
label: t(
|
|
207
|
+
label: t(r)("mf-kitchen.advanceBuilder"),
|
|
207
208
|
"text-color": "primary",
|
|
208
209
|
bgColor: "typo-white",
|
|
209
210
|
"border-color": "primary",
|
|
210
|
-
onClick:
|
|
211
|
+
onClick: b
|
|
211
212
|
}, null, 8, ["label"])
|
|
212
213
|
]),
|
|
213
|
-
u("div",
|
|
214
|
-
s.value &&
|
|
214
|
+
u("div", Z, [
|
|
215
|
+
s.value && g.profile ? (x(), w(N, {
|
|
215
216
|
key: 0,
|
|
216
217
|
"receipt-info": s.value,
|
|
217
|
-
profile:
|
|
218
|
+
profile: g.profile
|
|
218
219
|
}, null, 8, ["receipt-info", "profile"])) : S("", !0)
|
|
219
220
|
])
|
|
220
221
|
])
|
|
@@ -224,5 +225,5 @@ const A = { class: "flex flex-col w-[420px]" }, H = { class: "flex flex-col px-[
|
|
|
224
225
|
}
|
|
225
226
|
});
|
|
226
227
|
export {
|
|
227
|
-
|
|
228
|
+
ne as default
|
|
228
229
|
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { defineComponent as f, defineAsyncComponent as s, computed as a, openBlock as c, createBlock as u, KeepAlive as v, resolveDynamicComponent as R } from "vue";
|
|
2
|
+
import { useCoreStore as _ } from "@feedmepos/mf-common";
|
|
3
|
+
import { useRoute as A, useRouter as N } from "vue-router";
|
|
4
|
+
const g = "mProfile_2021-08-11T03:00:54.471Z", b = "25-b8e114a8abdd0f62619314e6e057ee7a", O = "Mock Receipt Template", P = {
|
|
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
|
+
}, y = "+60123456789", M = "-", T = "", C = !0, H = [], k = [], J = {
|
|
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
|
+
}, B = "", S = "Mock Receipt Template", q = null, x = "mockReceiptTemplate", L = "", Y = "", D = {
|
|
72
|
+
_id: g,
|
|
73
|
+
_rev: b,
|
|
74
|
+
name: O,
|
|
75
|
+
address: P,
|
|
76
|
+
phoneNo: y,
|
|
77
|
+
regNo: M,
|
|
78
|
+
email: T,
|
|
79
|
+
type_mProfile: C,
|
|
80
|
+
photos: H,
|
|
81
|
+
tags: k,
|
|
82
|
+
operatingHours: J,
|
|
83
|
+
description: B,
|
|
84
|
+
legalName: S,
|
|
85
|
+
sstRegNo: q,
|
|
86
|
+
url: x,
|
|
87
|
+
coverPhoto: L,
|
|
88
|
+
thumbnailPhoto: Y
|
|
89
|
+
}, j = /* @__PURE__ */ f({
|
|
90
|
+
__name: "ReceiptTemplate",
|
|
91
|
+
setup(I) {
|
|
92
|
+
const l = A(), i = s(() => import("./NormalModeView-c9e891a1.js")), p = s(() => import("./AdvanceModeView-bf31793f.js")), m = a(() => l.query.mode === "advance" ? p : i), o = _(), d = a(() => {
|
|
93
|
+
var r;
|
|
94
|
+
const e = o.currentRestaurant.value, [n] = o.restaurants.value;
|
|
95
|
+
return ((r = e ?? n) == null ? void 0 : r.profile) || D;
|
|
96
|
+
}), t = N();
|
|
97
|
+
function h(e) {
|
|
98
|
+
t.replace({
|
|
99
|
+
name: t.currentRoute.value.name,
|
|
100
|
+
query: { mode: e }
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return (e, n) => (c(), u(v, null, [
|
|
104
|
+
(c(), u(R(m.value), {
|
|
105
|
+
onChangeMode: h,
|
|
106
|
+
profile: d.value
|
|
107
|
+
}, null, 40, ["profile"]))
|
|
108
|
+
], 1024));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export {
|
|
112
|
+
j as default
|
|
113
|
+
};
|