@feedmepos/mf-kitchen 1.0.0 → 1.0.1
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-1ae75ba9.js +6200 -0
- package/dist/{NormalModeView-6d512143.js → NormalModeView-39415dd5.js} +79 -79
- package/dist/ReceiptTemplate-6fd26b0f.js +18 -0
- package/dist/app.d.ts +5 -5
- package/dist/app.js +696 -7
- package/dist/{restaurant-aaf7d812.js → restaurant-821ac89e.js} +213 -208
- package/dist/router/shared.d.ts +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/receipt-template/AdvanceModeView.vue.d.ts +7 -0
- package/dist/views/receipt-template/NormalModeView.vue.d.ts +7 -0
- package/dist/views/{AdvanceModeView.vue.d.ts → receipt-template/ReceiptTemplate.vue.d.ts} +0 -1
- package/package.json +1 -1
- package/dist/AdvanceModeView-04b079e0.js +0 -6200
- package/dist/app-7966dca0.js +0 -729
- package/dist/views/NormalModeView.vue.d.ts +0 -3
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { defineComponent as _, resolveComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { u as I, _ as N, I as D, a as E, r as T, b as R, T as z, P as A } from "./restaurant-aaf7d812.js";
|
|
6
|
-
import "./app-7966dca0.js";
|
|
1
|
+
import { defineComponent as _, resolveComponent as c, openBlock as g, createElementBlock as F, createElementVNode as r, createVNode as i, unref as a, toDisplayString as U, ref as y, onMounted as B, createBlock as w, createCommentVNode as S } from "vue";
|
|
2
|
+
import { useSnackbar as C } from "@feedmepos/ui-library";
|
|
3
|
+
import { useI18n as P, useCoreStore as M } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as $, _ as I, I as N, a as D, r as T, b as E, T as z, P as A } from "./restaurant-821ac89e.js";
|
|
7
5
|
import "pinia";
|
|
8
|
-
const H = { class: "flex flex-col w-[420px]" },
|
|
6
|
+
const H = { class: "flex flex-col w-[420px]" }, R = { class: "flex flex-col px-[24px] py-[16px] overflow-y-auto gap-24" }, Q = { 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__ */ _({
|
|
9
7
|
__name: "NormalModeEditor",
|
|
10
8
|
props: {
|
|
11
9
|
modelValue: {}
|
|
12
10
|
},
|
|
13
11
|
emits: ["update:model-value", "reset"],
|
|
14
|
-
setup(V, { emit:
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
12
|
+
setup(V, { emit: x }) {
|
|
13
|
+
const f = V, m = x, { t: n } = P();
|
|
14
|
+
function d(o) {
|
|
15
|
+
m("update:model-value", o(f.modelValue));
|
|
18
16
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
17
|
+
const h = $(() => {
|
|
18
|
+
m("reset");
|
|
21
19
|
});
|
|
22
20
|
return (o, l) => {
|
|
23
|
-
const
|
|
21
|
+
const b = c("FmTextarea"), k = c("FmTextField"), p = c("FmStepperField"), v = c("FmSwitch"), s = c("FmButton");
|
|
24
22
|
return g(), F("div", H, [
|
|
25
|
-
|
|
26
|
-
i(
|
|
23
|
+
r("div", R, [
|
|
24
|
+
i(b, {
|
|
27
25
|
"model-value": o.modelValue.headerText,
|
|
28
26
|
label: a(n)("mf-kitchen.editor.headerText"),
|
|
29
27
|
placeholder: a(n)("mf-kitchen.headerTextPlaceholder"),
|
|
30
|
-
"onUpdate:modelValue": l[0] || (l[0] = (e) =>
|
|
28
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => d((t) => ({ ...t, headerText: e })))
|
|
31
29
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
32
|
-
i(
|
|
30
|
+
i(k, {
|
|
33
31
|
"model-value": o.modelValue.invoicePrefix,
|
|
34
32
|
label: a(n)("mf-kitchen.editor.invoicePrefix"),
|
|
35
33
|
placeholder: a(n)("mf-kitchen.invoicePrefixPlaceholder"),
|
|
36
|
-
"onUpdate:modelValue": l[1] || (l[1] = (e) =>
|
|
34
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => d((t) => ({ ...t, invoicePrefix: e })))
|
|
37
35
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
38
|
-
i(
|
|
36
|
+
i(p, {
|
|
39
37
|
"model-value": o.modelValue.fontSize ?? 16,
|
|
40
38
|
max: 40,
|
|
41
39
|
min: 1,
|
|
@@ -44,58 +42,58 @@ const H = { class: "flex flex-col w-[420px]" }, Q = { class: "flex flex-col px-[
|
|
|
44
42
|
rules: [(e) => e <= 40 || a(n)("mf-kitchen.editor.validation.fontSizeMax")],
|
|
45
43
|
"onUpdate:modelValue": l[2] || (l[2] = (e) => {
|
|
46
44
|
const t = Math.min(e, 40);
|
|
47
|
-
|
|
45
|
+
d((u) => ({ ...u, fontSize: t }));
|
|
48
46
|
})
|
|
49
47
|
}, null, 8, ["model-value", "label", "rules"]),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
i(
|
|
48
|
+
r("div", Q, [
|
|
49
|
+
r("label", W, U(a(n)("mf-kitchen.receiptSetting")), 1),
|
|
50
|
+
r("div", j, [
|
|
51
|
+
i(v, {
|
|
54
52
|
"model-value": o.modelValue.needPhoneNo,
|
|
55
53
|
label: a(n)("mf-kitchen.editor.showContact"),
|
|
56
54
|
"label-placement": "left",
|
|
57
55
|
class: "receiptSettingSwitch",
|
|
58
|
-
"onUpdate:modelValue": l[3] || (l[3] = (e) =>
|
|
56
|
+
"onUpdate:modelValue": l[3] || (l[3] = (e) => d((t) => ({ ...t, needPhoneNo: e })))
|
|
59
57
|
}, null, 8, ["model-value", "label"]),
|
|
60
|
-
i(
|
|
58
|
+
i(v, {
|
|
61
59
|
"model-value": o.modelValue.needAddress,
|
|
62
60
|
label: a(n)("mf-kitchen.editor.showAddress"),
|
|
63
61
|
"label-placement": "left",
|
|
64
62
|
class: "receiptSettingSwitch",
|
|
65
|
-
"onUpdate:modelValue": l[4] || (l[4] = (e) =>
|
|
63
|
+
"onUpdate:modelValue": l[4] || (l[4] = (e) => d((t) => ({ ...t, needAddress: e })))
|
|
66
64
|
}, null, 8, ["model-value", "label"]),
|
|
67
|
-
i(
|
|
65
|
+
i(v, {
|
|
68
66
|
"model-value": o.modelValue.needEmail,
|
|
69
67
|
label: a(n)("mf-kitchen.editor.showEmail"),
|
|
70
68
|
"label-placement": "left",
|
|
71
69
|
class: "receiptSettingSwitch",
|
|
72
|
-
"onUpdate:modelValue": l[5] || (l[5] = (e) =>
|
|
70
|
+
"onUpdate:modelValue": l[5] || (l[5] = (e) => d((t) => ({ ...t, needEmail: e })))
|
|
73
71
|
}, null, 8, ["model-value", "label"]),
|
|
74
|
-
i(
|
|
72
|
+
i(I, {
|
|
75
73
|
"model-value": o.modelValue,
|
|
76
|
-
"onUpdate:modelValue": l[6] || (l[6] = (e) =>
|
|
74
|
+
"onUpdate:modelValue": l[6] || (l[6] = (e) => m("update:model-value", e))
|
|
77
75
|
}, null, 8, ["model-value"])
|
|
78
76
|
])
|
|
79
77
|
]),
|
|
80
|
-
i(
|
|
78
|
+
i(b, {
|
|
81
79
|
"model-value": o.modelValue.footerText,
|
|
82
80
|
label: a(n)("mf-kitchen.editor.footerText"),
|
|
83
81
|
placeholder: a(n)("mf-kitchen.footerTextPlaceholder"),
|
|
84
|
-
"onUpdate:modelValue": l[7] || (l[7] = (e) =>
|
|
82
|
+
"onUpdate:modelValue": l[7] || (l[7] = (e) => d((t) => ({ ...t, footerText: e })))
|
|
85
83
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
86
|
-
i(
|
|
84
|
+
i(k, {
|
|
87
85
|
"model-value": o.modelValue.footerQr ?? "",
|
|
88
86
|
label: a(n)("mf-kitchen.editor.footerQr"),
|
|
89
87
|
placeholder: a(n)("mf-kitchen.footerQrPlaceholder"),
|
|
90
|
-
"onUpdate:modelValue": l[8] || (l[8] = (e) =>
|
|
88
|
+
"onUpdate:modelValue": l[8] || (l[8] = (e) => d((t) => ({ ...t, footerQr: e })))
|
|
91
89
|
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
92
|
-
i(
|
|
90
|
+
i(N, {
|
|
93
91
|
"model-value": o.modelValue.imgData,
|
|
94
92
|
title: a(n)("mf-kitchen.editor.logoImage"),
|
|
95
|
-
"onUpdate:modelValue": l[9] || (l[9] = (e) =>
|
|
93
|
+
"onUpdate:modelValue": l[9] || (l[9] = (e) => d((t) => ({ ...t, imgData: e })))
|
|
96
94
|
}, null, 8, ["model-value", "title"]),
|
|
97
|
-
|
|
98
|
-
i(
|
|
95
|
+
r("div", O, [
|
|
96
|
+
i(p, {
|
|
99
97
|
"model-value": o.modelValue.imgHeight ?? 160,
|
|
100
98
|
max: 999,
|
|
101
99
|
min: 0,
|
|
@@ -104,10 +102,10 @@ const H = { class: "flex flex-col w-[420px]" }, Q = { class: "flex flex-col px-[
|
|
|
104
102
|
rules: [(e) => e <= 999 || "More than 999"],
|
|
105
103
|
"onUpdate:modelValue": l[10] || (l[10] = (e) => {
|
|
106
104
|
const t = Math.min(e, 999);
|
|
107
|
-
|
|
105
|
+
d((u) => ({ ...u, imgHeight: t }));
|
|
108
106
|
})
|
|
109
107
|
}, null, 8, ["model-value", "label", "rules"]),
|
|
110
|
-
i(
|
|
108
|
+
i(p, {
|
|
111
109
|
"model-value": o.modelValue.imgWidth ?? 160,
|
|
112
110
|
max: 999,
|
|
113
111
|
min: 0,
|
|
@@ -116,99 +114,101 @@ const H = { class: "flex flex-col w-[420px]" }, Q = { class: "flex flex-col px-[
|
|
|
116
114
|
rules: [(e) => e <= 999 || "More than 999"],
|
|
117
115
|
"onUpdate:modelValue": l[11] || (l[11] = (e) => {
|
|
118
116
|
const t = Math.min(e, 999);
|
|
119
|
-
|
|
117
|
+
d((u) => ({ ...u, imgWidth: t }));
|
|
120
118
|
})
|
|
121
119
|
}, null, 8, ["model-value", "label", "rules"])
|
|
122
120
|
])
|
|
123
121
|
]),
|
|
124
|
-
|
|
125
|
-
i(
|
|
122
|
+
r("div", q, [
|
|
123
|
+
i(s, {
|
|
126
124
|
class: "w-full",
|
|
127
125
|
variant: "secondary",
|
|
128
126
|
label: a(n)("mf-kitchen.resetToDefault"),
|
|
129
127
|
size: "md",
|
|
130
|
-
onClick: a(
|
|
128
|
+
onClick: a(h)
|
|
131
129
|
}, null, 8, ["label", "onClick"])
|
|
132
130
|
])
|
|
133
131
|
]);
|
|
134
132
|
};
|
|
135
133
|
}
|
|
136
|
-
}),
|
|
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__ */ _({
|
|
137
135
|
__name: "NormalModeView",
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
emits: ["change-mode"],
|
|
137
|
+
setup(V, { emit: x }) {
|
|
138
|
+
const f = C(), { t: m } = P(), n = M(), d = D(), h = y(), o = y();
|
|
140
139
|
async function l() {
|
|
141
140
|
if (o.value)
|
|
142
141
|
try {
|
|
143
|
-
const
|
|
144
|
-
|
|
142
|
+
const s = await T.updateInfo(o.value);
|
|
143
|
+
p(s), f.open(
|
|
145
144
|
{
|
|
146
|
-
title:
|
|
145
|
+
title: m("mf-kitchen.template.save.success", { file: m("mf-kitchen.receiptTemplate") }),
|
|
147
146
|
type: "success"
|
|
148
147
|
},
|
|
149
148
|
2e3
|
|
150
149
|
);
|
|
151
150
|
} catch {
|
|
152
|
-
|
|
151
|
+
f.open(
|
|
153
152
|
{
|
|
154
|
-
title:
|
|
153
|
+
title: m("mf-kitchen.template.save.failed", { file: m("mf-kitchen.receiptTemplate") }),
|
|
155
154
|
type: "error"
|
|
156
155
|
},
|
|
157
156
|
3e3
|
|
158
157
|
);
|
|
159
158
|
}
|
|
160
159
|
}
|
|
160
|
+
const b = x;
|
|
161
161
|
function k() {
|
|
162
|
-
|
|
162
|
+
b("change-mode", "advance");
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
164
|
+
function p(s) {
|
|
165
|
+
h.value = s, o.value = s;
|
|
166
166
|
}
|
|
167
167
|
function v() {
|
|
168
|
-
o.value =
|
|
168
|
+
o.value = h.value;
|
|
169
169
|
}
|
|
170
170
|
return B(async () => {
|
|
171
171
|
try {
|
|
172
|
-
await n.readRestaurants(),
|
|
173
|
-
} catch (
|
|
174
|
-
|
|
172
|
+
await n.readRestaurants(), p(await T.readInfo());
|
|
173
|
+
} catch (s) {
|
|
174
|
+
f.open(
|
|
175
175
|
{
|
|
176
|
-
title:
|
|
177
|
-
message: `${
|
|
176
|
+
title: m("mf-kitchen.template.load.fail", { file: m("mf-kitchen.receiptTemplate") }),
|
|
177
|
+
message: `${s}`,
|
|
178
178
|
type: "error"
|
|
179
179
|
},
|
|
180
180
|
1e3
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
|
-
}), (
|
|
184
|
-
const
|
|
185
|
-
return g(), F("div",
|
|
186
|
-
i(
|
|
183
|
+
}), (s, e) => {
|
|
184
|
+
const t = c("FmButton");
|
|
185
|
+
return g(), F("div", J, [
|
|
186
|
+
i(E),
|
|
187
187
|
i(z, { onUpdateTemplate: l }),
|
|
188
|
-
|
|
189
|
-
o.value ? (g(), w(
|
|
188
|
+
r("div", K, [
|
|
189
|
+
o.value ? (g(), w(G, {
|
|
190
190
|
key: 0,
|
|
191
191
|
modelValue: o.value,
|
|
192
|
-
"onUpdate:modelValue":
|
|
192
|
+
"onUpdate:modelValue": e[0] || (e[0] = (u) => o.value = u),
|
|
193
193
|
onReset: v
|
|
194
194
|
}, null, 8, ["modelValue"])) : S("", !0),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
i(
|
|
195
|
+
r("div", L, [
|
|
196
|
+
r("div", X, [
|
|
197
|
+
r("label", Y, U(a(m)("mf-kitchen.templateBuilder")), 1),
|
|
198
|
+
i(t, {
|
|
199
199
|
variant: "secondary",
|
|
200
|
-
label: a(
|
|
200
|
+
label: a(m)("mf-kitchen.advanceBuilder"),
|
|
201
201
|
"text-color": "primary",
|
|
202
202
|
bgColor: "typo-white",
|
|
203
203
|
"border-color": "primary",
|
|
204
204
|
onClick: k
|
|
205
205
|
}, null, 8, ["label"])
|
|
206
206
|
]),
|
|
207
|
-
|
|
208
|
-
o.value && a(
|
|
207
|
+
r("div", Z, [
|
|
208
|
+
o.value && a(d).profile ? (g(), w(A, {
|
|
209
209
|
key: 0,
|
|
210
210
|
"receipt-info": o.value,
|
|
211
|
-
profile: a(
|
|
211
|
+
profile: a(d).profile
|
|
212
212
|
}, null, 8, ["receipt-info", "profile"])) : S("", !0)
|
|
213
213
|
])
|
|
214
214
|
])
|
|
@@ -218,5 +218,5 @@ const H = { class: "flex flex-col w-[420px]" }, Q = { class: "flex flex-col px-[
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
export {
|
|
221
|
-
|
|
221
|
+
ne as default
|
|
222
222
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as m, defineAsyncComponent as n, computed as p, openBlock as s, createBlock as d, resolveDynamicComponent as i } from "vue";
|
|
2
|
+
import { useRoute as l, useRouter as _ } from "vue-router";
|
|
3
|
+
const M = /* @__PURE__ */ m({
|
|
4
|
+
__name: "ReceiptTemplate",
|
|
5
|
+
setup(f) {
|
|
6
|
+
const t = l(), c = n(() => import("./NormalModeView-39415dd5.js")), r = n(() => import("./AdvanceModeView-1ae75ba9.js")), a = p(() => t.query.mode === "advance" ? r : c), o = _();
|
|
7
|
+
function u(e) {
|
|
8
|
+
o.replace({
|
|
9
|
+
name: o.currentRoute.value.name,
|
|
10
|
+
query: { mode: e }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return (e, v) => (s(), d(i(a.value), { onChangeMode: u }, null, 32));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
M as default
|
|
18
|
+
};
|
package/dist/app.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import enUS from './locales/en-US.json';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { routes } from '../src/router/shared';
|
|
3
|
+
export { default as FmApp } from './App.vue';
|
|
4
4
|
export type AppMessagesSchema = typeof enUS;
|
|
5
5
|
export declare const i18nMessages: {
|
|
6
6
|
'en-US': {
|
|
@@ -10,9 +10,9 @@ export declare const i18nMessages: {
|
|
|
10
10
|
advance: string;
|
|
11
11
|
advanceBuilder: string;
|
|
12
12
|
advanceTemplateBuilder: string;
|
|
13
|
-
cancel: string;
|
|
14
13
|
confirmation: string;
|
|
15
14
|
designPanel: string;
|
|
15
|
+
discard: string;
|
|
16
16
|
imageUpload: {
|
|
17
17
|
logoSizeError: string;
|
|
18
18
|
};
|
|
@@ -223,9 +223,9 @@ export declare const i18nMessages: {
|
|
|
223
223
|
advance: string;
|
|
224
224
|
advanceBuilder: string;
|
|
225
225
|
advanceTemplateBuilder: string;
|
|
226
|
-
cancel: string;
|
|
227
226
|
confirmation: string;
|
|
228
227
|
designPanel: string;
|
|
228
|
+
discard: string;
|
|
229
229
|
imageUpload: {
|
|
230
230
|
logoSizeError: string;
|
|
231
231
|
};
|
|
@@ -437,9 +437,9 @@ export declare const i18nMessages: {
|
|
|
437
437
|
advance: string;
|
|
438
438
|
advanceBuilder: string;
|
|
439
439
|
advanceTemplateBuilder: string;
|
|
440
|
-
cancel: string;
|
|
441
440
|
confirmation: string;
|
|
442
441
|
designPanel: string;
|
|
442
|
+
discard: string;
|
|
443
443
|
imageUpload: {
|
|
444
444
|
logoSizeError: string;
|
|
445
445
|
};
|