@feedmepos/mf-order-setting 0.0.103 → 0.0.104-dev.20261110T024506Z.42744594144

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 (44) hide show
  1. package/dist/{DisplaySystemView-BBiZqcWq.js → DisplaySystemView-BtsDEdHM.js} +4 -4
  2. package/dist/{FoodCourtInvitationsView-DwOkVs9m.js → FoodCourtInvitationsView-CofVm4YP.js} +4 -4
  3. package/dist/FoodCourtOrderSettingsView-CDDzCH-W.js +331 -0
  4. package/dist/{FoodCourtOrdersView-y4EwK3sn.js → FoodCourtOrdersView-Bk9Rka5U.js} +181 -164
  5. package/dist/{FoodCourtStallsView-Bi8H-yR7.js → FoodCourtStallsView-CJoDTT-a.js} +2 -2
  6. package/dist/{FoodCourtStatusView-jugAzTKg.js → FoodCourtStatusView-j_Qqg0oc.js} +1 -1
  7. package/dist/{KioskDevicesView-CYiew4X5.js → KioskDevicesView-Cls5T8NZ.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BCvbeo7R.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-C2qp_5SJ.js} +5 -5
  9. package/dist/{KioskSettingView-AKBiij9a.js → KioskSettingView-9hi_pXhq.js} +4 -4
  10. package/dist/{KioskView-zKB6mC8I.js → KioskView-KQTx844N.js} +8 -8
  11. package/dist/{OrderSettingsView-CoV_yX3m.js → OrderSettingsView-BN6tAn3v.js} +10 -10
  12. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-KSMU_jGl.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-BJtkgRxo.js} +1 -1
  13. package/dist/{app-CmuI6uSl.js → app-C1UzvC6h.js} +23 -23
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-B3MssMma.js → dayjs.min-TB6djsKd.js} +1 -1
  16. package/dist/{featureFlag-CWvkPOBY.js → featureFlag-2UDPLG42.js} +1 -1
  17. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +8 -0
  18. package/dist/frontend/mf-order/src/composables/useUnsavedChangesGuard.d.ts +12 -0
  19. package/dist/frontend/mf-order/src/views/food-court/FoodCourtDineInSetting.vue.d.ts +5 -1
  20. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/{index-CMOvrim4.js → index-CA6o-LDa.js} +1 -1
  22. package/dist/{index-Dup6kWLX.js → index-CYf3Q9YX.js} +2 -2
  23. package/dist/{index-BQa8AudZ.js → index-CuUawz8a.js} +1 -1
  24. package/dist/{index-D5qh2_4b.js → index-DNcaPV07.js} +1 -1
  25. package/dist/{index-wuFIsXHT.js → index-_wKPPeQ2.js} +4 -4
  26. package/dist/{order.dto-BD9raQG5.js → order.dto-BODz8kMn.js} +2 -2
  27. package/dist/package/entity/queue/queue.do.d.ts +1 -0
  28. package/dist/package/entity/queue/queue.dto.d.ts +7 -0
  29. package/dist/{useInternalUser-CHtaur9A.js → useInternalUser-BMSgaKC9.js} +1 -1
  30. package/package.json +1 -1
  31. package/src/api/food-court/index.ts +8 -0
  32. package/src/composables/useUnsavedChangesGuard.spec.ts +93 -0
  33. package/src/composables/useUnsavedChangesGuard.ts +32 -0
  34. package/src/locales/en-US.json +1 -1
  35. package/src/locales/ja-JP.json +1 -1
  36. package/src/locales/th-TH.json +1 -1
  37. package/src/locales/zh-CN.json +1 -1
  38. package/src/views/food-court/FoodCourtDineInSetting.spec.ts +94 -0
  39. package/src/views/food-court/FoodCourtDineInSetting.vue +15 -1
  40. package/src/views/food-court/FoodCourtOrderSettingsView.spec.ts +127 -0
  41. package/src/views/food-court/FoodCourtOrderSettingsView.vue +49 -3
  42. package/src/views/food-court/food-court-export.spec.ts +18 -8
  43. package/src/views/food-court/food-court-export.ts +23 -6
  44. package/dist/FoodCourtOrderSettingsView-C9Ag5Bsg.js +0 -294
