@feedmepos/mf-menu 0.18.17 → 0.19.0-beta.2
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/ApplyProduct.vue_vue_type_script_setup_true_lang-DFJJHptK.js +158 -0
- package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BJ0b_uKf.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js} +2 -2
- package/dist/Catalog-CXzqtCF8.js +551 -0
- package/dist/Category-DKbtLbq8.js +387 -0
- package/dist/CookingGuide-BKon8TdH.js +862 -0
- package/dist/Group-D1UDksBG.js +46 -0
- package/dist/{Group-jEtbECLb.js → Group-izOWb_Bh.js} +1 -1
- package/dist/Group.vue_vue_type_script_setup_true_lang-DAlQcgYp.js +558 -0
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Q7es2wmt.js +237 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bw4uxqAp.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js} +11723 -11723
- package/dist/Ingredient-BIJu9P_9.js +484 -0
- package/dist/LinkProductSideSheet-BNdFZThd.js +104 -0
- package/dist/PrintRoute--fYPFcy7.js +417 -0
- package/dist/{Product-Bnr9oFr2.js → Product-vLtISbkD.js} +1 -1
- package/dist/Product.vue_vue_type_script_setup_true_lang-BHCihe6o.js +826 -0
- package/dist/Products-JaCNtcHS.js +236 -0
- package/dist/Publish-jpmiyB-b.js +525 -0
- package/dist/Recipe-B6y-oLPG.js +320 -0
- package/dist/Scheduler-Dj1rlr-U.js +222 -0
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BVAkohGJ.js +48 -0
- package/dist/ServingSequence-BhIfCyXl.js +4 -0
- package/dist/{Setting-DN8TQdIR.js → Setting-B5R1JfaL.js} +1 -1
- package/dist/Setting.vue_vue_type_script_setup_true_lang-xXtg0JOn.js +253 -0
- package/dist/Takeaway-BSFSz_JL.js +63 -0
- package/dist/{Takeaway-y0Nk0JAb.js → Takeaway-DjFTtbw6.js} +1 -1
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BUGL0wfZ.js +302 -0
- package/dist/TaxSetting-D9Q8XNgJ.js +25 -0
- package/dist/Unit-Cr_8O3zB.js +142 -0
- package/dist/Variant-loUMfNRB.js +222 -0
- package/dist/_id_-0w7KjYyQ.js +189 -0
- package/dist/{app-D7e31gIv.js → app-t9ONnc0s.js} +31701 -26207
- package/dist/app.js +7 -6
- package/dist/apps/mf-menu/src/app.d.ts +2784 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +1 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +1 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +16 -16
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +12 -12
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +4 -4
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +4 -4
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-D5tq3eE2.js → linked-status-DLL4aRiX.js} +8 -8
- package/dist/assets/{validate-menu-AcCpPyQZ.js → validate-menu-CoXc16jh.js} +8 -8
- package/dist/{catalog-Ck7lLTN2.js → catalog-4OmC0JA3.js} +66 -62
- package/dist/category-BE33DRqp.js +155 -0
- package/dist/{currency-CclA5a-2.js → currency-JHgYNbTQ.js} +1 -1
- package/dist/{index-DDd9B_ur.js → index-CE3zjhyh.js} +732 -740
- package/dist/index-pSg9p-28.js +238 -0
- package/dist/item-CEPx51U1.js +6371 -0
- package/dist/{lodash-BIQx_fko.js → lodash-VivR_BQ2.js} +1 -1
- package/dist/{menu-CYzbNubv.js → menu-ETQrtbbU.js} +1 -1
- package/dist/{object-DUtbNpoS.js → object-DEM5FMTB.js} +4 -4
- package/dist/scheduler-SRT_5Nio.js +491 -0
- package/dist/string-DpfFixWH.js +4 -0
- package/dist/style.css +1 -1
- package/dist/takeaway-RcvqKigG.js +267 -0
- package/dist/{toExcel-BXPcj8Gp.js → toExcel-BcgskY3F.js} +2 -2
- package/dist/unit-DLL7xIF1.js +350 -0
- package/package.json +4 -2
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-D9QsJ4vO.js +0 -155
- package/dist/Catalog-CZW54QJU.js +0 -570
- package/dist/Category-DvsP_L7d.js +0 -405
- package/dist/CookingGuide-DC3uXetk.js +0 -848
- package/dist/Group-DK5xqeYX.js +0 -44
- package/dist/Group.vue_vue_type_script_setup_true_lang-DGZ9hnPg.js +0 -538
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BQXqlXw4.js +0 -234
- package/dist/Ingredient-354LLwdX.js +0 -498
- package/dist/LinkProductSideSheet-anxSsu0z.js +0 -102
- package/dist/PrintRoute-DrSvtNLX.js +0 -425
- package/dist/Product.vue_vue_type_script_setup_true_lang-bBY54Q_1.js +0 -815
- package/dist/Products-CZyueqSO.js +0 -234
- package/dist/Publish-kRM1UuPk.js +0 -518
- package/dist/Recipe-nKpLIJs8.js +0 -345
- package/dist/Scheduler-DmZ8atXG.js +0 -233
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-CdsxA-p0.js +0 -48
- package/dist/ServingSequence-j00_ko5R.js +0 -4
- package/dist/Setting.vue_vue_type_script_setup_true_lang-Cx06MCJs.js +0 -247
- package/dist/Takeaway-BXZXCAaM.js +0 -61
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-9WVkdLZF.js +0 -316
- package/dist/TaxSetting-DdHx7ACN.js +0 -21
- package/dist/Unit-biPvleyL.js +0 -161
- package/dist/Variant-BP1IRNQx.js +0 -231
- package/dist/_id_-BiaNDI2N.js +0 -188
- package/dist/category-KiA5-36F.js +0 -154
- package/dist/index-BFeZlU8X.js +0 -232
- package/dist/item-Bcg7SiYv.js +0 -6325
- package/dist/scheduler-D1tgE0_9.js +0 -480
- package/dist/takeaway-BKsoD4EL.js +0 -264
- package/dist/unit-CswFvAyc.js +0 -346
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { defineComponent as Q, ref as k, computed as p, resolveComponent as g, openBlock as d, createElementBlock as w, Fragment as D, createVNode as i, unref as a, withCtx as _, createElementVNode as s, toDisplayString as M, createBlock as U, renderList as Y, createCommentVNode as W, h as m, withModifiers as G } from "vue";
|
|
2
|
+
import { d as H, n as X, b as C, h as q, u as te, i as ne, a as oe, _ as ae, f as le, k as re, j as se } from "./app-t9ONnc0s.js";
|
|
3
|
+
import { components as Z, useSnackbar as ie, useDialog as ue } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as de } from "./ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js";
|
|
5
|
+
import "@feedmepos/mf-common";
|
|
6
|
+
import { _ as J } from "./FormSection.vue_vue_type_script_setup_true_lang-BWJUD8NZ.js";
|
|
7
|
+
import { u as ce, l as me } from "./lodash-VivR_BQ2.js";
|
|
8
|
+
const pe = { class: "fm-typo-en-title-md-600" }, _e = { class: "space-y-32" }, fe = { class: "space-y-16" }, ve = { class: "flex items-center gap-8" }, ye = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ge = { class: "flex-1" }, he = { class: "grow overflow-y-auto" }, be = { class: "text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 px-16 py-8 border-b border-b-fm-color-neutral-gray-200" }, ke = { class: "flex items-center border-b border-b-fm-color-neutral-gray-100" }, xe = { class: "px-16 py-8 flex-1" }, Fe = { class: "py-8" }, Ie = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ Q({
|
|
9
|
+
__name: "PrintDepartmentDialog",
|
|
10
|
+
props: {
|
|
11
|
+
categorizedItems: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
canApplyItems: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
emits: ["onSave"],
|
|
21
|
+
setup(f, { expose: n, emit: y }) {
|
|
22
|
+
const N = f;
|
|
23
|
+
n({
|
|
24
|
+
showModal: R,
|
|
25
|
+
hideModal: V
|
|
26
|
+
});
|
|
27
|
+
function h() {
|
|
28
|
+
return {
|
|
29
|
+
_id: "",
|
|
30
|
+
name: "",
|
|
31
|
+
applyToItems: []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const b = k(!1), L = k(void 0);
|
|
35
|
+
function R(t) {
|
|
36
|
+
L.value = t ? H(t) : h(), l.value = H(L.value), b.value = !0;
|
|
37
|
+
}
|
|
38
|
+
function V() {
|
|
39
|
+
b.value = !1;
|
|
40
|
+
}
|
|
41
|
+
const l = k(h());
|
|
42
|
+
function x(t) {
|
|
43
|
+
l.value = {
|
|
44
|
+
...l.value,
|
|
45
|
+
applyToItems: Object.keys(t)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function K(t) {
|
|
49
|
+
l.value = {
|
|
50
|
+
...l.value,
|
|
51
|
+
applyToItems: l.value.applyToItems.filter((u) => u !== t)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const { t: r } = X(), S = p(() => l.value._id ? r("menu.print_route.department_dialog.update.title") : r("menu.print_route.department_dialog.add.title")), F = p(() => l.value._id ? r("menu.print_route.department_dialog.update.action") : r("menu.print_route.department_dialog.add.action")), O = p(() => l.value.applyToItems.length), $ = p(
|
|
55
|
+
() => l.value.applyToItems.reduce((t, u) => (t[u] = [], t), {})
|
|
56
|
+
), e = k(""), o = p(() => {
|
|
57
|
+
const t = e.value.toLowerCase();
|
|
58
|
+
return N.categorizedItems.reduce((u, z) => {
|
|
59
|
+
const I = z.items.filter(
|
|
60
|
+
(A) => (!t || A.name.toLowerCase().includes(t)) && !!$.value[A._id]
|
|
61
|
+
);
|
|
62
|
+
return I.length && u.push({ ...z, items: I }), u;
|
|
63
|
+
}, []);
|
|
64
|
+
}), c = k();
|
|
65
|
+
function P() {
|
|
66
|
+
var t;
|
|
67
|
+
(t = c.value) == null || t.show($.value);
|
|
68
|
+
}
|
|
69
|
+
const T = y;
|
|
70
|
+
k();
|
|
71
|
+
const E = ce(
|
|
72
|
+
() => !me.isEqual(L.value, l.value),
|
|
73
|
+
() => {
|
|
74
|
+
b.value = !1;
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
function B() {
|
|
78
|
+
V(), T("onSave", l.value);
|
|
79
|
+
}
|
|
80
|
+
return (t, u) => {
|
|
81
|
+
const z = g("FmTextField"), I = g("FmButton"), A = g("FmSearch"), ee = g("FmSideSheet");
|
|
82
|
+
return d(), w(D, null, [
|
|
83
|
+
i(ee, {
|
|
84
|
+
modelValue: b.value,
|
|
85
|
+
"onUpdate:modelValue": u[2] || (u[2] = (v) => b.value = v),
|
|
86
|
+
header: S.value,
|
|
87
|
+
"max-width": 560,
|
|
88
|
+
"is-container": a(Z).FmForm,
|
|
89
|
+
"is-container-props": {
|
|
90
|
+
onValidationSuccess: B,
|
|
91
|
+
blameFormChildOnValidationFailed: !0,
|
|
92
|
+
class: "flex flex-col h-full"
|
|
93
|
+
},
|
|
94
|
+
"onOn:clickedAway": a(E)
|
|
95
|
+
}, {
|
|
96
|
+
"side-sheet-header": _(() => [
|
|
97
|
+
s("span", pe, M(S.value), 1)
|
|
98
|
+
]),
|
|
99
|
+
"side-sheet-footer": _(() => [
|
|
100
|
+
s("div", Ie, [
|
|
101
|
+
i(I, {
|
|
102
|
+
label: F.value,
|
|
103
|
+
size: "lg",
|
|
104
|
+
variant: "primary",
|
|
105
|
+
type: "submit"
|
|
106
|
+
}, null, 8, ["label"]),
|
|
107
|
+
i(I, {
|
|
108
|
+
label: a(r)("menu.print_route.department_dialog.actions.cancel"),
|
|
109
|
+
size: "lg",
|
|
110
|
+
variant: "tertiary",
|
|
111
|
+
onClick: V
|
|
112
|
+
}, null, 8, ["label"])
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
default: _(() => [
|
|
116
|
+
s("div", _e, [
|
|
117
|
+
i(J, {
|
|
118
|
+
title: a(r)("menu.print_route.department_dialog.sections.route_detail.title")
|
|
119
|
+
}, {
|
|
120
|
+
default: _(() => [
|
|
121
|
+
i(z, {
|
|
122
|
+
autofocus: "",
|
|
123
|
+
modelValue: l.value.name,
|
|
124
|
+
"onUpdate:modelValue": u[0] || (u[0] = (v) => l.value.name = v),
|
|
125
|
+
rules: [
|
|
126
|
+
(v) => !!v || a(r)("menu.print_route.department_dialog.sections.route_detail.name.required")
|
|
127
|
+
],
|
|
128
|
+
label: a(r)("menu.print_route.department_dialog.sections.route_detail.name.label"),
|
|
129
|
+
placeholder: a(r)("menu.print_route.department_dialog.sections.route_detail.name.placeholder")
|
|
130
|
+
}, null, 8, ["modelValue", "rules", "label", "placeholder"])
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 8, ["title"]),
|
|
134
|
+
f.canApplyItems ? (d(), U(J, {
|
|
135
|
+
key: 0,
|
|
136
|
+
title: a(r)("menu.print_route.department_dialog.sections.link_product.title")
|
|
137
|
+
}, {
|
|
138
|
+
"append-title": _(() => [
|
|
139
|
+
i(I, {
|
|
140
|
+
icon: "link",
|
|
141
|
+
label: a(r)("menu.print_route.department_dialog.sections.link_product.link"),
|
|
142
|
+
variant: "secondary",
|
|
143
|
+
"text-color": "primary",
|
|
144
|
+
"border-color": "primary",
|
|
145
|
+
onClick: P
|
|
146
|
+
}, null, 8, ["label"])
|
|
147
|
+
]),
|
|
148
|
+
default: _(() => [
|
|
149
|
+
s("div", fe, [
|
|
150
|
+
s("div", ve, [
|
|
151
|
+
s("div", ye, M(a(r)("menu.print_route.department_dialog.sections.link_product.products_linked", {
|
|
152
|
+
count: O.value
|
|
153
|
+
})), 1),
|
|
154
|
+
s("div", ge, [
|
|
155
|
+
i(A, {
|
|
156
|
+
modelValue: e.value,
|
|
157
|
+
"onUpdate:modelValue": u[1] || (u[1] = (v) => e.value = v),
|
|
158
|
+
placeholder: a(r)("menu.print_route.department_dialog.sections.link_product.search")
|
|
159
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
s("div", he, [
|
|
163
|
+
(d(!0), w(D, null, Y(o.value, (v) => (d(), w("div", null, [
|
|
164
|
+
s("div", be, M(v.name), 1),
|
|
165
|
+
(d(!0), w(D, null, Y(v.items, (j) => (d(), w("div", ke, [
|
|
166
|
+
s("div", xe, M(j.name), 1),
|
|
167
|
+
s("div", Fe, [
|
|
168
|
+
i(I, {
|
|
169
|
+
icon: "delete",
|
|
170
|
+
variant: "tertiary",
|
|
171
|
+
"text-color": "neutral-gray-400",
|
|
172
|
+
onClick: () => K(j._id)
|
|
173
|
+
}, null, 8, ["onClick"])
|
|
174
|
+
])
|
|
175
|
+
]))), 256))
|
|
176
|
+
]))), 256))
|
|
177
|
+
])
|
|
178
|
+
])
|
|
179
|
+
]),
|
|
180
|
+
_: 1
|
|
181
|
+
}, 8, ["title"])) : W("", !0)
|
|
182
|
+
])
|
|
183
|
+
]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, ["modelValue", "header", "is-container", "is-container-props", "onOn:clickedAway"]),
|
|
186
|
+
i(de, {
|
|
187
|
+
ref_key: "applyProductRef",
|
|
188
|
+
ref: c,
|
|
189
|
+
"can-select-variant": !1,
|
|
190
|
+
options: f.categorizedItems,
|
|
191
|
+
title: a(r)("menu.print_route.department_dialog.sections.link_product.title"),
|
|
192
|
+
onOnComplete: x
|
|
193
|
+
}, null, 8, ["options", "title"])
|
|
194
|
+
], 64);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
function Ce(f, n) {
|
|
199
|
+
return {
|
|
200
|
+
module: C.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
201
|
+
operation: q.F_OPERATION_TYPE.create,
|
|
202
|
+
data: C.FdoMenuPrintDepartment.parse(f),
|
|
203
|
+
link: n.map((y) => ({
|
|
204
|
+
module: C.F_MENU_MODULE_V4_KEY.enum.item,
|
|
205
|
+
id: y
|
|
206
|
+
}))
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function Ve(f, n) {
|
|
210
|
+
return {
|
|
211
|
+
module: C.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
212
|
+
operation: q.F_OPERATION_TYPE.update,
|
|
213
|
+
data: C.FdoMenuPrintDepartment.parse(f),
|
|
214
|
+
link: n.map((y) => ({
|
|
215
|
+
module: C.F_MENU_MODULE_V4_KEY.enum.item,
|
|
216
|
+
id: y
|
|
217
|
+
}))
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function Pe(f) {
|
|
221
|
+
return {
|
|
222
|
+
module: C.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
223
|
+
operation: q.F_OPERATION_TYPE.delete,
|
|
224
|
+
data: f._id
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const Te = {
|
|
228
|
+
class: "flex flex-1 justify-end"
|
|
229
|
+
}, Ee = {
|
|
230
|
+
class: "flex justify-end items-center"
|
|
231
|
+
}, Me = {
|
|
232
|
+
class: "grow space-y-4"
|
|
233
|
+
}, Le = {
|
|
234
|
+
class: "fm-typo-en-body-lg-600"
|
|
235
|
+
}, Se = {
|
|
236
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
237
|
+
}, Ne = /* @__PURE__ */ Q({
|
|
238
|
+
__name: "PrintRoute",
|
|
239
|
+
setup(f) {
|
|
240
|
+
const {
|
|
241
|
+
t: n
|
|
242
|
+
} = X(), y = te(), N = p(() => y.categorizedRawMenuItems), h = p(() => {
|
|
243
|
+
const e = y.state.menu.modules.item;
|
|
244
|
+
return y.printDepartments.map((c) => ({
|
|
245
|
+
...c,
|
|
246
|
+
applyToItems: e.reduce((P, T) => {
|
|
247
|
+
var E;
|
|
248
|
+
return (E = T.print) != null && E.department.includes(c._id) && P.push(T), P;
|
|
249
|
+
}, [])
|
|
250
|
+
}), []);
|
|
251
|
+
}), b = p(() => h.value.length > 0), L = p(() => [{
|
|
252
|
+
accessorKey: "name",
|
|
253
|
+
header: () => n("menu.print_route.table.columns.name"),
|
|
254
|
+
cell: (e) => e.getValue(),
|
|
255
|
+
enableSorting: !1
|
|
256
|
+
}, {
|
|
257
|
+
accessorKey: "applyToItems",
|
|
258
|
+
header: () => n("menu.print_route.table.columns.products"),
|
|
259
|
+
cell: (e) => {
|
|
260
|
+
const o = e.getValue();
|
|
261
|
+
return n("menu.print_route.table.columns.products_count", {
|
|
262
|
+
count: o.length
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
enableSorting: !1
|
|
266
|
+
}, {
|
|
267
|
+
accessorKey: "_id",
|
|
268
|
+
header: "",
|
|
269
|
+
size: 52,
|
|
270
|
+
meta: {
|
|
271
|
+
cellClass: "pl-16",
|
|
272
|
+
headerContentClass: "-mx-16"
|
|
273
|
+
},
|
|
274
|
+
enableSorting: !1,
|
|
275
|
+
cell: (e) => m("div", {
|
|
276
|
+
class: "flex justify-end"
|
|
277
|
+
}, [m(Z.FmButton, {
|
|
278
|
+
icon: "delete",
|
|
279
|
+
textColor: "neutral-gray-400",
|
|
280
|
+
variant: "tertiary",
|
|
281
|
+
onClick: G(() => {
|
|
282
|
+
S(e.row.original);
|
|
283
|
+
}, ["stop", "prevent"])
|
|
284
|
+
})])
|
|
285
|
+
}]);
|
|
286
|
+
function R() {
|
|
287
|
+
var e;
|
|
288
|
+
x.value || (e = O.value) == null || e.showModal();
|
|
289
|
+
}
|
|
290
|
+
function V(e) {
|
|
291
|
+
var o;
|
|
292
|
+
x.value || (o = O.value) == null || o.showModal({
|
|
293
|
+
...e,
|
|
294
|
+
applyToItems: e.applyToItems.map(({
|
|
295
|
+
_id: c
|
|
296
|
+
}) => c)
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
const l = ne(oe(ie())), x = p(() => l.checkMenuIsLoading());
|
|
300
|
+
async function K(e) {
|
|
301
|
+
const o = e._id ? Ve(e, e.applyToItems) : Ce(e, e.applyToItems);
|
|
302
|
+
await l.updateMenu(o, e.name);
|
|
303
|
+
}
|
|
304
|
+
const r = ue();
|
|
305
|
+
function S(e) {
|
|
306
|
+
let o = [m("span", n("menu.print_route.dialogs.remove.message.prefix")), m("span", {
|
|
307
|
+
class: "fm-typo-en-body-lg-600"
|
|
308
|
+
}, e.name), m("span", "?")];
|
|
309
|
+
e.applyToItems.length && (o = [m("span", n("menu.print_route.dialogs.remove.message.products_using")), m("span", {
|
|
310
|
+
class: "fm-typo-en-body-lg-600"
|
|
311
|
+
}, e.applyToItems.length), m("span", n("menu.print_route.dialogs.remove.message.products_count")), ...o, m("div", {
|
|
312
|
+
class: "mt-8 fm-typo-en-body-md-400"
|
|
313
|
+
}, e.applyToItems.map((c) => m("li", {
|
|
314
|
+
class: "mt-4"
|
|
315
|
+
}, c.name)))]), r.open({
|
|
316
|
+
title: n("menu.print_route.dialogs.remove.title"),
|
|
317
|
+
contentComponent: m("div", o),
|
|
318
|
+
primaryActions: {
|
|
319
|
+
text: n("menu.print_route.actions.remove"),
|
|
320
|
+
close: !0,
|
|
321
|
+
variant: "destructive"
|
|
322
|
+
},
|
|
323
|
+
secondaryActions: {
|
|
324
|
+
text: n("menu.print_route.actions.cancel"),
|
|
325
|
+
close: !0
|
|
326
|
+
}
|
|
327
|
+
}).onPrimary(async () => {
|
|
328
|
+
await l.updateMenu(Pe(e), e.name, !0);
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
const F = k(""), O = k(), $ = p(() => {
|
|
332
|
+
if (!F.value) return h.value;
|
|
333
|
+
const e = F.value.toLowerCase();
|
|
334
|
+
return h.value.filter((o) => o.name.toLowerCase().includes(e));
|
|
335
|
+
});
|
|
336
|
+
return (e, o) => {
|
|
337
|
+
const c = g("FmSearch"), P = g("FmTable"), T = g("FmButton"), E = g("FmListItem"), B = g("FmList");
|
|
338
|
+
return d(), U(ae, {
|
|
339
|
+
heading: a(n)("menu.print_route.title")
|
|
340
|
+
}, {
|
|
341
|
+
"append-heading": _(() => [s("div", Te, [b.value ? (d(), U(le, {
|
|
342
|
+
key: 0,
|
|
343
|
+
disabled: x.value,
|
|
344
|
+
icon: "add",
|
|
345
|
+
label: a(n)("menu.print_route.actions.add"),
|
|
346
|
+
variant: "primary",
|
|
347
|
+
onClick: R
|
|
348
|
+
}, null, 8, ["disabled", "label"])) : W("", !0)])]),
|
|
349
|
+
default: _(() => [b.value ? (d(), w(D, {
|
|
350
|
+
key: 1
|
|
351
|
+
}, [s("div", Ee, [i(c, {
|
|
352
|
+
autofocus: "",
|
|
353
|
+
modelValue: F.value,
|
|
354
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => F.value = t),
|
|
355
|
+
class: "my-8 w-[320px] xs:w-full xs:px-16",
|
|
356
|
+
placeholder: a(n)("menu.print_route.table.search.placeholder")
|
|
357
|
+
}, null, 8, ["modelValue", "placeholder"])]), i(se, {
|
|
358
|
+
class: "xs:hidden block"
|
|
359
|
+
}, {
|
|
360
|
+
default: _(() => [i(P, {
|
|
361
|
+
"column-defs": L.value,
|
|
362
|
+
loading: x.value,
|
|
363
|
+
"page-size": h.value.length,
|
|
364
|
+
"row-data": h.value,
|
|
365
|
+
"search-value": F.value,
|
|
366
|
+
shrinkAt: !1,
|
|
367
|
+
"hide-footer": "",
|
|
368
|
+
"pin-header-row": "",
|
|
369
|
+
onRowClick: o[1] || (o[1] = (t) => V(t.original))
|
|
370
|
+
}, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
|
|
371
|
+
_: 1
|
|
372
|
+
}), i(B, {
|
|
373
|
+
class: "w-full px-16 xs:block hidden flex-1 min-h-0 overflow-scroll pb-64",
|
|
374
|
+
separator: ""
|
|
375
|
+
}, {
|
|
376
|
+
default: _(() => [(d(!0), w(D, null, Y($.value, (t) => (d(), U(E, {
|
|
377
|
+
key: t._id,
|
|
378
|
+
label: t.name,
|
|
379
|
+
style: {
|
|
380
|
+
padding: "12px 0 !important"
|
|
381
|
+
},
|
|
382
|
+
onClick: () => V(t)
|
|
383
|
+
}, {
|
|
384
|
+
default: _(() => [s("div", Me, [s("div", Le, M(t.name), 1), s("div", Se, M(a(n)("menu.print_route.table.mobile.products_linked", {
|
|
385
|
+
count: t.applyToItems.length
|
|
386
|
+
})), 1)]), i(T, {
|
|
387
|
+
disabled: x.value,
|
|
388
|
+
icon: "delete",
|
|
389
|
+
variant: "tertiary",
|
|
390
|
+
"text-color": "neutral-gray-400",
|
|
391
|
+
onClick: G(() => S(t), ["stop"])
|
|
392
|
+
}, null, 8, ["disabled", "onClick"])]),
|
|
393
|
+
_: 2
|
|
394
|
+
}, 1032, ["label", "onClick"]))), 128))]),
|
|
395
|
+
_: 1
|
|
396
|
+
})], 64)) : (d(), U(a(re), {
|
|
397
|
+
key: 0,
|
|
398
|
+
action: {
|
|
399
|
+
text: a(n)("menu.print_route.empty.action"),
|
|
400
|
+
callback: R
|
|
401
|
+
},
|
|
402
|
+
subtitle: a(n)("menu.print_route.empty.subtitle"),
|
|
403
|
+
title: a(n)("menu.print_route.empty.title")
|
|
404
|
+
}, null, 8, ["action", "subtitle", "title"])), i(we, {
|
|
405
|
+
ref_key: "printDepartmentRef",
|
|
406
|
+
ref: O,
|
|
407
|
+
"categorized-items": N.value,
|
|
408
|
+
onOnSave: K
|
|
409
|
+
}, null, 8, ["categorized-items"])]),
|
|
410
|
+
_: 1
|
|
411
|
+
}, 8, ["heading"]);
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
export {
|
|
416
|
+
Ne as default
|
|
417
|
+
};
|