@@ -2,13 +2,13 @@ import { ref as K, defineComponent as he, computed as V, watch as be, resolveCom
2
2
  import { useRoute as ts, useRouter as os } from "vue-router";
3
3
  import { useI18n as Pe, useCoreStore as nt, RestaurantSelector as as } from "@feedmepos/mf-common";
4
4
  import { u as Ja } from "./snackbar-DZQ0_reQ.js";
5
- import { D as Za } from "./order.dto-BD9raQG5.js";
5
+ import { D as Za } from "./order.dto-BODz8kMn.js";
6
6
  import { defineStore as ns } from "pinia";
7
- import { g as st, S as Ya, d as ss, c as so } from "./index-BQa8AudZ.js";
7
+ import { g as st, S as Ya, d as ss, c as so } from "./index-CuUawz8a.js";
8
8
  import { useDialogChild as ls, useDialog as Xa } from "@feedmepos/ui-library";
9
9
  import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- import { A as rs, v as Qa, u as is } from "./app-CmuI6uSl.js";
11
- import { u as ds, e as us } from "./featureFlag-CWvkPOBY.js";
10
+ import { A as rs, v as Qa, u as is } from "./app-C1UzvC6h.js";
11
+ import { u as ds, e as us } from "./featureFlag-2UDPLG42.js";
12
12
  function en(e) {
13
13
  return JSON.parse(JSON.stringify(e));
14
14
  }
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as P, resolveComponent as C, openBlock as l, createBlock as T, withCtx as E, createVNode as f, unref as a, createCommentVNode as I, ref as g, computed as S, watch as Y, createElementVNode as u, toDisplayString as v, createElementBlock as m, Fragment as J, withKeys as O, h as H, isRef as W } from "vue";
2
- import { d as Q } from "./dayjs.min-B3MssMma.js";
2
+ import { d as Q } from "./dayjs.min-TB6djsKd.js";
3
3
  import { useI18n as R, useCoreStore as X } from "@feedmepos/mf-common";
4
4
  import { useDialog as Z, components as ee } from "@feedmepos/ui-library";
5
5
  import { u as te } from "./snackbar-DZQ0_reQ.js";
6
6
  import { u as oe } from "./search-BAPEUu1R.js";
7
- import { g as B, b as q } from "./index-BQa8AudZ.js";
8
- import { f as ae } from "./index-CMOvrim4.js";
7
+ import { g as B, b as q } from "./index-CuUawz8a.js";
8
+ import { f as ae } from "./index-CA6o-LDa.js";
9
9
  import { i as ne, n as D, k as re, l as se, e as K, M as le, m as ie, o as ue } from "./food-court-member-joC8tmsI.js";
10
- import { _ as de } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-KSMU_jGl.js";
10
+ import { _ as de } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-BJtkgRxo.js";
11
11
  const U = () => q("/foodcourt-v2/join-codes"), V = {
12
12
  /** One item per court that has a row for this restaurant. */
13
13
  async listMemberships(p) {
@@ -0,0 +1,331 @@
1
+ import { onMounted as V, onBeforeUnmount as H, defineComponent as B, ref as w, computed as b, watch as oe, resolveComponent as c, unref as e, openBlock as v, createElementBlock as F, createElementVNode as l, toDisplayString as p, createVNode as m, createBlock as I, createCommentVNode as $, withCtx as A, Fragment as z } from "vue";
2
+ import { useDialog as te } from "@feedmepos/ui-library";
3
+ import { useI18n as U } from "@feedmepos/mf-common";
4
+ import { u as re } from "./useFoodCourtContext-2p5sJMcB.js";
5
+ import { onBeforeRouteLeave as ne } from "vue-router";
6
+ import { u as W } from "./index-Cmb4sEqq.js";
7
+ import { u as Q } from "./snackbar-DZQ0_reQ.js";
8
+ import { F as D } from "./index-CA6o-LDa.js";
9
+ function le(r, n) {
10
+ async function o() {
11
+ return !r.value || await n();
12
+ }
13
+ ne(o);
14
+ function f(a) {
15
+ r.value && (a.preventDefault(), a.returnValue = "");
16
+ }
17
+ return V(() => window.addEventListener("beforeunload", f)), H(() => window.removeEventListener("beforeunload", f)), { allowLeave: o };
18
+ }
19
+ const ae = { key: 0 }, se = { class: "p-[1.5rem] flex flex-col gap-5 m-5 w-2/3" }, de = { class: "flex-grow fm-typo-en-title-sm-600" }, ue = { class: "flex-grow fm-typo-en-title-sm-600 mt-16" }, ie = { class: "flex flex-col gap-2 fm-typo-en-body-md-400" }, ce = { class: "text-fm-color-typo-secondary" }, me = { class: "text-fm-color-typo-secondary" }, ve = { class: "fm-corner-radius-lg flex flex-col gap-5 m-5" }, fe = {
20
+ key: 2,
21
+ class: "p-[1.5rem] m-5 flex flex-col gap-3 items-start"
22
+ }, pe = { class: "fm-typo-en-body-md-400" }, _e = /* @__PURE__ */ B({
23
+ __name: "FoodCourtDineInSetting",
24
+ props: {
25
+ foodCourtId: {}
26
+ },
27
+ emits: ["dirty-change"],
28
+ setup(r, { emit: n }) {
29
+ const o = r, f = n, { t: a } = U(), { showSuccess: S } = Q(), { startAsyncCallWithErr: g, isLoading: t } = W(), s = w(), C = w(), h = b(
30
+ () => s.value !== void 0 && s.value.qrOrderingEnabled !== C.value
31
+ );
32
+ oe(h, (x) => f("dirty-change", x), { immediate: !0 }), H(() => f("dirty-change", !1));
33
+ const i = w(!1);
34
+ async function d() {
35
+ i.value = !1;
36
+ try {
37
+ s.value = await g(
38
+ () => D.getDineIn(o.foodCourtId)
39
+ ), C.value = s.value.qrOrderingEnabled;
40
+ } catch {
41
+ i.value = !0;
42
+ }
43
+ }
44
+ V(d);
45
+ async function k() {
46
+ if (!s.value) return;
47
+ const x = { qrOrderingEnabled: s.value.qrOrderingEnabled };
48
+ s.value = await g(
49
+ () => D.updateDineIn(o.foodCourtId, x)
50
+ ), C.value = s.value.qrOrderingEnabled, S(a("order.foodCourt.saved"));
51
+ }
52
+ return (x, _) => {
53
+ const O = c("FmSwitch"), T = c("FmButton"), R = c("FmCircularProgress");
54
+ return !e(t) && s.value ? (v(), F("div", ae, [
55
+ l("div", se, [
56
+ l("div", de, p(e(a)("order.generalSetting")), 1),
57
+ m(O, {
58
+ modelValue: s.value.qrOrderingEnabled,
59
+ "onUpdate:modelValue": _[0] || (_[0] = (u) => s.value.qrOrderingEnabled = u),
60
+ value: "qrOrderingEnabled",
61
+ label: e(a)("order.foodCourt.qrOrdering"),
62
+ sublabel: e(a)("order.foodCourt.qrOrderingSublabel"),
63
+ "label-placement": "right"
64
+ }, null, 8, ["modelValue", "label", "sublabel"]),
65
+ l("div", ue, p(e(a)("order.acceptedPayment")), 1),
66
+ l("div", ie, [
67
+ l("span", null, p(e(a)("order.foodCourt.acceptedPaymentOnline")), 1),
68
+ l("span", ce, p(e(a)("order.foodCourt.acceptedPaymentNotAccepted")), 1),
69
+ l("span", me, p(e(a)("order.foodCourt.acceptedPaymentSource")), 1)
70
+ ])
71
+ ]),
72
+ l("div", ve, [
73
+ m(T, {
74
+ variant: "primary",
75
+ label: e(a)("order.saveSetting"),
76
+ class: "mr-auto",
77
+ onClick: k
78
+ }, null, 8, ["label"])
79
+ ])
80
+ ])) : e(t) ? (v(), I(R, {
81
+ key: 1,
82
+ size: "xxl"
83
+ })) : i.value ? (v(), F("div", fe, [
84
+ l("span", pe, p(e(a)("order.foodCourt.loadFailed")), 1),
85
+ m(T, {
86
+ variant: "secondary",
87
+ label: e(a)("order.foodCourt.retry"),
88
+ onClick: d
89
+ }, null, 8, ["label"])
90
+ ])) : $("", !0);
91
+ };
92
+ }
93
+ }), X = "FC-", G = 3, N = { min: 2, max: 6 };
94
+ function P(r) {
95
+ return typeof r == "number" && Number.isInteger(r) && r >= N.min && r <= N.max;
96
+ }
97
+ function ge(r) {
98
+ const n = (o) => `${X}${String(o).padStart(r, "0")}`;
99
+ return { start: n(1), end: n(Math.pow(10, r) - 1) };
100
+ }
101
+ function L(r) {
102
+ return Math.pow(10, r) - 1;
103
+ }
104
+ function ye(r, n) {
105
+ return typeof r == "number" && Number.isInteger(r) && r >= 0 && r <= L(n);
106
+ }
107
+ function be(r, n) {
108
+ const o = r + 1 > L(n) ? 1 : r + 1;
109
+ return `${X}${String(o).padStart(n, "0")}`;
110
+ }
111
+ const Ce = { key: 0 }, he = { class: "p-[1.5rem] flex flex-col gap-5 m-5 mr-8 w-full max-w-4xl" }, xe = { class: "flex-grow fm-typo-en-title-sm-600" }, Fe = { class: "mr-9 grid grid-cols-1 md:grid-cols-2 gap-5" }, we = { class: "min-w-0" }, Se = { class: "bg-gray-50 p-3 rounded-lg border" }, ke = { class: "flex items-center gap-2" }, Ee = { class: "mr-9 grid grid-cols-1 md:grid-cols-2 gap-5" }, Ie = { class: "min-w-0" }, Oe = { class: "mt-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Te = { class: "mt-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, $e = { class: "fm-corner-radius-lg flex flex-col gap-5 m-5" }, De = {
112
+ key: 2,
113
+ class: "p-[1.5rem] m-5 flex flex-col gap-3 items-start"
114
+ }, Ne = { class: "fm-typo-en-body-md-400" }, Re = /* @__PURE__ */ B({
115
+ __name: "FoodCourtGeneralSetting",
116
+ props: {
117
+ foodCourtId: {}
118
+ },
119
+ setup(r) {
120
+ const n = r, { t: o } = U(), { showSuccess: f, showError: a } = Q(), { startAsyncCallWithErr: S, isLoading: g } = W(), t = w(), s = b(
121
+ () => {
122
+ var u;
123
+ return P((u = t.value) == null ? void 0 : u.digit) ? t.value.digit : G;
124
+ }
125
+ ), C = b(() => ge(s.value)), h = w(null), i = b(() => {
126
+ var u;
127
+ return (((u = t.value) == null ? void 0 : u.current) ?? null) !== h.value;
128
+ }), d = b(() => {
129
+ var u;
130
+ return ye((u = t.value) == null ? void 0 : u.current, s.value);
131
+ }), k = b(
132
+ () => o("order.foodCourt.currentNumberRule", { max: L(s.value) })
133
+ ), x = b(
134
+ () => be(d.value ? t.value.current : h.value ?? 0, s.value)
135
+ ), _ = w(!1);
136
+ async function O() {
137
+ _.value = !1;
138
+ try {
139
+ t.value = await S(
140
+ () => D.getOrderNumber(n.foodCourtId)
141
+ ), h.value = t.value.current ?? null;
142
+ } catch {
143
+ _.value = !0;
144
+ }
145
+ }
146
+ V(O);
147
+ function T(u) {
148
+ t.value && (t.value.resetTime = u ? "00:00" : null);
149
+ }
150
+ async function R() {
151
+ if (!t.value) return;
152
+ if (!P(t.value.digit)) {
153
+ a(o("order.foodCourt.numberOfDigitsRule"));
154
+ return;
155
+ }
156
+ if (i.value && !d.value) {
157
+ a(k.value);
158
+ return;
159
+ }
160
+ const u = {
161
+ digit: t.value.digit,
162
+ resetTime: t.value.resetTime ?? null,
163
+ ...i.value ? { current: t.value.current } : {}
164
+ };
165
+ t.value = await S(
166
+ () => D.updateOrderNumber(n.foodCourtId, u)
167
+ ), h.value = t.value.current ?? null, f(o("order.foodCourt.saved"));
168
+ }
169
+ return (u, E) => {
170
+ const j = c("FmSwitch"), J = c("FmIcon"), K = c("FmTooltip"), Y = c("FmTimePicker"), q = c("FmStepperField"), Z = c("FmCard"), M = c("FmButton"), ee = c("FmCircularProgress");
171
+ return !e(g) && t.value ? (v(), F("div", Ce, [
172
+ l("div", he, [
173
+ l("div", xe, p(e(o)("order.orderNumberSettings")), 1),
174
+ l("div", Fe, [
175
+ l("div", we, [
176
+ l("div", Se, [
177
+ l("div", ke, [
178
+ m(j, {
179
+ "model-value": !!t.value.resetTime,
180
+ label: e(o)("order.autoResetOrderNumber"),
181
+ "onUpdate:modelValue": T,
182
+ "label-placement": "right"
183
+ }, null, 8, ["model-value", "label"]),
184
+ m(K, {
185
+ content: e(o)("order.foodCourt.autoResetTooltip"),
186
+ zIndex: 1e3
187
+ }, {
188
+ default: A(() => [
189
+ m(J, {
190
+ name: "info",
191
+ size: "sm",
192
+ class: "cursor-help text-fm-color-neutral-gray-400"
193
+ })
194
+ ]),
195
+ _: 1
196
+ }, 8, ["content"])
197
+ ]),
198
+ t.value.resetTime ? (v(), I(Y, {
199
+ key: 0,
200
+ "model-value": t.value.resetTime,
201
+ "onUpdate:modelValue": E[0] || (E[0] = (y) => y && (t.value.resetTime = y)),
202
+ class: "mt-3"
203
+ }, null, 8, ["model-value"])) : $("", !0)
204
+ ])
205
+ ])
206
+ ]),
207
+ l("div", Ee, [
208
+ l("div", Ie, [
209
+ m(Z, {
210
+ variant: "outlined",
211
+ class: "p-3"
212
+ }, {
213
+ default: A(() => [
214
+ m(q, {
215
+ "model-value": t.value.digit,
216
+ label: e(o)("order.foodCourt.numberOfDigits"),
217
+ "onUpdate:modelValue": E[1] || (E[1] = (y) => t.value.digit = y),
218
+ "show-steppers": !1,
219
+ placeholder: String(e(G)),
220
+ rules: [() => {
221
+ var y;
222
+ return e(P)((y = t.value) == null ? void 0 : y.digit) || e(o)("order.foodCourt.numberOfDigitsRule");
223
+ }],
224
+ min: e(N).min,
225
+ max: e(N).max
226
+ }, null, 8, ["model-value", "label", "placeholder", "rules", "min", "max"]),
227
+ m(q, {
228
+ "model-value": t.value.current ?? null,
229
+ label: e(o)("order.currentNumber"),
230
+ "onUpdate:modelValue": E[2] || (E[2] = (y) => t.value.current = y),
231
+ "show-steppers": !1,
232
+ placeholder: "0",
233
+ rules: [() => !i.value || d.value || k.value],
234
+ min: 0,
235
+ class: "mt-3"
236
+ }, null, 8, ["model-value", "label", "rules"]),
237
+ l("div", Oe, p(e(o)("order.foodCourt.numberPreview", C.value)), 1),
238
+ l("div", Te, p(e(o)("order.foodCourt.nextNumber", { number: x.value })), 1)
239
+ ]),
240
+ _: 1
241
+ })
242
+ ])
243
+ ])
244
+ ]),
245
+ l("div", $e, [
246
+ m(M, {
247
+ variant: "primary",
248
+ label: e(o)("order.saveSetting"),
249
+ class: "mr-auto",
250
+ onClick: R
251
+ }, null, 8, ["label"])
252
+ ])
253
+ ])) : e(g) ? (v(), I(ee, {
254
+ key: 1,
255
+ size: "xxl"
256
+ })) : _.value ? (v(), F("div", De, [
257
+ l("span", Ne, p(e(o)("order.foodCourt.loadFailed")), 1),
258
+ m(M, {
259
+ variant: "secondary",
260
+ label: e(o)("order.foodCourt.retry"),
261
+ onClick: O
262
+ }, null, 8, ["label"])
263
+ ])) : $("", !0);
264
+ };
265
+ }
266
+ }), Pe = { class: "py-[1.5rem]" }, Ve = {
267
+ key: 0,
268
+ class: "flex px-[1.5rem] items-center"
269
+ }, Be = {
270
+ key: 1,
271
+ class: "px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary"
272
+ }, We = /* @__PURE__ */ B({
273
+ __name: "FoodCourtOrderSettingsView",
274
+ setup(r) {
275
+ const { t: n } = U(), o = re(), f = w("dinein"), a = w(!1), S = te();
276
+ let g;
277
+ function t() {
278
+ return g ?? (g = new Promise((i) => {
279
+ const d = S.open({
280
+ title: n("order.unsavedLeaveTitle"),
281
+ message: n("order.unsavedLeaveMessage"),
282
+ primaryActions: { text: n("order.unsavedLeaveConfirm"), variant: "destructive", close: !0 },
283
+ secondaryActions: { text: n("order.keepEditing"), variant: "tertiary", close: !0 }
284
+ });
285
+ d.onPrimary(() => i(!0)), d.onClose(() => setTimeout(() => i(!1), 0));
286
+ }).finally(() => g = void 0)), g;
287
+ }
288
+ const { allowLeave: s } = le(a, t), C = b({
289
+ get: () => f.value,
290
+ set: (i) => {
291
+ i !== f.value && s().then((d) => {
292
+ d && (a.value = !1, f.value = i);
293
+ });
294
+ }
295
+ }), h = b(() => [
296
+ { label: n("order.dineIn"), value: "dinein" },
297
+ { label: n("order.general"), value: "general" }
298
+ ]);
299
+ return (i, d) => {
300
+ const k = c("FmPageHead"), x = c("FmTabs");
301
+ return v(), F(z, null, [
302
+ l("div", Pe, [
303
+ m(k, {
304
+ title: e(n)("order.orderSetting"),
305
+ "line-height": 1.7
306
+ }, null, 8, ["title"]),
307
+ e(o) ? (v(), F("div", Ve, [
308
+ m(x, {
309
+ "model-value": C.value,
310
+ "onUpdate:modelValue": d[0] || (d[0] = (_) => C.value = _),
311
+ items: h.value
312
+ }, null, 8, ["model-value", "items"])
313
+ ])) : $("", !0)
314
+ ]),
315
+ e(o) ? (v(), F(z, { key: 0 }, [
316
+ f.value === "dinein" ? (v(), I(_e, {
317
+ key: `dinein-${e(o)}`,
318
+ "food-court-id": e(o),
319
+ onDirtyChange: d[1] || (d[1] = (_) => a.value = _)
320
+ }, null, 8, ["food-court-id"])) : (v(), I(Re, {
321
+ key: `general-${e(o)}`,
322
+ "food-court-id": e(o)
323
+ }, null, 8, ["food-court-id"]))
324
+ ], 64)) : (v(), F("div", Be, p(e(n)("order.foodCourt.noFoodCourt")), 1))
325
+ ], 64);
326
+ };
327
+ }
328
+ });
329
+ export {
330
+ We as default
331
+ };